[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[creduce-bugs] clang delta crash



I ran into this crash with creduce
172b0074fe9444ce79d7177b6c32a9c5731f036e. Hopefully it's easy to fix.

-Jeff
# 1 "<built-in>" 1
#if 0 /* expanded by -frewrite-includes */
#endif /* expanded by -frewrite-includes */
# 1 "../../mozilla-config.h" 1
/* List of defines generated by configure. Included with preprocessor flag,
 * -include, to avoid long list of -D defines on the compile command-line.
 * Do not edit.
 */

#ifndef MOZILLA_CONFIG_H
#define MOZILLA_CONFIG_H

#if defined(__clang__)
#pragma clang diagnostic push
#if __has_warning("-Wreserved-id-macro")
#pragma clang diagnostic ignored "-Wreserved-id-macro"
#endif
# 14 "../../mozilla-config.h"
#endif
# 15 "../../mozilla-config.h"

#define A11Y_LOG 1
#define ACCESSIBILITY 1
#define ATTRIBUTE_ALIGNED_MAX 64
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
#if !defined(__STDC_FORMAT_MACROS)
#define __STDC_FORMAT_MACROS
#endif
# 156 "../../mozilla-config.h"

#if defined(__clang__)
#pragma clang diagnostic pop
#endif
# 160 "../../mozilla-config.h"

/*
 * Force-include Char16.h in order to define PRUnichar as char16_t everywhere.
 * Note that this should be the first #include to make sure that prtypes.h does
 * not attempt to define PRUnichar.  This includes the following hunspell-specific
 * includes.
 *
 * We don't use this to build elfhack and elf-dynstr-gc since those builds happen
 * during the export tier.  Also, disable this when building assembly files too.
 */
#if !defined(ELFHACK_BUILD) && !defined(__ASSEMBLER__)
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Char16.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Char16.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Implements a UTF-16 character type. */

#ifndef mozilla_Char16_h
#define mozilla_Char16_h

#ifdef __cplusplus

/*
 * C++11 introduces a char16_t type and support for UTF-16 string and character
 * literals. C++11's char16_t is a distinct builtin type. Technically, char16_t
 * is a 16-bit code unit of a Unicode code point, not a "character".
 */

#if defined(_MSC_VER) && _MSC_VER < 1900
   /*
    * C++11 says char16_t is a distinct builtin type, but Windows's yvals.h
    * char32_t type, so we have to undo that damage here and provide our own,
    * which is identical to the yvals.h type.
    */
#  define MOZ_UTF16_HELPER(s) L##s
#  define _CHAR16T
typedef wchar_t char16_t;
typedef unsigned int char32_t;
#else
# 39 "../../dist/include/mozilla/Char16.h"
   /* C++11 has a builtin char16_t type. */
#  define MOZ_UTF16_HELPER(s) u##s
   /**
    * This macro is used to distinguish when char16_t would be a distinct
    * typedef from wchar_t.
    */
#  define MOZ_CHAR16_IS_NOT_WCHAR
#endif
# 220 "../../dist/include/mozilla/Char16.h"

/*
 * Macro arguments used in concatenation or stringification won't be expanded.
 * Therefore, in order for |MOZ_UTF16(FOO)| to work as expected (which is to
 * expand |FOO| before doing whatever |MOZ_UTF16| needs to do to it) a helper
 * macro, |MOZ_UTF16_HELPER| needs to be inserted in between to allow the macro
 * argument to expand. See "3.10.6 Separate Expansion of Macro Arguments" of the
 * CPP manual for a more accurate and precise explanation.
 */
#define MOZ_UTF16(s) MOZ_UTF16_HELPER(s)

static_assert(sizeof(char16_t) == 2, "Is char16_t type 16 bits?");
static_assert(char16_t(-1) > char16_t(0), "Is char16_t type unsigned?");
static_assert(sizeof(MOZ_UTF16('A')) == 2, "Is char literal 16 bits?");
static_assert(sizeof(MOZ_UTF16("")[0]) == 2, "Is string char 16 bits?");

#endif
# 237 "../../dist/include/mozilla/Char16.h"

#endif /* mozilla_Char16_h */
# 239 "../../dist/include/mozilla/Char16.h"
# 172 "../../mozilla-config.h" 2
#endif
# 173 "../../mozilla-config.h"

/*
 * Force-include hunspell_alloc_hooks.h and hunspell_fopen_hooks.h for hunspell,
 * so that we don't need to modify them directly.
 *
 * HUNSPELL_STATIC is defined in extensions/spellcheck/hunspell/src/Makefile.in,
 *
 * CHROMIUM_SANDBOX_BUILD is defined in security/sandbox/moz.build.
 * Note that this include path relies on the LOCAL_INCLUDES in that file.
 */
#if defined(CHROMIUM_SANDBOX_BUILD) && defined(XP_WIN)
#if 0 /* expanded by -frewrite-includes */
#include "base/win/sdkdecls.h"
#endif /* expanded by -frewrite-includes */
# 194 "../../mozilla-config.h"
#endif
# 195 "../../mozilla-config.h"

#endif /* MOZILLA_CONFIG_H */
# 197 "../../mozilla-config.h"
# 1 "<built-in>" 2
# 1 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 1
# 1 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef CanvasRenderingContext2D_h
#define CanvasRenderingContext2D_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Attributes.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Implementations of various class and method modifier attributes. */

#ifndef mozilla_Attributes_h
#define mozilla_Attributes_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Compiler.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Compiler.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Various compiler checks. */

#ifndef mozilla_Compiler_h
#define mozilla_Compiler_h

#define MOZ_IS_GCC 0
#define MOS_IS_MSVC 0

#if !defined(__clang__) && defined(__GNUC__)

#  undef MOZ_IS_GCC
#  define MOZ_IS_GCC 1
   /*
    * This macro should simplify gcc version checking. For example, to check
    * for gcc 4.7.1 or later, check `#if MOZ_GCC_VERSION_AT_LEAST(4, 7, 1)`.
    */
#  define MOZ_GCC_VERSION_AT_LEAST(major, minor, patchlevel)          \
     ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) \
      >= ((major) * 10000 + (minor) * 100 + (patchlevel)))
#  if !MOZ_GCC_VERSION_AT_LEAST(4, 6, 0)
#    error "mfbt (and Gecko) require at least gcc 4.6 to build."
#  endif
# 29 "../../dist/include/mozilla/Compiler.h"

#elif defined(_MSC_VER)
# 31 "../../dist/include/mozilla/Compiler.h"

#  undef MOZ_IS_MSVC
#  define MOZ_IS_MSVC 1

#endif
# 36 "../../dist/include/mozilla/Compiler.h"

/*
 * The situation with standard libraries is a lot worse than with compilers,
 * particularly as clang and gcc could end up using one of three or so standard
 * libraries, and they may not be up-to-snuff with newer C++11 versions. To
 * detect the library, we're going to include cstddef (which is a small header
 * which will be transitively included by everybody else at some point) to grab
 * the version macros and deduce macros from there.
 */
#ifdef __cplusplus
#if 0 /* expanded by -frewrite-includes */
#  include <cstddef>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef" 1 3
// -*- C++ -*-

#ifndef _LIBCPP_CSTDDEF
#define _LIBCPP_CSTDDEF

/*
    cstddef synopsis

Macros:
*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 1 3
// -*- C++ -*-
//===--------------------------- __config ---------------------------------===//
#ifndef _LIBCPP_CONFIG
#define _LIBCPP_CONFIG

#if !defined(_MSC_VER) || defined(__clang__)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#endif
# 17 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifdef __GNUC__
#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
#endif
# 21 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#define _LIBCPP_VERSION 1101

#define _LIBCPP_ABI_VERSION 1

#define _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_X##_LIBCPP_Y
#define _LIBCPP_CONCAT(_LIBCPP_X,_LIBCPP_Y) _LIBCPP_CONCAT1(_LIBCPP_X,_LIBCPP_Y)

#define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION)
# 37 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifdef __BIG_ENDIAN__
#if __BIG_ENDIAN__
#define _LIBCPP_LITTLE_ENDIAN 0
#define _LIBCPP_BIG_ENDIAN    1
#endif  // __BIG_ENDIAN__
# 43 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
# 54 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
# ifndef __LONG_LONG_SUPPORTED
#  define _LIBCPP_HAS_NO_LONG_LONG
# endif  // __LONG_LONG_SUPPORTED
# 57 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#endif  // __FreeBSD__
# 58 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifdef __NetBSD__
#if 0 /* expanded by -frewrite-includes */
# include <sys/endian.h>
#endif /* expanded by -frewrite-includes */
# 61 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#  if _BYTE_ORDER == _LITTLE_ENDIAN
#   define _LIBCPP_LITTLE_ENDIAN 1
#   define _LIBCPP_BIG_ENDIAN    0
#    define _LIBCPP_WARNING(x) __pragma(message(__FILE__ "(" _LIBCPP_TOSTRING(__LINE__) ") : warning note: " x))
#  endif
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#  // If mingw not explicitly detected, assume using MS C runtime only.
#  ifndef __MINGW32__
#    define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
#  endif
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#ifndef _LIBCPP_EXCEPTION_ABI
#define _LIBCPP_EXCEPTION_ABI _LIBCPP_TYPE_VIS
#endif
# 155 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_ALWAYS_INLINE
# ifdef _LIBCPP_MSVC
#  define _LIBCPP_ALWAYS_INLINE __forceinline
# endif
# 160 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#endif
# 161 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#endif // _WIN32
# 163 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef __has_attribute
#define __has_attribute(__x) 0
#endif
# 167 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_HIDDEN
#define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden")))
#endif
# 171 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_FUNC_VIS
#define _LIBCPP_FUNC_VIS __attribute__ ((__visibility__("default")))
#endif
# 175 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_TYPE_VIS
#  if __has_attribute(__type_visibility__)
#    define _LIBCPP_TYPE_VIS __attribute__ ((__type_visibility__("default")))
#  else
# 180 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#    define _LIBCPP_TYPE_VIS __attribute__ ((__visibility__("default")))
#  endif
# 182 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#endif
# 183 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_TYPE_VIS_ONLY
# define _LIBCPP_TYPE_VIS_ONLY _LIBCPP_TYPE_VIS
#endif
# 187 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_FUNC_VIS_ONLY
# define _LIBCPP_FUNC_VIS_ONLY _LIBCPP_FUNC_VIS
#endif
# 191 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_INLINE_VISIBILITY
#define _LIBCPP_INLINE_VISIBILITY __attribute__ ((__visibility__("hidden"), __always_inline__))
#endif
# 195 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_EXCEPTION_ABI
#define _LIBCPP_EXCEPTION_ABI __attribute__ ((__visibility__("default")))
#endif
# 199 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_ALWAYS_INLINE
#define _LIBCPP_ALWAYS_INLINE  __attribute__ ((__visibility__("hidden"), __always_inline__))
# 209 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if __has_feature(cxx_alignas)
#  define _ALIGNAS_TYPE(x) alignas(x)
#  define _ALIGNAS(x) alignas(x)
#else
# 214 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#  define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))
#  define _ALIGNAS(x) __attribute__((__aligned__(x)))
#endif
# 217 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if !__has_feature(cxx_alias_templates)
#define _LIBCPP_HAS_NO_TEMPLATE_ALIASES
#endif
# 221 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef __GXX_EXPERIMENTAL_CXX0X__
#ifdef __linux__
#define _LIBCPP_HAS_NO_UNICODE_CHARS
#else
# 226 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
typedef __char16_t char16_t;
typedef __char32_t char32_t;
#endif
# 229 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#endif
# 230 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if !(__has_feature(cxx_exceptions))
#define _LIBCPP_NO_EXCEPTIONS
#endif
# 234 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if !(__has_feature(cxx_rtti))
#define _LIBCPP_NO_RTTI
#endif
# 238 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if !(__has_feature(cxx_strong_enums))
#define _LIBCPP_HAS_NO_STRONG_ENUMS
#endif
# 242 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if !(__has_feature(cxx_decltype))
#define _LIBCPP_HAS_NO_DECLTYPE
#endif
# 246 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if __has_feature(cxx_attributes)
#  define _LIBCPP_NORETURN [[noreturn]]
#else
# 250 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#  define _LIBCPP_NORETURN __attribute__ ((noreturn))
#endif
# 252 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if !(__has_feature(cxx_defaulted_functions))
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#endif  // !(__has_feature(cxx_defaulted_functions))
# 256 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if !(__has_feature(cxx_deleted_functions))
#define _LIBCPP_HAS_NO_DELETED_FUNCTIONS
#endif  // !(__has_feature(cxx_deleted_functions))
# 260 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if !(__has_feature(cxx_lambdas))
#define _LIBCPP_HAS_NO_LAMBDAS
#endif
# 264 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

# 310 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if !(__has_feature(cxx_constexpr))
#define _LIBCPP_HAS_NO_CONSTEXPR
#endif
# 314 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
#if defined(__FreeBSD__)
#define _LIBCPP_HAS_QUICK_EXIT
#define _LIBCPP_HAS_C11_FEATURES
#elif defined(__linux__)
# 320 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#if 0 /* expanded by -frewrite-includes */
#include <features.h>
#endif /* expanded by -frewrite-includes */
# 327 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#endif
# 328 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#endif
# 329 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if (__has_feature(cxx_noexcept))
#  define _NOEXCEPT noexcept
#  define _NOEXCEPT_(x) noexcept(x)
#  define _NOEXCEPT_OR_FALSE(x) noexcept(x)
#else
# 335 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#  define _NOEXCEPT throw()
#  define _NOEXCEPT_(x)
#  define _NOEXCEPT_OR_FALSE(x) false
#endif
#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIBCPP_NAMESPACE {
#define _LIBCPP_END_NAMESPACE_STD  } }
#define _VSTD std::_LIBCPP_NAMESPACE

namespace std {
  inline namespace _LIBCPP_NAMESPACE {
  }
}

#elif defined(__GNUC__)
# 355 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#define _ALIGNAS(x) __attribute__((__aligned__(x)))
#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x))))

#define _LIBCPP_NORETURN __attribute__((noreturn))

#define _NOEXCEPT throw()
#define _NOEXCEPT_(x)
#define _NOEXCEPT_OR_FALSE(x) false

#ifndef __GXX_EXPERIMENTAL_CXX0X__

#define _LIBCPP_HAS_NO_ADVANCED_SFINAE

#if _GNUC_VER < 403
#define _LIBCPP_HAS_NO_RVALUE_REFERENCES
#endif
# 394 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if _GNUC_VER < 403
#define _LIBCPP_HAS_NO_STATIC_ASSERT
#define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
#endif  // _GNUC_VER < 404
# 406 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if _GNUC_VER < 406
#define _LIBCPP_HAS_NO_NULLPTR
#endif
# 410 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if _GNUC_VER < 407
#define _LIBCPP_HAS_NO_ADVANCED_SFINAE
#define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#endif
# 415 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#endif  // __GXX_EXPERIMENTAL_CXX0X__
#define decltype(x) __typeof__(x)
#endif
# 506 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifdef _LIBCPP_HAS_NO_CONSTEXPR
#define _LIBCPP_CONSTEXPR
#else
# 510 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#define _LIBCPP_CONSTEXPR constexpr
#endif
# 512 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
#define _LIBCPP_DEFAULT {}
#else
# 516 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#define _LIBCPP_DEFAULT = default;
#endif
# 518 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifdef __GNUC__
#define _NOALIAS __attribute__((__malloc__))
#else
# 522 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#define _NOALIAS
#endif
# 524 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef __has_feature
#define __has_feature(__x) 0
#endif
# 528 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__)
#   define _LIBCPP_EXPLICIT explicit
#else
# 532 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#   define _LIBCPP_EXPLICIT
#endif
# 534 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
#define _LIBCPP_DECLARE_STRONG_ENUM(x) struct _LIBCPP_TYPE_VIS x { enum __lx
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \
    __lx __v_; \
    _LIBCPP_ALWAYS_INLINE x(__lx __v) : __v_(__v) {} \
    _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \
    _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \
    };
#else  // _LIBCPP_HAS_NO_STRONG_ENUMS
# 544 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_TYPE_VIS x
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
#endif  // _LIBCPP_HAS_NO_STRONG_ENUMS
# 547 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifdef _LIBCPP_DEBUG
#   if _LIBCPP_DEBUG == 0
#       define _LIBCPP_DEBUG_LEVEL 1
#   elif _LIBCPP_DEBUG == 1
# 552 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#       define _LIBCPP_DEBUG_LEVEL 2
#   else
# 554 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#       error Supported values for _LIBCPP_DEBUG are 0 and 1
#   endif
# 556 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#   define _LIBCPP_EXTERN_TEMPLATE(...)
#endif
# 558 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_EXTERN_TEMPLATE
#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
#endif
# 562 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_EXTERN_TEMPLATE2
#define _LIBCPP_EXTERN_TEMPLATE2(...) extern template __VA_ARGS__;
#endif
# 566 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
# 586 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
#  define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1
#endif
# 590 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#ifndef _LIBCPP_STD_VER
#  if  __cplusplus <= 201103L
#    define _LIBCPP_STD_VER 11
#  else
# 595 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#    define _LIBCPP_STD_VER 13  // current year, or date of c++14 ratification
#  endif
# 597 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#endif  // _LIBCPP_STD_VER
# 604 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

#if _LIBCPP_STD_VER <= 11
#define _LIBCPP_CONSTEXPR_AFTER_CXX11
#define _LIBCPP_EXPLICIT_AFTER_CXX11
#define _LIBCPP_DEPRECATED_AFTER_CXX11
#else
# 610 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3
#define _LIBCPP_CONSTEXPR_AFTER_CXX11 constexpr
#define _LIBCPP_EXPLICIT_AFTER_CXX11 explicit
#define _LIBCPP_DEPRECATED_AFTER_CXX11 [[deprecated]]
#endif
# 614 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config" 3

// Try to find out if RTTI is disabled.
// g++ and cl.exe have RTTI on by default and define a macro when it is.
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#if !defined(_SIZE_T) || __has_feature(modules)
/* Always define size_t when modules are available. */
#if !__has_feature(modules)
#define _SIZE_T
#endif
# 42 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ size_t;
#endif

#define offsetof(t, d) __builtin_offsetof(t, d)

#endif /* __STDDEF_H */
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
__WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
#if defined(__need_wint_t)
/* Always define wint_t when modules are available. */
#if !defined(_WINT_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 45 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 48 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef" 3
#endif
# 49 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef" 3

_LIBCPP_BEGIN_NAMESPACE_STD

using ::ptrdiff_t;
using ::size_t;

typedef long double max_align_t;

#ifdef _LIBCPP_HAS_NO_NULLPTR

    friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>=(nullptr_t, nullptr_t) {return true;}
};

inline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);}

#define nullptr _VSTD::__get_nullptr_t()

#endif  // _LIBCPP_HAS_NO_NULLPTR
# 91 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef" 3

_LIBCPP_END_NAMESPACE_STD

#ifndef _LIBCPP_HAS_NO_NULLPTR

namespace std
{
    typedef decltype(nullptr) nullptr_t;
}

#endif  // _LIBCPP_HAS_NO_NULLPTR
# 102 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef" 3

#endif  // _LIBCPP_CSTDDEF
# 104 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstddef" 3
# 47 "../../dist/include/mozilla/Compiler.h" 2
#  ifdef _STLPORT_MAJOR
#    define MOZ_USING_STLPORT 1
#    define MOZ_STLPORT_VERSION_AT_LEAST(major, minor, patch) \
       (_STLPORT_VERSION >= ((major) << 8 | (minor) << 4 | (patch)))
#  elif defined(_LIBCPP_VERSION)
# 52 "../../dist/include/mozilla/Compiler.h"
   /*
    * libc++, unfortunately, doesn't appear to have useful versioning macros.
    * Hopefully, the recommendations of N3694 with respect to standard libraries
    * will get applied instead and we won't need to worry about version numbers
    * here.
    */
#    define MOZ_USING_LIBCXX 1
#  elif defined(__GLIBCXX__)
# 60 "../../dist/include/mozilla/Compiler.h"
#    define MOZ_USING_LIBSTDCXX 1
   /*
    * libstdc++ is also annoying and doesn't give us useful versioning macros
    * for the library. If we're using gcc, then assume that libstdc++ matches
    * the compiler version. If we're using clang, we're going to have to fake
    * major/minor combinations by looking for newly-defined config macros.
    */
#    if MOZ_IS_GCC
#      define MOZ_LIBSTDCXX_VERSION_AT_LEAST(major, minor, patch) \
          MOZ_GCC_VERSION_AT_LEAST(major, minor, patch)
#    endif
# 94 "../../dist/include/mozilla/Compiler.h"
#  endif
# 95 "../../dist/include/mozilla/Compiler.h"

   // Flesh out the defines for everyone else
# 104 "../../dist/include/mozilla/Compiler.h"
#  ifndef MOZ_USING_LIBSTDCXX
#    define MOZ_USING_LIBSTDCXX 0
#    define MOZ_LIBSTDCXX_VERSION_AT_LEAST(major, minor, patch) 0
#  endif
# 108 "../../dist/include/mozilla/Compiler.h"
#endif /* __cplusplus */
# 109 "../../dist/include/mozilla/Compiler.h"
# 37 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_ALWAYS_INLINE     inline
#endif
# 39 "../../dist/include/mozilla/Attributes.h"

#if defined(_MSC_VER)
/*
 * g++ requires -std=c++0x or -std=gnu++0x to support C++11 functionality
 * http://stackoverflow.com/questions/20498142/visual-studio-2013-explicit-keyword-bug
 */
#  define MOZ_HAVE_CXX11_FINAL         final
#  define MOZ_HAVE_CXX11_OVERRIDE
#  define MOZ_HAVE_NEVER_INLINE          __declspec(noinline)
#  define MOZ_HAVE_NORETURN              __declspec(noreturn)
#  ifdef __clang__
     /* clang-cl probably supports constexpr and explicit conversions. */
#  endif
# 66 "../../dist/include/mozilla/Attributes.h"
#elif defined(__clang__)
# 67 "../../dist/include/mozilla/Attributes.h"
   /*
    * Per Clang documentation, "Note that marketing version numbers should not
    * be used to check for language features, as different vendors use different
    * numbering schemes. Instead, use the feature checking macros."
    */
#  ifndef __has_extension
#    define __has_extension __has_feature /* compatibility, for older versions of clang */
#  endif
# 75 "../../dist/include/mozilla/Attributes.h"
#  if __has_extension(cxx_constexpr)
#    define MOZ_HAVE_CXX11_CONSTEXPR
#  endif
# 78 "../../dist/include/mozilla/Attributes.h"
#  if __has_extension(cxx_explicit_conversions)
#    define MOZ_HAVE_EXPLICIT_CONVERSION
#  endif
# 81 "../../dist/include/mozilla/Attributes.h"
#  if __has_extension(cxx_override_control)
#    define MOZ_HAVE_CXX11_OVERRIDE
#    define MOZ_HAVE_CXX11_FINAL         final
#  endif
# 91 "../../dist/include/mozilla/Attributes.h"
#elif defined(__GNUC__)
# 92 "../../dist/include/mozilla/Attributes.h"
#  if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
#    if MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
#      define MOZ_HAVE_CXX11_OVERRIDE
#      define MOZ_HAVE_CXX11_FINAL       final
#      define MOZ_HAVE_CXX11_FINAL       __final
#    endif
# 104 "../../dist/include/mozilla/Attributes.h"
#  endif
# 105 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_HAVE_NEVER_INLINE          __attribute__((noinline))
#  define MOZ_HAVE_NORETURN              __attribute__((noreturn))
#endif
# 108 "../../dist/include/mozilla/Attributes.h"

/*
 * When built with clang analyzer (a.k.a scan-build), define MOZ_HAVE_NORETURN
 * to mark some false positives
 */
#ifdef __clang_analyzer__
#  if __has_extension(attribute_analyzer_noreturn)
#    define MOZ_HAVE_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
#  endif
# 117 "../../dist/include/mozilla/Attributes.h"
#endif
# 118 "../../dist/include/mozilla/Attributes.h"

/*
 * The MOZ_CONSTEXPR specifier declares that a C++11 compiler can evaluate a
 * function at compile time. A constexpr function cannot examine any values
 * except its arguments and can have no side effects except its return value.
 * The MOZ_CONSTEXPR_VAR specifier tells a C++11 compiler that a variable's
 * value may be computed at compile time.  It should be prefered to just
 * marking variables as MOZ_CONSTEXPR because if the compiler does not support
 * constexpr it will fall back to making the variable const, and some compilers
 * do not accept variables being marked both const and constexpr.
 */
#ifdef MOZ_HAVE_CXX11_CONSTEXPR
#  define MOZ_CONSTEXPR         constexpr
#  define MOZ_CONSTEXPR_VAR     constexpr
#else
# 133 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_CONSTEXPR         /* no support */
#  define MOZ_CONSTEXPR_VAR     const
#endif
# 136 "../../dist/include/mozilla/Attributes.h"

/*
 * MOZ_EXPLICIT_CONVERSION is a specifier on a type conversion
 * overloaded operator that declares that a C++11 compiler should restrict
 * this operator to allow only explicit type conversions, disallowing
 * implicit conversions.
 *
 *       return mPtr != nullptr;
 *     }
 *   };
 *
 */
#ifdef MOZ_HAVE_EXPLICIT_CONVERSION
#  define MOZ_EXPLICIT_CONVERSION explicit
#else
# 159 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_EXPLICIT_CONVERSION /* no support */
#endif
# 161 "../../dist/include/mozilla/Attributes.h"

/*
 * MOZ_NEVER_INLINE is a macro which expands to tell the compiler that the
 * method decorated with it must never be inlined, even if the compiler would
 * otherwise choose to inline the method.  Compilers aren't absolutely
 * guaranteed to support this, but most do.
 */
#if defined(MOZ_HAVE_NEVER_INLINE)
#  define MOZ_NEVER_INLINE      MOZ_HAVE_NEVER_INLINE
#else
# 171 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_NEVER_INLINE      /* no support */
#endif
# 173 "../../dist/include/mozilla/Attributes.h"

/*
 * MOZ_NORETURN, specified at the start of a function declaration, indicates
 * that the given function does not return.  (The function definition does not
 * need to be annotated.)
 *
 */
#if defined(MOZ_HAVE_NORETURN)
#  define MOZ_NORETURN          MOZ_HAVE_NORETURN
#else
# 191 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_NORETURN          /* no support */
#endif
# 193 "../../dist/include/mozilla/Attributes.h"

/**
 * MOZ_COLD tells the compiler that a function is "cold", meaning infrequently
 * executed. This may lead it to optimize for size more aggressively than speed,
 * or to allocate the body of the function in a distant part of the text segment
 * to help keep it from taking up unnecessary icache when it isn't in use.
 *
 * Place this attribute at the very beginning of a function definition. For
 * example, write
 *
 *   MOZ_COLD int foo();
 *
 * or
 *
 *   MOZ_COLD int foo() { return 42; }
 */
#if defined(__GNUC__) || defined(__clang__)
#  define MOZ_COLD __attribute__ ((cold))
#else
# 212 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_COLD
#endif
# 214 "../../dist/include/mozilla/Attributes.h"

/**
 * MOZ_NONNULL tells the compiler that some of the arguments to a function are
 * known to be non-null. The arguments are a list of 1-based argument indexes
 * identifying arguments which are known to be non-null.
 *
 * Place this attribute at the very beginning of a function definition. For
 * example, write
 *
 *
 */
#if defined(MOZ_HAVE_ANALYZER_NORETURN)
#  define MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS          MOZ_HAVE_ANALYZER_NORETURN
#else
# 250 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS          /* no support */
#endif
# 252 "../../dist/include/mozilla/Attributes.h"

/*
 * MOZ_ASAN_BLACKLIST is a macro to tell AddressSanitizer (a compile-time
 * instrumentation shipped with Clang and GCC) to not instrument the annotated
 * function. Furthermore, it will prevent the compiler from inlining the
 * function because inlining currently breaks the blacklisting mechanism of
 * AddressSanitizer.
 */
#if defined(__has_feature)
#  if __has_feature(address_sanitizer)
#    define MOZ_HAVE_ASAN_BLACKLIST
#  endif
# 264 "../../dist/include/mozilla/Attributes.h"
#elif defined(__GNUC__)
# 265 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_ASAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_sanitize_address))
#else
# 273 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_ASAN_BLACKLIST /* nothing */
#endif
# 275 "../../dist/include/mozilla/Attributes.h"

/*
 * MOZ_TSAN_BLACKLIST is a macro to tell ThreadSanitizer (a compile-time
 * instrumentation shipped with Clang) to not instrument the annotated function.
 * Furthermore, it will prevent the compiler from inlining the function because
 * inlining currently breaks the blacklisting mechanism of ThreadSanitizer.
 */
#if defined(__has_feature)
#  if __has_feature(thread_sanitizer)
#    define MOZ_TSAN_BLACKLIST MOZ_NEVER_INLINE __attribute__((no_sanitize_thread))
#  else
# 286 "../../dist/include/mozilla/Attributes.h"
#    define MOZ_TSAN_BLACKLIST /* nothing */
#  endif
# 288 "../../dist/include/mozilla/Attributes.h"
#else
# 289 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_TSAN_BLACKLIST /* nothing */
#endif
# 291 "../../dist/include/mozilla/Attributes.h"

#ifdef __cplusplus

/*
 * MOZ_OVERRIDE explicitly indicates that a virtual member function in a class
 * overrides a member function of a base class, rather than potentially being a
 *   };
 *
 * In compilers supporting C++11 override controls, MOZ_OVERRIDE *requires* that
 * the function marked with it override a member function of a base class: it
 * is a compile error if it does not.  Otherwise MOZ_OVERRIDE does not affect
 * semantics and merely documents the override relationship to the reader (but
 * of course must still be used correctly to not break C++11 compilers).
 */
#if defined(MOZ_HAVE_CXX11_OVERRIDE)
#  define MOZ_OVERRIDE          override
#else
# 332 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_OVERRIDE          /* no support */
#endif
# 334 "../../dist/include/mozilla/Attributes.h"

/*
 * MOZ_FINAL indicates that some functionality cannot be overridden through
 * inheritance.  It can be used to annotate either classes/structs or virtual
 * member functions.
 *
 * class annotated with MOZ_FINAL.  In other compilers it serves only as
 * documentation.
 *
 *     // This will be an error in some compilers:
 *     virtual void f();
 *   };
 *
 * In compilers implementing final controls, it is an error for a derived class
 * to override a method annotated with MOZ_FINAL.  In other compilers it serves
 * only as documentation.
 */
#if defined(MOZ_HAVE_CXX11_FINAL)
#  define MOZ_FINAL             MOZ_HAVE_CXX11_FINAL
#else
# 401 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_FINAL             /* no support */
#endif
# 403 "../../dist/include/mozilla/Attributes.h"

/**
 * MOZ_WARN_UNUSED_RESULT tells the compiler to emit a warning if a function's
 * return value is not used by the caller.
 *
 * Place this attribute at the very beginning of a function definition. For
 * example, write
 *
 *   MOZ_WARN_UNUSED_RESULT int foo();
 *
 * or
 *
 *   MOZ_WARN_UNUSED_RESULT int foo() { return 42; }
 */
#if defined(__GNUC__) || defined(__clang__)
#  define MOZ_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result))
#else
# 420 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_WARN_UNUSED_RESULT
#endif
# 422 "../../dist/include/mozilla/Attributes.h"

/*
 * The following macros are attributes that support the static analysis plugin
 * included with Mozilla, and will be implemented (when such support is enabled)
 * as C++11 attributes. Since such attributes are legal pretty much everywhere
 * and have subtly different semantics depending on their placement, the
 *   intended to prevent introducing static initializers.  This attribute
 *   smart pointer is not manipulated directly.
 */
#ifdef MOZ_CLANG_PLUGIN
#  define MOZ_MUST_OVERRIDE __attribute__((annotate("moz_must_override")))
#  define MOZ_STACK_CLASS __attribute__((annotate("moz_stack_class")))
    _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \
    __attribute__((annotate("moz_heap_allocator"))) \
    _Pragma("clang diagnostic pop")
#else
# 552 "../../dist/include/mozilla/Attributes.h"
#  define MOZ_MUST_OVERRIDE /* nothing */
#  define MOZ_STACK_CLASS /* nothing */
#  define MOZ_NONHEAP_CLASS /* nothing */
#  define MOZ_TRIVIAL_CTOR_DTOR /* nothing */
#  define MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS /* nothing */
#  define MOZ_IMPLICIT /* nothing */
#  define MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT /* nothing */
#  define MOZ_HEAP_ALLOCATOR /* nothing */
#  define MOZ_OWNING_REF /* nothing */
#  define MOZ_NON_OWNING_REF /* nothing */
#  define MOZ_UNSAFE_REF(reason) /* nothing */
#  define MOZ_NO_ADDREF_RELEASE_ON_RETURN /* nothing */
#endif /* MOZ_CLANG_PLUGIN */
# 565 "../../dist/include/mozilla/Attributes.h"

#endif /* __cplusplus */
# 567 "../../dist/include/mozilla/Attributes.h"

#endif /* mozilla_Attributes_h */
#ifndef _LIBCPP_VECTOR
#define _LIBCPP_VECTOR

/*
    vector synopsis

namespace std
{
template <class T, class Allocator>
void swap(vector<T,Allocator>& x, vector<T,Allocator>& y)
    noexcept(noexcept(x.swap(y)));

}  // std

*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 265 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#if 0 /* expanded by -frewrite-includes */
#include <__bit_reference>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 1 3
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP___BIT_REFERENCE
#define _LIBCPP___BIT_REFERENCE

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 1 3
// -*- C++ -*-
//===-------------------------- algorithm ---------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_ALGORITHM
#define _LIBCPP_ALGORITHM

/*
    algorithm synopsis

#include <initializer_list>
    bool
    lexicographical_compare(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2);
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/initializer_list" 1 3
// -*- C++ -*-
//===----------------------- initializer_list -----------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_INITIALIZER_LIST
#define _LIBCPP_INITIALIZER_LIST

/*
#include <__config>
#endif /* expanded by -frewrite-includes */
# 47 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/initializer_list" 3
#if 0 /* expanded by -frewrite-includes */
#include <cstddef>
#endif /* expanded by -frewrite-includes */
# 48 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/initializer_list" 3

namespace std  // purposefully not versioned
{

#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

template<class _Ep>
class _LIBCPP_TYPE_VIS_ONLY initializer_list
{
    const _Ep* __begin_;
    size_t    __size_;

    _LIBCPP_ALWAYS_INLINE
    _LIBCPP_CONSTEXPR_AFTER_CXX11
    initializer_list(const _Ep* __b, size_t __s) _NOEXCEPT
        : __begin_(__b),
          __size_(__s)
        {}
public:
    typedef _Ep        value_type;
    typedef const _Ep& reference;
    typedef const _Ep& const_reference;
    typedef size_t    size_type;

    typedef const _Ep* iterator;
    size_t    size()  const _NOEXCEPT {return __size_;}
    
    _LIBCPP_ALWAYS_INLINE
    _LIBCPP_CONSTEXPR_AFTER_CXX11
    const _Ep* begin() const _NOEXCEPT {return __begin_;}

    _LIBCPP_ALWAYS_INLINE
    _LIBCPP_CONSTEXPR_AFTER_CXX11
    const _Ep* end()   const _NOEXCEPT {return __begin_ + __size_;}
};

template<class _Ep>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR_AFTER_CXX11
const _Ep*
begin(initializer_list<_Ep> __il) _NOEXCEPT
{
    return __il.begin();
}

template<class _Ep>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR_AFTER_CXX11
const _Ep*
end(initializer_list<_Ep> __il) _NOEXCEPT
{
    return __il.end();
}

#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 115 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/initializer_list" 3

}  // std

#endif  // _LIBCPP_INITIALIZER_LIST
# 119 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/initializer_list" 3
# 624 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <type_traits>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 1 3
// -*- C++ -*-
//===------------------------ type_traits ---------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_TYPE_TRAITS
#define _LIBCPP_TYPE_TRAITS

/*
    type_traits synopsis
#include <cstddef>
#endif /* expanded by -frewrite-includes */
# 204 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 207 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
#endif
# 208 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <bool _Bp, class _If, class _Then>
    struct _LIBCPP_TYPE_VIS_ONLY conditional {typedef _If type;};
template <class _If, class _Then>
    struct _LIBCPP_TYPE_VIS_ONLY conditional<false, _If, _Then> {typedef _Then type;};

#if _LIBCPP_STD_VER > 11
template <bool _Bp, class _If, class _Then> using conditional_t = typename conditional<_Bp, _If, _Then>::type;
#endif
# 219 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <bool, class _Tp = void> struct _LIBCPP_TYPE_VIS_ONLY enable_if {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY enable_if<true, _Tp> {typedef _Tp type;};

#if _LIBCPP_STD_VER > 11
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
#endif
# 226 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3


struct __two {char __lx[2];};

// helper class:

template <class _Tp, _Tp __v>
struct _LIBCPP_TYPE_VIS_ONLY integral_constant
{
    static _LIBCPP_CONSTEXPR const _Tp      value = __v;
    typedef _Tp               value_type;
    typedef integral_constant type;
    _LIBCPP_INLINE_VISIBILITY
        _LIBCPP_CONSTEXPR operator value_type() const {return value;}
#if _LIBCPP_STD_VER > 11
    _LIBCPP_INLINE_VISIBILITY
         constexpr value_type operator ()() const {return value;}
#endif
# 244 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
};

template <class _Tp, _Tp __v>
_LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value;

typedef integral_constant<bool, true>  true_type;
typedef integral_constant<bool, false> false_type;

// is_const

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_const            : public false_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_const<_Tp const> : public true_type {};

// is_volatile

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_volatile               : public false_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_volatile<_Tp volatile> : public true_type {};

// remove_const

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_const            {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_const<const _Tp> {typedef _Tp type;};
#if _LIBCPP_STD_VER > 11
template <class _Tp> using remove_const_t = typename remove_const<_Tp>::type;
#endif
# 269 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// remove_volatile

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_volatile               {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_cv
{typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;};
#if _LIBCPP_STD_VER > 11
template <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type;
#endif
# 285 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_void

template <class _Tp> struct __libcpp_is_void       : public false_type {};
template <>          struct __libcpp_is_void<void> : public true_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_void
    : public __libcpp_is_void<typename remove_cv<_Tp>::type> {};

// __is_nullptr_t

template <class _Tp> struct __is_nullptr_t_impl       : public false_type {};
template <>          struct __is_nullptr_t_impl<nullptr_t> : public true_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __is_nullptr_t
    : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};

#if _LIBCPP_STD_VER > 11
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_null_pointer
    : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
#endif
# 306 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_integral

template <class _Tp> struct __libcpp_is_integral                     : public false_type {};
template <>          struct __libcpp_is_integral<bool>               : public true_type {};
template <>          struct __libcpp_is_integral<char>               : public true_type {};
template <>          struct __libcpp_is_integral<signed char>        : public true_type {};
template <>          struct __libcpp_is_integral<unsigned char>      : public true_type {};
template <>          struct __libcpp_is_integral<wchar_t>            : public true_type {};
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
template <>          struct __libcpp_is_integral<char16_t>           : public true_type {};
template <>          struct __libcpp_is_integral<char32_t>           : public true_type {};
#endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
# 319 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
template <>          struct __libcpp_is_integral<short>              : public true_type {};
template <>          struct __libcpp_is_integral<unsigned short>     : public true_type {};
template <>          struct __libcpp_is_integral<int>                : public true_type {};
template <>          struct __libcpp_is_integral<unsigned int>       : public true_type {};
template <>          struct __libcpp_is_integral<long>               : public true_type {};
template <>          struct __libcpp_is_integral<unsigned long>      : public true_type {};
template <>          struct __libcpp_is_integral<long long>          : public true_type {};
template <>          struct __libcpp_is_integral<unsigned long long> : public true_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_integral
    : public __libcpp_is_integral<typename remove_cv<_Tp>::type> {};

// is_floating_point

template <class _Tp> struct __libcpp_is_floating_point              : public false_type {};
template <>          struct __libcpp_is_floating_point<float>       : public true_type {};
template <>          struct __libcpp_is_floating_point<double>      : public true_type {};
template <>          struct __libcpp_is_floating_point<long double> : public true_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_floating_point
    : public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {};

// is_array

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_array
    : public false_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_array<_Tp[]>
    : public true_type {};
template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY is_array<_Tp[_Np]>
    : public true_type {};

// is_pointer

template <class _Tp> struct __libcpp_is_pointer       : public false_type {};
template <class _Tp> struct __libcpp_is_pointer<_Tp*> : public true_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pointer
    : public __libcpp_is_pointer<typename remove_cv<_Tp>::type> {};

// is_reference

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_lvalue_reference       : public false_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_lvalue_reference<_Tp&> : public true_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_rvalue_reference        : public false_type {};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_rvalue_reference<_Tp&&> : public true_type {};
#endif
# 367 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference        : public false_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&>  : public true_type {};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&&> : public true_type {};
# 386 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp> struct __libcpp_union : public false_type {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_union
    : public __libcpp_union<typename remove_cv<_Tp>::type> {};

#endif
# 392 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_class

#if __has_feature(is_class) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_class
    : public integral_constant<bool, __is_class(_Tp)> {};

#else
# 401 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

namespace __is_class_imp
{
template <class _Tp> char  __test(int _Tp::*);
template <class _Tp> __two __test(...);
}

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_class
    : public integral_constant<bool, sizeof(__is_class_imp::__test<_Tp>(0)) == 1 && !is_union<_Tp>::value> {};

#endif
# 412 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_same

template <class _Tp, class _Up> struct _LIBCPP_TYPE_VIS_ONLY is_same           : public false_type {};
template <class _Tp>            struct _LIBCPP_TYPE_VIS_ONLY is_same<_Tp, _Tp> : public true_type {};

// is_function

namespace __libcpp_is_function_imp
{
template <class _Tp> char  __test(_Tp*);
template <class _Tp> __two __test(...);
template <class _Tp> _Tp&  __source();
}

template <class _Tp, bool = is_class<_Tp>::value ||
                            is_union<_Tp>::value ||
                            is_void<_Tp>::value  ||
                            is_reference<_Tp>::value ||
                            __is_nullptr_t<_Tp>::value >
struct __libcpp_is_function
    : public integral_constant<bool, sizeof(__libcpp_is_function_imp::__test<_Tp>(__libcpp_is_function_imp::__source<_Tp>())) == 1>
    {};
template <class _Tp> struct __libcpp_is_function<_Tp, true> : public false_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_function
    : public __libcpp_is_function<_Tp> {};

// is_member_function_pointer

template <class _Tp> struct            __libcpp_is_member_function_pointer             : public false_type {};
template <class _Tp, class _Up> struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_function_pointer
    : public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type> {};

// is_member_pointer

template <class _Tp>            struct __libcpp_is_member_pointer             : public false_type {};
template <class _Tp, class _Up> struct __libcpp_is_member_pointer<_Tp _Up::*> : public true_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_pointer
    : public __libcpp_is_member_pointer<typename remove_cv<_Tp>::type> {};

// is_member_object_pointer

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_object_pointer
    : public integral_constant<bool, is_member_pointer<_Tp>::value &&
                                    !is_member_function_pointer<_Tp>::value> {};

// is_enum

#if __has_feature(is_enum) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_enum
    : public integral_constant<bool, __is_enum(_Tp)> {};

#else
                                     !is_reference<_Tp>::value        &&
                                     !is_member_pointer<_Tp>::value   &&
                                     !is_union<_Tp>::value            &&
                                     !is_class<_Tp>::value            &&
                                     !is_function<_Tp>::value         > {};

#endif
# 484 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_arithmetic

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_arithmetic
    : public integral_constant<bool, is_integral<_Tp>::value      ||
                                     is_floating_point<_Tp>::value> {};

// is_fundamental
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_scalar
    : public integral_constant<bool, is_arithmetic<_Tp>::value     ||
                                     is_member_pointer<_Tp>::value ||
                                     is_pointer<_Tp>::value        ||
                                     __is_nullptr_t<_Tp>::value    ||
                                     is_enum<_Tp>::value           > {};

template <> struct _LIBCPP_TYPE_VIS_ONLY is_scalar<nullptr_t> : public true_type {};
template <class _Tp, bool = is_reference<_Tp>::value ||
                            is_function<_Tp>::value  ||
                            is_const<_Tp>::value     >
struct __add_const             {typedef _Tp type;};

template <class _Tp>
struct __add_const<_Tp, false> {typedef const _Tp type;};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_const
    {typedef typename __add_const<_Tp>::type type;};

#if _LIBCPP_STD_VER > 11
template <class _Tp> using add_const_t = typename add_const<_Tp>::type;
#endif
# 538 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// add_volatile

template <class _Tp, bool = is_reference<_Tp>::value ||
                            is_function<_Tp>::value  ||
                            is_volatile<_Tp>::value  >
struct __add_volatile             {typedef _Tp type;};

template <class _Tp>
struct __add_volatile<_Tp, false> {typedef volatile _Tp type;};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_volatile
    {typedef typename __add_volatile<_Tp>::type type;};

#if _LIBCPP_STD_VER > 11
template <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type;
#endif
# 555 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// add_cv

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_cv
    {typedef typename add_const<typename add_volatile<_Tp>::type>::type type;};

#if _LIBCPP_STD_VER > 11
template <class _Tp> using add_cv_t = typename add_cv<_Tp>::type;
#endif
# 564 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// remove_reference

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_reference        {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_reference<_Tp&>  {typedef _Tp type;};
# 576 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// add_lvalue_reference

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_lvalue_reference                      {typedef _Tp& type;};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_lvalue_reference<_Tp&>                {typedef _Tp& type;};  // for older compiler
template <>          struct _LIBCPP_TYPE_VIS_ONLY add_lvalue_reference<void>                {typedef void type;};
template <>          struct _LIBCPP_TYPE_VIS_ONLY add_lvalue_reference<const void>          {typedef const void type;};
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY  add_rvalue_reference                     {typedef _Tp&& type;};
template <>          struct _LIBCPP_TYPE_VIS_ONLY add_rvalue_reference<void>                {typedef void type;};
template <>          struct _LIBCPP_TYPE_VIS_ONLY add_rvalue_reference<const void>          {typedef const void type;};
template <>          struct _LIBCPP_TYPE_VIS_ONLY add_rvalue_reference<volatile void>       {typedef volatile void type;};
template <>          struct _LIBCPP_TYPE_VIS_ONLY add_rvalue_reference<const volatile void> {typedef const volatile void type;};


template <class _Tp>
typename add_lvalue_reference<_Tp>::type
declval();

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 617 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

struct __any
{
    __any(...);
};

// remove_pointer

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_pointer                      {typedef _Tp type;};
# 634 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// add_pointer

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY add_pointer
    {typedef typename remove_reference<_Tp>::type* type;};

#if _LIBCPP_STD_VER > 11
template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type;
#endif
# 643 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_signed

template <class _Tp, bool = is_integral<_Tp>::value>
struct __libcpp_is_signed_impl : public integral_constant<bool, _Tp(-1) < _Tp(0)> {};

template <class _Tp>
struct __libcpp_is_signed_impl<_Tp, false> : public true_type {};  // floating point

template <class _Tp, bool = is_arithmetic<_Tp>::value>
struct __libcpp_is_signed : public __libcpp_is_signed_impl<_Tp> {};

template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_signed : public __libcpp_is_signed<_Tp> {};

// is_unsigned

template <class _Tp, bool = is_integral<_Tp>::value>
struct __libcpp_is_unsigned_impl : public integral_constant<bool, _Tp(0) < _Tp(-1)> {};

template <class _Tp>
struct __libcpp_is_unsigned_impl<_Tp, false> : public false_type {};  // floating point

template <class _Tp, bool = is_arithmetic<_Tp>::value>
struct __libcpp_is_unsigned : public __libcpp_is_unsigned_impl<_Tp> {};

template <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_unsigned : public __libcpp_is_unsigned<_Tp> {};

// rank

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY rank
    : public integral_constant<size_t, 0> {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY rank<_Tp[]>
    : public integral_constant<size_t, rank<_Tp>::value + 1> {};
template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY rank<_Tp[_Np]>
    : public integral_constant<size_t, rank<_Tp>::value + 1> {};

// extent

template <class _Tp, unsigned _Ip = 0> struct _LIBCPP_TYPE_VIS_ONLY extent
    : public integral_constant<size_t, 0> {};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY extent<_Tp[], 0>
    : public integral_constant<size_t, 0> {};
template <class _Tp, unsigned _Ip> struct _LIBCPP_TYPE_VIS_ONLY extent<_Tp[], _Ip>
    : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};
template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY extent<_Tp[_Np], 0>
    : public integral_constant<size_t, _Np> {};
template <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TYPE_VIS_ONLY extent<_Tp[_Np], _Ip>
    : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {};

// remove_extent

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_extent
    {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_extent<_Tp[]>
    {typedef _Tp type;};
template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY remove_extent<_Tp[_Np]>
    {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_all_extents
    {typedef _Tp type;};
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY remove_all_extents<_Tp[]>
    {typedef typename remove_all_extents<_Tp>::type type;};
template <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS_ONLY remove_all_extents<_Tp[_Np]>
    {typedef typename remove_all_extents<_Tp>::type type;};

#if _LIBCPP_STD_VER > 11
template <class _Tp> using remove_all_extents_t = typename remove_all_extents<_Tp>::type;
#endif
# 721 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// decay

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY decay
{
private:
    typedef typename remove_reference<_Tp>::type _Up;
public:
    typedef typename conditional
                     <
                         is_array<_Up>::value,
                         typename remove_extent<_Up>::type*,
                         typename conditional
                         <
                              is_function<_Up>::value,
                              typename add_pointer<_Up>::type,
                              typename remove_cv<_Up>::type
                         >::type
                     >::type type;
};
namespace __is_abstract_imp
{
template <class _Tp> char  __test(_Tp (*)[1]);
template <class _Tp> __two __test(...);
}

template <class _Tp, bool = is_class<_Tp>::value>
struct __libcpp_abstract : public integral_constant<bool, sizeof(__is_abstract_imp::__test<_Tp>(0)) != 1> {};

template <class _Tp> struct __libcpp_abstract<_Tp, false> : public false_type {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_abstract : public __libcpp_abstract<_Tp> {};

// is_base_of

#ifdef _LIBCPP_HAS_IS_BASE_OF

template <class _Bp, class _Dp>
struct _LIBCPP_TYPE_VIS_ONLY is_base_of
    : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};

#else  // __has_feature(is_base_of)
# 771 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

namespace __is_base_of_imp
{
template <class _Tp>
struct _Dst
{
    _Dst(const volatile _Tp &);
};
template <class _Tp>
struct _Src
{
    operator const volatile _Tp &();
    template <class _Up> operator const _Dst<_Up> &();
};
template <size_t> struct __one { typedef char type; };
template <class _Bp, class _Dp> typename __one<sizeof(_Dst<_Bp>(declval<_Src<_Dp> >()))>::type __test(int);
template <class _Bp, class _Dp> __two __test(...);
}

template <class _Bp, class _Dp>
struct _LIBCPP_TYPE_VIS_ONLY is_base_of
    : public integral_constant<bool, is_class<_Bp>::value &&
                                     sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {};

#endif  // __has_feature(is_base_of)
# 796 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_convertible

#if __has_feature(is_convertible_to)

template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY is_convertible
    : public integral_constant<bool, __is_convertible_to(_T1, _T2) &&
                                     !is_abstract<_T2>::value> {};

#else  // __has_feature(is_convertible_to)
struct __is_convertible_check<_Tp, 0>
{
    static const size_t __v = sizeof(_Tp);
};

template <class _T1, class _T2,
    unsigned _T1_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T1>::value,
    unsigned _T2_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T2>::value>
struct __is_convertible
    : public integral_constant<bool,
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
        sizeof(__is_convertible_imp::__test<_T2>(__is_convertible_imp::__source<_T1>())) == 1
#else
#endif
# 855 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    >
{};

template <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 0> : false_type {};

template <class _T1> struct __is_convertible<_T1, const _T1&, 1, 0> : true_type {};
template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY is_convertible
    : public __is_convertible<_T1, _T2>
{
    static const size_t __complete_check1 = __is_convertible_check<_T1>::__v;
    static const size_t __complete_check2 = __is_convertible_check<_T2>::__v;
};

#endif  // __has_feature(is_convertible_to)
# 915 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_empty

#if __has_feature(is_empty)

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_empty
    : public integral_constant<bool, __is_empty(_Tp)> {};

#else  // __has_feature(is_empty)
# 925 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp>
struct __is_empty1
    : public _Tp
#endif  // __has_feature(is_empty)
# 946 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_polymorphic

#if __has_feature(is_polymorphic)

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_polymorphic
    : public integral_constant<bool, __is_polymorphic(_Tp)> {};

#else
# 956 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template<typename _Tp> char &__is_polymorphic_impl(
    typename enable_if<sizeof((_Tp*)dynamic_cast<const volatile void*>(declval<_Tp*>())) != 0,
                       int>::type);
template<typename _Tp> __two &__is_polymorphic_impl(...);

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_polymorphic
    : public integral_constant<bool, sizeof(__is_polymorphic_impl<_Tp>(0)) == 1> {};

#endif // __has_feature(is_polymorphic)
# 966 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// has_virtual_destructor

#if __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
    : public integral_constant<bool, __has_virtual_destructor(_Tp)> {};

#else  // _LIBCPP_HAS_TYPE_TRAITS
# 975 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
    : public false_type {};

#endif  // _LIBCPP_HAS_TYPE_TRAITS
# 980 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// alignment_of

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY alignment_of
    : public integral_constant<size_t, __alignof__(_Tp)> {};

// aligned_storage

template <class _Hp, class _Tp>
struct __type_list
{
    typedef _Hp _Head;
    typedef _Tp _Tail;
};

struct __nat
{
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
    __nat() = delete;
    __nat(const __nat&) = delete;
    __nat& operator=(const __nat&) = delete;
    ~__nat() = delete;
#endif
# 1003 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
};

template <class _Tp>
struct __align_type
{
    static const size_t value = alignment_of<_Tp>::value;
    typedef _Tp type;
};

struct __struct_double {long double __lx;};
struct __struct_double4 {double __lx[4];};

typedef
    __type_list<__align_type<unsigned char>,
    __type_list<__align_type<unsigned short>,
    __type_list<__align_type<unsigned int>,
    __type_list<__align_type<unsigned long>,
    __type_list<__align_type<unsigned long long>,
    __type_list<__align_type<double>,
    __type_list<__align_type<long double>,
    __type_list<__align_type<__struct_double>,
    __type_list<__align_type<__struct_double4>,
    __type_list<__align_type<int*>,
    __nat
    > > > > > > > > > > __all_types;

template <class _TL, size_t _Align> struct __find_pod;

template <class _Hp, size_t _Align>
struct __find_pod<__type_list<_Hp, __nat>, _Align>
{
    typedef typename conditional<
                             _Align == _Hp::value,
                             typename _Hp::type,
                             void
                         >::type type;
};

template <class _Hp, class _Tp, size_t _Align>
struct __find_pod<__type_list<_Hp, _Tp>, _Align>
{
    typedef typename conditional<
                             _Align == _Hp::value,
                             typename _Hp::type,
                             typename __find_pod<_Tp, _Align>::type
                         >::type type;
};

template <class _TL, size_t _Len> struct __find_max_align;

template <class _Hp, size_t _Len>
struct __find_max_align<__type_list<_Hp, __nat>, _Len> : public integral_constant<size_t, _Hp::value> {};

template <size_t _Len, size_t _A1, size_t _A2>
struct __select_align
{
private:
    static const size_t __min = _A2 < _A1 ? _A2 : _A1;
    static const size_t __max = _A1 < _A2 ? _A2 : _A1;
public:
    static const size_t value = _Len < __max ? __min : __max;
};

template <class _Hp, class _Tp, size_t _Len>
struct __find_max_align<__type_list<_Hp, _Tp>, _Len>
    : public integral_constant<size_t, __select_align<_Len, _Hp::value, __find_max_align<_Tp, _Len>::value>::value> {};

template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
struct _LIBCPP_TYPE_VIS_ONLY aligned_storage
{
    typedef typename __find_pod<__all_types, _Align>::type _Aligner;
    static_assert(!is_void<_Aligner>::value, "");
    union type
    {
        _Aligner __align;
        unsigned char __data[_Len];
    };
};

#if _LIBCPP_STD_VER > 11
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
    using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
#endif
# 1086 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
template <size_t _Len>\
struct _LIBCPP_TYPE_VIS_ONLY aligned_storage<_Len, n>\
{\
    struct _ALIGNAS(n) type\
    {\
        unsigned char __lx[_Len];\
    };\
}

_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x200);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x400);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x800);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1000);
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2000);
// MSDN says that MSVC does not support alignment beyond 8192 (=0x2000)
#if !defined(_LIBCPP_MSVC)
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4000);

template <size_t _I0, size_t ..._In>
struct __static_max;

template <size_t _I0>
struct __static_max<_I0>
{
    static const size_t value = _I0;
};

template <size_t _I0, size_t _I1, size_t ..._In>
struct __static_max<_I0, _I1, _In...>
{
    static const size_t value = _I0 >= _I1 ? __static_max<_I0, _In...>::value :
                                             __static_max<_I1, _In...>::value;
};

template <size_t _Len, class _Type0, class ..._Types>
struct aligned_union
{
    static const size_t alignment_value = __static_max<__alignof__(_Type0),
                                                       __alignof__(_Types)...>::value;
    static const size_t __len = __static_max<_Len, sizeof(_Type0),
                                             sizeof(_Types)...>::value;
    typedef typename aligned_storage<__len, alignment_value>::type type;
};

#if _LIBCPP_STD_VER > 11
template <size_t _Len, class ..._Types> using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
#endif
# 1151 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1153 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp>
struct __numeric_type
{
   static void __test(...);
   ;
   static long double __test(long double);

   typedef decltype(__test(declval<_Tp>())) type;
   static const bool value = !is_same<type, void>::value;
};

template <>
struct __numeric_type<void>
{
   static const bool value = true;
};

// __promote

template <class _A1, class _A2 = void, class _A3 = void,
          bool = __numeric_type<_A1>::value &&
                 __numeric_type<_A2>::value &&
                 __numeric_type<_A3>::value>
class __promote
{
    static const bool value = false;
};


#ifdef _LIBCPP_STORE_AS_OPTIMIZATION

// __transform

template <class _Tp, size_t = sizeof(_Tp), bool = is_scalar<_Tp>::value> struct __transform {typedef _Tp type;};
template <class _Tp> struct __transform<_Tp, 1, true> {typedef unsigned char      type;};
template <class _Tp> struct __transform<_Tp, 2, true> {typedef unsigned short     type;};
template <class _Tp> struct __transform<_Tp, 4, true> {typedef unsigned int       type;};
template <class _Tp> struct __transform<_Tp, 8, true> {typedef unsigned long long type;};

#endif  // _LIBCPP_STORE_AS_OPTIMIZATION
# 1233 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// make_signed / make_unsigned

typedef
    __type_list<signed char,
    __type_list<signed short,
    __type_list<signed int,
    __type_list<signed long,
    __type_list<signed long long,
    __nat
    > > > > > __signed_types;


template <class _TypeList, size_t _Size, bool = _Size <= sizeof(typename _TypeList::_Head)> struct __find_first;

template <class _Hp, class _Tp, size_t _Size>
struct __find_first<__type_list<_Hp, _Tp>, _Size, true>
{
    typedef _Hp type;
};

template <class _Hp, class _Tp, size_t _Size>
struct __find_first<__type_list<_Hp, _Tp>, _Size, false>
{
    typedef typename __find_first<_Tp, _Size>::type type;
};

template <class _Tp, class _Up, bool = is_const<typename remove_reference<_Tp>::type>::value,
                             bool = is_volatile<typename remove_reference<_Tp>::type>::value>
struct __apply_cv
{
    typedef _Up type;
};

template <class _Tp, class _Up>
struct __apply_cv<_Tp, _Up, true, false>
{
    typedef const _Up type;
};

template <class _Tp, class _Up>
struct __apply_cv<_Tp, _Up, false, true>
{
    typedef volatile _Up type;
};

template <class _Tp, class _Up>
struct __apply_cv<_Tp, _Up, true, true>
{
    typedef const volatile _Up type;
};

template <class _Tp, class _Up>
struct __apply_cv<_Tp&, _Up, false, false>
{
    typedef _Up& type;
};

template <class _Tp, class _Up>
struct __apply_cv<_Tp&, _Up, true, false>
{
    typedef const _Up& type;
};

template <class _Tp, class _Up>
struct __apply_cv<_Tp&, _Up, false, true>
{
    typedef volatile _Up& type;
};

template <class _Tp, class _Up>
struct __apply_cv<_Tp&, _Up, true, true>
{
    typedef const volatile _Up& type;
};

template <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value>
struct __make_signed {};

template <class _Tp>
struct __make_signed<_Tp, true>
{
    typedef typename __find_first<__signed_types, sizeof(_Tp)>::type type;
};

#if _LIBCPP_STD_VER > 11
template <class _Tp> using make_signed_t = typename make_signed<_Tp>::type;
#endif
# 1345 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value>
struct __make_unsigned {};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY make_unsigned
{
    typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
};

#if _LIBCPP_STD_VER > 11
# 1402 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
public:
    typedef typename remove_reference<decltype(true ? __t() : __u())>::type type;
};

#else  // _LIBCPP_HAS_NO_VARIADICS
# 1407 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class ..._Tp> struct common_type;

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp>
{
    typedef typename decay<_Tp>::type type;
};

template <class _Tp, class _Up>
struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up>
{
private:
    static _Tp&& __t();
    static _Up&& __u();
    static bool __f();
public:
    typedef typename decay<decltype(__f() ? __t() : __u())>::type type;
};

template <class _Tp, class _Up, class ..._Vp>
struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up, _Vp...>
{
    typedef typename common_type<typename common_type<_Tp, _Up>::type, _Vp...>::type type;
};

#if _LIBCPP_STD_VER > 11
template <class ..._Tp> using common_type_t = typename common_type<_Tp...>::type;
#endif
# 1436 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1438 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_assignable

template<typename, typename _Tp> struct __select_2nd { typedef _Tp type; };

template <class _Tp, class _Arg>
typename __select_2nd<decltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>())), true_type>::type
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__is_assignable_test(_Tp&&, _Arg&&);
#else
# 1448 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
__is_assignable_test(_Tp, _Arg&);
#endif
# 1450 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Arg>
false_type
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__is_assignable_test(__any, _Arg&&);
#else
# 1456 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
__is_assignable_test(__any, _Arg&);
#endif
# 1458 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp, class _Arg, bool = is_void<_Tp>::value || is_void<_Arg>::value>
struct __is_assignable_imp
    : public common_type
        <
            decltype(__is_assignable_test(declval<_Tp>(), declval<_Arg>()))
        >::type {};

template <class _Tp, class _Arg>
struct __is_assignable_imp<_Tp, _Arg, true>
    : public false_type
{
};

template <class _Tp, class _Arg>
struct is_assignable
    : public __is_assignable_imp<_Tp, _Arg> {};

// is_copy_assignable

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_copy_assignable
    : public is_assignable<typename add_lvalue_reference<_Tp>::type,
                     const typename add_lvalue_reference<_Tp>::type> {};

// is_move_assignable

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_move_assignable
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    : public is_assignable<typename add_lvalue_reference<_Tp>::type,
                     const typename add_rvalue_reference<_Tp>::type> {};
#else
# 1489 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : public is_copy_assignable<_Tp> {};
#endif
# 1491 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_destructible

template <class _Tp>
struct __destructible_test
{
    _Tp __t;
};

template <class _Tp>
decltype((_VSTD::declval<__destructible_test<_Tp> >().~__destructible_test<_Tp>(), true_type()))
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
__is_destructible_test(_Tp&&);
#else
# 1505 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
__is_destructible_test(_Tp&);
#endif
# 1507 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

false_type
__is_destructible_test(__any);

template <class _Tp, bool = is_void<_Tp>::value || is_abstract<_Tp>::value
                                                || is_function<_Tp>::value>
struct __destructible_imp
    : public common_type
        <
            decltype(__is_destructible_test(declval<_Tp>()))
        >::type {};

template <class _Tp>
struct __destructible_imp<_Tp, true>
    : public false_type {};

template <class _Tp>
struct is_destructible
    : public __destructible_imp<_Tp> {};

template <class _Tp>
struct is_destructible<_Tp[]>
    : public false_type {};

// move

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename remove_reference<_Tp>::type&&
move(_Tp&& __t) _NOEXCEPT
{
    typedef typename remove_reference<_Tp>::type _Up;
    return static_cast<_Up&&>(__t);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp&&
forward(typename std::remove_reference<_Tp>::type& __t) _NOEXCEPT
{
    return static_cast<_Tp&&>(__t);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp&&
forward(typename std::remove_reference<_Tp>::type&& __t) _NOEXCEPT
{
    static_assert(!std::is_lvalue_reference<_Tp>::value,
                  "Can not forward an rvalue as an lvalue.");
    return static_cast<_Tp&&>(__t);
}

#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1563 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp>
    _LIBCPP_INLINE_VISIBILITY
    explicit __rv(_Trr& __t) : t_(__t) {}
};

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1602 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

#else
# 1614 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename decay<_Tp>::type
__decay_copy(const _Tp& __t)
{
    return _VSTD::forward<_Tp>(__t);
}

#endif
# 1624 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _MP, bool _IsMemberFuctionPtr, bool _IsMemberObjectPtr>
struct __member_pointer_traits_imp
{
};

#ifndef _LIBCPP_HAS_NO_VARIADICS


template <class _Rp, class _Class, class _P0>
struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const volatile, true, false>
{
    typedef _Class const volatile _ClassType;
    typedef _Rp _ReturnType;
};

template <class _Rp, class _Class, class _P0, class _P1>
struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const volatile, true, false>
{
    typedef _Class const volatile _ClassType;
    typedef _Rp _ReturnType;
};

template <class _Rp, class _Class, class _P0, class _P1, class _P2>
struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const volatile, true, false>
{
    typedef _Class const volatile _ClassType;
    typedef _Rp _ReturnType;
};

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1835 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Rp, class _Class>
struct __member_pointer_traits_imp<_Rp _Class::*, false, true>
{
    typedef _Class _ClassType;
    typedef _Rp _ReturnType;
};

template <class _MP>
struct __member_pointer_traits
    : public __member_pointer_traits_imp<typename remove_cv<_MP>::type,
                    is_member_function_pointer<_MP>::value,
                    is_member_object_pointer<_MP>::value>
{
//     typedef ... _ClassType;
//     typedef ... _ReturnType;
};

// result_of

template <class _Callable> class result_of;

#ifdef _LIBCPP_HAS_NO_VARIADICS

template <class _Fn, bool, bool>
class __result_of
                        >
{
};

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2004 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class ..._Args>
false_type
__is_constructible_test(__any, _Args&& ...);

template <bool, class _Tp, class... _Args>
struct __is_constructible // false, _Tp is not a scalar
    : public common_type
             <
                 decltype(__is_constructible_test(declval<_Tp>(), declval<_Args>()...))
             >::type
    {};

//      function types are not constructible

template <class _Rp, class... _A1, class... _A2>
struct __is_constructible<false, _Rp(_A1...), _A2...>
    : public false_type
    {};

//      handle scalars and reference types

//      Scalars are default constructible, references are not

template <class _Tp>
struct __is_constructible_ref
{
    true_type static __lxx(_Tp);
    false_type static __lxx(...);
};

template <class _Tp, class _A0>
struct __is_constructible<true, _Tp, _A0>
    : public common_type
             <
                 decltype(__is_constructible_ref<_Tp>::__lxx(declval<_A0>()))
             >::type
    {};

//      Scalars and references are not constructible from multiple args.
template <bool, class _Tp, class... _Args>
struct __is_constructible_void_check
    : public __is_constructible<is_scalar<_Tp>::value || is_reference<_Tp>::value,
                                _Tp, _Args...>
    {};

//      If any of T or Args is void, is_constructible should be false

template <class _Tp, class... _Args>
struct __is_constructible_void_check<true, _Tp, _Args...>
    : public false_type
    {};

template <class ..._Args> struct __contains_void;

template <> struct __contains_void<> : false_type {};

template <class _A0, class ..._Args>
struct __contains_void<_A0, _Args...>
{
    static const bool value = is_void<_A0>::value ||
                              __contains_void<_Args...>::value;
};

//      is_constructible entry point

template <class _Tp, class... _Args>
struct _LIBCPP_TYPE_VIS_ONLY is_constructible
    : public __is_constructible_void_check<__contains_void<_Tp, _Args...>::value
                                        || is_abstract<_Tp>::value,
                                           _Tp, _Args...>
    {};
//      Incomplete array types are not constructible

template <class _Ap, class ..._Args>
struct __is_constructible<false, _Ap[], _Args...>
    : public false_type
    {};

#else  // _LIBCPP_HAS_NO_VARIADICS

//      Array types are default constructible if their element type
    : public false_type
    {};

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2307 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3


template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_copy_constructible
    : public is_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type>
    {};

// is_move_constructible

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_move_constructible
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    : public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
#else
# 2329 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : public is_copy_constructible<_Tp>
#endif
# 2331 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    {};

// is_trivially_constructible

#ifndef _LIBCPP_HAS_NO_VARIADICS

#if __has_feature(is_trivially_constructible)
# 2346 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp, class... _Args>
struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible
    : false_type
{
};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp>
#if __has_feature(has_trivial_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
    : integral_constant<bool, __has_trivial_constructor(_Tp)>
#else
# 2358 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : integral_constant<bool, is_scalar<_Tp>::value>
#endif
# 2360 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
{
};

template <class _Tp>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&&>
#else
# 2367 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp>
#endif
# 2369 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : integral_constant<bool, is_scalar<_Tp>::value>
{
};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, const _Tp&>
    : integral_constant<bool, is_scalar<_Tp>::value>
{
};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&>
    : integral_constant<bool, is_scalar<_Tp>::value>
{
};

#endif  // !__has_feature(is_trivially_constructible)
# 2386 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#else  // _LIBCPP_HAS_NO_VARIADICS

#if __has_feature(is_trivially_constructible)

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, __is_construct::__nat,
                                                       __is_construct::__nat>
    : integral_constant<bool, __is_trivially_constructible(_Tp)>
{
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&,
                                                       __is_construct::__nat>
    : integral_constant<bool, is_scalar<_Tp>::value>
{
};

#endif  // !__has_feature(is_trivially_constructible)
# 2457 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2459 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_trivially_default_constructible

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_default_constructible
    : public is_trivially_constructible<_Tp>
    {};

// is_trivially_copy_constructible

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_constructible
    : public is_trivially_constructible<_Tp, typename add_lvalue_reference<const _Tp>::type>
    {};

// is_trivially_move_constructible

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_constructible
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    : public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
#else
# 2478 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : public is_trivially_copy_constructible<_Tp>
#endif
# 2480 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    {};

// is_trivially_assignable

#if __has_feature(is_trivially_constructible)
# 2493 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp, class _Arg>
struct is_trivially_assignable
    : public false_type {};

template <class _Tp>
struct is_trivially_assignable<_Tp&, _Tp>
    : integral_constant<bool, is_scalar<_Tp>::value> {};

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp>
struct is_trivially_assignable<_Tp&, _Tp&&>
    : integral_constant<bool, is_scalar<_Tp>::value> {};

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2517 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#endif  // !__has_feature(is_trivially_constructible)
# 2519 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_trivially_copy_assignable

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_assignable
    : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
                               const typename add_lvalue_reference<_Tp>::type>
    {};

// is_trivially_move_assignable

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_assignable
    {};

// is_trivially_destructible

#if __has_feature(has_trivial_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
    : public integral_constant<bool, __has_trivial_destructor(_Tp)> {};

#else  // _LIBCPP_HAS_TYPE_TRAITS
# 2546 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp> struct __libcpp_trivial_destructor
    : public integral_constant<bool, is_scalar<_Tp>::value ||
                                     is_reference<_Tp>::value> {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
    : public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {};

#endif  // _LIBCPP_HAS_TYPE_TRAITS
# 2555 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_nothrow_constructible

#ifndef _LIBCPP_HAS_NO_VARIADICS

#if __has_feature(cxx_noexcept)

template <bool, class _Tp, class... _Args> struct __is_nothrow_constructible;

template <class _Tp, class... _Args>
struct __is_nothrow_constructible<true, _Tp, _Args...>
    : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
{
};

template <class _Tp, class... _Args>
struct __is_nothrow_constructible<false, _Tp, _Args...>
    : public false_type
{
};

template <class _Tp, class... _Args>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
    : __is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, _Tp, _Args...>
{
};

template <class _Tp, size_t _Ns>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp[_Ns]>
    : __is_nothrow_constructible<is_constructible<_Tp>::value, _Tp>
{
};

#else  // __has_feature(cxx_noexcept)
# 2589 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
{
};

template <class _Tp>
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&&>
#else
# 2610 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
#endif
# 2617 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
{
};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&>
#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
    : integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
# 2625 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : integral_constant<bool, is_scalar<_Tp>::value>
#endif
# 2627 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
{
};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&>
#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
    : integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
# 2635 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : integral_constant<bool, is_scalar<_Tp>::value>
#endif
# 2637 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
{
};

#endif  // __has_feature(cxx_noexcept)
# 2641 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#else  // _LIBCPP_HAS_NO_VARIADICS
# 2643 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp, class _A0 = __is_construct::__nat,
                     class _A1 = __is_construct::__nat>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
    : false_type
{
};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, __is_construct::__nat,
                                                       __is_construct::__nat>
#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
    : integral_constant<bool, __has_nothrow_constructor(_Tp)>
#else
# 2657 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : integral_constant<bool, is_scalar<_Tp>::value>
#endif
# 2659 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
{
};

template <class _Tp>

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&,
                                                       __is_construct::__nat>
#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
    : integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
# 2690 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : integral_constant<bool, is_scalar<_Tp>::value>
#endif
# 2692 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
{
};

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2696 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_nothrow_default_constructible

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_default_constructible
    : public is_nothrow_constructible<_Tp>
    {};

// is_nothrow_copy_constructible

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_constructible
    : public is_nothrow_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type>
    {};

// is_nothrow_move_constructible

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_constructible
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
#else
# 2715 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : public is_nothrow_copy_constructible<_Tp>
#endif
# 2717 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    {};

// is_nothrow_assignable

#if __has_feature(cxx_noexcept)

template <bool, class _Tp, class _Arg> struct __is_nothrow_assignable;

template <class _Tp, class _Arg>
struct __is_nothrow_assignable<false, _Tp, _Arg>
    : public false_type
{
};

template <class _Tp, class _Arg>
struct __is_nothrow_assignable<true, _Tp, _Arg>
    : public integral_constant<bool, noexcept(_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>()) >
{
};

template <class _Tp, class _Arg>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable
    : public __is_nothrow_assignable<is_assignable<_Tp, _Arg>::value, _Tp, _Arg>
{
};
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp>
#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
    : integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
# 2780 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : integral_constant<bool, is_scalar<_Tp>::value> {};
#endif
# 2782 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2784 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#endif  // __has_feature(cxx_noexcept)
# 2786 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_nothrow_copy_assignable

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_assignable
    : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
                               const typename add_lvalue_reference<_Tp>::type>
    {};

// is_nothrow_move_assignable

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_assignable
    : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
                                     typename add_rvalue_reference<_Tp>::type>
#else
# 2801 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
                                     typename add_lvalue_reference<_Tp>::type>
#endif
# 2803 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    {};

// is_nothrow_destructible

#if __has_feature(cxx_noexcept)

template <bool, class _Tp> struct __is_nothrow_destructible;

template <class _Tp>
struct __is_nothrow_destructible<false, _Tp>
    : public false_type
{
};

template <class _Tp>
struct __is_nothrow_destructible<true, _Tp>
    : public integral_constant<bool, noexcept(_VSTD::declval<_Tp>().~_Tp()) >
{
};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible
    : public __is_nothrow_destructible<is_destructible<_Tp>::value, _Tp>
{
};

template <class _Tp, size_t _Ns>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp[_Ns]>
    : public is_nothrow_destructible<_Tp>
{
};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp&>
    : public true_type
{
};

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp&&>
    : public true_type
{
};

#endif
# 2850 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#else
# 2852 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp> struct __libcpp_nothrow_destructor
    : public integral_constant<bool, is_scalar<_Tp>::value ||
                                     is_reference<_Tp>::value> {};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible
    : public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};

#endif
# 2861 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_pod

#if __has_feature(is_pod) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pod
    : public integral_constant<bool, __is_pod(_Tp)> {};


#endif  // _LIBCPP_HAS_TYPE_TRAITS
# 2878 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

// is_literal_type;

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_literal_type
#if __has_feature(is_literal)
    : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
#endif
# 2898 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    {};
    
// is_trivially_copyable;

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copyable
#if __has_feature(is_trivially_copyable)
    : public integral_constant<bool, __is_trivially_copyable(_Tp)>
#else
# 2906 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
#endif
# 2908 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    {};
    
// is_trivial;

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivial
#if __has_feature(is_trivial)
    : public integral_constant<bool, __is_trivial(_Tp)>
#else
# 2916 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    : integral_constant<bool, is_trivially_copyable<_Tp>::value &&
                                 is_trivially_default_constructible<_Tp>::value>
#endif
# 2919 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
    {};

#ifndef _LIBCPP_HAS_NO_VARIADICS

// Check for complete types

template <class ..._Tp> struct __check_complete;

template <>
struct __check_complete<>
{
};
template <class _Hp>
struct __check_complete<_Hp, _Hp>
    : private __check_complete<_Hp>
{
};

template <class _Tp>
struct __check_complete<_Tp>
{
    static_assert(sizeof(_Tp) > 0, "Type must be complete.");
};

template <class _Tp>
struct __check_complete<_Tp&>
    : private __check_complete<_Tp>
{
};

template <class _Tp>
struct __check_complete<_Tp&&>
    : private __check_complete<_Tp>
{
};

template <class _Rp, class ..._Param>
struct __check_complete<_Rp (*)(_Param...)>
    : private __check_complete<_Rp>
{
};

template <class ..._Param>
struct __check_complete<void (*)(_Param...)>
{
};

template <class _Rp, class ..._Param>
struct __check_complete<_Rp (_Param...)>
    : private __check_complete<_Rp>
{
};

template <class ..._Param>
struct __check_complete<void (_Param...)>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...)>
    : private __check_complete<_Class>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) const>
    : private __check_complete<_Class>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) volatile>
    : private __check_complete<_Class>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) const volatile>
    : private __check_complete<_Class>
{
};

#if __has_feature(cxx_reference_qualified_functions)

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) &>
    : private __check_complete<_Class>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) const&>
    : private __check_complete<_Class>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) volatile&>
    : private __check_complete<_Class>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&>
    : private __check_complete<_Class>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) &&>
    : private __check_complete<_Class>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) const&&>
    : private __check_complete<_Class>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) volatile&&>
    : private __check_complete<_Class>
{
};

template <class _Rp, class _Class, class ..._Param>
struct __check_complete<_Rp (_Class::*)(_Param...) const volatile&&>
    : private __check_complete<_Class>
{
};

#endif
# 3060 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Rp, class _Class>
struct __check_complete<_Rp _Class::*>
    : private __check_complete<_Class>
{
};

// __invoke forward declarations

// fall back - none of the bullets

template <class ..._Args>
auto
__invoke(__any, _Args&& ...__args)
    -> __nat;

// bullets 1 and 2

template <class _Fp, class _A0, class ..._Args,
            class = typename enable_if
            <
                is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
                is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
                           typename remove_reference<_A0>::type>::value
            >::type
         >
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
    -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));

template <class _Fp, class _A0, class ..._Args,
            class = typename enable_if
            <
                is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
                !is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
                           typename remove_reference<_A0>::type>::value
            >::type
         >
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
    -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));

// bullets 3 and 4

template <class _Fp, class _A0,
            class = typename enable_if
            <
                is_member_object_pointer<typename remove_reference<_Fp>::type>::value &&
                is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
                           typename remove_reference<_A0>::type>::value
            >::type
         >
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0)
    -> decltype(_VSTD::forward<_A0>(__a0).*__f);

template <class _Fp, class _A0,
            class = typename enable_if
            <
                is_member_object_pointer<typename remove_reference<_Fp>::type>::value &&
                !is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
                           typename remove_reference<_A0>::type>::value
            >::type
         >
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0)
    -> decltype((*_VSTD::forward<_A0>(__a0)).*__f);

// bullet 5

template <class _Fp, class ..._Args>
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _Args&& ...__args)
    -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...));

// __invokable

template <class _Fp, class ..._Args>
struct __invokable_imp
    : private __check_complete<_Fp>
{
    typedef decltype(
            __invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...)
                    ) type;
    static const bool value = !is_same<type, __nat>::value;
};

template <class _Fp, class ..._Args>
struct __invokable
    : public integral_constant<bool,
          __invokable_imp<_Fp, _Args...>::value>
{
};

// __invoke_of

template <bool _Invokable, class _Fp, class ..._Args>
struct __invoke_of_imp  // false
{
};

template <class _Fp, class ..._Args>
struct __invoke_of_imp<true, _Fp, _Args...>
{
    typedef typename __invokable_imp<_Fp, _Args...>::type type;
};

template <class _Fp, class ..._Args>
struct __invoke_of
    : public __invoke_of_imp<__invokable<_Fp, _Args...>::value, _Fp, _Args...>
{
};

template <class _Fp, class ..._Args>
class _LIBCPP_TYPE_VIS_ONLY result_of<_Fp(_Args...)>
    : public __invoke_of<_Fp, _Args...>
{
};

#if _LIBCPP_STD_VER > 11
template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
#endif
# 3187 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 3189 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
typename enable_if
<
    is_move_constructible<_Tp>::value &&
    is_move_assignable<_Tp>::value
>::type
#else
# 3199 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
void
#endif
# 3201 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
swap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value &&
                                    is_nothrow_move_assignable<_Tp>::value)
{
    _Tp __t(_VSTD::move(__x));
    __x = _VSTD::move(__y);
    __y = _VSTD::move(__t);
}

template <class _ForwardIterator1, class _ForwardIterator2>
inline _LIBCPP_INLINE_VISIBILITY
void
iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
    //                                  _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b)))
               _NOEXCEPT_(_NOEXCEPT_(swap(*_VSTD::declval<_ForwardIterator1>(),
                                          *_VSTD::declval<_ForwardIterator2>())))
{
    swap(*__a, *__b);
}

// __swappable

namespace __detail
{

using _VSTD::swap;
;

template <class _Tp>
struct __swappable
{
    typedef decltype(swap(_VSTD::declval<_Tp&>(), _VSTD::declval<_Tp&>())) type;
    static const bool value = !is_same<type, __nat>::value;
};

}  // __detail

template <class _Tp>
struct __is_swappable
    : public integral_constant<bool, __detail::__swappable<_Tp>::value>
{
};

#if __has_feature(cxx_noexcept)

template <bool, class _Tp>
struct __is_nothrow_swappable_imp
    : public integral_constant<bool, noexcept(swap(_VSTD::declval<_Tp&>(),
                                                   _VSTD::declval<_Tp&>()))>
{
};

template <class _Tp>
struct __is_nothrow_swappable_imp<false, _Tp>
    : public false_type
{
};

template <class _Tp>
struct __is_nothrow_swappable
    : public __is_nothrow_swappable_imp<__is_swappable<_Tp>::value, _Tp>
{
};

#else  // __has_feature(cxx_noexcept)
# 3265 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp>
struct __is_nothrow_swappable
    : public false_type
{
};

#endif  // __has_feature(cxx_noexcept)
# 3273 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#ifdef _LIBCXX_UNDERLYING_TYPE

template <class _Tp>
struct underlying_type
{
    typedef _LIBCXX_UNDERLYING_TYPE(_Tp) type;
};

#if _LIBCPP_STD_VER > 11
template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type;
#endif
# 3285 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#else  // _LIBCXX_UNDERLYING_TYPE
# 3287 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

template <class _Tp, bool _Support = false>
struct underlying_type
{
    static_assert(_Support, "The underyling_type trait requires compiler "
                            "support. Either no such support exists or "
                            "libc++ does not know how to use it.");
};

#endif // _LIBCXX_UNDERLYING_TYPE
# 3297 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE

template <class _Tp>
struct __has_operator_addressof_imp
{
    template <class>
        static auto __test(__any) -> false_type;
    template <class _Up>
        static auto __test(_Up* __u)
            -> typename __select_2nd<decltype(__u->operator&()), true_type>::type;

    static const bool value = decltype(__test<_Tp>(nullptr))::value;
};

template <class _Tp>
struct __has_operator_addressof
    : public integral_constant<bool, __has_operator_addressof_imp<_Tp>::value>
{};

#endif  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
# 3318 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_TYPE_TRAITS
# 3322 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits" 3
# 625 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <cstring>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring" 1 3
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CSTRING
#define _LIBCPP_CSTRING

/*
    cstring synopsis

 * 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.
 *
 *	@(#)string.h	8.1 (Berkeley) 6/2/93
 */

#ifndef _STRING_H_
#define	_STRING_H_

#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types.h" 1 3 4
/*
 * Copyright (c) 2004, 2008, 2009 Apple Inc. All rights reserved.
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef __TYPES_H_
#define __TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 1 3 4
/*
 * Copyright (c) 2003-2007 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _SYS__TYPES_H_
#define _SYS__TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 1 3 4
/*
 * 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.
 *
 *	@(#)cdefs.h	8.8 (Berkeley) 1/9/95
 */

#ifndef	_CDEFS_H_
#define	_CDEFS_H_

#if defined(__cplusplus)
#define	__BEGIN_DECLS	extern "C" {
#define	__END_DECLS	}
#else
# 74 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#define	__BEGIN_DECLS
#define	__END_DECLS
#endif
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

/* This SDK is designed to work with clang and specific versions of
 * gcc >= 4.0 with Apple's patch sets */
#if !defined(__GNUC__) || __GNUC__ < 4
#warning "Unsupported compiler detected"
#endif
# 83 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

/*
 * The __CONCAT macro is used to concatenate parts of symbol names, e.g.
 * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
 * The __CONCAT macro is a bit tricky -- make sure you don't put spaces
 * in between its arguments.  __CONCAT can also concatenate double-quoted
 * strings produced by the __STRING macro, but this only works with ANSI C.
 */
#if defined(__STDC__) || defined(__cplusplus)
#define	__P(protos)	protos		/* full-blown ANSI C */
#define	__CONCAT(x,y)	x ## y
#define	__STRING(x)	#x

#define	__const		const		/* define reserved names to standard */
#define	__signed	signed
#define	__volatile	volatile
#if defined(__cplusplus)
#define	__inline	inline		/* convert to C++ keyword */
#else
# 102 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#define	signed		__signed
#define	volatile	__volatile
#endif /* !NO_ANSI_KEYWORDS */
# 133 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#endif /* !(__STDC__ || __cplusplus) */
# 134 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

#define __dead2		__attribute__((noreturn))
#define __pure2		__attribute__((const))

/* __unused denotes variables and functions that may not be used, preventing
 * the compiler from warning about it if not used.
 */
#define __unused	__attribute__((unused))

/* __used forces variables and functions to be included even if it appears
 * This may require turning on such warning with the -Wdeprecated flag.
 * __deprecated_enum_msg() should be used on enums, and compilers that support
 * it will print the deprecation warning.
 */
#define __deprecated	__attribute__((deprecated))

#ifdef __has_extension
    #if __has_extension(attribute_deprecated_with_message)
        #define __deprecated_msg(_msg) __attribute__((deprecated(_msg)))
    #else
# 162 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
        #define __deprecated_msg(_msg) __attribute__((deprecated))
    #endif
# 164 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#elif defined(__GNUC__) && ((__GNUC__ >= 5) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))
# 165 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
# 177 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
    #define __deprecated_enum_msg(_msg)
#endif
# 179 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

/* __unavailable causes the compiler to error out when encountering
 * code using the tagged function of variable.
 */

/*
 * We use `__restrict' as a way to define the `restrict' type qualifier
 * without disturbing older software that is unaware of C99 keywords.
 */
#if __STDC_VERSION__ < 199901
#define __restrict
#else
# 198 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#define __restrict	restrict
#endif
# 200 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

/* Declaring inline functions within headers is error-prone due to differences
 * across various versions of the C language and extensions.  __header_inline
 * can be used to declare inline functions within system headers.  In cases
 * The check for !__GNUC__ || __clang__ is because gcc doesn't correctly
 * support c99 inline in some cases:
 * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55965
 */

#if defined(__cplusplus) || \
    (__STDC_VERSION__ >= 199901L && \
     !defined(__GNUC_GNU_INLINE__) && \
     (!defined(__GNUC__) || defined(__clang__)))
# define __header_inline           inline
#elif defined(__GNUC__) && defined(__GNUC_STDC_INLINE__)
# 223 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
# define __header_inline           extern __inline __attribute__((__gnu_inline__))
#elif defined(__GNUC__)
# 225 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
# define __header_inline           extern __inline
#else
# 227 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
  /* If we land here, we've encountered an unsupported compiler,
   * so hopefully it understands static __inline as a fallback.
   */
# define __header_inline           static __inline
#endif
# 232 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

#ifdef __GNUC__
# define __header_always_inline    __header_inline __attribute__ ((__always_inline__))
#else
# 236 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
  /* Unfortunately, we're using a compiler that we don't know how to force to
   * inline.  Oh well.
   */
# define __header_always_inline    __header_inline
#endif
# 241 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

/*
 * Compiler-dependent macros that bracket portions of code where the
 * "-Wunreachable-code" warning should be ignored. Please use sparingly.
 */
#if defined(__clang__)
# define __unreachable_ok_push \
         _Pragma("clang diagnostic push") \
         _Pragma("clang diagnostic ignored \"-Wunreachable-code\"")
# define __unreachable_ok_pop \
         _Pragma("clang diagnostic pop")
#elif defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
# 253 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
# define __unreachable_ok_pop
#endif
# 262 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

/*
 * Compiler-dependent macros to declare that functions take printf-like
 * or scanf-like arguments.  They are null except for versions of gcc
 * that are known to support the features properly.  Functions declared
 * with these attributes will cause compilation warnings if there is a
 * mismatch between the format string and subsequent function parameter
 * types.
 */
#define __printflike(fmtarg, firstvararg) \
		__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#define __scanflike(fmtarg, firstvararg) \
		__attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#ifndef	__DEQUALIFY
#define	__DEQUALIFY(type, var)	__CAST_AWAY_QUALIFIER(var, const volatile, type)
#endif
# 310 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

/*
 * COMPILATION ENVIRONMENTS -- see compat(5) for additional detail
 *
 * pre-10.5, and it is the default compilation environment, revert the
 * compilation environment to pre-__DARWIN_UNIX03.
 */
#if !defined(__DARWIN_ONLY_UNIX_CONFORMANCE)
#  if defined(__LP64__)
#    define __DARWIN_ONLY_UNIX_CONFORMANCE 1
#  else /* !__LP64__ */
# 376 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#    define __DARWIN_ONLY_UNIX_CONFORMANCE 0
#  endif /* __LP64__ */
# 378 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#endif /* !__DARWIN_ONLY_UNIX_CONFORMANCE */
# 379 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

#if !defined(__DARWIN_UNIX03)
#  if   __DARWIN_ONLY_UNIX_CONFORMANCE
# 432 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#    define __DARWIN_VERS_1050 1
#  endif
# 434 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#endif /* !__DARWIN_VERS_1050 */
# 435 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

#if !defined(__DARWIN_NON_CANCELABLE)
#  if __DARWIN_ONLY_UNIX_CONFORMANCE
#    define __DARWIN_SUF_UNIX03		/* nothing */
#  else /* !__DARWIN_ONLY_UNIX_CONFORMANCE */
# 447 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#    define __DARWIN_SUF_UNIX03		"$UNIX2003"
#  endif /* __DARWIN_ONLY_UNIX_CONFORMANCE */
# 449 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

#  if __DARWIN_64_BIT_INO_T
#    if __DARWIN_ONLY_64_BIT_INO_T
#      define __DARWIN_SUF_64_BIT_INO_T	/* nothing */
#    else /* !__DARWIN_ONLY_64_BIT_INO_T */
# 454 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#      define __DARWIN_SUF_64_BIT_INO_T	"$INODE64"
#    endif /* __DARWIN_ONLY_64_BIT_INO_T */
# 456 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#  else /* !__DARWIN_64_BIT_INO_T */
# 457 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#    define __DARWIN_SUF_64_BIT_INO_T	/* nothing */
#  endif /* __DARWIN_64_BIT_INO_T */
# 459 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

#  if __DARWIN_VERS_1050
#    if __DARWIN_ONLY_VERS_1050
#      define __DARWIN_SUF_1050		/* nothing */
#    else /* !__DARWIN_ONLY_VERS_1050 */
# 464 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#      define __DARWIN_SUF_1050		"$1050"
#    endif /* __DARWIN_ONLY_VERS_1050 */
# 466 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#  else /* !__DARWIN_VERS_1050 */
# 467 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#    define __DARWIN_SUF_NON_CANCELABLE	/* nothing */
#  endif /* __DARWIN_NON_CANCELABLE */
# 475 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

#else /* !__DARWIN_UNIX03 */
# 477 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#  define __DARWIN_SUF_UNIX03		/* nothing */
#  define __DARWIN_SUF_64_BIT_INO_T	/* nothing */
#  define __DARWIN_SUF_NON_CANCELABLE	/* nothing */
#  define __DARWIN_SUF_1050		/* nothing */
#endif /* __DARWIN_UNIX03 */
# 482 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

#define __DARWIN_SUF_EXTSN		"$DARWIN_EXTSN"

/*
 * symbol versioning macros
 */
#define __DARWIN_ALIAS(sym)		__asm("_" __STRING(sym) __DARWIN_SUF_UNIX03)
#define __DARWIN_ALIAS_C(sym)		__asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03)
#define __DARWIN_ALIAS_I(sym)		__asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T __DARWIN_SUF_UNIX03)
#define __DARWIN_NOCANCEL(sym)  	__asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE)
#define __DARWIN_INODE64(sym)		__asm("_" __STRING(sym) __DARWIN_SUF_64_BIT_INO_T)


#if defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 40100
#define __DARWIN_ALIAS_STARTING_IPHONE___IPHONE_4_1(x) x
#define __DARWIN_ALIAS_STARTING(_mac, _iphone, x)
#endif
# 515 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4


/*
 * POSIX.1 requires that the macros we test be defined before any standard
 * header file is included.  This permits us to convert values for feature
 * testing, as necessary, using only _POSIX_C_SOURCE.
 *
 * Here's a quick run-down of the versions:
 *  defined(_POSIX_SOURCE)		1003.1-1988
 *  _POSIX_C_SOURCE == 1L		1003.1-1990
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _CDEFS_H_
# error "Never use <sys/_posix_availability.h> directly.  Use <sys/cdefs.h> instead."
#endif
# 31 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_posix_availability.h" 3 4

#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 198808L
#define ___POSIX_C_DEPRECATED_STARTING_198808L __deprecated
#else
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_posix_availability.h" 3 4
#define ___POSIX_C_DEPRECATED_STARTING_200112L
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_posix_availability.h" 3 4

#if !defined(_DARWIN_C_SOURCE) && defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200809L
#define ___POSIX_C_DEPRECATED_STARTING_200809L __deprecated
#else
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_posix_availability.h" 3 4
#define ___POSIX_C_DEPRECATED_STARTING_200809L
#endif
# 73 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_posix_availability.h" 3 4

# 573 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 2 3 4

#define __POSIX_C_DEPRECATED(ver) ___POSIX_C_DEPRECATED_STARTING_##ver
#define __DARWIN_C_FULL         900000L

#if   defined(_ANSI_SOURCE)
#define __DARWIN_C_LEVEL        __DARWIN_C_ANSI
#elif defined(_POSIX_C_SOURCE) && !defined(_DARWIN_C_SOURCE) && !defined(_NONSTD_SOURCE)
# 588 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#define __DARWIN_C_LEVEL        _POSIX_C_SOURCE
#else
# 590 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#define __DARWIN_C_LEVEL        __DARWIN_C_FULL
#endif
# 592 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

/* If the developer has neither requested a strict language mode nor a version
 * of POSIX, turn on functionality provided by __STDC_WANT_LIB_EXT1__ as part
#if __DARWIN_UNIX03
/*
 * Architecture validation for current SDK
 */
#if   !defined(__sys_cdefs_arch_unknown__) && defined(__arm__)
#elif !defined(__sys_cdefs_arch_unknown__) && defined(__arm64__)
# 679 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#else
# 680 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
#error Unsupported architecture
#endif
# 682 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4

#endif /* !_CDEFS_H_ */
# 684 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/cdefs.h" 3 4
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_types.h" 1 3 4
/*
 * Copyright (c) 2003-2007 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _BSD_MACHINE__TYPES_H_
#define _BSD_MACHINE__TYPES_H_

#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "arm/_types.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 */
#ifndef	_BSD_ARM__TYPES_H_
#define	_BSD_ARM__TYPES_H_

/*
 * This header file contains integer types.  It's intended to also contain
 * flotaing point and other arithmetic types, as needed, later.
 */
typedef unsigned char		__uint8_t;
typedef	short			__int16_t;
typedef	unsigned short		__uint16_t;
typedef int			__int32_t;
typedef unsigned int		__uint32_t;
typedef long long		__int64_t;
typedef unsigned long long	__uint64_t;

typedef long			__darwin_intptr_t;
typedef unsigned int		__darwin_natural_t;

/*
 * The rune type below is declared to be an ``int'' instead of the more natural
 * ``unsigned long'' or ``long''.  Two things are happening here.  It is not
 * unsigned so that EOF (-1) can be naturally assigned to it and used.  Also,
 * it looks like 10646 will be a 31 bit standard.  This means that if your
 * rune_t must be the same type.  Also wint_t must be no narrower than
 * wchar_t, and should also be able to hold all members of the largest
 * character set plus one extra value (WEOF). wint_t must be at least 16 bits.
 */

typedef int			__darwin_ct_rune_t;	/* ct_rune_t */

/*
 * mbstate_t is an opaque object to keep conversion state, during multibyte
 * stream conversions.  The content must not be referenced by user programs.
 */
typedef union {
	char		__mbstate8[128];
	long long	_mbstateL;			/* for alignment */
} __mbstate_t;

typedef __mbstate_t		__darwin_mbstate_t;	/* mbstate_t */

#if defined(__PTRDIFF_TYPE__)
typedef __PTRDIFF_TYPE__	__darwin_ptrdiff_t;	/* ptr1 - ptr2 */
#elif defined(__LP64__)
# 62 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4
typedef long			__darwin_ptrdiff_t;	/* ptr1 - ptr2 */
#else
# 64 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4
typedef int			__darwin_ptrdiff_t;	/* ptr1 - ptr2 */
#endif /* __GNUC__ */
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4

#if defined(__SIZE_TYPE__)
typedef __SIZE_TYPE__		__darwin_size_t;	/* sizeof() */
#else
# 70 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4
typedef unsigned long		__darwin_size_t;	/* sizeof() */
#endif
# 72 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4

#if (__GNUC__ > 2)
typedef __builtin_va_list	__darwin_va_list;	/* va_list */
#else
# 76 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4
typedef void *			__darwin_va_list;	/* va_list */
#endif
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4

#if defined(__WCHAR_TYPE__)
typedef __WCHAR_TYPE__		__darwin_wchar_t;	/* wchar_t */
#else
# 82 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4
typedef __darwin_ct_rune_t	__darwin_wchar_t;	/* wchar_t */
#endif
# 84 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4

typedef __darwin_wchar_t	__darwin_rune_t;	/* rune_t */

#if defined(__WINT_TYPE__)
typedef __WINT_TYPE__		__darwin_wint_t;	/* wint_t */
#else
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4
typedef __darwin_ct_rune_t	__darwin_wint_t;	/* wint_t */
#endif
# 92 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4

typedef unsigned long		__darwin_clock_t;	/* clock() */
typedef __uint32_t		__darwin_socklen_t;	/* socklen_t (duh) */
typedef long			__darwin_ssize_t;	/* byte count or error */
typedef long			__darwin_time_t;	/* time() */

#endif	/* _BSD_ARM__TYPES_H_ */
# 99 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_types.h" 3 4
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_types.h" 2 3 4
#else
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_types.h" 3 4
#error architecture not supported
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_types.h" 3 4

#endif /* _BSD_MACHINE__TYPES_H_ */
# 38 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_types.h" 3 4
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 2 3 4

/*
 * Type definitions; takes common type definitions that must be used
 * in multiple header files due to [XSI], removes them from the system
 * space, and puts them in the implementation space.
 */

#ifdef __cplusplus
#ifdef __GNUG__
#define __DARWIN_NULL __null
#else /* ! __GNUG__ */
# 45 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 3 4
#ifdef __LP64__
#define __DARWIN_NULL (0L)
#else /* !__LP64__ */
# 48 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 3 4
#define __DARWIN_NULL 0
#endif /* __LP64__ */
# 50 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 3 4
#endif /* __GNUG__ */
# 51 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 3 4
#else /* ! __cplusplus */
# 52 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 3 4
#define __DARWIN_NULL ((void *)0)
#endif /* __cplusplus */
# 54 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 3 4

typedef	__int64_t	__darwin_blkcnt_t;	/* total blocks */
typedef	__int32_t	__darwin_blksize_t;	/* preferred block size */
typedef __int32_t	__darwin_dev_t;		/* dev_t */
typedef unsigned int	__darwin_fsblkcnt_t;	/* Used by statvfs and fstatvfs */
typedef unsigned int	__darwin_fsfilcnt_t;	/* Used by statvfs and fstatvfs */
typedef __uint32_t	__darwin_gid_t;		/* [???] process and group IDs */
typedef __uint32_t	__darwin_id_t;		/* [XSI] pid_t, uid_t, or gid_t*/
typedef __uint64_t	__darwin_ino64_t;	/* [???] Used for 64 bit inodes */
#if __DARWIN_64_BIT_INO_T
typedef __darwin_ino64_t __darwin_ino_t;	/* [???] Used for inodes */
#else /* !__DARWIN_64_BIT_INO_T */
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 3 4
typedef __uint32_t	__darwin_ino_t;		/* [???] Used for inodes */
#endif /* __DARWIN_64_BIT_INO_T */
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types.h" 3 4
typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
typedef __darwin_mach_port_name_t __darwin_mach_port_t; /* Used by mach */
typedef __uint16_t	__darwin_mode_t;	/* [???] Some file attributes */
typedef __int64_t	__darwin_off_t;		/* [???] Used for file sizes */
typedef __int32_t	__darwin_pid_t;		/* [???] process and group IDs */
typedef __uint32_t	__darwin_sigset_t;	/* [???] signal set */
typedef __int32_t	__darwin_suseconds_t;	/* [???] microseconds */
typedef __uint32_t	__darwin_uid_t;		/* [???] user IDs */
typedef __uint32_t	__darwin_useconds_t;	/* [???] microseconds */
typedef	unsigned char	__darwin_uuid_t[16];
typedef	char	__darwin_uuid_string_t[37];

#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_types.h" 1 3 4
/*
 * Copyright (c) 2003-2013 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _SYS__PTHREAD_TYPES_H_
#define _SYS__PTHREAD_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_types.h" 3 4

// pthread opaque structures
#if defined(__LP64__)
#define __PTHREAD_RWLOCKATTR_SIZE__	16
#else // !__LP64__
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_types.h" 3 4
#define __PTHREAD_SIZE__		4088
#define __PTHREAD_ATTR_SIZE__		36
#define __PTHREAD_MUTEXATTR_SIZE__	8
#define __PTHREAD_MUTEX_SIZE__		40
#define __PTHREAD_CONDATTR_SIZE__	4
#define __PTHREAD_COND_SIZE__		24
#define __PTHREAD_ONCE_SIZE__		4
#define __PTHREAD_RWLOCK_SIZE__		124
#define __PTHREAD_RWLOCKATTR_SIZE__	12
#endif // !__LP64__
# 56 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_types.h" 3 4

struct __darwin_pthread_handler_rec {
};

struct _opaque_pthread_cond_t {
	long __sig;
	char __opaque[__PTHREAD_COND_SIZE__];
};

struct _opaque_pthread_condattr_t {
	long __sig;
	char __opaque[__PTHREAD_CONDATTR_SIZE__];
};

struct _opaque_pthread_mutex_t {
	long __sig;
	char __opaque[__PTHREAD_MUTEX_SIZE__];
};

struct _opaque_pthread_mutexattr_t {
	long __sig;
	char __opaque[__PTHREAD_MUTEXATTR_SIZE__];
};

struct _opaque_pthread_once_t {
	long __sig;
	char __opaque[__PTHREAD_SIZE__];
};

typedef struct _opaque_pthread_attr_t __darwin_pthread_attr_t;
typedef struct _opaque_pthread_cond_t __darwin_pthread_cond_t;
typedef struct _opaque_pthread_condattr_t __darwin_pthread_condattr_t;
typedef unsigned long __darwin_pthread_key_t;
typedef struct _opaque_pthread_mutex_t __darwin_pthread_mutex_t;
typedef struct _opaque_pthread_mutexattr_t __darwin_pthread_mutexattr_t;
typedef struct _opaque_pthread_once_t __darwin_pthread_once_t;
typedef struct _opaque_pthread_rwlock_t __darwin_pthread_rwlock_t;
typedef struct _opaque_pthread_rwlockattr_t __darwin_pthread_rwlockattr_t;
typedef struct _opaque_pthread_t *__darwin_pthread_t;

#endif // _SYS__PTHREAD_TYPES_H_
# 121 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_types.h" 3 4
#endif
# 38 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types.h" 3 4

typedef	int		__darwin_nl_item;
typedef	int		__darwin_wctrans_t;
#ifdef __LP64__
typedef	__uint32_t	__darwin_wctype_t;
#else /* !__LP64__ */
# 44 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types.h" 3 4
typedef	unsigned long	__darwin_wctype_t;
#endif /* __LP64__ */
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types.h" 3 4

#ifdef __WCHAR_MAX__
#define __DARWIN_WCHAR_MAX	__WCHAR_MAX__
#else /* ! __WCHAR_MAX__ */
# 56 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types.h" 3 4
#define __DARWIN_WCHAR_MIN	0
#endif
# 58 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types.h" 3 4
#define	__DARWIN_WEOF 	((__darwin_wint_t)-1)

#ifndef _FORTIFY_SOURCE
#  if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1050)
#    define _FORTIFY_SOURCE 0
#  else
# 64 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types.h" 3 4
#    define _FORTIFY_SOURCE 2	/* on by default */
#  endif
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types.h" 3 4
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types.h" 3 4

#endif /* __TYPES_H_ */
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types.h" 3 4
# 62 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 63 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/Availability.h" 1 3 4
/*
 * Copyright (c) 2007-2014 by Apple Inc.. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * @APPLE_LICENSE_HEADER_END@
 */
 
#ifndef __AVAILABILITY__
#define __AVAILABILITY__
 /*     
    These macros are for use in OS header files. They enable function prototypes
    and Objective-C methods to be tagged with the OS version in which they

*/
#ifndef __AVAILABILITY_INTERNAL__
#define __AVAILABILITY_INTERNAL__


#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
    /* make sure a default max version is set */
    #ifndef __IPHONE_OS_VERSION_MAX_ALLOWED
        #define __IPHONE_OS_VERSION_MAX_ALLOWED     __IPHONE_8_1
    #endif
# 63 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
    /* make sure a valid min is set */
    #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_0
        #undef __IPHONE_OS_VERSION_MIN_REQUIRED
        #define __IPHONE_OS_VERSION_MIN_REQUIRED    __IPHONE_2_0 
    #endif
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4

    #if defined(__has_attribute) && defined(__has_feature)
        #if __has_attribute(availability)
            /* use better attributes if possible */
            #define __AVAILABILITY_INTERNAL__IPHONE_2_0                    __attribute__((availability(ios,introduced=2.0)))
            #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_2_0    __attribute__((availability(ios,introduced=2.0,deprecated=2.0)))
# 385 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_NA               __attribute__((availability(ios,introduced=2.2)))
            #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_NA_MSG(_msg)     __attribute__((availability(ios,introduced=2.2)))
            #define __AVAILABILITY_INTERNAL__IPHONE_3_0                    __attribute__((availability(ios,introduced=3.0)))
            #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0    __attribute__((availability(ios,introduced=3.0,deprecated=3.0)))
            #if __has_feature(attribute_availability_with_message)
                    #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_3_0_MSG(_msg)    __attribute__((availability(ios,introduced=3.0,deprecated=3.0,message=_msg)))
            #else
# 410 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
                    #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_4_0_MSG(_msg)    __attribute__((availability(ios,introduced=3.0,deprecated=4.0)))
# 458 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
                    #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_7_0_MSG(_msg)    __attribute__((availability(ios,introduced=3.0,deprecated=7.0)))
            #endif
# 460 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__IPHONE_3_0_DEP__IPHONE_7_1    __attribute__((availability(ios,introduced=3.0,deprecated=7.1)))
            #if __has_feature(attribute_availability_with_message)
                    #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2_MSG(_msg)    __attribute__((availability(ios,introduced=3.2,deprecated=3.2,message=_msg)))
            #else
# 572 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
                    #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_3_2_MSG(_msg)    __attribute__((availability(ios,introduced=3.2,deprecated=3.2)))
            #endif
# 574 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_4_0    __attribute__((availability(ios,introduced=3.2,deprecated=4.0)))
# 622 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_NA               __attribute__((availability(ios,introduced=3.2)))
            #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_NA_MSG(_msg)     __attribute__((availability(ios,introduced=3.2)))
            #define __AVAILABILITY_INTERNAL__IPHONE_4_0                    __attribute__((availability(ios,introduced=4.0)))
            #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0    __attribute__((availability(ios,introduced=4.0,deprecated=4.0)))
            #if __has_feature(attribute_availability_with_message)
                    #define __AVAILABILITY_INTERNAL__IPHONE_4_0_DEP__IPHONE_4_0_MSG(_msg)    __attribute__((availability(ios,introduced=4.0,deprecated=4.0,message=_msg)))
            #else
# 653 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
                    #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_6_1_MSG(_msg)    __attribute__((availability(ios,introduced=4.2,deprecated=6.1)))
            #endif
# 829 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_7_0    __attribute__((availability(ios,introduced=4.2,deprecated=7.0)))
            #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_NA               __attribute__((availability(ios,introduced=4.2)))
            #define __AVAILABILITY_INTERNAL__IPHONE_4_2_DEP__IPHONE_NA_MSG(_msg)     __attribute__((availability(ios,introduced=4.2)))
            #define __AVAILABILITY_INTERNAL__IPHONE_4_3                    __attribute__((availability(ios,introduced=4.3)))
            #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_4_3    __attribute__((availability(ios,introduced=4.3,deprecated=4.3)))
            #if __has_feature(attribute_availability_with_message)
                    #define __AVAILABILITY_INTERNAL__IPHONE_4_3_DEP__IPHONE_6_0_MSG(_msg)    __attribute__((availability(ios,introduced=4.3,deprecated=6.0,message=_msg)))
            #else
                    #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_7_1_MSG(_msg)    __attribute__((availability(ios,introduced=5.0,deprecated=7.1)))
            #endif
# 949 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_0    __attribute__((availability(ios,introduced=5.0,deprecated=8.0)))
            #if __has_feature(attribute_availability_with_message)
                    #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_1_MSG(_msg)    __attribute__((availability(ios,introduced=5.0,deprecated=8.1,message=_msg)))
            #else
# 959 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
                    #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_8_1_MSG(_msg)    __attribute__((availability(ios,introduced=5.0,deprecated=8.1)))
            #endif
# 961 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_NA               __attribute__((availability(ios,introduced=5.0)))
            #define __AVAILABILITY_INTERNAL__IPHONE_5_0_DEP__IPHONE_NA_MSG(_msg)     __attribute__((availability(ios,introduced=5.0)))
            #define __AVAILABILITY_INTERNAL__IPHONE_8_0_DEP__IPHONE_NA_MSG(_msg)     __attribute__((availability(ios,introduced=8.0)))
            #define __AVAILABILITY_INTERNAL__IPHONE_8_1                    __attribute__((availability(ios,introduced=8.1)))
            #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_1    __attribute__((availability(ios,introduced=8.1,deprecated=8.1)))
            #if __has_feature(attribute_availability_with_message)
                    #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_1_MSG(_msg)    __attribute__((availability(ios,introduced=8.1,deprecated=8.1,message=_msg)))
            #else
# 1148 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
                    #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_8_1_MSG(_msg)    __attribute__((availability(ios,introduced=8.1,deprecated=8.1)))
            #endif
# 1150 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_NA               __attribute__((availability(ios,introduced=8.1)))
            #define __AVAILABILITY_INTERNAL__IPHONE_8_1_DEP__IPHONE_NA_MSG(_msg)     __attribute__((availability(ios,introduced=8.1)))
            #define __AVAILABILITY_INTERNAL__IPHONE_NA                               __attribute__((availability(ios,unavailable)))
            #define __AVAILABILITY_INTERNAL__IPHONE_NA_DEP__IPHONE_NA                __attribute__((availability(ios,unavailable)))
            #define __AVAILABILITY_INTERNAL__IPHONE_NA_DEP__IPHONE_NA_MSG(_msg)      __attribute__((availability(ios,unavailable)))
        #endif
# 1156 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
    #endif
# 1157 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4

    #ifndef __AVAILABILITY_INTERNAL__IPHONE_2_0
        /* set up old style internal macros (up to 2.0) */
        #if __IPHONE_OS_VERSION_MAX_ALLOWED < __IPHONE_2_0
            #define __AVAILABILITY_INTERNAL__IPHONE_2_0                      __AVAILABILITY_INTERNAL_UNAVAILABLE
        #elif __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
# 1341 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__IPHONE_3_2                      __AVAILABILITY_INTERNAL_WEAK_IMPORT
        #else
# 1343 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__IPHONE_3_2                      __AVAILABILITY_INTERNAL_REGULAR
        #endif
# 1345 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
        #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_NA           __AVAILABILITY_INTERNAL__IPHONE_3_2
        #define __AVAILABILITY_INTERNAL__IPHONE_3_2_DEP__IPHONE_NA_MSG(_msg) __AVAILABILITY_INTERNAL__IPHONE_3_2
        #if __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_2_1
            #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2              __AVAILABILITY_INTERNAL_REGULAR
            #define __AVAILABILITY_INTERNAL__IPHONE_2_0_DEP__IPHONE_3_2_MSG(_msg)    __AVAILABILITY_INTERNAL_REGULAR
            #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2              __AVAILABILITY_INTERNAL__IPHONE_2_1
            #define __AVAILABILITY_INTERNAL__IPHONE_2_1_DEP__IPHONE_3_2_MSG(_msg)    __AVAILABILITY_INTERNAL__IPHONE_2_1
            #define __AVAILABILITY_INTERNAL__IPHONE_2_2_DEP__IPHONE_3_2              __AVAILABILITY_INTERNAL__IPHONE_2_1
            #define __AVAILABILITY_INTERNAL__MAC_10_0_DEP__MAC_NA                __attribute__((availability(macosx,introduced=10.0)))
            #define __AVAILABILITY_INTERNAL__MAC_10_1                  __attribute__((availability(macosx,introduced=10.1)))
            #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_1    __attribute__((availability(macosx,introduced=10.1,deprecated=10.1)))
            #if __has_feature(attribute_availability_with_message)
                #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_1_MSG(_msg)    __attribute__((availability(macosx,introduced=10.1,deprecated=10.1,message=_msg)))
            #else
# 5835 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
                #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_1_MSG(_msg)    __attribute__((availability(macosx,introduced=10.1,deprecated=10.1)))
            #endif
# 5861 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__MAC_10_1_DEP__MAC_10_6    __attribute__((availability(macosx,introduced=10.1,deprecated=10.6)))
            #if __has_feature(attribute_availability_with_message)
                #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_3_MSG(_msg)    __attribute__((availability(macosx,introduced=10.3,deprecated=10.3)))
            #endif
# 5957 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_10_4    __attribute__((availability(macosx,introduced=10.3,deprecated=10.4)))
            #define __AVAILABILITY_INTERNAL__MAC_10_3_DEP__MAC_NA                __attribute__((availability(macosx,introduced=10.3)))
            #define __AVAILABILITY_INTERNAL__MAC_10_4                  __attribute__((availability(macosx,introduced=10.4)))
            #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_4    __attribute__((availability(macosx,introduced=10.4,deprecated=10.4)))
            #if __has_feature(attribute_availability_with_message)
                #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_4_MSG(_msg)    __attribute__((availability(macosx,introduced=10.4,deprecated=10.4,message=_msg)))
            #else
# 6006 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
                #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_10_4_MSG(_msg)    __attribute__((availability(macosx,introduced=10.4,deprecated=10.4)))
            #endif
# 6044 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
            #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_NA_MSG(_msg)      __attribute__((availability(macosx,introduced=10.4)))
            #define __AVAILABILITY_INTERNAL__MAC_10_4_DEP__MAC_NA                __attribute__((availability(macosx,introduced=10.4)))
            #define __AVAILABILITY_INTERNAL__MAC_10_5                  __attribute__((availability(macosx,introduced=10.5)))
            #define __AVAILABILITY_INTERNAL__MAC_10_6_DEP__MAC_10_10_MSG(_msg)    __AVAILABILITY_INTERNAL__MAC_10_6
            #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10              __AVAILABILITY_INTERNAL__MAC_10_7
            #define __AVAILABILITY_INTERNAL__MAC_10_7_DEP__MAC_10_10_MSG(_msg)    __AVAILABILITY_INTERNAL__MAC_10_7
            #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10              __AVAILABILITY_INTERNAL__MAC_10_8
            #define __AVAILABILITY_INTERNAL__MAC_10_8_DEP__MAC_10_10_MSG(_msg)    __AVAILABILITY_INTERNAL__MAC_10_8
            #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10              __AVAILABILITY_INTERNAL__MAC_10_9
            #define __AVAILABILITY_INTERNAL__MAC_10_9_DEP__MAC_10_10_MSG(_msg)    __AVAILABILITY_INTERNAL__MAC_10_9
            #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10              __AVAILABILITY_INTERNAL__MAC_10_10
            #define __AVAILABILITY_INTERNAL__MAC_10_10_DEP__MAC_10_10_MSG(_msg)    __AVAILABILITY_INTERNAL__MAC_10_10
        #endif
# 6566 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
    #endif
# 6591 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
#endif
# 6592 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4

#endif /* __AVAILABILITY_INTERNAL__ */
# 6594 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/AvailabilityInternal.h" 3 4
# 153 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/Availability.h" 2 3 4

#ifdef __IPHONE_OS_VERSION_MIN_REQUIRED
    #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_ios
    #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep) \
                                                    __AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep
    #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg) \
                                                    __AVAILABILITY_INTERNAL##_iosIntro##_DEP##_iosDep##_MSG(_msg)

#else
# 169 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/Availability.h" 3 4
    #define __OSX_AVAILABLE_STARTING(_osx, _ios)
    #define __OSX_AVAILABLE_BUT_DEPRECATED(_osxIntro, _osxDep, _iosIntro, _iosDep)
    #define __OSX_AVAILABLE_BUT_DEPRECATED_MSG(_osxIntro, _osxDep, _iosIntro, _iosDep, _msg)
#endif
# 173 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/Availability.h" 3 4


#if defined(__has_feature) && __has_feature(attribute_availability_with_message)
    #define __OS_AVAILABILITY(_target, _availability)            __attribute__((availability(_target,_availability)))
    #define __OS_AVAILABILITY_MSG(_target, _availability, _msg)  __attribute__((availability(_target,_availability,message=_msg)))
#else
# 179 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/Availability.h" 3 4
    #define __OS_AVAILABILITY(_target, _availability)
    #define __OS_AVAILABILITY_MSG(_target, _availability, _msg)
#endif
# 182 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/Availability.h" 3 4


/* for use to document app extension usage */
#if defined(__has_feature) && __has_feature(attribute_availability_app_extension)
    #define __OSX_EXTENSION_UNAVAILABLE(_msg)  __OS_AVAILABILITY_MSG(macosx_app_extension,unavailable,_msg)
    #define __IOS_EXTENSION_UNAVAILABLE(_msg)  __OS_AVAILABILITY_MSG(ios_app_extension,unavailable,_msg)
#else
# 189 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/Availability.h" 3 4
    #define __OSX_EXTENSION_UNAVAILABLE(_msg)
    #define __IOS_EXTENSION_UNAVAILABLE(_msg)
#endif
# 192 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/Availability.h" 3 4

#define __OS_EXTENSION_UNAVAILABLE(_msg)  __OSX_EXTENSION_UNAVAILABLE(_msg) __IOS_EXTENSION_UNAVAILABLE(_msg)
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code

/* ANSI-C */

__BEGIN_DECLS
void	*memchr(const void *, int, size_t);
int	 memcmp(const void *, const void *, size_t);
void	*memcpy(void *, const void *, size_t);
void	*memmove(void *, const void *, size_t);
void	*memset(void *, int, size_t);
;
char	*strchr(const char *, int);
int	 strcmp(const char *, const char *);
;
;
;
char	*strerror(int) __DARWIN_ALIAS(strerror);
size_t	 strlen(const char *);
;
int	 strncmp(const char *, const char *, size_t);
;
;
;
;
char	*strstr(const char *, const char *);
;
;
__END_DECLS



/* Additional functionality provided by:
 * POSIX.1c-1995,
#endif /* __DARWIN_C_LEVEL >= 200809L */
# 137 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4

/* C11 Annex K */

#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_rsize_t.h>
typedef __darwin_size_t        rsize_t;
#endif  /* _RSIZE_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_rsize_t.h" 3 4
# 142 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_errno_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_errno_t.h" 1 3 4
# 143 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 2 3 4

__BEGIN_DECLS
 __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
__END_DECLS
#endif
# 148 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4

/* Darwin extensions */

#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_ssize_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_ssize_t.h" 1 3 4
/*
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _SSIZE_T 
#define _SSIZE_T 
typedef __darwin_ssize_t        ssize_t; 
#endif  /* _SSIZE_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_ssize_t.h" 3 4
# 153 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 2 3 4

__BEGIN_DECLS
 __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
 __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
 __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);
 __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_3_0);

;
__END_DECLS

/* Some functions historically defined in string.h were placed in strings.h
 * by SUS.  We are using "strings.h" instead of <strings.h> to avoid an issue
 * where /Developer/Headers/FlatCarbon/Strings.h could be included instead on
 * case-insensitive file systems.
 */
#if 0 /* expanded by -frewrite-includes */
#include "strings.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/strings.h" 1 3 4
/*
 * Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * SUCH DAMAGE.
 *
 *	@(#)strings.h	8.1 (Berkeley) 6/2/93
 */

#ifndef _STRINGS_H_
#define _STRINGS_H_

# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _SIZE_T 
#define _SIZE_T 
typedef __darwin_size_t        size_t; 
#endif  /* _SIZE_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 3 4
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/strings.h" 2 3 4

__BEGIN_DECLS
/* Removed in Issue 7 */
#if !defined(_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 200809L
 __POSIX_C_DEPRECATED(200112L);
 __POSIX_C_DEPRECATED(200112L);
 __POSIX_C_DEPRECATED(200112L);
 __POSIX_C_DEPRECATED(200112L);
 __POSIX_C_DEPRECATED(200112L);
#endif
# 76 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/strings.h" 3 4

;
;
;
__END_DECLS

/* Darwin extensions */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
__BEGIN_DECLS
 __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
 __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
 __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
 __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
 __OSX_AVAILABLE_STARTING(__MAC_10_9, __IPHONE_7_0);
__END_DECLS

#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 1 3 4
/*
 * Copyright (c) 2000, 2007, 2010 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 *
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 *	@(#)string.h	8.1 (Berkeley) 6/2/93
 */

#ifndef _STRING_H_
#define	_STRING_H_

#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
__BEGIN_DECLS
char	*strtok_r(char *, const char *, char **);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 199506L */
# 107 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4



/* Darwin extensions */

#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_ssize_t.h>
#endif /* expanded by -frewrite-includes */
# 153 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4


/* Some functions historically defined in string.h were placed in strings.h
 * by SUS.  We are using "strings.h" instead of <strings.h> to avoid an issue
 * where /Developer/Headers/FlatCarbon/Strings.h could be included instead on
 * case-insensitive file systems.
 */
#if 0 /* expanded by -frewrite-includes */
#include "strings.h"
#include <xlocale/_string.h>
#endif /* expanded by -frewrite-includes */
# 182 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4
#endif /* _USE_EXTENDED_LOCALES_ */
# 183 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4

#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
/* Security checking functions.  */
#if 0 /* expanded by -frewrite-includes */
#include <secure/_string.h>
#endif /* expanded by -frewrite-includes */
# 187 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4
#endif
# 188 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4

#endif /* _STRING_H_ */
# 190 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4
# 93 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/strings.h" 2 3 4
#endif
# 94 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/strings.h" 3 4

#endif  /* _STRINGS_H_ */
# 96 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/strings.h" 3 4

# 177 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 2 3 4
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
# 178 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4


#ifdef _USE_EXTENDED_LOCALES_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_string.h>
#include <secure/_string.h>
#endif /* expanded by -frewrite-includes */
# 187 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4
#endif
# 188 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4

#endif /* _STRING_H_ */
# 190 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/string.h" 3 4
# 66 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring" 3

_LIBCPP_BEGIN_NAMESPACE_STD

using ::size_t;
using ::memcpy;
using ::memmove;



using ::memset;
using ::strerror;
using ::strlen;

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_CSTRING
# 113 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring" 3
# 626 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <utility>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 1 3
// -*- C++ -*-

#ifndef _LIBCPP_UTILITY
#define _LIBCPP_UTILITY

/*
    utility synopsis

namespace std
#endif /* expanded by -frewrite-includes */
# 157 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
#if 0 /* expanded by -frewrite-includes */
#include <__tuple>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
#ifndef _LIBCPP___TUPLE
#define _LIBCPP___TUPLE

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple" 3
#if 0 /* expanded by -frewrite-includes */
#include <cstddef>
#endif /* expanded by -frewrite-includes */
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple" 3
#if 0 /* expanded by -frewrite-includes */
#include <type_traits>
#endif /* expanded by -frewrite-includes */
# 17 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple" 3

#ifdef _LIBCPP_HAS_NO_VARIADICS

#if 0 /* expanded by -frewrite-includes */
#include <__tuple_03>
#endif /* expanded by -frewrite-includes */
# 25 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple" 3

#else  // _LIBCPP_HAS_NO_VARIADICS
# 27 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY tuple_size;

template <class _Tp>
class _LIBCPP_TYPE_VIS_ONLY tuple_size<const _Tp>
    : public tuple_size<_Tp> {};

template <size_t _Ip, class _Tp> class _LIBCPP_TYPE_VIS_ONLY tuple_element;

template <size_t _Ip, class _Tp>
class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, const _Tp>
{
public:
};

template <size_t _Ip, class _Tp>
class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, const volatile _Tp>
{
public:
    typedef typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
};

template <class ..._Tp> class _LIBCPP_TYPE_VIS_ONLY tuple;
template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY pair;
template <class _Tp, size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY array;

template <class _Tp> struct __tuple_like : false_type {};

template <class _Tp> struct __tuple_like<const _Tp> : public __tuple_like<_Tp> {};
template <class _Tp> struct __tuple_like<volatile _Tp> : public __tuple_like<_Tp> {};
template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_like<_Tp> {};

template <class... _Tp> struct __tuple_like<tuple<_Tp...> > : true_type {};
template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {};
template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {};

template <size_t _Ip, class ..._Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, tuple<_Tp...> >::type&
get(tuple<_Tp...>&) _NOEXCEPT;

template <size_t _Ip, class ..._Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Ip, tuple<_Tp...> >::type&
get(const tuple<_Tp...>&) _NOEXCEPT;

template <size_t _Ip, class ..._Tp>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, tuple<_Tp...> >::type&&
get(tuple<_Tp...>&&) _NOEXCEPT;

template <size_t _Ip, class _T1, class _T2>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, pair<_T1, _T2> >::type&
get(pair<_T1, _T2>&) _NOEXCEPT;

template <size_t _Ip, class _T1, class _T2>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
get(const pair<_T1, _T2>&) _NOEXCEPT;

template <size_t _Ip, class _T1, class _T2>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
get(pair<_T1, _T2>&&) _NOEXCEPT;

template <size_t _Ip, class _Tp, size_t _Size>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp&
get(array<_Tp, _Size>&) _NOEXCEPT;

template <size_t _Ip, class _Tp, size_t _Size>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const _Tp&
get(const array<_Tp, _Size>&) _NOEXCEPT;

template <size_t _Ip, class _Tp, size_t _Size>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
_Tp&&
get(array<_Tp, _Size>&&) _NOEXCEPT;

// __make_tuple_indices

template <size_t...> struct __tuple_indices {};

template <size_t _Sp, class _IntTuple, size_t _Ep>
struct __make_indices_imp;

template <size_t _Sp, size_t ..._Indices, size_t _Ep>
struct __make_indices_imp<_Sp, __tuple_indices<_Indices...>, _Ep>
{
    typedef typename __make_indices_imp<_Sp+1, __tuple_indices<_Indices..., _Sp>, _Ep>::type type;
};

template <size_t _Ep, size_t ..._Indices>
struct __make_indices_imp<_Ep, __tuple_indices<_Indices...>, _Ep>
{
    typedef __tuple_indices<_Indices...> type;
};

template <size_t _Ep, size_t _Sp = 0>
struct __make_tuple_indices
{
    static_assert(_Sp <= _Ep, "__make_tuple_indices input error");
    typedef typename __make_indices_imp<_Sp, __tuple_indices<>, _Ep>::type type;
};

// __tuple_types

template <class ..._Tp> struct __tuple_types {};

template <size_t _Ip>
class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, __tuple_types<> >
{
public:
    static_assert(_Ip == 0, "tuple_element index out of range");
    static_assert(_Ip != 0, "tuple_element index out of range");
};

template <class _Hp, class ..._Tp>
class _LIBCPP_TYPE_VIS_ONLY tuple_element<0, __tuple_types<_Hp, _Tp...> >
{
public:
    typedef _Hp type;
};
// __make_tuple_types

// __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a
// __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep).
// _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>.  If _Tuple is a
// lvalue_reference type, then __tuple_types<_Types&...> is the result.

template <class _TupleTypes, class _Tp, size_t _Sp, size_t _Ep>
struct __make_tuple_types_imp;

template <class ..._Types, class _Tp, size_t _Sp, size_t _Ep>
struct __make_tuple_types_imp<__tuple_types<_Types...>, _Tp, _Sp, _Ep>
{
    typedef typename remove_reference<_Tp>::type _Tpr;
    typedef typename __make_tuple_types_imp<__tuple_types<_Types...,
                                            typename conditional<is_lvalue_reference<_Tp>::value,
                                                typename tuple_element<_Sp, _Tpr>::type&,
                                                typename tuple_element<_Sp, _Tpr>::type>::type>,
                                            _Tp, _Sp+1, _Ep>::type type;
};

template <class ..._Types, class _Tp, size_t _Ep>
struct __make_tuple_types_imp<__tuple_types<_Types...>, _Tp, _Ep, _Ep>
{
    typedef __tuple_types<_Types...> type;
};

template <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value, size_t _Sp = 0>
struct __make_tuple_types
{
    static_assert(_Sp <= _Ep, "__make_tuple_types input error");
    typedef typename __make_tuple_types_imp<__tuple_types<>, _Tp, _Sp, _Ep>::type type;
};

// __tuple_convertible

template <bool, class _Tp, class _Up>
struct __tuple_convertible_imp : public false_type {};

template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
struct __tuple_convertible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
    : public integral_constant<bool,
                               is_convertible<_Tp0, _Up0>::value &&
                               __tuple_convertible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};

template <>
struct __tuple_convertible_imp<true, __tuple_types<>, __tuple_types<> >
    : public true_type {};

template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
                                bool = __tuple_like<_Up>::value>
struct __tuple_convertible
    : public false_type {};

template <class _Tp, class _Up>
struct __tuple_convertible<_Tp, _Up, true, true>
    : public __tuple_convertible_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
                                     tuple_size<_Up>::value,
             typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
{};

// __tuple_constructible

template <bool, class _Tp, class _Up>
struct __tuple_constructible_imp : public false_type {};

template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
struct __tuple_constructible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
    : public integral_constant<bool,
                               is_constructible<_Up0, _Tp0>::value &&
                               __tuple_constructible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};

template <>
struct __tuple_constructible_imp<true, __tuple_types<>, __tuple_types<> >
    : public true_type {};

template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
                                bool = __tuple_like<_Up>::value>
struct __tuple_constructible
    : public false_type {};
// __tuple_assignable

template <bool, class _Tp, class _Up>
struct __tuple_assignable_imp : public false_type {};

template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
struct __tuple_assignable_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
    : public integral_constant<bool,
                               is_assignable<_Up0&, _Tp0>::value &&
                               __tuple_assignable_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};

template <>
struct __tuple_assignable_imp<true, __tuple_types<>, __tuple_types<> >
    : public true_type {};

template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
                                bool = __tuple_like<_Up>::value>
struct __tuple_assignable
    : public false_type {};

template <class _Tp, class _Up>
struct __tuple_assignable<_Tp, _Up, true, true>
    : public __tuple_assignable_imp<tuple_size<typename remove_reference<_Tp>::type>::value ==
                                    tuple_size<_Up>::value,
             typename __make_tuple_types<_Tp>::type, typename __make_tuple_types<_Up>::type>
{};

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 304 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple" 3

#endif  // _LIBCPP___TUPLE
# 306 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tuple" 3
# 158 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <type_traits>
#endif /* expanded by -frewrite-includes */
# 159 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3

_LIBCPP_BEGIN_NAMESPACE_STD

namespace rel_ops
{









}  // rel_ops

// swap_ranges

template <class _ForwardIterator1, class _ForwardIterator2>
inline _LIBCPP_INLINE_VISIBILITY
_ForwardIterator2
swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2)
{
    for(; __first1 != __last1; ++__first1, ++__first2)
        swap(*__first1, *__first2);
    return __first2;
}



template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
const _Tp&
#endif
# 235 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
move_if_noexcept(_Tp& __x) _NOEXCEPT
{
    return _VSTD::move(__x);
}

struct _LIBCPP_TYPE_VIS_ONLY piecewise_construct_t { };
#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_UTILITY)
extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
#else
# 244 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
#endif
# 246 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3

template <class _T1, class _T2>
struct _LIBCPP_TYPE_VIS_ONLY pair
{
    typedef _T1 first_type;
    typedef _T2 second_type;

    _T1 first;
    _T2 second;

    // pair(const pair&) = default;
    // pair(pair&&) = default;

    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR pair() : first(), second() {}

    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    pair(const _T1& __x, const _T2& __y)
        : first(__x), second(__y) {}

    template<class _U1, class _U2>
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
        pair(const pair<_U1, _U2>& __p
#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
                 ,typename enable_if<is_convertible<const _U1&, _T1>::value &&
                                    is_convertible<const _U2&, _T2>::value>::type* = 0
#endif
# 272 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
                                      )
            : first(__p.first), second(__p.second) {}

#if !defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
    _LIBCPP_INLINE_VISIBILITY
    pair(const pair& __p) = default;
#elif !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) || !_LIBCPP_TRIVIAL_PAIR_COPY_CTOR
# 279 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
    _LIBCPP_INLINE_VISIBILITY
    pair(const pair& __p)
        _NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
                   is_nothrow_copy_constructible<second_type>::value)
        : first(__p.first),
                                    is_convertible<_U2, _T2>::value>::type* = 0)
            : first(_VSTD::forward<_U1>(__p.first)),
              second(_VSTD::forward<_U2>(__p.second)) {}

#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
    _LIBCPP_INLINE_VISIBILITY
    pair(pair&& __p) = default;
#else
            return *this;
        }

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 379 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 381 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
private:

#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
        _LIBCPP_INLINE_VISIBILITY
        pair(piecewise_construct_t,
             tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
             __tuple_indices<_I1...>, __tuple_indices<_I2...>);
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 398 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
};







#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY reference_wrapper;

template <class _Tp>
struct __make_pair_return_impl
{
    typedef _Tp type;
};

template <class _Tp>
struct __make_pair_return_impl<reference_wrapper<_Tp>>
{
    typedef _Tp& type;
};

template <class _Tp>
struct __make_pair_return
{
    typedef typename __make_pair_return_impl<typename decay<_Tp>::type>::type type;
};


#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 495 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3



#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 505 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
template <class _T1, class _T2>
class _LIBCPP_TYPE_VIS_ONLY tuple_element<1, pair<_T1, _T2> >
{
public:
    typedef _T2 type;
};

template <class _T1, class _T2>
class _LIBCPP_TYPE_VIS_ONLY tuple_element<0, const pair<_T1, _T2> >
{
public:
    typedef const _T1 type;
};

template <class _T1, class _T2>
class _LIBCPP_TYPE_VIS_ONLY tuple_element<1, const pair<_T1, _T2> >
{
public:
    typedef const _T2 type;
};

template <size_t _Ip> struct __get_pair;

template <>
struct __get_pair<0>
{
    

    

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

    template <class _T1, class _T2>
    static
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    _T1&&
    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T1>(__p.first);}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 568 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
};

template <>
struct __get_pair<1>
{
    

    template <class _T1, class _T2>
    static
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    const _T2&
    get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

    template <class _T1, class _T2>
    static
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    _T2&&
    get(pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<_T2>(__p.second);}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 594 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
};

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <size_t _Ip, class _T1, class _T2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
get(pair<_T1, _T2>&& __p) _NOEXCEPT
{
}

#endif
# 668 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3

#if _LIBCPP_STD_VER > 11

template<class _Tp, _Tp... _Ip>
inline _LIBCPP_INLINE_VISIBILITY
_T1 exchange(_T1& __obj, _T2 && __new_value)
{
    _T1 __old_value = _VSTD::move(__obj);
    __obj = _VSTD::forward<_T2>(__new_value);
    return __old_value;
}    
#endif  // _LIBCPP_STD_VER > 11
# 765 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_UTILITY
# 769 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/utility" 3
# 627 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <memory>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 1 3
// -*- C++ -*-
//===-------------------------- memory ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_MEMORY
#define _LIBCPP_MEMORY

/*
    memory synopsis

namespace std
{

struct allocator_arg_t { };
constexpr allocator_arg_t allocator_arg = allocator_arg_t();
pointer_safety get_pointer_safety() noexcept;

void* align(size_t alignment, size_t size, void*& ptr, size_t& space);

}  // std

*/

//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef __LIBCPP_TYPEINFO
#define __LIBCPP_TYPEINFO

/*

    typeinfo synopsis

namespace std {

class type_info
#include <__config>
#endif /* expanded by -frewrite-includes */
# 61 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3
#if 0 /* expanded by -frewrite-includes */
#include <exception>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 1 3
// -*- C++ -*-

#ifndef _LIBCPP_EXCEPTION
#define _LIBCPP_EXCEPTION

/*
    exception synopsis

namespace std
#endif /* expanded by -frewrite-includes */
# 82 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 85 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3
#endif
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3

namespace std  // purposefully not using versioning namespace
{

class _LIBCPP_EXCEPTION_ABI exception
{
public:
    _LIBCPP_INLINE_VISIBILITY exception() _NOEXCEPT {}
    virtual ~exception() _NOEXCEPT;
    virtual const char* what() const _NOEXCEPT;
};

class _LIBCPP_EXCEPTION_ABI bad_exception
    : public exception
{
public:
    _LIBCPP_INLINE_VISIBILITY bad_exception() _NOEXCEPT {}
    virtual ~bad_exception() _NOEXCEPT;
    virtual const char* what() const _NOEXCEPT;
};

typedef void (*unexpected_handler)();
class _LIBCPP_TYPE_VIS exception_ptr
{
    void* __ptr_;
public:
    _LIBCPP_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {}
    _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
    exception_ptr(const exception_ptr&) _NOEXCEPT;
    exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
    ~exception_ptr() _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_EXPLICIT
        operator bool() const _NOEXCEPT {return __ptr_ != nullptr;}

    friend _LIBCPP_INLINE_VISIBILITY
    bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
        {return __x.__ptr_ == __y.__ptr_;}
    friend _LIBCPP_INLINE_VISIBILITY
    bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
        {return !(__x == __y);}

    friend _LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
    friend _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
};

template<class _Ep>
exception_ptr
make_exception_ptr(_Ep __e) _NOEXCEPT
{
#ifndef _LIBCPP_NO_EXCEPTIONS
    try
    {
        throw __e;
    }
    catch (...)
    {
        return current_exception();
    }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 163 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3
}

// nested_exception

class _LIBCPP_EXCEPTION_ABI nested_exception
{
    exception_ptr __ptr_;
public:
    nested_exception() _NOEXCEPT;
//     nested_exception(const nested_exception&) noexcept = default;
//     nested_exception& operator=(const nested_exception&) noexcept = default;
    virtual ~nested_exception() _NOEXCEPT;

    // access functions
    _LIBCPP_NORETURN void rethrow_nested() const;
    _LIBCPP_INLINE_VISIBILITY exception_ptr nested_ptr() const _NOEXCEPT {return __ptr_;}
};

template <class _Tp>
_LIBCPP_NORETURN
void
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
throw_with_nested(_Tp&& __t, typename enable_if<
                  is_class<typename remove_reference<_Tp>::type>::value &&
                  !is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value
                                    >::type* = 0)
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 198 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3
throw_with_nested (_Tp& __t, typename enable_if<
                  is_class<_Tp>::value && !is_base_of<nested_exception, _Tp>::value
                                    >::type* = 0)
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 202 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3
{
#ifndef _LIBCPP_NO_EXCEPTIONS
    throw __nested<typename remove_reference<_Tp>::type>(_VSTD::forward<_Tp>(__t));
#endif
# 206 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3
}

template <class _Tp>
_LIBCPP_NORETURN
void
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
throw_with_nested(_Tp&& __t, typename enable_if<
                  !is_class<typename remove_reference<_Tp>::type>::value ||
                  is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value
                                    >::type* = 0)
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 217 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3
throw_with_nested (_Tp& __t, typename enable_if<
                  !is_class<_Tp>::value || is_base_of<nested_exception, _Tp>::value
                                    >::type* = 0)
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 221 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3
{
#ifndef _LIBCPP_NO_EXCEPTIONS
    throw _VSTD::forward<_Tp>(__t);
#endif
# 225 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3
}

template <class _Ep>
inline _LIBCPP_INLINE_VISIBILITY
void
rethrow_if_nested(const _Ep& __e, typename enable_if<
                                   is_polymorphic<_Ep>::value
                                                   >::type* = 0)
{
    const nested_exception* __nep = dynamic_cast<const nested_exception*>(&__e);
    if (__nep)
        __nep->rethrow_nested();
}

template <class _Ep>
inline _LIBCPP_INLINE_VISIBILITY
void
rethrow_if_nested(const _Ep&, typename enable_if<
                                   !is_polymorphic<_Ep>::value
                                                   >::type* = 0)
{
}

}  // std

#endif  // _LIBCPP_EXCEPTION
# 251 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/exception" 3
# 62 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 2 3
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CSTDINT
#define _LIBCPP_CSTDINT

/*
    cstdint synopsis

 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
\*===----------------------------------------------------------------------===*/

#ifndef __CLANG_STDINT_H
#define __CLANG_STDINT_H

/* If we're hosted, fall back to the system's stdint.h, which might have
 * additional definitions.
 */
#if __STDC_HOSTED__ && \
    defined(__has_include_next) && (1)/*__has_include_next(<stdint.h>)*/

// C99 7.18.3 Limits of other integer types
//
// used in C++.
# ifdef __cplusplus
#  if !defined(__STDC_LIMIT_MACROS)
#   define __STDC_LIMIT_MACROS
#   define __STDC_LIMIT_MACROS_DEFINED_BY_CLANG
#  endif
# 58 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h" 3 4
#  if !defined(__STDC_CONSTANT_MACROS)
#include <sys/_types/_int8_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_int8_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _INT8_T
#define _INT8_T
typedef	__signed char		int8_t;
#endif /* _INT8_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_int8_t.h" 3 4
# 19 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_int16_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_int16_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _INT16_T
#define _INT16_T
typedef	short			int16_t;
#endif /* _INT16_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_int16_t.h" 3 4
# 20 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_int32_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_int32_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _INT32_T
#define _INT32_T
typedef	int			int32_t;
#endif /* _INT32_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_int32_t.h" 3 4
# 21 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_int64_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_int64_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _INT64_T
#define _INT64_T
typedef	long long		int64_t;
#endif /* _INT64_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_int64_t.h" 3 4
# 22 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 2 3 4

#if 0 /* expanded by -frewrite-includes */
#include <_types/_uint8_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uint8_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _UINT8_T
#define _UINT8_T
typedef unsigned char uint8_t;
#endif /* _UINT8_T */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uint8_t.h" 3 4
# 24 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types/_uint16_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uint16_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 */

#ifndef _UINT16_T
#define _UINT16_T
typedef unsigned short uint16_t;
#endif /* _UINT16_T */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uint16_t.h" 3 4
# 25 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types/_uint32_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uint32_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _UINT32_T
#define _UINT32_T
typedef unsigned int uint32_t;
#endif /* _UINT32_T */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uint32_t.h" 3 4
# 26 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types/_uint64_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uint64_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _UINT64_T
#define _UINT64_T
typedef unsigned long long uint64_t;
#endif /* _UINT64_T */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uint64_t.h" 3 4
# 27 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 2 3 4

/* 7.18.1.2 Minimum-width integer types */
typedef int8_t           int_least8_t;
typedef int16_t         int_least16_t;
typedef int32_t         int_least32_t;
typedef int64_t         int_least64_t;
typedef uint8_t         uint_least8_t;
typedef uint16_t       uint_least16_t;
typedef uint32_t       uint_least32_t;
typedef uint64_t       uint_least64_t;


/* 7.18.1.3 Fastest-width integer types */
typedef int8_t            int_fast8_t;
typedef int16_t          int_fast16_t;
typedef int32_t          int_fast32_t;
typedef int64_t          int_fast64_t;
typedef uint8_t          uint_fast8_t;
typedef uint16_t        uint_fast16_t;
typedef uint32_t        uint_fast32_t;
typedef uint64_t        uint_fast64_t;


/* 7.18.1.4 Integer types capable of holding object pointers */

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 53 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_intptr_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_intptr_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _INTPTR_T
#define _INTPTR_T
typedef __darwin_intptr_t	intptr_t;
#endif /* _INTPTR_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_intptr_t.h" 3 4
# 54 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_uintptr_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_uintptr_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _UINTPTR_T
#define _UINTPTR_T
typedef unsigned long		uintptr_t;
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_intmax_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _INTMAX_T
#define _INTMAX_T
#ifdef __INTMAX_TYPE__
typedef __INTMAX_TYPE__ intmax_t;
#else
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_intmax_t.h" 3 4
#ifdef __LP64__
typedef long int intmax_t;
#else
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_intmax_t.h" 3 4
typedef long long int intmax_t;
#endif /* __LP64__ */
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_intmax_t.h" 3 4
#endif /* __INTMAX_TYPE__ */
# 40 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_intmax_t.h" 3 4
#endif /* _INTMAX_T */
# 41 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_intmax_t.h" 3 4
# 59 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types/_uintmax_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uintmax_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _UINTMAX_T
#define _UINTMAX_T
#ifdef __UINTMAX_TYPE__
typedef __UINTMAX_TYPE__ uintmax_t;
#else
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uintmax_t.h" 3 4
#ifdef __LP64__
typedef long unsigned int uintmax_t;
#else
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uintmax_t.h" 3 4
typedef long long unsigned int uintmax_t;
#endif /* __LP64__ */
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uintmax_t.h" 3 4
#endif /* __UINTMAX_TYPE__ */
# 40 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_uintmax_t.h" 3 4
#endif /* _UINTMAX_T */

/* 7.18.2.1 Limits of exact-width integer types */
#define INT8_MAX         127
#define INT16_MAX        32767
#define INT32_MAX        2147483647
#define INT64_MAX        9223372036854775807LL

#define INT8_MIN          -128
#define INT64_MIN        (-INT64_MAX-1)

#define UINT8_MAX         255
#define UINT16_MAX        65535
#define UINT32_MAX        4294967295U
#define UINT64_MAX        18446744073709551615ULL

/* 7.18.2.2 Limits of minimum-width integer types */

#if __WORDSIZE == 64
#define INTPTR_MIN	  INT64_MIN
#define INTPTR_MAX	  INT64_MAX
#else
# 127 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 3 4
#define INTPTR_MIN        INT32_MIN
#define INTPTR_MAX        INT32_MAX
#define SIZE_MAX          UINT32_MAX
#endif
# 157 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 3 4

#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
#define RSIZE_MAX         (SIZE_MAX >> 1)
#endif
# 161 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdint.h" 3 4

/* 7.18.4 Macros for integer constants */
#define INT8_C(v)    (v)
# endif
# 74 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h" 3 4

#else
# 76 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h" 3 4

#ifdef __INT64_TYPE__
# ifdef __INT64_C_SUFFIX__
#  define __int64_c_suffix __INT64_C_SUFFIX__
#  define __int32_c_suffix __INT64_C_SUFFIX__
#  define __int16_c_suffix __INT64_C_SUFFIX__
#  define  __int8_c_suffix __INT64_C_SUFFIX__
# else
#  undef  __int8_c_suffix
# endif /* __INT16_C_SUFFIX__ */
# 424 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h" 3 4
#endif /* __INT16_TYPE__ */
# 425 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h" 3 4

#ifdef __int_least16_t
# ifdef __int16_c_suffix
#  define INT16_C(v) __int_c(v, __int16_c_suffix)
#  define UINT16_C(v) __uint_c(v, __int16_c_suffix)
# else
# 431 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h" 3 4
#  define INT16_C(v) v
#  define UINT16_C(v) v ## U
# endif /* __int16_c_suffix */
# 434 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h" 3 4
# define UINT_FAST32_MAX  __UINT_LEAST32_MAX
#endif /* __INT_LEAST32_MIN */
# 592 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h" 3 4


/* 7.18.4.2 Macros for greatest-width integer constants. */
#define INTMAX_C(v)   __INTN_C(__INTMAX_WIDTH__, v)
#define UINTMAX_C(v) __UINTN_C(__INTMAX_WIDTH__, v)

#endif /* __STDC_HOSTED__ */
# 708 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h" 3 4
#endif /* __CLANG_STDINT_H */
# 709 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdint.h" 3 4
# 146 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdint" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 149 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdint" 3
#endif
# 150 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdint" 3

_LIBCPP_BEGIN_NAMESPACE_STD
using::uintptr_t;

using::intmax_t;
using::uintmax_t;

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_CSTDINT
# 192 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdint" 3
# 64 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 67 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3
#endif
# 68 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3

namespace std  // purposefully not using versioning namespace
{

class _LIBCPP_EXCEPTION_ABI type_info
{
    type_info& operator=(const type_info&);
    ;
protected:
#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
    const char* __type_name;
#else
# 80 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3
    // A const char* with the non-unique RTTI bit possibly set.
# 108 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3
        {if (!((__type_name & __arg.__type_name) & _LIBCPP_NONUNIQUE_RTTI_BIT))
           return __type_name < __arg.__type_name;
         return __compare_nonunique_names(__arg) < 0;}
#endif
# 112 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3

    _LIBCPP_INLINE_VISIBILITY
    size_t hash_code() const _NOEXCEPT
#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
        {return *reinterpret_cast<const size_t*>(&__type_name);}
#else
# 118 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3
        {if (!(__type_name & _LIBCPP_NONUNIQUE_RTTI_BIT)) return __type_name;
         const char *__ptr = __name_for_load();
         size_t __hash = 5381;
         while (unsigned char __c = static_cast<unsigned char>(*__ptr++))
           __hash = (__hash * 33) ^ __c;
         return __hash;}
#endif
# 125 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3

    _LIBCPP_INLINE_VISIBILITY
    bool operator==(const type_info& __arg) const _NOEXCEPT
#ifndef _LIBCPP_NONUNIQUE_RTTI_BIT
        {return __type_name == __arg.__type_name;}
#else
# 131 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3
        {if (__type_name == __arg.__type_name) return true;
         if (!((__type_name & __arg.__type_name) & _LIBCPP_NONUNIQUE_RTTI_BIT))
           return false;
         return __compare_nonunique_names(__arg) == 0;}
    _LIBCPP_INLINE_VISIBILITY
    int __compare_nonunique_names(const type_info &__arg) const _NOEXCEPT
        {return __builtin_strcmp(__name_for_load(), __arg.__name_for_load());}

    _LIBCPP_INLINE_VISIBILITY
    const char *__name_for_load() const _NOEXCEPT
        {uintptr_t __data = __type_name;
#if 1
         __data &= ~_LIBCPP_NONUNIQUE_RTTI_BIT;
#endif
# 152 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3
         return reinterpret_cast<const char*>(__data);}
#endif
# 154 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3
};


class _LIBCPP_EXCEPTION_ABI bad_typeid
    : public exception
{
public:
    bad_typeid() _NOEXCEPT;
    virtual ~bad_typeid() _NOEXCEPT;
    virtual const char* what() const _NOEXCEPT;
};

}  // std

#endif  // __LIBCPP_TYPEINFO
# 177 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/typeinfo" 3
# 595 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/new" 1 3
// -*- C++ -*-
//===----------------------------- new ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_NEW
#define _LIBCPP_NEW

/*
    new synopsis

namespace std
{

class bad_alloc
    : public exception
#endif /* expanded by -frewrite-includes */
# 70 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/new" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 73 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/new" 3
#endif
# 74 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/new" 3

namespace std  // purposefully not using versioning namespace
{

class _LIBCPP_EXCEPTION_ABI bad_alloc
    : public exception
{
public:
    bad_alloc() _NOEXCEPT;
    virtual ~bad_alloc() _NOEXCEPT;
    virtual const char* what() const _NOEXCEPT;
};

class _LIBCPP_EXCEPTION_ABI bad_array_new_length
    : public bad_alloc
{
public:
    bad_array_new_length() _NOEXCEPT;
    virtual ~bad_array_new_length() _NOEXCEPT;
    virtual const char* what() const _NOEXCEPT;
};

_LIBCPP_FUNC_VIS void __throw_bad_alloc();  // not in C++ spec

struct _LIBCPP_TYPE_VIS nothrow_t {};
extern _LIBCPP_FUNC_VIS const nothrow_t nothrow;
typedef void (*new_handler)();
_LIBCPP_FUNC_VIS new_handler set_new_handler(new_handler) _NOEXCEPT;
_LIBCPP_FUNC_VIS new_handler get_new_handler() _NOEXCEPT;

}  // std

#if defined(_WIN32) && !defined(cxx_EXPORTS)
# define _LIBCPP_NEW_DELETE_VIS _LIBCPP_FUNC_VIS_ONLY
#else
# 124 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/new" 3
# define _LIBCPP_NEW_DELETE_VIS _LIBCPP_FUNC_VIS
#endif
_LIBCPP_NEW_DELETE_VIS void* operator new(std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
_LIBCPP_NEW_DELETE_VIS void  operator delete(void* __p) _NOEXCEPT;
_LIBCPP_NEW_DELETE_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;

_LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz)
#if !__has_feature(cxx_noexcept)
    throw(std::bad_alloc)
#endif
# 140 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/new" 3
;
_LIBCPP_NEW_DELETE_VIS void* operator new[](std::size_t __sz, const std::nothrow_t&) _NOEXCEPT _NOALIAS;
_LIBCPP_NEW_DELETE_VIS void  operator delete[](void* __p) _NOEXCEPT;
_LIBCPP_NEW_DELETE_VIS void  operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;

inline _LIBCPP_INLINE_VISIBILITY void* operator new  (std::size_t, void* __p) _NOEXCEPT {return __p;}

#endif /* expanded by -frewrite-includes */
# 599 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
#if 0 /* expanded by -frewrite-includes */
#include <limits>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/limits" 1 3
// -*- C++ -*-
//===---------------------------- limits ----------------------------------===//
#ifndef _LIBCPP_LIMITS
#define _LIBCPP_LIMITS

/*
    limits synopsis

namespace std
{

template<> class numeric_limits<cv float>;
template<> class numeric_limits<cv double>;
template<> class numeric_limits<cv long double>;

}  // std

*/

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
_LIBCPP_WARNING("macro min is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing min")
#else
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro min is incompatible with C++.  #undefing min
#endif
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef min
#endif
# 20 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3

#ifdef max
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro max is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing max")
#else
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro max is incompatible with C++.  #undefing max
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
# 120 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/limits" 3
#endif // __IBMCPP__
# 121 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/limits" 3

_LIBCPP_BEGIN_NAMESPACE_STD

enum float_round_style
{
    round_indeterminate       = -1,
    round_toward_zero         =  0,
    round_to_nearest          =  1,
    round_toward_infinity     =  2,
    round_toward_neg_infinity =  3
};

enum float_denorm_style
{
    denorm_indeterminate = -1,
    denorm_absent = 0,
    denorm_present = 1
};

template <class _Tp, bool = is_arithmetic<_Tp>::value>
class __libcpp_numeric_limits
{
protected:
    typedef _Tp type;

    static _LIBCPP_CONSTEXPR const  bool is_specialized = false;
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return type();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return type();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return type();}

    static _LIBCPP_CONSTEXPR const int  digits = 0;
    static _LIBCPP_CONSTEXPR const int  digits10 = 0;
    static _LIBCPP_CONSTEXPR const int  max_digits10 = 0;
    static _LIBCPP_CONSTEXPR const bool is_signed = false;
    static _LIBCPP_CONSTEXPR const bool is_integer = false;
    static _LIBCPP_CONSTEXPR const bool is_exact = false;
    static _LIBCPP_CONSTEXPR const int  radix = 0;
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return type();}

    static _LIBCPP_CONSTEXPR const int  min_exponent = 0;
    static _LIBCPP_CONSTEXPR const int  min_exponent10 = 0;
    static _LIBCPP_CONSTEXPR const int  max_exponent = 0;
    static _LIBCPP_CONSTEXPR const int  max_exponent10 = 0;

    static _LIBCPP_CONSTEXPR const bool has_infinity = false;
    static _LIBCPP_CONSTEXPR const bool has_quiet_NaN = false;
    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = false;
    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = denorm_absent;
    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = false;
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return type(0);}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return type(0);}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return type(0);}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return type(0);}

    static _LIBCPP_CONSTEXPR const bool is_iec559 = false;
    static _LIBCPP_CONSTEXPR const bool is_bounded = true;
    static _LIBCPP_CONSTEXPR const bool is_modulo = true;

#if __i386__ || __x86_64__
    static _LIBCPP_CONSTEXPR const bool traps = true;
#else
# 243 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/limits" 3
    static _LIBCPP_CONSTEXPR const bool traps = false;
#endif
# 245 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/limits" 3
    static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
    static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
};

template <>
class __libcpp_numeric_limits<bool, true>
{
protected:
    typedef bool type;

    static _LIBCPP_CONSTEXPR const bool is_specialized = true;


    static _LIBCPP_CONSTEXPR const bool traps = false;
    static _LIBCPP_CONSTEXPR const bool tinyness_before = false;
    static _LIBCPP_CONSTEXPR const float_round_style round_style = round_to_nearest;
};

template <class _Tp>
class _LIBCPP_TYPE_VIS_ONLY numeric_limits
    : private __libcpp_numeric_limits<typename remove_cv<_Tp>::type>
{
    typedef __libcpp_numeric_limits<typename remove_cv<_Tp>::type> __base;
    typedef typename __base::type type;
public:
    static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}

    static _LIBCPP_CONSTEXPR const int  digits = __base::digits;
    static _LIBCPP_CONSTEXPR const int  digits10 = __base::digits10;
    static _LIBCPP_CONSTEXPR const int  max_digits10 = __base::max_digits10;
    static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
    static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
    static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
    static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
    static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
};

template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_specialized;
template <class _Tp>
    _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits;
template <class _Tp>
    _LIBCPP_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style;

template <class _Tp>
class _LIBCPP_TYPE_VIS_ONLY numeric_limits<const _Tp>
    : private numeric_limits<_Tp>
{
    typedef numeric_limits<_Tp> __base;
    typedef _Tp type;
public:
    static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}

    static _LIBCPP_CONSTEXPR const int  digits = __base::digits;
    static _LIBCPP_CONSTEXPR const int  digits10 = __base::digits10;
    static _LIBCPP_CONSTEXPR const int  max_digits10 = __base::max_digits10;
    static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
    static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
    static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
    static _LIBCPP_CONSTEXPR const int  radix = __base::radix;
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type epsilon() _NOEXCEPT {return __base::epsilon();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type round_error() _NOEXCEPT {return __base::round_error();}
    static _LIBCPP_CONSTEXPR const bool has_signaling_NaN = __base::has_signaling_NaN;
    static _LIBCPP_CONSTEXPR const float_denorm_style has_denorm = __base::has_denorm;
    static _LIBCPP_CONSTEXPR const bool has_denorm_loss = __base::has_denorm_loss;
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}

    static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
    static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
    static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;

    static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
    static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
    static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
};

template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_specialized;
template <class _Tp>
    _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::digits;
template <class _Tp>
    _LIBCPP_CONSTEXPR const int numeric_limits<const _Tp>::digits10;
template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::is_modulo;
template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::traps;
template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<const _Tp>::tinyness_before;
template <class _Tp>
    _LIBCPP_CONSTEXPR const float_round_style numeric_limits<const _Tp>::round_style;

template <class _Tp>
class _LIBCPP_TYPE_VIS_ONLY numeric_limits<volatile _Tp>
    : private numeric_limits<_Tp>
{
    typedef numeric_limits<_Tp> __base;
    typedef _Tp type;
public:
    static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type infinity() _NOEXCEPT {return __base::infinity();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type quiet_NaN() _NOEXCEPT {return __base::quiet_NaN();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type signaling_NaN() _NOEXCEPT {return __base::signaling_NaN();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}

    static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
    static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
    static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;

    static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
    static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
    static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
};

template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::is_specialized;
template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<volatile _Tp>::tinyness_before;
template <class _Tp>
    _LIBCPP_CONSTEXPR const float_round_style numeric_limits<volatile _Tp>::round_style;

template <class _Tp>
class _LIBCPP_TYPE_VIS_ONLY numeric_limits<const volatile _Tp>
    : private numeric_limits<_Tp>
{
    typedef numeric_limits<_Tp> __base;
    typedef _Tp type;
public:
    static _LIBCPP_CONSTEXPR const bool is_specialized = __base::is_specialized;
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type min() _NOEXCEPT {return __base::min();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type max() _NOEXCEPT {return __base::max();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type lowest() _NOEXCEPT {return __base::lowest();}

    static _LIBCPP_CONSTEXPR const int  digits = __base::digits;
    static _LIBCPP_CONSTEXPR const int  digits10 = __base::digits10;
    static _LIBCPP_CONSTEXPR const int  max_digits10 = __base::max_digits10;
    static _LIBCPP_CONSTEXPR const bool is_signed = __base::is_signed;
    static _LIBCPP_CONSTEXPR const bool is_integer = __base::is_integer;
    static _LIBCPP_CONSTEXPR const bool is_exact = __base::is_exact;
    static _LIBCPP_CONSTEXPR const int  radix = __base::radix;
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR type denorm_min() _NOEXCEPT {return __base::denorm_min();}

    static _LIBCPP_CONSTEXPR const bool is_iec559 = __base::is_iec559;
    static _LIBCPP_CONSTEXPR const bool is_bounded = __base::is_bounded;
    static _LIBCPP_CONSTEXPR const bool is_modulo = __base::is_modulo;

    static _LIBCPP_CONSTEXPR const bool traps = __base::traps;
    static _LIBCPP_CONSTEXPR const bool tinyness_before = __base::tinyness_before;
    static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style;
};

template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_specialized;
template <class _Tp>
    _LIBCPP_CONSTEXPR const int numeric_limits<const volatile _Tp>::digits;
template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_bounded;
template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::is_modulo;
template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::traps;
template <class _Tp>
    _LIBCPP_CONSTEXPR const bool numeric_limits<const volatile _Tp>::tinyness_before;
template <class _Tp>
    _LIBCPP_CONSTEXPR const float_round_style numeric_limits<const volatile _Tp>::round_style;

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_LIMITS
# 814 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/limits" 3
# 600 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <iterator>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 1 3
// -*- C++ -*-
//===-------------------------- iterator ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_ITERATOR
#define _LIBCPP_ITERATOR

/*
    iterator synopsis

namespace std
{

template<class Iterator>
struct iterator_traits
{
    typedef typename Iterator::difference_type difference_type;
    typedef typename Iterator::value_type value_type;
    typedef typename Iterator::pointer pointer;
    typedef typename Iterator::reference reference;
    typedef typename Iterator::iterator_category iterator_category;
};

template<class T>
#endif /* expanded by -frewrite-includes */
# 331 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
#if 0 /* expanded by -frewrite-includes */
#include <cstddef>
#endif /* expanded by -frewrite-includes */
# 332 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
#if 0 /* expanded by -frewrite-includes */
#include <iosfwd>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd" 1 3
// -*- C++ -*-
//===--------------------------- iosfwd -----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_IOSFWD
#define _LIBCPP_IOSFWD

/*
    iosfwd synopsis

namespace std
{

template<class charT> struct char_traits;
template<class T>     class allocator;
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
 *
 *	$NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
 */

#ifndef _WCHAR_H_
#define _WCHAR_H_

#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 72 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 73 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_null.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_null.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _MBSTATE_T
#define _MBSTATE_T
typedef __darwin_mbstate_t mbstate_t;
#endif /* _MBSTATE_T */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_mbstate_t.h" 3 4
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_ct_rune_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_ct_rune_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDARG_H
#define __STDARG_H

#ifndef _VA_LIST
typedef __builtin_va_list va_list;
#define _VA_LIST
#endif
# 33 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdarg.h" 3 4
#define va_start(ap, param) __builtin_va_start(ap, param)
#define va_end(ap)          __builtin_va_end(ap)
#define va_arg(ap, type)    __builtin_va_arg(ap, type)

/* GCC always defines __va_copy, but does not define va_copy unless in c99 mode
 * or -ansi is not specified, since it was not part of C90.
 */
#define __va_copy(d,s) __builtin_va_copy(d,s)

#if __STDC_VERSION__ >= 199900L || __cplusplus >= 201103L || !defined(__STRICT_ANSI__)
#define va_copy(dest, src)  __builtin_va_copy(dest, src)
#endif
# 45 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdarg.h" 3 4

/* Hack required to make standard headers work, at least on Ubuntu */
#define __GNUC_VA_LIST 1
typedef __builtin_va_list __gnuc_va_list;

#endif /* __STDARG_H */
# 51 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stdarg.h" 3 4
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 1 3 4
/*
 * Copyright (c) 2000, 2005, 2007, 2009, 2010 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 *
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. 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.
 *
 *	@(#)stdio.h	8.5 (Berkeley) 4/29/95
 */

#ifndef	_STDIO_H_
#define	_STDIO_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4

/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _SYS_STDIO_H_
#define	_SYS_STDIO_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/stdio.h" 3 4

#if __DARWIN_C_LEVEL >= 200809L
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/stdio.h" 3 4

__BEGIN_DECLS

 __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);

__END_DECLS

#endif /* __DARWIN_C_LEVEL >= 200809L */
# 44 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/stdio.h" 3 4

#endif /* _SYS_STDIO_H_ */
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/stdio.h" 3 4
# 76 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 2 3 4

typedef __darwin_off_t		fpos_t;

#define	_FSTDIO			/* Define for new stdio with functions. */

/*
 * NB: to fit things in six character monocase externals, the stdio
 * code uses the prefix `__s' for stdio objects, typically followed
 * by a three-character attempt at a mnemonic.
 */

/* stdio buffers */
struct __sbuf {
	unsigned char	*_base;
	int		_size;
};

/* hold a buncha junk that would grow the ABI */
struct __sFILEX;

/*
 * stdio state variables.
 *
 * The following always hold:
 *
 *	if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
 *		_lbfsize is -_bf._size, else _lbfsize is 0
 *	if _flags&__SRD, _w is 0
 *	if _flags&__SWR, _r is 0
 *
 * This ensures that the getc and putc macros (or inline functions) never
 * try to write or read from a file that is in `read' or `write' mode.
 * (Moreover, they can, and do, automatically switch from read mode to
 * write mode, and back, on "r+" and "w+" files.)
 *
 * _lbfsize is used only to make the inline line-buffered output stream
 * code as compact as possible.
 *
 * _ub, _up, and _ur are used when ungetc() pushes back more characters
 * than fit in the current _bf, or when ungetc() pushes back a character
 * that does not match the previous one in _bf.  When this happens,
 * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
 * _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
 *
 * NB: see WARNING above before changing the layout of this structure!
 */
typedef	struct __sFILE {
	unsigned char *_p;	/* current position in (some) buffer */
	int	_r;		/* read space left for getc() */
	int	_w;		/* write space left for putc() */
	short	_flags;		/* flags, below; this FILE is free if 0 */
	short	_file;		/* fileno, if Unix descriptor, else -1 */
	struct	__sbuf _bf;	/* the buffer (at least 1 byte, if !NULL) */
	int	_lbfsize;	/* 0 or -_bf._size, for inline putc */

	/* operations */
	void	*_cookie;	/* cookie passed to io functions */
	int	(*_close)(void *);
	int	(*_read) (void *, char *, int);
	fpos_t	(*_seek) (void *, fpos_t, int);
	int	(*_write)(void *, const char *, int);

	/* separate buffer for long sequences of ungetc() */
	struct	__sbuf _ub;	/* ungetc buffer */
	struct __sFILEX *_extra; /* additions to FILE to not break ABI */
	int	_ur;		/* saved _r when _r is counting ungetc data */

	/* tricks to meet minimum requirements even when malloc() fails */
	unsigned char _ubuf[3];	/* guarantee an ungetc() buffer */
	unsigned char _nbuf[1];	/* guarantee a getc() buffer */

	/* separate buffer for fgetln() when line crosses buffer boundary */
	struct	__sbuf _lb;	/* buffer for fgetln() */

	/* Unix stdio files get aligned to block boundaries on fseek() */
	int	_blksize;	/* stat.st_blksize (may be != _bf._size) */
	fpos_t	_offset;	/* current lseek offset (see WARNING) */
} FILE;

__BEGIN_DECLS
extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
__END_DECLS

#define	__SLBF	0x0001		/* line buffered */
#define	__SNBF	0x0002		/* unbuffered */
#define	__SRD	0x0004		/* OK to read */
#define	__SWR	0x0008		/* OK to write */
	/* RD and WR are never simultaneously asserted */
#define	__SRW	0x0010		/* open for reading & writing */
#define	__SEOF	0x0020		/* found EOF */
#define	__SERR	0x0040		/* found error */
#define	__SMBF	0x0080		/* _buf is from malloc */
#define	__SAPP	0x0100		/* fdopen()ed in append mode */
#define	__SSTR	0x0200		/* this is an sprintf/snprintf string */
#define	__SOPT	0x0400		/* do fseek() optimisation */
#define	__SNPT	0x0800		/* do not do fseek() optimisation */
#define	__SOFF	0x1000		/* set iff _offset is in fact correct */
#define	__SMOD	0x2000		/* true => fgetln modified _p text */
#define __SALC  0x4000		/* allocate string space dynamically */
#define __SIGN  0x8000		/* ignore this file in _fwalk */

/*
 * The following three definitions are for ANSI C, which took them
 * from System V, which brilliantly took internal interface macros and
 * made them official arguments to setvbuf(), without renaming them.
 * Hence, these ugly _IOxxx names are *supposed* to appear in user code.
 *
 * Although numbered as their counterparts above, the implementation
 * does not rely on this.
 */
#define	_IOFBF	0		/* setvbuf should set fully buffered */
#define	_IOLBF	1		/* setvbuf should set line buffered */
#define	_IONBF	2		/* setvbuf should set unbuffered */

#define	BUFSIZ	1024		/* size of buffer used by setbuf */
#define	EOF	(-1)

				/* must be == _POSIX_STREAM_MAX <limits.h> */
#define	FOPEN_MAX	20	/* must be <= OPEN_MAX <sys/syslimits.h> */
#define	FILENAME_MAX	1024	/* must be <= PATH_MAX <sys/syslimits.h> */

/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
#ifndef _ANSI_SOURCE
#define	P_tmpdir	"/var/tmp/"
#endif
# 203 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
#define	L_tmpnam	1024	/* XXX must be == PATH_MAX */
#define	TMP_MAX		308915776

#ifndef SEEK_SET
#define	SEEK_SET	0	/* set file offset to offset */
#endif
# 209 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
#ifndef SEEK_CUR
#define	SEEK_CUR	1	/* set file offset to current plus offset */
#endif
# 212 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
#ifndef SEEK_END
#define	SEEK_END	2	/* set file offset to EOF plus offset */
#endif
# 215 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4

#define	stdin	__stdinp
#define	stdout	__stdoutp
#define	stderr	__stderrp

#ifdef _DARWIN_UNLIMITED_STREAMS
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_3_2
#error "_DARWIN_UNLIMITED_STREAMS specified, but -miphoneos-version-min version does not support it."
#elif defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_6
# 224 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
#error "_DARWIN_UNLIMITED_STREAMS specified, but -mmacosx-version-min version does not support it."
#endif
# 226 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
#endif
# 227 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4

/* ANSI-C */

__BEGIN_DECLS
;
;
;
;
int	 fflush(FILE *);
;
;
;
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
FILE	*fopen(const char * __restrict, const char * __restrict) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fopen));
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
# 242 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
 __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fopen));
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
# 244 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
int	 fprintf(FILE * __restrict, const char * __restrict, ...) __printflike(2, 3);
;
int	 fputs(const char * __restrict, FILE * __restrict) __DARWIN_ALIAS(fputs);
;
FILE	*freopen(const char * __restrict, const char * __restrict,
                 FILE * __restrict) __DARWIN_ALIAS(freopen);
int	 fscanf(FILE * __restrict, const char * __restrict, ...) __scanflike(2, 3);
;
;
;
size_t	 fwrite(const void * __restrict, size_t, size_t, FILE * __restrict) __DARWIN_ALIAS(fwrite);
;
;
#if !defined(_POSIX_C_SOURCE)
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
#endif
# 276 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
char	*tmpnam(char *);
;
int	 vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0);
int	 vprintf(const char * __restrict, va_list) __printflike(1, 0);
int	 vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0);
__END_DECLS



/* Additional functionality provided by:
 * POSIX.1-1988
 */

#if __DARWIN_C_LEVEL >= 198808L
#define	L_ctermid	1024	/* size for ctermid(); PATH_MAX */

__BEGIN_DECLS
#ifndef __CTERMID_DEFINED
/* Multiply defined in stdio.h and unistd.h by SUS */
#define __CTERMID_DEFINED 1
;
#endif
# 298 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4

#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
FILE	*fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen));
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
# 302 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
 __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
# 304 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
;
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 198808L */
# 307 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4


/* Additional functionality provided by:
 * POSIX.2-1992 C Language Binding Option
 */

#if __DARWIN_C_LEVEL >= 199209L
__BEGIN_DECLS
;
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
FILE	*popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen));
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
# 319 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
 __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen));
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
# 321 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 199209L */
# 323 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4




/* Additional functionality provided by:
 * POSIX.1c-1995,
# 402 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4



/* Additional functionality provided by:
 * POSIX.1-2001
 * ISO C99
 */

#if __DARWIN_C_LEVEL >= 200112L
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_off_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_off_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _OFF_T 
#define _OFF_T 
typedef __darwin_off_t		off_t;
#endif  /* _OFF_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_off_t.h" 3 4
# 412 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 2 3 4

__BEGIN_DECLS
;
;
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200112L */
# 418 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4

#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
__BEGIN_DECLS
int	 snprintf(char * __restrict, size_t, const char * __restrict, ...) __printflike(3, 4);
int	 vfscanf(FILE * __restrict, const char * __restrict, va_list) __scanflike(2, 0);
int	 vscanf(const char * __restrict, va_list) __scanflike(1, 0);
int	 vsnprintf(char * __restrict, size_t, const char * __restrict, va_list) __printflike(3, 0);
int	 vsscanf(const char * __restrict, const char * __restrict, va_list) __scanflike(2, 0);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus) */
# 428 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4



/* Additional functionality provided by:
 * POSIX.1-2008
 */

#if __DARWIN_C_LEVEL >= 200809L
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_ssize_t.h>
#endif /* expanded by -frewrite-includes */
# 437 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4

__BEGIN_DECLS
int	dprintf(int, const char * __restrict, ...) __printflike(2, 3) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
int	 asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
;
;
__const char *fmtcheck(const char *, const char *);
;
;
;
int	 vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
;


/*
 * Stdio function-access interface.
 */
;
__END_DECLS
# 488 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
#endif /* _USE_EXTENDED_LOCALES_ */
# 489 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4

#if defined (__GNUC__) && _FORTIFY_SOURCE > 0 && !defined (__cplusplus)
/* Security checking functions.  */
#if 0 /* expanded by -frewrite-includes */
#include <secure/_stdio.h>
#endif /* expanded by -frewrite-includes */
# 493 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
#endif
# 494 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4

#endif /* _STDIO_H_ */
# 496 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdio.h" 3 4
# 91 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <time.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 1 3 4
/*
 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
 *
 * 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. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 *	@(#)time.h	8.3 (Berkeley) 1/21/94
 */

#ifndef _TIME_H_
#define	_TIME_H_

#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_clock_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_clock_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _CLOCK_T
#define _CLOCK_T
typedef __darwin_clock_t        clock_t;
#endif /* _CLOCK_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_clock_t.h" 3 4
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_null.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_null.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _TIME_T 
#define _TIME_T 
typedef __darwin_time_t		time_t; 
#endif  /* _TIME_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_time_t.h" 3 4
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_timespec.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_timespec.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
_STRUCT_TIMESPEC
{
	__darwin_time_t	tv_sec;
	long            tv_nsec;
};
#endif /* _STRUCT_TIMESPEC */
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_timespec.h" 3 4
# 72 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 2 3 4

struct tm {
	int	tm_sec;		/* seconds after the minute [0-60] */
	int	tm_min;		/* minutes after the hour [0-59] */
	int	tm_hour;	/* hours since midnight [0-23] */
	int	tm_mday;	/* day of the month [1-31] */
	int	tm_mon;		/* months since January [0-11] */
	int	tm_year;	/* years since 1900 */
	int	tm_wday;	/* days since Sunday [0-6] */
	int	tm_yday;	/* days since January 1 [0-365] */
	int	tm_isdst;	/* Daylight Savings Time flag */
	long	tm_gmtoff;	/* offset from CUT in seconds */
	char	*tm_zone;	/* timezone abbreviation */
};

#if __DARWIN_UNIX03
#define CLOCKS_PER_SEC  1000000	/* [XSI] */
#else /* !__DARWIN_UNIX03 */
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_limits.h>	/* Include file containing CLK_TCK. */
#endif /* expanded by -frewrite-includes */
# 91 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4

#define CLOCKS_PER_SEC  (__DARWIN_CLK_TCK)
#endif /* __DARWIN_UNIX03 */
# 94 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4

#ifndef _ANSI_SOURCE
extern char *tzname[];
#endif
# 98 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4

extern int getdate_err;
#if __DARWIN_UNIX03
extern long timezone __DARWIN_ALIAS(timezone);
#endif /* __DARWIN_UNIX03 */
# 103 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4
extern int daylight;

__BEGIN_DECLS
;
clock_t clock(void) __DARWIN_ALIAS(clock);
;
;
;
;
;
time_t mktime(struct tm *) __DARWIN_ALIAS(mktime);
size_t strftime(char * __restrict, size_t, const char * __restrict, const struct tm * __restrict) __DARWIN_ALIAS(strftime);
char *strptime(const char * __restrict, const char * __restrict, struct tm * __restrict) __DARWIN_ALIAS(strptime);
;

#ifndef _ANSI_SOURCE
;
#endif /* not ANSI */
# 121 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4

/* [TSF] Thread safe functions */
;
;
;
;

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
;
#if !__DARWIN_UNIX03
char *timezone(int, int);
#endif /* !__DARWIN_UNIX03 */
# 133 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4
;
;
;
;
#endif /* neither ANSI nor POSIX */
# 138 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4

#if !defined(_ANSI_SOURCE)
int nanosleep(const struct timespec *, struct timespec *) __DARWIN_ALIAS_C(nanosleep);
#endif
# 142 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4
__END_DECLS

#ifdef _USE_EXTENDED_LOCALES_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_time.h>
#endif /* expanded by -frewrite-includes */
# 146 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4
#endif /* _USE_EXTENDED_LOCALES_ */
# 147 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4

#endif /* !_TIME_H_ */
# 149 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/time.h" 3 4
# 92 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_wctype.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 1 3 4
/*-
 * Copyright (c)1999 Citrus Project,
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 */

/*
 * Common header for wctype.h and wchar.h
 *
 * Contains everything required by wctype.h except:
 *
 *	#include <_types/_wctrans_t.h>
 *	int iswblank(wint_t);
 *	wint_t towctrans(wint_t, wctrans_t);
 *	wctrans_t wctrans(const char *);
 */

#ifndef __WCTYPE_H_
#define __WCTYPE_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 43 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 44 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_wint_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_wint_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _WINT_T
#define _WINT_T
typedef __darwin_wint_t wint_t;
#endif /* _WINT_T */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_wint_t.h" 3 4
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_wint_t.h>
#endif /* expanded by -frewrite-includes */
# 47 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types/_wctype_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_wctype_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _WCTYPE_T
#define _WCTYPE_T 
typedef __darwin_wctype_t wctype_t;
#endif /* _WCTYPE_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_wctype_t.h" 3 4
# 48 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 2 3 4

#ifndef WEOF
#define WEOF			__DARWIN_WEOF
#endif
# 52 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 3 4

#ifndef __DARWIN_WCTYPE_TOP_inline
#define __DARWIN_WCTYPE_TOP_inline __header_inline
#endif
# 56 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <ctype.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 1 3 4
/*
 * Copyright (c) 2000, 2005, 2008 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 */
/*
 * Copyright (c) 1989, 1993
 *	The Regents of the University of California.  All rights reserved.
 * (c) UNIX System Laboratories, Inc.
 * All or some portions of this file are derived from material licensed
 * to the University of California by American Telephone and Telegraph
 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
 * the permission of UNIX System Laboratories, Inc.
 *
 *	@(#)ctype.h	8.4 (Berkeley) 1/21/94
 */

#ifndef	_CTYPE_H_
#define _CTYPE_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 70 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <runetype.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/runetype.h" 1 3 4
/*-
 * Copyright (c) 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Paul Borman at Krystal Technologies.
 *
 * Redistribution and use in source and binary forms, with or without
 * 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.
 *
 *	@(#)runetype.h	8.1 (Berkeley) 6/2/93
 */

#ifndef	_RUNETYPE_H_
#define	_RUNETYPE_H_

#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 43 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/runetype.h" 3 4

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)

#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 53 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/runetype.h" 3 4

#define	_CACHED_RUNES	(1 <<8 )	/* Must be a power of 2 */
#define	_CRMASK		(~(_CACHED_RUNES - 1))

/*
 * The lower 8 bits of runetype[] contain the digit value of the rune.
 */
typedef struct {
	__darwin_rune_t	__min;		/* First rune of the range */
	__darwin_rune_t	__max;		/* Last rune (inclusive) of the range */
	__darwin_rune_t	__map;		/* What first maps to in maps */
	__uint32_t	*__types;	/* Array of types in range */
} _RuneEntry;

typedef struct {
	int		__nranges;	/* Number of ranges stored */
	_RuneEntry	*__ranges;	/* Pointer to the ranges */
} _RuneRange;

typedef struct {
	char		__name[14];	/* CHARCLASS_NAME_MAX = 14 */
	__uint32_t	__mask;		/* charclass mask */
} _RuneCharClass;

typedef struct {
	char		__magic[8];	/* Magic saying what version we are */
	char		__encoding[32];	/* ASCII name of this encoding */

	__darwin_rune_t	(*__sgetrune)(const char *, __darwin_size_t, char const **);
	int		(*__sputrune)(__darwin_rune_t, char *, __darwin_size_t, char **);
	__darwin_rune_t	__invalid_rune;

	__uint32_t	__runetype[_CACHED_RUNES];
	__darwin_rune_t	__maplower[_CACHED_RUNES];
	__darwin_rune_t	__mapupper[_CACHED_RUNES];

	/*
	 * The following are to deal with Runes larger than _CACHED_RUNES - 1.
	 * Their data is actually contiguous with this structure so as to make
	 * it easier to read/write from/to disk.
	 */
	_RuneRange	__runetype_ext;
	_RuneRange	__maplower_ext;
	_RuneRange	__mapupper_ext;

	void		*__variable;	/* Data which depends on the encoding */
	int		__variable_len;	/* how long that data is */

	/*
	 * extra fields to deal with arbitrary character classes
	 */
	int		__ncharclasses;
	_RuneCharClass	*__charclasses;
} _RuneLocale;

#define	_RUNE_MAGIC_A	"RuneMagA"	/* Indicates version A of RuneLocale */

__BEGIN_DECLS
extern _RuneLocale _DefaultRuneLocale;
extern _RuneLocale *_CurrentRuneLocale;
__END_DECLS

#endif	/* !_RUNETYPE_H_ */
# 116 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/runetype.h" 3 4
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 2 3 4

#define	_CTYPE_A	0x00000100L		/* Alpha */
#define	_CTYPE_C	0x00000200L		/* Control */
#define	_CTYPE_D	0x00000400L		/* Digit */
#define	_CTYPE_G	0x00000800L		/* Graph */
#define	_CTYPE_L	0x00001000L		/* Lower */
#define	_CTYPE_P	0x00002000L		/* Punct */
#define	_CTYPE_S	0x00004000L		/* Space */
#define	_CTYPE_U	0x00008000L		/* Upper */
#define	_CTYPE_X	0x00010000L		/* X digit */
#define	_CTYPE_B	0x00020000L		/* Blank */
#define	_CTYPE_R	0x00040000L		/* Print */
#define	_CTYPE_I	0x00080000L		/* Ideogram */
#define	_CTYPE_T	0x00100000L		/* Special */
#define	_CTYPE_Q	0x00200000L		/* Phonogram */
#define	_CTYPE_SW0	0x20000000L		/* 0 width character */
#define	_CTYPE_SW1	0x40000000L		/* 1 width character */
#define	_CTYPE_SW2	0x80000000L		/* 2 width character */
#define	_CTYPE_SW3	0xc0000000L		/* 3 width character */
#define	_CTYPE_SWM	0xe0000000L		/* Mask for screen width data */
#define	_CTYPE_SWS	30			/* Bits to shift to get width */

#ifdef _NONSTD_SOURCE
/*
 * Backward compatibility
 */
#define	_A		_CTYPE_A		/* Alpha */
#define	_C		_CTYPE_C		/* Control */
#define	_D		_CTYPE_D		/* Digit */
#define	_G		_CTYPE_G		/* Graph */
#define	_L		_CTYPE_L		/* Lower */
#define	_P		_CTYPE_P		/* Punct */
#define	_S		_CTYPE_S		/* Space */
#define	_U		_CTYPE_U		/* Upper */
#define	_X		_CTYPE_X		/* X digit */
#define	_B		_CTYPE_B		/* Blank */
#define	_R		_CTYPE_R		/* Print */
#define	_I		_CTYPE_I		/* Ideogram */
#define	_T		_CTYPE_T		/* Special */
#define	_Q		_CTYPE_Q		/* Phonogram */
#define	_SW0		_CTYPE_SW0		/* 0 width character */
#define	_SW1		_CTYPE_SW1		/* 1 width character */
#define	_SW2		_CTYPE_SW2		/* 2 width character */
#define	_SW3		_CTYPE_SW3		/* 3 width character */
#endif /* _NONSTD_SOURCE */
# 116 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4

#define __DARWIN_CTYPE_inline		__header_inline

#define __DARWIN_CTYPE_TOP_inline	__header_inline

/*
 * Use inline functions if we are allowed to and the compiler supports them.
 */
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
    (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))

/* See comments in <machine/_type.h> about __darwin_ct_rune_t. */
__BEGIN_DECLS
;
;
;
__END_DECLS

__DARWIN_CTYPE_TOP_inline int
isascii(int _c)
{
	return ((_c & ~0x7F) == 0);
}

#ifdef USE_ASCII
__DARWIN_CTYPE_inline int
__maskrune(__darwin_ct_rune_t _c, unsigned long _f)
{
	return (int)_DefaultRuneLocale.__runetype[_c & 0xff] & (__uint32_t)_f;
}
#else /* !USE_ASCII */
# 147 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
__BEGIN_DECLS
int             	__maskrune(__darwin_ct_rune_t, unsigned long);
__END_DECLS
#endif /* USE_ASCII */
# 151 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4

__DARWIN_CTYPE_inline int
__istype(__darwin_ct_rune_t _c, unsigned long _f)
{
#ifdef USE_ASCII
	return !!(__maskrune(_c, _f));
#else /* USE_ASCII */
# 158 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
	return (isascii(_c) ? !!(_DefaultRuneLocale.__runetype[_c] & _f)
		: !!__maskrune(_c, _f));
#endif /* USE_ASCII */
# 161 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
}

__DARWIN_CTYPE_inline __darwin_ct_rune_t
__isctype(__darwin_ct_rune_t _c, unsigned long _f)
{
#ifdef USE_ASCII
	return !!(__maskrune(_c, _f));
#else /* USE_ASCII */
# 169 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
	return (_c < 0 || _c >= _CACHED_RUNES) ? 0 :
		!!(_DefaultRuneLocale.__runetype[_c] & _f);
#endif /* USE_ASCII */
# 172 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
}

#ifdef USE_ASCII
__DARWIN_CTYPE_inline __darwin_ct_rune_t
__toupper(__darwin_ct_rune_t _c)
{
	return _DefaultRuneLocale.__mapupper[_c & 0xff];
}

__DARWIN_CTYPE_inline __darwin_ct_rune_t
__tolower(__darwin_ct_rune_t _c)
{
	return _DefaultRuneLocale.__maplower[_c & 0xff];
}
#else /* !USE_ASCII */
# 187 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
__BEGIN_DECLS
__darwin_ct_rune_t	__toupper(__darwin_ct_rune_t);
__darwin_ct_rune_t	__tolower(__darwin_ct_rune_t);
__END_DECLS
#endif /* USE_ASCII */
# 192 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4

__DARWIN_CTYPE_inline int
__wcwidth(__darwin_ct_rune_t _c)
{
	unsigned int _x;

	if (_c == 0)
		return (0);
	_x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R);
	if ((_x & _CTYPE_SWM) != 0)
		return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
	return ((_x & _CTYPE_R) != 0 ? 1 : -1);
}

#ifndef _EXTERNALIZE_CTYPE_INLINES_

#define	_tolower(c)	__tolower(c)
#define	_toupper(c)	__toupper(c)

__DARWIN_CTYPE_TOP_inline int
isalnum(int _c)
{
	return (__istype(_c, _CTYPE_A|_CTYPE_D));
}

__DARWIN_CTYPE_TOP_inline int
isalpha(int _c)
{
	return (__istype(_c, _CTYPE_A));
}

__DARWIN_CTYPE_TOP_inline int
isblank(int _c)
{
	return (__istype(_c, _CTYPE_B));
}

__DARWIN_CTYPE_TOP_inline int
iscntrl(int _c)
{
	return (__istype(_c, _CTYPE_C));
}

/* ANSI -- locale independent */
__DARWIN_CTYPE_TOP_inline int
isdigit(int _c)
{
	return (__isctype(_c, _CTYPE_D));
}

__DARWIN_CTYPE_TOP_inline int
isgraph(int _c)
{
	return (__istype(_c, _CTYPE_G));
}

__DARWIN_CTYPE_TOP_inline int
islower(int _c)
{
	return (__istype(_c, _CTYPE_L));
}

__DARWIN_CTYPE_TOP_inline int
isprint(int _c)
{
	return (__istype(_c, _CTYPE_R));
}

__DARWIN_CTYPE_TOP_inline int
ispunct(int _c)
{
	return (__istype(_c, _CTYPE_P));
}

__DARWIN_CTYPE_TOP_inline int
isspace(int _c)
{
	return (__istype(_c, _CTYPE_S));
}

__DARWIN_CTYPE_TOP_inline int
isupper(int _c)
{
	return (__istype(_c, _CTYPE_U));
}

/* ANSI -- locale independent */
__DARWIN_CTYPE_TOP_inline int
isxdigit(int _c)
{
	return (__isctype(_c, _CTYPE_X));
}

__DARWIN_CTYPE_TOP_inline int
toascii(int _c)
{
	return (_c & 0x7F);
}

__DARWIN_CTYPE_TOP_inline int
tolower(int _c)
{
        return (__tolower(_c));
}

__DARWIN_CTYPE_TOP_inline int
toupper(int _c)
{
        return (__toupper(_c));
}

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
__DARWIN_CTYPE_TOP_inline int
digittoint(int _c)
{
	return (__maskrune(_c, 0x0F));
}

__DARWIN_CTYPE_TOP_inline int
ishexnumber(int _c)
{
	return (__istype(_c, _CTYPE_X));
}

__DARWIN_CTYPE_TOP_inline int
isideogram(int _c)
{
	return (__istype(_c, _CTYPE_I));
}

__DARWIN_CTYPE_TOP_inline int
isnumber(int _c)
{
	return (__istype(_c, _CTYPE_D));
}

__DARWIN_CTYPE_TOP_inline int
isphonogram(int _c)
{
	return (__istype(_c, _CTYPE_Q));
}

__DARWIN_CTYPE_TOP_inline int
isrune(int _c)
{
	return (__istype(_c, 0xFFFFFFF0L));
}

__DARWIN_CTYPE_TOP_inline int
isspecial(int _c)
{
	return (__istype(_c, _CTYPE_T));
}
#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 346 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
#endif /* _EXTERNALIZE_CTYPE_INLINES_ */
# 347 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4

#else /* not using inlines */
# 349 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4

__BEGIN_DECLS
int     isalnum(int);
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
int     _tolower(int);
int     _toupper(int);
int     digittoint(int);
int     ishexnumber(int);
int     isideogram(int);
int     isnumber(int);
int     isphonogram(int);
int     isrune(int);
int     isspecial(int);
#endif
# 379 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
__END_DECLS

#endif /* using inlines */
# 382 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4

#ifdef _USE_EXTENDED_LOCALES_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_ctype.h>
#endif /* expanded by -frewrite-includes */
# 385 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
#endif /* _USE_EXTENDED_LOCALES_ */
# 386 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4

#endif /* !_CTYPE_H_ */
# 388 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/ctype.h" 3 4
# 58 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 2 3 4

/*
 * Use inline functions if we are allowed to and the compiler supports them.
 */
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
    (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))

__DARWIN_WCTYPE_TOP_inline int
iswalnum(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_A|_CTYPE_D));
}

__DARWIN_WCTYPE_TOP_inline int
iswalpha(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_A));
}

__DARWIN_WCTYPE_TOP_inline int
iswcntrl(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_C));
}

__DARWIN_WCTYPE_TOP_inline int
iswctype(wint_t _wc, wctype_t _charclass)
{
	return (__istype(_wc, _charclass));
}

__DARWIN_WCTYPE_TOP_inline int
iswdigit(wint_t _wc)
{
	return (__isctype(_wc, _CTYPE_D));
}

__DARWIN_WCTYPE_TOP_inline int
iswgraph(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_G));
}

__DARWIN_WCTYPE_TOP_inline int
iswlower(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_L));
}

__DARWIN_WCTYPE_TOP_inline int
iswprint(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_R));
}

__DARWIN_WCTYPE_TOP_inline int
iswpunct(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_P));
}
# 177 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 3 4
#endif /* _USE_EXTENDED_LOCALES_ */
# 178 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 3 4

#endif /* __WCTYPE_H_ */
# 180 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_wctype.h" 3 4
# 93 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 2 3 4


/* Initially added in Issue 4 */
__BEGIN_DECLS
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
wint_t	ungetwc(wint_t, FILE *);
int	vfwprintf(FILE * __restrict, const wchar_t * __restrict,
	    __darwin_va_list);
int	vswprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict,
	    __darwin_va_list);
int	vwprintf(const wchar_t * __restrict, __darwin_va_list);
size_t	wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
wchar_t	*wcscat(wchar_t * __restrict, const wchar_t * __restrict);
wchar_t	*wcschr(const wchar_t *, wchar_t);
int	wcscmp(const wchar_t *, const wchar_t *);
;
;
;
size_t	wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
	    const struct tm * __restrict) __DARWIN_ALIAS(wcsftime);
size_t	wcslen(const wchar_t *);
;
;
;
;
;
;
;
;
;
;
;
;
;
;
wchar_t	*wmemchr(const wchar_t *, wchar_t, size_t);
int	wmemcmp(const wchar_t *, const wchar_t *, size_t);
wchar_t	*wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
wchar_t	*wmemmove(wchar_t *, const wchar_t *, size_t);
wchar_t	*wmemset(wchar_t *, wchar_t, size_t);
;
;
;
;
__END_DECLS



/* Additional functionality provided by:
 * POSIX.1-2001
 * ISO C99
 */

#if __DARWIN_C_LEVEL >= 200112L || defined(_C99_SOURCE) || defined(__cplusplus)
__BEGIN_DECLS
;
;
;
;
;
#if !__DARWIN_NO_LONG_LONG
;
;
#endif /* !__DARWIN_NO_LONG_LONG */
# 184 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 3 4
__END_DECLS
#endif
# 186 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 3 4

# 219 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 3 4


/* Poison the following routines if -fshort-wchar is set */
#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
#pragma GCC poison fgetwln fgetws fputwc fputws fwprintf fwscanf mbrtowc mbsnrtowcs mbsrtowcs putwc putwchar swprintf swscanf vfwprintf vfwscanf vswprintf vswscanf vwprintf vwscanf wcrtomb wcscat wcschr wcscmp wcscoll wcscpy wcscspn wcsftime wcsftime wcslcat wcslcpy wcslen wcsncat wcsncmp wcsncpy wcsnrtombs wcspbrk wcsrchr wcsrtombs wcsspn wcsstr wcstod wcstof wcstok wcstol wcstold wcstoll wcstoul wcstoull wcswidth wcsxfrm wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset wprintf wscanf
#endif
# 225 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 3 4

#ifdef _USE_EXTENDED_LOCALES_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_wchar.h>
#endif /* expanded by -frewrite-includes */
# 228 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 3 4
#endif /* _USE_EXTENDED_LOCALES_ */
# 229 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 3 4

#endif /* !_WCHAR_H_ */
# 231 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wchar.h" 3 4
# 91 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 94 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd" 3
#endif
# 95 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd" 3

_LIBCPP_BEGIN_NAMESPACE_STD

class _LIBCPP_TYPE_VIS ios_base;

template<class _CharT>  struct _LIBCPP_TYPE_VIS_ONLY char_traits;
template<class _Tp>     class _LIBCPP_TYPE_VIS_ONLY allocator;

template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_ios;

template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_streambuf;
template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_istream;
template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_ostream;
template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_iostream;

template <class _CharT, class _Traits = char_traits<_CharT>,
          class _Allocator = allocator<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_stringbuf;
template <class _CharT, class _Traits = char_traits<_CharT>,
          class _Allocator = allocator<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_istringstream;
template <class _CharT, class _Traits = char_traits<_CharT>,
          class _Allocator = allocator<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_ostringstream;
template <class _CharT, class _Traits = char_traits<_CharT>,
          class _Allocator = allocator<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_stringstream;

template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_filebuf;
template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_ifstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_ofstream;
template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_fstream;

template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY istreambuf_iterator;
template <class _CharT, class _Traits = char_traits<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY ostreambuf_iterator;

typedef basic_ios<char>              ios;
typedef basic_ios<wchar_t>           wios;

typedef basic_streambuf<char>        streambuf;
typedef basic_istream<char>          istream;
typedef basic_ostream<char>          ostream;
typedef basic_iostream<char>         iostream;

typedef basic_stringbuf<char>        stringbuf;
typedef basic_istringstream<char>    istringstream;
typedef basic_ostringstream<char>    ostringstream;
typedef basic_stringstream<char>     stringstream;

typedef basic_filebuf<char>          filebuf;
typedef basic_ifstream<char>         ifstream;
typedef basic_ofstream<char>         ofstream;

template <class _State>             class _LIBCPP_TYPE_VIS_ONLY fpos;
typedef fpos<mbstate_t>    streampos;
typedef fpos<mbstate_t>    wstreampos;
#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
typedef fpos<mbstate_t>    u16streampos;
typedef fpos<mbstate_t>    u32streampos;
#endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
# 182 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd" 3

typedef long long streamoff;        // for char_traits in <string>

template <class _CharT,             // for <stdexcept>
          class _Traits = char_traits<_CharT>,
          class _Allocator = allocator<_CharT> >
    class _LIBCPP_TYPE_VIS_ONLY basic_string;
typedef basic_string<char, char_traits<char>, allocator<char> > string;
typedef basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> > wstring;

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_IOSFWD
# 195 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd" 3
# 333 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <initializer_list>
#endif /* expanded by -frewrite-includes */
# 334 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
#ifdef __APPLE__
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 346 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
#endif
# 347 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3

_LIBCPP_BEGIN_NAMESPACE_STD

struct _LIBCPP_TYPE_VIS_ONLY input_iterator_tag {};
struct _LIBCPP_TYPE_VIS_ONLY output_iterator_tag {};
struct _LIBCPP_TYPE_VIS_ONLY forward_iterator_tag       : public input_iterator_tag {};
struct _LIBCPP_TYPE_VIS_ONLY bidirectional_iterator_tag : public forward_iterator_tag {};
struct _LIBCPP_TYPE_VIS_ONLY random_access_iterator_tag : public bidirectional_iterator_tag {};

template <class _Tp>
struct __has_iterator_category
{
private:
    struct __two {char __lx; char __lxx;};
    ;
    template <class _Up> static char __test(typename _Up::iterator_category* = 0);
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Iter, bool> struct __iterator_traits_impl {};

template <class _Iter>
struct __iterator_traits_impl<_Iter, true>
{
    typedef typename _Iter::difference_type   difference_type;
    typedef typename _Iter::value_type        value_type;
    typedef typename _Iter::pointer           pointer;
    typedef typename _Iter::reference         reference;
    typedef typename _Iter::iterator_category iterator_category;
};

template <class _Iter, bool> struct __iterator_traits {};

template <class _Iter>
struct __iterator_traits<_Iter, true>
    :  __iterator_traits_impl
      <
        _Iter,
        is_convertible<typename _Iter::iterator_category, input_iterator_tag>::value ||
        is_convertible<typename _Iter::iterator_category, output_iterator_tag>::value
      >
{};

// iterator_traits<Iterator> will only have the nested types if Iterator::iterator_category
//    exists.  Else iterator_traits<Iterator> will be an empty class.  This is a
//    conforming extension which allows some programs to compile and behave as
//    the client expects instead of failing at compile time.

template <class _Iter>
struct _LIBCPP_TYPE_VIS_ONLY iterator_traits
    : __iterator_traits<_Iter, __has_iterator_category<_Iter>::value> {};

template<class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY iterator_traits<_Tp*>
{
    typedef ptrdiff_t difference_type;
    typedef typename remove_const<_Tp>::type value_type;
    typedef _Tp* pointer;
    typedef _Tp& reference;
    typedef random_access_iterator_tag iterator_category;
};

template <class _Tp, class _Up, bool = __has_iterator_category<iterator_traits<_Tp> >::value>
struct __has_iterator_category_convertible_to
    : public integral_constant<bool, is_convertible<typename iterator_traits<_Tp>::iterator_category, _Up>::value>
{};

template <class _Tp, class _Up>
struct __has_iterator_category_convertible_to<_Tp, _Up, false> : public false_type {};

template <class _Tp>
struct __is_input_iterator : public __has_iterator_category_convertible_to<_Tp, input_iterator_tag> {};

template <class _Tp>
struct __is_forward_iterator : public __has_iterator_category_convertible_to<_Tp, forward_iterator_tag> {};

template <class _Tp>
struct __is_bidirectional_iterator : public __has_iterator_category_convertible_to<_Tp, bidirectional_iterator_tag> {};

template <class _Tp>
struct __is_random_access_iterator : public __has_iterator_category_convertible_to<_Tp, random_access_iterator_tag> {};

template<class _Category, class _Tp, class _Distance = ptrdiff_t,
         class _Pointer = _Tp*, class _Reference = _Tp&>
struct _LIBCPP_TYPE_VIS_ONLY iterator
{
    typedef _Tp        value_type;
    typedef _Distance  difference_type;
    typedef _Pointer   pointer;
    typedef _Reference reference;
    typedef _Category  iterator_category;
};

template <class _InputIter>
inline _LIBCPP_INLINE_VISIBILITY
void __advance(_InputIter& __i,
             typename iterator_traits<_InputIter>::difference_type __n, input_iterator_tag)
{
    for (; __n > 0; --__n)
        ++__i;
}





template <class _InputIter>
inline _LIBCPP_INLINE_VISIBILITY
void advance(_InputIter& __i,
             typename iterator_traits<_InputIter>::difference_type __n)
{
    __advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
}

template <class _InputIter>
inline _LIBCPP_INLINE_VISIBILITY
typename iterator_traits<_InputIter>::difference_type
__distance(_InputIter __first, _InputIter __last, input_iterator_tag)
{
    typename iterator_traits<_InputIter>::difference_type __r(0);
    for (; __first != __last; ++__first)
        ++__r;
    return __r;
}

template <class _RandIter>
inline _LIBCPP_INLINE_VISIBILITY
typename iterator_traits<_RandIter>::difference_type
__distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)
{
    return __last - __first;
}

template <class _InputIter>
inline _LIBCPP_INLINE_VISIBILITY
typename iterator_traits<_InputIter>::difference_type
distance(_InputIter __first, _InputIter __last)
{
    return __distance(__first, __last, typename iterator_traits<_InputIter>::iterator_category());
}

template <class _ForwardIter>
inline _LIBCPP_INLINE_VISIBILITY
_ForwardIter
next(_ForwardIter __x,
     typename iterator_traits<_ForwardIter>::difference_type __n = 1,
     typename enable_if<__is_forward_iterator<_ForwardIter>::value>::type* = 0)
{
    _VSTD::advance(__x, __n);
    return __x;
}

template <class _BidiretionalIter>
inline _LIBCPP_INLINE_VISIBILITY
_BidiretionalIter
prev(_BidiretionalIter __x,
     typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,
     typename enable_if<__is_bidirectional_iterator<_BidiretionalIter>::value>::type* = 0)
{
    _VSTD::advance(__x, -__n);
    return __x;
}

template <class _Iter>
class _LIBCPP_TYPE_VIS_ONLY reverse_iterator
    : public iterator<typename iterator_traits<_Iter>::iterator_category,
                      typename iterator_traits<_Iter>::value_type,
                      typename iterator_traits<_Iter>::difference_type,
                      typename iterator_traits<_Iter>::pointer,
                      typename iterator_traits<_Iter>::reference>
{
private:
    mutable _Iter __t;
protected:
    _Iter current;
public:
    typedef _Iter                                            iterator_type;
    typedef typename iterator_traits<_Iter>::difference_type difference_type;
    typedef typename iterator_traits<_Iter>::reference       reference;
    typedef typename iterator_traits<_Iter>::pointer         pointer;

    _LIBCPP_INLINE_VISIBILITY reverse_iterator() : current() {}
    _LIBCPP_INLINE_VISIBILITY explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
    template <class _Up> _LIBCPP_INLINE_VISIBILITY reverse_iterator(const reverse_iterator<_Up>& __u)
        : __t(__u.base()), current(__u.base()) {}
    _LIBCPP_INLINE_VISIBILITY _Iter base() const {return current;}
    _LIBCPP_INLINE_VISIBILITY reference operator*() const {__t = current; return *--__t;}
    _LIBCPP_INLINE_VISIBILITY pointer  operator->() const {return &(operator*());}
    _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator++() {--current; return *this;}
    _LIBCPP_INLINE_VISIBILITY reverse_iterator  operator++(int)
        {reverse_iterator __tmp(*this); --current; return __tmp;}
    _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator--() {++current; return *this;}
    _LIBCPP_INLINE_VISIBILITY reverse_iterator  operator--(int)
        {reverse_iterator __tmp(*this); ++current; return __tmp;}
    _LIBCPP_INLINE_VISIBILITY reverse_iterator  operator+ (difference_type __n) const
        {return reverse_iterator(current - __n);}
    _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator+=(difference_type __n)
        {current -= __n; return *this;}
    _LIBCPP_INLINE_VISIBILITY reverse_iterator  operator- (difference_type __n) const
        {return reverse_iterator(current + __n);}
    _LIBCPP_INLINE_VISIBILITY reverse_iterator& operator-=(difference_type __n)
        {current += __n; return *this;}
    _LIBCPP_INLINE_VISIBILITY reference         operator[](difference_type __n) const
        {return current[-__n-1];}
};













template <class _Container>
class _LIBCPP_TYPE_VIS_ONLY back_insert_iterator
    : public iterator<output_iterator_tag,
                      void,
                      void,
                      void,
                      back_insert_iterator<_Container>&>
{
protected:
    _Container* container;
public:
    typedef _Container container_type;

    _LIBCPP_INLINE_VISIBILITY explicit back_insert_iterator(_Container& __x) : container(&__x) {}
    _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(const typename _Container::value_type& __value_)
        {container->push_back(__value_); return *this;}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value_)
        {container->push_back(_VSTD::move(__value_)); return *this;}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 655 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator*()     {return *this;}
    _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++()    {return *this;}
    _LIBCPP_INLINE_VISIBILITY back_insert_iterator  operator++(int) {return *this;}
};

template <class _Container>
inline _LIBCPP_INLINE_VISIBILITY
back_insert_iterator<_Container>
back_inserter(_Container& __x)
{
    return back_insert_iterator<_Container>(__x);
}

template <class _Container>
class _LIBCPP_TYPE_VIS_ONLY front_insert_iterator
    : public iterator<output_iterator_tag,
                      void,
                      void,
                      void,
                      front_insert_iterator<_Container>&>
{
protected:
    _Container* container;
public:
    typedef _Container container_type;

    _LIBCPP_INLINE_VISIBILITY explicit front_insert_iterator(_Container& __x) : container(&__x) {}
    _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(const typename _Container::value_type& __value_)
        {container->push_front(__value_); return *this;}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::value_type&& __value_)
        {container->push_front(_VSTD::move(__value_)); return *this;}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 688 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator*()     {return *this;}
    _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator++()    {return *this;}
    _LIBCPP_INLINE_VISIBILITY front_insert_iterator  operator++(int) {return *this;}
};

template <class _Container>
inline _LIBCPP_INLINE_VISIBILITY
front_insert_iterator<_Container>
front_inserter(_Container& __x)
{
    return front_insert_iterator<_Container>(__x);
}

template <class _Container>
class _LIBCPP_TYPE_VIS_ONLY insert_iterator
    : public iterator<output_iterator_tag,
                      void,
                      void,
                      void,
                      insert_iterator<_Container>&>
{
protected:
    _Container* container;
    typename _Container::iterator iter;
public:
    typedef _Container container_type;

    _LIBCPP_INLINE_VISIBILITY insert_iterator(_Container& __x, typename _Container::iterator __i)
        : container(&__x), iter(__i) {}
    _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(const typename _Container::value_type& __value_)
        {iter = container->insert(iter, __value_); ++iter; return *this;}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::value_type&& __value_)
        {iter = container->insert(iter, _VSTD::move(__value_)); ++iter; return *this;}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 723 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    _LIBCPP_INLINE_VISIBILITY insert_iterator& operator*()        {return *this;}
    _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++()       {return *this;}
    _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++(int)    {return *this;}
};

template <class _Container>
inline _LIBCPP_INLINE_VISIBILITY
insert_iterator<_Container>
inserter(_Container& __x, typename _Container::iterator __i)
{
    return insert_iterator<_Container>(__x, __i);
}

template <class _Tp, class _CharT = char,
          class _Traits = char_traits<_CharT>, class _Distance = ptrdiff_t>
class _LIBCPP_TYPE_VIS_ONLY istream_iterator
    : public iterator<input_iterator_tag, _Tp, _Distance, const _Tp*, const _Tp&>
{
public:
    typedef _CharT char_type;
    typedef _Traits traits_type;
    typedef basic_istream<_CharT,_Traits> istream_type;
private:
    istream_type* __in_stream_;
    _Tp __value_;
public:
    _LIBCPP_INLINE_VISIBILITY istream_iterator() : __in_stream_(0) {}
    _LIBCPP_INLINE_VISIBILITY istream_iterator(istream_type& __s) : __in_stream_(&__s)
        {
            if (!(*__in_stream_ >> __value_))
                __in_stream_ = 0;
        }

    _LIBCPP_INLINE_VISIBILITY const _Tp& operator*() const {return __value_;}
    _LIBCPP_INLINE_VISIBILITY const _Tp* operator->() const {return &(operator*());}
    _LIBCPP_INLINE_VISIBILITY istream_iterator& operator++()
        {
            if (!(*__in_stream_ >> __value_))
                __in_stream_ = 0;
            return *this;
        }
    _LIBCPP_INLINE_VISIBILITY istream_iterator  operator++(int)
        {istream_iterator __t(*this); ++(*this); return __t;}

    friend _LIBCPP_INLINE_VISIBILITY
    bool operator==(const istream_iterator& __x, const istream_iterator& __y)
        {return __x.__in_stream_ == __y.__in_stream_;}

    friend _LIBCPP_INLINE_VISIBILITY
    bool operator!=(const istream_iterator& __x, const istream_iterator& __y)
        {return !(__x == __y);}
};

template <class _Tp, class _CharT = char, class _Traits = char_traits<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY ostream_iterator
    : public iterator<output_iterator_tag, void, void, void, void>
{
public:
    typedef _CharT char_type;
    typedef _Traits traits_type;
    typedef basic_ostream<_CharT,_Traits> ostream_type;
private:
    ostream_type* __out_stream_;
    const char_type* __delim_;
public:
    _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s)
        : __out_stream_(&__s), __delim_(0) {}
    _LIBCPP_INLINE_VISIBILITY ostream_iterator(ostream_type& __s, const _CharT* __delimiter)
        : __out_stream_(&__s), __delim_(__delimiter) {}
    _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator=(const _Tp& __value_)
        {
            *__out_stream_ << __value_;
            if (__delim_)
                *__out_stream_ << __delim_;
            return *this;
        }

    _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator*()     {return *this;}
    _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++()    {return *this;}
    _LIBCPP_INLINE_VISIBILITY ostream_iterator& operator++(int) {return *this;}
};

template<class _CharT, class _Traits>
class _LIBCPP_TYPE_VIS_ONLY istreambuf_iterator
    : public iterator<input_iterator_tag, _CharT,
                      typename _Traits::off_type, _CharT*,
                      _CharT>
{
public:
    typedef _CharT                          char_type;
    typedef _Traits                         traits_type;
    typedef typename _Traits::int_type      int_type;
    typedef basic_streambuf<_CharT,_Traits> streambuf_type;
    typedef basic_istream<_CharT,_Traits>   istream_type;
private:
    mutable streambuf_type* __sbuf_;

    class __proxy
    {
        char_type __keep_;
        streambuf_type* __sbuf_;
        _LIBCPP_INLINE_VISIBILITY __proxy(char_type __c, streambuf_type* __s)
            : __keep_(__c), __sbuf_(__s) {}
        friend class istreambuf_iterator;
    public:
        _LIBCPP_INLINE_VISIBILITY char_type operator*() const {return __keep_;}
    };

    _LIBCPP_INLINE_VISIBILITY
    bool __test_for_eof() const
    {
        if (__sbuf_ && traits_type::eq_int_type(__sbuf_->sgetc(), traits_type::eof()))
            __sbuf_ = 0;
        return __sbuf_ == 0;
    }
public:
    _LIBCPP_INLINE_VISIBILITY __proxy              operator++(int)
        {
            return __proxy(__sbuf_->sbumpc(), __sbuf_);
        }

    _LIBCPP_INLINE_VISIBILITY bool equal(const istreambuf_iterator& __b) const
        {return __test_for_eof() == __b.__test_for_eof();}
};

template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
bool operator==(const istreambuf_iterator<_CharT,_Traits>& __a,
                const istreambuf_iterator<_CharT,_Traits>& __b)
                {return __a.equal(__b);}

template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
bool operator!=(const istreambuf_iterator<_CharT,_Traits>& __a,
                const istreambuf_iterator<_CharT,_Traits>& __b)
                {return !__a.equal(__b);}

template <class _CharT, class _Traits>
class _LIBCPP_TYPE_VIS_ONLY ostreambuf_iterator
    : public iterator<output_iterator_tag, void, void, void, void>
{
public:
    typedef _CharT                          char_type;
    typedef _Traits                         traits_type;
    typedef basic_streambuf<_CharT,_Traits> streambuf_type;
    typedef basic_ostream<_CharT,_Traits>   ostream_type;
private:
    streambuf_type* __sbuf_;
#if !defined(__APPLE__) || \
    (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \
    (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0)

    template <class _Ch, class _Tr>
    friend
    _LIBCPP_HIDDEN
    ostreambuf_iterator<_Ch, _Tr>
    __pad_and_output(ostreambuf_iterator<_Ch, _Tr> __s,
                     const _Ch* __ob, const _Ch* __op, const _Ch* __oe,
                     ios_base& __iob, _Ch __fl);
#endif
# 915 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
};

template <class _Iter>
class _LIBCPP_TYPE_VIS_ONLY move_iterator
{
private:
    _Iter __i;
public:
    typedef _Iter                                            iterator_type;
    typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
    typedef typename iterator_traits<iterator_type>::value_type value_type;
    typedef typename iterator_traits<iterator_type>::difference_type difference_type;
    typedef typename iterator_traits<iterator_type>::pointer pointer;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    typedef value_type&& reference;
#else
# 931 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    typedef typename iterator_traits<iterator_type>::reference reference;
#endif
# 933 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3

    _LIBCPP_INLINE_VISIBILITY move_iterator() : __i() {}
    _LIBCPP_INLINE_VISIBILITY explicit move_iterator(_Iter __x) : __i(__x) {}
    template <class _Up> _LIBCPP_INLINE_VISIBILITY move_iterator(const move_iterator<_Up>& __u)
        : __i(__u.base()) {}
    _LIBCPP_INLINE_VISIBILITY _Iter base() const {return __i;}
    _LIBCPP_INLINE_VISIBILITY reference operator*() const {
      return static_cast<reference>(*__i);
    }
    _LIBCPP_INLINE_VISIBILITY pointer  operator->() const {
      typename iterator_traits<iterator_type>::reference __ref = *__i;
      return &__ref;
    }
    _LIBCPP_INLINE_VISIBILITY move_iterator& operator++() {++__i; return *this;}
    _LIBCPP_INLINE_VISIBILITY move_iterator  operator++(int)
        {move_iterator __tmp(*this); ++__i; return __tmp;}
    _LIBCPP_INLINE_VISIBILITY move_iterator& operator--() {--__i; return *this;}
    _LIBCPP_INLINE_VISIBILITY move_iterator  operator--(int)
        {move_iterator __tmp(*this); --__i; return __tmp;}
    _LIBCPP_INLINE_VISIBILITY move_iterator  operator+ (difference_type __n) const
        {return move_iterator(__i + __n);}
    _LIBCPP_INLINE_VISIBILITY move_iterator& operator+=(difference_type __n)
        {__i += __n; return *this;}
    _LIBCPP_INLINE_VISIBILITY move_iterator  operator- (difference_type __n) const
        {return move_iterator(__i - __n);}
    _LIBCPP_INLINE_VISIBILITY move_iterator& operator-=(difference_type __n)
        {__i -= __n; return *this;}
    _LIBCPP_INLINE_VISIBILITY reference         operator[](difference_type __n) const
    {
      return static_cast<reference>(__i[__n]);
    }
};



















// __wrap_iter

template <class _Iter> class __wrap_iter;

template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;

template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;

template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
operator!=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;

template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
operator>(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;

template <class _Iter1, class _Iter2>
_LIBCPP_INLINE_VISIBILITY
bool
operator>=(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY copy(_Ip, _Ip, _Op);
template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY copy_backward(_B1, _B1, _B2);
template <class _Ip, class _Op> _Op _LIBCPP_INLINE_VISIBILITY move(_Ip, _Ip, _Op);
template <class _B1, class _B2> _B2 _LIBCPP_INLINE_VISIBILITY move_backward(_B1, _B1, _B2);

template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_trivially_copy_assignable<_Tp>::value,
    _Tp*
>::type
__unwrap_iter(__wrap_iter<_Tp*>);

template <class _Iter>
class __wrap_iter
{
public:
    typedef _Iter                                                      iterator_type;
    typedef typename iterator_traits<iterator_type>::iterator_category iterator_category;
    typedef typename iterator_traits<iterator_type>::value_type        value_type;
    typedef typename iterator_traits<iterator_type>::difference_type   difference_type;
    typedef typename iterator_traits<iterator_type>::pointer           pointer;
    typedef typename iterator_traits<iterator_type>::reference         reference;
private:
    iterator_type __i;
public:
    _LIBCPP_INLINE_VISIBILITY __wrap_iter() _NOEXCEPT
#if _LIBCPP_STD_VER > 11
                : __i{}
#endif
# 1113 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__insert_i(this);
#endif
# 1117 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    }
    template <class _Up> _LIBCPP_INLINE_VISIBILITY __wrap_iter(const __wrap_iter<_Up>& __u,
        typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = 0) _NOEXCEPT
        : __i(__u.base())
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__iterator_copy(this, &__u);
#endif
# 1125 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    }
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_INLINE_VISIBILITY
    ~__wrap_iter()
    {
        __get_db()->__erase_i(this);
    }
#endif
# 1149 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to dereference a non-dereferenceable iterator");
#endif
# 1155 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
        return *__i;
    }
    _LIBCPP_INLINE_VISIBILITY pointer  operator->() const _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to dereference a non-dereferenceable iterator");
#endif
# 1163 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
        return (pointer)&reinterpret_cast<const volatile char&>(*__i);
    }
    _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator++() _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to increment non-incrementable iterator");
#endif
# 1171 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
        ++__i;
        return *this;
    }
    _LIBCPP_INLINE_VISIBILITY __wrap_iter  operator++(int) _NOEXCEPT
        {__wrap_iter __tmp(*this); ++(*this); return __tmp;}
    _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator--() _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__decrementable(this),
                       "Attempted to decrement non-decrementable iterator");
#endif
# 1182 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
        --__i;
        return *this;
    }
    _LIBCPP_INLINE_VISIBILITY __wrap_iter  operator--(int) _NOEXCEPT
        {__wrap_iter __tmp(*this); --(*this); return __tmp;}
    _LIBCPP_INLINE_VISIBILITY __wrap_iter  operator+ (difference_type __n) const _NOEXCEPT
        {__wrap_iter __w(*this); __w += __n; return __w;}
    _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator+=(difference_type __n) _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__addable(this, __n),
                   "Attempted to add/subtract iterator outside of valid range");
#endif
# 1195 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
        __i += __n;
        return *this;
    }
    _LIBCPP_INLINE_VISIBILITY __wrap_iter  operator- (difference_type __n) const _NOEXCEPT
        {return *this + (-__n);}
    _LIBCPP_INLINE_VISIBILITY __wrap_iter& operator-=(difference_type __n) _NOEXCEPT
        {*this += -__n; return *this;}
    _LIBCPP_INLINE_VISIBILITY reference        operator[](difference_type __n) const _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__subscriptable(this, __n),
                   "Attempted to subscript iterator outside of valid range");
#endif
# 1208 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
        return __i[__n];
    }

    _LIBCPP_INLINE_VISIBILITY iterator_type base() const _NOEXCEPT {return __i;}

private:
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_INLINE_VISIBILITY __wrap_iter(const void* __p, iterator_type __x) : __i(__x)
    {
        __get_db()->__insert_ic(this, __p);
    }
#else
# 1220 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    _LIBCPP_INLINE_VISIBILITY __wrap_iter(iterator_type __x) _NOEXCEPT : __i(__x) {}
#endif
# 1222 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3

    template <class _Up> friend class __wrap_iter;
    template <class _CharT, class _Traits, class _Alloc> friend class basic_string;
    template <class _Tp, class _Alloc> friend class vector;

    template <class _Iter1, class _Iter2>
    friend
    bool
    operator==(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;

    template <class _Iter1, class _Iter2>
    friend
    bool
    operator<(const __wrap_iter<_Iter1>&, const __wrap_iter<_Iter2>&) _NOEXCEPT;
    ;
    ;
    ;
    ;

    ;
};

template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator==(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
{
    return __x.base() == __y.base();
}

template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator<(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
                   "Attempted to compare incomparable iterators");
#endif
# 1299 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    return __x.base() < __y.base();
}

template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
inline _LIBCPP_INLINE_VISIBILITY
bool
operator!=(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter1>& __y) _NOEXCEPT
{
    return !(__x == __y);
}







template <class _Iter1, class _Iter2>
inline _LIBCPP_INLINE_VISIBILITY
typename __wrap_iter<_Iter1>::difference_type
operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__less_than_comparable(&__x, &__y),
                   "Attempted to subtract incompatible iterators");
#endif
# 1375 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3
    return __x.base() - __y.base();
}

template <class _Iter>
inline _LIBCPP_INLINE_VISIBILITY
__wrap_iter<_Iter>
operator+(typename __wrap_iter<_Iter>::difference_type __n,
          __wrap_iter<_Iter> __x) _NOEXCEPT
{
    __x += __n;
    return __x;
}





#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)

template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY
auto
end(_Cp& __c) -> decltype(__c.end())
{
    return __c.end();
}

template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY
auto
end(const _Cp& __c) -> decltype(__c.end())
{
    return __c.end();
}

#if _LIBCPP_STD_VER > 11
inline _LIBCPP_INLINE_VISIBILITY
reverse_iterator<const _Ep*> rbegin(initializer_list<_Ep> __il)
auto crend(const _Cp& __c) -> decltype(rend(__c))
{
    return rend(__c);
}

#endif
# 1525 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3


#else  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
# 1528 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3







template <class _Cp>
inline _LIBCPP_INLINE_VISIBILITY
typename _Cp::const_iterator
end(const _Cp& __c)
{
    return __c.end();
}

#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_TRAILING_RETURN)
# 1562 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iterator" 3

_LIBCPP_END_NAMESPACE_STD

# 17 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3
#if 0 /* expanded by -frewrite-includes */
#include <exception>
#endif /* expanded by -frewrite-includes */
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3
#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
# 19 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 22 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3
#endif
# 23 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Arg, class _Result>
struct _LIBCPP_TYPE_VIS_ONLY unary_function
{
    typedef _Arg    argument_type;
    typedef _Result result_type;
};

template <class _Arg1, class _Arg2, class _Result>
struct _LIBCPP_TYPE_VIS_ONLY binary_function
{
    typedef _Arg1   first_argument_type;
    typedef _Arg2   second_argument_type;
    typedef _Result result_type;
};

template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash;

template <class _Tp>
struct __has_result_type
{
private:
    struct __two {char __lx; char __lxx;};
    template <class _Up> static __two __test(...);
    template <class _Up> static char __test(typename _Up::result_type* = 0);
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
#else
# 57 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3
template <class _Tp>
#endif
# 59 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3
struct _LIBCPP_TYPE_VIS_ONLY less : binary_function<_Tp, _Tp, bool>
{
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY 
    bool operator()(const _Tp& __x, const _Tp& __y) const
        {return __x < __y;}
};

#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY less<void>
{
    template <class _T1, class _T2> 
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 77 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

// addressof

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp*
addressof(_Tp& __x) _NOEXCEPT
{
    return (_Tp*)&reinterpret_cast<const volatile char&>(__x);
}

#if defined(_LIBCPP_HAS_OBJC_ARC) && !defined(_LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF)
// Objective-C++ Automatic Reference Counting uses qualified pointers
// that require special addressof() signatures. When
// _LIBCPP_PREDEFINED_OBJC_ARC_ADDRESSOF is defined, the compiler
// itself is providing these definitions. Otherwise, we provide them.
template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
__strong _Tp*
#endif
# 127 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

#ifdef _LIBCPP_HAS_NO_VARIADICS

#if 0 /* expanded by -frewrite-includes */
#include <__functional_base_03>
#endif /* expanded by -frewrite-includes */
# 131 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

#else  // _LIBCPP_HAS_NO_VARIADICS
# 133 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

// __weak_result_type

template <class _Tp>
struct __derives_from_unary_function
{
private:
    struct __two {char __lx; char __lxx;};
    static __two __test(...);
    template <class _Ap, class _Rp>
        static unary_function<_Ap, _Rp>
        __test(const volatile unary_function<_Ap, _Rp>*);
public:
    static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
    typedef decltype(__test((_Tp*)0)) type;
};

template <class _Tp>
struct __derives_from_binary_function
{
private:
    struct __two {char __lx; char __lxx;};
    static __two __test(...);
    template <class _A1, class _A2, class _Rp>
        static binary_function<_A1, _A2, _Rp>
        __test(const volatile binary_function<_A1, _A2, _Rp>*);
public:
    static const bool value = !is_same<decltype(__test((_Tp*)0)), __two>::value;
    typedef decltype(__test((_Tp*)0)) type;
};

template <class _Tp, bool = __derives_from_unary_function<_Tp>::value>
struct __maybe_derive_from_unary_function  // bool is true
    : public __derives_from_unary_function<_Tp>::type
{
};

template <class _Tp>
struct __maybe_derive_from_unary_function<_Tp, false>
{
};

template <class _Tp, bool = __derives_from_binary_function<_Tp>::value>
struct __maybe_derive_from_binary_function  // bool is true
    : public __derives_from_binary_function<_Tp>::type
{
};

template <class _Tp>
struct __maybe_derive_from_binary_function<_Tp, false>
{
};

template <class _Tp, bool = __has_result_type<_Tp>::value>
struct __weak_result_type_imp // bool is true
    : public __maybe_derive_from_unary_function<_Tp>,
      public __maybe_derive_from_binary_function<_Tp>
{
    typedef typename _Tp::result_type result_type;
};

template <class _Tp>
struct __weak_result_type_imp<_Tp, false>
    : public __maybe_derive_from_unary_function<_Tp>,
      public __maybe_derive_from_binary_function<_Tp>
{
};

template <class _Tp>
struct __weak_result_type
    : public __weak_result_type_imp<_Tp>
{
};

// 0 argument case

template <class _Rp>
struct __weak_result_type<_Rp ()>
{
    typedef _Rp result_type;
};

template <class _Rp>
struct __weak_result_type<_Rp (&)()>
{
    typedef _Rp result_type;
};

template <class _Rp>
struct __weak_result_type<_Rp (*)()>
{
    typedef _Rp result_type;
};

// 1 argument case

template <class _Rp, class _A1>
struct __weak_result_type<_Rp (_A1)>
    : public unary_function<_A1, _Rp>
{
};

template <class _Rp, class _A1>
struct __weak_result_type<_Rp (&)(_A1)>
    : public unary_function<_A1, _Rp>
{
};

template <class _Rp, class _A1>
struct __weak_result_type<_Rp (*)(_A1)>
    : public unary_function<_A1, _Rp>
{
};

template <class _Rp, class _Cp>
struct __weak_result_type<_Rp (_Cp::*)()>
    : public unary_function<_Cp*, _Rp>
{
};

template <class _Rp, class _Cp>
struct __weak_result_type<_Rp (_Cp::*)() const>
    : public unary_function<const _Cp*, _Rp>
{
};

template <class _Rp, class _Cp>
struct __weak_result_type<_Rp (_Cp::*)() volatile>
    : public unary_function<volatile _Cp*, _Rp>
{
};

template <class _Rp, class _Cp>
struct __weak_result_type<_Rp (_Cp::*)() const volatile>
    : public unary_function<const volatile _Cp*, _Rp>
{
};

// 2 argument case

template <class _Rp, class _A1, class _A2>
struct __weak_result_type<_Rp (_A1, _A2)>
    : public binary_function<_A1, _A2, _Rp>
{
};

template <class _Rp, class _A1, class _A2>
struct __weak_result_type<_Rp (*)(_A1, _A2)>
    : public binary_function<_A1, _A2, _Rp>
{
};

template <class _Rp, class _A1, class _A2>
struct __weak_result_type<_Rp (&)(_A1, _A2)>
    : public binary_function<_A1, _A2, _Rp>
{
};

template <class _Rp, class _Cp, class _A1>
struct __weak_result_type<_Rp (_Cp::*)(_A1)>
    : public binary_function<_Cp*, _A1, _Rp>
{
};

template <class _Rp, class _Cp, class _A1>
struct __weak_result_type<_Rp (_Cp::*)(_A1) const>
    : public binary_function<const _Cp*, _A1, _Rp>
{
};

template <class _Rp, class _Cp, class _A1>
struct __weak_result_type<_Rp (_Cp::*)(_A1) volatile>
    : public binary_function<volatile _Cp*, _A1, _Rp>
{
    typedef _Rp result_type;
};

template <class _Rp, class _Cp, class _A1, class _A2, class ..._A3>
struct __weak_result_type<_Rp (_Cp::*)(_A1, _A2, _A3...) const>
{
    typedef _Rp result_type;
};

template <class _Fp, class _A0, class ..._Args,
            class>
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
    -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...))
{
    return (_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...);
}

template <class _Fp, class _A0, class ..._Args,
            class>
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
    -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...))
{
    return ((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...);
}

// bullets 3 and 4

template <class _Fp, class _A0,
            class>
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0)
    -> decltype(_VSTD::forward<_A0>(__a0).*__f)
{
    return _VSTD::forward<_A0>(__a0).*__f;
}

template <class _Fp, class _A0,
            class>
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0)
    -> decltype((*_VSTD::forward<_A0>(__a0)).*__f)
{
    return (*_VSTD::forward<_A0>(__a0)).*__f;
}

// bullet 5

template <class _Fp, class ..._Args>
inline _LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _Args&& ...__args)
    -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...))
{
    return _VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...);
}

template <class _Tp, class ..._Args>
struct __invoke_return
{
    typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type;
};

template <class _Tp>
class _LIBCPP_TYPE_VIS_ONLY reference_wrapper
    : public __weak_result_type<_Tp>
{
public:
    // types
    typedef _Tp type;
private:
    type* __f_;

public:
    // construct/copy/destroy
    _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT
        : __f_(_VSTD::addressof(__f)) {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    private: reference_wrapper(type&&); public: // = delete; // do not bind to temps
#endif
# 439 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

    // access
    _LIBCPP_INLINE_VISIBILITY operator type&    () const _NOEXCEPT {return *__f_;}
    _LIBCPP_INLINE_VISIBILITY          type& get() const _NOEXCEPT {return *__f_;}

    // invoke
    template <class... _ArgTypes>
       _LIBCPP_INLINE_VISIBILITY
       typename __invoke_of<type&, _ArgTypes...>::type
          operator() (_ArgTypes&&... __args) const
          {
              return __invoke(get(), _VSTD::forward<_ArgTypes>(__args)...);
          }
};

template <class _Tp> struct __is_reference_wrapper_impl : public false_type {};
template <class _Tp> struct __is_reference_wrapper_impl<reference_wrapper<_Tp> > : public true_type {};
template <class _Tp> struct __is_reference_wrapper
    : public __is_reference_wrapper_impl<typename remove_cv<_Tp>::type> {};

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
reference_wrapper<_Tp>
ref(_Tp& __t) _NOEXCEPT
{
    return reference_wrapper<_Tp>(__t);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
reference_wrapper<_Tp>
ref(reference_wrapper<_Tp> __t) _NOEXCEPT
{
    return ref(__t.get());
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS

template <class _Tp> void ref(const _Tp&&) = delete;
template <class _Tp> void cref(const _Tp&&) = delete;

#else  // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
# 498 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

template <class _Tp> void ref(const _Tp&&);// = delete;
template <class _Tp> void cref(const _Tp&&);// = delete;

#endif  // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
# 503 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 505 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 507 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

#if _LIBCPP_STD_VER > 11
template <class _Tp1, class _Tp2 = void>
struct __is_transparent
{
private:
    struct __two {char __lx; char __lxx;};
    template <class _Up> static __two __test(...);
    template <class _Up> static char __test(typename _Up::is_transparent* = 0);
public:
    static const bool value = sizeof(__test<_Tp1>(0)) == 1;
};
#endif
# 520 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

// allocator_arg_t

struct _LIBCPP_TYPE_VIS_ONLY allocator_arg_t { };

#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY)
extern const allocator_arg_t allocator_arg;
#else
# 528 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3
constexpr allocator_arg_t allocator_arg = allocator_arg_t();
#endif
# 530 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

// uses_allocator

template <class _Tp>
struct __has_allocator_type
{
private:
    struct __two {char __lx; char __lxx;};
    template <class _Up> static __two __test(...);
    template <class _Up> static char __test(typename _Up::allocator_type* = 0);
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Tp, class _Alloc, bool = __has_allocator_type<_Tp>::value>
struct __uses_allocator
    : public integral_constant<bool,
        is_convertible<_Alloc, typename _Tp::allocator_type>::value>
{
};

template <class _Tp, class _Alloc>
struct __uses_allocator<_Tp, _Alloc, false>
    : public false_type
{
};

template <class _Tp, class _Alloc>
struct _LIBCPP_TYPE_VIS_ONLY uses_allocator
    : public __uses_allocator<_Tp, _Alloc>
{
};

#ifndef _LIBCPP_HAS_NO_VARIADICS

// allocator construction

template <class _Tp, class _Alloc, class ..._Args>
struct __uses_alloc_ctor_imp
{
    static const bool __ua = uses_allocator<_Tp, _Alloc>::value;
    static const bool __ic =
        is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
    static const int value = __ua ? 2 - __ic : 0;
};

template <class _Tp, class _Alloc, class ..._Args>
struct __uses_alloc_ctor
    : integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value>
    {};

template <class _Tp, class _Allocator, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void __user_alloc_construct_impl (integral_constant<int, 0>, _Tp *__storage, const _Allocator &, _Args &&... __args )
{
    new (__storage) _Tp (_VSTD::forward<_Args>(__args)...);
}

template <class _Tp, class _Allocator, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void __user_alloc_construct_impl (integral_constant<int, 1>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
{
    new (__storage) _Tp (allocator_arg, __a, _VSTD::forward<_Args>(__args)...);
}

template <class _Tp, class _Allocator, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void __user_alloc_construct_impl (integral_constant<int, 2>, _Tp *__storage, const _Allocator &__a, _Args &&... __args )
{
    new (__storage) _Tp (_VSTD::forward<_Args>(__args)..., __a);
}

template <class _Tp, class _Allocator, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void __user_alloc_construct (_Tp *__storage, const _Allocator &__a, _Args &&... __args)
{ 
    __user_alloc_construct_impl( 
             __uses_alloc_ctor<_Tp, _Allocator>(), 
             __storage, __a, _VSTD::forward<_Args>(__args)...
        );
}
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 612 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_FUNCTIONAL_BASE
# 616 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__functional_base" 3
# 602 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <iosfwd>
#endif /* expanded by -frewrite-includes */
# 603 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
#if 0 /* expanded by -frewrite-includes */
#include <tuple>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple" 1 3
// -*- C++ -*-
//===--------------------------- tuple ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_TUPLE
#define _LIBCPP_TUPLE

/*
    tuple synopsis
#include <__functional_base>
#endif /* expanded by -frewrite-includes */
# 128 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple" 3
#if 0 /* expanded by -frewrite-includes */
#include <utility>
#endif /* expanded by -frewrite-includes */
# 129 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 132 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple" 3
#endif
# 133 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple" 3

_LIBCPP_BEGIN_NAMESPACE_STD

#ifndef _LIBCPP_HAS_NO_VARIADICS

// tuple_size

template <class ..._Tp>
class _LIBCPP_TYPE_VIS_ONLY tuple_size<tuple<_Tp...> >
    : public integral_constant<size_t, sizeof...(_Tp)>
{
};

// tuple_element

template <size_t _Ip, class ..._Tp>
class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, tuple<_Tp...> >
{
public:
    typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
};

// __tuple_leaf

template <size_t _Ip, class _Hp, bool=is_empty<_Hp>::value
#if __has_feature(is_final)
                                 && !__is_final(_Hp)
#endif
# 161 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple" 3
         >
class __tuple_leaf;

template <size_t _Ip, class _Hp, bool _Ep>
inline _LIBCPP_INLINE_VISIBILITY
void swap(__tuple_leaf<_Ip, _Hp, _Ep>& __x, __tuple_leaf<_Ip, _Hp, _Ep>& __y)
    _NOEXCEPT_(__is_nothrow_swappable<_Hp>::value)
{
    swap(__x.get(), __y.get());
}

template <size_t _Ip, class _Hp, bool>
class __tuple_leaf
{
    _Hp value;

    __tuple_leaf& operator=(const __tuple_leaf&);
public:
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
             _NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) : value()
       {static_assert(!is_reference<_Hp>::value,
              "Attempted to default construct a reference element in a tuple");}

    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        __tuple_leaf(integral_constant<int, 0>, const _Alloc&)
            : value()
        {static_assert(!is_reference<_Hp>::value,
              "Attempted to default construct a reference element in a tuple");}

    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a)
            : value(allocator_arg_t(), __a)
        {static_assert(!is_reference<_Hp>::value,
              "Attempted to default construct a reference element in a tuple");}

    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a)
            : value(__a)
        {static_assert(!is_reference<_Hp>::value,
              "Attempted to default construct a reference element in a tuple");}

    template <class _Tp,
              class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
        explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
            : value(_VSTD::forward<_Tp>(__t))
        {static_assert(!is_reference<_Hp>::value ||
                       (is_lvalue_reference<_Hp>::value &&
                        (is_lvalue_reference<_Tp>::value ||
                         is_same<typename remove_reference<_Tp>::type,
                                 reference_wrapper<
                                    typename remove_reference<_Hp>::type
                                 >
                                >::value)),
       "Attempted to construct a reference element in a tuple with an rvalue");}

    template <class _Tp, class _Alloc>
        _LIBCPP_INLINE_VISIBILITY

    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_CONSTEXPR_AFTER_CXX11
    __tuple_leaf(__tuple_leaf&& __t) _NOEXCEPT_(is_nothrow_move_constructible<_Hp>::value)
        : value(_VSTD::forward<_Hp>(__t.get()))
        {}

    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11       _Hp& get()       _NOEXCEPT {return value;}
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Hp& get() const _NOEXCEPT {return value;}
};

template <size_t _Ip, class _Hp>
class __tuple_leaf<_Ip, _Hp, true>
    : private _Hp
{
    template <class _Tp, class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
            : _Hp(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t)) {}

    template <class _Tp, class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
            : _Hp(_VSTD::forward<_Tp>(__t), __a) {}

    template <class _Tp>
        _LIBCPP_INLINE_VISIBILITY
        __tuple_leaf&
        operator=(_Tp&& __t) _NOEXCEPT_((is_nothrow_assignable<_Hp&, _Tp>::value))
        {
            _Hp::operator=(_VSTD::forward<_Tp>(__t));
            return *this;
        }

    _LIBCPP_INLINE_VISIBILITY
    int
    swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
    {
        _VSTD::swap(*this, __t);
        return 0;
    }

    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11       _Hp& get()       _NOEXCEPT {return static_cast<_Hp&>(*this);}
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Hp& get() const _NOEXCEPT {return static_cast<const _Hp&>(*this);}
};

template <class ..._Tp>
_LIBCPP_INLINE_VISIBILITY
void __swallow(_Tp&&...) _NOEXCEPT {}

template <bool ...> struct __all;

template <>
struct __all<>
{
    static const bool value = true;
};

template <bool _B0, bool ... _Bp>
struct __all<_B0, _Bp...>
{
    static const bool value = _B0 && __all<_Bp...>::value;
};

// __tuple_impl

template<class _Indx, class ..._Tp> struct __tuple_impl;

template<size_t ..._Indx, class ..._Tp>
struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
    : public __tuple_leaf<_Indx, _Tp>...
{
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_CONSTEXPR __tuple_impl()
        _NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}

    template <size_t ..._Uf, class ..._Tf,
              size_t ..._Ul, class ..._Tl, class ..._Up>
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
        explicit
        __tuple_impl(__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
                     __tuple_indices<_Ul...>, __tuple_types<_Tl...>,
                     _Up&&... __u)
                     _NOEXCEPT_((__all<is_nothrow_constructible<_Tf, _Up>::value...>::value &&
                                 __all<is_nothrow_default_constructible<_Tl>::value...>::value)) :
            __tuple_leaf<_Uf, _Tf>(_VSTD::forward<_Up>(__u))...,
            __tuple_leaf<_Ul, _Tl>()...
            {}

    template <class _Alloc, size_t ..._Uf, class ..._Tf,
              size_t ..._Ul, class ..._Tl, class ..._Up>
        _LIBCPP_INLINE_VISIBILITY
        explicit
        __tuple_impl(allocator_arg_t, const _Alloc& __a,
                     __tuple_indices<_Uf...>, __tuple_types<_Tf...>,
                     __tuple_indices<_Ul...>, __tuple_types<_Tl...>,
                     _Up&&... __u) :
            __tuple_leaf<_Uf, _Tf>(__uses_alloc_ctor<_Tf, _Alloc, _Up>(), __a,
            _VSTD::forward<_Up>(__u))...,
            __tuple_leaf<_Ul, _Tl>(__uses_alloc_ctor<_Tl, _Alloc>(), __a)...
            {}

    template <class _Tuple,
              class = typename enable_if
                      <
                         __tuple_constructible<_Tuple, tuple<_Tp...> >::value
                      >::type
             >
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
        __tuple_impl(_Tuple&& __t) _NOEXCEPT_((__all<is_nothrow_constructible<_Tp, typename tuple_element<_Indx,
                                       typename __make_tuple_types<_Tuple>::type>::type>::value...>::value))
            : __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
                                       typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
            {}

    template <class _Alloc, class _Tuple,
              class = typename enable_if
                      <
                         __tuple_convertible<_Tuple, tuple<_Tp...> >::value
                      >::type
             >
        _LIBCPP_INLINE_VISIBILITY
        __tuple_impl(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
            : __tuple_leaf<_Indx, _Tp>(__uses_alloc_ctor<_Tp, _Alloc, typename tuple_element<_Indx,
                                       typename __make_tuple_types<_Tuple>::type>::type>(), __a,
                                       _VSTD::forward<typename tuple_element<_Indx,
                                       typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...
            {}

    template <class _Tuple>
        _LIBCPP_INLINE_VISIBILITY
        typename enable_if
        <
            __tuple_assignable<_Tuple, tuple<_Tp...> >::value,
            __tuple_impl&
        >::type
        operator=(_Tuple&& __t) _NOEXCEPT_((__all<is_nothrow_assignable<_Tp&, typename tuple_element<_Indx,
                                       typename __make_tuple_types<_Tuple>::type>::type>::value...>::value))
        {
            __swallow(__tuple_leaf<_Indx, _Tp>::operator=(_VSTD::forward<typename tuple_element<_Indx,
                                       typename __make_tuple_types<_Tuple>::type>::type>(_VSTD::get<_Indx>(__t)))...);
            return *this;
        }

    __tuple_impl(const __tuple_impl&) = default;
    __tuple_impl(__tuple_impl&&) = default;

    _LIBCPP_INLINE_VISIBILITY
    __tuple_impl&
    operator=(const __tuple_impl& __t) _NOEXCEPT_((__all<is_nothrow_copy_assignable<_Tp>::value...>::value))
    {
        __swallow(__tuple_leaf<_Indx, _Tp>::swap(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t))...);
    }
};

template <class ..._Tp>
class _LIBCPP_TYPE_VIS_ONLY tuple
{
    typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> base;

    base base_;

    template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
        typename tuple_element<_Jp, tuple<_Up...> >::type& get(tuple<_Up...>&) _NOEXCEPT;
    template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
        const typename tuple_element<_Jp, tuple<_Up...> >::type& get(const tuple<_Up...>&) _NOEXCEPT;
    template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
        typename tuple_element<_Jp, tuple<_Up...> >::type&& get(tuple<_Up...>&&) _NOEXCEPT;
public:

    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_CONSTEXPR tuple()
        _NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}

    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    explicit tuple(const _Tp& ... __t) _NOEXCEPT_((__all<is_nothrow_copy_constructible<_Tp>::value...>::value)) 
        : base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
                typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
                typename __make_tuple_indices<0>::type(),
                typename __make_tuple_types<tuple, 0>::type(),
                __t...
               ) {}

    template <class _Alloc>
      _LIBCPP_INLINE_VISIBILITY
      tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
        : base_(allocator_arg_t(), __a,
                typename __make_tuple_indices<sizeof...(_Tp)>::type(),
                typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
                typename __make_tuple_indices<0>::type(),
                typename __make_tuple_types<tuple, 0>::type(),
                __t...
               ) {}

    template <class ..._Up,
              typename enable_if
                      <
                         sizeof...(_Up) <= sizeof...(_Tp) &&
                         __tuple_convertible
                         <
                            tuple<_Up...>,
                            typename __make_tuple_types<tuple,
                                     sizeof...(_Up) < sizeof...(_Tp) ?
                                        sizeof...(_Up) :
                                        sizeof...(_Tp)>::type
                         >::value,
                         bool
                      >::type = false
             >
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
        tuple(_Up&&... __u)
            _NOEXCEPT_((
                is_nothrow_constructible<
                    typename __make_tuple_indices<sizeof...(_Up)>::type,
                    typename __make_tuple_types<tuple, sizeof...(_Up)>::type,
                    typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type,
                    typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type,
                    _Up...
                >::value
            ))
            : base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
                    typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
                    typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
                    typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
                    _VSTD::forward<_Up>(__u)...) {}

    template <class ..._Up,
              typename enable_if
                      <
                         sizeof...(_Up) <= sizeof...(_Tp) &&
                         __tuple_constructible
                         <
                            tuple<_Up...>,
                            typename __make_tuple_types<tuple,
                                     sizeof...(_Up) < sizeof...(_Tp) ?
                                        sizeof...(_Up) :
                                        sizeof...(_Tp)>::type
                         >::value &&
                         !__tuple_convertible
                         <
                            tuple<_Up...>,
                            typename __make_tuple_types<tuple,
                                     sizeof...(_Up) < sizeof...(_Tp) ?
                                        sizeof...(_Up) :
                                        sizeof...(_Tp)>::type
                         >::value,
                         bool
                      >::type =false
             >
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
        explicit
        tuple(_Up&&... __u)
            _NOEXCEPT_((
                is_nothrow_constructible<
                    typename __make_tuple_indices<sizeof...(_Up)>::type,
                    typename __make_tuple_types<tuple, sizeof...(_Up)>::type,
                    typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type,
                    typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type,
                    _Up...
                >::value
            ))
            : base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
                    typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
                    typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
                    typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
                    _VSTD::forward<_Up>(__u)...) {}

    template <class _Alloc, class ..._Up,
              class = typename enable_if
                      <
                         sizeof...(_Up) <= sizeof...(_Tp) &&
                         __tuple_convertible
                         <
                            tuple<_Up...>,
                            typename __make_tuple_types<tuple,
                                     sizeof...(_Up) < sizeof...(_Tp) ?
                                        sizeof...(_Up) :
                                        sizeof...(_Tp)>::type
                         >::value
                      >::type
             >
        _LIBCPP_INLINE_VISIBILITY
        tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
            : base_(allocator_arg_t(), __a,
                    typename __make_tuple_indices<sizeof...(_Up)>::type(),
                    typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
                    typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
                    typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
                    _VSTD::forward<_Up>(__u)...) {}

    template <class _Tuple,
              typename enable_if
                      <
                         __tuple_convertible<_Tuple, tuple>::value,
                         bool
                      >::type = false
             >
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
        tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<base, _Tuple>::value))
            : base_(_VSTD::forward<_Tuple>(__t)) {}

    template <class _Tuple,
              typename enable_if
                      <
                         __tuple_constructible<_Tuple, tuple>::value &&
                         !__tuple_convertible<_Tuple, tuple>::value,
                         bool
                      >::type = false
             >
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
        explicit
        tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<base, _Tuple>::value))
            : base_(_VSTD::forward<_Tuple>(__t)) {}

    template <class _Alloc, class _Tuple,
              class = typename enable_if
                      <
                         __tuple_convertible<_Tuple, tuple>::value
                      >::type
             >
        _LIBCPP_INLINE_VISIBILITY
        tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
            : base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}

    template <class _Tuple,
              class = typename enable_if
                      <
                         __tuple_assignable<_Tuple, tuple>::value
                      >::type
             >
        _LIBCPP_INLINE_VISIBILITY
        tuple&
        operator=(_Tuple&& __t) _NOEXCEPT_((is_nothrow_assignable<base&, _Tuple>::value))
        {
            base_.operator=(_VSTD::forward<_Tuple>(__t));
            return *this;
        }

    _LIBCPP_INLINE_VISIBILITY
    void swap(tuple& __t) _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
        {base_.swap(__t.base_);}
};

template <>
class _LIBCPP_TYPE_VIS_ONLY tuple<>
{
public:
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_CONSTEXPR tuple() _NOEXCEPT {}
    template <class _Alloc>
    _LIBCPP_INLINE_VISIBILITY
        tuple(allocator_arg_t, const _Alloc&) _NOEXCEPT {}
    template <class _Alloc>
    _LIBCPP_INLINE_VISIBILITY
        tuple(allocator_arg_t, const _Alloc&, const tuple&) _NOEXCEPT {}
    template <class _Up>
    _LIBCPP_INLINE_VISIBILITY
        tuple(array<_Up, 0>) _NOEXCEPT {}
    template <class _Alloc, class _Up>
    _LIBCPP_INLINE_VISIBILITY
        tuple(allocator_arg_t, const _Alloc&, array<_Up, 0>) _NOEXCEPT {}
    _LIBCPP_INLINE_VISIBILITY
    void swap(tuple&) _NOEXCEPT {}
};

template <class ..._Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    __all<__is_swappable<_Tp>::value...>::value,
    void
>::type
swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u)
                 _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
    {__t.swap(__u);}

// get

template <size_t _Ip, class ..._Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, tuple<_Tp...> >::type&
get(tuple<_Tp...>& __t) _NOEXCEPT
{
    typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
    return static_cast<__tuple_leaf<_Ip, type>&>(__t.base_).get();
}

template <size_t _Ip, class ..._Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Ip, tuple<_Tp...> >::type&
get(const tuple<_Tp...>& __t) _NOEXCEPT
{
    typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
    return static_cast<const __tuple_leaf<_Ip, type>&>(__t.base_).get();
}

template <size_t _Ip, class ..._Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, tuple<_Tp...> >::type&&
get(tuple<_Tp...>&& __t) _NOEXCEPT
{
    typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
    return static_cast<type&&>(
             static_cast<__tuple_leaf<_Ip, type>&&>(__t.base_).get());
}

#if _LIBCPP_STD_VER > 11
template <class _T1, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
constexpr _T1&& get(tuple<_Args...>&& __tup) noexcept
{
    return _VSTD::get<__find_exactly_one_t<_T1, _Args...>::value>(_VSTD::move(__tup));
}

#endif
# 795 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple" 3

// tie

template <class ..._Tp>
inline _LIBCPP_INLINE_VISIBILITY
tuple<_Tp&...>
tie(_Tp&... __t) _NOEXCEPT
{
    return tuple<_Tp&...>(__t...);
}

template <class _Up>
struct __ignore_t
{
    template <class _Tp>
        _LIBCPP_INLINE_VISIBILITY
        const __ignore_t& operator=(_Tp&&) const {return *this;}
};

namespace { const __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); }

template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY reference_wrapper;

template <class _Tp>
struct __make_tuple_return_impl
{
    typedef _Tp type;
};

template <class _Tp>
struct __make_tuple_return_impl<reference_wrapper<_Tp> >
{
    typedef _Tp& type;
};

template <class _Tp>
struct __make_tuple_return
{
    typedef typename __make_tuple_return_impl<typename decay<_Tp>::type>::type type;
};

template <class... _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
tuple<typename __make_tuple_return<_Tp>::type...>
make_tuple(_Tp&&... __t)
{
    return tuple<typename __make_tuple_return<_Tp>::type...>(_VSTD::forward<_Tp>(__t)...);
}

template <class... _Tp>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
tuple<_Tp&&...>
forward_as_tuple(_Tp&&... __t) _NOEXCEPT
{
    return tuple<_Tp&&...>(_VSTD::forward<_Tp>(__t)...);
}

template <size_t _Ip>
struct __tuple_equal
{
    template <class _Tp, class _Up>
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    bool operator()(const _Tp& __x, const _Up& __y)
    {
        return __tuple_equal<_Ip - 1>()(__x, __y) && get<_Ip-1>(__x) == get<_Ip-1>(__y);
    }
};

template <>
struct __tuple_equal<0>
{
    template <class _Tp, class _Up>
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    bool operator()(const _Tp&, const _Up&)
    {
        return true;
    }
};

template <class ..._Tp, class ..._Up>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool
operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
    return __tuple_equal<sizeof...(_Tp)>()(__x, __y);
}

// tuple_cat

template <class _Tp, class _Up> struct __tuple_cat_type;

template <class ..._Ttypes, class ..._Utypes>
struct __tuple_cat_type<tuple<_Ttypes...>, __tuple_types<_Utypes...> >
{
    typedef tuple<_Ttypes..., _Utypes...> type;
};

template <class _ResultTuple, bool _Is_Tuple0TupleLike, class ..._Tuples>
struct __tuple_cat_return_1
{
};

template <class ..._Types, class _Tuple0>
struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0>
{
    typedef typename __tuple_cat_type<tuple<_Types...>,
            typename __make_tuple_types<typename remove_reference<_Tuple0>::type>::type>::type
                                                                           type;
};

template <class ..._Types, class _Tuple0, class _Tuple1, class ..._Tuples>
struct __tuple_cat_return_1<tuple<_Types...>, true, _Tuple0, _Tuple1, _Tuples...>
    : public __tuple_cat_return_1<
                 typename __tuple_cat_type<
                     tuple<_Types...>,
                     typename __make_tuple_types<typename remove_reference<_Tuple0>::type>::type
                 >::type,
                 __tuple_like<typename remove_reference<_Tuple1>::type>::value,
                 _Tuple1, _Tuples...>
{
};

template <class ..._Tuples> struct __tuple_cat_return;

template <class _Tuple0, class ..._Tuples>
struct __tuple_cat_return<_Tuple0, _Tuples...>
    : public __tuple_cat_return_1<tuple<>,
         __tuple_like<typename remove_reference<_Tuple0>::type>::value, _Tuple0,
                                                                     _Tuples...>
{
};

template <>
struct __tuple_cat_return<>
{
    typedef tuple<> type;
};

inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
tuple<>
tuple_cat()
{
    return tuple<>();
}

template <class _Rp, class _Indices, class _Tuple0, class ..._Tuples>
struct __tuple_cat_return_ref_imp;

template <class ..._Types, size_t ..._I0, class _Tuple0>
struct __tuple_cat_return_ref_imp<tuple<_Types...>, __tuple_indices<_I0...>, _Tuple0>
{
};

template <class _Tuple0, class ..._Tuples>
struct __tuple_cat_return_ref
    : public __tuple_cat_return_ref_imp<tuple<>,
               typename __make_tuple_indices<
                        tuple_size<typename remove_reference<_Tuple0>::type>::value
               >::type, _Tuple0, _Tuples...>
{
};

template <class _Types, class _I0, class _J0>
struct __tuple_cat;

template <class ..._Types, size_t ..._I0, size_t ..._J0>
struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J0...> >
{
    template <class _Tuple0>
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type
    operator()(tuple<_Types...> __t, _Tuple0&& __t0)
    {
        return forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))...,
                                      get<_J0>(_VSTD::forward<_Tuple0>(__t0))...);
    }

    template <class _Tuple0, class _Tuple1, class ..._Tuples>
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&, _Tuple1&&, _Tuples&&...>::type
    operator()(tuple<_Types...> __t, _Tuple0&& __t0, _Tuple1&& __t1, _Tuples&& ...__tpls)
    {
        typedef typename remove_reference<_Tuple0>::type _T0;
        typedef typename remove_reference<_Tuple1>::type _T1;
        return __tuple_cat<
           tuple<_Types..., typename __apply_cv<_Tuple0, typename tuple_element<_J0, _T0>::type>::type&&...>,
           typename __make_tuple_indices<sizeof ...(_Types) + tuple_size<_T0>::value>::type,
           typename __make_tuple_indices<tuple_size<_T1>::value>::type>()
                           (forward_as_tuple(
                              _VSTD::forward<_Types>(get<_I0>(__t))...,
                              get<_J0>(_VSTD::forward<_Tuple0>(__t0))...
                            ),
                            _VSTD::forward<_Tuple1>(__t1),
                            _VSTD::forward<_Tuples>(__tpls)...);
    }
};

template <class _Tuple0, class... _Tuples>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename __tuple_cat_return<_Tuple0, _Tuples...>::type
tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls)
{
    typedef typename remove_reference<_Tuple0>::type _T0;
    return __tuple_cat<tuple<>, __tuple_indices<>,
                  typename __make_tuple_indices<tuple_size<_T0>::value>::type>()
                  (tuple<>(), _VSTD::forward<_Tuple0>(__t0),
                                            _VSTD::forward<_Tuples>(__tpls)...);
}

template <class ..._Tp, class _Alloc>
struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<tuple<_Tp...>, _Alloc>
    : true_type {};

template <class _T1, class _T2>
template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2>
inline _LIBCPP_INLINE_VISIBILITY
pair<_T1, _T2>::pair(piecewise_construct_t,
                     tuple<_Args1...>& __first_args, tuple<_Args2...>& __second_args,
                     __tuple_indices<_I1...>, __tuple_indices<_I2...>)
    :  first(_VSTD::forward<_Args1>(get<_I1>( __first_args))...),
      second(_VSTD::forward<_Args2>(get<_I2>(__second_args))...)
{
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1099 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple" 3

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_TUPLE
# 1103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple" 3
# 604 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <cstring>
#endif /* expanded by -frewrite-includes */
# 605 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
#if defined(_LIBCPP_NO_EXCEPTIONS)
    #if 0 /* expanded by -frewrite-includes */
#include <cassert>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 1 3
// -*- C++ -*-
//===-------------------------- cassert -----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
# 21 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 3
#if 0 /* expanded by -frewrite-includes */
#include <assert.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 1 3 4
/*-
 * Copyright (c) 1992, 1993
 *	The Regents of the University of California.  All rights reserved.
 * (c) UNIX System Laboratories, Inc.
 * All or some portions of this file are derived from material licensed
 * to the University of California by American Telephone and Telegraph
 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
 * the permission of UNIX System Laboratories, Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
#endif /* expanded by -frewrite-includes */
# 43 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
#ifdef __cplusplus
#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 1 3 4
/*
 * Copyright (c) 2000, 2002 - 2008 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 *	California, Berkeley and its contributors.
 * 4. 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.
 *
 *	@(#)stdlib.h	8.5 (Berkeley) 5/19/95
 */

#ifndef _STDLIB_H_
#define _STDLIB_H_

#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 62 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 64 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
#if !defined(_ANSI_SOURCE)
#if 0 /* expanded by -frewrite-includes */
#include <sys/wait.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 1 3 4
/*
 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 */
 
#ifndef _SYS_WAIT_H_
#define	_SYS_WAIT_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4

/*
 * This file holds definitions relevent to the wait4 system call
 * and the alternate interfaces that use it (wait, wait3, waitpid).
 */

/*
 * [XSI] The type idtype_t shall be defined as an enumeration type whose
 * possible values shall include at least P_ALL, P_PID, and P_PGID.
 */
typedef enum {
	P_ALL,
	P_PID,
	P_PGID
} idtype_t;

/*
 * [XSI] The id_t and pid_t types shall be defined as described
 * in <sys/types.h>
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _PID_T 
#define _PID_T 
typedef __darwin_pid_t        pid_t; 
#endif  /* _PID_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_pid_t.h" 3 4
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_id_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_id_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _ID_T 
#define _ID_T 
typedef __darwin_id_t	id_t;		/* can hold pid_t, gid_t, or uid_t */
#endif /* _ID_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_id_t.h" 3 4
# 91 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 2 3 4

/*
 * [XSI] The siginfo_t type shall be defined as described in <signal.h>
 * [XSI] The rusage structure shall be defined as described in <sys/resource.h>
 * [XSI] Inclusion of the <sys/wait.h> header may also make visible all
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)signal.h	8.2 (Berkeley) 1/21/94
 */

#ifndef	_SYS_SIGNAL_H_
#define	_SYS_SIGNAL_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 73 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/appleapiopts.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/appleapiopts.h" 1 3 4
/*
 * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef __SYS_APPLEAPIOPTS_H__
#define __SYS_APPLEAPIOPTS_H__


#ifndef __APPLE_API_STANDARD
#define __APPLE_API_STANDARD
#endif /* __APPLE_API_STANDARD */

#endif /* __SYS_APPLEAPIOPTS_H__ */
# 62 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/appleapiopts.h" 3 4

# 74 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 2 3 4

#define __DARWIN_NSIG	32	/* counting 0; could be 33 (mask is 1-32) */

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#define NSIG	__DARWIN_NSIG
#endif
# 80 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <machine/signal.h>	/* sigcontext; codes for SIGILL, SIGFPE */
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/signal.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _BSD_MACHINE_SIGNAL_H_
#define _BSD_MACHINE_SIGNAL_H_

#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "arm/signal.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/signal.h" 1 3 4
/*
 * Copyright (c) 2000-2009 Apple, Inc. All rights reserved.
 */
/*
 * Copyright (c) 1992 NeXT Computer, Inc.
 *
 */

# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/signal.h" 2 3 4
#else
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/signal.h" 3 4
#error architecture not supported
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/signal.h" 3 4

#endif /* _BSD_MACHINE_SIGNAL_H_ */
# 38 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/signal.h" 3 4
# 82 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 2 3 4

#define	SIGHUP	1	/* hangup */
#define	SIGINT	2	/* interrupt */
#define	SIGQUIT	3	/* quit */
#define	SIGILL	4	/* illegal instruction (not reset when caught) */
#define	SIGTRAP	5	/* trace trap (not reset when caught) */
#define	SIGABRT	6	/* abort() */
#if  (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#define SIGWINCH 28	/* window size changes */
#define SIGINFO	29	/* information request */
#endif
# 121 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 3 4
#define SIGUSR1 30	/* user defined signal 1 */
#define SIGUSR2 31	/* user defined signal 2 */

#if defined(_ANSI_SOURCE) || __DARWIN_UNIX03 || defined(__cplusplus)
/*
 * Language spec sez we must list exactly one parameter, even though we
 * actually supply three.  Ugh!
 * SIG_HOLD is chosen to avoid KERN_SIG_* values in <sys/signalvar.h>
 */
#define	SIG_DFL		(void (*)(int))0
#define	SIG_IGN		(void (*)(int))1
#define	SIG_HOLD	(void (*)(int))5
#define	SIG_ERR		((void (*)(int))-1)
#else
# 135 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 3 4
/* DO NOT REMOVE THE COMMENTED OUT int: fixincludes needs to see them */
#define	SIG_DFL		(void (*)(/*int*/))0
#define	SIG_IGN		(void (*)(/*int*/))1
#define	SIG_HOLD	(void (*)(/*int*/))5
#define	SIG_ERR		((void (*)(/*int*/))-1)
#endif
# 141 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 3 4

#ifndef _ANSI_SOURCE
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 144 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <machine/_mcontext.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_mcontext.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "arm/_mcontext.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef __ARM_MCONTEXT_H_
#define __ARM_MCONTEXT_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/appleapiopts.h>
#endif /* expanded by -frewrite-includes */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/arm/_structs.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 1 3 4
/*
 * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
 */
/*
 * @OSF_COPYRIGHT@
 */
#ifndef	_MACH_ARM__STRUCTS_H_
#define	_MACH_ARM__STRUCTS_H_

#if __DARWIN_UNIX03
#define _STRUCT_ARM_EXCEPTION_STATE	struct __darwin_arm_exception_state
_STRUCT_ARM_EXCEPTION_STATE
{
	__uint32_t	__exception; /* number of arm exception taken */
	__uint32_t	__fsr; /* Fault status */
	__uint32_t	__far; /* Virtual Fault Address */
};
#else /* !__DARWIN_UNIX03 */
# 19 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
#define _STRUCT_ARM_EXCEPTION_STATE	struct arm_exception_state
_STRUCT_ARM_EXCEPTION_STATE
{
	__uint32_t	exception; /* number of arm exception taken */
	__uint32_t	fsr; /* Fault status */
	__uint32_t	far; /* Virtual Fault Address */
};
#endif /* __DARWIN_UNIX03 */
# 27 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

#if __DARWIN_UNIX03
#define _STRUCT_ARM_EXCEPTION_STATE64	struct __darwin_arm_exception_state64
_STRUCT_ARM_EXCEPTION_STATE64
{
	__uint64_t	__far; /* Virtual Fault Address */
	__uint32_t	__esr; /* Exception syndrome */
	__uint32_t	__exception; /* number of arm exception taken */
};
#else /* !__DARWIN_UNIX03 */
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
#define _STRUCT_ARM_EXCEPTION_STATE64	struct arm_exception_state64
_STRUCT_ARM_EXCEPTION_STATE64
{
	__uint64_t	far; /* Virtual Fault Address */
	__uint32_t	esr; /* Exception syndrome */
	__uint32_t	exception; /* number of arm exception taken */
};
#endif /* __DARWIN_UNIX03 */
# 45 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

#if __DARWIN_UNIX03
#define _STRUCT_ARM_THREAD_STATE	struct __darwin_arm_thread_state
_STRUCT_ARM_THREAD_STATE
{
	__uint32_t	__r[13];	/* General purpose register r0-r12 */
	__uint32_t	__sp;		/* Stack pointer r13 */
	__uint32_t	__lr;		/* Link register r14 */
	__uint32_t	__pc;		/* Program counter r15 */
	__uint32_t	__cpsr;		/* Current program status register */
};
#else /* !__DARWIN_UNIX03 */
# 57 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
#define _STRUCT_ARM_THREAD_STATE	struct arm_thread_state
_STRUCT_ARM_THREAD_STATE
{
	__uint32_t	r[13];	/* General purpose register r0-r12 */
	__uint32_t	sp;		/* Stack pointer r13 */
	__uint32_t	lr;		/* Link register r14 */
	__uint32_t	pc;		/* Program counter r15 */
	__uint32_t	cpsr;		/* Current program status register */
};
#endif /* __DARWIN_UNIX03 */
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

#if __DARWIN_UNIX03
#define _STRUCT_ARM_THREAD_STATE64	struct __darwin_arm_thread_state64
_STRUCT_ARM_THREAD_STATE64
{
	__uint64_t    __x[29];	/* General purpose registers x0-x28 */
	__uint64_t    __fp;		/* Frame pointer x29 */
	__uint64_t    __lr;		/* Link register x30 */
	__uint64_t    __sp;		/* Stack pointer x31 */
	__uint64_t    __pc;		/* Program counter */
	__uint32_t    __cpsr;	/* Current program status register */
	__uint32_t    __pad;    /* Same size for 32-bit or 64-bit clients */
};
#else /* !__DARWIN_UNIX03 */
# 81 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
#define _STRUCT_ARM_THREAD_STATE64	struct arm_thread_state64
_STRUCT_ARM_THREAD_STATE64
{
	__uint64_t    x[29];	/* General purpose registers x0-x28 */
	__uint64_t    fp;		/* Frame pointer x29 */
	__uint64_t    lr;		/* Link register x30 */
	__uint64_t    sp;		/* Stack pointer x31 */
	__uint64_t    pc; 		/* Program counter */
	__uint32_t    cpsr;		/* Current program status register */
	__uint32_t    __pad;    /* Same size for 32-bit or 64-bit clients */
};
#endif /* __DARWIN_UNIX03 */
# 93 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

#if __DARWIN_UNIX03
#define _STRUCT_ARM_VFP_STATE		struct __darwin_arm_vfp_state
_STRUCT_ARM_VFP_STATE
{
	__uint32_t        __r[64];
	__uint32_t        __fpscr;

};
#else /* !__DARWIN_UNIX03 */
# 103 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
#define _STRUCT_ARM_VFP_STATE	struct arm_vfp_state
_STRUCT_ARM_VFP_STATE
{
	__uint32_t        r[64];
	__uint32_t        fpscr;
};
#endif /* __DARWIN_UNIX03 */
# 110 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

#if __DARWIN_UNIX03
#define _STRUCT_ARM_NEON_STATE64	struct __darwin_arm_neon_state64
#define _STRUCT_ARM_NEON_STATE		struct __darwin_arm_neon_state

#if defined(__arm64__)
_STRUCT_ARM_NEON_STATE64
{
	__uint128_t       __v[32];
	__uint32_t        __fpsr;
	__uint32_t        __fpcr;
	char opaque[(32 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));

_STRUCT_ARM_NEON_STATE
{
	char opaque[(16 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));

#else
# 145 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
#error Unknown architecture.
#endif
# 147 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

#else /* !__DARWIN_UNIX03 */
# 149 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
#define _STRUCT_ARM_NEON_STATE64 struct arm_neon_state64
#define _STRUCT_ARM_NEON_STATE struct arm_neon_state

#if defined(__arm64__)
_STRUCT_ARM_NEON_STATE64
{
	__uint128_t		q[32];
	uint32_t		fpsr;
	uint32_t		fpcr;

};
_STRUCT_ARM_NEON_STATE
{
	__uint128_t		q[16];
	uint32_t		fpsr;
	uint32_t		fpcr;

};
#elif defined(__arm__)
# 168 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
/*
 * No 128-bit intrinsic for ARM; leave it opaque for now.
 */
_STRUCT_ARM_NEON_STATE64
{
	char opaque[(32 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));

_STRUCT_ARM_NEON_STATE
{
	char opaque[(16 * 16) + (2 * sizeof(__uint32_t))];
} __attribute__((aligned(16)));

#else
# 182 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
#error Unknown architecture.
#endif
# 184 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

#endif /* __DARWIN_UNIX03 */
# 186 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

/*
 * Debug State
 */
#if defined(__arm__)
/* Old-fashioned debug state is only for ARM */

#if __DARWIN_UNIX03
#define _STRUCT_ARM_DEBUG_STATE	struct __darwin_arm_debug_state
_STRUCT_ARM_DEBUG_STATE
{
	__uint32_t        __bvr[16];
	__uint32_t        __bcr[16];
	__uint32_t        __wvr[16];
	__uint32_t        __wcr[16];
};
#else /* !__DARWIN_UNIX03 */
# 203 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
#define _STRUCT_ARM_DEBUG_STATE	struct arm_debug_state
_STRUCT_ARM_DEBUG_STATE
{
	__uint32_t        bvr[16];
	__uint32_t        bcr[16];
	__uint32_t        wvr[16];
	__uint32_t        wcr[16];
};
#endif /* __DARWIN_UNIX03 */
# 212 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

#elif defined(__arm64__)
# 214 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

/* ARM's arm_debug_state is ARM64's arm_legacy_debug_state */

#if __DARWIN_UNIX03
#define _STRUCT_ARM_LEGACY_DEBUG_STATE	struct arm_legacy_debug_state
_STRUCT_ARM_LEGACY_DEBUG_STATE
{
	__uint32_t        __bvr[16];
	__uint32_t        __bcr[16];
	__uint32_t        __wvr[16];
	__uint32_t        __wcr[16];
};
#else /* __DARWIN_UNIX03 */
# 227 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
#define _STRUCT_ARM_LEGACY_DEBUG_STATE	struct arm_legacy_debug_state
_STRUCT_ARM_LEGACY_DEBUG_STATE
{
	__uint32_t        bvr[16];
	__uint32_t        bcr[16];
	__uint32_t        wvr[16];
	__uint32_t        wcr[16];
};
#endif /* __DARWIN_UNIX03 */
# 236 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
	__uint32_t        bcr[16];
	__uint32_t        wvr[16];
	__uint32_t        wcr[16];
	__uint64_t	  mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
};

#define _STRUCT_ARM_DEBUG_STATE64	struct arm_debug_state64
_STRUCT_ARM_DEBUG_STATE64
{
	__uint64_t        bvr[16];
	__uint64_t        bcr[16];
	__uint64_t        wvr[16];
	__uint64_t        wcr[16];
	__uint64_t	  mdscr_el1; /* Bit 0 is SS (Hardware Single Step) */
};
#endif /* __DARWIN_UNIX03 */
# 281 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4

#endif /* _MACH_ARM__STRUCTS_H_ */
# 283 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/_structs.h" 3 4
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 2 3 4

#ifndef _STRUCT_MCONTEXT32
#if __DARWIN_UNIX03
#define _STRUCT_MCONTEXT32        struct __darwin_mcontext32
_STRUCT_MCONTEXT32
{
	_STRUCT_ARM_EXCEPTION_STATE	__es;
	_STRUCT_ARM_THREAD_STATE	__ss;
	_STRUCT_ARM_VFP_STATE		__fs;
};

#else /* !__DARWIN_UNIX03 */
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4
#define _STRUCT_MCONTEXT32        struct mcontext32
_STRUCT_MCONTEXT32
{
	_STRUCT_ARM_EXCEPTION_STATE	es;
	_STRUCT_ARM_THREAD_STATE	ss;
	_STRUCT_ARM_VFP_STATE		fs;
};

#endif /* __DARWIN_UNIX03 */
# 55 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4
#endif /* _STRUCT_MCONTEXT32 */
# 56 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4


#ifndef _STRUCT_MCONTEXT64
#if __DARWIN_UNIX03
#define _STRUCT_MCONTEXT64	struct __darwin_mcontext64
_STRUCT_MCONTEXT64
{
	_STRUCT_ARM_EXCEPTION_STATE64	__es;
	_STRUCT_ARM_THREAD_STATE64	__ss;
	_STRUCT_ARM_NEON_STATE64	__ns;
};

#else /* !__DARWIN_UNIX03 */
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4
#define _STRUCT_MCONTEXT64	struct mcontext64
_STRUCT_MCONTEXT64
{
	_STRUCT_ARM_EXCEPTION_STATE64	es;
	_STRUCT_ARM_THREAD_STATE64	ss;
	_STRUCT_ARM_NEON_STATE64	ns;
};
#endif /* __DARWIN_UNIX03 */
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4
#endif /* _STRUCT_MCONTEXT32 */
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4

#ifndef _MCONTEXT_T
#define _MCONTEXT_T
#if defined(__LP64__)
typedef _STRUCT_MCONTEXT64	*mcontext_t;
#define _STRUCT_MCONTEXT _STRUCT_MCONTEXT64
#else
# 85 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4
typedef _STRUCT_MCONTEXT32	*mcontext_t;
#define _STRUCT_MCONTEXT	_STRUCT_MCONTEXT32
#endif
# 88 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4
#endif /* _MCONTEXT_T */
# 89 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4

#endif /* __ARM_MCONTEXT_H_ */
# 91 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_mcontext.h" 3 4
# 30 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_mcontext.h" 2 3 4
#else
# 31 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_mcontext.h" 3 4
#error architecture not supported
#endif
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_mcontext.h" 3 4
# 146 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 2 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_attr_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_attr_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _PTHREAD_ATTR_T 
#define _PTHREAD_ATTR_T 
typedef __darwin_pthread_attr_t pthread_attr_t;
#endif  /* _PTHREAD_ATTR_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_attr_t.h" 3 4
# 148 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 2 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_sigaltstack.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_sigaltstack.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

/* Structure used in sigaltstack call. */
#ifndef _STRUCT_SIGALTSTACK
#if __DARWIN_UNIX03
#define _STRUCT_SIGALTSTACK	struct __darwin_sigaltstack
#else /* !__DARWIN_UNIX03 */
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_sigaltstack.h" 3 4
#define _STRUCT_SIGALTSTACK	struct sigaltstack
#endif /* __DARWIN_UNIX03 */
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_sigaltstack.h" 3 4
_STRUCT_SIGALTSTACK
{
	void            *ss_sp;	        /* signal stack base */
	__darwin_size_t ss_size;        /* signal stack length */
	int             ss_flags;       /* SA_DISABLE and/or SA_ONSTACK */
};
typedef _STRUCT_SIGALTSTACK	stack_t; /* [???] signal stack */

#endif /* _STRUCT_SIGALTSTACK */
# 45 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_sigaltstack.h" 3 4
# 150 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_ucontext.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_ucontext.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _SIGSET_T 
#define _SIGSET_T 
typedef __darwin_sigset_t		sigset_t;
#endif  /* _SIGSET_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_sigset_t.h" 3 4
# 154 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_size_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _UID_T 
#define _UID_T 
typedef __darwin_uid_t        uid_t; 
#endif  /* _UID_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_uid_t.h" 3 4
# 156 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 2 3 4

union sigval {
	/* Members as suggested by Annex C of POSIX 1003.1b. */
	int	sival_int;
	void	*sival_ptr;
};

#define	SIGEV_NONE	0	/* No async notification */
#define	SIGEV_SIGNAL	1	/* aio - completion notification */
#define	SIGEV_THREAD	3	/* [NOTIMP] [RTS] call notification function */

struct sigevent {
	int				sigev_notify;				/* Notification type */
	int				sigev_signo;				/* Signal number */
	union sigval	sigev_value;				/* Signal value */
	void			(*sigev_notify_function)(union sigval);	  /* Notification function */
	pthread_attr_t	*sigev_notify_attributes;	/* Notification attributes */
};


typedef struct __siginfo {
	int	si_signo;		/* signal number */
	int	si_errno;		/* errno association */
	int	si_code;		/* signal code */
	pid_t	si_pid;			/* sending process */
	uid_t	si_uid;			/* sender's ruid */
	int	si_status;		/* exit value */
	void	*si_addr;		/* faulting instruction */
	union sigval si_value;		/* signal value */
	long	si_band;		/* band event for SIGPOLL */
	unsigned long	__pad[7];	/* Reserved for Future Use */
} siginfo_t;

#define	TRAP_TRACE	2	/* [XSI] Process trace trap -NOTIMP */

/* Codes for SIGCHLD */
struct	sigstack {
	char	*ss_sp;			/* signal stack pointer */
	int	ss_onstack;		/* current status */
};

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
/*
 * Macro for converting signal number to a mask suitable for
 * sigblock().
 */
#define sigmask(m)	(1 << ((m)-1))


#define	BADSIG		SIG_ERR

#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 382 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 3 4
#endif	/* !_ANSI_SOURCE */
# 383 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 3 4

/*
 * For historical reasons; programs expect signal's return value to be
 * defined by <sys/signal.h>.
 */
__BEGIN_DECLS
void	(*signal(int, void (*)(int)))(int);
__END_DECLS
#endif	/* !_SYS_SIGNAL_H_ */
# 392 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/signal.h" 3 4
# 110 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/resource.h>	/* [XSI] for struct rusage */
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/resource.h" 1 3 4
/*
 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
# 161 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4

/*
 * [XSI] The following symbolic constants shall be defined as possible
 * values for the fourth argument to waitid().
 */
/* WNOHANG already defined for wait4() */
/* WUNTRACED defined for wait4() but not for waitid() */
#define	WEXITED		0x00000004  /* [XSI] Processes which have exitted */
#if __DARWIN_UNIX03
/* waitid() parameter */
#define	WSTOPPED	0x00000008  /* [XSI] Any child stopped by signal */
#endif
# 173 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4
#define	WCONTINUED	0x00000010  /* [XSI] Any child stopped then continued */
#define	WNOWAIT		0x00000020  /* [XSI] Leave process returned waitable */


#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
/* POSIX extensions and 4.2/4.3 compatability: */

/*
 * Tokens for special values of the "pid" parameter to wait4.
 */
#define	WAIT_ANY	(-1)	/* any process */
#define	WAIT_MYPGRP	0	/* any process in my process group */

#if 0 /* expanded by -frewrite-includes */
#include <machine/endian.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/endian.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
/*
 * Copyright 1995 NeXT Computer, Inc. All rights reserved.
 */
#ifndef _BSD_MACHINE_ENDIAN_H_
#define _BSD_MACHINE_ENDIAN_H_

#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "arm/endian.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/endian.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 * 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.
 *
 *	@(#)endian.h	8.1 (Berkeley) 6/11/93
 */

#ifndef _ARM__ENDIAN_H_
#define	_ARM__ENDIAN_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/endian.h" 3 4
/*
 * Define _NOQUAD if the compiler does NOT support 64-bit integers.
 */
/* #define _NOQUAD */

/*
 * Define the order of 32-bit words in 64-bit words.
 */
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0

/*
 * Definitions for byte order, according to byte significance from low
 * address to high.
 */
#define	__DARWIN_LITTLE_ENDIAN	1234	/* LSB first: i386, vax */
#define	__DARWIN_BIG_ENDIAN	4321	/* MSB first: 68000, ibm, net */
#define	__DARWIN_PDP_ENDIAN	3412	/* LSB first in word, MSW first in long */

#define	__DARWIN_BYTE_ORDER	__DARWIN_LITTLE_ENDIAN

#if	defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))

#define	LITTLE_ENDIAN	__DARWIN_LITTLE_ENDIAN
#define	BIG_ENDIAN	__DARWIN_BIG_ENDIAN
#define	PDP_ENDIAN	__DARWIN_PDP_ENDIAN

#define	BYTE_ORDER	__DARWIN_BYTE_ORDER

#if 0 /* expanded by -frewrite-includes */
#include <sys/_endian.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_endian.h" 1 3 4
/*
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * 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.
 */

#ifndef _SYS__ENDIAN_H_
#define	_SYS__ENDIAN_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#elif __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN
# 109 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_endian.h" 3 4

#define ntohl(x)        ((__uint32_t)(x))
#define ntohs(x)        ((__uint16_t)(x))
#define htonl(x)        ((__uint32_t)(x))
#define htons(x)        ((__uint16_t)(x))

#if     defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))

#define ntohll(x)       ((__uint64_t)(x))
#define htonll(x)       ((__uint64_t)(x))

#define NTOHL(x)        (x)
#define NTOHS(x)        (x)
#define NTOHLL(x)       (x)
#define HTONL(x)        (x)
#define HTONS(x)        (x)
#define HTONLL(x)       (x)
#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
# 127 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_endian.h" 3 4

#else	/* __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN */
# 129 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_endian.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <libkern/_OSByteOrder.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/_OSByteOrder.h" 1 3 4
/*
 * Copyright (c) 2006 Apple Computer, Inc. All rights reserved.
 *
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _OS__OSBYTEORDER_H
#define _OS__OSBYTEORDER_H

/*
 * This header is normally included from <libkern/OSByteOrder.h>.  However,
 * <sys/_endian.h> also includes this in the case of little-endian
 * architectures, so that we can map OSByteOrder routines to the hton* and ntoh*
 * macros.  This results in the asymmetry below; we only include
 * <libkern/arch/_OSByteOrder.h> for little-endian architectures.
 */

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 41 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/_OSByteOrder.h" 3 4

/* Macros for swapping constant values in the preprocessing stage. */
#define __DARWIN_OSSwapConstInt16(x) \
    ((__uint16_t)((((__uint16_t)(x) & 0xff00) >> 8) | \
                (((__uint16_t)(x) & 0x00ff) << 8)))

#define __DARWIN_OSSwapConstInt32(x) \
    ((__uint32_t)((((__uint32_t)(x) & 0xff000000) >> 24) | \
                (((__uint32_t)(x) & 0x00ff0000) >>  8) | \
                (((__uint32_t)(x) & 0x0000ff00) <<  8) | \
                (((__uint32_t)(x) & 0x000000ff) << 24)))

#define __DARWIN_OSSwapConstInt64(x) \
    ((__uint64_t)((((__uint64_t)(x) & 0xff00000000000000ULL) >> 56) | \
                (((__uint64_t)(x) & 0x00ff000000000000ULL) >> 40) | \
                (((__uint64_t)(x) & 0x0000ff0000000000ULL) >> 24) | \
                (((__uint64_t)(x) & 0x000000ff00000000ULL) >>  8) | \
                (((__uint64_t)(x) & 0x00000000ff000000ULL) <<  8) | \
                (((__uint64_t)(x) & 0x0000000000ff0000ULL) << 24) | \
                (((__uint64_t)(x) & 0x000000000000ff00ULL) << 40) | \
                (((__uint64_t)(x) & 0x00000000000000ffULL) << 56)))

#if defined(__GNUC__)


#if defined (__arm__) || defined(__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include <libkern/arm/OSByteOrder.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/arm/OSByteOrder.h" 1 3 4
/*
 * Copyright (c) 1999-2007 Apple Inc. All rights reserved.
 */

#ifndef _OS_OSBYTEORDERARM_H
#define _OS_OSBYTEORDERARM_H

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 9 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/arm/OSByteOrder.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <arm/arch.h> /* for _ARM_ARCH_6 */
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/arch.h" 1 3 4
/*
 * Copyright (c) 2007 Apple Inc. All rights reserved.
 */
#ifndef _ARM_ARCH_H
#define _ARM_ARCH_H

/* Collect the __ARM_ARCH_*__ compiler flags into something easier to use. */
#if defined (__ARM_ARCH_7A__) || defined (__ARM_ARCH_7S__) || defined (__ARM_ARCH_7F__) || defined (__ARM_ARCH_7K__)
#define _ARM_ARCH_7
#endif
# 11 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/arch.h" 3 4
# 38 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/arch.h" 3 4

#if defined (_ARM_ARCH_4T) || defined (__ARM_ARCH_4__)
#define _ARM_ARCH_4
#endif
# 42 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/arch.h" 3 4

#endif
# 44 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/arch.h" 3 4
# 10 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/arm/OSByteOrder.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_os_inline.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_os_inline.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#if !defined(OS_INLINE)
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#        define OS_INLINE static inline
# else
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_os_inline.h" 3 4
#        define OS_INLINE static __inline__
# endif
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_os_inline.h" 3 4
#endif /* OS_INLINE */
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_os_inline.h" 3 4
# 11 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/arm/OSByteOrder.h" 2 3 4

/* Generic byte swapping functions. */

OS_INLINE
uint16_t
_OSSwapInt16(
    uint16_t        data
)
{
  /* Reduces to 'rev16' with clang */
  return (uint16_t)(data << 8 | data >> 8);
}

OS_INLINE
uint32_t
_OSSwapInt32(
    uint32_t        data
)
{
#if defined(__llvm__)
  data = __builtin_bswap32(data);
#else
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/arm/OSByteOrder.h" 3 4
  /* This actually generates the best code */
  data = (((data ^ (data >> 16 | (data << 16))) & 0xFF00FFFF) >> 8) ^ (data >> 8 | data << 24);
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/arm/OSByteOrder.h" 3 4
  
  return data;
}

OS_INLINE
uint64_t
_OSSwapInt64(
    uint64_t        data
)
{
#if defined(__llvm__)
    return __builtin_bswap64(data);
#else
# 49 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/arm/OSByteOrder.h" 3 4
    union {
        uint64_t ull;
        uint32_t ul[2];
    } u;

    /* This actually generates the best code */
    u.ul[0] = (uint32_t)(data >> 32);
    u.ul[1] = (uint32_t)(data & 0xffffffff);
    u.ul[0] = _OSSwapInt32(u.ul[0]);
    u.ul[1] = _OSSwapInt32(u.ul[1]);
    return u.ull;
#endif
# 61 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/arm/OSByteOrder.h" 3 4
}

/* Functions for byte reversed loads. */

OS_INLINE
uint16_t
OSReadSwapInt16(
    const volatile void   * base,
    uintptr_t       offset
)
{
    uint16_t result;

    result = *(volatile uint16_t *)((volatile uintptr_t)base + offset);
    return _OSSwapInt16(result);
}

OS_INLINE
uint32_t
OSReadSwapInt32(
    const volatile void   * base,
    uintptr_t       offset
)
{
    uint32_t result;

    result = *(volatile uint32_t *)((volatile uintptr_t)base + offset);
    return _OSSwapInt32(result);
}

OS_INLINE
uint64_t
OSReadSwapInt64(
    const volatile void   * base,
    uintptr_t       offset
)
{
    volatile uint32_t * inp;
    union ullc {
        uint64_t     ull;
        uint32_t     ul[2];
    } outv;

    inp = (volatile uint32_t *)((volatile uintptr_t)base + offset);
    outv.ul[0] = inp[1];
    outv.ul[1] = inp[0];
    outv.ul[0] = _OSSwapInt32(outv.ul[0]);
    outv.ul[1] = _OSSwapInt32(outv.ul[1]);
    return outv.ull;
}

/* Functions for byte reversed stores. */

OS_INLINE
void
OSWriteSwapInt16(
    volatile void   * base,
    uintptr_t       offset,
    uint16_t        data
)
{
    *(volatile uint16_t *)((volatile uintptr_t)base + offset) = _OSSwapInt16(data);
}

OS_INLINE
void
OSWriteSwapInt32(
    volatile void   * base,
    uintptr_t       offset,
    uint32_t        data
)
{
    *(volatile uint32_t *)((volatile uintptr_t)base + offset) = _OSSwapInt32(data);
}

OS_INLINE
void
OSWriteSwapInt64(
    volatile void    * base,
    uintptr_t        offset,
    uint64_t         data
)
{
    *(volatile uint64_t *)((volatile uintptr_t)base + offset) = _OSSwapInt64(data);
}

#endif /* ! _OS_OSBYTEORDERARM_H */
# 148 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/arm/OSByteOrder.h" 3 4
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/_OSByteOrder.h" 2 3 4
#endif
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/_OSByteOrder.h" 3 4


#define __DARWIN_OSSwapInt16(x) \
    ((__uint16_t)(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt16(x) : _OSSwapInt16(x)))

#define __DARWIN_OSSwapInt32(x) \
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt32(x) : _OSSwapInt32(x))

#define __DARWIN_OSSwapInt64(x) \
    (__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))

#else /* ! __GNUC__ */
# 81 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/_OSByteOrder.h" 3 4


#define __DARWIN_OSSwapInt16(x) _OSSwapInt16(x)

#define __DARWIN_OSSwapInt32(x) _OSSwapInt32(x)

#define __DARWIN_OSSwapInt64(x) _OSSwapInt64(x)

#endif /* __GNUC__ */
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/_OSByteOrder.h" 3 4

#endif /* ! _OS__OSBYTEORDER_H */
# 92 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/_OSByteOrder.h" 3 4
# 131 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_endian.h" 2 3 4

#define ntohs(x)	__DARWIN_OSSwapInt16(x)
#define htons(x)	__DARWIN_OSSwapInt16(x)

#define ntohl(x)	__DARWIN_OSSwapInt32(x)
#define htonl(x)	__DARWIN_OSSwapInt32(x)

#if	defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))

#define ntohll(x)       __DARWIN_OSSwapInt64(x)
#define htonll(x)       __DARWIN_OSSwapInt64(x)

#define	NTOHL(x)	(x) = ntohl((__uint32_t)x)
#define	NTOHS(x)	(x) = ntohs((__uint16_t)x)
#define	NTOHLL(x)	(x) = ntohll((__uint64_t)x)
#define	HTONL(x)	(x) = htonl((__uint32_t)x)
#define	HTONS(x)	(x) = htons((__uint16_t)x)
#define	HTONLL(x)	(x) = htonll((__uint64_t)x)
#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
# 150 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_endian.h" 3 4
#endif /* __DARWIN_BYTE_ORDER */
# 151 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_endian.h" 3 4
#endif /* !_SYS__ENDIAN_H_ */
# 152 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_endian.h" 3 4
# 76 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/endian.h" 2 3 4

#endif /* defined(KERNEL) || (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/endian.h" 3 4
#endif /* !_ARM__ENDIAN_H_ */
# 79 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/endian.h" 3 4
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/endian.h" 2 3 4
#else
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/endian.h" 3 4
#error architecture not supported
#endif
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/endian.h" 3 4

#endif /* _BSD_MACHINE_ENDIAN_H_ */
# 41 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/endian.h" 3 4
# 187 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 2 3 4

/*
 * Deprecated:
 * Structure of the information in the status word returned by wait4.
 * If w_stopval==_WSTOPPED, then the second structure describes
 * the information returned, else the first.
 */
union wait {
	int	w_status;		/* used in syscall */
	/*
	 * Terminated process status.
	 */
	struct {
#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN 
		unsigned int	w_Termsig:7,	/* termination signal */
				w_Coredump:1,	/* core dump indicator */
				w_Retcode:8,	/* exit code if w_termsig==0 */
				w_Filler:16;	/* upper bits filler */
#endif
# 206 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4
#if __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN 
		unsigned int	w_Filler:16,	/* upper bits filler */
				w_Retcode:8,	/* exit code if w_termsig==0 */
				w_Coredump:1,	/* core dump indicator */
				w_Termsig:7;	/* termination signal */
#endif
# 212 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4
	} w_T;
	/*
	 * Stopped process status.  Returned
	 * only for traced children unless requested
	 * with the WUNTRACED option bit.
	 */
	struct {
#if __DARWIN_BYTE_ORDER == __DARWIN_LITTLE_ENDIAN 
		unsigned int	w_Stopval:8,	/* == W_STOPPED if stopped */
				w_Stopsig:8,	/* signal that stopped us */
				w_Filler:16;	/* upper bits filler */
#endif
# 224 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4
#if __DARWIN_BYTE_ORDER == __DARWIN_BIG_ENDIAN 
		unsigned int	w_Filler:16,	/* upper bits filler */
				w_Stopsig:8,	/* signal that stopped us */
				w_Stopval:8;	/* == W_STOPPED if stopped */
#endif
# 229 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4
	} w_S;
};
#define	w_termsig	w_T.w_Termsig
#define w_coredump	w_T.w_Coredump
#define w_retcode	w_T.w_Retcode
#define w_stopval	w_S.w_Stopval
#define w_stopsig	w_S.w_Stopsig

#endif /* (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
# 238 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4

#if !(__DARWIN_UNIX03 - 0)
/*
 * Stopped state value; cannot use waitid() parameter of the same name
 * in the same scope
 */
#define	WSTOPPED	_WSTOPPED
#endif /* !__DARWIN_UNIX03 */
# 246 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4

__BEGIN_DECLS
pid_t	wait(int *) __DARWIN_ALIAS_C(wait);
pid_t	waitpid(pid_t, int *, int) __DARWIN_ALIAS_C(waitpid);
#ifndef _ANSI_SOURCE
int	waitid(idtype_t, id_t, siginfo_t *, int) __DARWIN_ALIAS_C(waitid);
#endif /* !_ANSI_SOURCE */
# 253 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4
#if  (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
;
;
#endif /* (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) */
# 257 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4
__END_DECLS
#endif /* !_SYS_WAIT_H_ */
# 259 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/wait.h" 3 4
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 2 3 4
#if (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#if 0 /* expanded by -frewrite-includes */
#include <alloca.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/alloca.h" 1 3 4
/*
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _ALLOCA_H_
#define _ALLOCA_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 28 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/alloca.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 29 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/alloca.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_size_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
#ifndef _SIZE_T 
#define _SIZE_T 
typedef __darwin_size_t        size_t; 
#endif  /* _SIZE_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 3 4
# 30 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/alloca.h" 2 3 4

__BEGIN_DECLS
;		/* built-in for gcc */
__END_DECLS

#if defined(__GNUC__) && __GNUC__ >= 3
/* built-in for gcc 3 */
#undef	alloca
#undef	__alloca
#define	alloca(size)	__alloca(size)
#define	__alloca(size)	__builtin_alloca(size)
#endif
# 42 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/alloca.h" 3 4

#endif /* _ALLOCA_H_ */
# 44 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/alloca.h" 3 4
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 2 3 4
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
#endif /* !_ANSI_SOURCE */
# 70 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4

/* DO NOT REMOVE THIS COMMENT: fixincludes needs to see:
 * _GCC_SIZE_T */
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_size_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
#endif  /* _SIZE_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 3 4
# 74 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 2 3 4

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_ct_rune_t.h>
#endif /* expanded by -frewrite-includes */
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_rune_t.h>
#endif /* expanded by -frewrite-includes */
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
#endif	/* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 79 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_wchar_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_wchar_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
/* wchar_t is a built-in type in C++ */
#ifndef __cplusplus
#ifndef _WCHAR_T
#define _WCHAR_T
typedef __darwin_wchar_t wchar_t;
#endif /* _WCHAR_T */
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_wchar_t.h" 3 4
#endif /* __cplusplus */
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_wchar_t.h" 3 4
# 81 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 2 3 4

typedef struct {
	int quot;		/* quotient */
	int rem;		/* remainder */
} div_t;

typedef struct {
	long quot;		/* quotient */
	long rem;		/* remainder */
} ldiv_t;

#if !__DARWIN_NO_LONG_LONG
typedef struct {
	long long quot;
	long long rem;
} lldiv_t;
#endif /* !__DARWIN_NO_LONG_LONG */
# 98 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_null.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_null.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef NULL 
#define NULL  __DARWIN_NULL
#endif  /* NULL */
# 31 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_null.h" 3 4
# 100 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 2 3 4

#define	EXIT_FAILURE	1
#define	EXIT_SUCCESS	0

#define	RAND_MAX	0x7fffffff

#ifdef _USE_EXTENDED_LOCALES_
#if 0 /* expanded by -frewrite-includes */
#include <_xlocale.h>
#endif /* expanded by -frewrite-includes */
# 108 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
#endif /* _USE_EXTENDED_LOCALES_ */
# 109 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4

#ifndef MB_CUR_MAX
#ifdef _USE_EXTENDED_LOCALES_
#define	MB_CUR_MAX	(___mb_cur_max())
#ifndef MB_CUR_MAX_L
#define	MB_CUR_MAX_L(x)	(___mb_cur_max_l(x))
#endif /* !MB_CUR_MAX_L */
# 116 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
#else /* !_USE_EXTENDED_LOCALES_ */
# 117 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
extern int __mb_cur_max;
#define	MB_CUR_MAX	__mb_cur_max
#endif /* _USE_EXTENDED_LOCALES_ */
# 120 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
#endif /* MB_CUR_MAX */
# 121 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)) \
    && defined(_USE_EXTENDED_LOCALES_) && !defined(MB_CUR_MAX_L)
#define	MB_CUR_MAX_L(x)	(___mb_cur_max_l(x))
#endif
# 126 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4

__BEGIN_DECLS
void	 abort(void) __dead2;
int	 abs(int) __pure2;
;
;
;
;
#if !__DARWIN_NO_LONG_LONG
;
#endif /* !__DARWIN_NO_LONG_LONG */
# 138 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
;
void	*calloc(size_t, size_t);
div_t	 div(int, int) __pure2;
void	 exit(int) __dead2;
void	 free(void *);
;
long	 labs(long) __pure2;
ldiv_t	 ldiv(long, long) __pure2;
#if !__DARWIN_NO_LONG_LONG
;
;
#endif /* !__DARWIN_NO_LONG_LONG */
# 152 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
void	*malloc(size_t);
;
;
;
 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
;
;
void	*realloc(void *, size_t);
;
double	 strtod(const char *, char **) __DARWIN_ALIAS(strtod);
float	 strtof(const char *, char **) __DARWIN_ALIAS(strtof);
;
;
#if !__DARWIN_NO_LONG_LONG
;
#endif /* !__DARWIN_NO_LONG_LONG */
# 171 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
;
#if !__DARWIN_NO_LONG_LONG
;
#endif /* !__DARWIN_NO_LONG_LONG */
# 177 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
int	 system(const char *) __DARWIN_ALIAS_C(system) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_10_0,__MAC_NA,__IPHONE_2_0,__IPHONE_8_0, "Use posix_spawn APIs instead.");
;
;

#ifndef _ANSI_SOURCE
void	_Exit(int) __dead2;
;
;
; /* LEGACY */
; 
; /* LEGACY */
; /* LEGACY */
;
#if __DARWIN_UNIX03
int	 unsetenv(const char *) __DARWIN_ALIAS(unsetenv);
#else /* !__DARWIN_UNIX03 */
# 233 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
void	 unsetenv(const char *);
#endif /* __DARWIN_UNIX03 */
# 235 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
#endif	/* !_ANSI_SOURCE */
# 236 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
#if 0 /* expanded by -frewrite-includes */
#include <machine/types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/types.h" 1 3 4
/*
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
/*
 * Copyright 1995 NeXT Computer, Inc. All rights reserved.
 */
#ifndef _BSD_MACHINE_TYPES_H_
#define _BSD_MACHINE_TYPES_H_

#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "arm/types.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 1 3 4
/*
 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
 */
/*
 * Copyright 1995 NeXT Computer, Inc. All rights reserved.
 */
/*
 * Copyright (c) 1990, 1993
 *	The Regents of the University of California.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * 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.
 *
 *	@(#)types.h	8.3 (Berkeley) 1/5/94
 */

#ifndef	_MACHTYPES_H_
#define	_MACHTYPES_H_

#ifndef __ASSEMBLER__
#if 0 /* expanded by -frewrite-includes */
#include <arm/_types.h>
#endif /* expanded by -frewrite-includes */
# 47 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 48 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
/*
 * Basic integral types.  Omit the typedef if
 * not possible for a machine/compiler combination.
 */
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_int8_t.h>
#endif /* expanded by -frewrite-includes */
# 53 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_int16_t.h>
#endif /* expanded by -frewrite-includes */
# 54 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_int32_t.h>
#endif /* expanded by -frewrite-includes */
# 55 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_int64_t.h>
#endif /* expanded by -frewrite-includes */
# 56 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4

typedef	unsigned char		u_int8_t;
typedef	unsigned short		u_int16_t;
typedef	unsigned int		u_int32_t;
typedef	unsigned long long	u_int64_t;

#if __LP64__
typedef int64_t			register_t;
#else
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
typedef int32_t			register_t;
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_intptr_t.h>
#endif /* expanded by -frewrite-includes */
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_uintptr_t.h>
#endif /* expanded by -frewrite-includes */
# 70 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
/* These types are used for reserving the largest possible size. */
#ifdef __arm64__
typedef u_int64_t		user_addr_t;	
typedef u_int64_t		user_size_t;	
typedef int64_t			user_ssize_t;
typedef int64_t			user_long_t;
typedef u_int64_t		user_ulong_t;
typedef int64_t			user_time_t;
typedef int64_t			user_off_t;
#else
# 82 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
typedef u_int32_t		user_addr_t;	
typedef u_int32_t		user_size_t;	
typedef int32_t			user_ssize_t;
typedef int32_t			user_long_t;
typedef u_int32_t		user_ulong_t;
typedef int32_t			user_time_t;
typedef int64_t			user_off_t;
#endif
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4

#define USER_ADDR_NULL	((user_addr_t) 0)
#define CAST_USER_ADDR_T(a_ptr)   ((user_addr_t)((uintptr_t)(a_ptr)))


#endif /* !_ANSI_SOURCE && (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 96 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4

/* This defines the size of syscall arguments after copying into the kernel: */
#if defined(__arm__)
typedef u_int32_t		syscall_arg_t;
#elif defined(__arm64__)
# 101 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
typedef u_int64_t		syscall_arg_t;
#else
# 103 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
#error Unknown architecture.
#endif 
# 105 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4

#endif /* __ASSEMBLER__ */
# 107 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
#endif	/* _MACHTYPES_H_ */
# 108 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/types.h" 3 4
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/types.h" 2 3 4
#else
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/types.h" 3 4
#error architecture not supported
#endif
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/types.h" 3 4

#endif /* _BSD_MACHINE_TYPES_H_ */
# 41 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/types.h" 3 4
# 239 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 2 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_dev_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_dev_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _DEV_T 
#define _DEV_T 
typedef __darwin_dev_t        dev_t;	/* device number */ 
#endif  /* _DEV_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_dev_t.h" 3 4
# 241 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_mode_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_mode_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
	    size_t, int (^)(const void *, const void *)) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#endif /* __BLOCKS__ */
# 254 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4

	 /* getcap(3) functions */
;
;
;
#endif
# 323 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
__END_DECLS

#ifdef _USE_EXTENDED_LOCALES_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_stdlib.h>
#endif /* expanded by -frewrite-includes */
# 327 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
#endif /* _USE_EXTENDED_LOCALES_ */
# 328 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4

#endif /* _STDLIB_H_ */
# 330 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/stdlib.h" 3 4
# 45 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 2 3 4
#endif /* __cplusplus */
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

/*
 * Unlike other ANSI header files, <assert.h> may usefully be included
 * multiple times, with and without NDEBUG defined.
 */

#undef assert
#undef __assert

#ifdef NDEBUG
#define	assert(e)	((void)0)
#else
# 58 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

#ifndef __GNUC__

__BEGIN_DECLS
#ifndef __cplusplus
void abort(void) __dead2;
#endif /* !__cplusplus */
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
int  printf(const char * __restrict, ...);
__END_DECLS

#define assert(e)  \
    ((void) ((e) ? ((void)0) : __assert (#e, __FILE__, __LINE__)))
#define __assert(e, file, line) \
    ((void)printf ("%s:%u: failed assertion `%s'\n", file, line, e), abort())

#else /* __GNUC__ */
# 74 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

__BEGIN_DECLS
void __assert_rtn(const char *, const char *, int, const char *) __dead2;
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
void __eprintf(const char *, const char *, unsigned, const char *) __dead2;
#endif
# 80 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
__END_DECLS

#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
#define __assert(e, file, line) \
    __eprintf ("%s:%u: failed assertion `%s'\n", file, line, e)
#else
# 86 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
/* 8462256: modified __assert_rtn() replaces deprecated __eprintf() */
#define __assert(e, file, line) \
    __assert_rtn ((const char *)-1L, file, line, e)
#endif
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

#if __DARWIN_UNIX03
#define	assert(e) \
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
#else /* !__DARWIN_UNIX03 */
# 95 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
#define assert(e)  \
    (__builtin_expect(!(e), 0) ? __assert (#e, __FILE__, __LINE__) : (void)0)
#endif /* __DARWIN_UNIX03 */
# 98 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

#endif /* __GNUC__ */
# 100 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
#endif /* NDEBUG */
# 101 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
# 22 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 25 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 3
#endif
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 3
# 607 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 2 3
#endif
# 608 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

#if __has_feature(cxx_atomic)
#if 0 /* expanded by -frewrite-includes */
#  include <atomic>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 1 3
// -*- C++ -*-
//===--------------------------- atomic -----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_ATOMIC
#define _LIBCPP_ATOMIC

/*
    atomic synopsis

namespace std
{

// order and consistency

}  // std

*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 528 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
#if 0 /* expanded by -frewrite-includes */
#include <cstddef>
#endif /* expanded by -frewrite-includes */
# 529 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
#if 0 /* expanded by -frewrite-includes */
#include <cstdint>
#endif /* expanded by -frewrite-includes */
# 530 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
#if 0 /* expanded by -frewrite-includes */
#include <type_traits>
#endif /* expanded by -frewrite-includes */
# 531 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 534 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
#endif
# 535 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3

_LIBCPP_BEGIN_NAMESPACE_STD

#if !__has_feature(cxx_atomic)
#error <atomic> is not implemented
#else
# 541 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3

typedef enum memory_order
{
    memory_order_relaxed, memory_order_consume, memory_order_acquire,
    memory_order_release, memory_order_acq_rel, memory_order_seq_cst
} memory_order;

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
kill_dependency(_Tp __y) _NOEXCEPT
{
    return __y;
}

// general atomic<T>

template <class _Tp, bool = is_integral<_Tp>::value && !is_same<_Tp, bool>::value>
struct __atomic_base  // false
{
    mutable _Atomic(_Tp) __a_;

    _LIBCPP_INLINE_VISIBILITY
    bool is_lock_free() const volatile _NOEXCEPT
        {return __c11_atomic_is_lock_free(sizeof(_Tp));}
    _LIBCPP_INLINE_VISIBILITY
    bool is_lock_free() const _NOEXCEPT
        {return __c11_atomic_is_lock_free(sizeof(_Tp));}
    _LIBCPP_INLINE_VISIBILITY
    void store(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {__c11_atomic_store(&__a_, __d, __m);}
    _LIBCPP_INLINE_VISIBILITY
    void store(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {__c11_atomic_store(&__a_, __d, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp load(memory_order __m = memory_order_seq_cst) const volatile _NOEXCEPT
        {return __c11_atomic_load(&__a_, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp load(memory_order __m = memory_order_seq_cst) const _NOEXCEPT
        {return __c11_atomic_load(&__a_, __m);}
    _LIBCPP_INLINE_VISIBILITY
    operator _Tp() const volatile _NOEXCEPT {return load();}
    _LIBCPP_INLINE_VISIBILITY
    operator _Tp() const _NOEXCEPT          {return load();}
    _LIBCPP_INLINE_VISIBILITY
    _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {return __c11_atomic_exchange(&__a_, __d, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp exchange(_Tp __d, memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_exchange(&__a_, __d, __m);}
    _LIBCPP_INLINE_VISIBILITY
    bool compare_exchange_weak(_Tp& __e, _Tp __d,
                               memory_order __s, memory_order __f) volatile _NOEXCEPT
        {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
    _LIBCPP_INLINE_VISIBILITY
    bool compare_exchange_weak(_Tp& __e, _Tp __d,
                               memory_order __s, memory_order __f) _NOEXCEPT
        {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __s, __f);}
    _LIBCPP_INLINE_VISIBILITY
    bool compare_exchange_strong(_Tp& __e, _Tp __d,
                                 memory_order __s, memory_order __f) volatile _NOEXCEPT
        {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
    _LIBCPP_INLINE_VISIBILITY
    bool compare_exchange_strong(_Tp& __e, _Tp __d,
                                 memory_order __s, memory_order __f) _NOEXCEPT
        {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __s, __f);}
    _LIBCPP_INLINE_VISIBILITY
    bool compare_exchange_weak(_Tp& __e, _Tp __d,
                              memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
    _LIBCPP_INLINE_VISIBILITY
    bool compare_exchange_weak(_Tp& __e, _Tp __d,
                               memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_compare_exchange_weak(&__a_, &__e, __d, __m, __m);}
    _LIBCPP_INLINE_VISIBILITY
    bool compare_exchange_strong(_Tp& __e, _Tp __d,
                              memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}
    _LIBCPP_INLINE_VISIBILITY
    bool compare_exchange_strong(_Tp& __e, _Tp __d,
                                 memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_compare_exchange_strong(&__a_, &__e, __d, __m, __m);}

    _LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
    __atomic_base() _NOEXCEPT = default;
#else
# 628 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
    __atomic_base() _NOEXCEPT : __a_() {}
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
# 630 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3

    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __a_(__d) {}
#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
    __atomic_base(const __atomic_base&) = delete;
    __atomic_base& operator=(const __atomic_base&) = delete;
    __atomic_base& operator=(const __atomic_base&) volatile = delete;
#else  // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
# 638 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
private:
    __atomic_base(const __atomic_base&);
    __atomic_base& operator=(const __atomic_base&);
    __atomic_base& operator=(const __atomic_base&) volatile;
#endif  // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
# 643 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
};

// atomic<Integral>

template <class _Tp>
struct __atomic_base<_Tp, true>
    : public __atomic_base<_Tp, false>
{
    typedef __atomic_base<_Tp, false> __base;
    _LIBCPP_INLINE_VISIBILITY
    __atomic_base() _NOEXCEPT _LIBCPP_DEFAULT
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}

    _LIBCPP_INLINE_VISIBILITY
    _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {return __c11_atomic_fetch_add(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp fetch_add(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_fetch_add(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp fetch_sub(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {return __c11_atomic_fetch_and(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp fetch_and(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_fetch_and(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {return __c11_atomic_fetch_or(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp fetch_or(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_fetch_or(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {return __c11_atomic_fetch_xor(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp fetch_xor(_Tp __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_fetch_xor(&this->__a_, __op, __m);}

    _LIBCPP_INLINE_VISIBILITY
    _Tp operator++(int) volatile _NOEXCEPT      {return fetch_add(_Tp(1));}
    _LIBCPP_INLINE_VISIBILITY
    _Tp operator++(int) _NOEXCEPT               {return fetch_add(_Tp(1));}
    _LIBCPP_INLINE_VISIBILITY
    _Tp operator-=(_Tp __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp operator-=(_Tp __op) _NOEXCEPT          {return fetch_sub(__op) - __op;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp operator&=(_Tp __op) volatile _NOEXCEPT {return fetch_and(__op) & __op;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp operator&=(_Tp __op) _NOEXCEPT          {return fetch_and(__op) & __op;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp operator|=(_Tp __op) volatile _NOEXCEPT {return fetch_or(__op) | __op;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp operator|=(_Tp __op) _NOEXCEPT          {return fetch_or(__op) | __op;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp operator^=(_Tp __op) volatile _NOEXCEPT {return fetch_xor(__op) ^ __op;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp operator^=(_Tp __op) _NOEXCEPT          {return fetch_xor(__op) ^ __op;}
};

// atomic<T>

template <class _Tp>
struct atomic
    : public __atomic_base<_Tp>
{
    typedef __atomic_base<_Tp> __base;
    _LIBCPP_INLINE_VISIBILITY
    atomic() _NOEXCEPT _LIBCPP_DEFAULT
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}

    _LIBCPP_INLINE_VISIBILITY
    _Tp operator=(_Tp __d) volatile _NOEXCEPT
        {__base::store(__d); return __d;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp operator=(_Tp __d) _NOEXCEPT
        {__base::store(__d); return __d;}
};

// atomic<T*>

template <class _Tp>
struct atomic<_Tp*>
    : public __atomic_base<_Tp*>
{
    typedef __atomic_base<_Tp*> __base;
    _LIBCPP_INLINE_VISIBILITY
    atomic() _NOEXCEPT _LIBCPP_DEFAULT
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_CONSTEXPR atomic(_Tp* __d) _NOEXCEPT : __base(__d) {}

    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator=(_Tp* __d) volatile _NOEXCEPT
        {__base::store(__d); return __d;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator=(_Tp* __d) _NOEXCEPT
        {__base::store(__d); return __d;}

    _LIBCPP_INLINE_VISIBILITY
    _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst)
                                                                        volatile _NOEXCEPT
        {return __c11_atomic_fetch_add(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* fetch_add(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_fetch_add(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst)
                                                                        volatile _NOEXCEPT
        {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* fetch_sub(ptrdiff_t __op, memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_fetch_sub(&this->__a_, __op, __m);}

    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator++(int) volatile _NOEXCEPT            {return fetch_add(1);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator++(int) _NOEXCEPT                     {return fetch_add(1);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator--(int) volatile _NOEXCEPT            {return fetch_sub(1);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator--(int) _NOEXCEPT                     {return fetch_sub(1);}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator++() volatile _NOEXCEPT               {return fetch_add(1) + 1;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator++() _NOEXCEPT                        {return fetch_add(1) + 1;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator--() volatile _NOEXCEPT               {return fetch_sub(1) - 1;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator--() _NOEXCEPT                        {return fetch_sub(1) - 1;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator+=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_add(__op) + __op;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator+=(ptrdiff_t __op) _NOEXCEPT          {return fetch_add(__op) + __op;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator-=(ptrdiff_t __op) volatile _NOEXCEPT {return fetch_sub(__op) - __op;}
    _LIBCPP_INLINE_VISIBILITY
    _Tp* operator-=(ptrdiff_t __op) _NOEXCEPT          {return fetch_sub(__op) - __op;}
};

// atomic_is_lock_free

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_is_lock_free(const volatile atomic<_Tp>* __o) _NOEXCEPT
{
    return __o->is_lock_free();
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_is_lock_free(const atomic<_Tp>* __o) _NOEXCEPT
{
    return __o->is_lock_free();
}

// atomic_init

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
atomic_init(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
    __c11_atomic_init(&__o->__a_, __d);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
atomic_init(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
    __c11_atomic_init(&__o->__a_, __d);
}

// atomic_store

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
atomic_store(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
    __o->store(__d);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
atomic_store(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
    __o->store(__d);
}

// atomic_store_explicit

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
atomic_store_explicit(volatile atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
{
    __o->store(__d, __m);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
atomic_store_explicit(atomic<_Tp>* __o, _Tp __d, memory_order __m) _NOEXCEPT
{
    __o->store(__d, __m);
}

// atomic_load

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
atomic_load(const volatile atomic<_Tp>* __o) _NOEXCEPT
{
    return __o->load();
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
atomic_load(const atomic<_Tp>* __o) _NOEXCEPT
{
    return __o->load();
}

// atomic_load_explicit

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
atomic_load_explicit(const volatile atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
{
    return __o->load(__m);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
atomic_load_explicit(const atomic<_Tp>* __o, memory_order __m) _NOEXCEPT
{
    return __o->load(__m);
}

// atomic_exchange

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
atomic_exchange(volatile atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
    return __o->exchange(__d);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
atomic_exchange(atomic<_Tp>* __o, _Tp __d) _NOEXCEPT
{
    return __o->exchange(__d);
}

// atomic_exchange_explicit

// atomic_compare_exchange_weak

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_weak(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
{
    return __o->compare_exchange_weak(*__e, __d);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_weak(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
{
    return __o->compare_exchange_weak(*__e, __d);
}

// atomic_compare_exchange_strong

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_strong(volatile atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
{
    return __o->compare_exchange_strong(*__e, __d);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_strong(atomic<_Tp>* __o, _Tp* __e, _Tp __d) _NOEXCEPT
{
    return __o->compare_exchange_strong(*__e, __d);
}

// atomic_compare_exchange_weak_explicit

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_compare_exchange_strong_explicit(atomic<_Tp>* __o, _Tp* __e,
                                        _Tp __d,
                                        memory_order __s, memory_order __f) _NOEXCEPT
{
    return __o->compare_exchange_strong(*__e, __d, __s, __f);
}

// atomic_fetch_add

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_add(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
    return __o->fetch_add(__op);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_add(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_add_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
    return __o->fetch_add(__op, __m);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_sub_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
    return __o->fetch_sub(__op, __m);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_and(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
    return __o->fetch_and(__op);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_and(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
    return __o->fetch_and(__op);
}

// atomic_fetch_and_explicit

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_and_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
    return __o->fetch_and(__op, __m);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_and_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
    return __o->fetch_and(__op, __m);
}

// atomic_fetch_or

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_or(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
    return __o->fetch_or(__op);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_or(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
    return __o->fetch_or(__op);
}

// atomic_fetch_or_explicit

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_or_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
    return __o->fetch_or(__op, __m);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_or_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
    return __o->fetch_or(__op, __m);
}

// atomic_fetch_xor

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_xor(volatile atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
    return __o->fetch_xor(__op);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_xor(atomic<_Tp>* __o, _Tp __op) _NOEXCEPT
{
    return __o->fetch_xor(__op);
}

// atomic_fetch_xor_explicit

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_xor_explicit(volatile atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
    return __o->fetch_xor(__op, __m);
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_integral<_Tp>::value && !is_same<_Tp, bool>::value,
    _Tp
>::type
atomic_fetch_xor_explicit(atomic<_Tp>* __o, _Tp __op, memory_order __m) _NOEXCEPT
{
    return __o->fetch_xor(__op, __m);
}

// flag type and operations

typedef struct atomic_flag
{
    _Atomic(bool) __a_;

    _LIBCPP_INLINE_VISIBILITY
    bool test_and_set(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {return __c11_atomic_exchange(&__a_, true, __m);}
    _LIBCPP_INLINE_VISIBILITY
    bool test_and_set(memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {return __c11_atomic_exchange(&__a_, true, __m);}
    _LIBCPP_INLINE_VISIBILITY
    void clear(memory_order __m = memory_order_seq_cst) volatile _NOEXCEPT
        {__c11_atomic_store(&__a_, false, __m);}
    _LIBCPP_INLINE_VISIBILITY
    void clear(memory_order __m = memory_order_seq_cst) _NOEXCEPT
        {__c11_atomic_store(&__a_, false, __m);}

    _LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
    atomic_flag() _NOEXCEPT = default;
#else
# 1378 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
    atomic_flag() _NOEXCEPT : __a_() {}
#endif // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
# 1380 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3

    _LIBCPP_INLINE_VISIBILITY
    atomic_flag(bool __b) _NOEXCEPT : __a_(__b) {}

#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
    atomic_flag(const atomic_flag&) = delete;
    atomic_flag& operator=(const atomic_flag&) = delete;
    atomic_flag& operator=(const atomic_flag&) volatile = delete;
#else  // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
# 1389 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
private:
    atomic_flag(const atomic_flag&);
    atomic_flag& operator=(const atomic_flag&);
    atomic_flag& operator=(const atomic_flag&) volatile;
#endif  // _LIBCPP_HAS_NO_DELETED_FUNCTIONS
# 1394 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
} atomic_flag;

inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_flag_test_and_set(volatile atomic_flag* __o) _NOEXCEPT
{
    return __o->test_and_set();
}

inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_flag_test_and_set(atomic_flag* __o) _NOEXCEPT
{
    return __o->test_and_set();
}

inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_flag_test_and_set_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
{
    return __o->test_and_set(__m);
}

inline _LIBCPP_INLINE_VISIBILITY
bool
atomic_flag_test_and_set_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
{
    return __o->test_and_set(__m);
}

inline _LIBCPP_INLINE_VISIBILITY
void
atomic_flag_clear(volatile atomic_flag* __o) _NOEXCEPT
{
    __o->clear();
}

inline _LIBCPP_INLINE_VISIBILITY
void
atomic_flag_clear(atomic_flag* __o) _NOEXCEPT
{
    __o->clear();
}

inline _LIBCPP_INLINE_VISIBILITY
void
atomic_flag_clear_explicit(volatile atomic_flag* __o, memory_order __m) _NOEXCEPT
{
    __o->clear(__m);
}

inline _LIBCPP_INLINE_VISIBILITY
void
atomic_flag_clear_explicit(atomic_flag* __o, memory_order __m) _NOEXCEPT
{
    __o->clear(__m);
}
// lock-free property

#define ATOMIC_BOOL_LOCK_FREE      __GCC_ATOMIC_BOOL_LOCK_FREE
#define ATOMIC_CHAR_LOCK_FREE      __GCC_ATOMIC_CHAR_LOCK_FREE
#define ATOMIC_CHAR16_T_LOCK_FREE  __GCC_ATOMIC_CHAR16_T_LOCK_FREE
#define ATOMIC_CHAR32_T_LOCK_FREE  __GCC_ATOMIC_CHAR32_T_LOCK_FREE
#define ATOMIC_WCHAR_T_LOCK_FREE   __GCC_ATOMIC_WCHAR_T_LOCK_FREE
#define ATOMIC_SHORT_LOCK_FREE     __GCC_ATOMIC_SHORT_LOCK_FREE
#define ATOMIC_INT_LOCK_FREE       __GCC_ATOMIC_INT_LOCK_FREE
#define ATOMIC_LONG_LOCK_FREE      __GCC_ATOMIC_LONG_LOCK_FREE
#define ATOMIC_LLONG_LOCK_FREE     __GCC_ATOMIC_LLONG_LOCK_FREE
#define ATOMIC_POINTER_LOCK_FREE   __GCC_ATOMIC_POINTER_LOCK_FREE

#endif  //  !__has_feature(cxx_atomic)
# 1528 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_ATOMIC
# 1532 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/atomic" 3
# 611 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 2 3
#endif
# 612 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifdef min
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro min is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing min")
#else
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro min is incompatible with C++.  #undefing min
#endif
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef min
#endif
# 20 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3

#ifdef max
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro max is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing max")
#else
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro max is incompatible with C++.  #undefing max
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
#endif
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 614 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 617 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
#endif
# 618 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

_LIBCPP_BEGIN_NAMESPACE_STD

// addressof moved to <__functional_base>

template <class _Tp> class allocator;

template <>
class _LIBCPP_TYPE_VIS_ONLY allocator<void>
{
public:
    typedef void*             pointer;
    typedef const void*       const_pointer;
    typedef void              value_type;

    template <class _Up> struct rebind {typedef allocator<_Up> other;};
};

template <>
class _LIBCPP_TYPE_VIS_ONLY allocator<const void>
{
public:
    typedef const void*       pointer;
    typedef const void*       const_pointer;
    typedef const void        value_type;

    template <class _Up> struct rebind {typedef allocator<_Up> other;};
};

// pointer_traits

template <class _Tp>
struct __has_element_type
{
private:
    struct __two {char __lx; char __lxx;};
    template <class _Up> static __two __test(...);
    template <class _Up> static char __test(typename _Up::element_type* = 0);
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Ptr, bool = __has_element_type<_Ptr>::value>
struct __pointer_traits_element_type;

template <class _Ptr>
struct __pointer_traits_element_type<_Ptr, true>
{
    typedef typename _Ptr::element_type type;
};

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <template <class, class...> class _Sp, class _Tp, class ..._Args>
struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, true>
{
    typedef typename _Sp<_Tp, _Args...>::element_type type;
};

template <template <class, class...> class _Sp, class _Tp, class ..._Args>
struct __pointer_traits_element_type<_Sp<_Tp, _Args...>, false>
{
    typedef _Tp type;
};

#else  // _LIBCPP_HAS_NO_VARIADICS
# 684 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template <template <class> class _Sp, class _Tp>
struct __pointer_traits_element_type<_Sp<_Tp>, true>
{
    typedef typename _Sp<_Tp>::element_type type;
};

template <template <class> class _Sp, class _Tp>
struct __pointer_traits_element_type<_Sp<_Tp>, false>
{
    typedef _Tp type;
};

template <template <class, class> class _Sp, class _Tp, class _A0>
                                                           class _A1, class _A2>
struct __pointer_traits_element_type<_Sp<_Tp, _A0, _A1, _A2>, false>
{
    typedef _Tp type;
};

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 736 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template <class _Tp>
struct __has_difference_type
{
private:
    struct __two {char __lx; char __lxx;};
    template <class _Up> static __two __test(...);
    template <class _Up> static char __test(typename _Up::difference_type* = 0);
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Ptr, bool = __has_difference_type<_Ptr>::value>
struct __pointer_traits_difference_type
{
    typedef ptrdiff_t type;
};

template <class _Ptr>
struct __pointer_traits_difference_type<_Ptr, true>
{
    typedef typename _Ptr::difference_type type;
};

template <class _Tp, class _Up>
struct __has_rebind
{
private:
    struct __two {char __lx; char __lxx;};
    ;
    template <class _Xp> static char __test(typename _Xp::template rebind<_Up>* = 0);
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
struct __pointer_traits_rebind
{
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
    typedef typename _Tp::template rebind<_Up> type;
#else
# 777 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    typedef typename _Tp::template rebind<_Up>::other type;
#endif
# 779 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
};

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, true>
{
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
    typedef typename _Sp<_Tp, _Args...>::template rebind<_Up> type;
#else
# 789 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    typedef typename _Sp<_Tp, _Args...>::template rebind<_Up>::other type;
#endif
# 791 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
};

template <template <class, class...> class _Sp, class _Tp, class ..._Args, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp, _Args...>, _Up, false>
{
    typedef _Sp<_Up, _Args...> type;
};

#else  // _LIBCPP_HAS_NO_VARIADICS
# 800 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template <template <class> class _Sp, class _Tp, class _Up>
struct __pointer_traits_rebind<_Sp<_Tp>, _Up, true>
{
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
    typedef typename _Sp<_Tp>::template rebind<_Up> type;
#else
# 807 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    typedef typename _Sp<_Tp>::template rebind<_Up>::other type;
#endif
{
    typedef _Sp<_Up, _A0, _A1, _A2> type;
};

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 870 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template <class _Ptr>
struct _LIBCPP_TYPE_VIS_ONLY pointer_traits
{
    typedef _Ptr                                                     pointer;
    typedef typename __pointer_traits_element_type<pointer>::type    element_type;
    typedef typename __pointer_traits_difference_type<pointer>::type difference_type;

#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
    template <class _Up> using rebind = typename __pointer_traits_rebind<pointer, _Up>::type;
#else
# 881 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    template <class _Up> struct rebind
        {typedef typename __pointer_traits_rebind<pointer, _Up>::type other;};
#endif  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 884 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

private:
    struct __nat {};
public:
    _LIBCPP_INLINE_VISIBILITY
    static pointer pointer_to(typename conditional<is_void<element_type>::value,
                                           __nat, element_type>::type& __r)
        {return pointer::pointer_to(__r);}
};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY pointer_traits<_Tp*>
{
    typedef _Tp*      pointer;
    typedef _Tp       element_type;
    typedef ptrdiff_t difference_type;

#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
    template <class _Up> using rebind = _Up*;
#else
# 904 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    template <class _Up> struct rebind {typedef _Up* other;};
#endif
# 906 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

private:
    struct __nat {};
public:
    _LIBCPP_INLINE_VISIBILITY
    static pointer pointer_to(typename conditional<is_void<element_type>::value,
                                      __nat, element_type>::type& __r) _NOEXCEPT
        {return _VSTD::addressof(__r);}
};

// allocator_traits

namespace __has_pointer_type_imp
{
    template <class _Up> static __two __test(...);
    template <class _Up> static char __test(typename _Up::pointer* = 0);
}

template <class _Tp>
struct __has_pointer_type
    : public integral_constant<bool, sizeof(__has_pointer_type_imp::__test<_Tp>(0)) == 1>
{
};

namespace __pointer_type_imp
{

template <class _Tp, class _Dp, bool = __has_pointer_type<_Dp>::value>
struct __pointer_type
{
    typedef typename _Dp::pointer type;
};

template <class _Tp, class _Dp>
struct __pointer_type<_Tp, _Dp, false>
{
    typedef _Tp* type;
};

}  // __pointer_type_imp

template <class _Tp, class _Dp>
struct __pointer_type
{
    typedef typename __pointer_type_imp::__pointer_type<_Tp, typename remove_reference<_Dp>::type>::type type;
};

template <class _Tp>
struct __has_const_pointer
{
private:
    struct __two {char __lx; char __lxx;};
    ;
    template <class _Up> static char __test(typename _Up::const_pointer* = 0);
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Tp, class _Ptr, class _Alloc, bool = __has_const_pointer<_Alloc>::value>
struct __const_pointer
{
    typedef typename _Alloc::const_pointer type;
};

template <class _Tp, class _Ptr, class _Alloc>
struct __const_pointer<_Tp, _Ptr, _Alloc, false>
{
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
    typedef typename pointer_traits<_Ptr>::template rebind<const _Tp> type;
#else
# 976 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    typedef typename pointer_traits<_Ptr>::template rebind<const _Tp>::other type;
#endif
# 978 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
};

template <class _Tp>
struct __has_void_pointer
{
private:
    struct __two {char __lx; char __lxx;};
    template <class _Up> static __two __test(...);
    ;
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Ptr, class _Alloc, bool = __has_void_pointer<_Alloc>::value>
struct __void_pointer
{
    typedef typename _Alloc::void_pointer type;
};

template <class _Ptr, class _Alloc>
struct __void_pointer<_Ptr, _Alloc, false>
{
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
    typedef typename pointer_traits<_Ptr>::template rebind<void> type;
#else
# 1003 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    typedef typename pointer_traits<_Ptr>::template rebind<void>::other type;
#endif
# 1005 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
};

template <class _Tp>
struct __has_const_void_pointer
{
private:
    struct __two {char __lx; char __lxx;};
    template <class _Up> static __two __test(...);
    ;
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Ptr, class _Alloc, bool = __has_const_void_pointer<_Alloc>::value>
struct __const_void_pointer
{
    typedef typename _Alloc::const_void_pointer type;
};

template <class _Ptr, class _Alloc>
struct __const_void_pointer<_Ptr, _Alloc, false>
{
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
    typedef typename pointer_traits<_Ptr>::template rebind<const void> type;
#else
# 1030 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    typedef typename pointer_traits<_Ptr>::template rebind<const void>::other type;
#endif
# 1032 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
};

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp*
__to_raw_pointer(_Tp* __p) _NOEXCEPT
{
    return __p;
}



template <class _Tp>
struct __has_size_type
{
private:
    struct __two {char __lx; char __lxx;};
    ;
    template <class _Up> static char __test(typename _Up::size_type* = 0);
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Alloc, class _DiffType, bool = __has_size_type<_Alloc>::value>
struct __size_type
{
    typedef typename make_unsigned<_DiffType>::type type;
};

template <class _Alloc, class _DiffType>
struct __size_type<_Alloc, _DiffType, true>
{
    typedef typename _Alloc::size_type type;
};

template <class _Tp>
struct __has_propagate_on_container_copy_assignment
{
private:
    struct __two {char __lx; char __lxx;};
    template <class _Up> static __two __test(...);
    ;
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Alloc, bool = __has_propagate_on_container_copy_assignment<_Alloc>::value>
struct __propagate_on_container_copy_assignment
{
    typedef false_type type;
};

template <class _Alloc>
struct __propagate_on_container_copy_assignment<_Alloc, true>
{
    typedef typename _Alloc::propagate_on_container_copy_assignment type;
};

template <class _Tp>
struct __has_propagate_on_container_move_assignment
{
private:
    struct __two {char __lx; char __lxx;};
    ;
    template <class _Up> static char __test(typename _Up::propagate_on_container_move_assignment* = 0);
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Alloc, bool = __has_propagate_on_container_move_assignment<_Alloc>::value>
struct __propagate_on_container_move_assignment
{
    typedef false_type type;
};

template <class _Alloc>
struct __propagate_on_container_move_assignment<_Alloc, true>
{
    typedef typename _Alloc::propagate_on_container_move_assignment type;
};

template <class _Tp>
struct __has_propagate_on_container_swap
{
private:
    struct __two {char __lx; char __lxx;};
    template <class _Up> static __two __test(...);
    ;
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Alloc, bool = __has_propagate_on_container_swap<_Alloc>::value>
struct __propagate_on_container_swap
{
    typedef false_type type;
};

template <class _Alloc>
struct __propagate_on_container_swap<_Alloc, true>
{
    typedef typename _Alloc::propagate_on_container_swap type;
};

template <class _Tp, class _Up, bool = __has_rebind<_Tp, _Up>::value>
struct __has_rebind_other
{
private:
    struct __two {char __lx; char __lxx;};
    ;
    template <class _Xp> static char __test(typename _Xp::template rebind<_Up>::other* = 0);
public:
    static const bool value = sizeof(__test<_Tp>(0)) == 1;
};

template <class _Tp, class _Up>
struct __has_rebind_other<_Tp, _Up, false>
{
    static const bool value = false;
};

template <class _Tp, class _Up, bool = __has_rebind_other<_Tp, _Up>::value>
struct __allocator_traits_rebind
{
    typedef typename _Tp::template rebind<_Up>::other type;
};

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, true>
{
    typedef typename _Alloc<_Tp, _Args...>::template rebind<_Up>::other type;
};

template <template <class, class...> class _Alloc, class _Tp, class ..._Args, class _Up>
struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false>
{
    typedef _Alloc<_Up, _Args...> type;
};

#else  // _LIBCPP_HAS_NO_VARIADICS
                                                class _A1, class _A2, class _Up>
struct __allocator_traits_rebind<_Alloc<_Tp, _A0, _A1, _A2>, _Up, false>
{
    typedef _Alloc<_Up, _A0, _A1, _A2> type;
};

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1234 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE

template <class _Alloc, class _SizeType, class _ConstVoidPtr>
auto
__has_allocate_hint_test(_Alloc&& __a, _SizeType&& __sz, _ConstVoidPtr&& __p)
    -> decltype(__a.allocate(__sz, __p), true_type());

template <class _Alloc, class _SizeType, class _ConstVoidPtr>
auto
__has_allocate_hint_test(const _Alloc& __a, _SizeType&& __sz, _ConstVoidPtr&& __p)
    -> false_type;

template <class _Alloc, class _SizeType, class _ConstVoidPtr>
struct __has_allocate_hint
    : integral_constant<bool,
        is_same<
            decltype(__has_allocate_hint_test(declval<_Alloc>(),
                                          declval<_SizeType>(),
                                          declval<_ConstVoidPtr>())),
            true_type>::value>
{
};

#else  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
# 1259 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template <class _Alloc, class _SizeType, class _ConstVoidPtr>
struct __has_allocate_hint
    : true_type
{
};

#endif  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
# 1267 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

#if !defined(_LIBCPP_HAS_NO_ADVANCED_SFINAE) && !defined(_LIBCPP_HAS_NO_VARIADICS)

template <class _Alloc, class _Tp, class ..._Args>
decltype(_VSTD::declval<_Alloc>().construct(_VSTD::declval<_Tp*>(),
                                           _VSTD::declval<_Args>()...),
                                           true_type())
__has_construct_test(_Alloc&& __a, _Tp* __p, _Args&& ...__args);

template <class _Alloc, class _Pointer, class ..._Args>
false_type
__has_construct_test(const _Alloc& __a, _Pointer&& __p, _Args&& ...__args);

template <class _Alloc, class _Pointer, class ..._Args>
struct __has_construct
    : integral_constant<bool,
        is_same<
            decltype(__has_construct_test(declval<_Alloc>(),
                                          declval<_Pointer>(),
                                          declval<_Args>()...)),
            true_type>::value>
{
};

template <class _Alloc, class _Pointer>
auto
__has_destroy_test(_Alloc&& __a, _Pointer&& __p)
    -> decltype(__a.destroy(__p), true_type());

template <class _Alloc, class _Pointer>
auto
__has_destroy_test(const _Alloc& __a, _Pointer&& __p)
    -> false_type;

template <class _Alloc, class _Pointer>
struct __has_destroy
    : integral_constant<bool,
        is_same<
            decltype(__has_destroy_test(declval<_Alloc>(),
                                        declval<_Pointer>())),
            true_type>::value>
{
};

template <class _Alloc>
auto
__has_max_size_test(_Alloc&& __a)
    -> decltype(__a.max_size(), true_type());

template <class _Alloc>
auto
__has_max_size_test(const volatile _Alloc& __a)
    -> false_type;

template <class _Alloc>
struct __has_max_size
    : integral_constant<bool,
        is_same<
            decltype(__has_max_size_test(declval<_Alloc&>())),
            true_type>::value>
{
};

template <class _Alloc>
auto
__has_select_on_container_copy_construction_test(_Alloc&& __a)
    -> decltype(__a.select_on_container_copy_construction(), true_type());

template <class _Alloc>
auto
__has_select_on_container_copy_construction_test(const volatile _Alloc& __a)
    -> false_type;

template <class _Alloc>
struct __has_select_on_container_copy_construction
    : integral_constant<bool,
        is_same<
            decltype(__has_select_on_container_copy_construction_test(declval<_Alloc&>())),
            true_type>::value>
{
};

#else  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
# 1350 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Alloc, class _Pointer, class ..._Args>
struct __has_construct
    : false_type
{
};

#else  // _LIBCPP_HAS_NO_VARIADICS
# 1360 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template <class _Alloc, class _Pointer, class _Args>
struct __has_construct
    : false_type
{
};

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1368 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template <class _Alloc, class _Pointer>
struct __has_destroy
    : false_type
{
};

template <class _Alloc>
struct __has_max_size
    : true_type
{
};

template <class _Alloc>
struct __has_select_on_container_copy_construction
    : false_type
{
};

#endif  // _LIBCPP_HAS_NO_ADVANCED_SFINAE
# 1388 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template <class _Alloc, class _Ptr, bool = __has_difference_type<_Alloc>::value>
struct __alloc_traits_difference_type
{
    typedef typename pointer_traits<_Ptr>::difference_type type;
};

template <class _Alloc, class _Ptr>
struct __alloc_traits_difference_type<_Alloc, _Ptr, true>
{
    typedef typename _Alloc::difference_type type;
};

template <class _Alloc>
struct _LIBCPP_TYPE_VIS_ONLY allocator_traits
{
    typedef _Alloc                              allocator_type;
    typedef typename allocator_type::value_type value_type;

    typedef typename __pointer_type<value_type, allocator_type>::type pointer;
    typedef typename __const_pointer<value_type, pointer, allocator_type>::type const_pointer;
    typedef typename __void_pointer<pointer, allocator_type>::type void_pointer;
    typedef typename __const_void_pointer<pointer, allocator_type>::type const_void_pointer;

    typedef typename __alloc_traits_difference_type<allocator_type, pointer>::type difference_type;
    typedef typename __size_type<allocator_type, difference_type>::type size_type;

    typedef typename __propagate_on_container_copy_assignment<allocator_type>::type
                     propagate_on_container_copy_assignment;
    typedef typename __propagate_on_container_move_assignment<allocator_type>::type
                     propagate_on_container_move_assignment;
    typedef typename __propagate_on_container_swap<allocator_type>::type
                     propagate_on_container_swap;

#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
    template <class _Tp> using rebind_alloc =
                  typename __allocator_traits_rebind<allocator_type, _Tp>::type;
    template <class _Tp> using rebind_traits = allocator_traits<rebind_alloc<_Tp>>;
#else  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 1427 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    template <class _Tp> struct rebind_alloc
        {typedef typename __allocator_traits_rebind<allocator_type, _Tp>::type other;};
    template <class _Tp> struct rebind_traits
        {typedef allocator_traits<typename rebind_alloc<_Tp>::other> other;};
#endif  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 1432 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    _LIBCPP_INLINE_VISIBILITY
    static pointer allocate(allocator_type& __a, size_type __n)
        {return __a.allocate(__n);}
    _LIBCPP_INLINE_VISIBILITY
    static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
        {return allocate(__a, __n, __hint,
            __has_allocate_hint<allocator_type, size_type, const_void_pointer>());}

    _LIBCPP_INLINE_VISIBILITY
    static void deallocate(allocator_type& __a, pointer __p, size_type __n) _NOEXCEPT
        {__a.deallocate(__p, __n);}

#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class _Tp, class... _Args>
        _LIBCPP_INLINE_VISIBILITY
        static void construct(allocator_type& __a, _Tp* __p, _Args&&... __args)
            {__construct(__has_construct<allocator_type, pointer, _Args...>(),
                         __a, __p, _VSTD::forward<_Args>(__args)...);}
#else  // _LIBCPP_HAS_NO_VARIADICS
# 1452 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    template <class _Tp>
        _LIBCPP_INLINE_VISIBILITY
        static void construct(allocator_type& __a, _Tp* __p)
            {
                ::new ((void*)__p) _Tp();
        static void construct(allocator_type& __a, _Tp* __p, const _A0& __a0,
                              const _A1& __a1, const _A2& __a2)
            {
                ::new ((void*)__p) _Tp(__a0, __a1, __a2);
            }
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1479 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    template <class _Tp>
        _LIBCPP_INLINE_VISIBILITY
        static void destroy(allocator_type& __a, _Tp* __p)
            {__destroy(__has_destroy<allocator_type, _Tp*>(), __a, __p);}

    _LIBCPP_INLINE_VISIBILITY
    static size_type max_size(const allocator_type& __a) _NOEXCEPT
        {return __max_size(__has_max_size<const allocator_type>(), __a);}

    _LIBCPP_INLINE_VISIBILITY
    static allocator_type
        select_on_container_copy_construction(const allocator_type& __a)
            {return select_on_container_copy_construction(
                __has_select_on_container_copy_construction<const allocator_type>(),
                __a);}

    template <class _Ptr>
        _LIBCPP_INLINE_VISIBILITY
        static
        void
        __construct_forward(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __begin2)
        {
            for (; __begin1 != __end1; ++__begin1, ++__begin2)
                construct(__a, _VSTD::__to_raw_pointer(__begin2), _VSTD::move_if_noexcept(*__begin1));
        }

    template <class _Tp>
        _LIBCPP_INLINE_VISIBILITY
        static
        typename enable_if
        <
            (is_same<allocator_type, allocator<_Tp> >::value
                || !__has_construct<allocator_type, _Tp*, _Tp>::value) &&
             is_trivially_move_constructible<_Tp>::value,
            void
        >::type
        __construct_forward(allocator_type& __a, _Tp* __begin1, _Tp* __end1, _Tp*& __begin2)
        {
            ptrdiff_t _Np = __end1 - __begin1;
            _VSTD::memcpy(__begin2, __begin1, _Np * sizeof(_Tp));
            __begin2 += _Np;
        }

    template <class _Ptr>
        _LIBCPP_INLINE_VISIBILITY
        static
        void
        __construct_backward(allocator_type& __a, _Ptr __begin1, _Ptr __end1, _Ptr& __end2)
        {
            while (__end1 != __begin1)
            {
                construct(__a, _VSTD::__to_raw_pointer(__end2-1), _VSTD::move_if_noexcept(*--__end1));
                --__end2;
            }
        }


private:

    _LIBCPP_INLINE_VISIBILITY
    static pointer allocate(allocator_type& __a, size_type __n,
        const_void_pointer __hint, true_type)
        {return __a.allocate(__n, __hint);}
    _LIBCPP_INLINE_VISIBILITY
    static pointer allocate(allocator_type& __a, size_type __n,
        const_void_pointer, false_type)
        {return __a.allocate(__n);}

#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class _Tp, class... _Args>
        _LIBCPP_INLINE_VISIBILITY
        static void __construct(true_type, allocator_type& __a, _Tp* __p, _Args&&... __args)
            {__a.construct(__p, _VSTD::forward<_Args>(__args)...);}
    template <class _Tp, class... _Args>
        _LIBCPP_INLINE_VISIBILITY
        static void __construct(false_type, allocator_type&, _Tp* __p, _Args&&... __args)
            {
                ::new ((void*)__p) _Tp(_VSTD::forward<_Args>(__args)...);
            }
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1576 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    template <class _Tp>
        _LIBCPP_INLINE_VISIBILITY
        static void __destroy(true_type, allocator_type& __a, _Tp* __p)
            {__a.destroy(__p);}
    template <class _Tp>
        _LIBCPP_INLINE_VISIBILITY
        static void __destroy(false_type, allocator_type&, _Tp* __p)
            {
                __p->~_Tp();
            }

    _LIBCPP_INLINE_VISIBILITY
    static size_type __max_size(true_type, const allocator_type& __a)
            {return __a.max_size();}
    _LIBCPP_INLINE_VISIBILITY
    static size_type __max_size(false_type, const allocator_type&)
            {return numeric_limits<size_type>::max();}

    _LIBCPP_INLINE_VISIBILITY
    static allocator_type
        select_on_container_copy_construction(true_type, const allocator_type& __a)
            {return __a.select_on_container_copy_construction();}
    _LIBCPP_INLINE_VISIBILITY
    static allocator_type
        select_on_container_copy_construction(false_type, const allocator_type& __a)
            {return __a;}
};

// allocator

template <class _Tp>
class _LIBCPP_TYPE_VIS_ONLY allocator
{
public:
    typedef size_t            size_type;
    typedef ptrdiff_t         difference_type;
    typedef _Tp*              pointer;
    typedef const _Tp*        const_pointer;
    typedef _Tp&              reference;
    typedef const _Tp&        const_reference;
    typedef _Tp               value_type;

    typedef true_type propagate_on_container_move_assignment;

    template <class _Up> struct rebind {typedef allocator<_Up> other;};

    _LIBCPP_INLINE_VISIBILITY allocator() _NOEXCEPT {}
    template <class _Up> _LIBCPP_INLINE_VISIBILITY allocator(const allocator<_Up>&) _NOEXCEPT {}
    _LIBCPP_INLINE_VISIBILITY pointer address(reference __x) const _NOEXCEPT
        {return _VSTD::addressof(__x);}
    _LIBCPP_INLINE_VISIBILITY const_pointer address(const_reference __x) const _NOEXCEPT
        {return _VSTD::addressof(__x);}
    _LIBCPP_INLINE_VISIBILITY pointer allocate(size_type __n, allocator<void>::const_pointer = 0)
        {return static_cast<pointer>(::operator new(__n * sizeof(_Tp)));}
    _LIBCPP_INLINE_VISIBILITY void deallocate(pointer __p, size_type) _NOEXCEPT
        {::operator delete((void*)__p);}
    _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT
        {return size_type(~0) / sizeof(_Tp);}
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
    template <class _Up, class... _Args>
        _LIBCPP_INLINE_VISIBILITY
        void
        construct(_Up* __p, _Args&&... __args)
        {
            ::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
        }
#else  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
# 1644 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
        _LIBCPP_INLINE_VISIBILITY
        void
        _LIBCPP_INLINE_VISIBILITY
        void
        construct(pointer __p, const _A0& __a0, const _A1& __a1)
        {
            ::new((void*)__p) _Tp(__a0, __a1);
        }
#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
# 1786 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    _LIBCPP_INLINE_VISIBILITY void destroy(pointer __p) {__p->~_Tp();}
};





template <class _OutputIterator, class _Tp>
class _LIBCPP_TYPE_VIS_ONLY raw_storage_iterator
    : public iterator<output_iterator_tag,
                      _Tp,                                         // purposefully not C++03
                      ptrdiff_t,                                   // purposefully not C++03
                      _Tp*,                                        // purposefully not C++03
                      raw_storage_iterator<_OutputIterator, _Tp>&> // purposefully not C++03
{
private:
    _OutputIterator __x_;
public:
    _LIBCPP_INLINE_VISIBILITY explicit raw_storage_iterator(_OutputIterator __x) : __x_(__x) {}
    _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator*() {return *this;}
    _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator=(const _Tp& __element)
        {::new(&*__x_) _Tp(__element); return *this;}
    _LIBCPP_INLINE_VISIBILITY raw_storage_iterator& operator++() {++__x_; return *this;}
    _LIBCPP_INLINE_VISIBILITY raw_storage_iterator  operator++(int)
        {raw_storage_iterator __t(*this); ++__x_; return __t;}
};

template <class _Tp>
pair<_Tp*, ptrdiff_t>
get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT
{
    pair<_Tp*, ptrdiff_t> __r(0, 0);
    const ptrdiff_t __m = (~ptrdiff_t(0) ^
                           ptrdiff_t(ptrdiff_t(1) << (sizeof(ptrdiff_t) * __CHAR_BIT__ - 1)))
                           / sizeof(_Tp);
    if (__n > __m)
        __n = __m;
    while (__n > 0)
    {
        __r.first = static_cast<_Tp*>(::operator new(__n * sizeof(_Tp), nothrow));
        if (__r.first)
        {
            __r.second = __n;
            break;
        }
        __n /= 2;
    }
    return __r;
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void return_temporary_buffer(_Tp* __p) _NOEXCEPT {::operator delete(__p);}

template <class _Tp>
struct auto_ptr_ref
{
    _Tp* __ptr_;
};

template<class _Tp>
class _LIBCPP_TYPE_VIS_ONLY auto_ptr
{
private:
    _Tp* __ptr_;
public:
    typedef _Tp element_type;

    _LIBCPP_INLINE_VISIBILITY explicit auto_ptr(_Tp* __p = 0) throw() : __ptr_(__p) {}
    _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr& __p) throw() : __ptr_(__p.release()) {}
    template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr<_Up>& __p) throw()
        : __ptr_(__p.release()) {}
    _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr& __p) throw()
        {reset(__p.release()); return *this;}
    template<class _Up> _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr<_Up>& __p) throw()
        {reset(__p.release()); return *this;}
    _LIBCPP_INLINE_VISIBILITY auto_ptr& operator=(auto_ptr_ref<_Tp> __p) throw()
        {reset(__p.__ptr_); return *this;}
    _LIBCPP_INLINE_VISIBILITY ~auto_ptr() throw() {delete __ptr_;}

    _LIBCPP_INLINE_VISIBILITY _Tp& operator*() const throw()
        {return *__ptr_;}
    _LIBCPP_INLINE_VISIBILITY _Tp* operator->() const throw() {return __ptr_;}
    _LIBCPP_INLINE_VISIBILITY _Tp* get() const throw() {return __ptr_;}
    _LIBCPP_INLINE_VISIBILITY _Tp* release() throw()
    {
        _Tp* __t = __ptr_;
        __ptr_ = 0;
        return __t;
    }
    _LIBCPP_INLINE_VISIBILITY void reset(_Tp* __p = 0) throw()
    {
        if (__ptr_ != __p)
            delete __ptr_;
        __ptr_ = __p;
    }

    _LIBCPP_INLINE_VISIBILITY auto_ptr(auto_ptr_ref<_Tp> __p) throw() : __ptr_(__p.__ptr_) {}
    template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr_ref<_Up>() throw()
        {auto_ptr_ref<_Up> __t; __t.__ptr_ = release(); return __t;}
    template<class _Up> _LIBCPP_INLINE_VISIBILITY operator auto_ptr<_Up>() throw()
        {return auto_ptr<_Up>(release());}
};

template <>
class _LIBCPP_TYPE_VIS_ONLY auto_ptr<void>
{
public:
    typedef void element_type;
};

template <class _T1, class _T2, bool = is_same<typename remove_cv<_T1>::type,
                                                     typename remove_cv<_T2>::type>::value,
                                bool = is_empty<_T1>::value
#if __has_feature(is_final)
                                       && !__is_final(_T1)
#endif
# 1907 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
                                ,
                                bool = is_empty<_T2>::value
#if __has_feature(is_final)
                                       && !__is_final(_T2)
#endif
# 1912 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
         >
struct __libcpp_compressed_pair_switch;

template <class _T1, class _T2, bool IsSame>
struct __libcpp_compressed_pair_switch<_T1, _T2, IsSame, false, false> {enum {value = 0};};

template <class _T1, class _T2, bool IsSame>
struct __libcpp_compressed_pair_switch<_T1, _T2, IsSame, true, false>  {enum {value = 1};};

template <class _T1, class _T2, bool IsSame>
struct __libcpp_compressed_pair_switch<_T1, _T2, IsSame, false, true>  {enum {value = 2};};

template <class _T1, class _T2>
struct __libcpp_compressed_pair_switch<_T1, _T2, false, true, true>    {enum {value = 3};};

template <class _T1, class _T2>
struct __libcpp_compressed_pair_switch<_T1, _T2, true, true, true>     {enum {value = 1};};

template <class _T1, class _T2, unsigned = __libcpp_compressed_pair_switch<_T1, _T2>::value>
class __libcpp_compressed_pair_imp;

template <class _T1, class _T2>
class __libcpp_compressed_pair_imp<_T1, _T2, 0>
{
private:
    _T1 __first_;
    _T2 __second_;
public:
    typedef _T1 _T1_param;
    typedef _T2 _T2_param;

    typedef typename remove_reference<_T1>::type& _T1_reference;
    typedef typename remove_reference<_T2>::type& _T2_reference;

    typedef const typename remove_reference<_T1>::type& _T1_const_reference;
    typedef const typename remove_reference<_T2>::type& _T2_const_reference;

    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
        : __first_(_VSTD::forward<_T1_param>(__t1)) {}
    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
        : __second_(_VSTD::forward<_T2_param>(__t2)) {}
    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
        : __first_(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}

#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)

    _LIBCPP_INLINE_VISIBILITY
    __libcpp_compressed_pair_imp(const __libcpp_compressed_pair_imp& __p)

#endif  // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
# 1994 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

#ifndef _LIBCPP_HAS_NO_VARIADICS

    template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
        _LIBCPP_INLINE_VISIBILITY
        __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
                                     tuple<_Args1...> __first_args,
                                     tuple<_Args2...> __second_args,
                                     __tuple_indices<_I1...>,
                                     __tuple_indices<_I2...>)
            : __first_(_VSTD::forward<_Args1>(get<_I1>(__first_args))...),
              __second_(_VSTD::forward<_Args2>(get<_I2>(__second_args))...)
            {}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2009 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return __first_;}
    _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}

    _LIBCPP_INLINE_VISIBILITY _T2_reference       second() _NOEXCEPT       {return __second_;}
    _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return __second_;}

    _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp& __x)
        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
                   __is_nothrow_swappable<_T1>::value)
    {
        using _VSTD::swap;
        swap(__first_, __x.__first_);
        swap(__second_, __x.__second_);
    }
};

template <class _T1, class _T2>
class __libcpp_compressed_pair_imp<_T1, _T2, 1>
    : private _T1
{
private:
    _T2 __second_;
public:
    typedef _T1 _T1_param;
    typedef _T2 _T2_param;

    typedef _T1&                                        _T1_reference;
    typedef typename remove_reference<_T2>::type& _T2_reference;

    typedef const _T1&                                        _T1_const_reference;
    typedef const typename remove_reference<_T2>::type& _T2_const_reference;

    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
        : _T1(_VSTD::forward<_T1_param>(__t1)) {}
    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
        : __second_(_VSTD::forward<_T2_param>(__t2)) {}
    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
        : _T1(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}

#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)


#endif  // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
# 2085 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

#ifndef _LIBCPP_HAS_NO_VARIADICS

    template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
        _LIBCPP_INLINE_VISIBILITY
        __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
                                     tuple<_Args1...> __first_args,
                                     tuple<_Args2...> __second_args,
                                     __tuple_indices<_I1...>,
                                     __tuple_indices<_I2...>)
            : _T1(_VSTD::forward<_Args1>(get<_I1>(__first_args))...),
              __second_(_VSTD::forward<_Args2>(get<_I2>(__second_args))...)
            {}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2100 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return *this;}
    _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}

    _LIBCPP_INLINE_VISIBILITY _T2_reference       second() _NOEXCEPT       {return __second_;}
    _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return __second_;}

    _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp& __x)
        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
                   __is_nothrow_swappable<_T1>::value)
    {
        using _VSTD::swap;
        swap(__second_, __x.__second_);
    }
};

template <class _T1, class _T2>
class __libcpp_compressed_pair_imp<_T1, _T2, 2>
    : private _T2
{
private:
    _T1 __first_;
public:
    typedef _T1 _T1_param;
    typedef _T2 _T2_param;

    typedef typename remove_reference<_T1>::type& _T1_reference;
    typedef _T2&                                        _T2_reference;

    typedef const typename remove_reference<_T1>::type& _T1_const_reference;
    typedef const _T2&                                        _T2_const_reference;

    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
        : __first_(_VSTD::forward<_T1_param>(__t1)) {}
    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
        : _T2(_VSTD::forward<_T2_param>(__t2)) {}
    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
        _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
                   is_nothrow_move_constructible<_T2>::value)
        : _T2(_VSTD::forward<_T2_param>(__t2)), __first_(_VSTD::forward<_T1_param>(__t1)) {}

#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
        }

#endif  // defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
# 2177 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

#ifndef _LIBCPP_HAS_NO_VARIADICS

    template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
        _LIBCPP_INLINE_VISIBILITY
        __libcpp_compressed_pair_imp(piecewise_construct_t __pc,
                                     tuple<_Args1...> __first_args,
                                     tuple<_Args2...> __second_args,
                                     __tuple_indices<_I1...>,
                                     __tuple_indices<_I2...>)
            : _T2(_VSTD::forward<_Args2>(get<_I2>(__second_args))...),
              __first_(_VSTD::forward<_Args1>(get<_I1>(__first_args))...)
              
            {}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2193 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return __first_;}
    _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}

    _LIBCPP_INLINE_VISIBILITY _T2_reference       second() _NOEXCEPT       {return *this;}
    _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return *this;}

    _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp& __x)
        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
                   __is_nothrow_swappable<_T1>::value)
    {
        using _VSTD::swap;
        swap(__first_, __x.__first_);
    }
};

template <class _T1, class _T2>
class __libcpp_compressed_pair_imp<_T1, _T2, 3>
    : private _T1,
      private _T2
{
public:
    typedef _T1 _T1_param;
    typedef _T2 _T2_param;

    typedef _T1& _T1_reference;
    typedef _T2& _T2_reference;

    typedef const _T1& _T1_const_reference;
    typedef const _T2& _T2_const_reference;

    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
        : _T1(_VSTD::forward<_T1_param>(__t1)) {}
    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
        : _T2(_VSTD::forward<_T2_param>(__t2)) {}
    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
        : _T1(_VSTD::forward<_T1_param>(__t1)), _T2(_VSTD::forward<_T2_param>(__t2)) {}

#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)


#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2282 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return *this;}
    _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}

    _LIBCPP_INLINE_VISIBILITY _T2_reference       second() _NOEXCEPT       {return *this;}
    _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return *this;}

    _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp&)
        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
                   __is_nothrow_swappable<_T1>::value)
    {
    }
};

template <class _T1, class _T2>
class __compressed_pair
    : private __libcpp_compressed_pair_imp<_T1, _T2>
{
    typedef __libcpp_compressed_pair_imp<_T1, _T2> base;
public:
    typedef typename base::_T1_param _T1_param;
    typedef typename base::_T2_param _T2_param;

    typedef typename base::_T1_reference _T1_reference;
    typedef typename base::_T2_reference _T2_reference;

    typedef typename base::_T1_const_reference _T1_const_reference;
    typedef typename base::_T2_const_reference _T2_const_reference;

    _LIBCPP_INLINE_VISIBILITY __compressed_pair() {}
    _LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T1_param __t1)
        : base(_VSTD::forward<_T1_param>(__t1)) {}
    _LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T2_param __t2)
        : base(_VSTD::forward<_T2_param>(__t2)) {}
    _LIBCPP_INLINE_VISIBILITY __compressed_pair(_T1_param __t1, _T2_param __t2)
        : base(_VSTD::forward<_T1_param>(__t1), _VSTD::forward<_T2_param>(__t2)) {}

#if defined(_LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)

    _LIBCPP_INLINE_VISIBILITY
    __compressed_pair(const __compressed_pair& __p)
        _NOEXCEPT_(is_nothrow_copy_constructible<_T1>::value &&
                   is_nothrow_copy_constructible<_T2>::value)
    template <class... _Args1, class... _Args2>
        _LIBCPP_INLINE_VISIBILITY
        __compressed_pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
                                                      tuple<_Args2...> __second_args)
            : base(__pc, _VSTD::move(__first_args), _VSTD::move(__second_args),
                   typename __make_tuple_indices<sizeof...(_Args1)>::type(),
                   typename __make_tuple_indices<sizeof...(_Args2) >::type())
            {}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2365 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return base::first();}
    _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return base::first();}

    _LIBCPP_INLINE_VISIBILITY _T2_reference       second() _NOEXCEPT       {return base::second();}
    _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return base::second();}

    _LIBCPP_INLINE_VISIBILITY void swap(__compressed_pair& __x)
        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
                   __is_nothrow_swappable<_T1>::value)
        {base::swap(__x);}
};



// __same_or_less_cv_qualified

template <class _Ptr1, class _Ptr2,
          bool = is_same<typename remove_cv<typename pointer_traits<_Ptr1>::element_type>::type,
                         typename remove_cv<typename pointer_traits<_Ptr2>::element_type>::type
                        >::value
         >
struct __same_or_less_cv_qualified_imp
    : is_convertible<_Ptr1, _Ptr2> {};

template <class _Ptr1, class _Ptr2>
struct __same_or_less_cv_qualified_imp<_Ptr1, _Ptr2, false>
    : false_type {};

template <class _Ptr1, class _Ptr2, bool = is_scalar<_Ptr1>::value &&
                                         !is_pointer<_Ptr1>::value>
struct __same_or_less_cv_qualified
    : __same_or_less_cv_qualified_imp<_Ptr1, _Ptr2> {};

template <class _Ptr1, class _Ptr2>
struct __same_or_less_cv_qualified<_Ptr1, _Ptr2, true>
    : false_type {};

// default_delete

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY default_delete
{
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
#else
# 2417 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
#endif
# 2419 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    template <class _Up>
        _LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up>&,
             typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
    _LIBCPP_INLINE_VISIBILITY void operator() (_Tp* __ptr) const _NOEXCEPT
        {
            static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
            static_assert(!is_void<_Tp>::value, "default_delete can not delete incomplete type");
            delete __ptr;
        }
};

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY default_delete<_Tp[]>
{
public:
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
#else
# 2437 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
#endif
# 2439 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    template <class _Up>
        _LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up[]>&,
             typename enable_if<__same_or_less_cv_qualified<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
    template <class _Up>
        _LIBCPP_INLINE_VISIBILITY
        void operator() (_Up* __ptr,
                         typename enable_if<__same_or_less_cv_qualified<_Up*, _Tp*>::value>::type* = 0) const _NOEXCEPT
        {
            static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
            static_assert(!is_void<_Tp>::value, "default_delete can not delete incomplete type");
            delete [] __ptr;
        }
};

template <class _Tp, class _Dp = default_delete<_Tp> >
class _LIBCPP_TYPE_VIS_ONLY unique_ptr
{
public:
    typedef _Tp element_type;
    typedef _Dp deleter_type;
    typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
private:
    __compressed_pair<pointer, deleter_type> __ptr_;

#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    ;
    ;
    ;
    ;
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2471 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    struct __nat {int __for_bool_;};

    typedef       typename remove_reference<deleter_type>::type& _Dp_reference;
    typedef const typename remove_reference<deleter_type>::type& _Dp_const_reference;
public:
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT
        : __ptr_(pointer())
        {
            static_assert(!is_pointer<deleter_type>::value,
                "unique_ptr constructed with null function pointer deleter");
        }
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT
        : __ptr_(pointer())
        {
            static_assert(!is_pointer<deleter_type>::value,
                "unique_ptr constructed with null function pointer deleter");
        }
    _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(pointer __p) _NOEXCEPT
        : __ptr_(_VSTD::move(__p))
        {
            static_assert(!is_pointer<deleter_type>::value,
                "unique_ptr constructed with null function pointer deleter");
        }

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, typename conditional<
                                        is_reference<deleter_type>::value,
                                        deleter_type,
                                        typename add_lvalue_reference<const deleter_type>::type>::type __d)
             _NOEXCEPT
        : __ptr_(__p, __d) {}

    _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, typename remove_reference<deleter_type>::type&& __d)
             _NOEXCEPT
        : __ptr_(__p, _VSTD::move(__d))
        {
            static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
        }
    _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
        : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
    template <class _Up, class _Ep>
        _LIBCPP_INLINE_VISIBILITY
        unique_ptr(unique_ptr<_Up, _Ep>&& __u,
                   typename enable_if
                      <
                        !is_array<_Up>::value &&
                         is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
                         is_convertible<_Ep, deleter_type>::value &&
                         (
                            !is_reference<deleter_type>::value ||
                            is_same<deleter_type, _Ep>::value
                         ),
                         __nat
                      >::type = __nat()) _NOEXCEPT
            : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}

    template <class _Up>
        _LIBCPP_INLINE_VISIBILITY unique_ptr(auto_ptr<_Up>&& __p,
                typename enable_if<
                                      is_convertible<_Up*, _Tp*>::value &&
                                      is_same<_Dp, default_delete<_Tp> >::value,
                                      __nat
                                  >::type = __nat()) _NOEXCEPT
            : __ptr_(__p.release())
            {
            }

        _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT
            {
                reset(__u.release());
                __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
                return *this;
            }

        template <class _Up, class _Ep>
            _LIBCPP_INLINE_VISIBILITY
            typename enable_if
            <
                !is_array<_Up>::value &&
                is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
                is_assignable<deleter_type&, _Ep&&>::value,
                unique_ptr&
            >::type
            operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
            {
                reset(__u.release());
                __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
                return *this;
            }
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2562 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    _LIBCPP_INLINE_VISIBILITY operator __rv<unique_ptr>()
    {
        return __rv<unique_ptr>(*this);
    }
        _LIBCPP_INLINE_VISIBILITY
                typename enable_if<
                                      is_convertible<_Up*, _Tp*>::value &&
                                      is_same<_Dp, default_delete<_Tp> >::value,
                                      unique_ptr&
                                  >::type
        operator=(auto_ptr<_Up> __p)
            {reset(__p.release()); return *this;}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2593 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    _LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();}

    _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(nullptr_t) _NOEXCEPT
    {
        reset();
        return *this;
    }

    _LIBCPP_INLINE_VISIBILITY typename add_lvalue_reference<_Tp>::type operator*() const
        {return *__ptr_.first();}
    _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT {return __ptr_.first();}
    _LIBCPP_INLINE_VISIBILITY pointer get() const _NOEXCEPT {return __ptr_.first();}
    _LIBCPP_INLINE_VISIBILITY       _Dp_reference get_deleter() _NOEXCEPT
        {return __ptr_.second();}
    _LIBCPP_INLINE_VISIBILITY _Dp_const_reference get_deleter() const _NOEXCEPT
        {return __ptr_.second();}
    _LIBCPP_INLINE_VISIBILITY
        _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT
        {return __ptr_.first() != nullptr;}

    _LIBCPP_INLINE_VISIBILITY pointer release() _NOEXCEPT
    {
        pointer __t = __ptr_.first();
        __ptr_.first() = pointer();
        return __t;
    }

    _LIBCPP_INLINE_VISIBILITY void reset(pointer __p = pointer()) _NOEXCEPT
    {
        pointer __tmp = __ptr_.first();
        __ptr_.first() = __p;
        if (__tmp)
            __ptr_.second()(__tmp);
    }

    _LIBCPP_INLINE_VISIBILITY void swap(unique_ptr& __u) _NOEXCEPT
        {__ptr_.swap(__u.__ptr_);}
};

template <class _Tp, class _Dp>
class _LIBCPP_TYPE_VIS_ONLY unique_ptr<_Tp[], _Dp>
{
public:
    typedef _Tp element_type;
    typedef _Dp deleter_type;
    typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
private:
    __compressed_pair<pointer, deleter_type> __ptr_;

#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    ;
    ;
    ;
    ;
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2650 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    struct __nat {int __for_bool_;};

    typedef       typename remove_reference<deleter_type>::type& _Dp_reference;
    typedef const typename remove_reference<deleter_type>::type& _Dp_const_reference;
public:
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT
        : __ptr_(pointer())
        {
            static_assert(!is_pointer<deleter_type>::value,
                "unique_ptr constructed with null function pointer deleter");
        }
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT
        : __ptr_(pointer())
        {
            static_assert(!is_pointer<deleter_type>::value,
                "unique_ptr constructed with null function pointer deleter");
        }
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template <class _Pp,
              class = typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value>::type
             >
    _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(_Pp __p) _NOEXCEPT
        : __ptr_(__p)
        {
            static_assert(!is_pointer<deleter_type>::value,
                "unique_ptr constructed with null function pointer deleter");
        }


    template <class _Pp,
              class = typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value>::type
             >
    _LIBCPP_INLINE_VISIBILITY unique_ptr(_Pp __p, typename remove_reference<deleter_type>::type&& __d)
             _NOEXCEPT
        : __ptr_(__p, _VSTD::move(__d))
        {
            static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
        }

    _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, typename remove_reference<deleter_type>::type&& __d)
             _NOEXCEPT
        : __ptr_(pointer(), _VSTD::move(__d))
        {
            static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
        }

    _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
        : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}

    _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT
        {
            reset(__u.release());
            __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
            return *this;
        }

    template <class _Up, class _Ep>
        _LIBCPP_INLINE_VISIBILITY
        unique_ptr(unique_ptr<_Up, _Ep>&& __u,
                   typename enable_if
                            <
                                is_array<_Up>::value &&
                                __same_or_less_cv_qualified<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value
                                && is_convertible<_Ep, deleter_type>::value &&
                                (
                                    !is_reference<deleter_type>::value ||
                                    is_same<deleter_type, _Ep>::value
                                ),
                                __nat
                            >::type = __nat()
                  ) _NOEXCEPT
        : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}


        template <class _Up, class _Ep>
            _LIBCPP_INLINE_VISIBILITY
            typename enable_if
            <
                is_array<_Up>::value &&
                __same_or_less_cv_qualified<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
                is_assignable<deleter_type&, _Ep&&>::value,
                unique_ptr&
            >::type
            operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
            {
                reset(__u.release());
                __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
                return *this;
            }
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2757 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    }

    _LIBCPP_INLINE_VISIBILITY unique_ptr(__rv<unique_ptr> __u)
        : __ptr_(__u->release(), _VSTD::forward<deleter_type>(__u->get_deleter())) {}

    _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(__rv<unique_ptr> __u)
    {
        reset(__u->release());
        __ptr_.second() = _VSTD::forward<deleter_type>(__u->get_deleter());
        return *this;
    }

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2787 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    _LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();}


    _LIBCPP_INLINE_VISIBILITY pointer release() _NOEXCEPT
    {
        pointer __t = __ptr_.first();
        __ptr_.first() = pointer();
        return __t;
    }

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template <class _Pp,
              class = typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value>::type
             >
    _LIBCPP_INLINE_VISIBILITY void reset(_Pp __p) _NOEXCEPT
    {
        pointer __tmp = __ptr_.first();
        __ptr_.first() = __p;
    }
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2839 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    _LIBCPP_INLINE_VISIBILITY void reset(pointer __p = pointer())
    {
        pointer __tmp = __ptr_.first();
        __ptr_.first() = __p;
        if (__tmp)
            __ptr_.second()(__tmp);
    }
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2847 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    _LIBCPP_INLINE_VISIBILITY void swap(unique_ptr& __u) {__ptr_.swap(__u.__ptr_);}
private:

#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    ;
    ;
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2866 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
};











template <class _T1, class _D1>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator>=(nullptr_t, const unique_ptr<_T1, _D1>& __x)
{
    return !(nullptr < __x);
}

#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template<class _Tp, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
typename __unique_if<_Tp>::__unique_single
make_unique(_Args&&... __args)
{
#endif  // _LIBCPP_STD_VER > 11
# 3061 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template <class _Tp> struct hash;

template <class _Size>
inline _LIBCPP_INLINE_VISIBILITY
_Size
__loadword(const void* __p)
{
    _Size __r;
    std::memcpy(&__r, __p, sizeof(__r));
    return __r;
}

// We use murmur2 when size_t is 32 bits, and cityhash64 when size_t
// is 64 bits.  This is because cityhash64 uses 64bit x 64bit
// multiplication, which can be very slow on 32-bit systems.
template <class _Size, size_t = sizeof(_Size)*__CHAR_BIT__>
struct __murmur2_or_cityhash;

template <class _Size>
struct __murmur2_or_cityhash<_Size, 32>
{
    _Size operator()(const void* __key, _Size __len);
};

// murmur2
template <class _Size>
_Size
__murmur2_or_cityhash<_Size, 32>::operator()(const void* __key, _Size __len)
{
    const _Size __m = 0x5bd1e995;
    const _Size __r = 24;
    _Size __h = __len;
    const unsigned char* __data = static_cast<const unsigned char*>(__key);
    for (; __len >= 4; __data += 4, __len -= 4)
    {
        _Size __k = __loadword<_Size>(__data);
        __k *= __m;
        __k ^= __k >> __r;
        __k *= __m;
        __h *= __m;
        __h ^= __k;
    }
    switch (__len)
    {
    case 3:
        __h ^= __data[2] << 16;
    case 2:
        __h ^= __data[1] << 8;
    case 1:
        __h ^= __data[0];
        __h *= __m;
    }
    __h ^= __h >> 13;
    __h *= __m;
    __h ^= __h >> 15;
    return __h;
}

template <class _Size>
struct __murmur2_or_cityhash<_Size, 64>
{
    _Size operator()(const void* __key, _Size __len);

 private:
  // Some primes between 2^63 and 2^64.
  static const _Size __k0 = 0xc3a5c85c97cb3127ULL;
  static const _Size __k1 = 0xb492b66fbe98f273ULL;
  static const _Size __k2 = 0x9ae16a3b2f90404fULL;
  static const _Size __k3 = 0xc949d7c7509e6557ULL;

  static _Size __rotate(_Size __val, int __shift) {
    return __shift == 0 ? __val : ((__val >> __shift) | (__val << (64 - __shift)));
  }

  static _Size __rotate_by_at_least_1(_Size __val, int __shift) {
    return (__val >> __shift) | (__val << (64 - __shift));
  }

  static _Size __shift_mix(_Size __val) {
    return __val ^ (__val >> 47);
  }

  static _Size __hash_len_16(_Size __u, _Size __v) {
    const _Size __mul = 0x9ddfea08eb382d69ULL;
    _Size __a = (__u ^ __v) * __mul;
    __a ^= (__a >> 47);
    _Size __b = (__v ^ __a) * __mul;
    __b ^= (__b >> 47);
    __b *= __mul;
    return __b;
  }

  static _Size __hash_len_0_to_16(const char* __s, _Size __len) {
    if (__len > 8) {
      const _Size __a = __loadword<_Size>(__s);
      const _Size __b = __loadword<_Size>(__s + __len - 8);
      return __hash_len_16(__a, __rotate_by_at_least_1(__b + __len, __len)) ^ __b;
    }
    if (__len >= 4) {
      const uint32_t __a = __loadword<uint32_t>(__s);
      const uint32_t __b = __loadword<uint32_t>(__s + __len - 4);
      return __hash_len_16(__len + (__a << 3), __b);
    }
    if (__len > 0) {
      const unsigned char __a = __s[0];
      const unsigned char __b = __s[__len >> 1];
      const unsigned char __c = __s[__len - 1];
      const uint32_t __y = static_cast<uint32_t>(__a) +
                           (static_cast<uint32_t>(__b) << 8);
      const uint32_t __z = __len + (static_cast<uint32_t>(__c) << 2);
      return __shift_mix(__y * __k2 ^ __z * __k3) * __k2;
    }
    return __k2;
  }

  static _Size __hash_len_17_to_32(const char *__s, _Size __len) {
    const _Size __a = __loadword<_Size>(__s) * __k1;
    const _Size __b = __loadword<_Size>(__s + 8);
    const _Size __c = __loadword<_Size>(__s + __len - 8) * __k2;
    const _Size __d = __loadword<_Size>(__s + __len - 16) * __k0;
    return __hash_len_16(__rotate(__a - __b, 43) + __rotate(__c, 30) + __d,
                         __a + __rotate(__b ^ __k3, 20) - __c + __len);
  }

  // Return a 16-byte hash for 48 bytes.  Quick and dirty.
  // Callers do best to use "random-looking" values for a and b.
  static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
      _Size __w, _Size __x, _Size __y, _Size __z, _Size __a, _Size __b) {
    __a += __w;
    __b = __rotate(__b + __a + __z, 21);
    const _Size __c = __a;
    __a += __x;
    __a += __y;
    __b += __rotate(__a, 44);
    return pair<_Size, _Size>(__a + __z, __b + __c);
  }

  // Return a 16-byte hash for s[0] ... s[31], a, and b.  Quick and dirty.
  static pair<_Size, _Size> __weak_hash_len_32_with_seeds(
      const char* __s, _Size __a, _Size __b) {
    return __weak_hash_len_32_with_seeds(__loadword<_Size>(__s),
                                         __loadword<_Size>(__s + 8),
                                         __loadword<_Size>(__s + 16),
                                         __loadword<_Size>(__s + 24),
                                         __a,
                                         __b);
  }

  // Return an 8-byte hash for 33 to 64 bytes.
  static _Size __hash_len_33_to_64(const char *__s, size_t __len) {
    _Size __z = __loadword<_Size>(__s + 24);
    _Size __a = __loadword<_Size>(__s) +
                (__len + __loadword<_Size>(__s + __len - 16)) * __k0;
    _Size __b = __rotate(__a + __z, 52);
    _Size __c = __rotate(__a, 37);
    __a += __loadword<_Size>(__s + 8);
    __c += __rotate(__a, 7);
    __a += __loadword<_Size>(__s + 16);
    _Size __vf = __a + __z;
    _Size __vs = __b + __rotate(__a, 31) + __c;
    __a = __loadword<_Size>(__s + 16) + __loadword<_Size>(__s + __len - 32);
    __z += __loadword<_Size>(__s + __len - 8);
    __b = __rotate(__a + __z, 52);
    __c = __rotate(__a, 37);
    __a += __loadword<_Size>(__s + __len - 24);
    __c += __rotate(__a, 7);
    __a += __loadword<_Size>(__s + __len - 16);
    _Size __wf = __a + __z;
    _Size __ws = __b + __rotate(__a, 31) + __c;
    _Size __r = __shift_mix((__vf + __ws) * __k2 + (__wf + __vs) * __k0);
    return __shift_mix(__r * __k0 + __vs) * __k2;
  }
};

// cityhash64
template <class _Size>
_Size
__murmur2_or_cityhash<_Size, 64>::operator()(const void* __key, _Size __len)
{
  const char* __s = static_cast<const char*>(__key);
  if (__len <= 32) {
    if (__len <= 16) {
      return __hash_len_0_to_16(__s, __len);
    } else {
      return __hash_len_17_to_32(__s, __len);
    }
  } else if (__len <= 64) {
    return __hash_len_33_to_64(__s, __len);
  }

  // For strings over 64 bytes we hash the end first, and then as we
  // loop we keep 56 bytes of state: v, w, x, y, and z.
  _Size __x = __loadword<_Size>(__s + __len - 40);
  _Size __y = __loadword<_Size>(__s + __len - 16) +
              __loadword<_Size>(__s + __len - 56);
  _Size __z = __hash_len_16(__loadword<_Size>(__s + __len - 48) + __len,
                          __loadword<_Size>(__s + __len - 24));
  pair<_Size, _Size> __v = __weak_hash_len_32_with_seeds(__s + __len - 64, __len, __z);
  pair<_Size, _Size> __w = __weak_hash_len_32_with_seeds(__s + __len - 32, __y + __k1, __x);
  __x = __x * __k1 + __loadword<_Size>(__s);

  // Decrease len to the nearest multiple of 64, and operate on 64-byte chunks.
  __len = (__len - 1) & ~static_cast<_Size>(63);
  do {
    __x = __rotate(__x + __y + __v.first + __loadword<_Size>(__s + 8), 37) * __k1;
    __y = __rotate(__y + __v.second + __loadword<_Size>(__s + 48), 42) * __k1;
    __x ^= __w.second;
    __y += __v.first + __loadword<_Size>(__s + 40);
    __z = __rotate(__z + __w.first, 33) * __k1;
    __v = __weak_hash_len_32_with_seeds(__s, __v.second * __k1, __x + __w.first);
    __w = __weak_hash_len_32_with_seeds(__s + 32, __z + __w.second,
                                        __y + __loadword<_Size>(__s + 16));
    std::swap(__z, __x);
    __s += 64;
    __len -= 64;
  } while (__len != 0);
  return __hash_len_16(
      __hash_len_16(__v.first, __w.first) + __shift_mix(__y) * __k1 + __z,
      __hash_len_16(__v.second, __w.second) + __x);
}

template <class _Tp, size_t = sizeof(_Tp) / sizeof(size_t)>
struct __scalar_hash;

template <class _Tp>
struct __scalar_hash<_Tp, 0>
    : public unary_function<_Tp, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(_Tp __v) const _NOEXCEPT
    {
        union
        {
            _Tp    __t;
            size_t __a;
        } __u;
        __u.__a = 0;
        __u.__t = __v;
        return __u.__a;
    }
};

template <class _Tp>
struct __scalar_hash<_Tp, 1>
    : public unary_function<_Tp, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(_Tp __v) const _NOEXCEPT
    {
        union
        {
            _Tp    __t;
            size_t __a;
        } __u;
        __u.__t = __v;
        return __u.__a;
    }
};

template <class _Tp>
struct __scalar_hash<_Tp, 2>
    : public unary_function<_Tp, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(_Tp __v) const _NOEXCEPT
    {
        union
        {
            _Tp __t;
            struct
            {
                size_t __a;
                size_t __b;
            };
        } __u;
        __u.__t = __v;
        return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
    }
};

template <class _Tp>
struct __scalar_hash<_Tp, 3>
    : public unary_function<_Tp, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(_Tp __v) const _NOEXCEPT
    {
        union
        {
            _Tp __t;
            struct
            {
                size_t __a;
                size_t __b;
                size_t __c;
            };
        } __u;
        __u.__t = __v;
        return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
    }
};

template <class _Tp>
struct __scalar_hash<_Tp, 4>
    : public unary_function<_Tp, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(_Tp __v) const _NOEXCEPT
    {
        union
        {
            _Tp __t;
            struct
            {
                size_t __a;
                size_t __b;
                size_t __c;
                size_t __d;
            };
        } __u;
        __u.__t = __v;
        return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
    }
};

template<class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY hash<_Tp*>
    : public unary_function<_Tp*, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(_Tp* __v) const _NOEXCEPT
    {
        union
        {
            _Tp* __t;
            size_t __a;
        } __u;
        __u.__t = __v;
        return __murmur2_or_cityhash<size_t>()(&__u, sizeof(__u));
    }
};

template <class _Tp, class _Dp>
struct _LIBCPP_TYPE_VIS_ONLY hash<unique_ptr<_Tp, _Dp> >
{
    typedef unique_ptr<_Tp, _Dp> argument_type;
    typedef size_t               result_type;
    _LIBCPP_INLINE_VISIBILITY
    result_type operator()(const argument_type& __ptr) const _NOEXCEPT
    {
        typedef typename argument_type::pointer pointer;
        return hash<pointer>()(__ptr.get());
    }
};

struct __destruct_n
{
private:
    size_t size;

    template <class _Tp>
    _LIBCPP_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT
        {for (size_t __i = 0; __i < size; ++__i, ++__p) __p->~_Tp();}

    template <class _Tp>
    _LIBCPP_INLINE_VISIBILITY void __process(_Tp*, true_type) _NOEXCEPT
        {}

    _LIBCPP_INLINE_VISIBILITY void __incr(false_type) _NOEXCEPT
        {++size;}
    _LIBCPP_INLINE_VISIBILITY void __incr(true_type) _NOEXCEPT
        {}

    _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, false_type) _NOEXCEPT
        {size = __s;}
    _LIBCPP_INLINE_VISIBILITY void __set(size_t, true_type) _NOEXCEPT
        {}
public:
    _LIBCPP_INLINE_VISIBILITY explicit __destruct_n(size_t __s) _NOEXCEPT
        : size(__s) {}

    template <class _Tp>
    _LIBCPP_INLINE_VISIBILITY void __incr(_Tp*) _NOEXCEPT
        {__incr(integral_constant<bool, is_trivially_destructible<_Tp>::value>());}

    template <class _Tp>
    _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, _Tp*) _NOEXCEPT
        {__set(__s, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}

    template <class _Tp>
    _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) _NOEXCEPT
        {__process(__p, integral_constant<bool, is_trivially_destructible<_Tp>::value>());}
};

template <class _Alloc>
class __allocator_destructor
{
    typedef allocator_traits<_Alloc> __alloc_traits;
public:
    typedef typename __alloc_traits::pointer pointer;
    typedef typename __alloc_traits::size_type size_type;
private:
    _Alloc& __alloc_;
    size_type __s_;
public:
    _LIBCPP_INLINE_VISIBILITY __allocator_destructor(_Alloc& __a, size_type __s)
             _NOEXCEPT
        : __alloc_(__a), __s_(__s) {}
    _LIBCPP_INLINE_VISIBILITY
    void operator()(pointer __p) _NOEXCEPT
        {__alloc_traits::deallocate(__alloc_, __p, __s_);}
};

template <class _InputIterator, class _ForwardIterator>
_ForwardIterator
uninitialized_copy(_InputIterator __f, _InputIterator __l, _ForwardIterator __r)
{
    typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
#ifndef _LIBCPP_NO_EXCEPTIONS
    _ForwardIterator __s = __r;
    try
    {
#endif
# 3485 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
        for (; __f != __l; ++__f, ++__r)
            ::new(&*__r) value_type(*__f);
#ifndef _LIBCPP_NO_EXCEPTIONS
    }
    catch (...)
    {
        for (; __s != __r; ++__s)
            __s->~value_type();
        throw;
    }
#endif
# 3496 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    return __r;
}

template <class _InputIterator, class _Size, class _ForwardIterator>
_ForwardIterator
uninitialized_copy_n(_InputIterator __f, _Size __n, _ForwardIterator __r)
{
    typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
#ifndef _LIBCPP_NO_EXCEPTIONS
    _ForwardIterator __s = __r;
    try
    {
#endif
# 3509 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
        for (; __n > 0; ++__f, ++__r, --__n)
            ::new(&*__r) value_type(*__f);
#ifndef _LIBCPP_NO_EXCEPTIONS
    }
    catch (...)
    {
        for (; __s != __r; ++__s)
            __s->~value_type();
        throw;
    }
#endif
# 3520 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    return __r;
}





class _LIBCPP_EXCEPTION_ABI bad_weak_ptr
    : public std::exception
{
public:
    virtual ~bad_weak_ptr() _NOEXCEPT;
    virtual const char* what() const  _NOEXCEPT;
};

template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY weak_ptr;

class _LIBCPP_TYPE_VIS __shared_count
{
    ;
    ;

protected:
    long __shared_owners_;
    virtual ~__shared_count();
private:
    ;

public:
    _LIBCPP_INLINE_VISIBILITY
    explicit __shared_count(long __refs = 0) _NOEXCEPT
        : __shared_owners_(__refs) {}

    void __add_shared() _NOEXCEPT;
    bool __release_shared() _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY
    long use_count() const _NOEXCEPT {return __shared_owners_ + 1;}
};

class _LIBCPP_TYPE_VIS __shared_weak_count
    : private __shared_count
{
    long __shared_weak_owners_;

public:
    _LIBCPP_INLINE_VISIBILITY
    explicit __shared_weak_count(long __refs = 0) _NOEXCEPT
        : __shared_count(__refs),
          __shared_weak_owners_(__refs) {}
protected:
    ;

public:
    void __add_shared() _NOEXCEPT;
    void __add_weak() _NOEXCEPT;
    void __release_shared() _NOEXCEPT;
    void __release_weak() _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY
    long use_count() const _NOEXCEPT {return __shared_count::use_count();}
    __shared_weak_count* lock() _NOEXCEPT;

    // Define the function out only if we build static libc++ without RTTI.
    // Otherwise we may break clients who need to compile their projects with
    // -fno-rtti and yet link against a libc++.dylib compiled
    // without -fno-rtti.
#if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
    virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
#endif
# 3631 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
private:
    ;
};

template <class _Tp, class _Dp, class _Alloc>
class __shared_ptr_pointer
    : public __shared_weak_count
{
    __compressed_pair<__compressed_pair<_Tp, _Dp>, _Alloc> __data_;
public:
    _LIBCPP_INLINE_VISIBILITY
    __shared_ptr_pointer(_Tp __p, _Dp __d, _Alloc __a)
        :  __data_(__compressed_pair<_Tp, _Dp>(__p, _VSTD::move(__d)), _VSTD::move(__a)) {}

#ifndef _LIBCPP_NO_RTTI
    virtual const void* __get_deleter(const type_info&) const _NOEXCEPT;
#endif
# 3648 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

private:
    virtual void __on_zero_shared() _NOEXCEPT;
    virtual void __on_zero_shared_weak() _NOEXCEPT;
};

#ifndef _LIBCPP_NO_RTTI

template <class _Tp, class _Dp, class _Alloc>
const void*
__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__get_deleter(const type_info& __t) const _NOEXCEPT
{
    return __t == typeid(_Dp) ? &__data_.first().second() : 0;
}

#endif  // _LIBCPP_NO_RTTI
# 3664 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template <class _Tp, class _Dp, class _Alloc>
void
__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared() _NOEXCEPT
{
    __data_.first().second()(__data_.first().first());
    __data_.first().second().~_Dp();
}

template <class _Tp, class _Dp, class _Alloc>
void
__shared_ptr_pointer<_Tp, _Dp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
{
    typename _Alloc::template rebind<__shared_ptr_pointer>::other __a(__data_.second());
    __data_.second().~_Alloc();
    __a.deallocate(this, 1);
}

template <class _Tp, class _Alloc>
class __shared_ptr_emplace
    : public __shared_weak_count
{
    __compressed_pair<_Alloc, _Tp> __data_;
public:
#ifndef _LIBCPP_HAS_NO_VARIADICS

    _LIBCPP_INLINE_VISIBILITY
    __shared_ptr_emplace(_Alloc __a)
        :  __data_(_VSTD::move(__a)) {}

    template <class ..._Args>
        _LIBCPP_INLINE_VISIBILITY
        __shared_ptr_emplace(_Alloc __a, _Args&& ...__args)
            :  __data_(piecewise_construct, _VSTD::forward_as_tuple(__a),
                   _VSTD::forward_as_tuple(_VSTD::forward<_Args>(__args)...)) {}

#else  // _LIBCPP_HAS_NO_VARIADICS
# 3701 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

        __shared_ptr_emplace(_Alloc __a, _A0& __a0, _A1& __a1, _A2& __a2)
            :  __data_(__a, _Tp(__a0, __a1, __a2)) {}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 3722 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

private:
    virtual void __on_zero_shared() _NOEXCEPT;
    virtual void __on_zero_shared_weak() _NOEXCEPT;
public:
    _LIBCPP_INLINE_VISIBILITY
    _Tp* get() _NOEXCEPT {return &__data_.second();}
};

template <class _Tp, class _Alloc>
void
__shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared() _NOEXCEPT
{
    __data_.second().~_Tp();
}

template <class _Tp, class _Alloc>
void
__shared_ptr_emplace<_Tp, _Alloc>::__on_zero_shared_weak() _NOEXCEPT
{
    typename _Alloc::template rebind<__shared_ptr_emplace>::other __a(__data_.first());
    __data_.first().~_Alloc();
    __a.deallocate(this, 1);
}

template<class _Tp> class _LIBCPP_TYPE_VIS_ONLY enable_shared_from_this;

template<class _Tp>
class _LIBCPP_TYPE_VIS_ONLY shared_ptr
{
public:
    typedef _Tp element_type;
private:
    element_type*      __ptr_;
    __shared_weak_count* __cntrl_;

    struct __nat {int __for_bool_;};
public:
    _LIBCPP_CONSTEXPR shared_ptr() _NOEXCEPT;
    _LIBCPP_CONSTEXPR shared_ptr(nullptr_t) _NOEXCEPT;
    ;
    ;
    ;
    ;
    ;
    template<class _Yp> shared_ptr(const shared_ptr<_Yp>& __r, element_type* __p) _NOEXCEPT;
    shared_ptr(const shared_ptr& __r) _NOEXCEPT;
    template<class _Yp>
        shared_ptr(const shared_ptr<_Yp>& __r,
                   typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat())
                       _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    shared_ptr(shared_ptr&& __r) _NOEXCEPT;
    template<class _Yp> shared_ptr(shared_ptr<_Yp>&& __r,
                   typename enable_if<is_convertible<_Yp*, _Tp*>::value, __nat>::type = __nat())
                       _NOEXCEPT;
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 3797 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template<class _Yp,
             class = typename enable_if
                     <
                        is_convertible<_Yp*, element_type*>::value
                     >::type
            >
        shared_ptr(auto_ptr<_Yp>&& __r);
#else
# 3808 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    ;
#endif
# 3816 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template <class _Yp, class _Dp,
                 class = typename enable_if
                 <
                    !is_array<_Yp>::value &&
                    is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value
                 >::type
             >
       shared_ptr(unique_ptr<_Yp, _Dp>&&,
       typename enable_if<!is_lvalue_reference<_Dp>::value, __nat>::type = __nat());
    template <class _Yp, class _Dp,
                 class = typename enable_if
                 <
                    !is_array<_Yp>::value &&
                    is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value
                 >::type
             >
       shared_ptr(unique_ptr<_Yp, _Dp>&&,
       typename enable_if<is_lvalue_reference<_Dp>::value, __nat>::type = __nat());
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 3836 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    ;
    ;
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 3854 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    ~shared_ptr();

    shared_ptr& operator=(const shared_ptr& __r) _NOEXCEPT;
    template<class _Yp>
        typename enable_if
        <
            is_convertible<_Yp*, element_type*>::value,
            shared_ptr&
        >::type
        operator=(const shared_ptr<_Yp>& __r) _NOEXCEPT;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    shared_ptr& operator=(shared_ptr&& __r) _NOEXCEPT;
    template<class _Yp>
        typename enable_if
        <
            is_convertible<_Yp*, element_type*>::value,
            shared_ptr<_Tp>&
        >::type
        operator=(shared_ptr<_Yp>&& __r);
    template<class _Yp>
        typename enable_if
        <
            !is_array<_Yp>::value &&
            is_convertible<_Yp*, element_type*>::value,
            shared_ptr
        >::type&
        operator=(auto_ptr<_Yp>&& __r);
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 3883 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    template<class _Yp>
        typename enable_if
        <
            !is_array<_Yp>::value &&
            is_convertible<_Yp*, element_type*>::value,
            shared_ptr&
        >::type
        operator=(auto_ptr<_Yp> __r);
#endif
# 3892 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
    template <class _Yp, class _Dp>
        typename enable_if
        <
            !is_array<_Yp>::value &&
            is_convertible<typename unique_ptr<_Yp, _Dp>::pointer, element_type*>::value,
            shared_ptr&
        >::type
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
        operator=(unique_ptr<_Yp, _Dp>&& __r);
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 3902 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
        operator=(unique_ptr<_Yp, _Dp> __r);
#endif
# 3904 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    void swap(shared_ptr& __r) _NOEXCEPT;
    void reset() _NOEXCEPT;
    template<class _Yp>
        typename enable_if
        <
            is_convertible<_Yp*, element_type*>::value,
            void
        >::type
        reset(_Yp* __p);
    ;
    ;

    _LIBCPP_INLINE_VISIBILITY
    element_type* get() const _NOEXCEPT {return __ptr_;}
    _LIBCPP_INLINE_VISIBILITY
    typename add_lvalue_reference<element_type>::type operator*() const _NOEXCEPT
        {return *__ptr_;}
    _LIBCPP_INLINE_VISIBILITY
    element_type* operator->() const _NOEXCEPT {return __ptr_;}
    _LIBCPP_INLINE_VISIBILITY
    long use_count() const _NOEXCEPT {return __cntrl_ ? __cntrl_->use_count() : 0;}
    _LIBCPP_INLINE_VISIBILITY
    bool unique() const _NOEXCEPT {return use_count() == 1;}
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return get() != 0;}
    template <class _Up>
        _LIBCPP_INLINE_VISIBILITY
        bool owner_before(shared_ptr<_Up> const& __p) const
        {return __cntrl_ < __p.__cntrl_;}
    template <class _Up>
        _LIBCPP_INLINE_VISIBILITY
        bool owner_before(weak_ptr<_Up> const& __p) const
        {return __cntrl_ < __p.__cntrl_;}
    _LIBCPP_INLINE_VISIBILITY
    bool
    __owner_equivalent(const shared_ptr& __p) const
        {return __cntrl_ == __p.__cntrl_;}

#ifndef _LIBCPP_NO_RTTI
    template <class _Dp>
        _LIBCPP_INLINE_VISIBILITY
        _Dp* __get_deleter() const _NOEXCEPT
            {return (_Dp*)(__cntrl_ ? __cntrl_->__get_deleter(typeid(_Dp)) : 0);}
#endif  // _LIBCPP_NO_RTTI
# 3961 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

#ifndef _LIBCPP_HAS_NO_VARIADICS

    template<class ..._Args>
        static
        shared_ptr<_Tp>
        make_shared(_Args&& ...__args);

    template<class _Alloc, class ..._Args>
        static
        shared_ptr<_Tp>
        allocate_shared(const _Alloc& __a, _Args&& ...__args);

#else  // _LIBCPP_HAS_NO_VARIADICS
# 3975 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

    ;

    ;

    ;

    ;

    ;

    ;

    ;

    ;

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 4004 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

private:

    template <class _Yp>
        _LIBCPP_INLINE_VISIBILITY
        void
        __enable_weak_this(const enable_shared_from_this<_Yp>* __e) _NOEXCEPT
        {
            if (__e)
                __e->__weak_this_ = *this;
        }

    _LIBCPP_INLINE_VISIBILITY
    void __enable_weak_this(const void*) _NOEXCEPT {}

    template <class _Up> friend class _LIBCPP_TYPE_VIS_ONLY shared_ptr;
    template <class _Up> friend class _LIBCPP_TYPE_VIS_ONLY weak_ptr;
};

template<class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
shared_ptr<_Tp>::shared_ptr() _NOEXCEPT
    : __ptr_(0),
      __cntrl_(0)
{
}

template<class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
shared_ptr<_Tp>::shared_ptr(nullptr_t) _NOEXCEPT
    : __ptr_(0),
      __cntrl_(0)
{
}











template<class _Tp>
template<class _Yp>
inline _LIBCPP_INLINE_VISIBILITY
shared_ptr<_Tp>::shared_ptr(const shared_ptr<_Yp>& __r, element_type *__p) _NOEXCEPT
    : __ptr_(__p),
      __cntrl_(__r.__cntrl_)
{
    if (__cntrl_)
        __cntrl_->__add_shared();
}

template<class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
shared_ptr<_Tp>::shared_ptr(const shared_ptr& __r) _NOEXCEPT
    : __ptr_(__r.__ptr_),
      __cntrl_(__r.__cntrl_)
{
    if (__cntrl_)
        __cntrl_->__add_shared();
}

#ifndef _LIBCPP_HAS_NO_VARIADICS

template<class _Tp>
template<class ..._Args>
shared_ptr<_Tp>
shared_ptr<_Tp>::make_shared(_Args&& ...__args)
{
    typedef __shared_ptr_emplace<_Tp, allocator<_Tp> > _CntrlBlk;
    typedef allocator<_CntrlBlk> _A2;
    typedef __allocator_destructor<_A2> _D2;
    _A2 __a2;
    unique_ptr<_CntrlBlk, _D2> __hold2(__a2.allocate(1), _D2(__a2, 1));
    ::new(__hold2.get()) _CntrlBlk(__a2, _VSTD::forward<_Args>(__args)...);
    shared_ptr<_Tp> __r;
    __r.__ptr_ = __hold2.get()->get();
    __r.__cntrl_ = __hold2.release();
    __r.__ptr_ = __hold2.get()->get();
    __r.__cntrl_ = __hold2.release();
    __r.__enable_weak_this(__r.__ptr_);
    return __r;
}

#else  // _LIBCPP_HAS_NO_VARIADICS
# 4298 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

















#endif  // _LIBCPP_HAS_NO_VARIADICS

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template<class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
shared_ptr<_Tp>&
shared_ptr<_Tp>::operator=(shared_ptr&& __r) _NOEXCEPT
{
    shared_ptr(_VSTD::move(__r)).swap(*this);
    return *this;
}

template<class _Tp>
template<class _Yp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_convertible<_Yp*, _Tp*>::value,
    shared_ptr<_Tp>&
>::type
shared_ptr<_Tp>::operator=(shared_ptr<_Yp>&& __r)
{
}

#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 4530 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

template<class _Tp>
template<class _Yp>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    !is_array<_Yp>::value &&
    is_convertible<_Yp*, _Tp*>::value,
    shared_ptr<_Tp>&
>::type
shared_ptr<_Tp>::operator=(auto_ptr<_Yp> __r)
{
    shared_ptr(__r).swap(*this);
    return *this;
}

template<class _Tp>

#endif  // __has_feature(cxx_atomic)
# 5392 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3

//enum class
struct _LIBCPP_TYPE_VIS pointer_safety
{
    enum __lx
    {
        relaxed,
        preferred,
        strict
    };

    __lx __v_;

    _LIBCPP_INLINE_VISIBILITY
    pointer_safety(__lx __v) : __v_(__v) {}
    _LIBCPP_INLINE_VISIBILITY
    operator int() const {return __v_;}
};

_LIBCPP_FUNC_VIS void declare_reachable(void* __p);
_LIBCPP_FUNC_VIS void declare_no_pointers(char* __p, size_t __n);
_LIBCPP_FUNC_VIS void undeclare_no_pointers(char* __p, size_t __n);
_LIBCPP_FUNC_VIS pointer_safety get_pointer_safety() _NOEXCEPT;
_LIBCPP_FUNC_VIS void* __undeclare_reachable(void* __p);



_LIBCPP_FUNC_VIS void* align(size_t __align, size_t __sz, void*& __ptr, size_t& __space);

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_MEMORY
# 5430 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory" 3
# 628 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <iterator>
#endif /* expanded by -frewrite-includes */
# 629 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
#if 0 /* expanded by -frewrite-includes */
#include <cstddef>
#endif /* expanded by -frewrite-includes */
# 630 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3

#if defined(__IBMCPP__)
#if 0 /* expanded by -frewrite-includes */
#include "support/ibm/support.h"
#endif /* expanded by -frewrite-includes */
# 633 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
#endif
# 634 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
#if 0 /* expanded by -frewrite-includes */
#include "support/win32/support.h"
#endif /* expanded by -frewrite-includes */
# 636 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
#endif
#ifdef min
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro min is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing min")
#else
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro min is incompatible with C++.  #undefing min
#endif
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef min
#endif
# 20 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3

#ifdef max
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro max is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing max")
#else
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro max is incompatible with C++.  #undefing max
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
#endif
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 639 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 642 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
#endif
# 643 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _T1, class _T2 = _T1>
struct __equal_to
{
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}
};

template <class _T1>
struct __equal_to<_T1, _T1>
{
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
};

template <class _T1>
struct __equal_to<const _T1, _T1>
{
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
};

template <class _T1>
struct __equal_to<_T1, const _T1>
{
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
};

template <class _T1, class _T2 = _T1>
struct __less
{
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;}
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;}
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;}
};

template <class _T1>
struct __less<_T1, _T1>
{
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
};

template <class _T1>
struct __less<const _T1, _T1>
{
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
};

template <class _T1>
struct __less<_T1, const _T1>
{
    _LIBCPP_INLINE_VISIBILITY bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
};

template <class _Predicate>
class __negate
{
private:
    _Predicate __p_;
public:
    _LIBCPP_INLINE_VISIBILITY __negate() {}

    _LIBCPP_INLINE_VISIBILITY
    explicit __negate(_Predicate __p) : __p_(__p) {}

    template <class _T1>
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _T1& __x) {return !__p_(__x);}

    template <class _T1, class _T2>
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _T1& __x, const _T2& __y) {return !__p_(__x, __y);}
};

#ifdef _LIBCPP_DEBUG
#endif  // _LIBCPP_DEBUG
# 738 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3

// Precondition:  __x != 0
inline _LIBCPP_INLINE_VISIBILITY
unsigned
__ctz(unsigned __x)
{
    return static_cast<unsigned>(__builtin_ctz(__x));
}





// Precondition:  __x != 0


inline _LIBCPP_INLINE_VISIBILITY
unsigned long
__clz(unsigned long __x)
{
    return static_cast<unsigned long>(__builtin_clzl (__x));
}



inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned           __x) {return __builtin_popcount  (__x);}



// all_of

template <class _InputIterator, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_InputIterator
find(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
{
    for (; __first != __last; ++__first)
        if (*__first == __value_)
            break;
    return __first;
}

// find_if



// find_if_not



// find_end

template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
_ForwardIterator1
__find_end(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
           _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,
           forward_iterator_tag, forward_iterator_tag)
{
    // modeled after search algorithm
    _ForwardIterator1 __r = __last1;  // __last1 is the "default" answer
    if (__first2 == __last2)
        return __r;
    while (true)
    {
        while (true)
        {
            if (__first1 == __last1)         // if source exhausted return last correct answer
                return __r;                  //    (or __last1 if never found)
            if (__pred(*__first1, *__first2))
                break;
            ++__first1;
        }
        // *__first1 matches *__first2, now match elements after here
        _ForwardIterator1 __m1 = __first1;
        _ForwardIterator2 __m2 = __first2;
        while (true)
        {
            if (++__m2 == __last2)
            {                         // Pattern exhaused, record answer and search for another one
                __r = __first1;
                ++__first1;
                break;
            }
            if (++__m1 == __last1)     // Source exhausted, return last answer
                return __r;
            if (!__pred(*__m1, *__m2))  // mismatch, restart with a new __first
            {
                ++__first1;
                break;
            }  // else there is a match, check next elements
        }
    }
}



// find_first_of

template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
_ForwardIterator1
find_first_of(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
              _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
{
    for (; __first1 != __last1; ++__first1)
        for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
            if (__pred(*__first1, *__j))
                return __first1;
    return __last1;
}



// adjacent_find

template <class _ForwardIterator, class _BinaryPredicate>
inline _LIBCPP_INLINE_VISIBILITY
_ForwardIterator
adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
{
    if (__first != __last)
    {
        _ForwardIterator __i = __first;
        while (++__i != __last)
        {
            if (__pred(*__first, *__i))
                return __first;
            __first = __i;
        }
    }
    return __last;
}



// count

template <class _InputIterator, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
typename iterator_traits<_InputIterator>::difference_type
count(_InputIterator __first, _InputIterator __last, const _Tp& __value_)
{
    typename iterator_traits<_InputIterator>::difference_type __r(0);
    for (; __first != __last; ++__first)
        if (*__first == __value_)
            ++__r;
    return __r;
}

// count_if



// mismatch

template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
inline _LIBCPP_INLINE_VISIBILITY
pair<_InputIterator1, _InputIterator2>
mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
         _InputIterator2 __first2, _BinaryPredicate __pred)
{
    for (; __first1 != __last1; ++__first1, ++__first2)
        if (!__pred(*__first1, *__first2))
            break;
    return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
}



#if _LIBCPP_STD_VER > 11
template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
inline _LIBCPP_INLINE_VISIBILITY
pair<_InputIterator1, _InputIterator2>
mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
         _InputIterator2 __first2, _InputIterator2 __last2,
    return _VSTD::mismatch(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>());
}
#endif
# 1155 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3

// equal

template <class _InputIterator1, class _InputIterator2, class _BinaryPredicate>
inline _LIBCPP_INLINE_VISIBILITY
bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _BinaryPredicate __pred)
{
    for (; __first1 != __last1; ++__first1, ++__first2)
        if (!__pred(*__first1, *__first2))
            return false;
    return true;
}



#if _LIBCPP_STD_VER > 11
template <class _BinaryPredicate, class _InputIterator1, class _InputIterator2>
inline _LIBCPP_INLINE_VISIBILITY
bool
__equal(_InputIterator1 __first1, _InputIterator1 __last1, 
        typename iterator_traits<_InputIterator1>::iterator_category(),
        typename iterator_traits<_InputIterator2>::iterator_category());
}

template <class _InputIterator1, class _InputIterator2>
inline _LIBCPP_INLINE_VISIBILITY
bool
equal(_InputIterator1 __first1, _InputIterator1 __last1, 
      _InputIterator2 __first2, _InputIterator2 __last2)
{
    typedef typename iterator_traits<_InputIterator1>::value_type __v1;
    typedef typename iterator_traits<_InputIterator2>::value_type __v2;
    return _VSTD::__equal(__first1, __last1, __first2, __last2, __equal_to<__v1, __v2>(),
        typename iterator_traits<_InputIterator1>::iterator_category(),
        typename iterator_traits<_InputIterator2>::iterator_category());
}
#endif
# 1232 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3

// is_permutation

template<class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
bool
is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
               _ForwardIterator2 __first2, _BinaryPredicate __pred)
{
    // shorten sequences as much as possible by lopping of any equal parts
    for (; __first1 != __last1; ++__first1, ++__first2)
        if (!__pred(*__first1, *__first2))
            goto __not_done;
    return true;
__not_done:
    // __first1 != __last1 && *__first1 != *__first2
    typedef typename iterator_traits<_ForwardIterator1>::difference_type _D1;
    _D1 __l1 = _VSTD::distance(__first1, __last1);
    if (__l1 == _D1(1))
        return false;
    _ForwardIterator2 __last2 = _VSTD::next(__first2, __l1);
    // For each element in [f1, l1) see if there are the same number of
    //    equal elements in [f2, l2)
    for (_ForwardIterator1 __i = __first1; __i != __last1; ++__i)
    {
        // Have we already counted the number of *__i in [f1, l1)?
        for (_ForwardIterator1 __j = __first1; __j != __i; ++__j)
            if (__pred(*__j, *__i))
                goto __next_iter;
        {
            // Count number of *__i in [f2, l2)
            _D1 __c2 = 0;
            for (_ForwardIterator2 __j = __first2; __j != __last2; ++__j)
                if (__pred(*__i, *__j))
                    ++__c2;
            if (__c2 == 0)
                return false;
            // Count number of *__i in [__i, l1) (we can start with 1)
            _D1 __c1 = 1;
            for (_ForwardIterator1 __j = _VSTD::next(__i); __j != __last1; ++__j)
                if (__pred(*__i, *__j))
                    ++__c1;
            if (__c1 != __c2)
                return false;
        }
__next_iter:;
    }
    return true;
}



#if _LIBCPP_STD_VER > 11
template<class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
    typedef typename iterator_traits<_ForwardIterator2>::difference_type _D2;
    _D2 __l2 = _VSTD::distance(__first2, __last2);
    if (__l1 != __l2)
        return false;

    // For each element in [f1, l1) see if there are the same number of
    typedef typename iterator_traits<_ForwardIterator2>::value_type __v2;
    return _VSTD::__is_permutation(__first1, __last1, __first2, __last2,
        __equal_to<__v1, __v2>(),
        typename iterator_traits<_ForwardIterator1>::iterator_category(),
        typename iterator_traits<_ForwardIterator2>::iterator_category());
}
#endif
# 1385 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3

// search

template <class _BinaryPredicate, class _ForwardIterator1, class _ForwardIterator2>
_ForwardIterator1
__search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
         _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred,
         forward_iterator_tag, forward_iterator_tag)
{
    if (__first2 == __last2)
        return __first1;  // Everything matches an empty sequence
    while (true)
    {
        // Find first element in sequence 1 that matchs *__first2, with a mininum of loop checks
        while (true)
        {
            if (__first1 == __last1)  // return __last1 if no element matches *__first2
                return __last1;
            if (__pred(*__first1, *__first2))
                break;
            ++__first1;
        }
        // *__first1 matches *__first2, now match elements after here
        _ForwardIterator1 __m1 = __first1;
        _ForwardIterator2 __m2 = __first2;
        while (true)
        {
            if (++__m2 == __last2)  // If pattern exhausted, __first1 is the answer (works for 1 element pattern)
                return __first1;
            if (++__m1 == __last1)  // Otherwise if source exhaused, pattern not found
                return __last1;
            if (!__pred(*__m1, *__m2))  // if there is a mismatch, restart with a new __first1
            {
                ++__first1;
                break;
            }  // else there is a match, check next elements
        }
    }
}



template <class _ForwardIterator1, class _ForwardIterator2, class _BinaryPredicate>
inline _LIBCPP_INLINE_VISIBILITY
_ForwardIterator1
search(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
       _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred)
{
    return _VSTD::__search<typename add_lvalue_reference<_BinaryPredicate>::type>
                         (__first1, __last1, __first2, __last2, __pred,
                          typename std::iterator_traits<_ForwardIterator1>::iterator_category(),
                          typename std::iterator_traits<_ForwardIterator2>::iterator_category());
}



// search_n

template <class _BinaryPredicate, class _ForwardIterator, class _Size, class _Tp>
_ForwardIterator
__search_n(_ForwardIterator __first, _ForwardIterator __last,
           _Size __count, const _Tp& __value_, _BinaryPredicate __pred, forward_iterator_tag)
{
    if (__count <= 0)
        return __first;
    while (true)
    {
        // Find first element in sequence that matchs __value_, with a mininum of loop checks
        while (true)
        {
            if (__first == __last)  // return __last if no element matches __value_
                return __last;
            if (__pred(*__first, __value_))
                break;
            ++__first;
        }
        // *__first matches __value_, now match elements after here
        _ForwardIterator __m = __first;
        _Size __c(0);
        while (true)
        {
            if (++__c == __count)  // If pattern exhausted, __first is the answer (works for 1 element pattern)
                return __first;
            if (++__m == __last)  // Otherwise if source exhaused, pattern not found
                return __last;
            if (!__pred(*__m, __value_))  // if there is a mismatch, restart with a new __first
            {
                __first = __m;
                ++__first;
                break;
            }  // else there is a match, check next elements
        }
    }
}







// copy

template <class _Iter>
struct __libcpp_is_trivial_iterator
{
    static const bool value = is_pointer<_Iter>::value;
};

template <class _Iter>
struct __libcpp_is_trivial_iterator<move_iterator<_Iter> >
{
    static const bool value = is_pointer<_Iter>::value;
};

template <class _Iter>
struct __libcpp_is_trivial_iterator<__wrap_iter<_Iter> >
{
    static const bool value = is_pointer<_Iter>::value;
};

template <class _Iter>
inline _LIBCPP_INLINE_VISIBILITY
_Iter
__unwrap_iter(_Iter __i)
{
    return __i;
}


# 1713 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3

template <class _InputIterator, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY
_OutputIterator
__copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
    for (; __first != __last; ++__first, ++__result)
        *__result = *__first;
    return __result;
}



template <class _InputIterator, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY
_OutputIterator
copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
    return _VSTD::__copy(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
}

// copy_backward

template <class _BidirectionalIterator, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY
_OutputIterator
__copy_backward(_BidirectionalIterator __first, _BidirectionalIterator __last, _OutputIterator __result)
{
    while (__first != __last)
        *--__result = *--__last;
    return __result;
        *__result = _VSTD::move(*__first);
    return __result;
}

template <class _Tp, class _Up>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_same<typename remove_const<_Tp>::type, _Up>::value &&
    is_trivially_copy_assignable<_Up>::value,
    _Up*
>::type
__move(_Tp* __first, _Tp* __last, _Up* __result)
{
    const size_t __n = static_cast<size_t>(__last - __first);
    _VSTD::memmove(__result, __first, __n * sizeof(_Up));
    return __result + __n;
}

template <class _InputIterator, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY
_OutputIterator
move(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
    return _VSTD::__move(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
}

// move_backward

template <class _InputIterator, class _OutputIterator>
inline _LIBCPP_INLINE_VISIBILITY
_OutputIterator
__move_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result)
{
    while (__first != __last)
        *--__result = _VSTD::move(*--__last);
    return __result;
}



template <class _BidirectionalIterator1, class _BidirectionalIterator2>
inline _LIBCPP_INLINE_VISIBILITY
_BidirectionalIterator2
move_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last,
              _BidirectionalIterator2 __result)
{
    return _VSTD::__move_backward(__unwrap_iter(__first), __unwrap_iter(__last), __unwrap_iter(__result));
}

// iter_swap

// moved to <type_traits> for better swap / noexcept support

// transform





// replace



// replace_if



// replace_copy



// replace_copy_if



// fill_n

template <class _OutputIterator, class _Size, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_OutputIterator
__fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
{
    for (; __n > 0; ++__first, --__n)
        *__first = __value_;
    return __first;
}



template <class _OutputIterator, class _Size, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_OutputIterator
fill_n(_OutputIterator __first, _Size __n, const _Tp& __value_)
{
   return _VSTD::__fill_n(__first, __n, __value_);
}

// fill

template <class _ForwardIterator, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
__fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, forward_iterator_tag)
{
    for (; __first != __last; ++__first)
        *__first = __value_;
}



template <class _ForwardIterator, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
void
fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_)
{
    _VSTD::__fill(__first, __last, __value_, typename iterator_traits<_ForwardIterator>::iterator_category());
}

// generate



// generate_n



// remove

template <class _ForwardIterator, class _BinaryPredicate>
_ForwardIterator
unique(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred)
{
    __first = _VSTD::adjacent_find<_ForwardIterator, typename add_lvalue_reference<_BinaryPredicate>::type>
                                 (__first, __last, __pred);
    if (__first != __last)
    {
        // ...  a  a  ?  ...
        //      f     i
        _ForwardIterator __i = __first;
        for (++__i; ++__i != __last;)
            if (!__pred(*__first, *__i))
                *++__first = _VSTD::move(*__i);
        ++__first;
    }
    return __first;
}



// unique_copy

template <class _BinaryPredicate, class _InputIterator, class _OutputIterator>
_OutputIterator
__unique_copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _BinaryPredicate __pred,
              input_iterator_tag, output_iterator_tag)
{
    if (__first != __last)
    {
        typename iterator_traits<_InputIterator>::value_type __t(*__first);
        *__result = __t;
        ++__result;
        while (++__first != __last)
        {
            if (!__pred(__t, *__first))
            {
                __t = *__first;
                *__result = __t;
                ++__result;
            }
        }
    }
    return __result;
}


// reverse

template <class _BidirectionalIterator>
inline _LIBCPP_INLINE_VISIBILITY
void
__reverse(_BidirectionalIterator __first, _BidirectionalIterator __last, bidirectional_iterator_tag)
{
    while (__first != __last)
    {
        if (__first == --__last)
            break;
        swap(*__first, *__last);
        ++__first;
    }
}

template <class _ForwardIterator>
_ForwardIterator
__rotate_left(_ForwardIterator __first, _ForwardIterator __last)
{
    typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
    value_type __tmp = _VSTD::move(*__first);
    _ForwardIterator __lm1 = _VSTD::move(_VSTD::next(__first), __last, __first);
    *__lm1 = _VSTD::move(__tmp);
    return __lm1;
}

template <class _BidirectionalIterator>
_BidirectionalIterator
__rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last)
{
    typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
    _BidirectionalIterator __lm1 = _VSTD::prev(__last);
    value_type __tmp = _VSTD::move(*__lm1);
    _BidirectionalIterator __fp1 = _VSTD::move_backward(__first, __lm1, __last);
    *__first = _VSTD::move(__tmp);
    return __fp1;
}

template <class _ForwardIterator>
_ForwardIterator
__rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
{
    _ForwardIterator __i = __middle;
    while (true)
    {
        swap(*__first, *__i);
        ++__first;
        if (++__i == __last)
            break;
        if (__first == __middle)
            __middle = __i;
    }
    _ForwardIterator __r = __first;
    if (__first != __middle)
    {
        __i = __middle;
        while (true)
        {
            swap(*__first, *__i);
            ++__first;
            if (++__i == __last)
            {
                if (__first == __middle)
                    break;
                __i = __middle;
            }
            else if (__first == __middle)
                __middle = __i;
        }
    }
    return __r;
}

template<typename _Integral>
inline _LIBCPP_INLINE_VISIBILITY
_Integral
__gcd(_Integral __x, _Integral __y)
{
    do
    {
        _Integral __t = __x % __y;
        __x = __y;
        __y = __t;
    } while (__y);
    return __x;
}

template<typename _RandomAccessIterator>
_RandomAccessIterator
__rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last)
{
    typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
    typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;

    const difference_type __m1 = __middle - __first;
    const difference_type __m2 = __last - __middle;
    if (__m1 == __m2)
    {
        _VSTD::swap_ranges(__first, __middle, __middle);
        return __middle;
    }
    const difference_type __g = _VSTD::__gcd(__m1, __m2);
    for (_RandomAccessIterator __p = __first + __g; __p != __first;)
    {
        value_type __t(_VSTD::move(*--__p));
        _RandomAccessIterator __p1 = __p;
        _RandomAccessIterator __p2 = __p1 + __m1;
        do
        {
            *__p1 = _VSTD::move(*__p2);
            __p1 = __p2;
            const difference_type __d = __last - __p2;
            if (__m1 < __d)
                __p2 += __m1;
            else
                __p2 = __first + (__m1 - __d);
        } while (__p2 != __p);
        *__p1 = _VSTD::move(__t);
    }
    return __first + __m2;
}

template <class _ForwardIterator>
inline _LIBCPP_INLINE_VISIBILITY
_ForwardIterator
__rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last,
         _VSTD::forward_iterator_tag)
{
    typedef typename _VSTD::iterator_traits<_ForwardIterator>::value_type value_type;
    if (_VSTD::is_trivially_move_assignable<value_type>::value)
    {
        if (_VSTD::next(__first) == __middle)
            return _VSTD::__rotate_left(__first, __last);
    }
    return _VSTD::__rotate_forward(__first, __middle, __last);
}





template <class _ForwardIterator>
inline _LIBCPP_INLINE_VISIBILITY
_ForwardIterator
rotate(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last)
{
    if (__first == __middle)
        return __last;
    if (__middle == __last)
        return __first;
    return _VSTD::__rotate(__first, __middle, __last,
                           typename _VSTD::iterator_traits<_ForwardIterator>::iterator_category());
}

// rotate_copy



// min_element

template <class _ForwardIterator, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
_ForwardIterator
min_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
    if (__first != __last)
    {
        _ForwardIterator __i = __first;
        while (++__i != __last)
            if (__comp(*__i, *__first))
                __first = __i;
    }
    return __first;
}



// min

template <class _Tp, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
const _Tp&
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
{
    return __comp(__b, __a) ? __b : __a;
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
const _Tp&
min(const _Tp& __a, const _Tp& __b)
{
    return _VSTD::min(__a, __b, __less<_Tp>());
}

#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

template<class _Tp, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
min(initializer_list<_Tp> __t, _Compare __comp)
{
    return *_VSTD::min_element(__t.begin(), __t.end(), __comp);
}

template<class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
_Tp
min(initializer_list<_Tp> __t)
{
    return *_VSTD::min_element(__t.begin(), __t.end());
}

#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 2568 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3

// max_element

template <class _ForwardIterator, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
_ForwardIterator
max_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
    if (__first != __last)
    {
        _ForwardIterator __i = __first;
        while (++__i != __last)
            if (__comp(*__first, *__i))
                __first = __i;
    }
    return __first;
}



// max

template <class _Tp, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
const _Tp&
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
{
    return __comp(__a, __b) ? __b : __a;
}

template <class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
const _Tp&
max(const _Tp& __a, const _Tp& __b)
{
    return _VSTD::max(__a, __b, __less<_Tp>());
}

#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 2632 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3

// minmax_element

template <class _ForwardIterator, class _Compare>
std::pair<_ForwardIterator, _ForwardIterator>
minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp)
{
  std::pair<_ForwardIterator, _ForwardIterator> __result(__first, __first);
  if (__first != __last)
  {
      if (++__first != __last)
      {
          if (__comp(*__first, *__result.first))
              __result.first = __first;
          else
              __result.second = __first;
          while (++__first != __last)
          {
              _ForwardIterator __i = __first;
              if (++__first == __last)
              {
                  if (__comp(*__i, *__result.first))
                      __result.first = __i;
                  else if (!__comp(*__i, *__result.second))
                      __result.second = __i;
                  break;
              }
              else
              {
                  if (__comp(*__first, *__i))
                  {
                      if (__comp(*__first, *__result.first))
                          __result.first = __first;
                      if (!__comp(*__i, *__result.second))
                          __result.second = __i;
                  }
                  else
                  {
                      if (__comp(*__i, *__result.first))
                          __result.first = __i;
                      if (!__comp(*__first, *__result.second))
                          __result.second = __first;
                  }
              }
          }
      }
  }
  return __result;
}







// uniform_int_distribution

template<class _IntType = int>
class uniform_int_distribution
{
public:
    // types
    typedef _IntType result_type;

    class param_type
    {
        result_type __a_;
        result_type __b_;
    public:
        typedef uniform_int_distribution distribution_type;

        

        
        

        
        
    };

private:
    param_type __p_;

public:
    // constructors and reset functions
    
    
    

    // generating functions
    
    ;

    // property functions
    
    

    
    

    
    

    
    
};



class _LIBCPP_TYPE_VIS __rs_default;

_LIBCPP_FUNC_VIS __rs_default __rs_get();

class _LIBCPP_TYPE_VIS __rs_default
{
    static unsigned __c_;

    ;
public:
    typedef uint_fast32_t result_type;

    static const result_type _Min = 0;
    static const result_type _Max = 0xFFFFFFFF;

    ;
    ;

    ;

    
    

    friend _LIBCPP_FUNC_VIS __rs_default __rs_get();
};

_LIBCPP_FUNC_VIS __rs_default __rs_get();





// partition_point



// stable_partition

template <class _Predicate, class _ForwardIterator, class _Distance, class _Pair>
_ForwardIterator
__stable_partition(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred,
                   _Distance __len, _Pair __p, forward_iterator_tag __fit)
{
    // *__first is known to be false
    // __len >= 1
    if (__len == 1)
        return __first;
    if (__len == 2)
    {
        _ForwardIterator __m = __first;
        if (__pred(*++__m))
        {
            swap(*__first, *__m);
            return __m;
        }
        return __first;
    }
    if (__len <= __p.second)
    {   // The buffer is big enough to use
        typedef typename iterator_traits<_ForwardIterator>::value_type value_type;
        __destruct_n __d(0);
        unique_ptr<value_type, __destruct_n&> __h(__p.first, __d);
        // Move the falses into the temporary buffer, and the trues to the front of the line
        // Update __first to always point to the end of the trues
        value_type* __t = __p.first;
        ::new(__t) value_type(_VSTD::move(*__first));
        __d.__incr((value_type*)0);
        ++__t;
        _ForwardIterator __i = __first;
        while (++__i != __last)
        {
            if (__pred(*__i))
            {
                *__first = _VSTD::move(*__i);
                ++__first;
            }
            else
            {
                ::new(__t) value_type(_VSTD::move(*__i));
                __d.__incr((value_type*)0);
                ++__t;
            }
        }
        // All trues now at start of range, all falses in buffer
        // Move falses back into range, but don't mess up __first which points to first false
        __i = __first;
        for (value_type* __t2 = __p.first; __t2 < __t; ++__t2, ++__i)
            *__i = _VSTD::move(*__t2);
        // __h destructs moved-from values out of the temp buffer, but doesn't deallocate buffer
        return __first;
    }
    // Else not enough buffer, do in place
    // __len >= 3
    _ForwardIterator __m = __first;
    _Distance __len2 = __len / 2;  // __len2 >= 2
    _VSTD::advance(__m, __len2);
    // recurse on [__first, __m), *__first know to be false
    // F?????????????????
    // f       m         l
    typedef typename add_lvalue_reference<_Predicate>::type _PredRef;
    _ForwardIterator __first_false = __stable_partition<_PredRef>(__first, __m, __pred, __len2, __p, __fit);
    // TTTFFFFF??????????
    // f  ff   m         l
    // recurse on [__m, __last], except increase __m until *(__m) is false, *__last know to be true
    _ForwardIterator __m1 = __m;
    _ForwardIterator __second_false = __last;
    _Distance __len_half = __len - __len2;
    while (__pred(*__m1))
    {
        if (++__m1 == __last)
            goto __second_half_done;
        --__len_half;
    }
    // TTTFFFFFTTTF??????
    // f  ff   m  m1     l
    __second_false = __stable_partition<_PredRef>(__m1, __last, __pred, __len_half, __p, __fit);
__second_half_done:
    // TTTFFFFFTTTTTFFFFF
    // f  ff   m    sf   l
    return _VSTD::rotate(__first_false, __m, __second_false);
    // TTTTTTTTFFFFFFFFFF
    //         |
}

struct __return_temporary_buffer
{
    template <class _Tp>
    _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __p) const {_VSTD::return_temporary_buffer(__p);}
};









// is_sorted_until





// is_sorted





// sort

// stable, 2-3 compares, 0-2 swaps

template <class _Compare, class _ForwardIterator>
unsigned
__sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z, _Compare __c)
{
    unsigned __r = 0;
    if (!__c(*__y, *__x))          // if x <= y
    {
        if (!__c(*__z, *__y))      // if y <= z
            return __r;            // x <= y && y <= z
                                   // x <= y && y > z
        swap(*__y, *__z);          // x <= z && y < z
        __r = 1;
        if (__c(*__y, *__x))       // if x > y
        {
            swap(*__x, *__y);      // x < y && y <= z
            __r = 2;
        }
        return __r;                // x <= y && y < z
    }
    if (__c(*__z, *__y))           // x > y, if y > z
    {
        swap(*__x, *__z);          // x < y && y < z
        __r = 1;
        return __r;
    }
    swap(*__x, *__y);              // x > y && y <= z
    __r = 1;                       // x < y && x <= z
    if (__c(*__z, *__y))           // if y > z
    {
        swap(*__y, *__z);          // x <= y && y < z
        __r = 2;
    }
    return __r;
}                                  // x <= y && y <= z

// stable, 3-6 compares, 0-5 swaps

template <class _Compare, class _ForwardIterator>
unsigned
__sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
            _ForwardIterator __x4, _Compare __c)
{
    unsigned __r = __sort3<_Compare>(__x1, __x2, __x3, __c);
    if (__c(*__x4, *__x3))
    {
        swap(*__x3, *__x4);
        ++__r;
        if (__c(*__x3, *__x2))
        {
            swap(*__x2, *__x3);
            ++__r;
            if (__c(*__x2, *__x1))
            {
                swap(*__x1, *__x2);
                ++__r;
            }
        }
    }
    return __r;
}

// stable, 4-10 compares, 0-9 swaps

template <class _Compare, class _ForwardIterator>
unsigned
__sort5(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3,
            _ForwardIterator __x4, _ForwardIterator __x5, _Compare __c)
{
    unsigned __r = __sort4<_Compare>(__x1, __x2, __x3, __x4, __c);
    if (__c(*__x5, *__x4))
    {
        swap(*__x4, *__x5);
        ++__r;
        if (__c(*__x4, *__x3))
        {
            swap(*__x3, *__x4);
            ++__r;
            if (__c(*__x3, *__x2))
            {
                swap(*__x2, *__x3);
                ++__r;
                if (__c(*__x2, *__x1))
                {
                    swap(*__x1, *__x2);
                    ++__r;
                }
            }
        }
    }
    return __r;
}

// Assumes size > 0


template <class _Compare, class _BirdirectionalIterator>
void
__insertion_sort(_BirdirectionalIterator __first, _BirdirectionalIterator __last, _Compare __comp)
{
    typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type;
    if (__first != __last)
    {
        _BirdirectionalIterator __i = __first;
        for (++__i; __i != __last; ++__i)
        {
            _BirdirectionalIterator __j = __i;
            value_type __t(_VSTD::move(*__j));
            for (_BirdirectionalIterator __k = __i; __k != __first && __comp(__t,  *--__k); --__j)
                *__j = _VSTD::move(*__k);
            *__j = _VSTD::move(__t);
        }
    }
}

template <class _Compare, class _RandomAccessIterator>
void
__insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
    typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
    _RandomAccessIterator __j = __first+2;
    __sort3<_Compare>(__first, __first+1, __j, __comp);
    for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
    {
        if (__comp(*__i, *__j))
        {
            value_type __t(_VSTD::move(*__i));
            _RandomAccessIterator __k = __j;
            __j = __i;
            do
            {
                *__j = _VSTD::move(*__k);
                __j = __k;
            } while (__j != __first && __comp(__t, *--__k));
            *__j = _VSTD::move(__t);
        }
        __j = __i;
    }
}

template <class _Compare, class _RandomAccessIterator>
bool
__insertion_sort_incomplete(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
    switch (__last - __first)
    {
    case 0:
    case 1:
        return true;
    case 2:
        if (__comp(*--__last, *__first))
            swap(*__first, *__last);
        return true;
    case 3:
        _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
        return true;
    case 4:
        _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
        return true;
    case 5:
        _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
        return true;
    }
    typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
    _RandomAccessIterator __j = __first+2;
    __sort3<_Compare>(__first, __first+1, __j, __comp);
    const unsigned __limit = 8;
    unsigned __count = 0;
    for (_RandomAccessIterator __i = __j+1; __i != __last; ++__i)
    {
        if (__comp(*__i, *__j))
        {
            value_type __t(_VSTD::move(*__i));
            _RandomAccessIterator __k = __j;
            __j = __i;
            do
            {
                *__j = _VSTD::move(*__k);
                __j = __k;
            } while (__j != __first && __comp(__t, *--__k));
            *__j = _VSTD::move(__t);
            if (++__count == __limit)
                return ++__i == __last;
        }
        __j = __i;
    }
    return true;
}

template <class _Compare, class _BirdirectionalIterator>
void
__insertion_sort_move(_BirdirectionalIterator __first1, _BirdirectionalIterator __last1,
                      typename iterator_traits<_BirdirectionalIterator>::value_type* __first2, _Compare __comp)
{
    typedef typename iterator_traits<_BirdirectionalIterator>::value_type value_type;
    if (__first1 != __last1)
    {
        __destruct_n __d(0);
        unique_ptr<value_type, __destruct_n&> __h(__first2, __d);
        value_type* __last2 = __first2;
        ::new(__last2) value_type(_VSTD::move(*__first1));
        __d.__incr((value_type*)0);
        for (++__last2; ++__first1 != __last1; ++__last2)
        {
            value_type* __j2 = __last2;
            value_type* __i2 = __j2;
            if (__comp(*__first1, *--__i2))
            {
                ::new(__j2) value_type(_VSTD::move(*__i2));
                __d.__incr((value_type*)0);
                for (--__j2; __i2 != __first2 && __comp(*__first1,  *--__i2); --__j2)
                    *__j2 = _VSTD::move(*__i2);
                *__j2 = _VSTD::move(*__first1);
            }
            else
            {
                ::new(__j2) value_type(_VSTD::move(*__first1));
                __d.__incr((value_type*)0);
            }
        }
        __h.release();
    }
}

template <class _Compare, class _RandomAccessIterator>
void
__sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
    // _Compare is known to be a reference type
    typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
    typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
    const difference_type __limit = is_trivially_copy_constructible<value_type>::value &&
                                    is_trivially_copy_assignable<value_type>::value ? 30 : 6;
    while (true)
    {
    __restart:
        difference_type __len = __last - __first;
        switch (__len)
        {
        case 0:
        case 1:
            return;
        case 2:
            if (__comp(*--__last, *__first))
                swap(*__first, *__last);
            return;
        case 3:
            _VSTD::__sort3<_Compare>(__first, __first+1, --__last, __comp);
            return;
        case 4:
            _VSTD::__sort4<_Compare>(__first, __first+1, __first+2, --__last, __comp);
            return;
        case 5:
            _VSTD::__sort5<_Compare>(__first, __first+1, __first+2, __first+3, --__last, __comp);
            return;
        }
        if (__len <= __limit)
        {
            _VSTD::__insertion_sort_3<_Compare>(__first, __last, __comp);
            return;
        }
        // __len > 5
        _RandomAccessIterator __m = __first;
        _RandomAccessIterator __lm1 = __last;
        --__lm1;
        unsigned __n_swaps;
        {
        difference_type __delta;
        if (__len >= 1000)
        {
            __delta = __len/2;
            __m += __delta;
            __delta /= 2;
            __n_swaps = _VSTD::__sort5<_Compare>(__first, __first + __delta, __m, __m+__delta, __lm1, __comp);
        }
        else
        {
            __delta = __len/2;
            __m += __delta;
            __n_swaps = _VSTD::__sort3<_Compare>(__first, __m, __lm1, __comp);
        }
        }
        // *__m is median
        // partition [__first, __m) < *__m and *__m <= [__m, __last)
        // (this inhibits tossing elements equivalent to __m around unnecessarily)
        _RandomAccessIterator __i = __first;
        _RandomAccessIterator __j = __lm1;
        // j points beyond range to be tested, *__m is known to be <= *__lm1
        // The search going up is known to be guarded but the search coming down isn't.
        // Prime the downward search with a guard.
        if (!__comp(*__i, *__m))  // if *__first == *__m
        {
            // *__first == *__m, *__first doesn't go in first part
            // manually guard downward moving __j against __i
            while (true)
            {
                if (__i == --__j)
                {
                    // *__first == *__m, *__m <= all other elements
                    // Parition instead into [__first, __i) == *__first and *__first < [__i, __last)
                    ++__i;  // __first + 1
                    __j = __last;
                    if (!__comp(*__first, *--__j))  // we need a guard if *__first == *(__last-1)
                    {
                        while (true)
                        {
                            if (__i == __j)
                                return;  // [__first, __last) all equivalent elements
                            if (__comp(*__first, *__i))
                            {
                                swap(*__i, *__j);
                                ++__n_swaps;
                                ++__i;
                                break;
                            }
                            ++__i;
                        }
                    }
                    // [__first, __i) == *__first and *__first < [__j, __last) and __j == __last - 1
                    if (__i == __j)
                        return;
                    while (true)
                    {
                        while (!__comp(*__first, *__i))
                            ++__i;
                        while (__comp(*__first, *--__j))
                            ;
                        if (__i >= __j)
                            break;
                        swap(*__i, *__j);
                        ++__n_swaps;
                        ++__i;
                    }
                    // [__first, __i) == *__first and *__first < [__i, __last)
                    // The first part is sorted, sort the secod part
                    // _VSTD::__sort<_Compare>(__i, __last, __comp);
                    __first = __i;
                    goto __restart;
                }
                    __m = __j;
                ++__i;
            }
        }
        // [__first, __i) < *__m and *__m <= [__i, __last)
        if (__i != __m && __comp(*__m, *__i))
        {
            swap(*__i, *__m);
            ++__n_swaps;
        }
        // [__first, __i) < *__i and *__i <= [__i+1, __last)
        // If we were given a perfect partition, see if insertion sort is quick...
        if (__n_swaps == 0)
        {
            bool __fs = _VSTD::__insertion_sort_incomplete<_Compare>(__first, __i, __comp);
            if (_VSTD::__insertion_sort_incomplete<_Compare>(__i+1, __last, __comp))
            {
                if (__fs)
                    return;
                __last = __i;
                continue;
            }
            else
            {
                if (__fs)
                {
                    __first = ++__i;
                    continue;
                }
            }
        }
        // sort smaller range with recursive call and larger with tail recursion elimination
        if (__i - __first < __last - __i)
        {
            _VSTD::__sort<_Compare>(__first, __i, __comp);
            // _VSTD::__sort<_Compare>(__i+1, __last, __comp);
            __first = ++__i;
        }
        else
        {
            _VSTD::__sort<_Compare>(__i+1, __last, __comp);
            // _VSTD::__sort<_Compare>(__first, __i, __comp);
            __last = __i;
        }
    }
}

// This forwarder keeps the top call and the recursive calls using the same instantiation, forcing a reference _Compare




# 4042 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3

// lower_bound

template <class _Compare, class _ForwardIterator, class _Tp>
_ForwardIterator
__lower_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
{
    typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
    difference_type __len = _VSTD::distance(__first, __last);
    while (__len != 0)
    {
        difference_type __l2 = __len / 2;
        _ForwardIterator __m = __first;
        _VSTD::advance(__m, __l2);
        if (__comp(*__m, __value_))
        {
            __first = ++__m;
            __len -= __l2 + 1;
        }
        else
            __len = __l2;
    }
    return __first;
}





// upper_bound

template <class _Compare, class _ForwardIterator, class _Tp>
_ForwardIterator
__upper_bound(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value_, _Compare __comp)
{
    typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type;
    difference_type __len = _VSTD::distance(__first, __last);
    while (__len != 0)
    {
        difference_type __l2 = __len / 2;
        _ForwardIterator __m = __first;
        _VSTD::advance(__m, __l2);
        if (__comp(__value_, *__m))
            __len = __l2;
        else
        {
            __first = ++__m;
            __len -= __l2 + 1;
        }
    }
    return __first;
}





// equal_range







// binary_search







// merge

template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
_OutputIterator
__merge(_InputIterator1 __first1, _InputIterator1 __last1,
        _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp)
{
    for (; __first1 != __last1; ++__result)
    {
        if (__first2 == __last2)
            return _VSTD::copy(__first1, __last1, __result);
        if (__comp(*__first2, *__first1))
        {
            *__result = *__first2;
            ++__first2;
        }
        else
        {
            *__result = *__first1;
            ++__first1;
        }
    }
    return _VSTD::copy(__first2, __last2, __result);
}





// inplace_merge

template <class _Compare, class _BidirectionalIterator>
void
__buffered_inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
                _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1,
                                 typename iterator_traits<_BidirectionalIterator>::difference_type __len2,
                typename iterator_traits<_BidirectionalIterator>::value_type* __buff)
{
    typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
    typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
    typedef typename iterator_traits<_BidirectionalIterator>::pointer pointer;
    __destruct_n __d(0);
    unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
    if (__len1 <= __len2)
    {
        value_type* __p = __buff;
        for (_BidirectionalIterator __i = __first; __i != __middle; __d.__incr((value_type*)0), ++__i, ++__p)
            ::new(__p) value_type(_VSTD::move(*__i));
        __merge<_Compare>(move_iterator<value_type*>(__buff),
                          move_iterator<value_type*>(__p),
                          move_iterator<_BidirectionalIterator>(__middle),
                          move_iterator<_BidirectionalIterator>(__last),
                          __first, __comp);
    }
    else
    {
        value_type* __p = __buff;
        for (_BidirectionalIterator __i = __middle; __i != __last; __d.__incr((value_type*)0), ++__i, ++__p)
            ::new(__p) value_type(_VSTD::move(*__i));
        typedef reverse_iterator<_BidirectionalIterator> _RBi;
        typedef reverse_iterator<value_type*> _Rv;
        __merge(move_iterator<_RBi>(_RBi(__middle)), move_iterator<_RBi>(_RBi(__first)),
                move_iterator<_Rv>(_Rv(__p)), move_iterator<_Rv>(_Rv(__buff)),
                _RBi(__last), __negate<_Compare>(__comp));
    }
}

template <class _Compare, class _BidirectionalIterator>
void
__inplace_merge(_BidirectionalIterator __first, _BidirectionalIterator __middle, _BidirectionalIterator __last,
                _Compare __comp, typename iterator_traits<_BidirectionalIterator>::difference_type __len1,
                                 typename iterator_traits<_BidirectionalIterator>::difference_type __len2,
                typename iterator_traits<_BidirectionalIterator>::value_type* __buff, ptrdiff_t __buff_size)
{
    typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type;
    typedef typename iterator_traits<_BidirectionalIterator>::difference_type difference_type;
    while (true)
    {
        // if __middle == __last, we're done
        if (__len2 == 0)
            return;
        // shrink [__first, __middle) as much as possible (with no moves), returning if it shrinks to 0
        for (; true; ++__first, --__len1)
        {
            if (__len1 == 0)
                return;
            if (__comp(*__middle, *__first))
                break;
        }
        if (__len1 <= __buff_size || __len2 <= __buff_size)
        {
            __buffered_inplace_merge<_Compare>(__first, __middle, __last, __comp, __len1, __len2, __buff);
            return;
        }
        // __first < __middle < __last
        // *__first > *__middle
        // partition [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last) such that
        //     all elements in:
        //         [__first, __m1)  <= [__middle, __m2)
        //         [__middle, __m2) <  [__m1, __middle)
        //         [__m1, __middle) <= [__m2, __last)
        //     and __m1 or __m2 is in the middle of its range
        _BidirectionalIterator __m1;  // "median" of [__first, __middle)
        _BidirectionalIterator __m2;  // "median" of [__middle, __last)
        difference_type __len11;      // distance(__first, __m1)
        difference_type __len21;      // distance(__middle, __m2)
        // binary search smaller range
        if (__len1 < __len2)
        {   // __len >= 1, __len2 >= 2
            __len21 = __len2 / 2;
            __m2 = __middle;
            _VSTD::advance(__m2, __len21);
            __m1 = __upper_bound<_Compare>(__first, __middle, *__m2, __comp);
            __len11 = _VSTD::distance(__first, __m1);
        }
        else
        {
            if (__len1 == 1)
            {   // __len1 >= __len2 && __len2 > 0, therefore __len2 == 1
                // It is known *__first > *__middle
                swap(*__first, *__middle);
                return;
            }
            // __len1 >= 2, __len2 >= 1
            __len11 = __len1 / 2;
            __m1 = __first;
            _VSTD::advance(__m1, __len11);
            __m2 = __lower_bound<_Compare>(__middle, __last, *__m1, __comp);
            __len21 = _VSTD::distance(__middle, __m2);
        }
        difference_type __len12 = __len1 - __len11;  // distance(__m1, __middle)
        difference_type __len22 = __len2 - __len21;  // distance(__m2, __last)
        // [__first, __m1) [__m1, __middle) [__middle, __m2) [__m2, __last)
        // swap middle two partitions
        __middle = _VSTD::rotate(__m1, __middle, __m2);
        // __len12 and __len21 now have swapped meanings
        // merge smaller range with recurisve call and larger with tail recursion elimination
        if (__len11 + __len21 < __len12 + __len22)
        {
            __inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);
//          __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
            __first = __middle;
            __middle = __m2;
            __len1 = __len12;
            __len2 = __len22;
        }
        else
        {
            __inplace_merge<_Compare>(__middle, __m2, __last, __comp, __len12, __len22, __buff, __buff_size);
//          __inplace_merge<_Compare>(__first, __m1, __middle, __comp, __len11, __len21, __buff, __buff_size);
            __last = __middle;
            __middle = __m1;
            __len1 = __len11;
            __len2 = __len21;
        }
    }
}

template <class _Tp>
struct __inplace_merge_switch
{
    static const unsigned value = is_trivially_copy_assignable<_Tp>::value;
};





// stable_sort

template <class _Compare, class _InputIterator1, class _InputIterator2>
void
__merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1,
        _InputIterator2 __first2, _InputIterator2 __last2,
        typename iterator_traits<_InputIterator1>::value_type* __result, _Compare __comp)
{
    typedef typename iterator_traits<_InputIterator1>::value_type value_type;
    __destruct_n __d(0);
    unique_ptr<value_type, __destruct_n&> __h(__result, __d);
    for (; true; ++__result)
    {
        if (__first1 == __last1)
        {
            for (; __first2 != __last2; ++__first2, ++__result, __d.__incr((value_type*)0))
                ::new (__result) value_type(_VSTD::move(*__first2));
            __h.release();
            return;
        }
        if (__first2 == __last2)
        {
            for (; __first1 != __last1; ++__first1, ++__result, __d.__incr((value_type*)0))
                ::new (__result) value_type(_VSTD::move(*__first1));
            __h.release();
            return;
        }
        if (__comp(*__first2, *__first1))
        {
            ::new (__result) value_type(_VSTD::move(*__first2));
            __d.__incr((value_type*)0);
            ++__first2;
        }
        else
        {
            ::new (__result) value_type(_VSTD::move(*__first1));
            __d.__incr((value_type*)0);
            ++__first1;
        }
    }
}

template <class _Compare, class _InputIterator1, class _InputIterator2, class _OutputIterator>
void
__merge_move_assign(_InputIterator1 __first1, _InputIterator1 __last1,
        _InputIterator2 __first2, _InputIterator2 __last2,
        _OutputIterator __result, _Compare __comp)
{
    for (; __first1 != __last1; ++__result)
    {
        if (__first2 == __last2)
        {
            for (; __first1 != __last1; ++__first1, ++__result)
                *__result = _VSTD::move(*__first1);
            return;
        }
        if (__comp(*__first2, *__first1))
        {
            *__result = _VSTD::move(*__first2);
            ++__first2;
        }
        else
        {
            *__result = _VSTD::move(*__first1);
            ++__first1;
        }
    }
    for (; __first2 != __last2; ++__first2, ++__result)
        *__result = _VSTD::move(*__first2);
}

template <class _Compare, class _RandomAccessIterator>
void
__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
              typename iterator_traits<_RandomAccessIterator>::difference_type __len,
              typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size);

template <class _Compare, class _RandomAccessIterator>
void
__stable_sort_move(_RandomAccessIterator __first1, _RandomAccessIterator __last1, _Compare __comp,
                   typename iterator_traits<_RandomAccessIterator>::difference_type __len,
                   typename iterator_traits<_RandomAccessIterator>::value_type* __first2)
{
    typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
    switch (__len)
    {
    case 0:
        return;
    case 1:
        ::new(__first2) value_type(_VSTD::move(*__first1));
        return;
    case 2:
       __destruct_n __d(0);
        unique_ptr<value_type, __destruct_n&> __h2(__first2, __d);
    }
    if (__len <= 8)
    {
        __insertion_sort_move<_Compare>(__first1, __last1, __first2, __comp);
        return;
    }
    typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;
    _RandomAccessIterator __m = __first1 + __l2;
    __stable_sort<_Compare>(__first1, __m, __comp, __l2, __first2, __l2);
    __stable_sort<_Compare>(__m, __last1, __comp, __len - __l2, __first2 + __l2, __len - __l2);
    __merge_move_construct<_Compare>(__first1, __m, __m, __last1, __first2, __comp);
}

template <class _Tp>
struct __stable_sort_switch
{
    static const unsigned value = 128*is_trivially_copy_assignable<_Tp>::value;
};

template <class _Compare, class _RandomAccessIterator>
void
__stable_sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
              typename iterator_traits<_RandomAccessIterator>::difference_type __len,
              typename iterator_traits<_RandomAccessIterator>::value_type* __buff, ptrdiff_t __buff_size)
{
    typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
    typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
    switch (__len)
    {
    case 0:
    case 1:
        return;
    case 2:
        if (__comp(*--__last, *__first))
            swap(*__first, *__last);
        return;
    }
    if (__len <= static_cast<difference_type>(__stable_sort_switch<value_type>::value))
    {
        __insertion_sort<_Compare>(__first, __last, __comp);
        return;
    }
    typename iterator_traits<_RandomAccessIterator>::difference_type __l2 = __len / 2;
    _RandomAccessIterator __m = __first + __l2;
    if (__len <= __buff_size)
    {
        __destruct_n __d(0);
        unique_ptr<value_type, __destruct_n&> __h2(__buff, __d);
        __stable_sort_move<_Compare>(__first, __m, __comp, __l2, __buff);
        __d.__set(__l2, (value_type*)0);
        __stable_sort_move<_Compare>(__m, __last, __comp, __len - __l2, __buff + __l2);
        __d.__set(__len, (value_type*)0);
        __merge_move_assign<_Compare>(__buff, __buff + __l2, __buff + __l2, __buff + __len, __first, __comp);
//         __merge<_Compare>(move_iterator<value_type*>(__buff),
//                           move_iterator<value_type*>(__buff + __l2),
//                           move_iterator<_RandomAccessIterator>(__buff + __l2),
//                           move_iterator<_RandomAccessIterator>(__buff + __len),
//                           __first, __comp);
        return;
    }
    __stable_sort<_Compare>(__first, __m, __comp, __l2, __buff, __buff_size);
    __stable_sort<_Compare>(__m, __last, __comp, __len - __l2, __buff, __buff_size);
    __inplace_merge<_Compare>(__first, __m, __last, __comp, __l2, __len - __l2, __buff, __buff_size);
}

// push_heap

template <class _Compare, class _RandomAccessIterator>
void
__push_heap_front(_RandomAccessIterator __first, _RandomAccessIterator, _Compare __comp,
                  typename iterator_traits<_RandomAccessIterator>::difference_type __len)
{
    typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
    typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
    if (__len > 1)
    {
        difference_type __p = 0;
        _RandomAccessIterator __pp = __first;
        difference_type __c = 2;
        _RandomAccessIterator __cp = __first + __c;
        if (__c == __len || __comp(*__cp, *(__cp - 1)))
        {
            --__c;
            --__cp;
        }
        if (__comp(*__pp, *__cp))
        {
            value_type __t(_VSTD::move(*__pp));
            do
            {
                *__pp = _VSTD::move(*__cp);
                __pp = __cp;
                __p = __c;
                __c = (__p + 1) * 2;
                if (__c > __len)
                    break;
                __cp = __first + __c;
                if (__c == __len || __comp(*__cp, *(__cp - 1)))
                {
                    --__c;
                    --__cp;
                }
            } while (__comp(__t, *__cp));
            *__pp = _VSTD::move(__t);
        }
    }
}

template <class _Compare, class _RandomAccessIterator>
void
__push_heap_back(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
                 typename iterator_traits<_RandomAccessIterator>::difference_type __len)
{
    typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
    typedef typename iterator_traits<_RandomAccessIterator>::value_type value_type;
    if (__len > 1)
    {
        __len = (__len - 2) / 2;
        _RandomAccessIterator __ptr = __first + __len;
        if (__comp(*__ptr, *--__last))
        {
            value_type __t(_VSTD::move(*__last));
            do
            {
                *__last = _VSTD::move(*__ptr);
                __last = __ptr;
                if (__len == 0)
                    break;
                __len = (__len - 1) / 2;
                __ptr = __first + __len;
            } while (__comp(*__ptr, __t));
            *__last = _VSTD::move(__t);
        }
    }
}

template <class _RandomAccessIterator, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
void
push_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
#ifdef _LIBCPP_DEBUG
    typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;
    __debug_less<_Compare> __c(__comp);
    __push_heap_back<_Comp_ref>(__first, __last, __c, __last - __first);
#else  // _LIBCPP_DEBUG
# 4804 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
    typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
    __push_heap_back<_Comp_ref>(__first, __last, __comp, __last - __first);
#endif  // _LIBCPP_DEBUG
# 4807 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
}



// pop_heap

template <class _Compare, class _RandomAccessIterator>
inline _LIBCPP_INLINE_VISIBILITY
void
__pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp,
           typename iterator_traits<_RandomAccessIterator>::difference_type __len)
{
    if (__len > 1)
    {
        swap(*__first, *--__last);
        __push_heap_front<_Compare>(__first, __last, __comp, __len-1);
    }
}

template <class _RandomAccessIterator, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
void
pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
#ifdef _LIBCPP_DEBUG
    typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;
    __debug_less<_Compare> __c(__comp);
    __pop_heap<_Comp_ref>(__first, __last, __c, __last - __first);
#else  // _LIBCPP_DEBUG
# 4842 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
    typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
    __pop_heap<_Comp_ref>(__first, __last, __comp, __last - __first);
#endif  // _LIBCPP_DEBUG
# 4845 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
}



// make_heap

template <class _Compare, class _RandomAccessIterator>
void
__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
    typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
    difference_type __n = __last - __first;
    if (__n > 1)
    {
        __last = __first;
        ++__last;
        for (difference_type __i = 1; __i < __n;)
            __push_heap_back<_Compare>(__first, ++__last, __comp, ++__i);
    }
}

template <class _RandomAccessIterator, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
void
make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
{
#ifdef _LIBCPP_DEBUG
    typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;
    __debug_less<_Compare> __c(__comp);
    __make_heap<_Comp_ref>(__first, __last, __c);
#else  // _LIBCPP_DEBUG
# 4882 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
    typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
    __make_heap<_Comp_ref>(__first, __last, __comp);
#endif  // _LIBCPP_DEBUG
# 4885 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
}




// set_symmetric_difference







// lexicographical_compare

template <class _Compare, class _InputIterator1, class _InputIterator2>
bool
__lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
                          _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
{
    for (; __first2 != __last2; ++__first1, ++__first2)
    {
        if (__first1 == __last1 || __comp(*__first1, *__first2))
            return true;
        if (__comp(*__first2, *__first1))
            return false;
    }
    return false;
}

template <class _InputIterator1, class _InputIterator2, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
bool
lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
                        _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp)
{
#ifdef _LIBCPP_DEBUG
    typedef typename add_lvalue_reference<__debug_less<_Compare> >::type _Comp_ref;
    __debug_less<_Compare> __c(__comp);
    return __lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __c);
#else  // _LIBCPP_DEBUG
# 5527 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
    typedef typename add_lvalue_reference<_Compare>::type _Comp_ref;
    return __lexicographical_compare<_Comp_ref>(__first1, __last1, __first2, __last2, __comp);
#endif  // _LIBCPP_DEBUG
# 5530 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
}



// next_permutation



_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_ALGORITHM
# 5680 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm" 3
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 2 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 21 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3
#endif
# 22 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Cp, bool _IsConst, typename _Cp::__storage_type = 0> class __bit_iterator;
template <class _Cp> class __bit_const_reference;

template <class _Tp>
struct __has_storage_type
{
    static const bool value = false;
};

template <class _Cp, bool = __has_storage_type<_Cp>::value>
class __bit_reference
{
    typedef typename _Cp::__storage_type    __storage_type;
    typedef typename _Cp::__storage_pointer __storage_pointer;

    __storage_pointer __seg_;
    __storage_type    __mask_;

#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC)
    friend typename _Cp::__self;
#else
# 46 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3
    friend class _Cp::__self;
#endif
# 48 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3
    friend class __bit_const_reference<_Cp>;
    friend class __bit_iterator<_Cp, false>;
public:
    _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT
        {return static_cast<bool>(*__seg_ & __mask_);}
    _LIBCPP_INLINE_VISIBILITY bool operator ~() const _NOEXCEPT
        {return !static_cast<bool>(*this);}

    _LIBCPP_INLINE_VISIBILITY
    __bit_reference& operator=(bool __x) _NOEXCEPT
    {
        if (__x)
            *__seg_ |= __mask_;
        else
            *__seg_ &= ~__mask_;
        return *this;
    }

    _LIBCPP_INLINE_VISIBILITY
    __bit_reference& operator=(const __bit_reference& __x) _NOEXCEPT
        {return operator=(static_cast<bool>(__x));}

    _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {*__seg_ ^= __mask_;}
    _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, false> operator&() const _NOEXCEPT
        {return __bit_iterator<_Cp, false>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
private:
    _LIBCPP_INLINE_VISIBILITY
    __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
        : __seg_(__s), __mask_(__m) {}
};

template <class _Cp>
class __bit_reference<_Cp, false>
{
};









template <class _Cp>
class __bit_const_reference
{
    typedef typename _Cp::__storage_type          __storage_type;
    typedef typename _Cp::__const_storage_pointer __storage_pointer;

    __storage_pointer        __seg_;
    __storage_type __mask_;

#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC)
    friend typename _Cp::__self;
#else
# 136 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3
    friend class _Cp::__self;
#endif
# 138 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3
    friend class __bit_iterator<_Cp, true>;
public:
    _LIBCPP_INLINE_VISIBILITY
    __bit_const_reference(const __bit_reference<_Cp>& __x) _NOEXCEPT
        : __seg_(__x.__seg_), __mask_(__x.__mask_) {}

    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR operator bool() const _NOEXCEPT
        {return static_cast<bool>(*__seg_ & __mask_);}

    _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const _NOEXCEPT
        {return __bit_iterator<_Cp, true>(__seg_, static_cast<unsigned>(__ctz(__mask_)));}
private:
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_CONSTEXPR
    __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
        : __seg_(__s), __mask_(__m) {}

    ;
};

// find







// count




// rotate

template <class _Cp>
struct __bit_array
{
    typedef typename _Cp::difference_type difference_type;
    typedef typename _Cp::__storage_type  __storage_type;
    typedef typename _Cp::__storage_pointer __storage_pointer;
    typedef typename _Cp::iterator        iterator;
    static const unsigned __bits_per_word = _Cp::__bits_per_word;
    static const unsigned _Np = 4;

    difference_type __size_;
    __storage_type __word_[_Np];

    _LIBCPP_INLINE_VISIBILITY static difference_type capacity()
        {return static_cast<difference_type>(_Np * __bits_per_word);}
    _LIBCPP_INLINE_VISIBILITY explicit __bit_array(difference_type __s) : __size_(__s) {}
    _LIBCPP_INLINE_VISIBILITY iterator begin()
    {
        return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]), 0);
    }
    _LIBCPP_INLINE_VISIBILITY iterator end()
    {
        return iterator(pointer_traits<__storage_pointer>::pointer_to(__word_[0]) + __size_ / __bits_per_word,
                                                  static_cast<unsigned>(__size_ % __bits_per_word));
    }
};



// equal







template <class _Cp, bool _IsConst,
          typename _Cp::__storage_type>
class __bit_iterator
{
public:
    typedef typename _Cp::difference_type                                                          difference_type;
    typedef bool                                                                                  value_type;
    typedef __bit_iterator                                                                        pointer;
    typedef typename conditional<_IsConst, __bit_const_reference<_Cp>, __bit_reference<_Cp> >::type reference;
    typedef random_access_iterator_tag                                                            iterator_category;

private:
    typedef typename _Cp::__storage_type                                           __storage_type;
    typedef typename conditional<_IsConst, typename _Cp::__const_storage_pointer,
                                           typename _Cp::__storage_pointer>::type  __storage_pointer;
    static const unsigned __bits_per_word = _Cp::__bits_per_word;

    __storage_pointer __seg_;
    unsigned          __ctz_;

public:
    _LIBCPP_INLINE_VISIBILITY __bit_iterator() _NOEXCEPT
#if _LIBCPP_STD_VER > 11
    : __seg_(nullptr), __ctz_(0)
#endif
# 1115 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3
    {}

    _LIBCPP_INLINE_VISIBILITY
    __bit_iterator(const __bit_iterator<_Cp, false>& __it) _NOEXCEPT
        : __seg_(__it.__seg_), __ctz_(__it.__ctz_) {}

    _LIBCPP_INLINE_VISIBILITY reference operator*() const _NOEXCEPT
        {return reference(__seg_, __storage_type(1) << __ctz_);}

    _LIBCPP_INLINE_VISIBILITY friend bool operator>=(const __bit_iterator& __x, const __bit_iterator& __y)
        {return !(__x < __y);}

private:
    _LIBCPP_INLINE_VISIBILITY
    __bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT
        : __seg_(__s), __ctz_(__ctz) {}

#if defined(__clang__) || defined(__IBMCPP__) || defined(_LIBCPP_MSVC)
    friend typename _Cp::__self;
#else
# 1228 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3
    friend class _Cp::__self;
#endif
# 1230 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3
    friend class __bit_reference<_Cp>;
    friend class __bit_const_reference<_Cp>;
    friend class __bit_iterator<_Cp, true>;
    template <class _Dp> friend struct __bit_array;
    ;
    ;
    ;
};

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP___BIT_REFERENCE
# 1288 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__bit_reference" 3
# 266 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <type_traits>
#endif /* expanded by -frewrite-includes */
# 267 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#if 0 /* expanded by -frewrite-includes */
#include <climits>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/climits" 1 3
// -*- C++ -*-
//===--------------------------- climits ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CLIMITS
#define _LIBCPP_CLIMITS

/*
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/limits.h" 1 3 4
/*===---- limits.h - Standard header for integer sizes --------------------===*\
 *
 * Copyright (c) 2009 Chris Lattner
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
\*===----------------------------------------------------------------------===*/

#ifndef __CLANG_LIMITS_H
#define __CLANG_LIMITS_H

/* The system's limits.h may, in turn, try to #include_next GCC's limits.h.
   Avert this #include_next madness. */
#if defined __GNUC__ && !defined _GCC_LIMITS_H_
#define _GCC_LIMITS_H_
#endif
# 33 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/limits.h" 3 4

/* System headers include a number of constants from POSIX in <limits.h>.
   Include it if we're hosted. */
#if __STDC_HOSTED__ && \
    defined(__has_include_next) && (1)/*__has_include_next(<limits.h>)*/
#if 0 /* expanded by -frewrite-includes */
#include_next <limits.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/limits.h" 1 3 4
/*
 * Copyright (c) 2000, 2004-2007, 2009 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 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.
 *
 *	@(#)limits.h	8.2 (Berkeley) 1/4/94
 */

#ifndef _LIMITS_H_
#define	_LIMITS_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 64 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/limits.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/limits.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/limits.h" 1 3 4
/* This is the `system' limits.h, independent of any particular
   compiler.  GCC provides its own limits.h which can be found in
   /usr/lib/gcc, although it is not very informative.  
   This file is public domain.  */
#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include <arm/limits.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/limits.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 */
/*
 */

#ifndef _ARM_LIMITS_H_
#define _ARM_LIMITS_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 43 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/limits.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <arm/_limits.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_limits.h" 1 3 4
/*
 * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
 */
#define	CHAR_MIN	(-128)		/* min value for a char */

#define	USHRT_MAX	65535		/* max value for an unsigned short */
#define	SHRT_MAX	32767		/* max value for a short */
#define	SHRT_MIN	(-32768)	/* min value for a short */

#define	UINT_MAX	0xffffffff	/* max value for an unsigned int */
#define	INT_MAX		2147483647	/* max value for an int */
#define	INT_MIN		(-2147483647-1)	/* min value for an int */

#ifdef __LP64__
#define	ULONG_MAX	0xffffffffffffffffUL	/* max unsigned long */
#define	LONG_MAX	0x7fffffffffffffffL	/* max signed long */
#define	LONG_MIN	(-0x7fffffffffffffffL-1) /* min signed long */
#else /* !__LP64__ */
# 82 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/limits.h" 3 4
#define	ULONG_MAX	0xffffffffUL	/* max unsigned long */
#define	LONG_MAX	2147483647L	/* max signed long */
#define	LONG_MIN	(-2147483647L-1) /* min signed long */
#endif /* __LP64__ */
# 86 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/limits.h" 3 4

#define	ULLONG_MAX	0xffffffffffffffffULL	/* max unsigned long long */
#define	LLONG_MAX	0x7fffffffffffffffLL	/* max signed long long */
#define	LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min signed long long */

#if !defined(_ANSI_SOURCE)
#ifdef __LP64__
#define LONG_BIT	64
#else /* !__LP64__ */
# 95 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/limits.h" 3 4
#define LONG_BIT	32
#endif /* __LP64__ */
# 97 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/limits.h" 3 4
#define	SSIZE_MAX	LONG_MAX	/* max value for a ssize_t */
#define WORD_BIT	32

#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
#define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */

#define	UQUAD_MAX	ULLONG_MAX
#define	QUAD_MAX	LLONG_MAX
#define	QUAD_MIN	LLONG_MIN

#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
# 108 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/limits.h" 3 4
#endif /* !_ANSI_SOURCE */
# 109 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/limits.h" 3 4

#endif /* _ARM_LIMITS_H_ */
# 111 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/limits.h" 3 4
# 7 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/limits.h" 2 3 4
#else
# 8 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/limits.h" 3 4
#error architecture not supported
#endif
# 10 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/limits.h" 3 4
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/limits.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/syslimits.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/syslimits.h" 1 3 4
/*
 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
 * 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.
 *
 *	@(#)syslimits.h	8.1 (Berkeley) 6/2/93
 */

#ifndef _SYS_SYSLIMITS_H_
#define _SYS_SYSLIMITS_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/syslimits.h" 3 4

#if !defined(_ANSI_SOURCE)
/*
 * Note: CHILD_MAX *must* be less than hard_maxproc, which is set at
 * compile time; you *cannot* set it higher than the hard limit!!
 */
#define	ARG_MAX		   (256 * 1024)	/* max bytes for an exec function */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define	CHILD_MAX		   266	/* max simultaneous processes */
#define	GID_MAX		   2147483647U	/* max value for a gid_t (2^31-2) */
#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
# 80 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/syslimits.h" 3 4
#define	LINK_MAX		32767	/* max file link count */
#define	MAX_CANON		 1024	/* max bytes in term canon input line */
#define	MAX_INPUT		 1024	/* max bytes in terminal input */
#define	NAME_MAX		  255	/* max bytes in a file name */
#define	NGROUPS_MAX		   16	/* max supplemental group id's */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define	UID_MAX		   2147483647U	/* max value for a uid_t (2^31-2) */

#define	OPEN_MAX		10240	/* max open files per process - todo, make a config option? */

#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
# 91 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/syslimits.h" 3 4
#define	PATH_MAX		 1024	/* max bytes in pathname */
#define	PIPE_BUF		  512	/* max bytes for atomic pipe writes */

#define	BC_BASE_MAX		   99	/* max ibase/obase values in bc(1) */
#define	BC_DIM_MAX		 2048	/* max array elements in bc(1) */
#define	BC_SCALE_MAX		   99	/* max scale value in bc(1) */
#define	BC_STRING_MAX		 1000	/* max const string length in bc(1) */
#define	CHARCLASS_NAME_MAX	   14	/* max character class name size */
#define	COLL_WEIGHTS_MAX	    2	/* max weights for order keyword */
#define	EQUIV_CLASS_MAX		    2
#define	EXPR_NEST_MAX		   32	/* max expressions nested in expr(1) */
#define	LINE_MAX		 2048	/* max bytes in an input line */
#define	RE_DUP_MAX		  255	/* max RE's in interval notation */

#if __DARWIN_UNIX03
#define	NZERO			   20	/* default priority [XSI] */
					/* = ((PRIO_MAX - PRIO_MIN) / 2) + 1 */
					/* range: 0 - 39 [(2 * NZERO) - 1] */
					/* 0 is not actually used */
#else /* !__DARWIN_UNIX03 */
# 111 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/syslimits.h" 3 4
#define	NZERO			    0	/* default priority */
					/* range: -20 - 20 */
					/* (PRIO_MIN - PRIO_MAX) */
#endif /* __DARWIN_UNIX03 */
# 115 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/syslimits.h" 3 4
#endif /* !_ANSI_SOURCE */
# 116 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/syslimits.h" 3 4

#endif /* !_SYS_SYSLIMITS_H_ */
# 118 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/syslimits.h" 3 4
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/limits.h" 2 3 4

#if __DARWIN_C_LEVEL > __DARWIN_C_ANSI

#endif /* __DARWIN_C_LEVEL > __DARWIN_C_ANSI */
# 158 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/limits.h" 3 4

/* NZERO to be defined here. TBD. See also sys/param.h  */

#endif /* !_LIMITS_H_ */
# 162 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/limits.h" 3 4
# 39 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/limits.h" 2 3 4
#endif
# 40 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/limits.h" 3 4

/* Many system headers try to "help us out" by defining these.  No really, we
   know how big each datatype is. */
#undef  SCHAR_MIN
#undef  SCHAR_MAX
#define SCHAR_MAX __SCHAR_MAX__
#define SHRT_MAX  __SHRT_MAX__
#define INT_MAX   __INT_MAX__
#define LONG_MAX  __LONG_MAX__

#define SCHAR_MIN (-__SCHAR_MAX__-1)
#define SHRT_MIN  (-__SHRT_MAX__ -1)
#define INT_MIN   (-__INT_MAX__  -1)
#define LONG_MIN  (-__LONG_MAX__ -1L)

#define UCHAR_MAX (__SCHAR_MAX__*2  +1)
#define USHRT_MAX (__SHRT_MAX__ *2  +1)
#define UINT_MAX  (__INT_MAX__  *2U +1U)
#define ULONG_MAX (__LONG_MAX__ *2UL+1UL)

#ifndef MB_LEN_MAX
#define MB_LEN_MAX 1
#endif
# 79 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/limits.h" 3 4

#define CHAR_BIT  __CHAR_BIT__

#ifdef __CHAR_UNSIGNED__  /* -funsigned-char */
#define CHAR_MIN 0
#define CHAR_MAX UCHAR_MAX
#else
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/limits.h" 3 4
#define LONG_LONG_MIN  (-__LONG_LONG_MAX__-1LL)
#define ULONG_LONG_MAX (__LONG_LONG_MAX__*2ULL+1ULL)
#endif
# 118 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/limits.h" 3 4

#endif /* __CLANG_LIMITS_H */
# 120 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/limits.h" 3 4
# 43 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/climits" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 46 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/climits" 3
#endif
# 47 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/climits" 3

#endif  // _LIBCPP_CLIMITS
# 49 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/climits" 3
# 268 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <limits>
#endif /* expanded by -frewrite-includes */
# 269 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#if 0 /* expanded by -frewrite-includes */
#include <initializer_list>
#endif /* expanded by -frewrite-includes */
# 270 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#if 0 /* expanded by -frewrite-includes */
#include <memory>
#endif /* expanded by -frewrite-includes */
# 271 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#if 0 /* expanded by -frewrite-includes */
#include <stdexcept>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdexcept" 1 3
// -*- C++ -*-
//===--------------------------- stdexcept --------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_STDEXCEPT
#define _LIBCPP_STDEXCEPT

/*
    stdexcept synopsis

namespace std
#include <exception>
#endif /* expanded by -frewrite-includes */
# 47 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdexcept" 3
#if 0 /* expanded by -frewrite-includes */
#include <iosfwd>  // for string forward decl
#endif /* expanded by -frewrite-includes */
# 48 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdexcept" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 51 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdexcept" 3
#endif
# 52 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdexcept" 3

namespace std  // purposefully not using versioning namespace
{

class _LIBCPP_EXCEPTION_ABI logic_error
    : public exception
{
private:
    void* __imp_;
public:
    explicit logic_error(const string&);
    explicit logic_error(const char*);

    logic_error(const logic_error&) _NOEXCEPT;
    logic_error& operator=(const logic_error&) _NOEXCEPT;

    virtual ~logic_error() _NOEXCEPT;

    virtual const char* what() const _NOEXCEPT;
};

class _LIBCPP_EXCEPTION_ABI runtime_error
    : public exception
{
private:
    void* __imp_;
public:
    explicit runtime_error(const string&);
    explicit runtime_error(const char*);

    runtime_error(const runtime_error&) _NOEXCEPT;
    runtime_error& operator=(const runtime_error&) _NOEXCEPT;

    virtual ~runtime_error() _NOEXCEPT;

    virtual const char* what() const _NOEXCEPT;
};

class _LIBCPP_EXCEPTION_ABI domain_error
    : public logic_error
{
public:
    _LIBCPP_INLINE_VISIBILITY explicit domain_error(const string& __s) : logic_error(__s) {}
    _LIBCPP_INLINE_VISIBILITY explicit domain_error(const char* __s)   : logic_error(__s) {}

    virtual ~domain_error() _NOEXCEPT;
};

class _LIBCPP_EXCEPTION_ABI invalid_argument
    : public logic_error
{
public:
    _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const string& __s) : logic_error(__s) {}
    _LIBCPP_INLINE_VISIBILITY explicit invalid_argument(const char* __s)   : logic_error(__s) {}

};

class _LIBCPP_EXCEPTION_ABI overflow_error
    : public runtime_error
{
public:
    _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const string& __s) : runtime_error(__s) {}
    _LIBCPP_INLINE_VISIBILITY explicit overflow_error(const char* __s)   : runtime_error(__s) {}

    virtual ~overflow_error() _NOEXCEPT;
};

class _LIBCPP_EXCEPTION_ABI underflow_error
    : public runtime_error
{
public:
    _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const string& __s) : runtime_error(__s) {}
    _LIBCPP_INLINE_VISIBILITY explicit underflow_error(const char* __s)   : runtime_error(__s) {}

    virtual ~underflow_error() _NOEXCEPT;
};

}  // std

#endif  // _LIBCPP_STDEXCEPT
# 163 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdexcept" 3
# 272 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 273 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#if 0 /* expanded by -frewrite-includes */
#include <cstring>
#endif /* expanded by -frewrite-includes */
# 274 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#if 0 /* expanded by -frewrite-includes */
#include <__split_buffer>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 1 3
// -*- C++ -*-
#ifndef _LIBCPP_SPLIT_BUFFER
#define _LIBCPP_SPLIT_BUFFER

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 6 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3
#if 0 /* expanded by -frewrite-includes */
#include <type_traits>
#endif /* expanded by -frewrite-includes */
# 7 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 8 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifdef min
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro min is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing min")
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
#endif
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 10 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 13 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3
#endif
# 14 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <bool>
class __split_buffer_common
{
protected:
    void __throw_length_error() const;
    void __throw_out_of_range() const;
};

template <class _Tp, class _Allocator = allocator<_Tp> >
struct __split_buffer
    : private __split_buffer_common<true>
{
private:
    __split_buffer(const __split_buffer&);
    __split_buffer& operator=(const __split_buffer&);
public:
    typedef _Tp                                             value_type;
    typedef _Allocator                                      allocator_type;
    typedef typename remove_reference<allocator_type>::type __alloc_rr;
    typedef allocator_traits<__alloc_rr>                    __alloc_traits;
    typedef value_type&                                     reference;
    typedef const value_type&                               const_reference;
    typedef typename __alloc_traits::size_type              size_type;
    typedef typename __alloc_traits::difference_type        difference_type;
    typedef typename __alloc_traits::pointer                pointer;
    typedef typename __alloc_traits::const_pointer          const_pointer;
    typedef pointer                                         iterator;
    typedef const_pointer                                   const_iterator;

    pointer                                         __first_;
    pointer                                         __begin_;
    pointer                                         __end_;
    __compressed_pair<pointer, allocator_type> __end_cap_;

    typedef typename add_lvalue_reference<allocator_type>::type __alloc_ref;
    typedef typename add_lvalue_reference<allocator_type>::type __alloc_const_ref;

    _LIBCPP_INLINE_VISIBILITY __alloc_rr&           __alloc() _NOEXCEPT         {return __end_cap_.second();}
    _LIBCPP_INLINE_VISIBILITY const __alloc_rr&     __alloc() const _NOEXCEPT   {return __end_cap_.second();}
    _LIBCPP_INLINE_VISIBILITY pointer&              __end_cap() _NOEXCEPT       {return __end_cap_.first();}
    _LIBCPP_INLINE_VISIBILITY const pointer&        __end_cap() const _NOEXCEPT {return __end_cap_.first();}

    __split_buffer()
        _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
    explicit __split_buffer(__alloc_rr& __a);
    explicit __split_buffer(const __alloc_rr& __a);
    __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
    ~__split_buffer();

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    __split_buffer(__split_buffer&& __c)
        _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
    __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
    __split_buffer& operator=(__split_buffer&& __c)
        _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
                is_nothrow_move_assignable<allocator_type>::value) ||
               !__alloc_traits::propagate_on_container_move_assignment::value);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 75 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3

    _LIBCPP_INLINE_VISIBILITY       iterator begin() _NOEXCEPT       {return __begin_;}
    _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}
    _LIBCPP_INLINE_VISIBILITY       iterator end() _NOEXCEPT         {return __end_;}
    _LIBCPP_INLINE_VISIBILITY const_iterator end() const _NOEXCEPT   {return __end_;}

    _LIBCPP_INLINE_VISIBILITY
    void clear() _NOEXCEPT
        {__destruct_at_end(__begin_);}
    _LIBCPP_INLINE_VISIBILITY size_type size() const {return static_cast<size_type>(__end_ - __begin_);}
    _LIBCPP_INLINE_VISIBILITY bool empty()     const {return __end_ == __begin_;}
    _LIBCPP_INLINE_VISIBILITY size_type capacity() const {return static_cast<size_type>(__end_cap() - __first_);}
    _LIBCPP_INLINE_VISIBILITY size_type __front_spare() const {return static_cast<size_type>(__begin_ - __first_);}
    _LIBCPP_INLINE_VISIBILITY size_type __back_spare() const {return static_cast<size_type>(__end_cap() - __end_);}

    _LIBCPP_INLINE_VISIBILITY       reference front()       {return *__begin_;}
    _LIBCPP_INLINE_VISIBILITY const_reference front() const {return *__begin_;}
    _LIBCPP_INLINE_VISIBILITY       reference back()        {return *(__end_ - 1);}
    _LIBCPP_INLINE_VISIBILITY const_reference back() const  {return *(__end_ - 1);}

    void reserve(size_type __n);
    void shrink_to_fit() _NOEXCEPT;
    void push_front(const_reference __x);
    _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
    void push_front(value_type&& __x);
    void push_back(value_type&& __x);
#if !defined(_LIBCPP_HAS_NO_VARIADICS)
    template <class... _Args>
        void emplace_back(_Args&&... __args);
#endif  // !defined(_LIBCPP_HAS_NO_VARIADICS)
# 106 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3
#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
# 107 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3

    _LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
    _LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}

    void __construct_at_end(size_type __n);
    ;
    ;
    ;

    _LIBCPP_INLINE_VISIBILITY void __destruct_at_begin(pointer __new_begin)
        {__destruct_at_begin(__new_begin, is_trivially_destructible<value_type>());}
        ;
        ;

    _LIBCPP_INLINE_VISIBILITY
    void __destruct_at_end(pointer __new_last) _NOEXCEPT
        {__destruct_at_end(__new_last, false_type());}
    _LIBCPP_INLINE_VISIBILITY
        void __destruct_at_end(pointer __new_last, false_type) _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY
        void __destruct_at_end(pointer __new_last, true_type) _NOEXCEPT;

    void swap(__split_buffer& __x)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
                   __is_nothrow_swappable<__alloc_rr>::value);

    ;

private:
    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__split_buffer& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
        {
            __alloc() = _VSTD::move(__c.__alloc());
        }

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__split_buffer&, false_type) _NOEXCEPT
        {}

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
                   __is_nothrow_swappable<__alloc_rr>::value)
        {__swap_alloc(__x, __y, integral_constant<bool,
                      __alloc_traits::propagate_on_container_swap::value>());}

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(__alloc_rr& __x, __alloc_rr& __y, true_type)
        _NOEXCEPT_(__is_nothrow_swappable<__alloc_rr>::value)
        {
            using _VSTD::swap;
            swap(__x, __y);
        }

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(__alloc_rr&, __alloc_rr&, false_type) _NOEXCEPT
        {}
};



//  Default constructs __n objects starting at __end_
//  throws if construction throws
//  Precondition:  __n > 0
//  Precondition:  size() + __n <= capacity()
//  Precondition:  __n > 0
//  Precondition:  size() + __n <= capacity()
//  Postcondition:  size() == old size() + __n
//  Postcondition:  [i] == __x for all i in [size() - __n, __n)










template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
__split_buffer<_Tp, _Allocator>::__split_buffer(size_type __cap, size_type __start, __alloc_rr& __a)
    : __end_cap_(nullptr, __a)
{
    __first_ = __cap != 0 ? __alloc_traits::allocate(__alloc(), __cap) : nullptr;
    __begin_ = __end_ = __first_ + __start;
    __end_cap() = __first_ + __cap;
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
__split_buffer<_Tp, _Allocator>::__split_buffer()
    _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr)
{
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
__split_buffer<_Tp, _Allocator>::__split_buffer(__alloc_rr& __a)
    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
{
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
__split_buffer<_Tp, _Allocator>::__split_buffer(const __alloc_rr& __a)
    : __first_(nullptr), __begin_(nullptr), __end_(nullptr), __end_cap_(nullptr, __a)
{
}

template <class _Tp, class _Allocator>
__split_buffer<_Tp, _Allocator>::~__split_buffer()
{
    clear();
    if (__first_)
        __alloc_traits::deallocate(__alloc(), __first_, capacity());
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Allocator>
__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
    _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
    : __first_(_VSTD::move(__c.__first_)),
      __begin_(_VSTD::move(__c.__begin_)),
      __end_(_VSTD::move(__c.__end_)),
      __end_cap_(_VSTD::move(__c.__end_cap_))
{
    __c.__first_ = nullptr;
    __c.__begin_ = nullptr;
    __c.__end_ = nullptr;
    __c.__end_cap() = nullptr;
}

template <class _Tp, class _Allocator>
__split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __alloc_rr& __a)
    : __end_cap_(__a)
{
    __first_ = __c.__first_;
    __begin_ = __c.__begin_;
    __end_ = __c.__end_;
    __end_cap() = __c.__end_cap();
    __move_assign_alloc(__c,
        integral_constant<bool,
                          __alloc_traits::propagate_on_container_move_assignment::value>());
    __c.__first_ = __c.__begin_ = __c.__end_ = __c.__end_cap() = nullptr;
    return *this;
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 423 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3

template <class _Tp, class _Allocator>
void
__split_buffer<_Tp, _Allocator>::swap(__split_buffer& __x)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
                   __is_nothrow_swappable<__alloc_rr>::value)
{
    _VSTD::swap(__first_, __x.__first_);
    _VSTD::swap(__begin_, __x.__begin_);
    _VSTD::swap(__end_, __x.__end_);
    _VSTD::swap(__end_cap(), __x.__end_cap());
    __swap_alloc(__alloc(), __x.__alloc());
}

template <class _Tp, class _Allocator>
void
__split_buffer<_Tp, _Allocator>::reserve(size_type __n)
{
    if (__n < capacity())
    {
        __split_buffer<value_type, __alloc_rr&> __t(__n, 0, __alloc());
        __t.__construct_at_end(move_iterator<pointer>(__begin_),
                               move_iterator<pointer>(__end_));
        _VSTD::swap(__first_, __t.__first_);
        _VSTD::swap(__begin_, __t.__begin_);
        _VSTD::swap(__end_, __t.__end_);
        _VSTD::swap(__end_cap(), __t.__end_cap());
    }
}

template <class _Tp, class _Allocator>
void
__split_buffer<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
{
    if (capacity() > size())
    {
#ifndef _LIBCPP_NO_EXCEPTIONS
        try
        {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 463 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3
            __split_buffer<value_type, __alloc_rr&> __t(size(), 0, __alloc());
            __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                   move_iterator<pointer>(__end_));
            __t.__end_ = __t.__begin_ + (__end_ - __begin_);
            _VSTD::swap(__first_, __t.__first_);
            _VSTD::swap(__begin_, __t.__begin_);
            _VSTD::swap(__end_, __t.__end_);
            _VSTD::swap(__end_cap(), __t.__end_cap());
#ifndef _LIBCPP_NO_EXCEPTIONS
        }
        catch (...)
        {
        }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 477 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3
    }
}

template <class _Tp, class _Allocator>
void
__split_buffer<_Tp, _Allocator>::push_front(const_reference __x)
{
    if (__begin_ == __first_)
    {
        if (__end_ < __end_cap())
        {
            difference_type __d = __end_cap() - __end_;
            __d = (__d + 1) / 2;
            __begin_ = _VSTD::move_backward(__begin_, __end_, __end_ + __d);
            __end_ += __d;
        }
        else
        {
            size_type __c = max<size_type>(2 * static_cast<size_t>(__end_cap() - __first_), 1);
            __split_buffer<value_type, __alloc_rr&> __t(__c, (__c + 3) / 4, __alloc());
            __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                   move_iterator<pointer>(__end_));
            _VSTD::swap(__first_, __t.__first_);
            _VSTD::swap(__begin_, __t.__begin_);
            __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                   move_iterator<pointer>(__end_));
            _VSTD::swap(__first_, __t.__first_);
            _VSTD::swap(__begin_, __t.__begin_);
            _VSTD::swap(__end_, __t.__end_);
            _VSTD::swap(__end_cap(), __t.__end_cap());
        }
    }
    __alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_), __x);
    ++__end_;
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Allocator>
void
__split_buffer<_Tp, _Allocator>::push_back(value_type&& __x)
{
    if (__end_ == __end_cap())
    {
        if (__begin_ > __first_)
        {
            difference_type __d = __begin_ - __first_;
            __d = (__d + 1) / 2;
            __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
            __begin_ -= __d;
        }
        else
        {
            size_type __c = max<size_type>(2 * static_cast<size_t>(__end_cap() - __first_), 1);
            __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
            __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                   move_iterator<pointer>(__end_));
            _VSTD::swap(__first_, __t.__first_);
            _VSTD::swap(__begin_, __t.__begin_);
            _VSTD::swap(__end_, __t.__end_);
            _VSTD::swap(__end_cap(), __t.__end_cap());
        }
    }
    __alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_),
            _VSTD::move(__x));
    ++__end_;
}

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Allocator>
template <class... _Args>
void
__split_buffer<_Tp, _Allocator>::emplace_back(_Args&&... __args)
{
    if (__end_ == __end_cap())
    {
        if (__begin_ > __first_)
        {
            difference_type __d = __begin_ - __first_;
            __d = (__d + 1) / 2;
            __end_ = _VSTD::move(__begin_, __end_, __begin_ - __d);
            __begin_ -= __d;
        }
        else
        {
            size_type __c = max<size_type>(2 * static_cast<size_t>(__end_cap() - __first_), 1);
            __split_buffer<value_type, __alloc_rr&> __t(__c, __c / 4, __alloc());
            __t.__construct_at_end(move_iterator<pointer>(__begin_),
                                   move_iterator<pointer>(__end_));
            _VSTD::swap(__first_, __t.__first_);
            _VSTD::swap(__begin_, __t.__begin_);
            _VSTD::swap(__end_, __t.__end_);
            _VSTD::swap(__end_cap(), __t.__end_cap());
        }
    }
    __alloc_traits::construct(__alloc(), _VSTD::__to_raw_pointer(__end_),
                              _VSTD::forward<_Args>(__args)...);
    ++__end_;
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 639 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 641 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer" 3




_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_SPLIT_BUFFER

#ifdef _LIBCPP_DEBUG
#if 0 /* expanded by -frewrite-includes */
#   include <__debug>
#endif /* expanded by -frewrite-includes */
# 281 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#else
# 282 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#   define _LIBCPP_ASSERT(x, m) ((void)0)
#endif
# 284 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 287 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#endif
# 288 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <bool>
class __vector_base_common
{
protected:
    _LIBCPP_ALWAYS_INLINE __vector_base_common() {}
    void __throw_length_error() const;
    void __throw_out_of_range() const;
};

template <bool __b>
void
__vector_base_common<__b>::__throw_length_error() const
{
#ifndef _LIBCPP_NO_EXCEPTIONS
    throw length_error("vector");
#else
# 307 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    assert(!"vector length_error");
#endif
# 309 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
}

template <bool __b>
void
__vector_base_common<__b>::__throw_out_of_range() const
{
#ifndef _LIBCPP_NO_EXCEPTIONS
    throw out_of_range("vector");
#else
# 318 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    assert(!"vector out_of_range");
#endif
# 320 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
}

#ifdef _LIBCPP_MSVC
#pragma warning( push )
#pragma warning( disable: 4231 )
#endif // _LIBCPP_MSVC
# 326 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS __vector_base_common<true>)
#ifdef _LIBCPP_MSVC
#pragma warning( pop )
#endif // _LIBCPP_MSVC
# 330 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

template <class _Tp, class _Allocator>
class __vector_base
    : protected __vector_base_common<true>
{
protected:
    typedef _Tp                                      value_type;
    typedef _Allocator                               allocator_type;
    typedef allocator_traits<allocator_type>         __alloc_traits;
    typedef value_type&                              reference;
    typedef const value_type&                        const_reference;
    typedef typename __alloc_traits::size_type       size_type;
    typedef typename __alloc_traits::difference_type difference_type;
    typedef typename __alloc_traits::pointer         pointer;
    typedef typename __alloc_traits::const_pointer   const_pointer;
    typedef pointer                                  iterator;
    typedef const_pointer                            const_iterator;

    pointer                                         __begin_;
    pointer                                         __end_;
    __compressed_pair<pointer, allocator_type> __end_cap_;

    _LIBCPP_INLINE_VISIBILITY
    allocator_type& __alloc() _NOEXCEPT
        {return __end_cap_.second();}
    _LIBCPP_INLINE_VISIBILITY
    const allocator_type& __alloc() const _NOEXCEPT
        {return __end_cap_.second();}
    _LIBCPP_INLINE_VISIBILITY
    pointer& __end_cap() _NOEXCEPT
        {return __end_cap_.first();}
    _LIBCPP_INLINE_VISIBILITY
    const pointer& __end_cap() const _NOEXCEPT
        {return __end_cap_.first();}

    _LIBCPP_INLINE_VISIBILITY
    __vector_base()
        _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
    _LIBCPP_INLINE_VISIBILITY __vector_base(const allocator_type& __a);
    ~__vector_base();

    _LIBCPP_INLINE_VISIBILITY
    void clear() _NOEXCEPT {__destruct_at_end(__begin_);}
    _LIBCPP_INLINE_VISIBILITY
    size_type capacity() const _NOEXCEPT
        {return static_cast<size_type>(__end_cap() - __begin_);}

    _LIBCPP_INLINE_VISIBILITY
    void __destruct_at_end(pointer __new_last) _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const __vector_base& __c)
        {__copy_assign_alloc(__c, integral_constant<bool,
                      __alloc_traits::propagate_on_container_copy_assignment::value>());}

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__vector_base& __c)
        _NOEXCEPT_(
            !__alloc_traits::propagate_on_container_move_assignment::value ||
            is_nothrow_move_assignable<allocator_type>::value)
        {__move_assign_alloc(__c, integral_constant<bool,
                      __alloc_traits::propagate_on_container_move_assignment::value>());}

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(allocator_type& __x, allocator_type& __y)
        _NOEXCEPT_(
            !__alloc_traits::propagate_on_container_swap::value ||
            __is_nothrow_swappable<allocator_type>::value)
        {__swap_alloc(__x, __y, integral_constant<bool,
                      __alloc_traits::propagate_on_container_swap::value>());}
private:
    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const __vector_base& __c, true_type)
        {
            if (__alloc() != __c.__alloc())
            {
                clear();
                __alloc_traits::deallocate(__alloc(), __begin_, capacity());
                __begin_ = __end_ = __end_cap() = nullptr;
            }
            __alloc() = __c.__alloc();
        }

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const __vector_base&, false_type)
        {}

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__vector_base& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
        {
            __alloc() = _VSTD::move(__c.__alloc());
        }

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__vector_base&, false_type)
        _NOEXCEPT
        {}

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
        {
            using _VSTD::swap;
            swap(__x, __y);
        }
    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(allocator_type&, allocator_type&, false_type)
        _NOEXCEPT
        {}
};

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
__vector_base<_Tp, _Allocator>::__destruct_at_end(pointer __new_last) _NOEXCEPT
{
    while (__new_last != __end_)
        __alloc_traits::destroy(__alloc(), _VSTD::__to_raw_pointer(--__end_));
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
__vector_base<_Tp, _Allocator>::__vector_base()
        _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
    : __begin_(nullptr),
      __end_(nullptr),
      __end_cap_(nullptr)
{
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
__vector_base<_Tp, _Allocator>::__vector_base(const allocator_type& __a)
    : __begin_(nullptr),
      __end_(nullptr),
      __end_cap_(nullptr, __a)
{
}

template <class _Tp, class _Allocator>
__vector_base<_Tp, _Allocator>::~__vector_base()
{
    if (__begin_ != nullptr)
    {
        clear();
        __alloc_traits::deallocate(__alloc(), __begin_, capacity());
    }
}

template <class _Tp, class _Allocator = allocator<_Tp> >
class _LIBCPP_TYPE_VIS_ONLY vector
    : private __vector_base<_Tp, _Allocator>
{
private:
    typedef __vector_base<_Tp, _Allocator>           __base;
public:
    typedef vector                                   __self;
    typedef _Tp                                      value_type;
    typedef _Allocator                               allocator_type;
    typedef typename __base::__alloc_traits          __alloc_traits;
    typedef typename __base::reference               reference;
    typedef typename __base::const_reference         const_reference;
    typedef typename __base::size_type               size_type;
    typedef typename __base::difference_type         difference_type;
    typedef typename __base::pointer                 pointer;
    typedef typename __base::const_pointer           const_pointer;
    typedef __wrap_iter<pointer>                     iterator;
    typedef __wrap_iter<const_pointer>               const_iterator;
    typedef _VSTD::reverse_iterator<iterator>         reverse_iterator;
    typedef _VSTD::reverse_iterator<const_iterator>   const_reverse_iterator;

    static_assert((is_same<typename allocator_type::value_type, value_type>::value),
                  "Allocator::value_type must be same type as value_type");

    _LIBCPP_INLINE_VISIBILITY
    vector()
        _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
        {
#if _LIBCPP_DEBUG_LEVEL >= 2
            __get_db()->__insert_c(this);
#endif
# 512 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
        }
    _LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a)
        : __base(__a)
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__insert_c(this);
#endif
# 519 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    }
    ;
#if _LIBCPP_STD_VER > 11
    explicit vector(size_type __n, const allocator_type& __a);
#endif
# 524 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    ;
    ;
    ;
    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    vector(initializer_list<value_type> __il);
    _LIBCPP_INLINE_VISIBILITY
    vector(initializer_list<value_type> __il, const allocator_type& __a);
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 560 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_INLINE_VISIBILITY
    ~vector()
    {
        __get_db()->__erase_c(this);
    }
#endif
# 567 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

    vector(const vector& __x);
    ;
    _LIBCPP_INLINE_VISIBILITY
    vector& operator=(const vector& __x);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    vector(vector&& __x)
        _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
    _LIBCPP_INLINE_VISIBILITY
    vector(vector&& __x, const allocator_type& __a);
    _LIBCPP_INLINE_VISIBILITY
    vector& operator=(vector&& __x)
        _NOEXCEPT_(
             __alloc_traits::propagate_on_container_move_assignment::value &&
             is_nothrow_move_assignable<allocator_type>::value);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 584 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    vector& operator=(initializer_list<value_type> __il)
        {assign(__il.begin(), __il.end()); return *this;}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 589 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

    ;
    ;

    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    void assign(initializer_list<value_type> __il)
        {assign(__il.begin(), __il.end());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 618 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

    _LIBCPP_INLINE_VISIBILITY
    allocator_type get_allocator() const _NOEXCEPT
        {return this->__alloc();}

    _LIBCPP_INLINE_VISIBILITY iterator               begin() _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY const_iterator         begin()   const _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY iterator               end() _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY const_iterator         end()     const _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY
    reverse_iterator       rbegin() _NOEXCEPT
        {return       reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rbegin()  const _NOEXCEPT
        {return const_reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
    reverse_iterator       rend() _NOEXCEPT
        {return       reverse_iterator(begin());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rend()    const _NOEXCEPT
        {return const_reverse_iterator(begin());}

    _LIBCPP_INLINE_VISIBILITY
    const_iterator         cbegin()  const _NOEXCEPT
        {return begin();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator         cend()    const _NOEXCEPT
        {return end();}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crbegin() const _NOEXCEPT
        {return rbegin();}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crend()   const _NOEXCEPT
        {return rend();}

    _LIBCPP_INLINE_VISIBILITY
    size_type size() const _NOEXCEPT
        {return static_cast<size_type>(this->__end_ - this->__begin_);}
    _LIBCPP_INLINE_VISIBILITY
    size_type capacity() const _NOEXCEPT
        {return __base::capacity();}
    _LIBCPP_INLINE_VISIBILITY
    bool empty() const _NOEXCEPT
        {return this->__begin_ == this->__end_;}
    size_type max_size() const _NOEXCEPT;
    void reserve(size_type __n);
    void shrink_to_fit() _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY reference       operator[](size_type __n);
    _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const;
    ;
    ;

    _LIBCPP_INLINE_VISIBILITY reference       front()
    {
        _LIBCPP_ASSERT(!empty(), "front() called for empty vector");
        return *this->__begin_;
    }
    _LIBCPP_INLINE_VISIBILITY const_reference front() const
    {
        _LIBCPP_ASSERT(!empty(), "front() called for empty vector");
        return *this->__begin_;
    }
    _LIBCPP_INLINE_VISIBILITY reference       back()
    {
        _LIBCPP_ASSERT(!empty(), "back() called for empty vector");
        return *(this->__end_ - 1);
    }
    _LIBCPP_INLINE_VISIBILITY const_reference back()  const
    {
        _LIBCPP_ASSERT(!empty(), "back() called for empty vector");
        return *(this->__end_ - 1);
    }

    _LIBCPP_INLINE_VISIBILITY
    value_type*       data() _NOEXCEPT
        {return _VSTD::__to_raw_pointer(this->__begin_);}
    _LIBCPP_INLINE_VISIBILITY
    const value_type* data() const _NOEXCEPT
        {return _VSTD::__to_raw_pointer(this->__begin_);}

    _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x);
#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class... _Args>
        void emplace_back(_Args&&... __args);
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 707 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 708 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    ;

    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    iterator insert(const_iterator __position, value_type&& __x);
#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class... _Args>
        iterator emplace(const_iterator __position, _Args&&... __args);
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 717 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 718 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    iterator insert(const_iterator __position, initializer_list<value_type> __il)
        {return insert(__position, __il.begin(), __il.end());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 745 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

    _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
    ;

    _LIBCPP_INLINE_VISIBILITY
    void clear() _NOEXCEPT
    {
        __base::clear();
        __invalidate_all_iterators();
    }

    void resize(size_type __sz);
    void resize(size_type __sz, const_reference __x);

    void swap(vector&)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<allocator_type>::value);

    bool __invariants() const;

#if _LIBCPP_DEBUG_LEVEL >= 2

    bool __dereferenceable(const const_iterator* __i) const;
    bool __decrementable(const const_iterator* __i) const;
    bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
    bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 773 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

private:
    _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
    void allocate(size_type __n);
    void deallocate() _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY size_type __recommend(size_type __new_size) const;
    void __construct_at_end(size_type __n);
    void __construct_at_end(size_type __n, const_reference __x);
    template <class _ForwardIterator>
        typename enable_if
        <
            __is_forward_iterator<_ForwardIterator>::value,
            void
        >::type
        __construct_at_end(_ForwardIterator __first, _ForwardIterator __last);
    void __move_construct_at_end(pointer __first, pointer __last);
    void __append(size_type __n);
    void __append(size_type __n, const_reference __x);
    _LIBCPP_INLINE_VISIBILITY
    iterator       __make_iter(pointer __p) _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY
    const_iterator __make_iter(const_pointer __p) const _NOEXCEPT;
    void __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v);
    pointer __swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v, pointer __p);
    void __move_range(pointer __from_s, pointer __from_e, pointer __to);
    void __move_assign(vector& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
    void __move_assign(vector& __c, false_type);
    _LIBCPP_INLINE_VISIBILITY
    void __destruct_at_end(pointer __new_last) _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __c_node* __c = __get_db()->__find_c_and_lock(this);
        for (__i_node** __p = __c->end_; __p != __c->beg_; )
        {
            --__p;
            const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
            if (__i->base() > __new_last)
            {
                (*__p)->__c_ = nullptr;
                if (--__c->end_ != __p)
                    memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
            }
        }
        __get_db()->unlock();
#endif
# 819 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
        __base::__destruct_at_end(__new_last);
    }
    template <class _Up>
        void
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
        __push_back_slow_path(_Up&& __x);
#else
# 826 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
        __push_back_slow_path(_Up& __x);
#endif
# 828 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#if !defined(_LIBCPP_HAS_NO_VARIADICS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
    template <class... _Args>
        void
        __emplace_back_slow_path(_Args&&... __args);
#endif
# 833 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
};

template <class _Tp, class _Allocator>
void
vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v)
{
    __alloc_traits::__construct_backward(this->__alloc(), this->__begin_, this->__end_, __v.__begin_);
    _VSTD::swap(this->__begin_, __v.__begin_);
    _VSTD::swap(this->__end_, __v.__end_);
    _VSTD::swap(this->__end_cap(), __v.__end_cap());
    __v.__first_ = __v.__begin_;
    __invalidate_all_iterators();
}

template <class _Tp, class _Allocator>
typename vector<_Tp, _Allocator>::pointer
vector<_Tp, _Allocator>::__swap_out_circular_buffer(__split_buffer<value_type, allocator_type&>& __v, pointer __p)
{
    pointer __r = __v.__begin_;
    __alloc_traits::__construct_backward(this->__alloc(), this->__begin_, __p, __v.__begin_);
    {
        clear();
        __alloc_traits::deallocate(this->__alloc(), this->__begin_, capacity());
        this->__begin_ = this->__end_ = this->__end_cap() = nullptr;
    }
}

template <class _Tp, class _Allocator>
typename vector<_Tp, _Allocator>::size_type
vector<_Tp, _Allocator>::max_size() const _NOEXCEPT
{
    return _VSTD::min<size_type>(__alloc_traits::max_size(this->__alloc()), numeric_limits<size_type>::max() / 2);  // end() >= begin(), always
}

//  throws if construction throws


#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>::vector(vector&& __x)
        _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
    : __base(_VSTD::move(__x.__alloc()))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
    __get_db()->swap(this, &__x);
#endif
# 1191 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    this->__begin_ = __x.__begin_;
    this->__end_ = __x.__end_;
    this->__end_cap() = __x.__end_cap();
    __x.__begin_ = __x.__end_ = __x.__end_cap() = nullptr;
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>::vector(vector&& __x, const allocator_type& __a)
    : __base(__a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1205 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    if (__a == __x.__alloc())
    {
        this->__begin_ = __x.__begin_;
        this->__end_ = __x.__end_;
        this->__end_cap() = __x.__end_cap();
        __x.__begin_ = __x.__end_ = __x.__end_cap() = nullptr;
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->swap(this, &__x);
#endif
# 1214 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    }
    else
    {
        typedef move_iterator<iterator> _Ip;
        assign(_Ip(__x.begin()), _Ip(__x.end()));
    }
}

#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1231 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    if (__il.size() > 0)
    {
        allocate(__il.size());
        __construct_at_end(__il.begin(), __il.end());
    }
}

#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1254 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>&
vector<_Tp, _Allocator>::operator=(vector&& __x)
        _NOEXCEPT_(
             __alloc_traits::propagate_on_container_move_assignment::value &&
             is_nothrow_move_assignable<allocator_type>::value)
{
    __move_assign(__x, integral_constant<bool,
          __alloc_traits::propagate_on_container_move_assignment::value>());
    return *this;
}

template <class _Tp, class _Allocator>
void
vector<_Tp, _Allocator>::__move_assign(vector& __c, false_type)
{
    if (__base::__alloc() != __c.__alloc())
    {
        typedef move_iterator<iterator> _Ip;
        assign(_Ip(__c.begin()), _Ip(__c.end()));
    }
    else
        __move_assign(__c, true_type());
}

template <class _Tp, class _Allocator>
void
vector<_Tp, _Allocator>::__move_assign(vector& __c, true_type)
    _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
{
    deallocate();
    this->__begin_ = __c.__begin_;
    this->__end_ = __c.__end_;
    this->__end_cap() = __c.__end_cap();
    __base::__move_assign_alloc(__c);
    __c.__begin_ = __c.__end_ = __c.__end_cap() = nullptr;
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->swap(this, &__c);
#endif
# 1295 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1298 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<_Tp, _Allocator>&
vector<_Tp, _Allocator>::operator=(const vector& __x)
{
    if (this != &__x)
    {
        __base::__copy_assign_alloc(__x);
        assign(__x.__begin_, __x.__end_);
    }
    return *this;
}







template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::__make_iter(pointer __p) _NOEXCEPT
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    return iterator(this, __p);
#else
# 1396 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    return iterator(__p);
#endif
# 1398 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename vector<_Tp, _Allocator>::const_iterator
vector<_Tp, _Allocator>::__make_iter(const_pointer __p) const _NOEXCEPT
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    return const_iterator(this, __p);
#else
# 1408 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    return const_iterator(__p);
#endif
# 1410 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename vector<_Tp, _Allocator>::reference
vector<_Tp, _Allocator>::operator[](size_type __n)
{
    _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds");
    return this->__begin_[__n];
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename vector<_Tp, _Allocator>::const_reference
vector<_Tp, _Allocator>::operator[](size_type __n) const
{
    _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds");
    return this->__begin_[__n];
}





template <class _Tp, class _Allocator>
void
vector<_Tp, _Allocator>::reserve(size_type __n)
{
    if (__n > capacity())
    {
        allocator_type& __a = this->__alloc();
        __split_buffer<value_type, allocator_type&> __v(__n, size(), __a);
        __swap_out_circular_buffer(__v);
    }
}

template <class _Tp, class _Allocator>
void
vector<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
{
    if (capacity() > size())
    {
#ifndef _LIBCPP_NO_EXCEPTIONS
        try
        {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 1502 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
            allocator_type& __a = this->__alloc();
            __split_buffer<value_type, allocator_type&> __v(size(), size(), __a);
            __swap_out_circular_buffer(__v);
#ifndef _LIBCPP_NO_EXCEPTIONS
        }
        catch (...)
        {
        }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 1511 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    }
}

template <class _Tp, class _Allocator>
template <class _Up>
void
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
vector<_Tp, _Allocator>::__push_back_slow_path(_Up&& __x)
#else
# 1520 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
vector<_Tp, _Allocator>::__push_back_slow_path(_Up& __x)
#endif
# 1522 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
{
    allocator_type& __a = this->__alloc();
    __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), __a);
    // __v.push_back(_VSTD::forward<_Up>(__x));
    __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_), _VSTD::forward<_Up>(__x));
    __v.__end_++;
    __swap_out_circular_buffer(__v);
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
vector<_Tp, _Allocator>::push_back(const_reference __x)
{
    if (this->__end_ != this->__end_cap())
    {
        __alloc_traits::construct(this->__alloc(),
                                  _VSTD::__to_raw_pointer(this->__end_), __x);
        ++this->__end_;
    }
    else
        __push_back_slow_path(__x);
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Allocator>
template <class... _Args>
void
vector<_Tp, _Allocator>::__emplace_back_slow_path(_Args&&... __args)
{
    allocator_type& __a = this->__alloc();
    __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), size(), __a);
//    __v.emplace_back(_VSTD::forward<_Args>(__args)...);
    __alloc_traits::construct(__a, _VSTD::__to_raw_pointer(__v.__end_), _VSTD::forward<_Args>(__args)...);
    __v.__end_++;
    __swap_out_circular_buffer(__v);
}

template <class _Tp, class _Allocator>
template <class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void
vector<_Tp, _Allocator>::emplace_back(_Args&&... __args)
{
    if (this->__end_ < this->__end_cap())
    {
        __alloc_traits::construct(this->__alloc(),
                                  _VSTD::__to_raw_pointer(this->__end_),
                                  _VSTD::forward<_Args>(__args)...);
        ++this->__end_;
    }
    else
        __emplace_back_slow_path(_VSTD::forward<_Args>(__args)...);
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1597 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1598 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3



template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::erase(const_iterator __position)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
        "vector::erase(iterator) called with an iterator not"
        " referring to this vector");
#endif
# 1618 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    _LIBCPP_ASSERT(__position != end(),
        "vector::erase(iterator) called with a non-dereferenceable iterator");
    difference_type __ps = __position - cbegin();
    pointer __p = this->__begin_ + __ps;
    iterator __r = __make_iter(__p);
    this->__destruct_at_end(_VSTD::move(__p + 1, this->__end_, __p));
    return __r;
}



template <class _Tp, class _Allocator>
void
vector<_Tp, _Allocator>::__move_range(pointer __from_s, pointer __from_e, pointer __to)
{
    pointer __old_last = this->__end_;
    difference_type __n = __old_last - __to;
    for (pointer __i = __from_s + __n; __i < __from_e; ++__i, ++this->__end_)
        __alloc_traits::construct(this->__alloc(),
                                  _VSTD::__to_raw_pointer(this->__end_),
                                  _VSTD::move(*__i));
    _VSTD::move_backward(__from_s, __from_s + __n, __old_last);
}



#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Allocator>
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::insert(const_iterator __position, value_type&& __x)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
        "vector::insert(iterator, x) called with an iterator not"
        " referring to this vector");
#endif
# 1705 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    pointer __p = this->__begin_ + (__position - begin());
    if (this->__end_ < this->__end_cap())
    {
        if (__p == this->__end_)
        {
            __alloc_traits::construct(this->__alloc(),
                                      _VSTD::__to_raw_pointer(this->__end_),
                                      _VSTD::move(__x));
            ++this->__end_;
        }
        else
        {
            __move_range(__p, this->__end_, __p + 1);
            *__p = _VSTD::move(__x);
        }
    }
    else
    {
        allocator_type& __a = this->__alloc();
        __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), __p - this->__begin_, __a);
        __v.push_back(_VSTD::move(__x));
        __p = __swap_out_circular_buffer(__v, __p);
    }
    return __make_iter(__p);
}

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Allocator>
template <class... _Args>
typename vector<_Tp, _Allocator>::iterator
vector<_Tp, _Allocator>::emplace(const_iterator __position, _Args&&... __args)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__position) == this,
        "vector::emplace(iterator, x) called with an iterator not"
        " referring to this vector");
#endif
# 1743 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    pointer __p = this->__begin_ + (__position - begin());
    if (this->__end_ < this->__end_cap())
    {
        if (__p == this->__end_)
        {
            __alloc_traits::construct(this->__alloc(),
                                      _VSTD::__to_raw_pointer(this->__end_),
                                      _VSTD::forward<_Args>(__args)...);
            ++this->__end_;
        }
        else
        {
            value_type __tmp(_VSTD::forward<_Args>(__args)...);
            __move_range(__p, this->__end_, __p + 1);
            *__p = _VSTD::move(__tmp);
        }
    }
    else
    {
        allocator_type& __a = this->__alloc();
        __split_buffer<value_type, allocator_type&> __v(__recommend(size() + 1), __p - this->__begin_, __a);
        __v.emplace_back(_VSTD::forward<_Args>(__args)...);
        __p = __swap_out_circular_buffer(__v, __p);
    }
    return __make_iter(__p);
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1771 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1772 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3


template <class _Tp, class _Allocator>
bool
vector<_Tp, _Allocator>::__invariants() const
{
    if (this->__begin_ == nullptr)
    {
        if (this->__end_ != nullptr || this->__end_cap() != nullptr)
            return false;
    }
    else
    {
        if (this->__begin_ > this->__end_)
            return false;
        if (this->__begin_ == this->__end_cap())
            return false;
        if (this->__end_ > this->__end_cap())
            return false;
    }
    return true;
}

#if _LIBCPP_DEBUG_LEVEL >= 2

template <class _Tp, class _Allocator>
bool
vector<_Tp, _Allocator>::__dereferenceable(const const_iterator* __i) const
{
    return this->__begin_ <= __i->base() && __i->base() < this->__end_;
}

template <class _Tp, class _Allocator>
bool
{
    const_pointer __p = __i->base() + __n;
    return this->__begin_ <= __p && __p < this->__end_;
}

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 2017 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
vector<_Tp, _Allocator>::__invalidate_all_iterators()
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__invalidate_all(this);
#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 2026 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
}

// vector<bool>

template <class _Allocator> class vector<bool, _Allocator>;

template <class _Allocator> struct hash<vector<bool, _Allocator> >;

template <class _Allocator>
struct __has_storage_type<vector<bool, _Allocator> >
{
    static const bool value = true;
};

template <class _Allocator>
class _LIBCPP_TYPE_VIS_ONLY vector<bool, _Allocator>
    : private __vector_base_common<true>
{
public:
    typedef vector                                   __self;
    typedef bool                                     value_type;
    typedef _Allocator                               allocator_type;
    typedef allocator_traits<allocator_type>         __alloc_traits;
    typedef typename __alloc_traits::size_type       size_type;
    typedef typename __alloc_traits::difference_type difference_type;
    typedef size_type __storage_type;
    typedef __bit_iterator<vector, false>            pointer;
    typedef __bit_iterator<vector, true>             const_pointer;
    typedef pointer                                  iterator;
    typedef const_pointer                            const_iterator;
    typedef _VSTD::reverse_iterator<iterator>         reverse_iterator;
    typedef _VSTD::reverse_iterator<const_iterator>   const_reverse_iterator;

private:
    typedef typename __alloc_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
                rebind_alloc<__storage_type>
#else
# 2064 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
                rebind_alloc<__storage_type>::other
#endif
# 2066 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
                                                     __storage_allocator;
    typedef allocator_traits<__storage_allocator>    __storage_traits;
    typedef typename __storage_traits::pointer       __storage_pointer;
    typedef typename __storage_traits::const_pointer __const_storage_pointer;

    __storage_pointer                                      __begin_;
    size_type                                              __size_;
    __compressed_pair<size_type, __storage_allocator> __cap_alloc_;
public:
    typedef __bit_reference<vector>                  reference;
    typedef __bit_const_reference<vector>            const_reference;
private:
    _LIBCPP_INLINE_VISIBILITY
    size_type& __cap() _NOEXCEPT
        {return __cap_alloc_.first();}
    _LIBCPP_INLINE_VISIBILITY
    const size_type& __cap() const _NOEXCEPT
        {return __cap_alloc_.first();}
    _LIBCPP_INLINE_VISIBILITY
    __storage_allocator& __alloc() _NOEXCEPT
        {return __cap_alloc_.second();}
    _LIBCPP_INLINE_VISIBILITY
    const __storage_allocator& __alloc() const _NOEXCEPT
        {return __cap_alloc_.second();}

    static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);

    _LIBCPP_INLINE_VISIBILITY
    static size_type __internal_cap_to_external(size_type __n) _NOEXCEPT
        {return __n * __bits_per_word;}
    _LIBCPP_INLINE_VISIBILITY
    static size_type __external_cap_to_internal(size_type __n) _NOEXCEPT
        {return (__n - 1) / __bits_per_word + 1;}

public:
    _LIBCPP_INLINE_VISIBILITY
    vector()
        _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
    _LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a);
    ~vector();
    ;
#if _LIBCPP_STD_VER > 11
    explicit vector(size_type __n, const allocator_type& __a);
#endif
# 2110 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    ;
    ;
    ;
    ;
    ;
    ;

    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    vector(initializer_list<value_type> __il);
    vector(initializer_list<value_type> __il, const allocator_type& __a);
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 2134 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    vector(vector&& __v)
        _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
    vector(vector&& __v, const allocator_type& __a);
    _LIBCPP_INLINE_VISIBILITY
    vector& operator=(vector&& __v)
        _NOEXCEPT_(
             __alloc_traits::propagate_on_container_move_assignment::value &&
             is_nothrow_move_assignable<allocator_type>::value);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2146 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    vector& operator=(initializer_list<value_type> __il)
        {assign(__il.begin(), __il.end()); return *this;}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 2151 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

    ;
    ;

    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    void assign(initializer_list<value_type> __il)
        {assign(__il.begin(), __il.end());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 2174 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

    _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT
        {return allocator_type(this->__alloc());}

    size_type max_size() const _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY
    size_type capacity() const _NOEXCEPT
        {return __internal_cap_to_external(__cap());}
    _LIBCPP_INLINE_VISIBILITY
    size_type size() const _NOEXCEPT
        {return __size_;}
    _LIBCPP_INLINE_VISIBILITY
    bool empty() const _NOEXCEPT
        {return __size_ == 0;}
    void reserve(size_type __n);
    void shrink_to_fit() _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY
    iterator begin() _NOEXCEPT
        {return __make_iter(0);}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator begin() const _NOEXCEPT
        {return __make_iter(0);}
    _LIBCPP_INLINE_VISIBILITY
    iterator end() _NOEXCEPT
        {return __make_iter(__size_);}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator end()   const _NOEXCEPT
        {return __make_iter(__size_);}

    _LIBCPP_INLINE_VISIBILITY
    reverse_iterator rbegin() _NOEXCEPT
        {return       reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rbegin() const _NOEXCEPT
        {return const_reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
    reverse_iterator rend() _NOEXCEPT
        {return       reverse_iterator(begin());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rend()   const _NOEXCEPT
        {return const_reverse_iterator(begin());}

    _LIBCPP_INLINE_VISIBILITY
    const_iterator         cbegin()  const _NOEXCEPT
        {return __make_iter(0);}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator         cend()    const _NOEXCEPT
        {return __make_iter(__size_);}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crbegin() const _NOEXCEPT
        {return rbegin();}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crend()   const _NOEXCEPT
        {return rend();}

    _LIBCPP_INLINE_VISIBILITY reference       operator[](size_type __n)       {return __make_ref(__n);}
    _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __n) const {return __make_ref(__n);}
    ;
    const_reference at(size_type __n) const;

    _LIBCPP_INLINE_VISIBILITY reference       front()       {return __make_ref(0);}
    _LIBCPP_INLINE_VISIBILITY const_reference front() const {return __make_ref(0);}
    _LIBCPP_INLINE_VISIBILITY reference       back()        {return __make_ref(__size_ - 1);}
    _LIBCPP_INLINE_VISIBILITY const_reference back()  const {return __make_ref(__size_ - 1);}

    void push_back(const value_type& __x);
#if _LIBCPP_STD_VER > 11
    template <class... _Args>
    _LIBCPP_INLINE_VISIBILITY void emplace_back(_Args&&... __args)
        { push_back ( value_type ( _VSTD::forward<_Args>(__args)... )); }
#endif
# 2246 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

    _LIBCPP_INLINE_VISIBILITY void pop_back() {--__size_;}

#if _LIBCPP_STD_VER > 11
    template <class... _Args>
   _LIBCPP_INLINE_VISIBILITY iterator emplace(const_iterator position, _Args&&... __args)
        { return insert ( position, value_type ( _VSTD::forward<_Args>(__args)... )); }
#endif
# 2254 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

    iterator insert(const_iterator __position, const value_type& __x);
    iterator insert(const_iterator __position, size_type __n, const value_type& __x);
    iterator insert(const_iterator __position, size_type __n, const_reference __x);
    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    iterator insert(const_iterator __position, initializer_list<value_type> __il)
        {return insert(__position, __il.begin(), __il.end());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 2278 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

    _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
    ;

    _LIBCPP_INLINE_VISIBILITY
    void clear() _NOEXCEPT {__size_ = 0;}

    void swap(vector&)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<allocator_type>::value);

    ;
    void flip() _NOEXCEPT;

    ;

private:
    _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
    ;
    void deallocate() _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY
    static size_type __align_it(size_type __new_size) _NOEXCEPT
        {return __new_size + (__bits_per_word-1) & ~(__bits_per_word-1);};
    _LIBCPP_INLINE_VISIBILITY  size_type __recommend(size_type __new_size) const;
    _LIBCPP_INLINE_VISIBILITY void __construct_at_end(size_type __n, bool __x);
    ;
    ;
    _LIBCPP_INLINE_VISIBILITY
    reference __make_ref(size_type __pos) _NOEXCEPT
        {return reference(__begin_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
    _LIBCPP_INLINE_VISIBILITY
    const_reference __make_ref(size_type __pos) const _NOEXCEPT
        {return const_reference(__begin_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
    _LIBCPP_INLINE_VISIBILITY
    iterator __make_iter(size_type __pos) _NOEXCEPT
        {return iterator(__begin_ + __pos / __bits_per_word, static_cast<unsigned>(__pos % __bits_per_word));}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator __make_iter(size_type __pos) const _NOEXCEPT
        {return const_iterator(__begin_ + __pos / __bits_per_word, static_cast<unsigned>(__pos % __bits_per_word));}
    _LIBCPP_INLINE_VISIBILITY
    iterator __const_iterator_cast(const_iterator __p) _NOEXCEPT
        {return begin() + (__p - cbegin());}

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const vector& __v)
        {__copy_assign_alloc(__v, integral_constant<bool,
                      __storage_traits::propagate_on_container_copy_assignment::value>());}
    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const vector& __c, true_type)
        {
            if (__alloc() != __c.__alloc())
                deallocate();
            __alloc() = __c.__alloc();
        }

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const vector&, false_type)
        {}

    void __move_assign(vector& __c, false_type);
    void __move_assign(vector& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(vector& __c)
        _NOEXCEPT_(
            !__storage_traits::propagate_on_container_move_assignment::value ||
            is_nothrow_move_assignable<allocator_type>::value)
        {__move_assign_alloc(__c, integral_constant<bool,
                      __storage_traits::propagate_on_container_move_assignment::value>());}
    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(vector& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
        {
            __alloc() = _VSTD::move(__c.__alloc());
        }

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(vector&, false_type)
        _NOEXCEPT
        {}

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y)
        _NOEXCEPT_(
            !__storage_traits::propagate_on_container_swap::value ||
            __is_nothrow_swappable<allocator_type>::value)
        {__swap_alloc(__x, __y, integral_constant<bool,
                      __storage_traits::propagate_on_container_swap::value>());}

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(__storage_allocator& __x, __storage_allocator& __y, true_type)
        _NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
        {
            using _VSTD::swap;
            swap(__x, __y);
        }
    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(__storage_allocator&, __storage_allocator&, false_type)
        _NOEXCEPT
        {}

    size_t __hash_code() const _NOEXCEPT;

    friend class __bit_reference<vector>;
    friend class __bit_const_reference<vector>;
    friend class __bit_iterator<vector, false>;
    friend class __bit_iterator<vector, true>;
    friend struct __bit_array<vector>;
    friend struct _LIBCPP_TYPE_VIS_ONLY hash<vector>;
};

template <class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
vector<bool, _Allocator>::__invalidate_all_iterators()
{
}

//  Allocate space for __n objects
//  throws length_error if __n > max_size()
//  throws (probably bad_alloc) if memory run out
//  Precondition:  __begin_ == __end_ == __cap() == 0
//  Precondition:  __n > 0
//  Postcondition:  capacity() == __n
//  Postcondition:  size() == 0


template <class _Allocator>
void
vector<bool, _Allocator>::deallocate() _NOEXCEPT
{
    if (this->__begin_ != nullptr)
    {
        __storage_traits::deallocate(this->__alloc(), this->__begin_, __cap());
        __invalidate_all_iterators();
        this->__begin_ = nullptr;
        this->__size_ = this->__cap() = 0;
    }
}

template <class _Allocator>
typename vector<bool, _Allocator>::size_type
vector<bool, _Allocator>::max_size() const _NOEXCEPT
{
    size_type __amax = __storage_traits::max_size(__alloc());
    size_type __nmax = numeric_limits<size_type>::max() / 2;  // end() >= begin(), always
    if (__nmax / __bits_per_word <= __amax)
        return __nmax;
    return __internal_cap_to_external(__amax);
}

//  Precondition:  __new_size > capacity()
template <class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename vector<bool, _Allocator>::size_type
vector<bool, _Allocator>::__recommend(size_type __new_size) const
{
    const size_type __ms = max_size();
    if (__new_size > __ms)
        this->__throw_length_error();
    const size_type __cap = capacity();
    if (__cap >= __ms / 2)
        return __ms;
    return _VSTD::max(2*__cap, __align_it(__new_size));
}

//  Default constructs __n objects starting at __end_
//  Precondition:  __n > 0
//  Precondition:  size() + __n <= capacity()
//  Postcondition:  size() == size() + __n
template <class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
vector<bool, _Allocator>::__construct_at_end(size_type __n, bool __x)
{
    size_type __old_size = this->__size_;
    this->__size_ += __n;
    _VSTD::fill_n(__make_iter(__old_size), __n, __x);
}



template <class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<bool, _Allocator>::vector()
        _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
    : __begin_(nullptr),
      __size_(0),
      __cap_alloc_(0)
{
}

template <class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<bool, _Allocator>::vector(const allocator_type& __a)
    : __begin_(nullptr),
      __size_(0),
      __cap_alloc_(0, static_cast<__storage_allocator>(__a))
{
}



#if _LIBCPP_STD_VER > 11
template <class _Allocator>
{
    size_type __n = static_cast<size_type>(__il.size());
    if (__n > 0)
    {
        allocate(__n);
        __construct_at_end(__il.begin(), __il.end());
    }
}

#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 2678 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3

template <class _Allocator>
vector<bool, _Allocator>::~vector()
{
    if (__begin_ != nullptr)
        __storage_traits::deallocate(__alloc(), __begin_, __cap());
    __invalidate_all_iterators();
}







#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<bool, _Allocator>::vector(vector&& __v)
        _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
    : __begin_(__v.__begin_),
      __size_(__v.__size_),
      __cap_alloc_(__v.__cap_alloc_)
{
    __v.__begin_ = nullptr;
    __v.__size_ = 0;
    __v.__cap() = 0;
}

template <class _Allocator>
vector<bool, _Allocator>::vector(vector&& __v, const allocator_type& __a)
    : __begin_(nullptr),
      __size_(0),
      __cap_alloc_(0, __a)
{
    if (__a == allocator_type(__v.__alloc()))
    {
        this->__begin_ = __v.__begin_;
        this->__size_ = __v.__size_;
        this->__cap() = __v.__cap();
        __v.__begin_ = nullptr;
        __v.__cap() = __v.__size_ = 0;
    }
    else if (__v.size() > 0)
    {
        allocate(__v.size());
        __construct_at_end(__v.begin(), __v.end());
    }
}

template <class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
vector<bool, _Allocator>&
vector<bool, _Allocator>::operator=(vector&& __v)
        _NOEXCEPT_(
             __alloc_traits::propagate_on_container_move_assignment::value &&
             is_nothrow_move_assignable<allocator_type>::value)
{
    __move_assign(__v, integral_constant<bool,
          __storage_traits::propagate_on_container_move_assignment::value>());
    return *this;
}

template <class _Allocator>
void
vector<bool, _Allocator>::__move_assign(vector& __c, false_type)
{
    if (__alloc() != __c.__alloc())
    __c.__cap() = __c.__size_ = 0;
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2808 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3







template <class _Allocator>
void
vector<bool, _Allocator>::reserve(size_type __n)
{
    if (__n > capacity())
    {
        vector __v(this->__alloc());
        __v.allocate(__n);
        __v.__construct_at_end(this->begin(), this->end());
        swap(__v);
        __invalidate_all_iterators();
    }
}

template <class _Allocator>
void
vector<bool, _Allocator>::shrink_to_fit() _NOEXCEPT
{
    if (__external_cap_to_internal(size()) > __cap())
    {
#ifndef _LIBCPP_NO_EXCEPTIONS
        try
        {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 2891 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
            vector(*this, allocator_type(__alloc())).swap(*this);
#ifndef _LIBCPP_NO_EXCEPTIONS
        }
        catch (...)
        {
        }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 2898 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
    }
}



template <class _Allocator>
typename vector<bool, _Allocator>::const_reference
vector<bool, _Allocator>::at(size_type __n) const
{
    if (__n >= size())
        this->__throw_out_of_range();
    return (*this)[__n];
}

template <class _Allocator>
void
vector<bool, _Allocator>::push_back(const value_type& __x)
{
    if (this->__size_ == this->capacity())
        reserve(__recommend(this->__size_ + 1));
    ++this->__size_;
    back() = __x;
}

template <class _Allocator>
typename vector<bool, _Allocator>::iterator
vector<bool, _Allocator>::insert(const_iterator __position, const value_type& __x)
{
    iterator __r;
    if (size() < capacity())
    {
        const_iterator __old_end = end();
        ++__size_;
        _VSTD::copy_backward(__position, __old_end, end());
        __r = __const_iterator_cast(__position);
    }
    else
    {
        vector __v(__alloc());
        __v.reserve(__recommend(__size_ + 1));
        __v.__size_ = __size_ + 1;
        __r = _VSTD::copy(cbegin(), __position, __v.begin());
        _VSTD::copy_backward(__position, cend(), __v.end());
        swap(__v);
    }
    *__r = __x;
    return __r;
}

template <class _Allocator>
typename vector<bool, _Allocator>::iterator
vector<bool, _Allocator>::insert(const_iterator __position, size_type __n, const value_type& __x)
{
    iterator __r;
    size_type __c = capacity();
    if (__n <= __c && size() <= __c - __n)
    {
        const_iterator __old_end = end();
        __size_ += __n;
        _VSTD::copy_backward(__position, __old_end, end());
        __r = __const_iterator_cast(__position);
    }
    else
    {
        vector __v(__alloc());
        __v.reserve(__recommend(__size_ + __n));
        __v.__size_ = __size_ + __n;
        __r = _VSTD::copy(cbegin(), __position, __v.begin());
        _VSTD::copy_backward(__position, cend(), __v.end());
        swap(__v);
    }
    _VSTD::fill_n(__r, __n, __x);
    return __r;
}





template <class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename vector<bool, _Allocator>::iterator
vector<bool, _Allocator>::erase(const_iterator __position)
{
    iterator __r = __const_iterator_cast(__position);
    _VSTD::copy(__position + 1, this->cend(), __r);
    --__size_;
    return __r;
}



template <class _Allocator>
void
vector<bool, _Allocator>::swap(vector& __x)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<allocator_type>::value)
{
    _VSTD::swap(this->__begin_, __x.__begin_);
    _VSTD::swap(this->__size_, __x.__size_);
    _VSTD::swap(this->__cap(), __x.__cap());
    __swap_alloc(this->__alloc(), __x.__alloc());
}



template <class _Allocator>
void
vector<bool, _Allocator>::flip() _NOEXCEPT
{
    // do middle whole words
    size_type __n = __size_;
    __storage_pointer __p = __begin_;
    for (; __n >= __bits_per_word; ++__p, __n -= __bits_per_word)
        *__p = ~*__p;
    // do last partial word
    if (__n > 0)
    {
        __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
        __storage_type __b = *__p & __m;
        *__p &= ~__m;
        *__p |= ~__b & __m;
    }
}



template <class _Allocator>
size_t
vector<bool, _Allocator>::__hash_code() const _NOEXCEPT
{
    size_t __h = 0;
    // do middle whole words
    size_type __n = __size_;
    __storage_pointer __p = __begin_;
    for (; __n >= __bits_per_word; ++__p, __n -= __bits_per_word)
        __h ^= *__p;
    // do last partial word
    if (__n > 0)
    {
        const __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
        __h ^= *__p & __m;
    }
    return __h;
}

template <class _Allocator>
struct _LIBCPP_TYPE_VIS_ONLY hash<vector<bool, _Allocator> >
    : public unary_function<vector<bool, _Allocator>, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(const vector<bool, _Allocator>& __vec) const _NOEXCEPT
        {return __vec.__hash_code();}
};

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator==(const vector<_Tp, _Allocator>& __x, const vector<_Tp, _Allocator>& __y)
{
    const typename vector<_Tp, _Allocator>::size_type __sz = __x.size();
    return __sz == __y.size() && _VSTD::equal(__x.begin(), __x.end(), __y.begin());
}





_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_VECTOR
# 3247 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/vector" 3
# 10 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMCanvasRenderingContext2D.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMCanvasRenderingContext2D.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMCanvasRenderingContext2D.idl
 */

#ifndef __gen_nsIDOMCanvasRenderingContext2D_h__
#define __gen_nsIDOMCanvasRenderingContext2D_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISupports.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsISupports.idl
 */

#ifndef __gen_nsISupports_h__
#define __gen_nsISupports_h__


#ifndef __gen_nsrootidl_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsrootidl.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsrootidl.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsrootidl.idl
 */

#ifndef __gen_nsrootidl_h__
#define __gen_nsrootidl_h__

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 12 "../../dist/include/nsrootidl.h"

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nscore.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nscore_h___
#define nscore_h___

/**
 * Make sure that we have the proper platform specific
 * c++ definitions needed by nscore.h
 */
#ifndef _XPCOM_CONFIG_H_
#if 0 /* expanded by -frewrite-includes */
#include "xpcom-config.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/xpcom-config.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Global defines needed by xpcom clients */

#ifndef _XPCOM_CONFIG_H_
#define _XPCOM_CONFIG_H_

/* Define this to throw() if the compiler complains about 
 * constructors returning NULL
 */
#define CPP_THROW_NEW throw()

/* Define if the c++ compiler can resolve ambiguity with |using| */
#define HAVE_CPP_AMBIGUITY_RESOLVING_USING 1

/* Define if a dyanmic_cast to void* gives the most derived object */
/* #undef HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR */

/* Define to either __attribute__((malloc)) or nothing */
#define NS_ATTR_MALLOC __attribute__((malloc))

/* Define to either __attribute__((warn_unused_result)) or nothing */
#define NS_WARN_UNUSED_RESULT __attribute__((warn_unused_result))

/* Define to a string describing the XPCOM ABI in use */
#define TARGET_XPCOM_ABI "arm-oabi-gcc3"

#endif /* _XPCOM_CONFIG_H_ */
# 31 "../../dist/include/xpcom-config.h"
# 16 "../../dist/include/nscore.h" 2
#endif
# 17 "../../dist/include/nscore.h"

/* Definitions of functions and operators that allocate memory. */
#if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
#if 0 /* expanded by -frewrite-includes */
#  include "mozilla/mozalloc.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/mozalloc.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: sw=4 ts=4 et :
 */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_mozalloc_h
#define mozilla_mozalloc_h

/*
 * https://bugzilla.mozilla.org/show_bug.cgi?id=427099
 */

#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/mozalloc.h"
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/mozalloc.h"
#if defined(__cplusplus)
#if 0 /* expanded by -frewrite-includes */
#  include <new>
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/mozalloc.h"
#endif
# 20 "../../dist/include/mozilla/mozalloc.h"
#if 0 /* expanded by -frewrite-includes */
#include "xpcom-config.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/mozalloc.h"

#if defined(__cplusplus)
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/fallible.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/fallible.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_fallible_h
#define mozilla_fallible_h

#if defined(__cplusplus)

/* Explicit fallible allocation
 *
 * Memory allocation (normally) defaults to abort in case of failed
 * allocation. That is, it never returns NULL, and crashes instead.
 *
 * Code can explicitely request for fallible memory allocation thanks
 * to the declarations below.
 *
 * The typical use of the mozilla::fallible const is with placement new,
 * like the following:
 *
 *     foo = new (mozilla::fallible) Foo();
 *
 *     Foo foo;
 *     foo.Method(nullptr, mozilla::fallible);
 *
 * If that last method call is in a method that itself takes a const
 * fallible_t& argument, it is recommended to propagate that argument
 * instead of using mozilla::fallible:
 *
 *     void Func(Foo &foo, const mozilla::fallible_t& aFallible) {
 *         foo.Method(nullptr, aFallible);
 *     }
 *
 */
namespace mozilla {

struct fallible_t { };

/* This symbol is kept unexported, such that in corner cases where the
 * compiler can't remove its use (essentially, cross compilation-unit
 * calls), the smallest machine code is used.
 * Depending how the linker packs symbols, it will consume between 1 and
 * 8 bytes of read-only data in each executable or shared library, but
 * only in those where it's actually not optimized out by the compiler.
 */
extern const fallible_t fallible;

} // namespace mozilla
#endif
# 66 "../../dist/include/mozilla/fallible.h"

#endif // mozilla_fallible_h
# 68 "../../dist/include/mozilla/fallible.h"
# 24 "../../dist/include/mozilla/mozalloc.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TemplateLib.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/TemplateLib.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Reusable template meta-functions on types and compile-time values.  Meta-
 * functions are placed inside the 'tl' namespace to avoid conflict with non-
 * meta functions of the same name (e.g., mozilla::tl::FloorLog2 vs.
 * mozilla::FloorLog2).
 *
 * When constexpr support becomes universal, we should probably use that instead
 * of some of these templates, for simplicity.
 */

#ifndef mozilla_TemplateLib_h
#define mozilla_TemplateLib_h

#if 0 /* expanded by -frewrite-includes */
#include <limits.h>
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/TemplateLib.h"
#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
#define _WCHAR_T
#if defined(_MSC_EXTENSIONS)
#define _WCHAR_T_DEFINED
#endif
# 64 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 65 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WCHAR_TYPE__ wchar_t;
#endif
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
__WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
#if defined(__need_wint_t)
/* Always define wint_t when modules are available. */
#if !defined(_WINT_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 22 "../../dist/include/mozilla/TemplateLib.h" 2

namespace mozilla {

namespace tl {

/** Compute min/max. */
template<size_t I, size_t J>
struct Min
{
  static const size_t value = I < J ? I : J;
};
template<size_t I, size_t J>
struct Max
{
  static const size_t value = I > J ? I : J;
};

/** Compute floor(log2(i)). */
template<size_t I>
struct FloorLog2
{
  static const size_t value = 1 + FloorLog2<I / 2>::value;
};
template<> struct FloorLog2<0> { /* Error */ };
template<> struct FloorLog2<1> { static const size_t value = 0; };

/** Compute ceiling(log2(i)). */
template<size_t I>
struct CeilingLog2
{
  static const size_t value = FloorLog2<2 * I - 1>::value;
};

/** Round up to the nearest power of 2. */
template<size_t I>
struct RoundUpPow2
{
  static const size_t value = size_t(1) << CeilingLog2<I>::value;
};
template<>
struct RoundUpPow2<0>
{
  static const size_t value = 1;
};

/** Compute the number of bits in the given unsigned type. */
template<typename T>
struct BitSize
{
  static const size_t value = sizeof(T) * CHAR_BIT;
};

/**
 * Produce an N-bit mask, where N <= BitSize<size_t>::value.  Handle the
 * language-undefined edge case when N = BitSize<size_t>::value.
 */
template<size_t N>
struct NBitMask
{
  // Assert the precondition.  On success this evaluates to 0.  Otherwise it
  // triggers divide-by-zero at compile time: a guaranteed compile error in
  // C++11, and usually one in C++98.  Add this value to |value| to assure
  // its computation.
  static const size_t checkPrecondition =
    0 / size_t(N < BitSize<size_t>::value);
  static const size_t value = (size_t(1) << N) - 1 + checkPrecondition;
};
template<>
struct NBitMask<BitSize<size_t>::value>
{
  static const size_t value = size_t(-1);
};

/**
 * For the unsigned integral type size_t, compute a mask M for N such that
 * for all X, !(X & M) implies X * N will not overflow (w.r.t size_t)
 */
template<size_t N>
struct MulOverflowMask
{
  static const size_t value =
    ~NBitMask<BitSize<size_t>::value - CeilingLog2<N>::value>::value;
};
template<> struct MulOverflowMask<0> { /* Error */ };
template<> struct MulOverflowMask<1> { static const size_t value = 0; };

} // namespace tl

} // namespace mozilla

#endif /* mozilla_TemplateLib_h */
# 113 "../../dist/include/mozilla/TemplateLib.h"
# 25 "../../dist/include/mozilla/mozalloc.h" 2
#endif
# 26 "../../dist/include/mozilla/mozalloc.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#else
# 40 "../../dist/include/mozilla/mozalloc.h"
#  define MOZALLOC_EXPORT
#endif
# 42 "../../dist/include/mozilla/mozalloc.h"


#if defined(MOZ_ALWAYS_INLINE_EVEN_DEBUG)
#  define MOZALLOC_INLINE MOZ_ALWAYS_INLINE_EVEN_DEBUG
#elif defined(HAVE_FORCEINLINE)
# 47 "../../dist/include/mozilla/mozalloc.h"
#  define MOZALLOC_INLINE __forceinline
#else
# 49 "../../dist/include/mozilla/mozalloc.h"
#  define MOZALLOC_INLINE inline
#endif
# 51 "../../dist/include/mozilla/mozalloc.h"

/* Workaround build problem with Sun Studio 12 */
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#  undef NS_WARN_UNUSED_RESULT
#  define NS_WARN_UNUSED_RESULT
#  undef NS_ATTR_MALLOC
#  define NS_ATTR_MALLOC
#endif
# 59 "../../dist/include/mozilla/mozalloc.h"

#if defined(__cplusplus)
extern "C" {
#endif /* ifdef __cplusplus */
# 63 "../../dist/include/mozilla/mozalloc.h"


/*
 * Each pair of declarations below is analogous to a "standard"
 * allocation function, except that the out-of-memory handling is made
 * explicit.  The |moz_x| versions will never return a NULL pointer;
 * if memory is exhausted, they abort.  The |moz_| versions may return
 * NULL pointers if memory is exhausted: their return value must be
 * checked.
 *
 * All these allocation functions are *guaranteed* to return a pointer
 * to memory allocated in such a way that that memory can be freed by
 * passing that pointer to |moz_free()|.
 */

MOZALLOC_EXPORT
void moz_free(void* ptr);

MOZALLOC_EXPORT void* moz_xmalloc(size_t size)
    NS_ATTR_MALLOC NS_WARN_UNUSED_RESULT;

MOZALLOC_EXPORT
void* moz_malloc(size_t size)
    NS_ATTR_MALLOC NS_WARN_UNUSED_RESULT;


MOZALLOC_EXPORT void* moz_xcalloc(size_t nmemb, size_t size)
    NS_ATTR_MALLOC NS_WARN_UNUSED_RESULT;

MOZALLOC_EXPORT void* moz_calloc(size_t nmemb, size_t size)
    NS_ATTR_MALLOC NS_WARN_UNUSED_RESULT;



#if defined(HAVE_STRNDUP)
MOZALLOC_EXPORT char* moz_xstrndup(const char* str, size_t strsize)
    NS_ATTR_MALLOC NS_WARN_UNUSED_RESULT;

MOZALLOC_EXPORT char* moz_strndup(const char* str, size_t strsize)
#endif /* if defined(HAVE_VALLOC) */
# 147 "../../dist/include/mozilla/mozalloc.h"


#ifdef __cplusplus
} /* extern "C" */
#endif /* ifdef __cplusplus */
# 152 "../../dist/include/mozilla/mozalloc.h"


#ifdef __cplusplus

/*
 * We implement the default operators new/delete as part of
 * libmozalloc, replacing their definitions in libstdc++.  The
 * operator new* definitions in libmozalloc will never return a NULL
 * pointer.
 *
 * Each operator new immediately below returns a pointer to memory
 * that can be delete'd by any of
 *
 *   (1) the matching infallible operator delete immediately below
 *   (2) the matching "fallible" operator delete further below
 *   (3) the matching system |operator delete(void*, std::nothrow)|
 *   (4) the matching system |operator delete(void*) throw(std::bad_alloc)|
 *
 * malloc/calloc/realloc/free.
 */
class InfallibleAllocPolicy
{
public:
    

    

    

    

    
};

#endif  /* ifdef __cplusplus */
# 342 "../../dist/include/mozilla/mozalloc.h"

#endif /* ifndef mozilla_mozalloc_h */
# 344 "../../dist/include/mozilla/mozalloc.h"
# 21 "../../dist/include/nscore.h" 2
#endif
# 22 "../../dist/include/nscore.h"

/**
 * Incorporate the integer data types which XPCOM uses.
 */
#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
#define _WCHAR_T
#if defined(_MSC_EXTENSIONS)
#define _WCHAR_T_DEFINED
#endif
# 64 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 65 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WCHAR_TYPE__ wchar_t;
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 68 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/nscore.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefCountType.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/RefCountType.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_RefCountType_h
#define mozilla_RefCountType_h
typedef uintptr_t MozRefCountType;

/*
 * This is the return type for AddRef() and Release() in nsISupports.
 * IUnknown of COM returns an unsigned long from equivalent functions.
 *
 * The following ifdef exists to maintain binary compatibility with
 * IUnknown, the base interface in Microsoft COM.
 */
#ifdef XP_WIN
typedef unsigned long MozExternalRefCountType;
#else
# 34 "../../dist/include/mozilla/RefCountType.h"
typedef uint32_t MozExternalRefCountType;
#endif
# 36 "../../dist/include/mozilla/RefCountType.h"

#endif
# 38 "../../dist/include/mozilla/RefCountType.h"
# 30 "../../dist/include/nscore.h" 2

/* Core XPCOM declarations. */

/*----------------------------------------------------------------------*/
/* Import/export defines */

#ifdef HAVE_VISIBILITY_HIDDEN_ATTRIBUTE
#define NS_VISIBILITY_HIDDEN   __attribute__ ((visibility ("hidden")))
#else
# 39 "../../dist/include/nscore.h"
#define NS_VISIBILITY_HIDDEN
#endif
# 41 "../../dist/include/nscore.h"

#if defined(HAVE_VISIBILITY_ATTRIBUTE)
#define NS_VISIBILITY_DEFAULT __attribute__ ((visibility ("default")))
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# 45 "../../dist/include/nscore.h"
#define NS_VISIBILITY_DEFAULT __global
#else
# 47 "../../dist/include/nscore.h"
#define NS_VISIBILITY_DEFAULT
#endif
# 49 "../../dist/include/nscore.h"

#define NS_HIDDEN_(type)   NS_VISIBILITY_HIDDEN type
#define NS_EXTERNAL_VIS_(type) NS_VISIBILITY_DEFAULT type

#define NS_HIDDEN           NS_VISIBILITY_HIDDEN
#define NS_EXTERNAL_VIS     NS_VISIBILITY_DEFAULT

/**
 * Mark a function as using a potentially non-standard function calling
 * convention.  This can be used on functions that are called very
 * frequently, to reduce the overhead of the function call.  It is still worth
 * using the macro for C++ functions which take no parameters since it allows
 * passing |this| in a register.
 *
 *  - Do not use this on any scriptable interface method since xptcall won't be
 *    aware of the different calling convention.
 *  - This must appear on the declaration, not the definition.
 *  - Adding this to a public function _will_ break binary compatibility.
 *  - This may be used on virtual functions but you must ensure it is applied
 *    to all implementations - the compiler will _not_ warn but it will crash.
 *  - This has no effect for functions which take a variable number of
 *    arguments.
 *  - __fastcall on windows should not be applied to class
 *    constructors/destructors - use the NS_CONSTRUCTOR_FASTCALL macro for
 *    constructors/destructors.
 *
 * Examples: int NS_FASTCALL func1(char *foo);
 *           NS_HIDDEN_(int) NS_FASTCALL func2(char *foo);
 */

#if defined(__i386__) && defined(__GNUC__)
#define NS_FASTCALL __attribute__ ((regparm (3), stdcall))
#define NS_CONSTRUCTOR_FASTCALL __attribute__ ((regparm (3), stdcall))
#elif defined(XP_WIN) && !defined(_WIN64)
# 83 "../../dist/include/nscore.h"
#define NS_FASTCALL __fastcall
#define NS_CONSTRUCTOR_FASTCALL
#else
# 86 "../../dist/include/nscore.h"
#define NS_FASTCALL
#define NS_CONSTRUCTOR_FASTCALL
#endif
# 89 "../../dist/include/nscore.h"

#ifdef XP_WIN

#define NS_IMPORT __declspec(dllimport)
#define NS_IMPORT_(type) __declspec(dllimport) type __stdcall
#define NS_EXPORT __declspec(dllexport)
#define NS_EXPORT_(type) __declspec(dllexport) type __stdcall
#define NS_IMETHOD_(type) virtual type __stdcall
#define NS_IMETHODIMP_(type) type __stdcall
 */

#define NS_EXPORT_STATIC_MEMBER_(type) type
#define NS_IMPORT_STATIC_MEMBER_(type) type

#else
# 118 "../../dist/include/nscore.h"

#define NS_IMPORT NS_EXTERNAL_VIS
#define NS_IMPORT_(type) NS_EXTERNAL_VIS_(type)
#define NS_EXPORT NS_EXTERNAL_VIS
#define NS_EXPORT_(type) NS_EXTERNAL_VIS_(type)
#define NS_IMETHOD_(type) virtual type
#define NS_IMETHODIMP_(type) type
#define NS_METHOD_(type) type
#define NS_CALLBACK_(_type, _name) _type (* _name)
#define NS_STDCALL
#define NS_FROZENCALL
#define NS_EXPORT_STATIC_MEMBER_(type) NS_EXTERNAL_VIS_(type)
#define NS_IMPORT_STATIC_MEMBER_(type) NS_EXTERNAL_VIS_(type)

#endif
# 133 "../../dist/include/nscore.h"

/**
 * Macro for creating typedefs for pointer-to-member types which are
 * declared with stdcall.  It is important to use this for any type which is
 * declared as stdcall (i.e. NS_IMETHOD).  For example, instead of writing:
 *
# define MOZ_DEPRECATED __declspec(deprecated)
#else
# 169 "../../dist/include/nscore.h"
# define MOZ_DEPRECATED
#endif
# 171 "../../dist/include/nscore.h"

/**
 * Printf style formats
 */
#ifdef __GNUC__
#define MOZ_FORMAT_PRINTF(stringIndex, firstToCheck)  \
    __attribute__ ((format (printf, stringIndex, firstToCheck)))
#else
# 179 "../../dist/include/nscore.h"
#define MOZ_FORMAT_PRINTF(stringIndex, firstToCheck)
#endif
# 181 "../../dist/include/nscore.h"

/**
 * Generic API modifiers which return the standard XPCOM nsresult type
 */
#define NS_IMETHOD          NS_IMETHOD_(nsresult)
#define NS_IMETHODIMP       NS_IMETHODIMP_(nsresult)
#define NS_METHOD           NS_METHOD_(nsresult)
#define NS_CALLBACK(_name)  NS_CALLBACK_(nsresult, _name)

/**
 * Import/Export macros for XPCOM APIs
 */

#ifdef __cplusplus
#define NS_EXTERN_C extern "C"
#else
# 197 "../../dist/include/nscore.h"
#define NS_EXTERN_C
#endif
# 199 "../../dist/include/nscore.h"

#define EXPORT_XPCOM_API(type) NS_EXTERN_C NS_EXPORT type NS_FROZENCALL
#define IMPORT_XPCOM_API(type) NS_EXTERN_C NS_IMPORT type NS_FROZENCALL
#define GLUE_XPCOM_API(type) NS_EXTERN_C NS_HIDDEN_(type) NS_FROZENCALL

#ifdef IMPL_LIBXUL
#define XPCOM_API(type) EXPORT_XPCOM_API(type)
#elif defined(XPCOM_GLUE)
# 207 "../../dist/include/nscore.h"
#define XPCOM_API(type) GLUE_XPCOM_API(type)
#else
# 209 "../../dist/include/nscore.h"
#define XPCOM_API(type) IMPORT_XPCOM_API(type)
#endif
# 211 "../../dist/include/nscore.h"

#ifdef MOZILLA_INTERNAL_API
   /*
     The frozen string API has different definitions of nsAC?String
     classes than the internal API. On systems that explicitly declare
     dllexport symbols this is not a problem, but on ELF systems
     internal symbols can accidentally "shine through"; we rename the
     internal classes to avoid symbol conflicts.
   */
#  define nsAString nsAString_internal
#  define nsACString nsACString_internal
#endif
# 223 "../../dist/include/nscore.h"

#if (defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
/* Make refcnt logging part of the build. This doesn't mean that
 * actual logging will occur (that requires a separate enable; see
 * nsTraceRefcnt and nsISupportsImpl.h for more information).  */
#define NS_BUILD_REFCNT_LOGGING
#endif
# 230 "../../dist/include/nscore.h"

/* If NO_BUILD_REFCNT_LOGGING is defined then disable refcnt logging
 * in the build. This overrides FORCE_BUILD_REFCNT_LOGGING. */
#if defined(NO_BUILD_REFCNT_LOGGING)
#undef NS_BUILD_REFCNT_LOGGING
#endif
# 236 "../../dist/include/nscore.h"

/* If a program allocates memory for the lifetime of the app, it doesn't make
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsError.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsError_h__
#define nsError_h__

#ifndef __cplusplus
#error nsError.h no longer supports C sources
#endif
# 13 "../../dist/include/nsError.h"
#ifndef mozilla_Likely_h
#define mozilla_Likely_h

#if defined(__clang__) || defined(__GNUC__)
#  define MOZ_LIKELY(x)   (__builtin_expect(!!(x), 1))
#  define MOZ_UNLIKELY(x) (__builtin_expect(!!(x), 0))
#else
# 19 "../../dist/include/mozilla/Likely.h"
#  define MOZ_LIKELY(x)   (!!(x))
#  define MOZ_UNLIKELY(x) (!!(x))
#endif
# 22 "../../dist/include/mozilla/Likely.h"

#endif /* mozilla_Likely_h */
# 24 "../../dist/include/mozilla/Likely.h"
# 15 "../../dist/include/nsError.h" 2

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsError.h"

/*
 * To add error code to your module, you need to do the following:
 *
 * 1) Add a module offset code.  Add yours to the bottom of the list
 *    right below this comment, adding 1.
 *
 * 2) In your module, define a header file which uses one of the
 *    NE_ERROR_GENERATExxxxxx macros.  Some examples below:
 *
 *    #define NS_ERROR_MYMODULE_MYERROR1 NS_ERROR_GENERATE(NS_ERROR_SEVERITY_ERROR,NS_ERROR_MODULE_MYMODULE,1)
 *    #define NS_ERROR_MYMODULE_MYERROR2 NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_MYMODULE,2)
 *    #define NS_ERROR_MYMODULE_MYERROR3 NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_MYMODULE,3)
 *
 */


/**
 * @name Standard Module Offset Code. Each Module should identify a unique number
 *       and then all errors associated with that module become offsets from the
 *       base associated with that module id. There are 16 bits of code bits for
 *       each module.
 */

#define NS_ERROR_MODULE_XPCOM      1
#define NS_ERROR_MODULE_BASE       2
#define NS_ERROR_MODULE_GFX        3
#define NS_ERROR_MODULE_WIDGET     4
#define NS_ERROR_MODULE_CALENDAR   5
#define NS_ERROR_MODULE_NETWORK    6
#define NS_ERROR_MODULE_PLUGINS    7
#define NS_ERROR_MODULE_LAYOUT     8
#define NS_ERROR_MODULE_HTMLPARSER 9
#define NS_ERROR_MODULE_RDF        10
#define NS_ERROR_MODULE_UCONV      11
#define NS_ERROR_MODULE_REG        12
#define NS_ERROR_MODULE_FILES      13
#define NS_ERROR_MODULE_DOM        14
#define NS_ERROR_MODULE_IMGLIB     15
#define NS_ERROR_MODULE_MAILNEWS   16
#define NS_ERROR_MODULE_EDITOR     17
#define NS_ERROR_MODULE_XPCONNECT  18
#define NS_ERROR_MODULE_PROFILE    19
#define NS_ERROR_MODULE_LDAP       20
#define NS_ERROR_MODULE_SECURITY   21
#define NS_ERROR_MODULE_DOM_XPATH  22
/* 23 used to be NS_ERROR_MODULE_DOM_RANGE (see bug 711047) */
#define NS_ERROR_MODULE_URILOADER  24
#define NS_ERROR_MODULE_CONTENT    25
#define NS_ERROR_MODULE_PYXPCOM    26
#define NS_ERROR_MODULE_XSLT       27
#define NS_ERROR_MODULE_IPC        28
#define NS_ERROR_MODULE_SVG        29
#define NS_ERROR_MODULE_STORAGE    30
#define NS_ERROR_MODULE_SCHEMA     31
#define NS_ERROR_MODULE_DOM_FILE   32
#define NS_ERROR_MODULE_DOM_INDEXEDDB 33
#define NS_ERROR_MODULE_DOM_FILEHANDLE 34
#define NS_ERROR_MODULE_SIGNED_JAR 35
#define NS_ERROR_MODULE_DOM_FILESYSTEM 36
#define NS_ERROR_MODULE_DOM_BLUETOOTH 37
#define NS_ERROR_MODULE_SIGNED_APP 38

/* NS_ERROR_MODULE_GENERAL should be used by modules that do not
 * care if return code values overlap. Callers of methods that
 * return such codes should be aware that they are not
 * globally unique. Implementors should be careful about blindly
 * returning codes from other modules that might also use
 * the generic base.
 */
#define NS_ERROR_MODULE_GENERAL    51

/**
 * @name Severity Code.  This flag identifies the level of warning
 */

#define NS_ERROR_SEVERITY_SUCCESS       0
#define NS_ERROR_SEVERITY_ERROR         1

/**
 * @name Mozilla Code.  This flag separates consumers of mozilla code
 *       from the native platform
 */

#define NS_ERROR_MODULE_BASE_OFFSET 0x45

/* Helpers for defining our enum, to be undef'd later */
#define SUCCESS_OR_FAILURE(sev, module, code) \
  ((uint32_t)(sev) << 31) | \
  ((uint32_t)(module + NS_ERROR_MODULE_BASE_OFFSET) << 16) | \
  (uint32_t)(code)
#define SUCCESS(code) \
  SUCCESS_OR_FAILURE(NS_ERROR_SEVERITY_SUCCESS, MODULE, code)
#define FAILURE(code) \
  SUCCESS_OR_FAILURE(NS_ERROR_SEVERITY_ERROR, MODULE, code)

/**
 * @name Standard return values
 */

/*@{*/

enum class nsresult : uint32_t
{
  #undef ERROR
  #define ERROR(key, val) key = val
  #if 0 /* expanded by -frewrite-includes */
#include "ErrorList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/ErrorList.h" 1
// IWYU pragma: private, include "nsError.h"
/* Helper file for nsError.h, via preprocessor magic */
  /* Standard "it worked" return value */
  ERROR(NS_OK,  0),

  /* ======================================================================= */
  /* Core errors, not part of any modules */
  /* ======================================================================= */
  ERROR(NS_ERROR_BASE,                          0xC1F30000),
  /* Returned when an instance is not initialized */
  ERROR(NS_ERROR_NOT_INITIALIZED,               NS_ERROR_BASE + 1),
  /* Returned when an instance is already initialized */
  ERROR(NS_ERROR_ALREADY_INITIALIZED,           NS_ERROR_BASE + 2),
  /* Returned by a not implemented function */
  ERROR(NS_ERROR_NOT_IMPLEMENTED,               0x80004001),
  /* Returned when a given interface is not supported. */
  ERROR(NS_NOINTERFACE,                         0x80004002),
  ERROR(NS_ERROR_NO_INTERFACE,                  NS_NOINTERFACE),
  /* Returned when a function aborts */
  ERROR(NS_ERROR_ABORT,                         0x80004004),
  /* Returned when a function fails */
  ERROR(NS_ERROR_FAILURE,                       0x80004005),
  /* Returned when an unexpected error occurs */
  ERROR(NS_ERROR_UNEXPECTED,                    0x8000ffff),
  /* Returned when a memory allocation fails */
  ERROR(NS_ERROR_OUT_OF_MEMORY,                 0x8007000e),
  /* Returned when an illegal value is passed */
  ERROR(NS_ERROR_ILLEGAL_VALUE,                 0x80070057),
  ERROR(NS_ERROR_INVALID_ARG,                   NS_ERROR_ILLEGAL_VALUE),
  ERROR(NS_ERROR_INVALID_POINTER,               NS_ERROR_INVALID_ARG),
  ERROR(NS_ERROR_NULL_POINTER,                  NS_ERROR_INVALID_ARG),
  /* Returned when a class doesn't allow aggregation */
  ERROR(NS_ERROR_NO_AGGREGATION,                0x80040110),
  /* Returned when an operation can't complete due to an unavailable resource */
  ERROR(NS_ERROR_NOT_AVAILABLE,                 0x80040111),
  /* Returned when a class is not registered */
  ERROR(NS_ERROR_FACTORY_NOT_REGISTERED,        0x80040154),
  /* Returned when a class cannot be registered, but may be tried again later */
  ERROR(NS_ERROR_FACTORY_REGISTER_AGAIN,        0x80040155),
  /* Returned when a dynamically loaded factory couldn't be found */
  ERROR(NS_ERROR_FACTORY_NOT_LOADED,            0x800401f8),
  /* Returned when a factory doesn't support signatures */
  ERROR(NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT,  NS_ERROR_BASE + 0x101),
  /* Returned when a factory already is registered */
  ERROR(NS_ERROR_FACTORY_EXISTS,                NS_ERROR_BASE + 0x100),


  /* ======================================================================= */
  /* 1: NS_ERROR_MODULE_XPCOM */
  /* ======================================================================= */
#define MODULE NS_ERROR_MODULE_XPCOM
  /* Result codes used by nsIVariant */
  ERROR(NS_ERROR_CANNOT_CONVERT_DATA,       FAILURE(1)),
  ERROR(NS_ERROR_OBJECT_IS_IMMUTABLE,       FAILURE(2)),
  ERROR(NS_ERROR_LOSS_OF_SIGNIFICANT_DATA,  FAILURE(3)),
  /* Result code used by nsIThreadManager */
  ERROR(NS_ERROR_NOT_SAME_THREAD,           FAILURE(4)),
  /* Various operations are not permitted during XPCOM shutdown and will fail
   * with this exception. */
  ERROR(NS_ERROR_ILLEGAL_DURING_SHUTDOWN,   FAILURE(30)),
  ERROR(NS_ERROR_SERVICE_NOT_AVAILABLE,     FAILURE(22)),
  /* XXX really need to better rationalize these error codes.  are consumers of
#undef MODULE


  /* ======================================================================= */
  /* 14: NS_ERROR_MODULE_DOM */
  /* ======================================================================= */
#define MODULE NS_ERROR_MODULE_DOM
  /* XXX If you add a new DOM error code, also add an error string to
   * dom/base/domerr.msg */

  /* Standard DOM error codes: http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html */
  ERROR(NS_ERROR_DOM_INDEX_SIZE_ERR,               FAILURE(1)),
  ERROR(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR,        FAILURE(3)),
  ERROR(NS_ERROR_DOM_WRONG_DOCUMENT_ERR,           FAILURE(4)),
  ERROR(NS_ERROR_DOM_INVALID_CHARACTER_ERR,        FAILURE(5)),
  ERROR(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR,  FAILURE(7)),
  ERROR(NS_ERROR_DOM_NOT_FOUND_ERR,                FAILURE(8)),
  ERROR(NS_ERROR_DOM_NOT_SUPPORTED_ERR,            FAILURE(9)),
  ERROR(NS_ERROR_DOM_INUSE_ATTRIBUTE_ERR,          FAILURE(10)),
  ERROR(NS_ERROR_DOM_INVALID_STATE_ERR,            FAILURE(11)),
  ERROR(NS_ERROR_DOM_SYNTAX_ERR,                   FAILURE(12)),
  ERROR(NS_ERROR_DOM_INVALID_MODIFICATION_ERR,     FAILURE(13)),
  ERROR(NS_ERROR_DOM_NAMESPACE_ERR,                FAILURE(14)),
  ERROR(NS_ERROR_DOM_INVALID_ACCESS_ERR,           FAILURE(15)),
  ERROR(NS_ERROR_DOM_TYPE_MISMATCH_ERR,            FAILURE(17)),
  ERROR(NS_ERROR_DOM_SECURITY_ERR,                 FAILURE(18)),
  ERROR(NS_ERROR_DOM_NETWORK_ERR,                  FAILURE(19)),
  ERROR(NS_ERROR_DOM_ABORT_ERR,                    FAILURE(20)),
  ERROR(NS_ERROR_DOM_URL_MISMATCH_ERR,             FAILURE(21)),
  ERROR(NS_ERROR_DOM_QUOTA_EXCEEDED_ERR,           FAILURE(22)),
  ERROR(NS_ERROR_DOM_TIMEOUT_ERR,                  FAILURE(23)),
  ERROR(NS_ERROR_DOM_INVALID_NODE_TYPE_ERR,        FAILURE(24)),
  ERROR(NS_ERROR_DOM_DATA_CLONE_ERR,               FAILURE(25)),
  /* XXX Should be JavaScript native errors */
  ERROR(NS_ERROR_TYPE_ERR,                         FAILURE(26)),
  ERROR(NS_ERROR_RANGE_ERR,                        FAILURE(27)),
  /* StringEncoding API errors from http://wiki.whatwg.org/wiki/StringEncoding */
  ERROR(NS_ERROR_DOM_ENCODING_NOT_SUPPORTED_ERR,   FAILURE(28)),
  ERROR(NS_ERROR_DOM_INVALID_POINTER_ERR,          FAILURE(29)),
  /* WebCrypto API errors from http://www.w3.org/TR/WebCryptoAPI/ */
  ERROR(NS_ERROR_DOM_UNKNOWN_ERR,                  FAILURE(30)),
  ERROR(NS_ERROR_DOM_DATA_ERR,                     FAILURE(31)),
  ERROR(NS_ERROR_DOM_OPERATION_ERR,                FAILURE(32)),
  /* DOM error codes defined by us */
  ERROR(NS_ERROR_DOM_SECMAN_ERR,                   FAILURE(1001)),
  ERROR(NS_ERROR_DOM_WRONG_TYPE_ERR,               FAILURE(1002)),
  ERROR(NS_ERROR_DOM_NOT_OBJECT_ERR,               FAILURE(1003)),
  ERROR(NS_ERROR_DOM_NOT_XPC_OBJECT_ERR,           FAILURE(1004)),
  ERROR(NS_ERROR_DOM_NOT_NUMBER_ERR,               FAILURE(1005)),
  ERROR(NS_ERROR_DOM_NOT_BOOLEAN_ERR,              FAILURE(1006)),
  ERROR(NS_ERROR_DOM_NOT_FUNCTION_ERR,             FAILURE(1007)),
  ERROR(NS_ERROR_DOM_TOO_FEW_PARAMETERS_ERR,       FAILURE(1008)),
  ERROR(NS_ERROR_DOM_BAD_DOCUMENT_DOMAIN,          FAILURE(1009)),
  ERROR(NS_ERROR_DOM_PROP_ACCESS_DENIED,           FAILURE(1010)),
  ERROR(NS_ERROR_DOM_XPCONNECT_ACCESS_DENIED,      FAILURE(1011)),
  ERROR(NS_ERROR_DOM_BAD_URI,                      FAILURE(1012)),
  ERROR(NS_ERROR_DOM_RETVAL_UNDEFINED,             FAILURE(1013)),
  ERROR(NS_ERROR_DOM_QUOTA_REACHED,                FAILURE(1014)),
  ERROR(NS_ERROR_DOM_JS_EXCEPTION,                 FAILURE(1015)),

  /* A way to represent uncatchable exceptions */
  ERROR(NS_ERROR_UNCATCHABLE_EXCEPTION,            FAILURE(1016)),

  /* May be used to indicate when e.g. setting a property value didn't
   * actually change the value, like for obj.foo = "bar"; obj.foo = "bar";
   * the second assignment throws NS_SUCCESS_DOM_NO_OPERATION.
   */
  ERROR(NS_SUCCESS_DOM_NO_OPERATION,               SUCCESS(1)),
#undef MODULE


  /* ======================================================================= */
  /* 15: NS_ERROR_MODULE_IMGLIB */
  /* ======================================================================= */
#define MODULE NS_ERROR_MODULE_IMGLIB
  ERROR(NS_IMAGELIB_SUCCESS_LOAD_FINISHED,  SUCCESS(0)),
  ERROR(NS_IMAGELIB_CHANGING_OWNER,         SUCCESS(1)),

  ERROR(NS_IMAGELIB_ERROR_FAILURE,       FAILURE(5)),
  ERROR(NS_IMAGELIB_ERROR_NO_DECODER,    FAILURE(6)),
  ERROR(NS_IMAGELIB_ERROR_NOT_FINISHED,  FAILURE(7)),
  ERROR(NS_IMAGELIB_ERROR_NO_ENCODER,    FAILURE(9)),
#undef MODULE


  /* ======================================================================= */
  /* 17: NS_ERROR_MODULE_EDITOR */
  /* ======================================================================= */
#define MODULE NS_ERROR_MODULE_EDITOR
  ERROR(NS_ERROR_EDITOR_NO_SELECTION,  FAILURE(1)),
  ERROR(NS_ERROR_EDITOR_NO_TEXTNODE,   FAILURE(2)),
  ERROR(NS_FOUND_TARGET,               FAILURE(3)),

  ERROR(NS_EDITOR_ELEMENT_NOT_FOUND,   SUCCESS(1)),
#undef MODULE


  /* ======================================================================= */
  /* 18: NS_ERROR_MODULE_XPCONNECT */
  /* ======================================================================= */
#define MODULE NS_ERROR_MODULE_XPCONNECT
  ERROR(NS_ERROR_XPC_NOT_ENOUGH_ARGS,                  FAILURE(1)),
  ERROR(NS_ERROR_XPC_NEED_OUT_OBJECT,                  FAILURE(2)),
  ERROR(NS_ERROR_XPC_CANT_SET_OUT_VAL,                 FAILURE(3)),
  ERROR(NS_ERROR_XPC_NATIVE_RETURNED_FAILURE,          FAILURE(4)),
  ERROR(NS_ERROR_XPC_CANT_GET_INTERFACE_INFO,          FAILURE(5)),
  ERROR(NS_ERROR_XPC_CANT_GET_PARAM_IFACE_INFO,        FAILURE(6)),
  ERROR(NS_ERROR_XPC_CANT_GET_METHOD_INFO,             FAILURE(7)),
  ERROR(NS_ERROR_XPC_UNEXPECTED,                       FAILURE(8)),
  ERROR(NS_ERROR_XPC_BAD_CONVERT_JS,                   FAILURE(9)),
  ERROR(NS_ERROR_XPC_BAD_CONVERT_NATIVE,               FAILURE(10)),
  ERROR(NS_ERROR_XPC_BAD_CONVERT_JS_NULL_REF,          FAILURE(11)),
  ERROR(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO,               FAILURE(12)),
  ERROR(NS_ERROR_XPC_CANT_CONVERT_WN_TO_FUN,           FAILURE(13)),
  ERROR(NS_ERROR_XPC_CANT_DEFINE_PROP_ON_WN,           FAILURE(14)),
  ERROR(NS_ERROR_XPC_CANT_WATCH_WN_STATIC,             FAILURE(15)),
  ERROR(NS_ERROR_XPC_CANT_EXPORT_WN_STATIC,            FAILURE(16)),
  ERROR(NS_ERROR_XPC_SCRIPTABLE_CALL_FAILED,           FAILURE(17)),
  ERROR(NS_ERROR_XPC_SCRIPTABLE_CTOR_FAILED,           FAILURE(18)),
  ERROR(NS_ERROR_XPC_CANT_CALL_WO_SCRIPTABLE,          FAILURE(19)),
  ERROR(NS_ERROR_XPC_CANT_CTOR_WO_SCRIPTABLE,          FAILURE(20)),
  ERROR(NS_ERROR_XPC_CI_RETURNED_FAILURE,              FAILURE(21)),
  ERROR(NS_ERROR_XPC_GS_RETURNED_FAILURE,              FAILURE(22)),
  ERROR(NS_ERROR_XPC_BAD_CID,                          FAILURE(23)),
  ERROR(NS_ERROR_XPC_BAD_IID,                          FAILURE(24)),
  ERROR(NS_ERROR_XPC_CANT_CREATE_WN,                   FAILURE(25)),
  ERROR(NS_ERROR_XPC_JS_THREW_EXCEPTION,               FAILURE(26)),
  ERROR(NS_ERROR_XPC_JS_THREW_NATIVE_OBJECT,           FAILURE(27)),
  ERROR(NS_ERROR_XPC_JS_THREW_JS_OBJECT,               FAILURE(28)),
  ERROR(NS_ERROR_XPC_JS_THREW_NULL,                    FAILURE(29)),
  ERROR(NS_ERROR_XPC_JS_THREW_STRING,                  FAILURE(30)),
  ERROR(NS_ERROR_XPC_JS_THREW_NUMBER,                  FAILURE(31)),
  ERROR(NS_ERROR_XPC_JAVASCRIPT_ERROR,                 FAILURE(32)),
  ERROR(NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS,    FAILURE(33)),
  ERROR(NS_ERROR_XPC_CANT_CONVERT_PRIMITIVE_TO_ARRAY,  FAILURE(34)),
  ERROR(NS_ERROR_XPC_CANT_CONVERT_OBJECT_TO_ARRAY,     FAILURE(35)),
  ERROR(NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY,     FAILURE(36)),
  ERROR(NS_ERROR_XPC_CANT_GET_ARRAY_INFO,              FAILURE(37)),
  ERROR(NS_ERROR_XPC_NOT_ENOUGH_CHARS_IN_STRING,       FAILURE(38)),
  ERROR(NS_ERROR_XPC_SECURITY_MANAGER_VETO,            FAILURE(39)),
  ERROR(NS_ERROR_XPC_INTERFACE_NOT_SCRIPTABLE,         FAILURE(40)),
  ERROR(NS_ERROR_XPC_INTERFACE_NOT_FROM_NSISUPPORTS,   FAILURE(41)),
  ERROR(NS_ERROR_XPC_CANT_GET_JSOBJECT_OF_DOM_OBJECT,  FAILURE(42)),
  ERROR(NS_ERROR_XPC_CANT_SET_READ_ONLY_CONSTANT,      FAILURE(43)),
  ERROR(NS_ERROR_XPC_CANT_SET_READ_ONLY_ATTRIBUTE,     FAILURE(44)),
  ERROR(NS_ERROR_XPC_CANT_SET_READ_ONLY_METHOD,        FAILURE(45)),
  ERROR(NS_ERROR_XPC_CANT_ADD_PROP_TO_WRAPPED_NATIVE,  FAILURE(46)),
  ERROR(NS_ERROR_XPC_CALL_TO_SCRIPTABLE_FAILED,        FAILURE(47)),
  ERROR(NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED,   FAILURE(48)),
  ERROR(NS_ERROR_XPC_BAD_ID_STRING,                    FAILURE(49)),
  ERROR(NS_ERROR_XPC_BAD_INITIALIZER_NAME,             FAILURE(50)),
  ERROR(NS_ERROR_XPC_HAS_BEEN_SHUTDOWN,                FAILURE(51)),
  ERROR(NS_ERROR_XPC_CANT_MODIFY_PROP_ON_WN,           FAILURE(52)),
  ERROR(NS_ERROR_XPC_BAD_CONVERT_JS_ZERO_ISNOT_NULL,   FAILURE(53)),
  ERROR(NS_ERROR_XPC_CANT_PASS_CPOW_TO_NATIVE,         FAILURE(54)),
  /* any new errors here should have an associated entry added in xpc.msg */

  ERROR(NS_SUCCESS_I_DID_SOMETHING,      SUCCESS(1)),
#undef MODULE


  /* ======================================================================= */
  /* 19: NS_ERROR_MODULE_PROFILE */
  /* ======================================================================= */
#define MODULE NS_ERROR_MODULE_PROFILE
  ERROR(NS_ERROR_LAUNCHED_CHILD_PROCESS,  FAILURE(200)),
#undef MODULE


  /* ======================================================================= */
  /* 21: NS_ERROR_MODULE_SECURITY */
  /* ======================================================================= */
#define MODULE NS_ERROR_MODULE_SECURITY
  /* Error code for CSP */
  ERROR(NS_ERROR_CSP_FORM_ACTION_VIOLATION,        FAILURE(98)),
  /* ======================================================================= */
  /* 51: NS_ERROR_MODULE_GENERAL */
  /* ======================================================================= */
#define MODULE NS_ERROR_MODULE_GENERAL
  /* Error code used internally by the incremental downloader to cancel the
   * network channel when the download is already complete. */
  ERROR(NS_ERROR_DOWNLOAD_COMPLETE,      FAILURE(1)),
  /* Error code used internally by the incremental downloader to cancel the
   * network channel when the response to a range request is 200 instead of
   * 206. */
  ERROR(NS_ERROR_DOWNLOAD_NOT_PARTIAL,   FAILURE(2)),
  ERROR(NS_ERROR_UNORM_MOREOUTPUT,       FAILURE(33)),

  ERROR(NS_ERROR_DOCSHELL_REQUEST_REJECTED,  FAILURE(1001)),
  /* This is needed for displaying an error message when navigation is
   * attempted on a document when printing The value arbitrary as long as it
   * doesn't conflict with any of the other values in the errors in
   * DisplayLoadError */
  ERROR(NS_ERROR_DOCUMENT_IS_PRINTMODE,  FAILURE(2001)),

  ERROR(NS_SUCCESS_DONT_FIXUP,           SUCCESS(1)),
  /* This success code may be returned by nsIAppStartup::Run to indicate that
   * the application should be restarted.  This condition corresponds to the
   * case in which nsIAppStartup::Quit was called with the eRestart flag. */
  ERROR(NS_SUCCESS_RESTART_APP,          SUCCESS(1)),
  ERROR(NS_SUCCESS_RESTART_METRO_APP,    SUCCESS(2)),
  ERROR(NS_SUCCESS_RESTART_APP_NOT_SAME_PROFILE,    SUCCESS(3)),
  ERROR(NS_SUCCESS_UNORM_NOTFOUND,  SUCCESS(17)),


  /* a11y */
  /* raised when current pivot's position is needed but it's not in the tree */
  ERROR(NS_ERROR_NOT_IN_TREE,  FAILURE(38)),

  /* see nsTextEquivUtils */
  ERROR(NS_OK_NO_NAME_CLAUSE_HANDLED,  SUCCESS(34))
#undef MODULE
# 124 "../../dist/include/nsError.h" 2
  #undef ERROR
};

/*
 * enum classes don't place their initializers in the global scope, so we need
 * constants for compatibility with old code.
 */
const nsresult
  #define ERROR(key, val) key = nsresult::key
  #if 0 /* expanded by -frewrite-includes */
#include "ErrorList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/ErrorList.h" 1
// IWYU pragma: private, include "nsError.h"
/* Helper file for nsError.h, via preprocessor magic */
  /* Standard "it worked" return value */
  ERROR(NS_OK,  0),

  /* ======================================================================= */
  /* Core errors, not part of any modules */
  /* ======================================================================= */
  ERROR(NS_ERROR_BASE,                          0xC1F30000),
  /* Returned when an instance is not initialized */
  ERROR(NS_ERROR_NOT_INITIALIZED,               NS_ERROR_BASE + 1),
  /* Returned when an instance is already initialized */
  ERROR(NS_ERROR_ALREADY_INITIALIZED,           NS_ERROR_BASE + 2),
  /* Returned by a not implemented function */
  ERROR(NS_ERROR_NOT_IMPLEMENTED,               0x80004001),
  /* Returned when a given interface is not supported. */
  ERROR(NS_NOINTERFACE,                         0x80004002),
  ERROR(NS_ERROR_NO_INTERFACE,                  NS_NOINTERFACE),
  /* Returned when a function aborts */
  ERROR(NS_ERROR_ABORT,                         0x80004004),
  /* Returned when a function fails */
  ERROR(NS_ERROR_FAILURE,                       0x80004005),
  /* Returned when an unexpected error occurs */
  ERROR(NS_ERROR_UNEXPECTED,                    0x8000ffff),
  /* Returned when a memory allocation fails */
  ERROR(NS_ERROR_OUT_OF_MEMORY,                 0x8007000e),
  /* Returned when an illegal value is passed */
  ERROR(NS_ERROR_ILLEGAL_VALUE,                 0x80070057),
  ERROR(NS_ERROR_INVALID_ARG,                   NS_ERROR_ILLEGAL_VALUE),
  ERROR(NS_ERROR_INVALID_POINTER,               NS_ERROR_INVALID_ARG),
  ERROR(NS_ERROR_NULL_POINTER,                  NS_ERROR_INVALID_ARG),
  /* Returned when a class doesn't allow aggregation */
  ERROR(NS_ERROR_NO_AGGREGATION,                0x80040110),
  /* Returned when an operation can't complete due to an unavailable resource */
  ERROR(NS_ERROR_NOT_AVAILABLE,                 0x80040111),
  /* Returned when a class is not registered */
  ERROR(NS_ERROR_FACTORY_NOT_REGISTERED,        0x80040154),
  /* Returned when a class cannot be registered, but may be tried again later */
  ERROR(NS_ERROR_FACTORY_REGISTER_AGAIN,        0x80040155),
  /* Returned when a dynamically loaded factory couldn't be found */
  ERROR(NS_ERROR_FACTORY_NOT_LOADED,            0x800401f8),
  /* Returned when a factory doesn't support signatures */
  ERROR(NS_ERROR_FACTORY_NO_SIGNATURE_SUPPORT,  NS_ERROR_BASE + 0x101),
  /* Returned when a factory already is registered */
  ERROR(NS_ERROR_FACTORY_EXISTS,                NS_ERROR_BASE + 0x100),


  /* Standard DOM error codes: http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html */
  ERROR(NS_ERROR_DOM_INDEX_SIZE_ERR,               FAILURE(1)),
  ERROR(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR,        FAILURE(3)),
  ERROR(NS_ERROR_DOM_WRONG_DOCUMENT_ERR,           FAILURE(4)),
  ERROR(NS_ERROR_DOM_INVALID_CHARACTER_ERR,        FAILURE(5)),
  ERROR(NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR,  FAILURE(7)),
  ERROR(NS_ERROR_DOM_NOT_FOUND_ERR,                FAILURE(8)),
  ERROR(NS_ERROR_DOM_NOT_SUPPORTED_ERR,            FAILURE(9)),
  ERROR(NS_ERROR_DOM_INUSE_ATTRIBUTE_ERR,          FAILURE(10)),
  ERROR(NS_ERROR_DOM_INVALID_STATE_ERR,            FAILURE(11)),
  ERROR(NS_ERROR_DOM_SYNTAX_ERR,                   FAILURE(12)),
  ERROR(NS_ERROR_DOM_INVALID_MODIFICATION_ERR,     FAILURE(13)),
  ERROR(NS_ERROR_DOM_NAMESPACE_ERR,                FAILURE(14)),
  ERROR(NS_ERROR_DOM_INVALID_ACCESS_ERR,           FAILURE(15)),
  ERROR(NS_ERROR_DOM_TYPE_MISMATCH_ERR,            FAILURE(17)),
  ERROR(NS_ERROR_DOM_SECURITY_ERR,                 FAILURE(18)),
  ERROR(NS_ERROR_DOM_NETWORK_ERR,                  FAILURE(19)),
  ERROR(NS_ERROR_DOM_ABORT_ERR,                    FAILURE(20)),
  ERROR(NS_ERROR_DOM_URL_MISMATCH_ERR,             FAILURE(21)),
  ERROR(NS_ERROR_DOM_QUOTA_EXCEEDED_ERR,           FAILURE(22)),
  ERROR(NS_ERROR_DOM_TIMEOUT_ERR,                  FAILURE(23)),
  ERROR(NS_ERROR_DOM_INVALID_NODE_TYPE_ERR,        FAILURE(24)),
  ERROR(NS_ERROR_DOM_DATA_CLONE_ERR,               FAILURE(25)),
  /* XXX Should be JavaScript native errors */
  ERROR(NS_ERROR_TYPE_ERR,                         FAILURE(26)),
  ERROR(NS_ERROR_RANGE_ERR,                        FAILURE(27)),
  /* StringEncoding API errors from http://wiki.whatwg.org/wiki/StringEncoding */
  ERROR(NS_ERROR_DOM_ENCODING_NOT_SUPPORTED_ERR,   FAILURE(28)),
  ERROR(NS_ERROR_DOM_INVALID_POINTER_ERR,          FAILURE(29)),
  /* WebCrypto API errors from http://www.w3.org/TR/WebCryptoAPI/ */
  ERROR(NS_ERROR_DOM_RETVAL_UNDEFINED,             FAILURE(1013)),
  ERROR(NS_ERROR_DOM_QUOTA_REACHED,                FAILURE(1014)),
  ERROR(NS_ERROR_DOM_JS_EXCEPTION,                 FAILURE(1015)),

  /* A way to represent uncatchable exceptions */
  ERROR(NS_ERROR_UNCATCHABLE_EXCEPTION,            FAILURE(1016)),

  /* May be used to indicate when e.g. setting a property value didn't
   * actually change the value, like for obj.foo = "bar"; obj.foo = "bar";
   * the second assignment throws NS_SUCCESS_DOM_NO_OPERATION.
   */
  ERROR(NS_SUCCESS_DOM_NO_OPERATION,               SUCCESS(1)),
#undef MODULE


  /* ======================================================================= */
#define MODULE NS_ERROR_MODULE_EDITOR
  ERROR(NS_ERROR_EDITOR_NO_SELECTION,  FAILURE(1)),
  ERROR(NS_ERROR_EDITOR_NO_TEXTNODE,   FAILURE(2)),
  ERROR(NS_FOUND_TARGET,               FAILURE(3)),

  ERROR(NS_EDITOR_ELEMENT_NOT_FOUND,   SUCCESS(1)),
#undef MODULE


  /* ======================================================================= */
  /* 18: NS_ERROR_MODULE_XPCONNECT */
  /* ======================================================================= */
#define MODULE NS_ERROR_MODULE_XPCONNECT
  ERROR(NS_ERROR_XPC_NOT_ENOUGH_ARGS,                  FAILURE(1)),
  ERROR(NS_ERROR_XPC_NEED_OUT_OBJECT,                  FAILURE(2)),
  ERROR(NS_ERROR_XPC_CANT_SET_OUT_VAL,                 FAILURE(3)),
  ERROR(NS_ERROR_XPC_NATIVE_RETURNED_FAILURE,          FAILURE(4)),
  ERROR(NS_ERROR_XPC_CANT_GET_INTERFACE_INFO,          FAILURE(5)),
  ERROR(NS_ERROR_XPC_CANT_GET_PARAM_IFACE_INFO,        FAILURE(6)),
  ERROR(NS_ERROR_XPC_CANT_GET_METHOD_INFO,             FAILURE(7)),
  ERROR(NS_ERROR_XPC_UNEXPECTED,                       FAILURE(8)),
  ERROR(NS_ERROR_XPC_BAD_CONVERT_JS,                   FAILURE(9)),
  ERROR(NS_ERROR_XPC_BAD_CONVERT_NATIVE,               FAILURE(10)),
  ERROR(NS_ERROR_XPC_BAD_CONVERT_JS_NULL_REF,          FAILURE(11)),
  ERROR(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO,               FAILURE(12)),
  ERROR(NS_ERROR_XPC_CANT_CONVERT_WN_TO_FUN,           FAILURE(13)),
  ERROR(NS_ERROR_XPC_CANT_DEFINE_PROP_ON_WN,           FAILURE(14)),
  ERROR(NS_ERROR_XPC_CANT_WATCH_WN_STATIC,             FAILURE(15)),
  ERROR(NS_ERROR_XPC_CANT_EXPORT_WN_STATIC,            FAILURE(16)),
  ERROR(NS_ERROR_XPC_SCRIPTABLE_CALL_FAILED,           FAILURE(17)),
  ERROR(NS_ERROR_XPC_SCRIPTABLE_CTOR_FAILED,           FAILURE(18)),
  ERROR(NS_ERROR_XPC_CANT_CALL_WO_SCRIPTABLE,          FAILURE(19)),
  ERROR(NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY,     FAILURE(36)),
  ERROR(NS_ERROR_XPC_CANT_GET_ARRAY_INFO,              FAILURE(37)),
  ERROR(NS_ERROR_XPC_NOT_ENOUGH_CHARS_IN_STRING,       FAILURE(38)),
  ERROR(NS_ERROR_XPC_SECURITY_MANAGER_VETO,            FAILURE(39)),
  ERROR(NS_ERROR_XPC_INTERFACE_NOT_SCRIPTABLE,         FAILURE(40)),
  ERROR(NS_ERROR_XPC_INTERFACE_NOT_FROM_NSISUPPORTS,   FAILURE(41)),
  ERROR(NS_ERROR_XPC_CANT_GET_JSOBJECT_OF_DOM_OBJECT,  FAILURE(42)),
  ERROR(NS_ERROR_XPC_CANT_SET_READ_ONLY_CONSTANT,      FAILURE(43)),
  ERROR(NS_ERROR_XPC_CANT_SET_READ_ONLY_ATTRIBUTE,     FAILURE(44)),
  ERROR(NS_ERROR_XPC_CANT_SET_READ_ONLY_METHOD,        FAILURE(45)),
  ERROR(NS_ERROR_XPC_CANT_ADD_PROP_TO_WRAPPED_NATIVE,  FAILURE(46)),
  ERROR(NS_ERROR_XPC_CALL_TO_SCRIPTABLE_FAILED,        FAILURE(47)),
  ERROR(NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED,   FAILURE(48)),
  ERROR(NS_ERROR_XPC_BAD_ID_STRING,                    FAILURE(49)),
  ERROR(NS_ERROR_XPC_BAD_INITIALIZER_NAME,             FAILURE(50)),
  ERROR(NS_ERROR_XPC_HAS_BEEN_SHUTDOWN,                FAILURE(51)),
  /* see nsTextEquivUtils */
  ERROR(NS_OK_NO_NAME_CLAUSE_HANDLED,  SUCCESS(34))
#undef MODULE
# 134 "../../dist/include/nsError.h" 2
  #undef ERROR
;

#undef SUCCESS_OR_FAILURE
#undef SUCCESS
#undef FAILURE

/**
 * @name Standard Error Handling Macros
 * @return 0 or 1 (false/true with bool type for C++)
 */

inline uint32_t
NS_FAILED_impl(nsresult aErr)
{
  return static_cast<uint32_t>(aErr) & 0x80000000;
}
#define NS_FAILED(_nsresult)    ((bool)MOZ_UNLIKELY(NS_FAILED_impl(_nsresult)))
#define NS_SUCCEEDED(_nsresult) ((bool)MOZ_LIKELY(!NS_FAILED_impl(_nsresult)))

/* Check that our enum type is actually uint32_t as expected */
static_assert(((nsresult)0) < ((nsresult)-1),
              "nsresult must be an unsigned type");
static_assert(sizeof(nsresult) == sizeof(uint32_t),
              "nsresult must be 32 bits");

/**
 * @name Standard Error Generating Macros
  *
  ***********************************************************************
  *      Do not depend on this function. It will be going away!
  ***********************************************************************
  */
;


/**
 * @name Standard Macros for retrieving error bits
 */






#ifdef _MSC_VER
#pragma warning(disable: 4251) /* 'nsCOMPtr<class nsIInputStream>' needs to have dll-interface to be used by clients of class 'nsInputStream' */
#pragma warning(disable: 4275) /* non dll-interface class 'nsISupports' used as base for dll-interface class 'nsIRDFNode' */
#endif
# 212 "../../dist/include/nsError.h"

#endif
# 214 "../../dist/include/nsError.h"
# 266 "../../dist/include/nscore.h" 2

typedef MozRefCountType nsrefcnt;

/*
 * Use these macros to do 64bit safe pointer conversions.
 */

#define NS_PTR_TO_INT32(x) ((int32_t)(intptr_t)(x))
#define NS_PTR_TO_UINT32(x) ((uint32_t)(intptr_t)(x))
#define NS_INT32_TO_PTR(x) ((void*)(intptr_t)(x))

/*
 * Use NS_STRINGIFY to form a string literal from the value of a macro.
 */
#define NS_STRINGIFY_HELPER(x_) #x_
#define NS_STRINGIFY(x_) NS_STRINGIFY_HELPER(x_)

/*
 * If we're being linked as standalone glue, we don't want a dynamic
 * dependency on NSPR libs, so we skip the debug thread-safety
 * checks, and we cannot use the THREADSAFE_ISUPPORTS macros.
 */
#if defined(XPCOM_GLUE) && !defined(XPCOM_GLUE_USE_NSPR)
#define XPCOM_GLUE_AVOID_NSPR
#endif
# 291 "../../dist/include/nscore.h"
#endif
# 54 "../../dist/include/nsrootidl.h"

#endif /* __gen_nsrootidl_h__ */
# 56 "../../dist/include/nsrootidl.h"
# 11 "../../dist/include/nsISupports.h" 2
#endif
# 12 "../../dist/include/nsISupports.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
  NS_IMETHOD_(nsrefcnt) Release(void) MOZ_OVERRIDE; 
#include "nsISupportsBase.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISupportsBase.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsISupports.h"

#ifndef nsISupportsBase_h__
#define nsISupportsBase_h__

#ifndef nscore_h___
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsISupportsBase.h"
#endif
# 14 "../../dist/include/nsISupportsBase.h"

#ifndef nsID_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsID.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsID.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsID_h__
#define nsID_h__

#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsID.h"

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsID.h"

#define NSID_LENGTH 39

/**
 * A "unique identifier". This is modeled after OSF DCE UUIDs.
 */

struct nsID
{
  /**
   * @name Identifier values
   */

  //@{
  uint32_t m0;
  uint16_t m1;
  uint16_t m2;
  uint8_t m3[8];
  //@}

  /**
   * @name Methods
   */

  //@{
  /**
   * Equivalency method. Compares this nsID with another.
   * @return <b>true</b> if they are the same, <b>false</b> if not.
   */

  inline bool Equals(const nsID& aOther) const
  {
    // Unfortunately memcmp isn't faster than this.
    return
      (((uint32_t*)&m0)[0] == ((uint32_t*)&aOther.m0)[0]) &&
      (((uint32_t*)&m0)[1] == ((uint32_t*)&aOther.m0)[1]) &&
      (((uint32_t*)&m0)[2] == ((uint32_t*)&aOther.m0)[2]) &&
      (((uint32_t*)&m0)[3] == ((uint32_t*)&aOther.m0)[3]);
  }

  

  /**
   * nsID Parsing method. Turns a {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
   * string into an nsID
   */
  ;

#ifndef XPCOM_GLUE_AVOID_NSPR
  /**
   * nsID string encoder. Returns an allocated string in
   * {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} format. Caller should free string.
   * YOU SHOULD ONLY USE THIS IF YOU CANNOT USE ToProvidedString() BELOW.
   */
  ;

  /**
   * nsID string encoder. Builds a string in
   * {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} format, into a char[NSID_LENGTH]
   * buffer provided by the caller (for instance, on the stack).
   */
  ;

#endif // XPCOM_GLUE_AVOID_NSPR
# 80 "../../dist/include/nsID.h"

  //@}
};

/*
 * Class IDs
 */

typedef nsID nsCID;

// Define an CID
#define NS_DEFINE_CID(_name, _cidspec) \
  const nsCID _name = _cidspec

#define NS_DEFINE_NAMED_CID(_name) \
  static nsCID k##_name = _name

#define REFNSCID const nsCID&

/**
 * An "interface id" which can be used to uniquely identify a given
 * interface.
 */

typedef nsID nsIID;

/**
 * A macro shorthand for <tt>const nsIID&<tt>
 */

#define REFNSIID const nsIID&

/**
 * Define an IID
 * obsolete - do not use this macro
 */

#define NS_DEFINE_IID(_name, _iidspec) \
  const nsIID _name = _iidspec

/**
 * A macro to build the static const IID accessor method. The Dummy
 * template parameter only exists so that the kIID symbol will be linked
 * properly (weak symbol on linux, gnu_linkonce on mac, multiple-definitions
 * merged on windows). Dummy should always be instantiated as "void".
 */

#define NS_DECLARE_STATIC_IID_ACCESSOR(the_iid)                         \
  template<typename T, typename U>                                      \
  struct COMTypeInfo;

#define NS_DEFINE_STATIC_IID_ACCESSOR(the_interface, the_iid)           \
  template<typename T>                                                  \
  struct the_interface::COMTypeInfo<the_interface, T> {                 \
    static const nsIID kIID NS_HIDDEN;                                  \
  };                                                                    \
  template<typename T>                                                  \
  const nsIID the_interface::COMTypeInfo<the_interface, T>::kIID NS_HIDDEN = the_iid;

/**
 * A macro to build the static const CID accessor method
 */

#define NS_DEFINE_STATIC_CID_ACCESSOR(the_cid) \
  static const nsID& GetCID() {static const nsID cid = the_cid; return cid;}

#define NS_GET_IID(T) (T::COMTypeInfo<T, void>::kIID)
#define NS_GET_TEMPLATE_IID(T) (T::template COMTypeInfo<T, void>::kIID)

#endif
# 150 "../../dist/include/nsID.h"
# 17 "../../dist/include/nsISupportsBase.h" 2
#endif
# 18 "../../dist/include/nsISupportsBase.h"


/*@{*/
/**
 * IID for the nsISupports interface
 * {00000000-0000-0000-c000-000000000046}
 *
 * To maintain binary compatibility with COM's IUnknown, we define the IID
 * of nsISupports to be the same as that of COM's IUnknown.
 */
#define NS_ISUPPORTS_IID                                                      \
  { 0x00000000, 0x0000, 0x0000,                                               \
    {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} }

/**
 * Basic component object model interface. Objects which implement
 * this interface support runtime interface discovery (QueryInterface)
 * and a reference counted memory model (AddRef/Release). This is
 * modelled after the win32 IUnknown API.
 */
class NS_NO_VTABLE nsISupports
{
public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISUPPORTS_IID)

  /**
   * @name Methods
   */

  //@{
  /**
   * A run time mechanism for interface discovery.
   * @param aIID [in] A requested interface IID
   * @param aInstancePtr [out] A pointer to an interface pointer to
   * receive the result.
   * @return <b>NS_OK</b> if the interface is supported by the associated
   * instance, <b>NS_NOINTERFACE</b> if it is not.
   *
   * aInstancePtr must not be null.
   */
  NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) = 0;
  /**
   * Increases the reference count for this interface.
   * The associated instance will not be deleted unless
   * the reference count is returned to zero.
   *
   * @return The resulting reference count.
   */
  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0;

  /**
   * Decreases the reference count for this interface.
   * Generally, if the reference count returns to zero,
   * the associated instance is deleted.
   *
   * @return The resulting reference count.
   */
  NS_IMETHOD_(MozExternalRefCountType) Release(void) = 0;

  //@}
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsISupports, NS_ISUPPORTS_IID)

/*@}*/

#endif
# 86 "../../dist/include/nsISupportsBase.h"
# 123 "../../dist/include/nsISupports.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISupportsUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsISupportsUtils_h__
#define nsISupportsUtils_h__

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsISupportsUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsBase.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsISupportsUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsISupportsUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsDebug.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsDebug_h___
#define nsDebug_h___

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsDebug.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsDebug.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsXPCOM.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsXPCOM.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsXPCOM_h__
#define nsXPCOM_h__

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsXPCOM.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsXPCOMCID.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsXPCOMCID.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsXPCOMCID_h__
#define nsXPCOMCID_h__

/**
 * XPCOM Directory Service Contract ID
 *   The directory service provides ways to obtain file system locations. The
 *   directory service is a singleton.
 *
 *   This contract supports the nsIDirectoryService and the nsIProperties
 *   interfaces.
 *
 */
#define NS_DIRECTORY_SERVICE_CONTRACTID "@mozilla.org/file/directory_service;1"

/**
 * XPCOM File
 *   The file abstraction provides ways to obtain and access files and
 *   directories located on the local system.
 *
 *   This contract supports the nsIFile interface.
 *   This contract may also support platform specific interfaces such as
 *   nsILocalFileMac on platforms where additional interfaces are required.
 *
 */
#define NS_LOCAL_FILE_CONTRACTID "@mozilla.org/file/local;1"

/**
 * XPCOM Category Manager Contract ID
 *   The contract supports the nsICategoryManager interface. The
 *   category manager is a singleton.
 * The "enumerateCategory" method of nsICategoryManager will return an object
 * that implements nsIUTF8StringEnumerator. In addition, the enumerator will
 * return the entries in sorted order (sorted by byte comparison).
 */
#define NS_CATEGORYMANAGER_CONTRACTID   "@mozilla.org/categorymanager;1"

/**
 * XPCOM Properties Object Contract ID
 *   Simple mapping object which supports the nsIProperties interface.
 */
#define NS_PROPERTIES_CONTRACTID "@mozilla.org/properties;1"
#define NS_SUPPORTS_DOUBLE_CID \
{ 0xcbf86871, 0x4ac0, 0x11d3, \
{ 0xba, 0xea, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } }
#define NS_SUPPORTS_DOUBLE_CONTRACTID "@mozilla.org/supports-double;1"

#define NS_SUPPORTS_VOID_CID \
{ 0xaf10f3e0, 0x568d, 0x11d3, \
{ 0xba, 0xf8, 0x0, 0x80, 0x5f, 0x8a, 0x5d, 0xd7 } }
#define NS_SUPPORTS_VOID_CONTRACTID "@mozilla.org/supports-void;1"

#define NS_SUPPORTS_INTERFACE_POINTER_CID \
{ 0xA99FEBBA, 0x1DD1, 0x11B2, \
{ 0xA9, 0x43, 0xB0, 0x23, 0x34, 0xA6, 0xD0, 0x83 } }
#define NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID "@mozilla.org/supports-interface-pointer;1"

#endif
# 185 "../../dist/include/nsXPCOMCID.h"
# 11 "../../dist/include/nsXPCOM.h" 2

#ifdef __cplusplus
#define DECL_CLASS(c) class c
#define DECL_STRUCT(c) struct c
#else
# 16 "../../dist/include/nsXPCOM.h"
#define DECL_CLASS(c) typedef struct c c
#define DECL_STRUCT(c) typedef struct c c
#endif
# 19 "../../dist/include/nsXPCOM.h"

DECL_CLASS(nsAString);
DECL_CLASS(nsACString);

DECL_CLASS(nsISupports);
DECL_CLASS(nsIModule);
DECL_CLASS(nsIComponentManager);
DECL_CLASS(nsIComponentRegistrar);
DECL_CLASS(nsIServiceManager);
DECL_CLASS(nsIFile);
DECL_CLASS(nsILocalFile);
DECL_CLASS(nsIDirectoryServiceProvider);
DECL_CLASS(nsIMemory);
DECL_CLASS(nsIDebug);

#ifdef __cplusplus
namespace mozilla {
struct Module;
}
#endif
# 39 "../../dist/include/nsXPCOM.h"

/**
 * Initialises XPCOM. You must call one of the NS_InitXPCOM methods
 * before proceeding to use xpcom. The one exception is that you may
 * call NS_NewLocalFile to create a nsIFile.
 *
 * @note Use <CODE>NS_NewLocalFile</CODE> or <CODE>NS_NewNativeLocalFile</CODE>
 *       to create the file object you supply as the bin directory path in this
 *       call. The function may be safely called before the rest of XPCOM or
 *       embedding has been initialised.
 *
 * @param aResult          The service manager.  You may pass null.
XPCOM_API(void*) NS_Alloc(size_t aSize);

/**
 * Reallocates a block of memory to a new size.
 * Frees a block of memory. Null is a permissible value, in which case no
 * action is taken.
 *
 * @param aPtr  The block of memory to free. This block must originally have
 *              been allocated by NS_Alloc or NS_Realloc
 * @note        This function is thread-safe.
 */
XPCOM_API(void) NS_Free(void* aPtr);

/**
 * Support for warnings, assertions, and debugging breaks.
 */

enum
{
  NS_DEBUG_WARNING = 0,
  NS_DEBUG_ASSERTION = 1,
  NS_DEBUG_BREAK = 2,
  NS_DEBUG_ABORT = 3
};

/**
 * Print a runtime assertion. This function is available in both debug and
 * release builds.
 *
 * @note Based on the value of aSeverity and the XPCOM_DEBUG_BREAK
 * environment variable, this function may cause the application to
 * print the warning, print a stacktrace, break into a debugger, or abort
 * immediately.
 *
 * @param aSeverity A NS_DEBUG_* value
 * @param aStr   A readable error message (ASCII, may be null)
 * @param aExpr  The expression evaluated (may be null)
 * @param aFile  The source file containing the assertion (may be null)
 * @param aLine  The source file line number (-1 indicates no line number)
 */
XPCOM_API(void) NS_DebugBreak(uint32_t aSeverity,
                              const char* aStr, const char* aExpr,
                              const char* aFile, int32_t aLine);

/**
 * Perform a stack-walk to a debugging log under various
 * circumstances. Used to aid debugging of leaked object graphs.
 *
 * The NS_Log* functions are available in both debug and release
 * builds of XPCOM, but the output will be useless unless binary
 * debugging symbols for all modules in the stacktrace are available.
 */

/**
 * By default, refcount logging is enabled at NS_InitXPCOM and
 * refcount statistics are printed at NS_ShutdownXPCOM. NS_LogInit and
 * NS_LogTerm allow applications to enable logging earlier and delay
 * printing of logging statistics. They should always be used as a
 * matched pair.
 */
XPCOM_API(void) NS_LogInit();

XPCOM_API(void) NS_LogTerm();

/**
 * Log construction and destruction of objects. Processing tools can use the
 * stacktraces printed by these functions to identify objects that are being
 * leaked.
 *
 * @param aPtr          A pointer to the concrete object.
 * @param aTypeName     The class name of the type
 * @param aInstanceSize The size of the type
 */

XPCOM_API(void) NS_LogCtor(void* aPtr, const char* aTypeName,
                           uint32_t aInstanceSize);

XPCOM_API(void) NS_LogDtor(void* aPtr, const char* aTypeName,
                           uint32_t aInstanceSize);

/**
 * Log a stacktrace when an XPCOM object's refcount is incremented or
 * decremented. Processing tools can use the stacktraces printed by these
 * functions to identify objects that were leaked due to XPCOM references.
 *
 * @param aPtr          A pointer to the concrete object
 * @param aNewRefCnt    The new reference count.
 * @param aTypeName     The class name of the type
 * @param aInstanceSize The size of the type
 */
XPCOM_API(void) NS_LogAddRef(void* aPtr, nsrefcnt aNewRefCnt,
                             const char* aTypeName, uint32_t aInstanceSize);

XPCOM_API(void) NS_LogRelease(void* aPtr, nsrefcnt aNewRefCnt,
                              const char* aTypeName);

/**
 * Log reference counting performed by COMPtrs. Processing tools can
 * use the stacktraces printed by these functions to simplify reports
 * about leaked objects generated from the data printed by
 * NS_LogAddRef/NS_LogRelease.
 *
 * @param aCOMPtr the address of the COMPtr holding a strong reference
 * @param aObject the object being referenced by the COMPtr
 */

XPCOM_API(void) NS_LogCOMPtrAddRef(void* aCOMPtr, nsISupports* aObject);

XPCOM_API(void) NS_LogCOMPtrRelease(void* aCOMPtr, nsISupports* aObject);

/**
 * The XPCOM cycle collector analyzes and breaks reference cycles between
 * participating XPCOM objects. All objects in the cycle must implement
 * nsCycleCollectionParticipant to break cycles correctly.
 */

#ifdef __cplusplus

class nsCycleCollectionParticipant;
class nsCycleCollectingAutoRefCnt;

XPCOM_API(void) NS_CycleCollectorSuspect3(void* aPtr,
                                          nsCycleCollectionParticipant* aCp,
                                          nsCycleCollectingAutoRefCnt* aRefCnt,
                                          bool* aShouldDelete);

#endif
# 315 "../../dist/include/nsXPCOM.h"

/**
 * Categories (in the category manager service) used by XPCOM:
 */
# 15 "../../dist/include/mozilla/Assertions.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/Assertions.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Compiler.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/Assertions.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Likely.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/Assertions.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MacroArgs.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/MacroArgs.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Implements various macros meant to ease the use of variadic macros.
 */

#ifndef mozilla_MacroArgs_h
#define mozilla_MacroArgs_h

/*
 * Passing (__VA_ARGS__, <rest of arguments>) rather than simply calling
 * MOZ_MACROARGS_ARG_COUNT_HELPER2(__VA_ARGS__, <rest of arguments>) very
 * carefully tiptoes around a MSVC bug where it improperly expands __VA_ARGS__
 * as a single token in argument lists. For details, see:
 *
 *   http://connect.microsoft.com/VisualStudio/feedback/details/380090/variadic-macro-replacement
 *   http://cplusplus.co.il/2010/07/17/variadic-macro-to-count-number-of-arguments/#comment-644
 */
#define MOZ_PASTE_PREFIX_AND_ARG_COUNT(aPrefix, ...) \
  MOZ_MACROARGS_ARG_COUNT_HELPER((__VA_ARGS__, \
    aPrefix##50, aPrefix##49, aPrefix##48, aPrefix##47, aPrefix##46, \
    aPrefix##45, aPrefix##44, aPrefix##43, aPrefix##42, aPrefix##41, \
    aPrefix##40, aPrefix##39, aPrefix##38, aPrefix##37, aPrefix##36, \
    aPrefix##35, aPrefix##34, aPrefix##33, aPrefix##32, aPrefix##31, \
    aPrefix##30, aPrefix##29, aPrefix##28, aPrefix##27, aPrefix##26, \
    aPrefix##25, aPrefix##24, aPrefix##23, aPrefix##22, aPrefix##21, \
    aPrefix##20, aPrefix##19, aPrefix##18, aPrefix##17, aPrefix##16, \
    aPrefix##15, aPrefix##14, aPrefix##13, aPrefix##12, aPrefix##11, \
    aPrefix##10, aPrefix##9,  aPrefix##8,  aPrefix##7,  aPrefix##6,  \
    aPrefix##5,  aPrefix##4,  aPrefix##3,  aPrefix##2,  aPrefix##1, aPrefix##0))

#define MOZ_MACROARGS_ARG_COUNT_HELPER(aArgs) \
  MOZ_MACROARGS_ARG_COUNT_HELPER2 aArgs

#define MOZ_MACROARGS_ARG_COUNT_HELPER2( \
   a1,  a2,  a3,  a4,  a5,  a6,  a7,  a8,  a9, a10, \
  a11, a12, a13, a14, a15, a16, a17, a18, a19, a20, \
  a21, a22, a23, a24, a25, a26, a27, a28, a29, a30, \
  a31, a32, a33, a34, a35, a36, a37, a38, a39, a40, \
  a41, a42, a43, a44, a45, a46, a47, a48, a49, a50, \
  a51, ...) a51

/*
 * MOZ_STATIC_ASSERT_VALID_ARG_COUNT ensures that a compile-time error occurs
 * when the argument count constraints of MOZ_PASTE_PREFIX_AND_ARG_COUNT are
 * violated. Use this macro wherever MOZ_PASTE_PREFIX_AND_ARG_COUNT is used
 * and pass it the same variadic arguments.
 *
 * This macro employs a few dirty tricks to function. To detect the zero
 * argument case, |(__VA_ARGS__)| is stringified, sizeof-ed, and compared to
 * what it should be in the absence of arguments.
 *
 * Detecting too many arguments is a little trickier. With a valid argument
 * count and a prefix of 1, MOZ_PASTE_PREFIX_AND_ARG_COUNT expands to e.g. 14.
 * With a prefix of 0.0, it expands to e.g. 0.04. If there are too many
 * arguments, it expands to the first argument over the limit. If this
 * exceeding argument is a number, the assertion will fail as there is no
 * number than can simultaneously be both > 10 and == 0. If the exceeding
 * argument is not a number, a compile-time error should still occur due to
 * the operations performed on it.
 */
#define MOZ_MACROARGS_STRINGIFY_HELPER(x) #x
#define MOZ_STATIC_ASSERT_VALID_ARG_COUNT(...) \
  static_assert( \
    sizeof(MOZ_MACROARGS_STRINGIFY_HELPER((__VA_ARGS__))) != sizeof("()") && \
      (MOZ_PASTE_PREFIX_AND_ARG_COUNT(1, __VA_ARGS__)) > 10 && \
      (int)(MOZ_PASTE_PREFIX_AND_ARG_COUNT(0.0, __VA_ARGS__)) == 0, \
    "MOZ_STATIC_ASSERT_VALID_ARG_COUNT requires 1 to 50 arguments") /* ; */

/*
 * MOZ_ARGS_AFTER_N expands to its arguments excluding the first |N|
 * arguments. For example:
 *
 *   MOZ_ARGS_AFTER_2(a, b, c, d) expands to: c, d
 */
#define MOZ_ARGS_AFTER_1(a1, ...) __VA_ARGS__
#define MOZ_ARGS_AFTER_2(a1, a2, ...) __VA_ARGS__

/*
 * MOZ_ARG_N expands to its |N|th argument.
 */
#define MOZ_ARG_1(a1, ...) a1
#define MOZ_ARG_2(a1, a2, ...) a2

#endif /* mozilla_MacroArgs_h */
# 106 "../../dist/include/mozilla/MacroArgs.h"
# 20 "../../dist/include/mozilla/Assertions.h" 2
#ifdef MOZ_DUMP_ASSERTION_STACK
#if 0 /* expanded by -frewrite-includes */
#include "nsTraceRefcnt.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTraceRefcnt.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsTraceRefcnt_h___
#define nsTraceRefcnt_h___

#if 0 /* expanded by -frewrite-includes */
#include <stdio.h> // for FILE
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsTraceRefcnt.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsTraceRefcnt.h"

class nsTraceRefcnt
{
public:
  static void Shutdown();

  enum StatisticsType {
    ALL_STATS,
    NEW_STATS
  };

  static nsresult DumpStatistics(StatisticsType aType = ALL_STATS,
                                 FILE* aOut = 0);

  /**
   * 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.
   */
  static void SetActivityIsLegal(bool aLegal);
};

#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
namespace std { typedef decltype(nullptr) nullptr_t; }
using ::std::nullptr_t;
#endif
# 85 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#else
# 44 "../../dist/include/mozilla/Assertions.h"
#if 0 /* expanded by -frewrite-includes */
#  include <signal.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 1 3 4
/*
 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * 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.
 *
 *	@(#)signal.h	8.3 (Berkeley) 3/30/94
 */

#ifndef _USER_SIGNAL_H
#define _USER_SIGNAL_H

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 62 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 63 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/signal.h>
#endif /* expanded by -frewrite-includes */
# 64 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_types.h>
#endif /* expanded by -frewrite-includes */
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _PTHREAD_T
#define _PTHREAD_T
typedef __darwin_pthread_t pthread_t;
#endif /* _PTHREAD_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_t.h" 3 4
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 2 3 4

#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
extern __const char *__const sys_signame[NSIG];
extern __const char *__const sys_siglist[NSIG];
#endif
# 72 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 3 4

__BEGIN_DECLS
;
__END_DECLS

#ifndef	_ANSI_SOURCE
__BEGIN_DECLS
;
int	kill(pid_t, int) __DARWIN_ALIAS(kill);
int	killpg(pid_t, int) __DARWIN_ALIAS(killpg);
;
int	pthread_sigmask(int, const sigset_t *, sigset_t *) __DARWIN_ALIAS(pthread_sigmask);
;
;
int	sigaltstack(const stack_t * __restrict, stack_t * __restrict)  __DARWIN_ALIAS(sigaltstack);
;
;
;
;
;
;
;
int	sigpause(int) __DARWIN_ALIAS_C(sigpause);
;
;
;
; 
int	sigsuspend(const sigset_t *) __DARWIN_ALIAS_C(sigsuspend);
int	sigwait(const sigset_t * __restrict, int * __restrict) __DARWIN_ALIAS_C(sigwait);
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
;
;
;
int	sigvec(int, struct sigvec *, struct sigvec *);
#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 108 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 3 4
__END_DECLS

/* List definitions after function declarations, or Reiser cpp gets upset. */
#if defined(__i386__) || defined(__x86_64__)
/* The left shift operator on intel is modulo 32 */
__header_always_inline int
__sigbits(int __signo)
{
    return __signo > __DARWIN_NSIG ? 0 : (1 << (__signo - 1));
}
#else /* !__i386__ && !__x86_64__ */
# 119 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 3 4
#define __sigbits(signo)	(1 << ((signo) - 1))
#endif /* __i386__ || __x86_64__ */
# 121 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 3 4

#define	sigaddset(set, signo)	(*(set) |= __sigbits(signo), 0)
#define	sigdelset(set, signo)	(*(set) &= ~__sigbits(signo), 0)
#define	sigismember(set, signo)	((*(set) & __sigbits(signo)) != 0)
#define	sigemptyset(set)	(*(set) = 0, 0)
#define	sigfillset(set)		(*(set) = ~(sigset_t)0, 0)
#endif	/* !_ANSI_SOURCE */
# 128 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 3 4

#endif	/* !_USER_SIGNAL_H */
# 130 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/signal.h" 3 4
# 45 "../../dist/include/mozilla/Assertions.h" 2
#endif
# 46 "../../dist/include/mozilla/Assertions.h"
#ifdef ANDROID
#if 0 /* expanded by -frewrite-includes */
#  include <android/log.h>
#endif /* expanded by -frewrite-includes */
# 48 "../../dist/include/mozilla/Assertions.h"
#endif
# 49 "../../dist/include/mozilla/Assertions.h"

/*
 * MOZ_STATIC_ASSERT may be used to assert a condition *at compile time* in C.
 * In C++11, static_assert is provided by the compiler to the same effect.
 * This can be useful when you make certain assumptions about what must hold for
 * optimal, or even correct, behavior.  For example, you might assert that the
 * size of a struct is a multiple of the target architecture's word size:
 *
 *   struct S { ... };
 *   // C
 *   MOZ_STATIC_ASSERT(sizeof(S) % sizeof(size_t) == 0,
 *                     "S should be a multiple of word size for efficiency");
 *   // C++11
 *   static_assert(sizeof(S) % sizeof(size_t) == 0,
 *                 "S should be a multiple of word size for efficiency");
 *
 * This macro can be used in any location where both an extern declaration and a
 * typedef could be used.
 */
#ifndef __cplusplus
   /*
    * Some of the definitions below create an otherwise-unused typedef.  This
    * triggers compiler warnings with some versions of gcc, so mark the typedefs
    * as permissibly-unused to disable the warnings.
    */
#  if defined(__GNUC__)
      * avoid conflicts.  These should be rare: a conflict would require use of
      * MOZ_STATIC_ASSERT on the same line in separate files in the same
      * translation unit, *and* the uses would have to be in code with
      * different linkage, *and* the first observed use must be in C++-linkage
      * code.
      */
#    define MOZ_STATIC_ASSERT(cond, reason) \
       typedef int MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __COUNTER__)[(cond) ? 1 : -1] MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE
#  else
# 113 "../../dist/include/mozilla/Assertions.h"
#    define MOZ_STATIC_ASSERT(cond, reason) \
       extern void MOZ_STATIC_ASSERT_GLUE(moz_static_assert, __LINE__)(int arg[(cond) ? 1 : -1]) MOZ_STATIC_ASSERT_UNUSED_ATTRIBUTE
#  endif
# 116 "../../dist/include/mozilla/Assertions.h"

#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  MOZ_STATIC_ASSERT(!(cond) || (expr), reason)
#else
# 119 "../../dist/include/mozilla/Assertions.h"
#define MOZ_STATIC_ASSERT_IF(cond, expr, reason)  static_assert(!(cond) || (expr), reason)
#endif
# 121 "../../dist/include/mozilla/Assertions.h"

#ifdef __cplusplus
extern "C" {
#endif
# 125 "../../dist/include/mozilla/Assertions.h"

/*
 * Prints |aStr| as an assertion failure (using aFilename and aLine as the
 * location of the assertion) to the standard debug-output channel.
 *
 * Usually you should use MOZ_ASSERT or MOZ_CRASH instead of this method.  This
 * method is primarily for internal use in this header, and only secondarily
 * for use in implementing release-build assertions.
 */
static MOZ_COLD MOZ_ALWAYS_INLINE void
MOZ_ReportAssertionFailure(const char* aStr, const char* aFilename, int aLine)
  MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS
{
#ifdef ANDROID
  __android_log_print(ANDROID_LOG_FATAL, "MOZ_Assert",
                      "Assertion failure: %s, at %s:%d\n",
                      aStr, aFilename, aLine);
#else
# 143 "../../dist/include/mozilla/Assertions.h"
  fprintf(stderr, "Assertion failure: %s, at %s:%d\n", aStr, aFilename, aLine);
#ifdef MOZ_DUMP_ASSERTION_STACK
  nsTraceRefcnt::WalkTheStack(stderr);
#endif
# 147 "../../dist/include/mozilla/Assertions.h"
  fflush(stderr);
#endif
# 149 "../../dist/include/mozilla/Assertions.h"
}

static MOZ_COLD MOZ_ALWAYS_INLINE void
MOZ_ReportCrash(const char* aStr, const char* aFilename, int aLine)
  MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS
{
#ifdef ANDROID
  __android_log_print(ANDROID_LOG_FATAL, "MOZ_CRASH",
                      "Hit MOZ_CRASH(%s) at %s:%d\n", aStr, aFilename, aLine);
#else
# 159 "../../dist/include/mozilla/Assertions.h"
  fprintf(stderr, "Hit MOZ_CRASH(%s) at %s:%d\n", aStr, aFilename, aLine);
#ifdef MOZ_DUMP_ASSERTION_STACK
  nsTraceRefcnt::WalkTheStack(stderr);
#endif
# 163 "../../dist/include/mozilla/Assertions.h"
  fflush(stderr);
#endif
# 165 "../../dist/include/mozilla/Assertions.h"
}

/**
 * MOZ_REALLY_CRASH is used in the implementation of MOZ_CRASH().  You should
 * call MOZ_CRASH instead.
 */
#if defined(_MSC_VER)
   /*
    *
    * (Technically these are Windows requirements, not MSVC requirements.  But
    * practically you need MSVC for debugging, and we only ship builds created
    * by MSVC, so doing it this way reduces complexity.)
    */

__declspec(noreturn) __inline void MOZ_NoReturn() {}

#  ifdef __cplusplus
#    define MOZ_REALLY_CRASH() \
       do { \
         ::__debugbreak(); \
         *((volatile int*) NULL) = __LINE__; \
         ::TerminateProcess(::GetCurrentProcess(), 3); \
         ::MOZ_NoReturn(); \
       } while (0)
#  else
# 206 "../../dist/include/mozilla/Assertions.h"
#    define MOZ_REALLY_CRASH() \
       do { \
         __debugbreak(); \
         *((volatile int*) NULL) = __LINE__; \
         TerminateProcess(GetCurrentProcess(), 3); \
         MOZ_NoReturn(); \
       } while (0)
#  endif
# 214 "../../dist/include/mozilla/Assertions.h"
#else
# 215 "../../dist/include/mozilla/Assertions.h"
#  ifdef __cplusplus
#    define MOZ_REALLY_CRASH() \
       do { \
         *((volatile int*) NULL) = __LINE__; \
         ::abort(); \
       } while (0)
#  else
# 222 "../../dist/include/mozilla/Assertions.h"
#    define MOZ_REALLY_CRASH() \
       do { \
         *((volatile int*) NULL) = __LINE__; \
         abort(); \
       } while (0)
#  endif
# 228 "../../dist/include/mozilla/Assertions.h"
#endif
# 229 "../../dist/include/mozilla/Assertions.h"

/*
 * print anything; this is because we want MOZ_CRASH to be 100% safe in release
 * builds, and it's hard to print to stderr safely when memory might have been
 * corrupted.
 */
#ifndef DEBUG
#  define MOZ_CRASH(...) MOZ_REALLY_CRASH()
#else
# 254 "../../dist/include/mozilla/Assertions.h"
#  define MOZ_CRASH(...) \
     do { \
       MOZ_ReportCrash("" __VA_ARGS__, __FILE__, __LINE__); \
       MOZ_REALLY_CRASH(); \
     } while (0)
#endif
# 260 "../../dist/include/mozilla/Assertions.h"

#ifdef __cplusplus
} /* extern "C" */
#endif
# 264 "../../dist/include/mozilla/Assertions.h"

/*
 * MOZ_ASSERT(expr [, explanation-string]) asserts that |expr| must be truthy in
 * debug builds.  If it is, execution continues.  Otherwise, an error message
 * including the expression and the explanation-string (if provided) is printed,
 * an attempt is made to invoke any existing debugger, and execution halts.
 * MOZ_ASSERT is fatal: no recovery is possible.  Do not assert a condition
 * which can correctly be falsy.
 *
 * The optional explanation-string, if provided, must be a string literal
 * explaining the assertion.  It is intended for use with assertions whose
 * correctness or rationale is non-obvious, and for assertions where the "real"
 * accidentally passing something unintended in lieu of an assertion condition.
 */

#ifdef __cplusplus
#if 0 /* expanded by -frewrite-includes */
#  include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/TypeTraits.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Template-based metaprogramming and type-testing facilities. */

#ifndef mozilla_TypeTraits_h
#define mozilla_TypeTraits_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Types.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Types.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* mfbt foundational types and macros. */

#ifndef mozilla_Types_h
#define mozilla_Types_h

/*
 * This header must be valid C and C++, includable by code embedding either
 * SpiderMonkey or Gecko.
 */

/* Expose all <stdint.h> types and size_t. */
#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 *     int LuggageCombination = 12345;
 *
 * If you are merely sharing a method across files, just use plain |extern|.
 * These macros are designed for use by library interfaces -- not for normal
 * methods or data used cross-file.
 */
#if defined(WIN32)
#  define MOZ_EXPORT   __declspec(dllexport)
#else /* Unix */
# 43 "../../dist/include/mozilla/Types.h"
#  ifdef HAVE_VISIBILITY_ATTRIBUTE
#    define MOZ_EXPORT       __attribute__((visibility("default")))
#  elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# 46 "../../dist/include/mozilla/Types.h"
#    define MOZ_EXPORT      __global
#  else
# 48 "../../dist/include/mozilla/Types.h"
#    define MOZ_EXPORT /* nothing */
#  endif
# 50 "../../dist/include/mozilla/Types.h"
#endif
# 51 "../../dist/include/mozilla/Types.h"


/*
 * Whereas implementers use MOZ_EXPORT to declare and define library symbols,
 * users use MOZ_IMPORT_API and MOZ_IMPORT_DATA to access them.  Most often the
 * implementer of the library will expose an API macro which expands to either
 * the export or import version of the macro, depending upon the compilation
 * mode.
 */
#ifdef _WIN32
#  if defined(__MWERKS__)
#    define MOZ_IMPORT_API /* nothing */
#  else
# 64 "../../dist/include/mozilla/Types.h"
#    define MOZ_IMPORT_API __declspec(dllimport)
#  endif
# 66 "../../dist/include/mozilla/Types.h"
#else
# 67 "../../dist/include/mozilla/Types.h"
#  define MOZ_IMPORT_API MOZ_EXPORT
#endif
# 69 "../../dist/include/mozilla/Types.h"

#if defined(_WIN32) && !defined(__MWERKS__)
#  define MOZ_IMPORT_DATA  __declspec(dllimport)
#else
# 73 "../../dist/include/mozilla/Types.h"
#  define MOZ_IMPORT_DATA  MOZ_EXPORT
#endif
# 75 "../../dist/include/mozilla/Types.h"

/*
 * Consistent with the above comment, the MFBT_API and MFBT_DATA macros expose
 * export mfbt declarations when building mfbt, and they expose import mfbt
 * declarations when using mfbt.
 */
#if defined(IMPL_MFBT)
#  define MFBT_API     MOZ_EXPORT
#  define MFBT_DATA    MOZ_EXPORT
#else
# 85 "../../dist/include/mozilla/Types.h"
  /*
   * On linux mozglue is linked in the program and we link libxul.so with
   * -z,defs. Normally that causes the linker to reject undefined references in
   * libxul.so, but as a loophole it allows undefined references to weak
   * symbols. We add the weak attribute to the import version of the MFBT API
   * macros to exploit this.
   */
#  if defined(MOZ_GLUE_IN_PROGRAM)
#    define MFBT_API   __attribute__((weak)) MOZ_IMPORT_API
#    define MFBT_DATA  __attribute__((weak)) MOZ_IMPORT_DATA
#  else
# 96 "../../dist/include/mozilla/Types.h"
#    define MFBT_API   MOZ_IMPORT_API
#    define MFBT_DATA  MOZ_IMPORT_DATA
#  endif
# 99 "../../dist/include/mozilla/Types.h"
#endif
# 100 "../../dist/include/mozilla/Types.h"

/*
 * C symbols in C++ code must be declared immediately within |extern "C"|
 * blocks.  However, in C code, they need not be declared specially.  This
 * difference is abstracted behind the MOZ_BEGIN_EXTERN_C and MOZ_END_EXTERN_C
 * macros, so that the user need not know whether he is being used in C or C++
 * code.
 *
 *   MOZ_BEGIN_EXTERN_C
 *
 *   extern MOZ_EXPORT int MostRandomNumber(void);
 *   ...other declarations...
 *
 *   MOZ_END_EXTERN_C
 *
 * This said, it is preferable to just use |extern "C"| in C++ header files for
 * its greater clarity.
 */
#ifdef __cplusplus
#  define MOZ_BEGIN_EXTERN_C    extern "C" {
#  define MOZ_END_EXTERN_C      }
#else
# 122 "../../dist/include/mozilla/Types.h"
#  define MOZ_BEGIN_EXTERN_C
#  define MOZ_END_EXTERN_C
#endif
# 125 "../../dist/include/mozilla/Types.h"

/*
 * GCC's typeof is available when decltype is not.
 */
#if defined(__GNUC__) && defined(__cplusplus) && \
  !defined(__GXX_EXPERIMENTAL_CXX0X__) && __cplusplus < 201103L
#  define decltype __typeof__
#endif
# 133 "../../dist/include/mozilla/Types.h"

#endif /* mozilla_Types_h */
# 135 "../../dist/include/mozilla/Types.h"
# 13 "../../dist/include/mozilla/TypeTraits.h" 2

/*
 * These traits are approximate copies of the traits and semantics from C++11's
 * <type_traits> header.  Don't add traits not in that header!  When all
 * platforms provide that header, we can convert all users and remove this one.
 */

#if 0 /* expanded by -frewrite-includes */
#include <wchar.h>
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/TypeTraits.h"

namespace mozilla {

/* Forward declarations. */

template<typename> struct RemoveCV;

/* 20.9.3 Helper classes [meta.help] */

/**
 * Helper class used as a base for various type traits, exposed publicly
 * because <type_traits> exposes it as well.
 */
template<typename T, T Value>
struct IntegralConstant
{
  static const T value = Value;
  typedef T ValueType;
  typedef IntegralConstant<T, Value> Type;
};

/** Convenient aliases. */
typedef IntegralConstant<bool, true> TrueType;
typedef IntegralConstant<bool, false> FalseType;

/* 20.9.4 Unary type traits [meta.unary] */

/* 20.9.4.1 Primary type categories [meta.unary.cat] */

namespace detail {

template<typename T>
struct IsVoidHelper : FalseType {};

template<>
struct IsVoidHelper<void> : TrueType {};

} // namespace detail

/**
 * IsVoid determines whether a type is void.
 *
 * mozilla::IsVoid<int>::value is false;
 * mozilla::IsVoid<void>::value is true;
 * mozilla::IsVoid<void*>::value is false;
 * mozilla::IsVoid<volatile void>::value is true.
 */
template<typename T>
struct IsVoid : detail::IsVoidHelper<typename RemoveCV<T>::Type> {};

namespace detail {

template <typename T>
struct IsIntegralHelper : FalseType {};

template<> struct IsIntegralHelper<char>               : TrueType {};
template<> struct IsIntegralHelper<signed char>        : TrueType {};
template<> struct IsIntegralHelper<unsigned char>      : TrueType {};
template<> struct IsIntegralHelper<short>              : TrueType {};
template<> struct IsIntegralHelper<unsigned short>     : TrueType {};
template<> struct IsIntegralHelper<int>                : TrueType {};
template<> struct IsIntegralHelper<unsigned int>       : TrueType {};
template<> struct IsIntegralHelper<long>               : TrueType {};
template<> struct IsIntegralHelper<unsigned long>      : TrueType {};
template<> struct IsIntegralHelper<long long>          : TrueType {};
template<> struct IsIntegralHelper<unsigned long long> : TrueType {};
template<> struct IsIntegralHelper<bool>               : TrueType {};
template<> struct IsIntegralHelper<wchar_t>            : TrueType {};
#ifdef MOZ_CHAR16_IS_NOT_WCHAR
template<> struct IsIntegralHelper<char16_t>           : TrueType {};
#endif
# 92 "../../dist/include/mozilla/TypeTraits.h"

} /* namespace detail */

/**
 * IsIntegral determines whether a type is an integral type.
 *
 * mozilla::IsIntegral<int>::value is true;
 * mozilla::IsIntegral<unsigned short>::value is true;
 * mozilla::IsIntegral<const long>::value is true;
 * mozilla::IsIntegral<int*>::value is false;
 * mozilla::IsIntegral<double>::value is false;
 *
 * Note that the behavior of IsIntegral on char16_t and char32_t is
 * unspecified.
 */
template<typename T>
struct IsIntegral : detail::IsIntegralHelper<typename RemoveCV<T>::Type>
{};

template<typename T, typename U>
struct IsSame;

namespace detail {

template<typename T>
struct IsFloatingPointHelper
  : IntegralConstant<bool,
                     IsSame<T, float>::value ||
                     IsSame<T, double>::value ||
                     IsSame<T, long double>::value>
{};

} // namespace detail

/**
 * IsFloatingPoint determines whether a type is a floating point type (float,
 * double, long double).
 *
 * mozilla::IsFloatingPoint<int>::value is false;
 * mozilla::IsFloatingPoint<const float>::value is true;
 * mozilla::IsFloatingPoint<long double>::value is true;
 * mozilla::IsFloatingPoint<double*>::value is false.
 */
template<typename T>
struct IsFloatingPoint
  : detail::IsFloatingPointHelper<typename RemoveCV<T>::Type>
{};

namespace detail {

template<typename T>
struct IsArrayHelper : FalseType {};

template<typename T, decltype(sizeof(1)) N>
struct IsArrayHelper<T[N]> : TrueType {};

template<typename T>
struct IsArrayHelper<T[]> : TrueType {};

} // namespace detail

/**
 * IsArray determines whether a type is an array type, of known or unknown
 * length.
 *
 * mozilla::IsArray<int>::value is false;
 * mozilla::IsArray<int[]>::value is true;
 * mozilla::IsArray<int[5]>::value is true.
 */
template<typename T>
struct IsArray : detail::IsArrayHelper<typename RemoveCV<T>::Type>
{};

namespace detail {

template<typename T>
struct IsPointerHelper : FalseType {};

template<typename T>
struct IsPointerHelper<T*> : TrueType {};

} // namespace detail

/**
 * IsPointer determines whether a type is a possibly-CV-qualified pointer type
 * (but not a pointer-to-member type).
 *
 * mozilla::IsPointer<struct S*>::value is true;
 * mozilla::IsPointer<int*>::value is true;
 * mozilla::IsPointer<int**>::value is true;
 * mozilla::IsPointer<const int*>::value is true;
 * mozilla::IsPointer<int* const>::value is true;
 * mozilla::IsPointer<int* volatile>::value is true;
 * mozilla::IsPointer<void (*)(void)>::value is true;
 * mozilla::IsPointer<int>::value is false;
 * mozilla::IsPointer<struct S>::value is false.
 * mozilla::IsPointer<int(struct S::*)>::value is false
 */
template<typename T>
struct IsPointer : detail::IsPointerHelper<typename RemoveCV<T>::Type>
{};

/**
 * IsLvalueReference determines whether a type is an lvalue reference.
 *
 * mozilla::IsLvalueReference<struct S*>::value is false;
 * mozilla::IsLvalueReference<int**>::value is false;
 * mozilla::IsLvalueReference<void (*)(void)>::value is false;
 * mozilla::IsLvalueReference<int>::value is false;
 * mozilla::IsLvalueReference<struct S>::value is false;
 * mozilla::IsLvalueReference<struct S*&>::value is true;
 * mozilla::IsLvalueReference<struct S&&>::value is false.
 */
template<typename T>
struct IsLvalueReference : FalseType {};

template<typename T>
struct IsLvalueReference<T&> : TrueType {};

/**
 * IsRvalueReference determines whether a type is an rvalue reference.
 *
 * mozilla::IsRvalueReference<struct S*>::value is false;
 * mozilla::IsRvalueReference<int**>::value is false;
 * mozilla::IsRvalueReference<void (*)(void)>::value is false;
 * mozilla::IsRvalueReference<int>::value is false;
 * mozilla::IsRvalueReference<struct S>::value is false;
 * mozilla::IsRvalueReference<struct S*&>::value is false;
 * mozilla::IsRvalueReference<struct S&&>::value is true.
 */
template<typename T>
struct IsRvalueReference : FalseType {};

template<typename T>
struct IsRvalueReference<T&&> : TrueType {};

namespace detail {

// __is_enum is a supported extension across all of our supported compilers.
template<typename T>
struct IsEnumHelper
  : IntegralConstant<bool, __is_enum(T)>
{};

} // namespace detail

/**
 * IsEnum determines whether a type is an enum type.
 *
 * mozilla::IsEnum<enum S>::value is true;
 * mozilla::IsEnum<enum S*>::value is false;
 * mozilla::IsEnum<int>::value is false;
 */
template<typename T>
struct IsEnum
  : detail::IsEnumHelper<typename RemoveCV<T>::Type>
{};

namespace detail {

// __is_class is a supported extension across all of our supported compilers:
// http://llvm.org/releases/3.0/docs/ClangReleaseNotes.html
// http://gcc.gnu.org/onlinedocs/gcc-4.4.7/gcc/Type-Traits.html#Type-Traits
// http://msdn.microsoft.com/en-us/library/ms177194%28v=vs.100%29.aspx
template<typename T>
struct IsClassHelper
  : IntegralConstant<bool, __is_class(T)>
{};

} // namespace detail

/**
 * IsClass determines whether a type is a class type (but not a union).
 *
 * struct S {};
 * union U {};
 * mozilla::IsClass<int>::value is false;
 * mozilla::IsClass<const S>::value is true;
 * mozilla::IsClass<U>::value is false;
 */
template<typename T>
struct IsClass
  : detail::IsClassHelper<typename RemoveCV<T>::Type>
{};

/* 20.9.4.2 Composite type traits [meta.unary.comp] */

/**
 * IsReference determines whether a type is an lvalue or rvalue reference.
 *
 * mozilla::IsReference<struct S*>::value is false;
 * mozilla::IsReference<int**>::value is false;
 * mozilla::IsReference<int&>::value is true;
 * mozilla::IsReference<void (*)(void)>::value is false;
 * mozilla::IsReference<const int&>::value is true;
 * mozilla::IsReference<int>::value is false;
 * mozilla::IsReference<struct S>::value is false;
 * mozilla::IsReference<struct S&>::value is true;
 * mozilla::IsReference<struct S*&>::value is true;
 * mozilla::IsReference<struct S&&>::value is true.
 */
template<typename T>
struct IsReference
  : IntegralConstant<bool,
                     IsLvalueReference<T>::value || IsRvalueReference<T>::value>
{};

/**
 * IsArithmetic determines whether a type is arithmetic.  A type is arithmetic
 * iff it is an integral type or a floating point type.
 *
 * mozilla::IsArithmetic<int>::value is true;
 */
template<typename T>
struct IsConst : FalseType {};

template<typename T>
struct IsConst<const T> : TrueType {};

/**
 * IsVolatile determines whether a type is volatile or not.
 *
 * mozilla::IsVolatile<int>::value is false;
 * mozilla::IsVolatile<void* volatile>::value is true;
 * mozilla::IsVolatile<volatile char*>::value is false.
 */
template<typename T>
struct IsVolatile : FalseType {};

template<typename T>
struct IsVolatile<volatile T> : TrueType {};

/**
 * Traits class for identifying POD types.  Until C++11 there's no automatic
 * way to detect PODs, so for the moment this is done manually.  Users may
 * define specializations of this class that inherit from mozilla::TrueType and
 * mozilla::FalseType (or equivalently mozilla::IntegralConstant<bool, true or
 * false>, or conveniently from mozilla::IsPod for composite types) as needed to
 * ensure correct IsPod behavior.
 */
template<typename T>
struct IsPod : public FalseType {};

template<> struct IsPod<char>               : TrueType {};
template<> struct IsPod<signed char>        : TrueType {};
template<> struct IsPod<unsigned char>      : TrueType {};
template<> struct IsPod<short>              : TrueType {};
template<> struct IsPod<unsigned short>     : TrueType {};
template<> struct IsPod<int>                : TrueType {};
template<> struct IsPod<unsigned int>       : TrueType {};
template<> struct IsPod<long>               : TrueType {};
template<> struct IsPod<unsigned long>      : TrueType {};
template<> struct IsPod<long long>          : TrueType {};
template<> struct IsPod<unsigned long long> : TrueType {};
template<> struct IsPod<bool>               : TrueType {};
template<> struct IsPod<float>              : TrueType {};
template<> struct IsPod<double>             : TrueType {};
template<> struct IsPod<wchar_t>            : TrueType {};
#ifdef MOZ_CHAR16_IS_NOT_WCHAR
template<> struct IsPod<char16_t>           : TrueType {};
#endif
# 369 "../../dist/include/mozilla/TypeTraits.h"
template<typename T> struct IsPod<T*>       : TrueType {};

namespace detail {

// __is_empty is a supported extension across all of our supported compilers:
// http://llvm.org/releases/3.0/docs/ClangReleaseNotes.html
// http://gcc.gnu.org/onlinedocs/gcc-4.4.7/gcc/Type-Traits.html#Type-Traits
// http://msdn.microsoft.com/en-us/library/ms177194%28v=vs.100%29.aspx
template<typename T>
struct IsEmptyHelper
  : IntegralConstant<bool, IsClass<T>::value && __is_empty(T)>
{};

} // namespace detail

/**
 * IsEmpty determines whether a type is a class (but not a union) that is empty.
 *
 * A class is empty iff it and all its base classes have no non-static data
 * members (except bit-fields of length 0) and no virtual member functions, and
 * no base class is empty or a virtual base class.
 *
 * Intuitively, empty classes don't have any data that has to be stored in
 * instances of those classes.  (The size of the class must still be non-zero,
 * because distinct array elements of any type must have different addresses.
 * However, if the Empty Base Optimization is implemented by the compiler [most
 * compilers implement it, and in certain cases C++11 requires it], the size of
 * a class inheriting from an empty |Base| class need not be inflated by
 * |sizeof(Base)|.)  And intuitively, non-empty classes have data members and/or
 * vtable pointers that must be stored in each instance for proper behavior.
 *   struct NE2 : virtual E1 {};
 *   struct NE3 : E2 { virtual ~NE3() {} };
 *   struct NE4 { virtual void f() {} };
 *   static_assert(!mozilla::IsEmpty<NE1>::value &&
 *                 !mozilla::IsEmpty<NE2>::value &&
 *                 !mozilla::IsEmpty<NE3>::value &&
 *                 !mozilla::IsEmpty<NE4>::value,
 *                 "all empty");
 */
template<typename T>
struct IsEmpty : detail::IsEmptyHelper<typename RemoveCV<T>::Type>
{};


namespace detail {

template<typename T,
         bool = IsFloatingPoint<T>::value,
         bool = IsIntegral<T>::value,
         typename NoCV = typename RemoveCV<T>::Type>
struct IsSignedHelper;

// Floating point is signed.
template<typename T, typename NoCV>
struct IsSignedHelper<T, true, false, NoCV> : TrueType {};

// Integral is conditionally signed.
template<typename T, typename NoCV>
struct IsSignedHelper<T, false, true, NoCV>
  : IntegralConstant<bool, bool(NoCV(-1) < NoCV(1))>
{};

// Non-floating point, non-integral is not signed.
template<typename T, typename NoCV>
struct IsSignedHelper<T, false, false, NoCV> : FalseType {};

} // namespace detail

/**
 * IsSigned determines whether a type is a signed arithmetic type.  |char| is
 * considered a signed type if it has the same representation as |signed char|.
 *
 * mozilla::IsSigned<int>::value is true;
 * mozilla::IsSigned<const unsigned int>::value is false;
 * mozilla::IsSigned<unsigned char>::value is false;
 * mozilla::IsSigned<float>::value is true.
 */
template<typename T>
struct IsSigned : detail::IsSignedHelper<T> {};

namespace detail {

template<typename T,
         bool = IsFloatingPoint<T>::value,
         bool = IsIntegral<T>::value,
         typename NoCV = typename RemoveCV<T>::Type>
struct IsUnsignedHelper;

// Floating point is not unsigned.
template<typename T, typename NoCV>
struct IsUnsignedHelper<T, true, false, NoCV> : FalseType {};

// Integral is conditionally unsigned.
template<typename T, typename NoCV>
struct IsUnsignedHelper<T, false, true, NoCV>
  : IntegralConstant<bool,
                     (IsSame<NoCV, bool>::value || bool(NoCV(1) < NoCV(-1)))>
{};

// Non-floating point, non-integral is not unsigned.
template<typename T, typename NoCV>
struct IsUnsignedHelper<T, false, false, NoCV> : FalseType {};

} // namespace detail

/**
 * IsUnsigned determines whether a type is an unsigned arithmetic type.
 *
 * mozilla::IsUnsigned<int>::value is false;
 * mozilla::IsUnsigned<const unsigned int>::value is true;
 * mozilla::IsUnsigned<unsigned char>::value is true;
 * mozilla::IsUnsigned<float>::value is false.
 */
template<typename T>
struct IsUnsigned : detail::IsUnsignedHelper<T> {};

/* 20.9.5 Type property queries [meta.unary.prop.query] */

/* 20.9.6 Relationships between types [meta.rel] */

/**
 * IsSame tests whether two types are the same type.
 *
 * mozilla::IsSame<int, int>::value is true;
 * mozilla::IsSame<int*, int*>::value is true;
 * mozilla::IsSame<int, unsigned int>::value is false;
 * mozilla::IsSame<void, void>::value is true;
 * mozilla::IsSame<const int, int>::value is false;
 * mozilla::IsSame<struct S, struct S>::value is true.
 */
template<typename T, typename U>
struct IsSame : FalseType {};

template<typename T>
struct IsSame<T, T> : TrueType {};

namespace detail {

#if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)

template<class Base, class Derived>
struct BaseOfTester : IntegralConstant<bool, __is_base_of(Base, Derived)> {};

#else
# 529 "../../dist/include/mozilla/TypeTraits.h"

// The trickery used to implement IsBaseOf here makes it possible to use it for
// the cases of private and multiple inheritance.  This code was inspired by the
// sample code here:
//
// http://stackoverflow.com/questions/2910979/how-is-base-of-works
template<class Base, class Derived>
struct BaseOfHelper
{
public:
  operator Base*() const;
  operator Derived*();
};

template<class Type>
struct BaseOfTester<Type, const Type> : TrueType {};

#endif
# 579 "../../dist/include/mozilla/TypeTraits.h"

} /* namespace detail */

/*
 * IsBaseOf allows to know whether a given class is derived from another.
 *
 * Consider the following class definitions:
 *
 *   class A {};
 *   class B : public A {};
 *   class C {};
 *
 * mozilla::IsBaseOf<A, B>::value is true;
 * mozilla::IsBaseOf<A, C>::value is false;
 */
template<class Base, class Derived>
struct IsBaseOf
  : IntegralConstant<bool, detail::BaseOfTester<Base, Derived>::value>
{};

namespace detail {

template<typename From, typename To>
struct ConvertibleTester
{
private:
  static From create();

  template<typename From1, typename To1>
  static char test(To to);

  template<typename From1, typename To1>
  static int test(...);

public:
  static const bool value =
    sizeof(test<From, To>(create())) == sizeof(char);
};

} // namespace detail

/**
 * For obscure reasons, you can't use IsConvertible when the types being tested
 * are related through private inheritance, and you'll get a compile error if
 * you try.  Just don't do it!
 */
template<typename From, typename To>
struct IsConvertible
  : IntegralConstant<bool, detail::ConvertibleTester<From, To>::value>
{};

/* 20.9.7 Transformations between types [meta.trans] */

/* 20.9.7.1 Const-volatile modifications [meta.trans.cv] */

/**
 * RemoveConst removes top-level const qualifications on a type.
 *
 * mozilla::RemoveConst<int>::Type is int;
 * mozilla::RemoveConst<const int>::Type is int;
 * mozilla::RemoveConst<const int*>::Type is const int*;
 * mozilla::RemoveConst<int* const>::Type is int*.
 */
template<typename T>
struct RemoveConst
{
  typedef T Type;
};

template<typename T>
struct RemoveConst<const T>
{
  typedef T Type;
};

/**
 * RemoveVolatile removes top-level volatile qualifications on a type.
 *
 * mozilla::RemoveVolatile<int>::Type is int;
 * mozilla::RemoveVolatile<volatile int>::Type is int;
 * mozilla::RemoveVolatile<volatile int*>::Type is volatile int*;
 * mozilla::RemoveVolatile<int* volatile>::Type is int*.
 */
template<typename T>
struct RemoveVolatile
{
  typedef T Type;
};

template<typename T>
struct RemoveVolatile<volatile T>
{
  typedef T Type;
};

/**
 * RemoveCV removes top-level const and volatile qualifications on a type.
 *
 * mozilla::RemoveCV<int>::Type is int;
 * mozilla::RemoveCV<const int>::Type is int;
 * mozilla::RemoveCV<volatile int>::Type is int;
 * mozilla::RemoveCV<int* const volatile>::Type is int*.
 */
template<typename T>
struct RemoveCV
{
  typedef typename RemoveConst<typename RemoveVolatile<T>::Type>::Type Type;
};

/* 20.9.7.2 Reference modifications [meta.trans.ref] */

/**
 * Converts reference types to the underlying types.
 *
 * mozilla::RemoveReference<T>::Type is T;
 * mozilla::RemoveReference<T&>::Type is T;
 * mozilla::RemoveReference<T&&>::Type is T;
 */

template<typename T>
struct RemoveReference
{
  typedef T Type;
};

template<typename T>
struct RemoveReference<T&>
{
  typedef T Type;
};

template<typename T>
struct RemoveReference<T&&>
{
  typedef T Type;
};

template<bool Condition, typename A, typename B>
struct Conditional;

namespace detail {

enum Voidness { TIsVoid, TIsNotVoid };

template<typename T, Voidness V = IsVoid<T>::value ? TIsVoid : TIsNotVoid>
struct AddLvalueReferenceHelper;

template<typename T>
struct AddLvalueReferenceHelper<T, TIsVoid>
{
  typedef void Type;
};

template<typename T>
struct AddLvalueReferenceHelper<T, TIsNotVoid>
{
  typedef T& Type;
};

} // namespace detail

/**
 * AddLvalueReference adds an lvalue & reference to T if one isn't already
 * present.  (Note: adding an lvalue reference to an rvalue && reference in
 * essence replaces the && with a &&, per C+11 reference collapsing rules.  For
 * example, int&& would become int&.)
 *
 * The final computed type will only *not* be an lvalue reference if T is void.
 *
 * mozilla::AddLvalueReference<int>::Type is int&;
 * mozilla::AddLvalueRference<volatile int&>::Type is volatile int&;
 * mozilla::AddLvalueReference<void*>::Type is void*&;
 * mozilla::AddLvalueReference<void>::Type is void;
 * mozilla::AddLvalueReference<struct S&&>::Type is struct S&.
 */
template<typename T>
struct AddLvalueReference
  : detail::AddLvalueReferenceHelper<T>
{};

/* 20.9.7.3 Sign modifications [meta.trans.sign] */

template<bool B, typename T = void>
struct EnableIf;

namespace detail {

template<bool MakeConst, typename T>
struct WithC : Conditional<MakeConst, const T, T>
{};

template<bool MakeVolatile, typename T>
struct WithV : Conditional<MakeVolatile, volatile T, T>
{};


template<bool MakeConst, bool MakeVolatile, typename T>
struct WithCV : WithC<MakeConst, typename WithV<MakeVolatile, T>::Type>
{};

template<typename T>
struct CorrespondingSigned;

template<>
struct CorrespondingSigned<char> { typedef signed char Type; };
template<>
struct CorrespondingSigned<unsigned char> { typedef signed char Type; };
template<>
struct CorrespondingSigned<unsigned short> { typedef short Type; };
template<>
struct CorrespondingSigned<unsigned int> { typedef int Type; };
template<>
struct CorrespondingSigned<unsigned long> { typedef long Type; };
template<>
struct CorrespondingSigned<unsigned long long> { typedef long long Type; };

template<typename T,
         typename CVRemoved = typename RemoveCV<T>::Type,
         bool IsSignedIntegerType = IsSigned<CVRemoved>::value &&
                                    !IsSame<char, CVRemoved>::value>
struct MakeSigned;

template<typename T, typename CVRemoved>
struct MakeSigned<T, CVRemoved, true>
{
  typedef T Type;
};

template<typename T, typename CVRemoved>
struct MakeSigned<T, CVRemoved, false>
  : WithCV<IsConst<T>::value, IsVolatile<T>::value,
           typename CorrespondingSigned<CVRemoved>::Type>
{};

} // namespace detail

/**
 * MakeSigned produces the corresponding signed integer type for a given
 * integral type T, with the const/volatile qualifiers of T.  T must be a
 * possibly-const/volatile-qualified integral type that isn't bool.
 *
 * If T is already a signed integer type (not including char!), then T is
 * produced.
 *
 * Otherwise, if T is an unsigned integer type, the signed variety of T, with
 * T's const/volatile qualifiers, is produced.
 *
 * Otherwise, the integral type of the same size as T, with the lowest rank,
 * with T's const/volatile qualifiers, is produced.  (This basically only acts
 * to produce signed char when T = char.)
 *
 * mozilla::MakeSigned<unsigned long>::Type is signed long;
 * mozilla::MakeSigned<volatile int>::Type is volatile int;
 * mozilla::MakeSigned<const unsigned short>::Type is const signed short;
 * mozilla::MakeSigned<const char>::Type is const signed char;
 * mozilla::MakeSigned<bool> is an error;
 * mozilla::MakeSigned<void*> is an error.
 */
template<typename T>
struct MakeSigned
  : EnableIf<IsIntegral<T>::value &&
             !IsSame<bool, typename RemoveCV<T>::Type>::value,
             typename detail::MakeSigned<T>
            >::Type
{};

namespace detail {

template<typename T>
struct CorrespondingUnsigned;

template<>
struct CorrespondingUnsigned<char> { typedef unsigned char Type; };
template<>
struct CorrespondingUnsigned<signed char> { typedef unsigned char Type; };
template<>
struct CorrespondingUnsigned<short> { typedef unsigned short Type; };
template<>
struct CorrespondingUnsigned<int> { typedef unsigned int Type; };
template<>
struct CorrespondingUnsigned<long> { typedef unsigned long Type; };
template<>
struct CorrespondingUnsigned<long long> { typedef unsigned long long Type; };


template<typename T,
         typename CVRemoved = typename RemoveCV<T>::Type,
         bool IsUnsignedIntegerType = IsUnsigned<CVRemoved>::value &&
                                      !IsSame<char, CVRemoved>::value>
struct MakeUnsigned;

template<typename T, typename CVRemoved>
struct MakeUnsigned<T, CVRemoved, true>
{
  typedef T Type;
};

template<typename T, typename CVRemoved>
struct MakeUnsigned<T, CVRemoved, false>
  : WithCV<IsConst<T>::value, IsVolatile<T>::value,
           typename CorrespondingUnsigned<CVRemoved>::Type>
{};

} // namespace detail

/**
 * MakeUnsigned produces the corresponding unsigned integer type for a given
 * integral type T, with the const/volatile qualifiers of T.  T must be a
 * possibly-const/volatile-qualified integral type that isn't bool.
 *
 * If T is already an unsigned integer type (not including char!), then T is
 * produced.
 *
 * Otherwise, if T is an signed integer type, the unsigned variety of T, with
 * T's const/volatile qualifiers, is produced.
 *
 * Otherwise, the unsigned integral type of the same size as T, with the lowest
 * rank, with T's const/volatile qualifiers, is produced.  (This basically only
 * acts to produce unsigned char when T = char.)
 *
 * mozilla::MakeUnsigned<signed long>::Type is unsigned long;
 * mozilla::MakeUnsigned<volatile unsigned int>::Type is volatile unsigned int;
 * mozilla::MakeUnsigned<const signed short>::Type is const unsigned short;
 * mozilla::MakeUnsigned<const char>::Type is const unsigned char;
 * mozilla::MakeUnsigned<bool> is an error;
 * mozilla::MakeUnsigned<void*> is an error.
 */
template<typename T>
struct MakeUnsigned
  : EnableIf<IsIntegral<T>::value &&
             !IsSame<bool, typename RemoveCV<T>::Type>::value,
             typename detail::MakeUnsigned<T>
            >::Type
{};

/* 20.9.7.4 Array modifications [meta.trans.arr] */

/**
 * RemoveExtent produces either the type of the elements of the array T, or T
 * itself.
 *
 * mozilla::RemoveExtent<int>::Type is int;
 * mozilla::RemoveExtent<const int[]>::Type is const int;
 * mozilla::RemoveExtent<volatile int[5]>::Type is volatile int;
 * mozilla::RemoveExtent<long[][17]>::Type is long[17].
 */
template<typename T>
struct RemoveExtent
{
  typedef T Type;
};

template<typename T>
struct RemoveExtent<T[]>
{
  typedef T Type;
};

template<typename T, decltype(sizeof(1)) N>
struct RemoveExtent<T[N]>
{
  typedef T Type;
};

/* 20.9.7.5 Pointer modifications [meta.trans.ptr] */

namespace detail {

template<typename T, typename CVRemoved>
struct RemovePointerHelper
{
  typedef T Type;
};

template<typename T, typename Pointee>
struct RemovePointerHelper<T, Pointee*>
{
  typedef Pointee Type;
};

} // namespac detail

/**
 * Produces the pointed-to type if a pointer is provided, else returns the input
 * type.  Note that this does not dereference pointer-to-member pointers.
 *
 * struct S { bool m; void f(); };
 * mozilla::RemovePointer<int>::Type is int;
 * mozilla::RemovePointer<int*>::Type is int;
 * mozilla::RemovePointer<int* const>::Type is int;
 * mozilla::RemovePointer<int* volatile>::Type is int;
 * mozilla::RemovePointer<const long*>::Type is const long;
 * mozilla::RemovePointer<void* const>::Type is void;
 * mozilla::RemovePointer<void (S::*)()>::Type is void (S::*)();
 * mozilla::RemovePointer<void (*)()>::Type is void();
 * mozilla::RemovePointer<bool S::*>::Type is bool S::*.
 */
template<typename T>
struct RemovePointer
  : detail::RemovePointerHelper<T, typename RemoveCV<T>::Type>
{};

/* 20.9.7.6 Other transformations [meta.trans.other] */

/**
 * EnableIf is a struct containing a typedef of T if and only if B is true.
 *
 * mozilla::EnableIf<true, int>::Type is int;
 * mozilla::EnableIf<false, int>::Type is a compile-time error.
 *
 * Use this template to implement SFINAE-style (Substitution Failure Is not An
 * Error) requirements.  For example, you might use it to impose a restriction
 * on a template parameter:
 *
 *   template<typename T>
 *   class PodVector // vector optimized to store POD (memcpy-able) types
 *   {
 *      EnableIf<IsPod<T>::value, T>::Type* vector;
 *      size_t length;
 *      ...
 *   };
 */
template<bool B, typename T>
struct EnableIf
{};

template<typename T>
struct EnableIf<true, T>
{
  typedef T Type;
};

/**
 * Conditional selects a class between two, depending on a given boolean value.
 *
 * mozilla::Conditional<true, A, B>::Type is A;
 * mozilla::Conditional<false, A, B>::Type is B;
 */
template<bool Condition, typename A, typename B>
struct Conditional
{
  typedef A Type;
};

template<class A, class B>
struct Conditional<false, A, B>
{
  typedef B Type;
};

} /* namespace mozilla */

#endif /* mozilla_TypeTraits_h */
# 1048 "../../dist/include/mozilla/TypeTraits.h"
# 313 "../../dist/include/mozilla/Assertions.h" 2
namespace mozilla {
namespace detail {

template<typename T>
struct IsFunction
{
  static const bool value = false;
};

template<typename R, typename... A>
struct IsFunction<R(A...)>
{
  static const bool value = true;
};

template<typename T>
struct AssertionConditionType
{
  typedef typename RemoveReference<T>::Type ValueT;
  static_assert(!IsArray<ValueT>::value,
                "Expected boolean assertion condition, got an array or a "
                "string!");
  static_assert(!IsFunction<ValueT>::value,
                "Expected boolean assertion condition, got a function! Did "
                "you intend to call that function?");
  static_assert(!IsFloatingPoint<ValueT>::value,
                "It's often a bad idea to assert that a floating-point number "
                "is nonzero, because such assertions tend to intermittently "
                "fail. Shouldn't your code gracefully handle this case instead "
                "of asserting? Anyway, if you really want to do that, write an "
                "explicit boolean condition, like !!x or x!=0.");

  static const bool isValid = true;
};

} // namespace detail
} // namespace mozilla
#  define MOZ_VALIDATE_ASSERT_CONDITION_TYPE(x) \
     static_assert(mozilla::detail::AssertionConditionType<decltype(x)>::isValid, \
                   "invalid assertion condition")
#else
# 354 "../../dist/include/mozilla/Assertions.h"
#  define MOZ_VALIDATE_ASSERT_CONDITION_TYPE(x)
#endif
# 356 "../../dist/include/mozilla/Assertions.h"

/* First the single-argument form. */
#define MOZ_ASSERT_HELPER1(expr) \
  do { \
    MOZ_VALIDATE_ASSERT_CONDITION_TYPE(expr); \
    if (MOZ_UNLIKELY(!(expr))) { \
      MOZ_ReportAssertionFailure(#expr, __FILE__, __LINE__); \
      MOZ_REALLY_CRASH(); \
    } \
  } while (0)
/* Now the two-argument form. */
#define MOZ_ASSERT_HELPER2(expr, explain) \
  do { \
    MOZ_VALIDATE_ASSERT_CONDITION_TYPE(expr); \
    if (MOZ_UNLIKELY(!(expr))) { \
      MOZ_ReportAssertionFailure(#expr " (" explain ")", __FILE__, __LINE__); \
      MOZ_REALLY_CRASH(); \
    } \
  } while (0)

#define MOZ_RELEASE_ASSERT_GLUE(a, b) a b
#define MOZ_RELEASE_ASSERT(...) \
  MOZ_RELEASE_ASSERT_GLUE( \
    MOZ_PASTE_PREFIX_AND_ARG_COUNT(MOZ_ASSERT_HELPER, __VA_ARGS__), \
    (__VA_ARGS__))

#ifdef DEBUG
#  define MOZ_ASSERT(...) MOZ_RELEASE_ASSERT(__VA_ARGS__)
#else
# 385 "../../dist/include/mozilla/Assertions.h"
#  define MOZ_ASSERT(...) do { } while (0)
#endif /* DEBUG */
# 387 "../../dist/include/mozilla/Assertions.h"

#ifdef RELEASE_BUILD
#  define MOZ_DIAGNOSTIC_ASSERT MOZ_ASSERT
#else
# 391 "../../dist/include/mozilla/Assertions.h"
#  define MOZ_DIAGNOSTIC_ASSERT MOZ_RELEASE_ASSERT
#endif
# 393 "../../dist/include/mozilla/Assertions.h"

/*
 * MOZ_ASSERT_IF(cond1, cond2) is equivalent to MOZ_ASSERT(cond2) if cond1 is
 * true.
 *
 *   MOZ_ASSERT_IF(isPrime(num), num == 2 || isOdd(num));
 *
 * As with MOZ_ASSERT, MOZ_ASSERT_IF has effect only in debug builds.  It is
 * designed to catch bugs during debugging, not "in the field".
 */
#ifdef DEBUG
#  define MOZ_ASSERT_IF(cond, expr) \
     do { \
       if (cond) { \
         MOZ_ASSERT(expr); \
       } \
     } while (0)
#else
# 411 "../../dist/include/mozilla/Assertions.h"
#  define MOZ_ASSERT_IF(cond, expr)  do { } while (0)
#endif
# 413 "../../dist/include/mozilla/Assertions.h"

/*
 * MOZ_ASSUME_UNREACHABLE_MARKER() expands to an expression which states that
 * it is undefined behavior for execution to reach this point.  No guarantees
 * are made about what will happen if this is reached at runtime.  Most code
 * should use MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE because it has extra
 * asserts.
 * Note that MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE is noreturn, so it's valid
 * not to return a value following a MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE
 * call.
 *
   do { \
     MOZ_ASSERT_UNREACHABLE(reason); \
     MOZ_ASSUME_UNREACHABLE_MARKER(); \
   } while (0)

/*
 * MOZ_ALWAYS_TRUE(expr) and MOZ_ALWAYS_FALSE(expr) always evaluate the provided
 * expression, in debug builds and in release builds both.  Then, in debug
 * builds only, the value of the expression is asserted either true or false
 * using MOZ_ASSERT.
 */
#ifdef DEBUG
#  define MOZ_ALWAYS_TRUE(expr)      MOZ_ASSERT((expr))
#  define MOZ_ALWAYS_FALSE(expr)     MOZ_ASSERT(!(expr))
#else
# 497 "../../dist/include/mozilla/Assertions.h"
#  define MOZ_ALWAYS_TRUE(expr)      ((void)(expr))
#  define MOZ_ALWAYS_FALSE(expr)     ((void)(expr))
#endif
# 500 "../../dist/include/mozilla/Assertions.h"

#undef MOZ_DUMP_ASSERTION_STACK

#endif /* mozilla_Assertions_h */
# 504 "../../dist/include/mozilla/Assertions.h"
# 15 "../../dist/include/nsDebug.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Likely.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsDebug.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h>
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsDebug.h"

#ifdef DEBUG
#if 0 /* expanded by -frewrite-includes */
#include "prprf.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prprf.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef prprf_h___
#define prprf_h___

/*
** API for PR printf like routines. Supports the following formats
**	%d - decimal
**	%u - unsigned decimal
**	%x - unsigned hex
**	%X - unsigned uppercase hex
**	%o - unsigned octal
**	%hd, %hu, %hx, %hX, %ho - 16-bit versions of above
**	%ld, %lu, %lx, %lX, %lo - 32-bit versions of above
**	%lld, %llu, %llx, %llX, %llo - 64 bit versions of above
**	%s - string
**	%c - character
**
** Prototypes and macros used to make up for deficiencies that we have found
** in ANSI environments.
**
** Since we do not wrap <stdlib.h> and all the other standard headers, authors
** of portable code will not know in general that they need these definitions.
** Instead of requiring these authors to find the dependent uses in their code
** and take the following steps only in those C files, we take steps once here
** for all C files.
**/

#ifndef prtypes_h___
#define prtypes_h___

#ifdef MDCPUCFG
#if 0 /* expanded by -frewrite-includes */
#include MDCPUCFG
#endif /* expanded by -frewrite-includes */
# 25 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#else
# 26 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "prcpucfg.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcpucfg.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nspr_cpucfg___
#define nspr_cpucfg___

#ifndef XP_UNIX
#define XP_UNIX
#endif
# 12 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcpucfg.h"

#define PR_AF_INET6 30  /* same as AF_INET6 */

#ifdef __LITTLE_ENDIAN__
#undef IS_BIG_ENDIAN
#define  IS_LITTLE_ENDIAN 1
#else
# 19 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcpucfg.h"
#undef IS_LITTLE_ENDIAN
#define  IS_BIG_ENDIAN 1
#endif
# 22 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcpucfg.h"

#ifdef __LP64__
#define IS_64
#endif
# 26 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcpucfg.h"

#ifndef HAVE_LONG_LONG
#define	HAVE_LONG_LONG
#endif
# 30 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcpucfg.h"
#undef	HAVE_ALIGNED_DOUBLES
#define	HAVE_ALIGNED_LONGLONGS 1

#ifdef IS_64

#define PR_ALIGN_OF_LONG    8
#define PR_ALIGN_OF_INT64   8
#define PR_ALIGN_OF_FLOAT   4
#define PR_ALIGN_OF_DOUBLE  8
#define PR_ALIGN_OF_POINTER 8
#define PR_ALIGN_OF_WORD    8
#define PR_ALIGN_OF_DWORD   8

#else /* IS_64 */
# 76 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcpucfg.h"

#define PR_BYTES_PER_BYTE   1
#define PR_BYTES_PER_SHORT  2
#define PR_BYTES_PER_INT    4
#define PR_BYTES_PER_INT64  8
#define PR_BYTES_PER_LONG   4
#define BYTES_PER_WORD_LOG2	PR_BYTES_PER_WORD_LOG2
#define BYTES_PER_DWORD_LOG2	PR_BYTES_PER_DWORD_LOG2
#define WORDS_PER_DWORD_LOG2	PR_WORDS_PER_DWORD_LOG2

#endif /* NO_NSPR_10_SUPPORT */
# 163 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcpucfg.h"

#endif /* nspr_cpucfg___ */
# 165 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcpucfg.h"

# 27 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h" 2
#endif
# 28 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#if !defined(_SIZE_T) || __has_feature(modules)
/* Always define size_t when modules are available. */
#if !__has_feature(modules)
#define _SIZE_T
#endif
# 42 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ size_t;
#endif
#ifdef __cplusplus
#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
namespace std { typedef decltype(nullptr) nullptr_t; }
using ::std::nullptr_t;
#endif
# 85 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#define offsetof(t, d) __builtin_offsetof(t, d)

#endif /* __STDDEF_H */
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
__WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
#if defined(__need_wint_t)
/* Always define wint_t when modules are available. */
#if !defined(_WINT_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#define PR_EXTERN_DATA(__type) extern __type
#define PR_IMPLEMENT_DATA(__type) __type

#define PR_CALLBACK
#define PR_CALLBACK_DECL
#define PR_STATIC_CALLBACK(__x) static __x

#else /* Unix */
# 121 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/* GCC 3.3 and later support the visibility attribute. */
#if (__GNUC__ >= 4) || \
    (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
#define PR_VISIBILITY_DEFAULT __attribute__((visibility("default")))
#else
# 127 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#define PR_VISIBILITY_DEFAULT
#endif
# 129 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

#define PR_EXPORT(__type) extern PR_VISIBILITY_DEFAULT __type
#define PR_EXPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type
#define PR_IMPORT(__type) extern PR_VISIBILITY_DEFAULT __type
#define PR_IMPORT_DATA(__type) extern PR_VISIBILITY_DEFAULT __type

#define PR_EXTERN(__type) extern PR_VISIBILITY_DEFAULT __type
#define PR_IMPLEMENT(__type) PR_VISIBILITY_DEFAULT __type
#define PR_EXTERN_DATA(__type) extern PR_VISIBILITY_DEFAULT __type
#define PR_IMPLEMENT_DATA(__type) PR_VISIBILITY_DEFAULT __type
#define PR_CALLBACK
#define PR_CALLBACK_DECL
#define PR_STATIC_CALLBACK(__x) static __x

#endif
# 144 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

#if defined(_NSPR_BUILD_)
#define NSPR_API(__type) PR_EXPORT(__type)
#define NSPR_DATA_API(__type) PR_EXPORT_DATA(__type)
#else
# 149 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#define NSPR_API(__type) PR_IMPORT(__type)
#define NSPR_DATA_API(__type) PR_IMPORT_DATA(__type)
#endif
# 152 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/***********************************************************************
** MACROS:      PR_BEGIN_MACRO
**              PR_END_MACRO
** DESCRIPTION:
**      Macro body brackets so that macros with compound statement definitions
**      behave syntactically more like functions when called.
***********************************************************************/
#define PR_BEGIN_MACRO  do {
#define PR_END_MACRO    } while (0)

/***********************************************************************
** MACROS:      PR_BEGIN_EXTERN_C
**              PR_END_EXTERN_C
** DESCRIPTION:
**      Macro shorthands for conditional C++ extern block delimiters.
***********************************************************************/
#ifdef __cplusplus
#define PR_BEGIN_EXTERN_C       extern "C" {
#define PR_END_EXTERN_C         }
#else
# 173 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#define PR_BEGIN_EXTERN_C
#define PR_END_EXTERN_C
#endif
# 176 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/***********************************************************************
** MACROS:      PR_BIT
**              PR_BITMASK
** DESCRIPTION:
** Bit masking macros.  XXX n must be <= 31 to be portable
***********************************************************************/
#define PR_BIT(n)       ((PRUint32)1 << (n))
#define PR_BITMASK(n)   (PR_BIT(n) - 1)

/***********************************************************************
** MACROS:      PR_ROUNDUP
**              PR_MIN
**              PR_MAX
**              PR_ABS
** DESCRIPTION:
**      Commonly used macros for operations on compatible types.
***********************************************************************/
#define PR_ROUNDUP(x,y) ((((x)+((y)-1))/(y))*(y))
#define PR_MIN(x,y)     ((x)<(y)?(x):(y))
#define PR_MAX(x,y)     ((x)>(y)?(x):(y))
#define PR_ABS(x)       ((x)<0?-(x):(x))

/***********************************************************************
** MACROS:      PR_ARRAY_SIZE
** DESCRIPTION:
**  The number of elements in an array.
***********************************************************************/
#define PR_ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))

PR_BEGIN_EXTERN_C

/*
** Starting in NSPR 4.9.5, NSPR's exact-width integer types should match
** the exact-width integer types defined in <stdint.h>. This allows sloppy
** code to use PRInt{N} and int{N}_t interchangeably.
**
** The 8-bit and 16-bit integer types can only be defined using char and
** short. All platforms define the 32-bit integer types using int. So only
** the 64-bit integer types could be defined differently.
**
** NSPR's original strategy was to use the "shortest" 64-bit integer type:
** if long is 64-bit, then prefer it over long long. This strategy is also
** used by Linux/glibc, FreeBSD, and NetBSD.
**
** Other platforms use a different strategy: simply define the 64-bit
** integer types using long long. We define the PR_ALTERNATE_INT64_TYPEDEF
/************************************************************************
** TYPES:       PRUint8
**              PRInt8
** DESCRIPTION:
**  The int8 types are known to be 8 bits each. There is no type that
**      is equivalent to a plain "char".
************************************************************************/
#if PR_BYTES_PER_BYTE == 1
typedef unsigned char PRUint8;
/*
** Some cfront-based C++ compilers do not like 'signed char' and
** issue the warning message:
**     warning: "signed" not implemented (ignored)
** For these compilers, we have to define PRInt8 as plain 'char'.
** Make sure that plain 'char' is indeed signed under these compilers.
*/
#if (defined(HPUX) && defined(__cplusplus) \
        && !defined(__GNUC__) && __cplusplus < 199707L) \
    || (defined(SCO) && defined(__cplusplus) \
        && !defined(__GNUC__) && __cplusplus == 1L)
typedef char PRInt8;
#else
# 260 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
typedef signed char PRInt8;
#endif
# 262 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#else
# 263 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#error No suitable type for PRInt8/PRUint8
#endif
# 265 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/************************************************************************
 * MACROS:      PR_INT8_MAX
 *              PR_INT8_MIN
 *              PR_UINT8_MAX
 * DESCRIPTION:
 *  The maximum and minimum values of a PRInt8 or PRUint8.
************************************************************************/

#define PR_INT8_MAX 127
#define PR_INT8_MIN (-128)
#define PR_UINT8_MAX 255U

/************************************************************************
** TYPES:       PRUint16
**              PRInt16
** DESCRIPTION:
**  The int16 types are known to be 16 bits each.
************************************************************************/
#if PR_BYTES_PER_SHORT == 2
typedef unsigned short PRUint16;
typedef short PRInt16;
#else
# 288 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#error No suitable type for PRInt16/PRUint16
#endif
# 290 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/************************************************************************
 * MACROS:      PR_INT16_MAX
 *              PR_INT16_MIN
 *              PR_UINT16_MAX
 * DESCRIPTION:
 *  The maximum and minimum values of a PRInt16 or PRUint16.
************************************************************************/

#define PR_INT16_MAX 32767
#define PR_INT16_MIN (-32768)
#define PR_UINT16_MAX 65535U

/************************************************************************
** TYPES:       PRUint32
**              PRInt32
** DESCRIPTION:
**  The int32 types are known to be 32 bits each.
************************************************************************/
#if PR_BYTES_PER_INT == 4
typedef unsigned int PRUint32;
typedef int PRInt32;
#define PR_INT32(x)  x
#define PR_UINT32(x) x ## U
#elif PR_BYTES_PER_LONG == 4
# 315 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
typedef unsigned long PRUint32;
typedef long PRInt32;
#define PR_INT32(x)  x ## L
#define PR_UINT32(x) x ## UL
#else
# 320 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#error No suitable type for PRInt32/PRUint32
#endif
# 322 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/************************************************************************
 * MACROS:      PR_INT32_MAX
**              PR_INT64_MIN
**              PR_UINT64_MAX
** DESCRIPTION:
**  The maximum and minimum values of a PRInt64 or PRUint64.
************************************************************************/
#ifdef HAVE_LONG_LONG
/* Keep this in sync with prlong.h. */
#if PR_BYTES_PER_LONG == 8 && !defined(PR_ALTERNATE_INT64_TYPEDEF)
typedef long PRInt64;
typedef unsigned long PRUint64;
#define PR_INT64(x)  x ## L
#define PR_UINT64(x) x ## UL
#elif defined(WIN32) && !defined(__GNUC__)
# 370 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
typedef __int64  PRInt64;
typedef unsigned __int64 PRUint64;
#define PR_INT64(x)  x ## i64
#define PR_UINT64(x) x ## ui64
#else
# 375 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
typedef long long PRInt64;
typedef unsigned long long PRUint64;
#define PR_INT64(x)  x ## LL
#define PR_UINT64(x) x ## ULL
#endif /* PR_BYTES_PER_LONG == 8 */
# 380 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

#define PR_INT64_MAX PR_INT64(0x7fffffffffffffff)
#define PR_INT64_MIN (-PR_INT64_MAX - 1)
#define PR_UINT64_MAX PR_UINT64(-1)
#else  /* !HAVE_LONG_LONG */
# 385 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
typedef struct {
#ifdef IS_LITTLE_ENDIAN
    PRUint32 lo, hi;
#else
# 389 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
    PRUint32 hi, lo;
#endif
# 391 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
} PRInt64;
typedef PRInt64 PRUint64;

#define PR_INT64_MAX (PRInt64){0x7fffffff, 0xffffffff}
#define PR_INT64_MIN (PRInt64){0xffffffff, 0xffffffff}
#define PR_UINT64_MAX (PRUint64){0xffffffff, 0xffffffff}

#endif /* !HAVE_LONG_LONG */
# 399 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/************************************************************************
** TYPES:       PRUintn
**              PRIntn
** DESCRIPTION:
**  The PRIntn types are most appropriate for automatic variables. They are
**      guaranteed to be at least 16 bits, though various architectures may
**      define them to be wider (e.g., 32 or even 64 bits). These types are
**      never valid for fields of a structure.
************************************************************************/
#if PR_BYTES_PER_INT >= 2
typedef int PRIntn;
typedef unsigned int PRUintn;
#else
# 413 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#error 'sizeof(int)' not sufficient for platform use
#endif
# 415 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/************************************************************************
** TYPES:       PRFloat64
** DESCRIPTION:
**  NSPR's floating point type is always 64 bits.
************************************************************************/
typedef double          PRFloat64;

/************************************************************************
** TYPES:       PRSize
** DESCRIPTION:
**  A type for representing the size of objects.
************************************************************************/
typedef size_t PRSize;


/************************************************************************
** TYPES:       PROffset32, PROffset64
** DESCRIPTION:
**  A type for representing byte offsets from some location.
************************************************************************/
typedef PRInt32 PROffset32;
typedef PRInt64 PROffset64;

/************************************************************************
** TYPES:       PRPtrDiff
** DESCRIPTION:
**  A type for pointer difference. Variables of this type are suitable
**      for storing a pointer or pointer subtraction.

/************************************************************************
** TYPES:       PRBool
** DESCRIPTION:
**  Use PRBool for variables and parameter types. Use PR_FALSE and PR_TRUE
**      for clarity of target type in assignments and actual arguments. Use
**      'if (bool)', 'while (!bool)', '(bool) ? x : y' etc., to test booleans
**      just as you would C int-valued conditions.
************************************************************************/
typedef PRIntn PRBool;
#define PR_TRUE 1
#define PR_FALSE 0

/************************************************************************
** TYPES:       PRPackedBool
** DESCRIPTION:
**  Use PRPackedBool within structs where bitfields are not desirable
**      but minimum and consistant overhead matters.
************************************************************************/
typedef PRUint8 PRPackedBool;

/*
** Status code used by some routines that have a single point of failure or
** special status return.
*/
typedef enum { PR_FAILURE = -1, PR_SUCCESS = 0 } PRStatus;

#ifndef __PRUNICHAR__
#define __PRUNICHAR__
#ifdef WIN32
typedef wchar_t PRUnichar;
#else
# 490 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
typedef PRUint16 PRUnichar;
#endif
# 492 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#endif
# 493 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/*
** WARNING: The undocumented data types PRWord and PRUword are
** only used in the garbage collection and arena code.  Do not
** use PRWord and PRUword in new code.
**
** A PRWord is an integer that is the same size as a void*.
** It implements the notion of a "word" in the Java Virtual
** Machine.  (See Sec. 3.4 "Words", The Java Virtual Machine
** Specification, Addison-Wesley, September 1996.
** http://java.sun.com/docs/books/vmspec/index.html.)
*/
#ifdef _WIN64
typedef PRInt64 PRWord;
typedef PRUint64 PRUword;
#else
# 509 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
typedef long PRWord;
typedef unsigned long PRUword;
#endif
# 512 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

#if defined(NO_NSPR_10_SUPPORT)
#else
# 515 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
/********* ???????????????? FIX ME       ??????????????????????????? *****/
** Macro shorthands for conditional C++ extern block delimiters.
*/
#ifdef NSPR_BEGIN_EXTERN_C
#undef NSPR_BEGIN_EXTERN_C
#endif
# 537 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#ifdef NSPR_END_EXTERN_C
#undef NSPR_END_EXTERN_C
#endif
# 540 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

#ifdef __cplusplus
#define NSPR_BEGIN_EXTERN_C     extern "C" {
#define NSPR_END_EXTERN_C       }
#else
# 545 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"
#define NSPR_BEGIN_EXTERN_C
#define NSPR_END_EXTERN_C
#endif
# 548 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

#if 0 /* expanded by -frewrite-includes */
#include "obsolete/protypes.h"
#endif /* expanded by -frewrite-includes */
# 550 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/********* ????????????? End Fix me ?????????????????????????????? *****/
#endif /* NO_NSPR_10_SUPPORT */
# 553 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

/*
** Compile-time assert. "condition" must be a constant expression.
** The macro can be used only in places where an "extern" declaration is
** allowed.
*/
#define PR_STATIC_ASSERT(condition) \
    extern void pr_static_assert(int arg[(condition) ? 1 : -1])

PR_END_EXTERN_C

#endif /* prtypes_h___ */
# 565 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtypes.h"

# 26 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prprf.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "prio.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * File:     prio.h
 *
 * Description:    PR i/o related stuff, such as file system access, file
 *         i/o, socket i/o, etc.
 */

#ifndef prio_h___
#define prio_h___

#if 0 /* expanded by -frewrite-includes */
#include "prlong.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlong.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
** File:                prlong.h
** Description: Portable access to 64 bit numerics
**
** Long-long (64-bit signed integer type) support. Some C compilers
** don't support 64 bit integers yet, so we use these macros to
** support both machines that do and don't.
**/
#ifndef prlong_h___
#define prlong_h___

#if 0 /* expanded by -frewrite-includes */
#include "prtypes.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlong.h"

PR_BEGIN_EXTERN_C

/***********************************************************************
** DEFINES:     LL_MaxInt
**              LL_MinInt
**              LL_Zero
**              LL_MaxUint
** DESCRIPTION:
**      Various interesting constants and static variable
**      initializer
***********************************************************************/
NSPR_API(PRInt64) LL_MaxInt(void);
NSPR_API(PRInt64) LL_MinInt(void);
NSPR_API(PRInt64) LL_Zero(void);
NSPR_API(PRUint64) LL_MaxUint(void);

#if defined(HAVE_LONG_LONG)

/* Keep this in sync with prtypes.h. */
#if PR_BYTES_PER_LONG == 8 && !defined(PR_ALTERNATE_INT64_TYPEDEF)
#define LL_MAXINT   9223372036854775807L
#define LL_MININT   (-LL_MAXINT - 1L)
#define LL_ZERO     0L
#define LL_MAXUINT  18446744073709551615UL
#define LL_INIT(hi, lo)  ((hi ## L << 32) + lo ## L)
#elif defined(WIN32) && !defined(__GNUC__)
# 45 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlong.h"
#define LL_MAXINT   9223372036854775807i64
#define LL_MININT   (-LL_MAXINT - 1i64)
#define LL_ZERO     0i64
#define LL_MAXUINT  18446744073709551615ui64
#define LL_INIT(hi, lo)  ((hi ## i64 << 32) + lo ## i64)
#else
# 51 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlong.h"
#define LL_MAXINT   9223372036854775807LL
#define LL_MININT   (-LL_MAXINT - 1LL)
#define LL_ZERO     0LL
#define LL_MAXUINT  18446744073709551615ULL
#define LL_INIT(hi, lo)  ((hi ## LL << 32) + lo ## LL)
#endif
# 57 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlong.h"

/***********************************************************************
** MACROS:      LL_*
** DESCRIPTION:
**      The following macros define portable access to the 64 bit
**      math facilities.
** MACROS:      LL_UDIVMOD
** DESCRIPTION:
**  Produce both a quotient and a remainder given an unsigned 
** INPUTS:      PRUint64 a: The dividend of the operation
**              PRUint64 b: The quotient of the operation
** OUTPUTS:     PRUint64 *qp: pointer to quotient
**              PRUint64 *rp: pointer to remainder
    if (_negative) \
    LL_NEG(r, r); \
}

/* a is an PRInt32, b is PRInt32, r is PRInt64 */
#define LL_ISHL(r, a, b) { \
    if (b) { \
    PRInt64 _a; \
    LL_NEG(l, l); \
}

#endif /* !HAVE_LONG_LONG */
# 400 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlong.h"

PR_END_EXTERN_C

#endif /* prlong_h___ */
# 404 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlong.h"
# 17 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "prtime.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtime.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 *----------------------------------------------------------------------
 *
 * prtime.h --
 *
 *     NSPR date and time functions
 *
 *-----------------------------------------------------------------------
 */

#ifndef prtime_h___
#define prtime_h___

#if 0 /* expanded by -frewrite-includes */
#include "prlong.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtime.h"

PR_BEGIN_EXTERN_C

/**********************************************************************/
/************************* TYPES AND CONSTANTS ************************/
/**********************************************************************/

#define PR_MSEC_PER_SEC		1000L
#define PR_USEC_PER_SEC		1000000L
#define PR_NSEC_PER_SEC		1000000000L
#define PR_USEC_PER_MSEC	1000L
#define PR_NSEC_PER_MSEC	1000000L

/*
 * PRTime --
 *
 *     NSPR represents basic time as 64-bit signed integers relative
 *     to midnight (00:00:00), January 1, 1970 Greenwich Mean Time (GMT).
 *     (GMT is also known as Coordinated Universal Time, UTC.)
 *     The units of time are in microseconds. Negative times are allowed
 *     to represent times prior to the January 1970 epoch. Such values are
 *     intended to be exported to other systems or converted to human
 *     readable form.
 *
 *     Notes on porting: PRTime corresponds to time_t in ANSI C.  NSPR 1.0
 *     simply uses PRInt64.
 */

typedef PRInt64 PRTime;

/*
 * Time zone and daylight saving time corrections applied to GMT to
 * obtain the local time of some geographic location
 */

typedef struct PRTimeParameters {
    PRInt32 tp_gmt_offset;     /* the offset from GMT in seconds */
    PRInt32 tp_dst_offset;     /* contribution of DST in seconds */
} PRTimeParameters;

/*
 * PRExplodedTime --
 *
 *     Time broken down into human-readable components such as year, month,
 *     day, hour, minute, second, and microsecond.  Time zone and daylight
 *     saving time corrections may be applied.  If they are applied, the
 *     offsets from the GMT must be saved in the 'tm_params' field so that
 *     all the information is available to reconstruct GMT.
 *
 *     Notes on porting: PRExplodedTime corrresponds to struct tm in
 *     ANSI C, with the following differences:
 *       - an additional field tm_usec;
 *       - replacing tm_isdst by tm_params;
 *       - the month field is spelled tm_month, not tm_mon;
 *       - we use absolute year, AD, not the year since 1900.
 *     The corresponding type in NSPR 1.0 is called PRTime.  Below is
 *     a table of date/time type correspondence in the three APIs:
 *         API          time since epoch          time in components
 *       ANSI C             time_t                  struct tm
 *       NSPR 1.0           PRInt64                   PRTime
 *       NSPR 2.0           PRTime                  PRExplodedTime
 */

typedef struct PRExplodedTime {
    PRInt32 tm_usec;		    /* microseconds past tm_sec (0-99999)  */
    PRInt32 tm_sec;             /* seconds past tm_min (0-61, accomodating
                                   up to two leap seconds) */
    PRInt32 tm_min;             /* minutes past tm_hour (0-59) */
    PRInt32 tm_hour;            /* hours past tm_day (0-23) */
    PRInt32 tm_mday;            /* days past tm_mon (1-31, note that it
				                starts from 1) */
    PRInt32 tm_month;           /* months past tm_year (0-11, Jan = 0) */
    PRInt16 tm_year;            /* absolute year, AD (note that we do not
				                count from 1900) */

    PRInt8 tm_wday;		        /* calculated day of the week
				                (0-6, Sun = 0) */
    PRInt16 tm_yday;            /* calculated day of the year
				                (0-365, Jan 1 = 0) */

    PRTimeParameters tm_params;  /* time parameters used by conversion */
} PRExplodedTime;

/*
 * PRTimeParamFn --
 */

NSPR_API(PRStatus) PR_ParseTimeString (
	const char *string,
	PRBool default_to_gmt,
	PRTime *result);

/* Format a time value into a buffer. Same semantics as strftime() */
NSPR_API(PRUint32) PR_FormatTime(char *buf, int buflen, const char *fmt,
                                           const PRExplodedTime *tm);

/* Format a time value into a buffer. Time is always in US English format, regardless
 * of locale setting.
 */
NSPR_API(PRUint32)
PR_FormatTimeUSEnglish( char* buf, PRUint32 bufSize,
                        const char* format, const PRExplodedTime* tm );

PR_END_EXTERN_C

#endif /* prtime_h___ */
# 263 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prtime.h"
# 18 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "prinrval.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinrval.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
** File:		prinrval.h
** Description:	API to interval timing functions of NSPR.
**
**
** NSPR provides interval times that are independent of network time
** of day values. Interval times are (in theory) accurate regardless
** of host processing requirements and also very cheap to acquire. It
** is expected that getting an interval time while in a synchronized
** function (holding one's lock).
**/

#if !defined(prinrval_h)
#define prinrval_h

#if 0 /* expanded by -frewrite-includes */
#include "prtypes.h"
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinrval.h"

PR_BEGIN_EXTERN_C

/**********************************************************************/
/************************* TYPES AND CONSTANTS ************************/
/**********************************************************************/

typedef PRUint32 PRIntervalTime;

/***********************************************************************
** DEFINES:     PR_INTERVAL_MIN
**              PR_INTERVAL_MAX
** DESCRIPTION:
**  
***********************************************************************/
#define PR_INTERVAL_NO_WAIT 0UL
#define PR_INTERVAL_NO_TIMEOUT 0xffffffffUL

/**********************************************************************/
/****************************** FUNCTIONS *****************************/
/**********************************************************************/

/***********************************************************************
** FUNCTION:    PR_IntervalNow
** DESCRIPTION:
**  Return the value of NSPR's free running interval timer. That timer
**  can be used to establish epochs and determine intervals (be computing
**  the difference between two times).
** OUTPUTS:     void
** RETURN:      PRUint32
**  
** SIDE EFFECTS:
**  None
** RESTRICTIONS:
**  Conversion may cause overflow, which is not reported.
** MEMORY:      N/A
** ALGORITHM:   N/A
***********************************************************************/
NSPR_API(PRUint32) PR_IntervalToSeconds(PRIntervalTime ticks);
NSPR_API(PRUint32) PR_IntervalToMilliseconds(PRIntervalTime ticks);
NSPR_API(PRUint32) PR_IntervalToMicroseconds(PRIntervalTime ticks);

PR_END_EXTERN_C


#endif /* !defined(prinrval_h) */
# 145 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinrval.h"

/* prinrval.h */
# 19 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "prinet.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * File:		prinet.h
 *
 * Notes:
 *     1. This file should have been an internal header.  Please do not
 *        depend on it to pull in the system header files you need.
 *     2. WARNING: This file is no longer cross-platform as it is a no-op
 *        for WIN32!  See the comment in the WIN32 section for details.
 */

#ifndef prinet_h__
#define prinet_h__

#if defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 1 3 4
/*
 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 * SUCH DAMAGE.
 *
 *	@(#)types.h	8.4 (Berkeley) 1/21/94
 */

#ifndef _SYS_TYPES_H_
#define	_SYS_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/appleapiopts.h>
#endif /* expanded by -frewrite-includes */
# 73 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

#ifndef __ASSEMBLER__
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 76 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

/* Machine type dependent parameters. */
#if 0 /* expanded by -frewrite-includes */
#include <machine/types.h>
#endif /* expanded by -frewrite-includes */
# 79 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 80 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <machine/endian.h>
#endif /* expanded by -frewrite-includes */
typedef	u_int64_t		u_quad_t;	/* quads */
typedef	int64_t			quad_t;
typedef	quad_t *		qaddr_t;

typedef	char *			caddr_t;	/* core address */
typedef	int32_t			daddr_t;	/* disk address */

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_dev_t.h>   		/* device number */
#endif /* expanded by -frewrite-includes */
# 103 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

typedef	u_int32_t		fixpt_t;	/* fixed point number */

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_blkcnt_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_blkcnt_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _IN_ADDR_T
#define _IN_ADDR_T
typedef	__uint32_t	in_addr_t;	/* base type for internet address */
#endif /* _IN_ADDR_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_in_addr_t.h" 3 4
# 110 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_in_port_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_in_port_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _IN_PORT_T
#define _IN_PORT_T
typedef	__uint16_t		in_port_t;
#endif /* _IN_PORT_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_in_port_t.h" 3 4
# 111 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_ino_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_ino_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _INO_T 
#define _INO_T 
typedef	__darwin_ino_t		ino_t;		/* inode number */
#endif  /* _INO_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_ino_t.h" 3 4
# 112 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 2 3 4

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_ino64_t.h>			/* 64bit inode number */
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_ino64_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _INO64_T 
#define _INO64_T 
typedef __darwin_ino64_t        ino64_t; 	/* 64bit inode number */
#endif  /* _INO64_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_ino64_t.h" 3 4
# 115 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 2 3 4
#endif /* !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE) */
# 116 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_key_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_key_t.h" 1 3 4
/*
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
#include <sys/_types/_off_t.h>
#endif /* expanded by -frewrite-includes */
# 123 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

typedef	int32_t			segsz_t;	/* segment size */
typedef	int32_t			swblk_t;	/* swap offset */

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_uid_t.h>
#endif /* expanded by -frewrite-includes */
# 128 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
/* Major, minor numbers, dev_t's. */
#if defined(__cplusplus)
/*
 * These lowercase macros tend to match member functions in some C++ code,
 * so for C++, we must use inline functions instead.
 */

static inline __int32_t  major(__uint32_t _x)
{
	return (__int32_t)(((__uint32_t)_x >> 24) & 0xff);
}

static inline __int32_t  minor(__uint32_t _x)
{
	return (__int32_t)((_x) & 0xffffff);
}

static inline dev_t  makedev(__uint32_t _major, __uint32_t _minor)
{
	return (dev_t)(((_major) << 24) | (_minor));
}

#else	/* !__cplusplus */
# 153 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

#define	major(x)	((int32_t)(((u_int32_t)(x) >> 24) & 0xff))
#define	minor(x)	((int32_t)((x) & 0xffffff))
#define	makedev(x,y)	((dev_t)(((x) << 24) | (y)))

#endif	/* !__cplusplus */
# 159 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4
#endif	/* !_POSIX_C_SOURCE */
# 160 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_clock_t.h>
#endif /* expanded by -frewrite-includes */
# 162 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_size_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
#endif  /* _SUSECONDS_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_suseconds_t.h" 3 4
# 168 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 2 3 4

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_rsize_t.h>
#endif /* expanded by -frewrite-includes */
# 171 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_errno_t.h>
#endif /* expanded by -frewrite-includes */
# 172 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4
#endif
# 173 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
typedef __int32_t	fd_mask;

/*
 * Select uses bit masks of file descriptors in longs.  These macros
 * manipulate such bit fields (the filesystem macros use chars).  The
 * extra protection here is to permit application redefinition above
 * the default size.
 */
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_fd_setsize.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_fd_setsize.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
# 31 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_fd_copy.h" 3 4
# 201 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 2 3 4
#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 202 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_cond_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _PTHREAD_COND_T
#define _PTHREAD_COND_T
typedef __darwin_pthread_cond_t pthread_cond_t;
#endif /* _PTHREAD_COND_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_cond_t.h" 3 4
# 213 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_condattr_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_condattr_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _PTHREAD_MUTEX_T
#define _PTHREAD_MUTEX_T
typedef __darwin_pthread_mutex_t pthread_mutex_t;
#endif /*_PTHREAD_MUTEX_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_mutex_t.h" 3 4
# 215 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_mutexattr_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_mutexattr_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_rwlock_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
typedef __darwin_pthread_rwlockattr_t pthread_rwlockattr_t;
#endif /* _PTHREAD_RWLOCKATTR_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_rwlockattr_t.h" 3 4
# 219 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_t.h>
#endif /* expanded by -frewrite-includes */
# 220 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

#endif /* __POSIX_LIB__ */
# 222 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_key_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_pthread/_pthread_key_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _FSFILCNT_T
#define _FSFILCNT_T
typedef __darwin_fsfilcnt_t		fsfilcnt_t;
#endif /* _FSFILCNT_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_fsfilcnt_t.h" 3 4
# 230 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 2 3 4

#endif /* !_SYS_TYPES_H_ */
# 232 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/types.h" 3 4
# 37 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <sys/socket.h>		/* AF_INET */
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 1 3 4
/*
 * Copyright (c) 2000-2014 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * Version 2.0.
 */

#ifndef _SYS_SOCKET_H_
#define	_SYS_SOCKET_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 76 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_param.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_param.h" 1 3 4
/*
 * Copyright (c) 2004-2007 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "arm/_param.h"
 * data types (int, long, ...).   The result is unsigned int and must be
 * cast to any desired pointer type.
 */
#define	__DARWIN_ALIGNBYTES	(sizeof(__darwin_size_t) - 1)
#define	__DARWIN_ALIGN(p)	((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES) &~ __DARWIN_ALIGNBYTES)

#define      __DARWIN_ALIGNBYTES32     (sizeof(__uint32_t) - 1)
#define       __DARWIN_ALIGN32(p)       ((__darwin_size_t)((char *)(__darwin_size_t)(p) + __DARWIN_ALIGNBYTES32) &~ __DARWIN_ALIGNBYTES32)


#endif /* _ARM__PARAM_H_ */
# 23 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arm/_param.h" 3 4
# 30 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_param.h" 2 3 4
#else
# 31 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_param.h" 3 4
#error architecture not supported
#endif
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/machine/_param.h" 3 4
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 2 3 4


#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 81 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4

/*
 * Definitions related to sockets: types, address families, options.
 */

/*
 * Data types.
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_sa_family_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _SA_FAMILY_T 
#define _SA_FAMILY_T 
typedef __uint8_t		sa_family_t;
#endif  /* _SA_FAMILY_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_sa_family_t.h" 3 4
# 94 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_socklen_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_socklen_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
#ifndef _SOCKLEN_T
#define _SOCKLEN_T
typedef	__darwin_socklen_t	socklen_t;
#endif
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_socklen_t.h" 3 4

# 95 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 2 3 4

/* XXX Not explicitly defined by POSIX, but function return types are */
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_size_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
#define	SOCK_SEQPACKET	5		/* sequenced packet stream */

/*
 * Option flags per-socket.
 */
#define	SO_DEBUG	0x0001		/* turn on debugging info recording */
#define	SO_ACCEPTCONN	0x0002		/* socket has had listen() */
#define	SO_REUSEADDR	0x0004		/* allow local address reuse */
#define	SO_KEEPALIVE	0x0008		/* keep connections alive */
#define	SO_DONTROUTE	0x0010		/* just use interface addresses */
#define	SO_BROADCAST	0x0020		/* permit sending of broadcast msgs */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define	SO_USELOOPBACK	0x0040		/* bypass hardware when possible */
#define SO_LINGER	0x0080          /* linger on close if data present (in ticks) */
#else
# 132 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4
#define SO_LINGER	0x1080          /* linger on close if data present (in seconds) */
#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 134 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4
#define	SO_OOBINLINE	0x0100		/* leave received OOB data in line */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define	SO_REUSEPORT	0x0200		/* allow local address & port reuse */
#define	SO_TIMESTAMP	0x0400		/* timestamp received dgram traffic */
#define SO_TIMESTAMP_MONOTONIC	0x0800	/* Monotonically increasing timestamp on rcvd dgram */
#ifndef __APPLE__
#define	SO_ACCEPTFILTER	0x1000		/* there is an accept filter */
#else
# 142 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4
#define SO_DONTTRUNC	0x2000		/* APPLE: Retain unread data */
					/*  (ATOMIC proto) */
#define SO_WANTMORE	0x4000		/* APPLE: Give hint when more data ready */
#define SO_WANTOOBFLAG	0x8000		/* APPLE: Want OOB in MSG_FLAG on receive */


#endif  /* (!__APPLE__) */
# 149 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4
#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 150 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4

/*
 * Additional options, not kept in so_options.
 */
#define SO_SNDBUF	0x1001		/* send buffer size */
#define SO_RCVBUF	0x1002		/* receive buffer size */
#define SO_SNDLOWAT	0x1003		/* send low-water mark */
#define SO_RCVLOWAT	0x1004		/* receive low-water mark */
#define SO_SNDTIMEO	0x1005		/* send timeout */
#define SO_RCVTIMEO	0x1006		/* receive timeout */
#define	SO_ERROR	0x1007		/* get error status and clear */
#define	SO_TYPE		0x1008		/* get socket type */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
/*efine	SO_PRIVSTATE	0x1009		   get/deny privileged state */
#define SO_LABEL        0x1010          /* socket's MAC label */
#define SO_PEERLABEL    0x1011          /* socket's peer MAC label */
#ifdef __APPLE__
#define SO_NREAD	0x1020		/* APPLE: get 1st-packet byte count */
#define SO_NKE		0x1021		/* APPLE: Install socket-level NKE */
#define SO_NOSIGPIPE	0x1022		/* APPLE: No SIGPIPE on EPIPE */
#define SO_NOADDRERR	0x1023		/* APPLE: Returns EADDRNOTAVAIL when src is not available anymore */
#define SO_NWRITE	0x1024		/* APPLE: Get number of bytes currently in send socket buffer */
#define SO_REUSESHAREUID	0x1025		/* APPLE: Allow reuse of port/socket by different userids */
#ifdef __APPLE_API_PRIVATE
#define SO_NOTIFYCONFLICT	0x1026	/* APPLE: send notification if there is a bind on a port which is already in use */
#define	SO_UPCALLCLOSEWAIT	0x1027	/* APPLE: block on close until an upcall returns */
#endif
# 177 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4
#define SO_LINGER_SEC	0x1080          /* linger on close if data present (in seconds) */
#define SO_RANDOMPORT   0x1082  /* APPLE: request local port randomization */
#define SO_NP_EXTENSIONS	0x1083	/* To turn off some POSIX behavior */
#endif
# 181 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4


#define SO_NUMRCVPKT		0x1112	/* number of datagrams in receive socket buffer */

#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 186 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4

/*
 * Structure used for manipulating linger option.
 */
struct	linger {
	int	l_onoff;		/* option on/off */
	int	l_linger;		/* linger time */
};

#ifndef __APPLE__
struct	accept_filter_arg {
	char	af_name[16];
	char	af_arg[256-16];
};
#endif
# 201 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4
#define	AF_UNIX		1		/* local to host (pipes) */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 279 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4

/*
 * [XSI] Structure used by kernel to store most addresses.
 */
struct sockaddr {
	__uint8_t	sa_len;		/* total length */
	sa_family_t	sa_family;	/* [XSI] address family */
	char		sa_data[14];	/* [XSI] addr value (actually larger) */
};

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define	SOCK_MAXADDRLEN	255		/* longest possible addresses */

/*
 * Structure used by kernel to pass protocol
 * information in raw sockets.
 */
struct sockproto {
	__uint16_t	sp_family;		/* address family */
	__uint16_t	sp_protocol;		/* protocol */
};
#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE)*/
# 301 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4

/*
 * RFC 2553: protocol-independent placeholder for socket addresses
 */
#define	_SS_MAXSIZE	128
#define	_SS_ALIGNSIZE	(sizeof(__int64_t))
#define	SHUT_RD		0		/* shut down the reading side */
# 557 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4


__BEGIN_DECLS
int	accept(int, struct sockaddr * __restrict, socklen_t * __restrict)
		__DARWIN_ALIAS_C(accept);
int	bind(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS(bind);
int	connect(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C( connect);
int	getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict)
		__DARWIN_ALIAS(getpeername);
int	getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict)
		__DARWIN_ALIAS(getsockname);
int	getsockopt(int, int, int, void * __restrict, socklen_t * __restrict);
int	listen(int, int) __DARWIN_ALIAS(listen);
ssize_t	recv(int, void *, size_t, int) __DARWIN_ALIAS_C(recv);
ssize_t	recvfrom(int, void *, size_t, int, struct sockaddr * __restrict,
		socklen_t * __restrict) __DARWIN_ALIAS_C(recvfrom);
ssize_t	recvmsg(int, struct msghdr *, int) __DARWIN_ALIAS_C(recvmsg);
ssize_t	send(int, const void *, size_t, int) __DARWIN_ALIAS_C(send);
ssize_t	sendmsg(int, const struct msghdr *, int) __DARWIN_ALIAS_C(sendmsg);
ssize_t	sendto(int, const void *, size_t,
		int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS_C(sendto);
int	setsockopt(int, int, int, const void *, socklen_t);
int	shutdown(int, int);
int	sockatmark(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
int	socket(int, int, int);
int	socketpair(int, int, int, int *) __DARWIN_ALIAS(socketpair);

#if !defined(_POSIX_C_SOURCE)
int	sendfile(int, int, off_t, off_t *, struct sf_hdtr *, int);
#endif	/* !_POSIX_C_SOURCE */
# 587 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
void	pfctlinput(int, struct sockaddr *);
#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 591 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4
__END_DECLS


#endif /* !_SYS_SOCKET_H_ */
# 595 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/socket.h" 3 4
# 38 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <netinet/in.h>         /* INADDR_ANY, ..., ntohl(), ... */
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet/in.h" 1 3 4
/*
 * 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.
 *
 *	@(#)in.h	8.3 (Berkeley) 1/3/94
 * $FreeBSD: src/sys/netinet/in.h,v 1.48.2.2 2001/04/21 14:53:06 ume Exp $
 */

#ifndef _NETINET_IN_H_
#define _NETINET_IN_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/appleapiopts.h>
#endif /* expanded by -frewrite-includes */
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet/in.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
/*
 * The following two #includes insure htonl and family are defined
 */
#if 0 /* expanded by -frewrite-includes */
#include <machine/endian.h>
#endif /* expanded by -frewrite-includes */
# 87 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet/in.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_endian.h>
#endif /* expanded by -frewrite-includes */
# 88 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet/in.h" 3 4

/*
 * Constants and structures defined by the internet system,
 * Per RFC 790, September 1981, and numerous additions.
 */

/*
 * Protocols (RFC 1700)
 */
#define	IPPROTO_IP		0		/* dummy for IP */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define	IPPROTO_HOPOPTS	0		/* IP6 hop-by-hop options */
#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 101 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet/in.h" 3 4
#define	IPPROTO_ICMP		1		/* control message protocol */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define	IPPROTO_IGMP		2		/* group mgmt protocol */
#define	IPPROTO_GGP		3		/* gateway^2 (deprecated) */
#define IPPROTO_IPV4		4 		/* IPv4 encapsulation */
#define IPPROTO_IPIP		IPPROTO_IPV4	/* for compatibility */
#define	IPCTL_DIRECTEDBROADCAST	9	/* may re-broadcast received packets */
#define IPCTL_INTRQMAXLEN	10	/* max length of netisr queue */
#define	IPCTL_INTRQDROPS	11	/* number of netisr q drops */
#define	IPCTL_STATS		12	/* ipstat structure */
#define	IPCTL_ACCEPTSOURCEROUTE	13	/* may accept source routed packets */
#define	IPCTL_FASTFORWARDING	14	/* use fast IP forwarding code */
#define	IPCTL_KEEPFAITH		15	/* deprecated */
#define	IPCTL_GIF_TTL		16	/* default TTL for gif encap packet */
#define	IPCTL_MAXID		17

#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 651 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet/in.h" 3 4

/* INET6 stuff */
#define __KAME_NETINET_IN_H_INCLUDED_
#if 0 /* expanded by -frewrite-includes */
#include <netinet6/in6.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet6/in6.h" 1 3 4
/*
 * Copyright (c) 2008-2013 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 *
 * This file contains Original Code and/or Modifications of Original Code
 * 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.
 *
 *	@(#)in.h	8.3 (Berkeley) 1/3/94
 */

#ifndef __KAME_NETINET_IN_H_INCLUDED_
#error "do not include netinet6/in6.h directly, include netinet/in.h. " \
	" see RFC2553"
#endif
# 97 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet6/in6.h" 3 4

#ifndef _NETINET6_IN6_H_
#define	_NETINET6_IN6_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/appleapiopts.h>
#endif /* expanded by -frewrite-includes */
# 101 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet6/in6.h" 3 4
#if 0 /* expanded by -frewrite-includes */
 * A user may set the IPPROTO_IP option IP_PORTRANGE to change this
 * default assignment range.
 *
 * The value IP_PORTRANGE_DEFAULT causes the default behavior.
 *
 * The value IP_PORTRANGE_HIGH is the same as IP_PORTRANGE_DEFAULT,
 * and exists only for FreeBSD compatibility purposes.
 *
 * The value IP_PORTRANGE_LOW changes the range to the "low" are
 * that is (by convention) restricted to privileged processes.
 * This convention is based on "vouchsafe" principles only.
 * It is only secure if you trust the remote host to restrict these ports.
 * The range is IPPORT_RESERVEDMIN to IPPORT_RESERVEDMAX.
 */

#define	IPV6PORT_RESERVED	1024
#define	IPV6PORT_ANONMIN	49152
#define	IPV6PORT_ANONMAX	65535
#define	IPV6PORT_RESERVEDMIN	600
#define	IPV6PORT_RESERVEDMAX	(IPV6PORT_RESERVED-1)
#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
# 148 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet6/in6.h" 3 4

/*
 * IPv6 address
 */
struct in6_addr {
	union {
		__uint8_t   __u6_addr8[16];
		__uint16_t  __u6_addr16[8];
		__uint32_t  __u6_addr32[4];
	} __u6_addr;			/* 128-bit IP6 address */
};

#define	s6_addr   __u6_addr.__u6_addr8

#define	INET6_ADDRSTRLEN	46

/*
 * Socket address for IPv6
 */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define	SIN6_LEN
#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
# 170 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet6/in6.h" 3 4
struct sockaddr_in6 {
	__uint8_t	sin6_len;	/* length of this struct(sa_family_t) */
	sa_family_t	sin6_family;	/* AF_INET6 (sa_family_t) */
	in_port_t	sin6_port;	/* Transport layer port # (in_port_t) */
	__uint32_t	sin6_flowinfo;	/* IP6 flow information */
	struct in6_addr	sin6_addr;	/* IP6 address */
	__uint32_t	sin6_scope_id;	/* scope zone index */
};




/*
 * Definition of some useful macros to handle IP6 addresses
	(IN6_IS_ADDR_MULTICAST(a) &&	\
	(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))
#define	IN6_IS_ADDR_MC_GLOBAL(a)	\
	(IN6_IS_ADDR_MULTICAST(a) &&	\
	(__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL))




/*
 * Options for use with [gs]etsockopt at the IPV6 level.
 * First word of comment is data type; bool is stored in int.
 */
/* no hdrincl */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
/*
 */
#define	IPV6_RECVTCLASS		35 /* bool; recv traffic class values */
#define	IPV6_TCLASS		36 /* int; send traffic class value */

#ifdef __APPLE_USE_RFC_3542
/* new socket options introduced in RFC3542 */
/*
 * ip6_dest; send dst option before rthdr
 * APPLE: Value purposely different than FreeBSD (35) to avoid
 * collision with definition of IPV6_RECVTCLASS in previous
 * darwin implementations
 */
#define	IPV6_RTHDRDSTOPTS	57

/*
 * bool; recv if, dst addr
/*
 * The following option is private; do not use it from user applications.
 * It is deliberately defined to the same value as IP_MSFILTER.
 */
#define	IPV6_MSFILTER		74 /* struct __msfilterreq; */
#endif /* __APPLE_USE_RFC_3542 */
#define	IPV6CTL_MAXIFPREFIXES	47
#define	IPV6CTL_MAXIFDEFROUTERS 48
#define	IPV6CTL_MAXDYNROUTES	49
#define	ICMPV6CTL_ND6_ONLINKNSRFC4861	50

/* New entries should be added here from current IPV6CTL_MAXID value. */
/* to define items, should talk with KAME guys first, for *BSD compatibility */
#define	IPV6CTL_MAXID		51



__BEGIN_DECLS
struct cmsghdr;

extern int inet6_option_space(int);
extern int inet6_option_init(void *, struct cmsghdr **, int);
extern int inet6_option_append(struct cmsghdr *, const __uint8_t *, int, int);
extern __uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int);
extern int inet6_option_next(const struct cmsghdr *, __uint8_t **);
extern int inet6_option_find(const struct cmsghdr *, __uint8_t **, int);

extern size_t inet6_rthdr_space(int, int);
extern struct cmsghdr *inet6_rthdr_init(void *, int);
extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *,
    unsigned int);
extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int);
extern int inet6_opt_find(void *, socklen_t, int, __uint8_t, socklen_t *,
    void **);
extern int inet6_opt_get_val(void *, int, void *, socklen_t);
extern socklen_t inet6_rth_space(int, int);
extern void *inet6_rth_init(void *, socklen_t, int, int);
extern int inet6_rth_add(void *, const struct in6_addr *);
extern int inet6_rth_reverse(const void *, void *);
extern int inet6_rth_segments(const void *);
extern struct in6_addr *inet6_rth_getaddr(const void *, int);
extern void addrsel_policy_init(void);
__END_DECLS
#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
# 666 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet6/in6.h" 3 4
#endif /* !_NETINET6_IN6_H_ */
# 667 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet6/in6.h" 3 4
# 655 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netinet/in.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/ioctl.h>
#endif /* expanded by -frewrite-includes */
# 41 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"
#endif
# 42 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"
#ifdef XP_UNIX
#ifdef AIX
/*
 * On AIX 4.3, the header <arpa/inet.h> refers to struct
 * ether_addr and struct sockaddr_dl that are not declared.
 * The following struct declarations eliminate the compiler
 * warnings.
 */
struct ether_addr;
struct sockaddr_dl;
#endif /* AIX */
# 53 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"
#if 0 /* expanded by -frewrite-includes */
#include <arpa/inet.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arpa/inet.h" 1 3 4
/*
 * ++Copyright++ 1983, 1993
 * -
 * Copyright (c) 1983, 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
 *	$Id: inet.h,v 1.10 2006/02/01 18:09:47 majka Exp $
 */

#ifndef _ARPA_INET_H_
#define	_ARPA_INET_H_

/* External definitions for functions in inet(3), addr2ascii(3) */

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arpa/inet.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arpa/inet.h" 3 4

__BEGIN_DECLS

in_addr_t	 inet_addr(const char *);
char		*inet_ntoa(struct in_addr);
const char	*inet_ntop(int, const void *, char *, socklen_t);
int		 inet_pton(int, const char *, void *);

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
int		 ascii2addr(int, const char *, void *);
char		*addr2ascii(int, const void *, int, char *);
int		 inet_aton(const char *, struct in_addr *);
in_addr_t	 inet_lnaof(struct in_addr);
struct in_addr	 inet_makeaddr(in_addr_t, in_addr_t);
in_addr_t	 inet_netof(struct in_addr);
in_addr_t	 inet_network(const char *);
char		*inet_net_ntop(int, const void *, int, char *, __darwin_size_t);
int		 inet_net_pton(int, const char *, void *, __darwin_size_t);
char	 	*inet_neta(in_addr_t, char *, __darwin_size_t);
unsigned int	 inet_nsap_addr(const char *, unsigned char *, int);
char	*inet_nsap_ntoa(int, const unsigned char *, char *);
#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
# 94 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arpa/inet.h" 3 4

__END_DECLS

#endif /* !_ARPA_INET_H_ */
# 98 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/arpa/inet.h" 3 4
# 54 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h" 2
#endif /* XP_UNIX */
# 55 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"
#if 0 /* expanded by -frewrite-includes */
#include <netdb.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netdb.h" 1 3 4
/*
 * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 * 
 * The Original Code and all software distributed under the License are
 */

/*
 *      @(#)netdb.h	8.1 (Berkeley) 6/2/93
 */

#ifndef _NETDB_H_
#define _NETDB_H_

#define	AI_PASSIVE	0x00000001 /* get address to use bind() */
#define	AI_CANONNAME	0x00000002 /* fill ai_canonname */
#define	AI_NUMERICHOST	0x00000004 /* prevent host name resolution */
#define	AI_NUMERICSERV	0x00001000 /* prevent service name resolution */
/* valid flags for addrinfo (not a standard def, apps should not use it) */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define AI_MASK \
    (AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | \
    AI_ADDRCONFIG)

#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 222 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netdb.h" 3 4
#define	AI_ALL		0x00000100 /* IPv6 and IPv4-mapped (with AI_V4MAPPED) */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define	AI_V4MAPPED_CFG	0x00000200 /* accept IPv4-mapped if kernel supports */
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 226 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netdb.h" 3 4
#define	AI_ADDRCONFIG	0x00000400 /* only if any address is assigned */
#define	AI_V4MAPPED	0x00000800 /* accept IPv4-mapped IPv6 address */
/* special recommended flags for getipnodebyname */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define	AI_DEFAULT	(AI_V4MAPPED_CFG | AI_ADDRCONFIG)
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
#define	NI_NUMERICSERV	0x00000008
#define	NI_DGRAM	0x00000010
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define NI_WITHSCOPEID	0x00000020

/*
 * Scope delimit character
 */
#define	SCOPE_DELIMITER	'%'
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 256 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netdb.h" 3 4

__BEGIN_DECLS

void		endhostent(void);
void		endnetent(void);
struct netent	*getnetent(void);
struct protoent	*getprotobyname(const char *);
struct protoent	*getprotobynumber(int);
struct protoent	*getprotoent(void);
struct servent	*getservbyname(const char *, const char *);
struct servent	*getservbyport(int, const char *);
struct servent	*getservent(void);
void		sethostent(int);
/* void		sethostfile(const char *); */
void		setnetent(int);
void		setprotoent(int);
void		setservent(int);

#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
void		freehostent(struct hostent *);
struct hostent	*gethostbyname2(const char *, int);
int			getnetgrent(char **, char **, char **);
void		endnetgrent(void);
void		setnetgrent(const char *);
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 311 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netdb.h" 3 4

__END_DECLS

#endif /* !_NETDB_H_ */
# 315 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/netdb.h" 3 4
# 56 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h" 2

#if defined(FREEBSD) || defined(BSDI) || defined(QNX)
#if 0 /* expanded by -frewrite-includes */
#include <rpc/types.h> /* the only place that defines INADDR_LOOPBACK */
#endif /* expanded by -frewrite-includes */
# 59 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"
#endif
# 60 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"

/*
 * OS/2 hack.  For some reason INADDR_LOOPBACK is not defined in the
 * socket headers.
 */
#if defined(OS2) && !defined(INADDR_LOOPBACK)
#define INADDR_LOOPBACK 0x7f000001
#endif
# 68 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"

/*
 * Prototypes of ntohl() etc. are declared in <machine/endian.h>
 * on these platforms.
# 81 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"

#elif defined(WIN32)
# 83 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"

/*
 * Do not include any system header files.
 *
 * Originally we were including <windows.h>.  It slowed down the
 * compilation of files that included NSPR headers, so we removed
 * the <windows.h> inclusion at customer's request, which created
 * an unfortunate inconsistency with other platforms.
 */

#else
# 94 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"

#error Unknown platform

#endif
# 98 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"

#endif /* prinet_h__ */
# 100 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinet.h"
# 20 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h" 2

PR_BEGIN_EXTERN_C

/* Typedefs */
typedef struct PRDir            PRDir;
typedef struct PRDirEntry       PRDirEntry;
#ifdef MOZ_UNICODE
typedef struct PRDirUTF16       PRDirUTF16;
typedef struct PRDirEntryUTF16  PRDirEntryUTF16;
#endif /* MOZ_UNICODE */
# 30 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"
typedef struct PRFileDesc       PRFileDesc;
typedef struct PRFileInfo       PRFileInfo;
typedef struct PRFileInfo64     PRFileInfo64;
typedef union  PRNetAddr        PRNetAddr;
typedef struct PRIOMethods      PRIOMethods;
typedef struct PRPollDesc       PRPollDesc;
typedef struct PRFilePrivate    PRFilePrivate;
typedef struct PRSendFileData   PRSendFileData;

/*
***************************************************************************
** The file descriptor.
** This is the primary structure to represent any active open socket,
** whether it be a normal file or a network connection. Such objects
** are stackable (or layerable). Each layer may have its own set of
** method pointers and context private to that layer. All each layer
** knows about its neighbors is how to get to their method table.
***************************************************************************
*/

typedef PRIntn PRDescIdentity;          /* see: Layering file descriptors */

struct PRFileDesc {
    const PRIOMethods *methods;         /* the I/O methods table */
    PRFilePrivate *secret;              /* layer dependent data */
    PRFileDesc *lower, *higher;         /* pointers to adjacent layers */
    void (PR_CALLBACK *dtor)(PRFileDesc *fd);
                                        /* A destructor function for layer */
    PRDescIdentity identity;            /* Identity of this particular layer  */
};

/*
***************************************************************************
** PRTransmitFileFlags
**
** Flags for PR_TransmitFile.  Pass PR_TRANSMITFILE_CLOSE_SOCKET to
** PR_TransmitFile if the connection should be closed after the file
** is transmitted.
***************************************************************************
*/
typedef enum PRTransmitFileFlags {
    PR_TRANSMITFILE_KEEP_OPEN = 0,    /* socket is left open after file
                                       * is transmitted. */
    PR_TRANSMITFILE_CLOSE_SOCKET = 1  /* socket is closed after file
                                       * is transmitted. */
} PRTransmitFileFlags;

/*
**************************************************************************
** Macros for PRNetAddr
**
** Address families: PR_AF_INET, PR_AF_INET6, PR_AF_LOCAL
** IP addresses: PR_INADDR_ANY, PR_INADDR_LOOPBACK, PR_INADDR_BROADCAST
**************************************************************************
*/

#ifdef WIN32

#define PR_AF_INET 2
#define PR_AF_LOCAL 1
#define PR_INADDR_ANY (unsigned long)0x00000000
#define PR_INADDR_LOOPBACK 0x7f000001
#define PR_INADDR_BROADCAST (unsigned long)0xffffffff

#else /* WIN32 */
# 95 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"

#define PR_AF_INET AF_INET
#define PR_AF_LOCAL AF_UNIX
#define PR_INADDR_ANY INADDR_ANY
#define PR_INADDR_LOOPBACK INADDR_LOOPBACK
#define PR_INADDR_BROADCAST INADDR_BROADCAST

#endif /* WIN32 */
# 103 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"

# 119 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"

/*
**************************************************************************
** A network address
**
** Only Internet Protocol (IPv4 and IPv6) addresses are supported.
** The address family must always represent IPv4 (AF_INET, probably == 2)
** or IPv6 (AF_INET6).
**************************************************************************
*************************************************************************/

struct PRIPv6Addr {
	union {
		PRUint8  _S6_u8[16];
		PRUint16 _S6_u16[8];
		PRUint32 _S6_u32[4];
		PRUint64 _S6_u64[2];
	} _S6_un;
};
#define pr_s6_addr		_S6_un._S6_u8
#define pr_s6_addr16	_S6_un._S6_u16
#define pr_s6_addr32	_S6_un._S6_u32
#define pr_s6_addr64 	_S6_un._S6_u64

typedef struct PRIPv6Addr PRIPv6Addr;

union PRNetAddr {
    struct {
        PRUint16 family;                /* address family (0x00ff maskable) */
#ifdef XP_BEOS
        char data[10];                  /* Be has a smaller structure */
#else
# 151 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"
        char data[14];                  /* raw address data */
#endif
# 153 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"
    } raw;
    struct {
        PRUint16 family;                /* address family (AF_INET) */
        PRUint16 port;                  /* port number */
        PRUint32 ip;                    /* The actual 32 bits of address */
#ifdef XP_BEOS
        char pad[4];                    /* Be has a smaller structure */
#else
# 161 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"
        char pad[8];
#endif
# 163 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"
    } inet;
    struct {
        PRUint16 family;                /* address family (AF_INET6) */
        PRUint16 port;                  /* port number */
        PRUint32 flowinfo;              /* routing information */
        PRIPv6Addr ip;                  /* the actual 128 bits of address */
        PRUint32 scope_id;              /* set of interfaces for a scope */
    } ipv6;
#if defined(XP_UNIX) || defined(XP_OS2)
    struct {                            /* Unix domain socket address */
        PRUint16 family;                /* address family (AF_UNIX) */
#ifdef XP_OS2
        char path[108];                 /* null-terminated pathname */
                                        /* bind fails if size is not 108. */
#else
# 178 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"
        char path[104];                 /* null-terminated pathname */
#endif
# 180 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"
    } local;
#endif
# 182 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"
};

/*
***************************************************************************
** PRSockOption
**
** The file descriptors can have predefined options set after they file
** descriptor is created to change their behavior. Only the options in
** the following enumeration are supported.
***************************************************************************
*/
typedef enum PRSockOption
{
    PR_SockOpt_Nonblocking,     /* nonblocking io */
    PR_SockOpt_Linger,          /* linger on close if data present */
    PR_SockOpt_Reuseaddr,       /* allow local address reuse */
    PR_SockOpt_Keepalive,       /* keep connections alive */
    PR_SockOpt_RecvBufferSize,  /* send buffer size */
    PR_SockOpt_SendBufferSize,  /* receive buffer size */

    PR_SockOpt_IpTimeToLive,    /* time to live */
    PR_SockOpt_IpTypeOfService, /* type of service and precedence */

    PR_SockOpt_AddMember,       /* add an IP group membership */
    PR_SockOpt_DropMember,      /* drop an IP group membership */
    PR_SockOpt_McastInterface,  /* multicast interface address */
    PR_SockOpt_McastTimeToLive, /* multicast timetolive */
    PR_SockOpt_McastLoopback,   /* multicast loopback */

    PR_SockOpt_NoDelay,         /* don't delay send to coalesce packets */
    PR_SockOpt_MaxSegment,      /* maximum segment size */
    PR_SockOpt_Broadcast,       /* enable broadcast */
    PR_SockOpt_Reuseport,       /* allow local address & port reuse on
                                 * platforms that support it */
    PR_SockOpt_Last
} PRSockOption;

typedef struct PRLinger {
	PRBool polarity;		    /* Polarity of the option's setting */
	PRIntervalTime linger;	    /* Time to linger before closing */
} PRLinger;

typedef struct PRMcastRequest {
	PRNetAddr mcaddr;			/* IP multicast address of group */
	PRNetAddr ifaddr;			/* local IP address of interface */
} PRMcastRequest;

typedef struct PRSocketOptionData
{
    PRSockOption option;
    union
    {
        PRUintn ip_ttl;             /* IP time to live */
        PRUintn mcast_ttl;          /* IP multicast time to live */
        PRUintn tos;                /* IP type of service and precedence */
        PRBool non_blocking;        /* Non-blocking (network) I/O */
        PRBool reuse_addr;          /* Allow local address reuse */
        PRBool reuse_port;          /* Allow local address & port reuse on
                                     * platforms that support it */
        PRBool keep_alive;          /* Keep connections alive */
        PRBool mcast_loopback;      /* IP multicast loopback */
        PRBool no_delay;            /* Don't delay send to coalesce packets */
        PRBool broadcast;           /* Enable broadcast */
        PRSize max_segment;         /* Maximum segment size */
        PRSize recv_buffer_size;    /* Receive buffer size */
        PRSize send_buffer_size;    /* Send buffer size */
        PRLinger linger;            /* Time to linger on close if data present */
        PRMcastRequest add_member;  /* add an IP group membership */
        PRMcastRequest drop_member; /* Drop an IP group membership */
        PRNetAddr mcast_if;         /* multicast interface address */
    } value;
} PRSocketOptionData;

/*
***************************************************************************
** PRIOVec
**
** The I/O vector is used by the write vector method to describe the areas
** that are affected by the ouput operation.
***************************************************************************
*/
typedef struct PRIOVec {
    char *iov_base;
    int iov_len;
} PRIOVec;

/*
***************************************************************************
** Discover what type of socket is being described by the file descriptor.
***************************************************************************
*/
typedef enum PRDescType
{
    PR_DESC_FILE = 1,
    PR_DESC_SOCKET_TCP = 2,
    PR_DESC_SOCKET_UDP = 3,
    PR_DESC_LAYERED = 4,
    PR_DESC_PIPE = 5
} PRDescType;

typedef enum PRSeekWhence {
    PR_SEEK_SET = 0,
    PR_SEEK_CUR = 1,
    PR_SEEK_END = 2
} PRSeekWhence;

NSPR_API(PRDescType) PR_GetDescType(PRFileDesc *file);

/*
***************************************************************************
** PRIOMethods
**
** The I/O methods table provides procedural access to the functions of
** the file descriptor. It is the responsibility of a layer implementor
** to provide suitable functions at every entry point. If a layer provides
** no functionality, it should call the next lower(higher) function of the
** same name (e.g., return fd->lower->method->close(fd->lower));
**
** Not all functions are implemented for all types of files. In cases where
** that is true, the function will return a error indication with an error
** code of PR_INVALID_METHOD_ERROR.
***************************************************************************
*/

typedef PRStatus (PR_CALLBACK *PRCloseFN)(PRFileDesc *fd);
typedef PRInt32 (PR_CALLBACK *PRReadFN)(PRFileDesc *fd, void *buf, PRInt32 amount);
typedef PRInt32 (PR_CALLBACK *PRWriteFN)(PRFileDesc *fd, const void *buf, PRInt32 amount);
typedef PRInt32 (PR_CALLBACK *PRAvailableFN)(PRFileDesc *fd);
typedef PRInt64 (PR_CALLBACK *PRAvailable64FN)(PRFileDesc *fd);
typedef PRStatus (PR_CALLBACK *PRFsyncFN)(PRFileDesc *fd);
typedef PROffset32 (PR_CALLBACK *PRSeekFN)(PRFileDesc *fd, PROffset32 offset, PRSeekWhence how);
typedef PROffset64 (PR_CALLBACK *PRSeek64FN)(PRFileDesc *fd, PROffset64 offset, PRSeekWhence how);
typedef PRStatus (PR_CALLBACK *PRFileInfoFN)(PRFileDesc *fd, PRFileInfo *info);
typedef PRStatus (PR_CALLBACK *PRFileInfo64FN)(PRFileDesc *fd, PRFileInfo64 *info);
typedef PRInt32 (PR_CALLBACK *PRWritevFN)(
    PRFileDesc *fd, const PRIOVec *iov, PRInt32 iov_size,
    PRIntervalTime timeout);
typedef PRStatus (PR_CALLBACK *PRConnectFN)(
    PRFileDesc *fd, const PRNetAddr *addr, PRIntervalTime timeout);
typedef PRFileDesc* (PR_CALLBACK *PRAcceptFN) (
    PRFileDesc *fd, PRNetAddr *addr, PRIntervalTime timeout);
typedef PRStatus (PR_CALLBACK *PRBindFN)(PRFileDesc *fd, const PRNetAddr *addr);
typedef PRStatus (PR_CALLBACK *PRListenFN)(PRFileDesc *fd, PRIntn backlog);
typedef PRStatus (PR_CALLBACK *PRShutdownFN)(PRFileDesc *fd, PRIntn how);
typedef PRInt32 (PR_CALLBACK *PRRecvFN)(
    PRFileDesc *fd, void *buf, PRInt32 amount,
    PRIntn flags, PRIntervalTime timeout);
typedef PRInt32 (PR_CALLBACK *PRSendFN) (
    PRFileDesc *fd, const void *buf, PRInt32 amount,
    PRIntn flags, PRIntervalTime timeout);
typedef PRInt32 (PR_CALLBACK *PRRecvfromFN)(
    PRFileDesc *fd, void *buf, PRInt32 amount,
    PRIntn flags, PRNetAddr *addr, PRIntervalTime timeout);
typedef PRInt32 (PR_CALLBACK *PRSendtoFN)(
    PRFileDesc *fd, const void *buf, PRInt32 amount,
    PRIntn flags, const PRNetAddr *addr, PRIntervalTime timeout);
typedef PRInt16 (PR_CALLBACK *PRPollFN)(
    PRFileDesc *fd, PRInt16 in_flags, PRInt16 *out_flags);
typedef PRInt32 (PR_CALLBACK *PRAcceptreadFN)(
    PRFileDesc *sd, PRFileDesc **nd, PRNetAddr **raddr,
    void *buf, PRInt32 amount, PRIntervalTime t);
typedef PRInt32 (PR_CALLBACK *PRTransmitfileFN)(
     PRFileDesc *sd, PRFileDesc *fd, const void *headers,
     PRInt32 hlen, PRTransmitFileFlags flags, PRIntervalTime t);
typedef PRStatus (PR_CALLBACK *PRGetsocknameFN)(PRFileDesc *fd, PRNetAddr *addr);
typedef PRStatus (PR_CALLBACK *PRGetpeernameFN)(PRFileDesc *fd, PRNetAddr *addr);
typedef PRStatus (PR_CALLBACK *PRGetsocketoptionFN)(
    PRFileDesc *fd, PRSocketOptionData *data);
typedef PRStatus (PR_CALLBACK *PRSetsocketoptionFN)(
    PRFileDesc *fd, const PRSocketOptionData *data);
typedef PRInt32 (PR_CALLBACK *PRSendfileFN)(
	PRFileDesc *networkSocket, PRSendFileData *sendData,
	PRTransmitFileFlags flags, PRIntervalTime timeout);
typedef PRStatus (PR_CALLBACK *PRConnectcontinueFN)(
    PRFileDesc *fd, PRInt16 out_flags);
typedef PRIntn (PR_CALLBACK *PRReservedFN)(PRFileDesc *fd);

struct PRIOMethods {
    PRDescType file_type;           /* Type of file represented (tos)           */
    PRCloseFN close;                /* close file and destroy descriptor        */
    PRReadFN read;                  /* read up to specified bytes into buffer   */
    PRWriteFN write;                /* write specified bytes from buffer        */
    PRAvailableFN available;        /* determine number of bytes available      */
    PRAvailable64FN available64;    /*          ditto, 64 bit                   */
    PRFsyncFN fsync;                /* flush all buffers to permanent store     */
};

/*
 **************************************************************************
 * FUNCTION: PR_GetSpecialFD
 * DESCRIPTION: Get the file descriptor that represents the standard input,
 *              output, or error stream.
 * INPUTS:
 *     PRSpecialFD id
 *         A value indicating the type of stream desired:
 *             PR_StandardInput: standard input
 *             PR_StandardOuput: standard output
 *             PR_StandardError: standard error
 * OUTPUTS: none
 * RETURNS: PRFileDesc *
 *     If the argument is valid, PR_GetSpecialFD returns a file descriptor
 *     that represents the corresponding standard I/O stream.  Otherwise,
 *     PR_GetSpecialFD returns NULL and sets error PR_INVALID_ARGUMENT_ERROR.
 * OUTPUTS:
 *     None.
 * RETURN:
 *     PRStatus
 * SIDE EFFECTS:
 * RESTRICTIONS:
 *     None.
 * MEMORY:
 *     The dynamic memory pointed to by the argument fd is freed.
 **************************************************************************
 */

NSPR_API(PRStatus)    PR_Close(PRFileDesc *fd);


NSPR_API(PRFileDesc *) PR_NewPollableEvent(void);

NSPR_API(PRStatus) PR_DestroyPollableEvent(PRFileDesc *event);

NSPR_API(PRStatus) PR_SetPollableEvent(PRFileDesc *event);

NSPR_API(PRStatus) PR_WaitForPollableEvent(PRFileDesc *event);

PR_END_EXTERN_C

#endif /* prio_h___ */
# 2023 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prio.h"
# 27 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prprf.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 28 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prprf.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h>
#endif /* expanded by -frewrite-includes */
# 29 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prprf.h"

PR_BEGIN_EXTERN_C

/*
** sprintf into a fixed size buffer. Guarantees that a NUL is at the end
** of the buffer. Returns the length of the written output, NOT including
** the NUL, or (PRUint32)-1 if an error occurs.
*/
NSPR_API(PRUint32) PR_snprintf(char *out, PRUint32 outlen, const char *fmt, ...);

/*
** sprintf into a PR_MALLOC'd buffer. Return a pointer to the malloc'd
** buffer on success, NULL on failure. Call "PR_smprintf_free" to release
** the memory returned.
*/
NSPR_API(char*) PR_smprintf(const char *fmt, ...);

/*
** Free the memory allocated, for the caller, by PR_smprintf
*/
NSPR_API(void) PR_smprintf_free(char *mem);

/*
** "append" sprintf into a PR_MALLOC'd buffer. "last" is the last value of
** the PR_MALLOC'd buffer. sprintf will append data to the end of last,
** growing it as necessary using realloc. If last is NULL, PR_sprintf_append
** will allocate the initial string. The return value is the new value of
** last for subsequent calls, or NULL if there is a malloc failure.
*/
NSPR_API(char*) PR_sprintf_append(char *last, const char *fmt, ...);

/*
** sprintf into a function. The function "f" is called with a string to
** place into the output. "arg" is an opaque pointer used by the stuff
** function to hold any state needed to do the storage of the output
** data. The return value is a count of the number of characters fed to
** the stuff function, or (PRUint32)-1 if an error occurs.
*/
typedef PRIntn (*PRStuffFunc)(void *arg, const char *s, PRUint32 slen);

NSPR_API(PRUint32) PR_sxprintf(PRStuffFunc f, void *arg, const char *fmt, ...);

/*
** fprintf to a PRFileDesc
*/
NSPR_API(PRUint32) PR_fprintf(struct PRFileDesc* fd, const char *fmt, ...);

/*
** va_list forms of the above.
*/
NSPR_API(PRUint32) PR_vsnprintf(char *out, PRUint32 outlen, const char *fmt, va_list ap);
NSPR_API(char*) PR_vsmprintf(const char *fmt, va_list ap);
NSPR_API(char*) PR_vsprintf_append(char *last, const char *fmt, va_list ap);
NSPR_API(PRUint32) PR_vsxprintf(PRStuffFunc f, void *arg, const char *fmt, va_list ap);
NSPR_API(PRUint32) PR_vfprintf(struct PRFileDesc* fd, const char *fmt, va_list ap);

/*
***************************************************************************
**     const char *buf
**         a character string holding the input to scan
**     const char *fmt
**         the format control string for the conversions
**     ...
**         variable number of arguments, each of them is a pointer to
**         a data object in which the converted value will be stored
** OUTPUTS: none
** RETURNS: PRInt32
**     The number of values converted and stored.
** RESTRICTIONS:
**    Multibyte characters in 'buf' or 'fmt' are not allowed.
***************************************************************************
*/

NSPR_API(PRInt32) PR_sscanf(const char *buf, const char *fmt, ...);

PR_END_EXTERN_C

#endif /* prprf_h___ */
# 123 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prprf.h"
# 20 "../../dist/include/nsDebug.h" 2
#endif
# 21 "../../dist/include/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;
 * evaluate the message argument.
 */
#ifdef DEBUG
#define NS_WARN_IF_FALSE(_expr,_msg)                          \
  do {                                                        \
    if (!(_expr)) {                                           \
      NS_DebugBreak(NS_DEBUG_WARNING, _msg, #_expr, __FILE__, __LINE__); \
    }                                                         \
  } while(0)
#else
# 68 "../../dist/include/nsDebug.h"
#define NS_WARN_IF_FALSE(_expr, _msg)  do { /* nothing */ } while(0)
#endif
# 70 "../../dist/include/nsDebug.h"


/**
 * Test an assertion for truth. If the expression is not true then
 * trigger a program failure.
 *
 * Note that the non-debug version of this macro does <b>not</b>
 * evaluate the message argument.
 */
#ifdef DEBUG
#define NS_ASSERTION(expr, str)                               \
  do {                                                        \
    if (!(expr)) {                                            \
      NS_DebugBreak(NS_DEBUG_ASSERTION, str, #expr, __FILE__, __LINE__); \
    }                                                         \
  } while(0)
#else
# 87 "../../dist/include/nsDebug.h"
#define NS_ASSERTION(expr, str)        do { /* nothing */ } while(0)
#endif
# 89 "../../dist/include/nsDebug.h"

/**
 * NS_PRECONDITION/POSTCONDITION are synonyms for NS_ASSERTION.
 */
#define NS_PRECONDITION(expr, str) NS_ASSERTION(expr, str)
#define NS_POSTCONDITION(expr, str) NS_ASSERTION(expr, str)

/**
 * This macros triggers a program failure if executed. It indicates that
 * an attempt was made to execute some unimplemented functionality.
 */
#ifdef DEBUG
#define NS_NOTYETIMPLEMENTED(str)                             \
  NS_DebugBreak(NS_DEBUG_ASSERTION, str, "NotYetImplemented", __FILE__, __LINE__)
#else
# 104 "../../dist/include/nsDebug.h"
#define NS_NOTYETIMPLEMENTED(str)      do { /* nothing */ } while(0)
#endif
# 106 "../../dist/include/nsDebug.h"

/**
 * This macros triggers a program failure if executed. It indicates that
 * an attempt was made to execute a codepath which should not be reachable.
 */
#ifdef DEBUG
#define NS_NOTREACHED(str)                                    \
  NS_DebugBreak(NS_DEBUG_ASSERTION, str, "Not Reached", __FILE__, __LINE__)
#else
# 115 "../../dist/include/nsDebug.h"
#define NS_NOTREACHED(str)             do { /* nothing */ } while(0)
#endif
# 117 "../../dist/include/nsDebug.h"

/**
 * Log an error message.
 */
#ifdef DEBUG
#define NS_ERROR(str)                                         \
  NS_DebugBreak(NS_DEBUG_ASSERTION, str, "Error", __FILE__, __LINE__)
#else
# 125 "../../dist/include/nsDebug.h"
#define NS_ERROR(str)                  do { /* nothing */ } while(0)
#endif
# 127 "../../dist/include/nsDebug.h"

/**
 * Log a warning message.
 */
#ifdef DEBUG
#define NS_WARNING(str)                                       \
  NS_DebugBreak(NS_DEBUG_WARNING, str, nullptr, __FILE__, __LINE__)
#else
# 135 "../../dist/include/nsDebug.h"
#define NS_WARNING(str)                do { /* nothing */ } while(0)
#endif
# 137 "../../dist/include/nsDebug.h"

/**
 * Trigger an debug-only abort.
 *
 * @see NS_RUNTIMEABORT for release-mode asserts.
 */
#ifdef DEBUG
#define NS_ABORT()                                            \
  NS_DebugBreak(NS_DEBUG_ABORT, nullptr, nullptr, __FILE__, __LINE__)
#else
# 147 "../../dist/include/nsDebug.h"
#define NS_ABORT()                     do { /* nothing */ } while(0)
#endif
# 149 "../../dist/include/nsDebug.h"

/**
 * Trigger a debugger breakpoint, only in debug builds.
 */
#ifdef DEBUG
#define NS_BREAK()                                            \
  NS_DebugBreak(NS_DEBUG_BREAK, nullptr, nullptr, __FILE__, __LINE__)
#else
# 157 "../../dist/include/nsDebug.h"
#define NS_BREAK()                     do { /* nothing */ } while(0)
#endif
# 159 "../../dist/include/nsDebug.h"

/******************************************************************************
** Macros for static assertions.  These are used by the sixgill tool.
** When the tool is not running these macros are no-ops.
******************************************************************************/

/* Avoid name collision if included with other headers defining annotations. */
#ifndef HAVE_STATIC_ANNOTATIONS
#define HAVE_STATIC_ANNOTATIONS

#ifdef XGILL_PLUGIN

#define STATIC_PRECONDITION(COND)          /* nothing */
#define STATIC_PRECONDITION_ASSUME(COND)   /* nothing */
#define STATIC_POSTCONDITION(COND)         /* nothing */
#define STATIC_POSTCONDITION_ASSUME(COND)  /* nothing */
#define STATIC_INVARIANT(COND)             /* nothing */
#define STATIC_INVARIANT_ASSUME(COND)      /* nothing */

#define STATIC_ASSERT(COND)          do { /* nothing */ } while(0)
#define STATIC_ASSUME(COND)          do { /* nothing */ } while(0)
#define STATIC_ASSERT_RUNTIME(COND)  do { /* nothing */ } while(0)

#endif /* XGILL_PLUGIN */
# 214 "../../dist/include/nsDebug.h"

#define STATIC_SKIP_INFERENCE STATIC_INVARIANT(skip_inference())
#define NS_POSTCONDITION(expr, str)  STATIC_ASSERT_RUNTIME(expr)

#endif /* XGILL_PLUGIN */
# 234 "../../dist/include/nsDebug.h"

/******************************************************************************
** Macros for terminating execution when an unrecoverable condition is
** reached.  These need to be compiled regardless of the DEBUG flag.
******************************************************************************/

/**
 * Terminate execution <i>immediately</i>, and if possible on the current
 * platform, in such a way that execution can't be continued by other
 * code (e.g., by intercepting a signal).
 */
#define NS_RUNTIMEABORT(msg)                                    \
  NS_DebugBreak(NS_DEBUG_ABORT, msg, nullptr, __FILE__, __LINE__)


/* Macros for checking the trueness of an expression passed in within an
 * interface implementation.  These need to be compiled regardless of the
 * DEBUG flag. New code should use NS_WARN_IF(condition) instead!
 * @status deprecated
 */

#define NS_ENSURE_TRUE(x, ret)                                \
  do {                                                        \
    if (MOZ_UNLIKELY(!(x))) {                                 \
       NS_WARNING("NS_ENSURE_TRUE(" #x ") failed");           \
       return ret;                                            \
    }                                                         \
  } while(0)

#define NS_ENSURE_FALSE(x, ret)                               \
  NS_ENSURE_TRUE(!(x), ret)

#define NS_ENSURE_TRUE_VOID(x)                                \
  do {                                                        \
    if (MOZ_UNLIKELY(!(x))) {                                 \
       NS_WARNING("NS_ENSURE_TRUE(" #x ") failed");           \
       return;                                                \
    }                                                         \
  } while(0)

#define NS_ENSURE_FALSE_VOID(x)                               \
  NS_ENSURE_TRUE_VOID(!(x))

/******************************************************************************
** Macros for checking results
******************************************************************************/

#if defined(DEBUG) && !defined(XPCOM_GLUE_AVOID_NSPR)

#define NS_ENSURE_SUCCESS_BODY(res, ret)                                  \
    char *msg = PR_smprintf("NS_ENSURE_SUCCESS(%s, %s) failed with "      \
                            "result 0x%X", #res, #ret, __rv);             \
    NS_WARNING(msg);                                                      \
    PR_smprintf_free(msg);

#define NS_ENSURE_SUCCESS_BODY_VOID(res)                                  \
    char *msg = PR_smprintf("NS_ENSURE_SUCCESS_VOID(%s) failed with "     \
                            "result 0x%X", #res, __rv);                   \
    NS_WARNING(msg);                                                      \
    PR_smprintf_free(msg);

#else
# 296 "../../dist/include/nsDebug.h"

#define NS_ENSURE_SUCCESS_BODY(res, ret)                                  \
    NS_WARNING("NS_ENSURE_SUCCESS(" #res ", " #ret ") failed");

#define NS_ENSURE_SUCCESS_BODY_VOID(res)                                  \
    NS_WARNING("NS_ENSURE_SUCCESS_VOID(" #res ") failed");

#endif
# 304 "../../dist/include/nsDebug.h"

#define NS_ENSURE_SUCCESS(res, ret)                                       \
  do {                                                                    \
    nsresult __rv = res; /* Don't evaluate |res| more than once */        \
    if (NS_FAILED(__rv)) {                                                \
      NS_ENSURE_SUCCESS_BODY(res, ret)                                    \
      return ret;                                                         \
    }                                                                     \
  } while(0)

#define NS_ENSURE_SUCCESS_VOID(res)                                       \
  do {                                                                    \
    nsresult __rv = res;                                                  \
    if (NS_FAILED(__rv)) {                                                \
      NS_ENSURE_SUCCESS_BODY_VOID(res)                                    \
      return;                                                             \
    }                                                                     \
  } while(0)

/******************************************************************************
  NS_ENSURE_TRUE(((arg) >= min) && ((arg) <= max), NS_ERROR_INVALID_ARG)

#define NS_ENSURE_STATE(state)                                \
  NS_ENSURE_TRUE(state, NS_ERROR_UNEXPECTED)

#define NS_ENSURE_NO_AGGREGATION(outer)                       \
  NS_ENSURE_FALSE(outer, NS_ERROR_NO_AGGREGATION)

/*****************************************************************************/

#ifdef XPCOM_GLUE
  #define NS_CheckThreadSafe(owningThread, msg)
#else
# 353 "../../dist/include/nsDebug.h"
  #define NS_CheckThreadSafe(owningThread, msg)                 \
    if (MOZ_UNLIKELY(owningThread != PR_GetCurrentThread())) {  \
      MOZ_CRASH(msg);                                           \
    }
#endif
# 358 "../../dist/include/nsDebug.h"

#ifdef MOZILLA_INTERNAL_API
void NS_ABORT_OOM(size_t aSize);
#else
# 362 "../../dist/include/nsDebug.h"
inline void NS_ABORT_OOM(size_t)
{
  MOZ_CRASH();
}
#endif
# 367 "../../dist/include/nsDebug.h"

typedef void (*StderrCallback)(const char* aFmt, va_list aArgs);
/* When compiling the XPCOM Glue on Windows, we pretend that it's going to
 * be linked with a static CRT (-MT) even when it's not. This means that we
 * cannot link to data exports from the CRT, only function exports. So,
 * instead of referencing "stderr" directly, use fdopen.
 */
#ifdef __cplusplus
extern "C" {
#endif
# 377 "../../dist/include/nsDebug.h"

/**
 * printf_stderr(...) is much like fprintf(stderr, ...), except that:
 *  - it calls the callback set through set_stderr_callback
 *  - on Android and Firefox OS, *instead* of printing to stderr, it
 *    prints to logcat.  (Newlines in the string lead to multiple lines
 * This is useful for general debugging code that logs information to a
 * file, but that you would like to be useful on Android and Firefox OS.
 * If you use fprintf_stderr instead of fprintf in such debugging code,
 * then callers can pass stderr to get logging that works on Android and
 * Firefox OS (and also the other side-effects of using printf_stderr).
 *
 * Code that is structured this way needs to be careful not to split a
 * line of output across multiple calls to fprintf_stderr, since doing
 * so will cause it to appear in multiple lines in logcat output.
 * (Producing multiple lines at once is fine.)
 */
void fprintf_stderr(FILE* aFile, const char* aFmt, ...) MOZ_FORMAT_PRINTF(2, 3);

// used by the profiler to log stderr in the profiler for more
// advanced performance debugging and display/layers visualization.
void set_stderr_callback(StderrCallback aCallback);

#if defined(ANDROID) && !defined(RELEASE_BUILD)
// Call this if you want a copy of stderr logging sent to a file. This is
// useful to get around logcat overflow problems on android devices, which use
// a circular logcat buffer and can intermittently drop messages if there's too
// much spew.
//
// This is intended for local debugging only, DO NOT USE IN PRODUCTION CODE.
// (This is ifndef RELEASE_BUILD to catch uses of it that accidentally get
// checked in). Using this will also prevent the profiler from getting a copy of
// the stderr messages which it uses for various visualization features.
//
// This function can be called from any thread, but if it is called multiple
// times all invocations must be on the same thread. Invocations after the
// first one are ignored, so you can safely put it inside a loop, for example.
// Once this is called there is no way to turn it off; all stderr output from
// that point forward will go to the file. Note that the output is subject to
// buffering so make sure you have enough output to flush the messages you care
// about before you terminate the process.
//
// The file passed in should be writable, so on Android devices a path like
// "/data/local/tmp/blah" is a good one to use as it is world-writable and will
// work even in B2G child processes which have reduced privileges. Note that the
// actual file created will have the PID appended to the path you pass in, so
// that on B2G the output from each process goes to a separate file.
void copy_stderr_to_file(const char* aFile);
#endif
# 442 "../../dist/include/nsDebug.h"

#ifdef __cplusplus
}
#endif
# 446 "../../dist/include/nsDebug.h"

#endif /* nsDebug_h___ */
# 448 "../../dist/include/nsDebug.h"
# 14 "../../dist/include/nsISupportsUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISupportsImpl.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsISupports.h"


#ifndef nsISupportsImpl_h__
#define nsISupportsImpl_h__

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsISupportsImpl.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsBase.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsISupportsImpl.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISupportsUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsISupportsUtils_h__
#define nsISupportsUtils_h__

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsISupportsUtils.h"
 * The following macro is clean, short, and obvious.  In the example above,
 * you would use it like this: |NS_ISUPPORTS_CAST(nsIBase*, this)|.
 */
  NS_PRECONDITION(aDestination, "null parameter");

  return aSource->QueryInterface(NS_GET_TEMPLATE_IID(DestinationType),
                                 reinterpret_cast<void**>(aDestination));
}

#endif /* __nsISupportsUtils_h */
# 145 "../../dist/include/nsISupportsUtils.h"
# 15 "../../dist/include/nsISupportsImpl.h" 2


#if !defined(XPCOM_GLUE_AVOID_NSPR)
#if 0 /* expanded by -frewrite-includes */
#include "prthread.h" /* needed for thread-safety checks */
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prthread.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef prthread_h___
#define prthread_h___

/*
** API for NSPR threads. On some architectures (Mac OS Classic
** notably) pre-emptibility is not guaranteed. Hard priority scheduling
** is not guaranteed, so programming using priority based synchronization
** is a no-no.
**
** NSPR threads are scheduled based loosely on their client set priority.
** In general, a thread of a higher priority has a statistically better
**
** Threads also have a "scope flag" which controls whether the threads
** are scheduled in the local scope or scheduled by the OS globally. This 
** indicates whether a thread is permanently bound to a native OS thread. 
** An unbound thread competes for scheduling resources in the same process.
**
** Another flag is "state flag" which control whether the thread is joinable.
** It allows other threads to wait for the created thread to reach completion.
**
** Threads can have "per-thread-data" attached to them. Each thread has a
** per-thread error number and error string which are updated when NSPR
** operations fail.
*/
#if 0 /* expanded by -frewrite-includes */
#include "prtypes.h"
#endif /* expanded by -frewrite-includes */
# 47 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prthread.h"
#if 0 /* expanded by -frewrite-includes */
#include "prinrval.h"
#endif /* expanded by -frewrite-includes */
# 48 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prthread.h"

PR_BEGIN_EXTERN_C

typedef struct PRThread PRThread;
typedef struct PRThreadStack PRThreadStack;

typedef enum PRThreadType {
    PR_USER_THREAD,
    PR_SYSTEM_THREAD
} PRThreadType;

typedef enum PRThreadScope {
    PR_LOCAL_THREAD,
    PR_GLOBAL_THREAD,
    PR_GLOBAL_BOUND_THREAD
} PRThreadScope;

typedef enum PRThreadState {
    PR_JOINABLE_THREAD,
    PR_UNJOINABLE_THREAD
} PRThreadState;

typedef enum PRThreadPriority
{
    PR_PRIORITY_FIRST = 0,      /* just a placeholder */
    PR_PRIORITY_LOW = 0,        /* the lowest possible priority */
    PR_PRIORITY_NORMAL = 1,     /* most common expected priority */
    PR_PRIORITY_HIGH = 2,       /* slightly more aggressive scheduling */
    PR_PRIORITY_URGENT = 3,     /* it does little good to have more than one */
    PR_PRIORITY_LAST = 3        /* this is just a placeholder */
} PRThreadPriority;

/*
** Create a new thread:
**     "type" is the type of thread to create
**     "start(arg)" will be invoked as the threads "main"
**     "thread" is the target thread 
**
** This can return PR_FAILURE if no joinable thread could be found 
** corresponding to the specified target thread.
**
** The calling thread is blocked until the target thread completes.
** Several threads cannot wait for the same thread to complete; one thread
** will operate successfully and others will terminate with an error PR_FAILURE.
** The calling thread will not be blocked if the target thread has already
** terminated.
*/
NSPR_API(PRStatus) PR_JoinThread(PRThread *thread);

/*
** Return the current thread object for the currently running code.
** Never returns NULL.
*/
NSPR_API(PRThread*) PR_GetCurrentThread(void);
#ifndef NO_NSPR_10_SUPPORT
#define PR_CurrentThread() PR_GetCurrentThread() /* for nspr1.0 compat. */
#endif /* NO_NSPR_10_SUPPORT */
# 136 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prthread.h"

/*
** Get the priority of "thread".
*/
NSPR_API(PRThreadPriority) PR_GetThreadPriority(const PRThread *thread);

/*
** Change the priority of the "thread" to "priority".
**
**      - new thread private data is set and the current private data is
**        not NULL.
**
** The index independently maintains specific values for each binding thread. 
** A thread can only get access to its own thread-specific-data.
**
** Upon a new index return the value associated with the index for all threads
** is NULL, and upon thread creation the value associated with all indices for 

/*
** Get the join state of this thread.
*/
NSPR_API(PRThreadState) PR_GetThreadState(const PRThread *thread);

PR_END_EXTERN_C

#endif /* prthread_h___ */
# 273 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prthread.h"
# 19 "../../dist/include/nsISupportsImpl.h" 2
#endif // !XPCOM_GLUE_AVOID_NSPR
# 20 "../../dist/include/nsISupportsImpl.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsISupportsImpl.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsXPCOM.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsISupportsImpl.h"
#ifndef XPCOM_GLUE
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Atomics.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Atomics.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Implements (almost always) lock-free atomic operations. The operations here
 * are a subset of that which can be found in C++11's <atomic> header, with a
 * different API to enforce consistent memory ordering constraints.
 *
 * Anyone caught using |volatile| for inter-thread memory safety needs to be
 * sent a copy of this header and the C++11 standard.
 */

#ifndef mozilla_Atomics_h
#define mozilla_Atomics_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/Atomics.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/Atomics.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Compiler.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/mozilla/Atomics.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/mozilla/Atomics.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/mozilla/Atomics.h"

/*
 * Our minimum deployment target on clang/OS X is OS X 10.6, whose SDK
 * does not have <atomic>.  So be sure to check for <atomic> support
 * along with C++0x support.
 */
#if defined(__clang__) || defined(__GNUC__)
   /*
    * Clang doesn't like <atomic> from libstdc++ before 4.7 due to the
    * loose typing of the atomic builtins. GCC 4.5 and 4.6 lacks inline
    * definitions for unspecialized std::atomic and causes linking errors.
    * Therefore, we require at least 4.7.0 for using libstdc++.
    *
    * libc++ <atomic> is only functional with clang.
    */
#  if MOZ_USING_LIBSTDCXX && MOZ_LIBSTDCXX_VERSION_AT_LEAST(4, 7, 0)
#    define MOZ_HAVE_CXX11_ATOMICS
#  elif MOZ_USING_LIBCXX && defined(__clang__)
# 43 "../../dist/include/mozilla/Atomics.h"
#    define MOZ_HAVE_CXX11_ATOMICS
#  endif
# 45 "../../dist/include/mozilla/Atomics.h"
#elif defined(_MSC_VER)
# 46 "../../dist/include/mozilla/Atomics.h"
#  define MOZ_HAVE_CXX11_ATOMICS
#endif
# 48 "../../dist/include/mozilla/Atomics.h"

namespace mozilla {

/**
 * An enum of memory ordering possibilities for atomics.
 *
 * Memory ordering is the observable state of distinct values in memory.
 * (It's a separate concept from atomicity, which concerns whether an
 * operation can ever be observed in an intermediate state.  Don't
 * conflate the two!)  Given a sequence of operations in source code on
 * memory, it is *not* always the case that, at all times and on all
 * cores, those operations will appear to have occurred in that exact
 * sequence.  First, the compiler might reorder that sequence, if it
 * thinks another ordering will be more efficient.  Second, the CPU may
 * not expose so consistent a view of memory.  CPUs will often perform
 * their own instruction reordering, above and beyond that performed by
 * the compiler.  And each core has its own memory caches, and accesses
 * (reads and writes both) to "memory" may only resolve to out-of-date
 * cache entries -- not to the "most recently" performed operation in
 * some global sense.  Any access to a value that may be used by
 * multiple threads, potentially across multiple cores, must therefore
 * have a memory ordering imposed on it, for all code on all
 * threads/cores to have a sufficiently coherent worldview.
 *
 * http://gcc.gnu.org/wiki/Atomic/GCCMM/AtomicSync and
 * http://en.cppreference.com/w/cpp/atomic/memory_order go into more
 * detail on all this, including examples of how each mode works.
 *
 * Note that for simplicity and practicality, not all of the modes in
 * C++11 are supported.  The missing C++11 modes are either subsumed by
 * the modes we provide below, or not relevant for the CPUs we support
 * in Gecko.  These three modes are confusing enough as it is!
 */
enum MemoryOrdering {
  /*
   * need some sort of up-to-date value, you need some sort of other
   * synchronizing operation.)  It's *not* good for locks, mutexes,
   * reference counts, etc. that mediate access to other memory, or must
   * be observably consistent with other memory.
   *
   * x86 architectures don't take advantage of the optimization
   * opportunities that relaxed ordering permits.  Thus it's possible
   * that using relaxed ordering will "work" on x86 but fail elsewhere
   * (ARM, say, which *does* implement non-sequentially-consistent
   * relaxed ordering semantics).  Be extra-careful using relaxed
   * ordering if you can't easily test non-x86 architectures!
   */
  Relaxed,

  /*
   * When an atomic value is updated with ReleaseAcquire ordering, and
   * a good, hard look at actual lock or mutex primitives first.
   */
  ReleaseAcquire,

  /*
   * When an atomic value is updated with SequentiallyConsistent
   * ordering, all writes observable when the update is observed, just
   * as with ReleaseAcquire ordering.  But, furthermore, a global total
   * ordering of SequentiallyConsistent operations *can* be described.
   * For example, if two cores perform SequentiallyConsistent operations
   * on separate objects, one core will observably perform its update
   * (and all previous operations will have completed), then the other
   * core will observably perform its update (and all previous
   * operations will have completed).  (Although those previous
   * operations aren't themselves ordered -- they could be intermixed,
   * or ordered if they occur on atomic values with ordering
   * requirements.)  SequentiallyConsistent is the *simplest and safest*
   * ordering of atomic operations -- it's always as if one operation
   * happens, then another, then another, in some order -- and every
   * core observes updates to happen in that single order.  Because it
   * has the most synchronization requirements, operations ordered this
   * way also tend to be slowest.
   *
   * SequentiallyConsistent ordering can be desirable when multiple
   * threads observe objects, and they all have to agree on the
   * observable order of changes to them.  People expect
   * SequentiallyConsistent ordering, even if they shouldn't, when
   * writing code, atomic or otherwise.  SequentiallyConsistent is also
   * the ordering of choice when designing lockless data structures.  If
   * you don't know what order to use, use this one.
   */
  SequentiallyConsistent,
};

} // namespace mozilla

// Build up the underlying intrinsics.
#ifdef MOZ_HAVE_CXX11_ATOMICS

#if 0 /* expanded by -frewrite-includes */
#  include <atomic>
#endif /* expanded by -frewrite-includes */
# 171 "../../dist/include/mozilla/Atomics.h"

namespace mozilla {
namespace detail {

/*
 * We provide CompareExchangeFailureOrder to work around a bug in some
 * versions of GCC's <atomic> header.  See bug 898491.
 */
template<MemoryOrdering Order> struct AtomicOrderConstraints;

template<>
struct AtomicOrderConstraints<Relaxed>
{
  static const std::memory_order AtomicRMWOrder = std::memory_order_relaxed;
  static const std::memory_order LoadOrder = std::memory_order_relaxed;
  static const std::memory_order StoreOrder = std::memory_order_relaxed;
  static const std::memory_order CompareExchangeFailureOrder =
    std::memory_order_relaxed;
};

template<>
struct AtomicOrderConstraints<ReleaseAcquire>
{
  static const std::memory_order AtomicRMWOrder = std::memory_order_acq_rel;
  static const std::memory_order LoadOrder = std::memory_order_acquire;
  static const std::memory_order StoreOrder = std::memory_order_release;
  static const std::memory_order CompareExchangeFailureOrder =
    std::memory_order_acquire;
};

template<>
struct AtomicOrderConstraints<SequentiallyConsistent>
{
  static const std::memory_order AtomicRMWOrder = std::memory_order_seq_cst;
  static const std::memory_order LoadOrder = std::memory_order_seq_cst;
  static const std::memory_order StoreOrder = std::memory_order_seq_cst;
  static const std::memory_order CompareExchangeFailureOrder =
    std::memory_order_seq_cst;
};

template<typename T, MemoryOrdering Order>
struct IntrinsicBase
{
  typedef std::atomic<T> ValueType;
  typedef AtomicOrderConstraints<Order> OrderedOp;
};

template<typename T, MemoryOrdering Order>
struct IntrinsicMemoryOps : public IntrinsicBase<T, Order>
{
  typedef IntrinsicBase<T, Order> Base;

  static T load(const typename Base::ValueType& aPtr)
  {
    return aPtr.load(Base::OrderedOp::LoadOrder);
  }

  static void store(typename Base::ValueType& aPtr, T aVal)
  {
    aPtr.store(aVal, Base::OrderedOp::StoreOrder);
  }

  static T exchange(typename Base::ValueType& aPtr, T aVal)
  {
    return aPtr.exchange(aVal, Base::OrderedOp::AtomicRMWOrder);
  }

  static bool compareExchange(typename Base::ValueType& aPtr,
                              T aOldVal, T aNewVal)
  {
    return aPtr.compare_exchange_strong(aOldVal, aNewVal,
                                        Base::OrderedOp::AtomicRMWOrder,
                                        Base::OrderedOp::CompareExchangeFailureOrder);
  }
};

template<typename T, MemoryOrdering Order>
struct IntrinsicAddSub : public IntrinsicBase<T, Order>
{
  typedef IntrinsicBase<T, Order> Base;

  static T add(typename Base::ValueType& aPtr, T aVal)
  {
    return aPtr.fetch_add(aVal, Base::OrderedOp::AtomicRMWOrder);
  }

  static T sub(typename Base::ValueType& aPtr, T aVal)
  {
    return aPtr.fetch_sub(aVal, Base::OrderedOp::AtomicRMWOrder);
  }
};

template<typename T, MemoryOrdering Order>
struct IntrinsicAddSub<T*, Order> : public IntrinsicBase<T*, Order>
{
  typedef IntrinsicBase<T*, Order> Base;

  static T* add(typename Base::ValueType& aPtr, ptrdiff_t aVal)
  {
    return aPtr.fetch_add(fixupAddend(aVal), Base::OrderedOp::AtomicRMWOrder);
  }

  static T* sub(typename Base::ValueType& aPtr, ptrdiff_t aVal)
  {
    return aPtr.fetch_sub(fixupAddend(aVal), Base::OrderedOp::AtomicRMWOrder);
  }
private:
  /*
   * GCC 4.6's <atomic> header has a bug where adding X to an
   * atomic<T*> is not the same as adding X to a T*.  Hence the need
   * for this function to provide the correct addend.
   */
  static ptrdiff_t fixupAddend(ptrdiff_t aVal)
  {
#if defined(__clang__) || defined(_MSC_VER)
    return aVal;
#elif defined(__GNUC__) && !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
# 288 "../../dist/include/mozilla/Atomics.h"
    return aVal * sizeof(T);
#else
# 290 "../../dist/include/mozilla/Atomics.h"
    return aVal;
#endif
# 292 "../../dist/include/mozilla/Atomics.h"
  }
};

template<typename T, MemoryOrdering Order>
struct IntrinsicIncDec : public IntrinsicAddSub<T, Order>
{
  typedef IntrinsicBase<T, Order> Base;

  static T inc(typename Base::ValueType& aPtr)
  {
    return IntrinsicAddSub<T, Order>::add(aPtr, 1);
  }

  static T dec(typename Base::ValueType& aPtr)
  {
    return IntrinsicAddSub<T, Order>::sub(aPtr, 1);
  }
};

template<typename T, MemoryOrdering Order>
struct AtomicIntrinsics : public IntrinsicMemoryOps<T, Order>,
                          public IntrinsicIncDec<T, Order>
{
  typedef IntrinsicBase<T, Order> Base;

  static T or_(typename Base::ValueType& aPtr, T aVal)
  {
    return aPtr.fetch_or(aVal, Base::OrderedOp::AtomicRMWOrder);
  }

  static T xor_(typename Base::ValueType& aPtr, T aVal)
  {
    return aPtr.fetch_xor(aVal, Base::OrderedOp::AtomicRMWOrder);
  }

  static T and_(typename Base::ValueType& aPtr, T aVal)
  {
    return aPtr.fetch_and(aVal, Base::OrderedOp::AtomicRMWOrder);
  }
};

template<typename T, MemoryOrdering Order>
struct AtomicIntrinsics<T*, Order>
  : public IntrinsicMemoryOps<T*, Order>, public IntrinsicIncDec<T*, Order>
{
};

} // namespace detail
} // namespace mozilla

#elif defined(__GNUC__)
# 343 "../../dist/include/mozilla/Atomics.h"

namespace mozilla {
namespace detail {

/*
 * we add a barrier above it as appropriate.
 */

template<MemoryOrdering Order> struct Barrier;

/*
 * Some processors (in particular, x86) don't require quite so many calls to
 * __sync_sychronize as our specializations of Barrier produce.  If
 * performance turns out to be an issue, defining these specializations
 * on a per-processor basis would be a good first tuning step.
 */

template<>
struct Barrier<Relaxed>
{
  static void beforeLoad() {}
  static void afterLoad() {}
  static void beforeStore() {}
  static void afterStore() {}
};

template<>
struct Barrier<ReleaseAcquire>
#else
# 896 "../../dist/include/mozilla/Atomics.h"
# error "Atomic compiler intrinsics are not supported on your platform"
#endif
# 898 "../../dist/include/mozilla/Atomics.h"

namespace mozilla {

namespace detail {

template<typename T, MemoryOrdering Order>
class AtomicBase
{
  // We only support 32-bit types on 32-bit Windows, which constrains our
  // implementation elsewhere.  But we support pointer-sized types everywhere.
  static_assert(sizeof(T) == 4 || (sizeof(uintptr_t) == 8 && sizeof(T) == 8),
                "mozilla/Atomics.h only supports 32-bit and pointer-sized types");

protected:
  typedef typename detail::AtomicIntrinsics<T, Order> Intrinsics;
  typename Intrinsics::ValueType mValue;

public:
  MOZ_CONSTEXPR AtomicBase() : mValue() {}
  explicit MOZ_CONSTEXPR AtomicBase(T aInit) : mValue(aInit) {}

  // Note: we can't provide operator T() here because Atomic<bool> inherits
  // from AtomcBase with T=uint32_t and not T=bool. If we implemented
  // operator T() here, it would cause errors when comparing Atomic<bool> with
  // a regular bool.

  T operator=(T aVal)
  {
    Intrinsics::store(mValue, aVal);
    return aVal;
  }

  /**
   * Performs an atomic swap operation.  aVal is stored and the previous
   * value of this variable is returned.
   */
  bool compareExchange(T aOldValue, T aNewValue)
  {
    return Intrinsics::compareExchange(mValue, aOldValue, aNewValue);
  }

private:
  template<MemoryOrdering AnyOrder>
  AtomicBase(const AtomicBase<T, AnyOrder>& aCopy) = delete;
};

template<typename T, MemoryOrdering Order>
class AtomicBaseIncDec : public AtomicBase<T, Order>
{
  typedef typename detail::AtomicBase<T, Order> Base;

public:
  MOZ_CONSTEXPR AtomicBaseIncDec() : Base() {}
  explicit MOZ_CONSTEXPR AtomicBaseIncDec(T aInit) : Base(aInit) {}

  using Base::operator=;

  operator T() const { return Base::Intrinsics::load(Base::mValue); }
  T operator++(int) { return Base::Intrinsics::inc(Base::mValue); }
  T operator--(int) { return Base::Intrinsics::dec(Base::mValue); }
  T operator++() { return Base::Intrinsics::inc(Base::mValue) + 1; }
  T operator--() { return Base::Intrinsics::dec(Base::mValue) - 1; }

private:
  template<MemoryOrdering AnyOrder>
  AtomicBaseIncDec(const AtomicBaseIncDec<T, AnyOrder>& aCopy) = delete;
};

} // namespace detail

/**
 * A wrapper for a type that enforces that all memory accesses are atomic.
 *
 * In general, where a variable |T foo| exists, |Atomic<T> foo| can be used in
 * its place.  Implementations for integral and pointer types are provided
 * below.
 *
 * Atomic accesses are sequentially consistent by default.  You should
 * use the default unless you are tall enough to ride the
 * memory-ordering roller coaster (if you're not sure, you aren't) and
 * you have a compelling reason to do otherwise.
 *
 * There is one exception to the case of atomic memory accesses: providing an
 * initial value of the atomic value is not guaranteed to be atomic.  This is a
 * deliberate design choice that enables static atomic variables to be declared
 * without introducing extra static constructors.
 */
template<typename T,
         MemoryOrdering Order = SequentiallyConsistent,
         typename Enable = void>
class Atomic;

/**
 * Atomic<T> implementation for integral types.
 *
 * In addition to atomic store and load operations, compound assignment and
 * increment/decrement operators are implemented which perform the
 * corresponding read-modify-write operation atomically.  Finally, an atomic
 * swap method is provided.
 */
template<typename T, MemoryOrdering Order>
class Atomic<T, Order, typename EnableIf<IsIntegral<T>::value &&
                       !IsSame<T, bool>::value>::Type>
  : public detail::AtomicBaseIncDec<T, Order>
{
  typedef typename detail::AtomicBaseIncDec<T, Order> Base;

public:
  MOZ_CONSTEXPR Atomic() : Base() {}
  explicit MOZ_CONSTEXPR Atomic(T aInit) : Base(aInit) {}

  using Base::operator=;

  T operator+=(T aDelta)
  {
    return Base::Intrinsics::add(Base::mValue, aDelta) + aDelta;
  }

  T operator-=(T aDelta)
  {
    return Base::Intrinsics::sub(Base::mValue, aDelta) - aDelta;
  }

  T operator|=(T aVal)
  {
    return Base::Intrinsics::or_(Base::mValue, aVal) | aVal;
  }

  T operator^=(T aVal)
  {
    return Base::Intrinsics::xor_(Base::mValue, aVal) ^ aVal;
  }

  T operator&=(T aVal)
  {
    return Base::Intrinsics::and_(Base::mValue, aVal) & aVal;
  }

private:
  Atomic(Atomic<T, Order>& aOther) = delete;
};

/**
 * Atomic<T> implementation for pointer types.
 *
 * An atomic compare-and-swap primitive for pointer variables is provided, as
 * are atomic increment and decement operators.  Also provided are the compound
 * assignment operators for addition and subtraction. Atomic swap (via
 * exchange()) is included as well.
 */
template<typename T, MemoryOrdering Order>
class Atomic<T*, Order> : public detail::AtomicBaseIncDec<T*, Order>
{
  typedef typename detail::AtomicBaseIncDec<T*, Order> Base;

public:
  MOZ_CONSTEXPR Atomic() : Base() {}
  explicit MOZ_CONSTEXPR Atomic(T* aInit) : Base(aInit) {}

  using Base::operator=;

  T* operator+=(ptrdiff_t aDelta)
  {
    return Base::Intrinsics::add(Base::mValue, aDelta) + aDelta;
  }
};

/**
 * Atomic<T> implementation for boolean types.
 *
 * The atomic store and load operations and the atomic swap method is provided.
 *
 * Note:
 *
 * - sizeof(Atomic<bool>) != sizeof(bool) for some implementations of
 *   bool and/or some implementations of std::atomic. This is allowed in
 *   [atomic.types.generic]p9.
 *
 * - It's not obvious whether the 8-bit atomic functions on Windows are always
 *   inlined or not. If they are not inlined, the corresponding functions in the
 *   runtime library are not available on Windows XP. This is why we implement
 *   Atomic<bool> with an underlying type of uint32_t.
 */
template<MemoryOrdering Order>
class Atomic<bool, Order>
  : protected detail::AtomicBase<uint32_t, Order>
{
  typedef typename detail::AtomicBase<uint32_t, Order> Base;

public:
  MOZ_CONSTEXPR Atomic() : Base() {}
  explicit MOZ_CONSTEXPR Atomic(bool aInit) : Base(aInit) {}

  // We provide boolean wrappers for the underlying AtomicBase methods.
  operator bool() const
  {
  }

private:
  Atomic(Atomic<bool, Order>& aOther) = delete;
};

} // namespace mozilla

#endif /* mozilla_Atomics_h */
# 1166 "../../dist/include/mozilla/Atomics.h"
# 25 "../../dist/include/nsISupportsImpl.h" 2
#endif
# 26 "../../dist/include/nsISupportsImpl.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */

#ifndef mozilla_MacroForEach_h
#define mozilla_MacroForEach_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MacroArgs.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/MacroForEach.h"

/*
 * MOZ_FOR_EACH(aMacro, aFixedArgs, aArgs) expands to N calls to the macro
 * |aMacro| where N is equal the number of items in the list |aArgs|. The
 * arguments for each |aMacro| call are composed of *all* arguments in the list
 * |aFixedArgs| as well as a single argument in the list |aArgs|. For example:
 *
 *   #define MACRO_A(x) x +
 * results in a compile-time error.
 */
#define MOZ_FOR_EACH_EXPAND_HELPER(...) __VA_ARGS__
#define MOZ_FOR_EACH_GLUE(a, b) a b
#define MOZ_FOR_EACH(aMacro, aFixedArgs, aArgs) \
  MOZ_FOR_EACH_GLUE( \
    MOZ_PASTE_PREFIX_AND_ARG_COUNT(MOZ_FOR_EACH_, \
                                   MOZ_FOR_EACH_EXPAND_HELPER aArgs), \
    (aMacro, aFixedArgs, aArgs))

#define MOZ_FOR_EACH_HELPER_GLUE(a, b) a b
#define MOZ_FOR_EACH_HELPER(aMacro, aFixedArgs, aArgs) \
  MOZ_FOR_EACH_HELPER_GLUE( \
    aMacro, \
    (MOZ_FOR_EACH_EXPAND_HELPER aFixedArgs MOZ_ARG_1 aArgs))

#define MOZ_FOR_EACH_1(m, fa, a) \
  MOZ_FOR_EACH_HELPER(m, fa, a)
#define MOZ_FOR_EACH_2(m, fa, a) \
  MOZ_FOR_EACH_HELPER(m, fa, a) MOZ_FOR_EACH_1(m, fa, (MOZ_ARGS_AFTER_1 a))
#define MOZ_FOR_EACH_3(m, fa, a) \
  MOZ_FOR_EACH_HELPER(m, fa, a) MOZ_FOR_EACH_2(m, fa, (MOZ_ARGS_AFTER_1 a))
#define MOZ_FOR_EACH_4(m, fa, a) \
  MOZ_FOR_EACH_HELPER(m, fa, a) MOZ_FOR_EACH_3(m, fa, (MOZ_ARGS_AFTER_1 a))
#define MOZ_FOR_EACH_5(m, fa, a) \
  MOZ_FOR_EACH_HELPER(m, fa, a) MOZ_FOR_EACH_4(m, fa, (MOZ_ARGS_AFTER_1 a))
#define MOZ_FOR_EACH_6(m, fa, a) \
  MOZ_FOR_EACH_HELPER(m, fa, a) MOZ_FOR_EACH_5(m, fa, (MOZ_ARGS_AFTER_1 a))
#define MOZ_FOR_EACH_7(m, fa, a) \
  MOZ_FOR_EACH_HELPER(m, fa, a) MOZ_FOR_EACH_6(m, fa, (MOZ_ARGS_AFTER_1 a))
#define MOZ_FOR_EACH_8(m, fa, a) \
  MOZ_FOR_EACH_HELPER(m, fa, a) MOZ_FOR_EACH_7(m, fa, (MOZ_ARGS_AFTER_1 a))
#define MOZ_FOR_EACH_49(m, fa, a) \
  MOZ_FOR_EACH_HELPER(m, fa, a) MOZ_FOR_EACH_48(m, fa, (MOZ_ARGS_AFTER_1 a))
#define MOZ_FOR_EACH_50(m, fa, a) \
  MOZ_FOR_EACH_HELPER(m, fa, a) MOZ_FOR_EACH_49(m, fa, (MOZ_ARGS_AFTER_1 a))

#endif /* mozilla_MacroForEach_h */
# 159 "../../dist/include/mozilla/MacroForEach.h"
# 32 "../../dist/include/nsISupportsImpl.h" 2

namespace mozilla {
template <typename T>
struct HasDangerousPublicDestructor
{
  static const bool value = false;
};
}

#if defined(__clang__)
   // bug 1028428 shows that at least in FreeBSD 10.0 with Clang 3.4 and libc++ 3.4,
   // std::is_destructible is buggy in that it returns false when it should return true
   // on ipc::SharedMemory. On the other hand, all Clang versions currently in use
   // seem to handle the fallback just fine.
#  define MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK
#elif defined(__GNUC__)
# 48 "../../dist/include/nsISupportsImpl.h"
   // GCC 4.7 is has buggy std::is_destructible
#  if MOZ_USING_LIBSTDCXX && MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
#    define MOZ_HAVE_STD_IS_DESTRUCTIBLE
   // Some GCC versions have an ICE when using destructors in decltype().
   // Works for me on GCC 4.8.2 on Fedora 20 x86-64.
#  elif MOZ_GCC_VERSION_AT_LEAST(4, 8, 2)
# 54 "../../dist/include/nsISupportsImpl.h"
#    define MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK
#  endif
# 56 "../../dist/include/nsISupportsImpl.h"
#endif
# 57 "../../dist/include/nsISupportsImpl.h"

#ifdef MOZ_HAVE_STD_IS_DESTRUCTIBLE
#if 0 /* expanded by -frewrite-includes */
#  include <type_traits>
#endif /* expanded by -frewrite-includes */
# 60 "../../dist/include/nsISupportsImpl.h"
#  define MOZ_IS_DESTRUCTIBLE(X) (std::is_destructible<X>::value)
#elif defined MOZ_CAN_USE_IS_DESTRUCTIBLE_FALLBACK
# 62 "../../dist/include/nsISupportsImpl.h"
  namespace mozilla {
    struct IsDestructibleFallbackImpl
    {
      template<typename T> static T&& Declval();

      template<typename T, typename = decltype(Declval<T>().~T())>
      static TrueType Test(int);

      template<typename>
      static FalseType Test(...);

      template<typename T>
      struct Selector
      {
        typedef decltype(Test<T>(0)) type;
      };
    };

    template<typename T>
    struct IsDestructibleFallback
      : IsDestructibleFallbackImpl::Selector<T>::type
    {
    };
  }
#  define MOZ_IS_DESTRUCTIBLE(X) (mozilla::IsDestructibleFallback<X>::value)
#endif
# 88 "../../dist/include/nsISupportsImpl.h"

#ifdef MOZ_IS_DESTRUCTIBLE
#define MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(X) \
  static_assert(!MOZ_IS_DESTRUCTIBLE(X) || \
                mozilla::HasDangerousPublicDestructor<X>::value, \
                "Reference-counted class " #X " should not have a public destructor. " \
                "Try to make this class's destructor non-public. If that is really " \
                "not possible, you can whitelist this class by providing a " \
                "HasDangerousPublicDestructor specialization for it."); \
  static_assert(!mozilla::HasDangerousPublicDestructor<X>::value || \
                MOZ_IS_DESTRUCTIBLE(X), \
                "Class " #X " has no public destructor. That's good! So please " \
                "remove the HasDangerousPublicDestructor specialization for it.");
#else
# 102 "../../dist/include/nsISupportsImpl.h"
#define MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(X)
#endif
# 104 "../../dist/include/nsISupportsImpl.h"

inline nsISupports*
ToSupports(nsISupports* aSupports)
{
  return aSupports;
}

inline nsISupports*
ToCanonicalSupports(nsISupports* aSupports)
{
  return nullptr;
}

////////////////////////////////////////////////////////////////////////////////
// Macros to help detect thread-safety:

#if (defined(DEBUG) || (defined(NIGHTLY_BUILD) && !defined(MOZ_PROFILING))) && !defined(XPCOM_GLUE_AVOID_NSPR)

class nsAutoOwningThread
{
public:
  nsAutoOwningThread() { mThread = PR_GetCurrentThread(); }
  void* GetThread() const { return mThread; }

private:
  void* mThread;
};

#define NS_DECL_OWNINGTHREAD            nsAutoOwningThread _mOwningThread;
#define NS_ASSERT_OWNINGTHREAD_AGGREGATE(agg, _class) \
  NS_CheckThreadSafe(agg->_mOwningThread.GetThread(), #_class " not thread-safe")
#define NS_ASSERT_OWNINGTHREAD(_class) NS_ASSERT_OWNINGTHREAD_AGGREGATE(this, _class)
#else // !DEBUG && !(NIGHTLY_BUILD && !MOZ_PROFILING)
# 137 "../../dist/include/nsISupportsImpl.h"

#define NS_DECL_OWNINGTHREAD            /* nothing */
#define NS_ASSERT_OWNINGTHREAD_AGGREGATE(agg, _class) ((void)0)
#define NS_ASSERT_OWNINGTHREAD(_class)  ((void)0)

#endif // DEBUG || (NIGHTLY_BUILD && !MOZ_PROFILING)
# 143 "../../dist/include/nsISupportsImpl.h"


// Macros for reference-count and constructor logging

#ifdef NS_BUILD_REFCNT_LOGGING

#define NS_LOG_ADDREF(_p, _rc, _type, _size) \
  NS_LogAddRef((_p), (_rc), (_type), (uint32_t) (_size))

#define NS_LOG_RELEASE(_p, _rc, _type) \
  NS_LogRelease((_p), (_rc), (_type))

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 156 "../../dist/include/nsISupportsImpl.h"
#define MOZ_ASSERT_CLASSNAME(_type)                         \
  static_assert(mozilla::IsClass<_type>::value,             \
                "Token '" #_type "' is not a class type.")
// Older versions of gcc can't instantiate local classes in templates.
// GCC 4.7 doesn't have this problem.
#if MOZ_IS_GCC
# if !MOZ_GCC_VERSION_AT_LEAST(4, 7, 0)
#  undef MOZ_ASSERT_CLASSNAME
#  define MOZ_ASSERT_CLASSNAME(_type)
# endif
# 166 "../../dist/include/nsISupportsImpl.h"
#endif
# 167 "../../dist/include/nsISupportsImpl.h"

// Note that the following constructor/destructor logging macros are redundant
// for refcounted objects that log via the NS_LOG_ADDREF/NS_LOG_RELEASE macros.
// Refcount logging is preferred.
#define MOZ_COUNT_CTOR(_type)                                 \
do {                                                          \
  MOZ_ASSERT_CLASSNAME(_type);                                \
  NS_LogCtor((void*)this, #_type, sizeof(*this));             \
} while (0)

#define MOZ_COUNT_CTOR_INHERITED(_type, _base)                    \
do {                                                              \
  MOZ_ASSERT_CLASSNAME(_type);                                    \
  MOZ_ASSERT_CLASSNAME(_base);                                    \
  NS_LogCtor((void*)this, #_type, sizeof(*this) - sizeof(_base)); \
} while (0)

#define MOZ_COUNT_DTOR(_type)                                 \
do {                                                          \
  MOZ_ASSERT_CLASSNAME(_type);                                \
  NS_LogDtor((void*)this, #_type, sizeof(*this));             \
} while (0)

#define MOZ_COUNT_DTOR_INHERITED(_type, _base)                    \
do {                                                              \
  MOZ_ASSERT_CLASSNAME(_type);                                    \
  MOZ_ASSERT_CLASSNAME(_base);                                    \
  NS_LogDtor((void*)this, #_type, sizeof(*this) - sizeof(_base)); \
} while (0)

/* nsCOMPtr.h allows these macros to be defined by clients
 * These logging functions require dynamic_cast<void*>, so they don't
 * do anything useful if we don't have dynamic_cast<void*>. */
#define NSCAP_LOG_ASSIGNMENT(_c, _p)                                \
  if (_p)                                                           \
    NS_LogCOMPtrAddRef((_c),static_cast<nsISupports*>(_p))

#define NSCAP_LOG_RELEASE(_c, _p)                                   \
  if (_p)                                                           \
    NS_LogCOMPtrRelease((_c), static_cast<nsISupports*>(_p))

#else /* !NS_BUILD_REFCNT_LOGGING */
# 209 "../../dist/include/nsISupportsImpl.h"

#define NS_LOG_ADDREF(_p, _rc, _type, _size)
#define NS_LOG_RELEASE(_p, _rc, _type)
#define MOZ_COUNT_CTOR(_type)
#define MOZ_COUNT_CTOR_INHERITED(_type, _base)
#define MOZ_COUNT_DTOR(_type)
#define MOZ_COUNT_DTOR_INHERITED(_type, _base)

#endif /* NS_BUILD_REFCNT_LOGGING */
# 218 "../../dist/include/nsISupportsImpl.h"


// Support for ISupports classes which interact with cycle collector.

#define NS_NUMBER_OF_FLAGS_IN_REFCNT 2
#define NS_IN_PURPLE_BUFFER (1 << 0)
#define NS_IS_PURPLE (1 << 1)
#define NS_REFCOUNT_CHANGE (1 << NS_NUMBER_OF_FLAGS_IN_REFCNT)
#define NS_REFCOUNT_VALUE(_val) (_val >> NS_NUMBER_OF_FLAGS_IN_REFCNT)

class nsCycleCollectingAutoRefCnt
{
public:
  nsCycleCollectingAutoRefCnt() : mRefCntAndFlags(0) {}

  explicit nsCycleCollectingAutoRefCnt(uintptr_t aValue)
    : mRefCntAndFlags(aValue << NS_NUMBER_OF_FLAGS_IN_REFCNT)
  {
  }

  MOZ_ALWAYS_INLINE uintptr_t incr(nsISupports* aOwner)
  {
    return incr(aOwner, nullptr);
  }

  MOZ_ALWAYS_INLINE uintptr_t incr(void* aOwner,
                                   nsCycleCollectionParticipant* aCp)
  {
    mRefCntAndFlags += NS_REFCOUNT_CHANGE;
    mRefCntAndFlags &= ~NS_IS_PURPLE;
    // For incremental cycle collection, use the purple buffer to track objects
    // that have been AddRef'd.
    if (!IsInPurpleBuffer()) {
      mRefCntAndFlags |= NS_IN_PURPLE_BUFFER;
      // Refcount isn't zero, so Suspect won't delete anything.
      MOZ_ASSERT(get() > 0);
      NS_CycleCollectorSuspect3(aOwner, aCp, this, nullptr);
    }
    return NS_REFCOUNT_VALUE(mRefCntAndFlags);
  }

  MOZ_ALWAYS_INLINE void stabilizeForDeletion()
  {
    // Set refcnt to 1 and mark us to be in the purple buffer.
    // This way decr won't call suspect again.
    mRefCntAndFlags = NS_REFCOUNT_CHANGE | NS_IN_PURPLE_BUFFER;
  }

  MOZ_ALWAYS_INLINE uintptr_t decr(nsISupports* aOwner,
                                   bool* aShouldDelete = nullptr)
  {
    return decr(aOwner, nullptr, aShouldDelete);
  }

  MOZ_ALWAYS_INLINE uintptr_t decr(void* aOwner,
                                   nsCycleCollectionParticipant* aCp,
                                   bool* aShouldDelete = nullptr)
  {
    MOZ_ASSERT(get() > 0);
    if (!IsInPurpleBuffer()) {
      mRefCntAndFlags -= NS_REFCOUNT_CHANGE;
      mRefCntAndFlags |= (NS_IN_PURPLE_BUFFER | NS_IS_PURPLE);
      uintptr_t retval = NS_REFCOUNT_VALUE(mRefCntAndFlags);
      // Suspect may delete 'aOwner' and 'this'!
      NS_CycleCollectorSuspect3(aOwner, aCp, this, aShouldDelete);
      return retval;
    }
    mRefCntAndFlags -= NS_REFCOUNT_CHANGE;
    mRefCntAndFlags |= (NS_IN_PURPLE_BUFFER | NS_IS_PURPLE);
    return NS_REFCOUNT_VALUE(mRefCntAndFlags);
  }

  MOZ_ALWAYS_INLINE void RemovePurple()
  {
    MOZ_ASSERT(IsPurple(), "must be purple");
    mRefCntAndFlags &= ~NS_IS_PURPLE;
  }

  MOZ_ALWAYS_INLINE void RemoveFromPurpleBuffer()
  {
    MOZ_ASSERT(IsInPurpleBuffer());
    mRefCntAndFlags &= ~(NS_IS_PURPLE | NS_IN_PURPLE_BUFFER);
  }

  MOZ_ALWAYS_INLINE bool IsPurple() const
  {
    return !!(mRefCntAndFlags & NS_IS_PURPLE);
  }

  MOZ_ALWAYS_INLINE bool IsInPurpleBuffer() const
  {
    return !!(mRefCntAndFlags & NS_IN_PURPLE_BUFFER);
  }

  MOZ_ALWAYS_INLINE nsrefcnt get() const
  {
    return NS_REFCOUNT_VALUE(mRefCntAndFlags);
  }

  MOZ_ALWAYS_INLINE operator nsrefcnt() const
  {
    return get();
  }

private:
  uintptr_t mRefCntAndFlags;
};

class nsAutoRefCnt
{
public:
  nsAutoRefCnt() : mValue(0) {}
  explicit nsAutoRefCnt(nsrefcnt aValue) : mValue(aValue) {}

  // only support prefix increment/decrement
  nsrefcnt operator++() { return ++mValue; }
  nsrefcnt operator--() { return --mValue; }

  nsrefcnt operator=(nsrefcnt aValue) { return (mValue = aValue); }
  operator nsrefcnt() const { return mValue; }
  nsrefcnt get() const { return mValue; }

  static const bool isThreadSafe = false;
private:
  nsrefcnt operator++(int) = delete;
  nsrefcnt operator--(int) = delete;
  nsrefcnt mValue;
};

#ifndef XPCOM_GLUE
namespace mozilla {
class ThreadSafeAutoRefCnt
{
public:
  ThreadSafeAutoRefCnt() : mValue(0) {}
  explicit ThreadSafeAutoRefCnt(nsrefcnt aValue) : mValue(aValue) {}

  // only support prefix increment/decrement
  MOZ_ALWAYS_INLINE nsrefcnt operator++() { return ++mValue; }
  MOZ_ALWAYS_INLINE nsrefcnt operator--() { return --mValue; }

  MOZ_ALWAYS_INLINE nsrefcnt operator=(nsrefcnt aValue)
  {
    return (mValue = aValue);
  }
  MOZ_ALWAYS_INLINE operator nsrefcnt() const { return mValue; }
  MOZ_ALWAYS_INLINE nsrefcnt get() const { return mValue; }

  static const bool isThreadSafe = true;
private:
  nsrefcnt operator++(int) = delete;
  nsrefcnt operator--(int) = delete;
  // In theory, RelaseAcquire consistency (but no weaker) is sufficient for
  // the counter. Making it weaker could speed up builds on ARM (but not x86),
  // but could break pre-existing code that assumes sequential consistency.
  Atomic<nsrefcnt> mValue;
};
}
#endif
# 377 "../../dist/include/nsISupportsImpl.h"

///////////////////////////////////////////////////////////////////////////////

/**
 * Declare the reference count variable and the implementations of the
 * AddRef and QueryInterface methods.
 */

#define NS_DECL_ISUPPORTS                                                     \
public:                                                                       \
  NS_IMETHOD QueryInterface(REFNSIID aIID,                                    \
                            void** aInstancePtr) MOZ_OVERRIDE;                \
  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) MOZ_OVERRIDE;             \
  NS_IMETHOD_(MozExternalRefCountType) Release(void) MOZ_OVERRIDE;            \
protected:                                                                    \
  nsAutoRefCnt mRefCnt;                                                       \
  NS_DECL_OWNINGTHREAD                                                        \
public:

#define NS_DECL_THREADSAFE_ISUPPORTS                                          \
public:                                                                       \
  NS_IMETHOD QueryInterface(REFNSIID aIID,                                    \
                            void** aInstancePtr) MOZ_OVERRIDE;                \
  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) MOZ_OVERRIDE;             \
  NS_IMETHOD_(MozExternalRefCountType) Release(void) MOZ_OVERRIDE;            \
protected:                                                                    \
  ::mozilla::ThreadSafeAutoRefCnt mRefCnt;                                    \
  NS_DECL_OWNINGTHREAD                                                        \
public:

#define NS_DECL_CYCLE_COLLECTING_ISUPPORTS                                    \
public:                                                                       \
  NS_IMETHOD QueryInterface(REFNSIID aIID,                                    \
                            void** aInstancePtr) MOZ_OVERRIDE;                \
  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) MOZ_OVERRIDE;             \
  NS_IMETHOD_(MozExternalRefCountType) Release(void) MOZ_OVERRIDE;            \
  NS_IMETHOD_(void) DeleteCycleCollectable(void);                             \
protected:                                                                    \
  nsCycleCollectingAutoRefCnt mRefCnt;                                        \
  NS_DECL_OWNINGTHREAD                                                        \
public:


///////////////////////////////////////////////////////////////////////////////

/*
 * Implementation of AddRef and Release for non-nsISupports (ie "native")
 * cycle-collected classes that use the purple buffer to avoid leaks.
 */

#define NS_IMPL_CC_NATIVE_ADDREF_BODY(_class)                                 \
    MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                                \
    MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");                      \
    NS_ASSERT_OWNINGTHREAD(_class);                                           \
    nsrefcnt count =                                                          \
      mRefCnt.incr(static_cast<void*>(this),                                  \
                   _class::NS_CYCLE_COLLECTION_INNERCLASS::GetParticipant()); \
    NS_LOG_ADDREF(this, count, #_class, sizeof(*this));                       \
    return count;

#define NS_IMPL_CC_NATIVE_RELEASE_BODY(_class)                                \
    MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");                          \
    NS_ASSERT_OWNINGTHREAD(_class);                                           \
    nsrefcnt count =                                                          \
      mRefCnt.decr(static_cast<void*>(this),                                  \
                   _class::NS_CYCLE_COLLECTION_INNERCLASS::GetParticipant()); \
    NS_LOG_RELEASE(this, count, #_class);                                     \
    return count;

#define NS_IMPL_CYCLE_COLLECTING_NATIVE_RELEASE(_class)                       \
NS_METHOD_(MozExternalRefCountType) _class::Release(void)                     \
{                                                                             \
  NS_IMPL_CC_NATIVE_RELEASE_BODY(_class)                                      \
}

#define NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(_class)            \
public:                                                                       \
  NS_METHOD_(MozExternalRefCountType) AddRef(void) {                          \
    NS_IMPL_CC_NATIVE_ADDREF_BODY(_class)                                     \
  }                                                                           \
  NS_METHOD_(MozExternalRefCountType) Release(void) {                         \
    NS_IMPL_CC_NATIVE_RELEASE_BODY(_class)                                    \
  }                                                                           \
protected:                                                                    \
  nsCycleCollectingAutoRefCnt mRefCnt;                                        \
  NS_DECL_OWNINGTHREAD                                                        \
public:


///////////////////////////////////////////////////////////////////////////////

/**
 * Use this macro to declare and implement the AddRef & Release methods for a
 * given non-XPCOM <i>_class</i>.
 *
 * @param _class The name of the class implementing the method
 * @param optional MOZ_OVERRIDE Mark the AddRef & Release methods as overrides.
 */
#define NS_INLINE_DECL_REFCOUNTING(_class, ...)                               \
public:                                                                       \
  NS_METHOD_(MozExternalRefCountType) AddRef(void) __VA_ARGS__ {              \
    MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                                \
    MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");                      \
    NS_ASSERT_OWNINGTHREAD(_class);                                           \
    ++mRefCnt;                                                                \
    NS_LOG_ADDREF(this, mRefCnt, #_class, sizeof(*this));                     \
    return mRefCnt;                                                           \
  }                                                                           \
  NS_METHOD_(MozExternalRefCountType) Release(void) __VA_ARGS__ {             \
    MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");                          \
    NS_ASSERT_OWNINGTHREAD(_class);                                           \
    --mRefCnt;                                                                \
    NS_LOG_RELEASE(this, mRefCnt, #_class);                                   \
    if (mRefCnt == 0) {                                                       \
      NS_ASSERT_OWNINGTHREAD(_class);                                         \
      mRefCnt = 1; /* stabilize */                                            \
      delete this;                                                            \
      return 0;                                                               \
    }                                                                         \
    return mRefCnt;                                                           \
  }                                                                           \
protected:                                                                    \
  nsAutoRefCnt mRefCnt;                                                       \
  NS_DECL_OWNINGTHREAD                                                        \
public:

/**
 * Use this macro to declare and implement the AddRef & Release methods for a
 * given non-XPCOM <i>_class</i> in a threadsafe manner.
 *
 * DOES NOT DO REFCOUNT STABILIZATION!
 *
 * @param _class The name of the class implementing the method
 */
#define NS_INLINE_DECL_THREADSAFE_REFCOUNTING(_class, ...)                    \
public:                                                                       \
  NS_METHOD_(MozExternalRefCountType) AddRef(void) __VA_ARGS__ {              \
    MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                                \
    MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");                      \
    nsrefcnt count = ++mRefCnt;                                               \
    NS_LOG_ADDREF(this, count, #_class, sizeof(*this));                       \
    return (nsrefcnt) count;                                                  \
  }                                                                           \
  NS_METHOD_(MozExternalRefCountType) Release(void) __VA_ARGS__ {             \
    MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");                          \
    nsrefcnt count = --mRefCnt;                                               \
    NS_LOG_RELEASE(this, count, #_class);                                     \
    if (count == 0) {                                                         \
      delete (this);                                                          \
      return 0;                                                               \
    }                                                                         \
    return count;                                                             \
  }                                                                           \
protected:                                                                    \
  ::mozilla::ThreadSafeAutoRefCnt mRefCnt;                                    \
public:

/**
 * Use this macro to implement the AddRef method for a given <i>_class</i>
 * @param _class The name of the class implementing the method
 */
#define NS_IMPL_ADDREF(_class)                                                \
NS_IMETHODIMP_(MozExternalRefCountType) _class::AddRef(void)                  \
{                                                                             \
  MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                                  \
  MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");                        \
  if (!mRefCnt.isThreadSafe)                                                  \
    NS_ASSERT_OWNINGTHREAD(_class);                                           \
  nsrefcnt count = ++mRefCnt;                                                 \
  NS_LOG_ADDREF(this, count, #_class, sizeof(*this));                         \
}

/**
 * Use this macro to implement the Release method for a given
 * <i>_class</i>.
 * @param _class The name of the class implementing the method
 * @param _destroy A statement that is executed when the object's
 *   refcount drops to zero.
 *
 * For example,
 *
 *   NS_IMPL_RELEASE_WITH_DESTROY(Foo, Destroy(this))
 *
 * will cause
 *
 *   Destroy(this);
 *
 * to be invoked when the object's refcount drops to zero. This
 * allows for arbitrary teardown activity to occur (e.g., deallocation
 * of object allocated with placement new).
 */
#define NS_IMPL_RELEASE_WITH_DESTROY(_class, _destroy)                        \
NS_IMETHODIMP_(MozExternalRefCountType) _class::Release(void)                 \
{                                                                             \
  MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");                            \
  if (!mRefCnt.isThreadSafe)                                                  \
    NS_ASSERT_OWNINGTHREAD(_class);                                           \
  nsrefcnt count = --mRefCnt;                                                 \
  NS_LOG_RELEASE(this, count, #_class);                                       \
  if (count == 0) {                                                           \
    if (!mRefCnt.isThreadSafe)                                                \
      NS_ASSERT_OWNINGTHREAD(_class);                                         \
    mRefCnt = 1; /* stabilize */                                              \
    _destroy;                                                                 \
    return 0;                                                                 \
  }                                                                           \
  return count;                                                               \
}

/**
 * Use this macro to implement the Release method for a given <i>_class</i>
 * @param _class The name of the class implementing the method
 *
 * A note on the 'stabilization' of the refcnt to one. At that point,
 * the object's refcount will have gone to zero. The object's
 * destructor may trigger code that attempts to QueryInterface() and
 * Release() 'this' again. Doing so will temporarily increment and
 * decrement the refcount. (Only a logic error would make one try to
 * keep a permanent hold on 'this'.)  To prevent re-entering the
 * destructor, we make sure that no balanced refcounting can return
 * the refcount to |0|.
 */
#define NS_IMPL_RELEASE(_class) \
  NS_IMPL_RELEASE_WITH_DESTROY(_class, delete (this))

/**
 * Use this macro to implement the Release method for a given <i>_class</i>
 * implemented as a wholly owned aggregated object intended to implement
 * interface(s) for its owner
 * @param _class The name of the class implementing the method
 * @param _aggregator the owning/containing object
 */
#define NS_IMPL_RELEASE_USING_AGGREGATOR(_class, _aggregator)                 \
NS_IMETHODIMP_(MozExternalRefCountType) _class::Release(void)                 \
{                                                                             \
  NS_PRECONDITION(_aggregator, "null aggregator");                            \
  return (_aggregator)->Release();                                            \
}


#define NS_IMPL_CYCLE_COLLECTING_ADDREF(_class)                               \
NS_IMETHODIMP_(MozExternalRefCountType) _class::AddRef(void)                  \
{                                                                             \
  MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(_class)                                  \
  MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");                        \
  NS_ASSERT_OWNINGTHREAD(_class);                                             \
  nsISupports *base = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Upcast(this);    \
  nsrefcnt count = mRefCnt.incr(base);                                        \
  NS_LOG_ADDREF(this, count, #_class, sizeof(*this));                         \
  return count;                                                               \
}

#define NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(_class, _destroy)       \
NS_IMETHODIMP_(MozExternalRefCountType) _class::Release(void)                 \
{                                                                             \
  MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");                            \
  NS_ASSERT_OWNINGTHREAD(_class);                                             \
  nsISupports *base = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Upcast(this);    \
  nsrefcnt count = mRefCnt.decr(base);                                        \
  NS_LOG_RELEASE(this, count, #_class);                                       \
  return count;                                                               \
}                                                                             \
NS_IMETHODIMP_(void) _class::DeleteCycleCollectable(void)                     \
{                                                                             \
  _destroy;                                                                   \
}

#define NS_IMPL_CYCLE_COLLECTING_RELEASE(_class)                              \
  NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(_class, delete (this))

// _LAST_RELEASE can be useful when certain resources should be released
// as soon as we know the object will be deleted.
#define NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_LAST_RELEASE(_class, _last)     \
NS_IMETHODIMP_(MozExternalRefCountType) _class::Release(void)                 \
{                                                                             \
  MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");                            \
  NS_ASSERT_OWNINGTHREAD(_class);                                             \
  bool shouldDelete = false;                                                  \
  nsISupports *base = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Upcast(this);    \
  nsrefcnt count = mRefCnt.decr(base, &shouldDelete);                         \
  NS_LOG_RELEASE(this, count, #_class);                                       \
  if (count == 0) {                                                           \

/**
 * There are two ways of implementing QueryInterface, and we use both:
 *
 * Table-driven QueryInterface uses a static table of IID->offset mappings
 * and a shared helper function. Using it tends to reduce codesize and improve
 * runtime performance (due to processor cache hits).
 *
 * Macro-driven QueryInterface generates a QueryInterface function directly
 * using common macros. This is necessary if special QueryInterface features
 * are being used (such as tearoffs and conditional interfaces).
 *
 * These methods can be combined into a table-driven function call followed
 * by custom code for tearoffs and conditionals.
 */

struct QITableEntry
{
  const nsIID* iid;     // null indicates end of the QITableEntry array
  int32_t   offset;
};

nsresult NS_FASTCALL
NS_TableDrivenQI(void* aThis, REFNSIID aIID,
                 void** aInstancePtr, const QITableEntry* aEntries);

/**
 * Implement table-driven queryinterface
 */

#define NS_INTERFACE_TABLE_HEAD(_class)                                       \
NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr)      \
{                                                                             \
  NS_ASSERTION(aInstancePtr,                                                  \
               "QueryInterface requires a non-NULL destination!");            \
  nsresult rv = NS_ERROR_FAILURE;

#define NS_INTERFACE_TABLE_BEGIN                                              \
  static const QITableEntry table[] = {

#define NS_INTERFACE_TABLE_ENTRY(_class, _interface)                          \
  { &NS_GET_IID(_interface),                                                  \
    int32_t(reinterpret_cast<char*>(                                          \
                        static_cast<_interface*>((_class*) 0x1000)) -         \
               reinterpret_cast<char*>((_class*) 0x1000))                     \
  },

#define NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(_class, _interface, _implClass)    \
  { &NS_GET_IID(_interface),                                                  \
    int32_t(reinterpret_cast<char*>(                                          \
                        static_cast<_interface*>(                             \
                                       static_cast<_implClass*>(              \
                                                      (_class*) 0x1000))) -   \
               reinterpret_cast<char*>((_class*) 0x1000))                     \
  },

/*
 * XXX: we want to use mozilla::ArrayLength (or equivalent,
 * MOZ_ARRAY_LENGTH) in this condition, but some versions of GCC don't
 * see that the static_assert condition is actually constant in those
 * cases, even with constexpr support (?).
 */
#define NS_INTERFACE_TABLE_END_WITH_PTR(_ptr)                                 \
  { nullptr, 0 } };                                                           \
  static_assert((sizeof(table)/sizeof(table[0])) > 1, "need at least 1 interface"); \
  rv = NS_TableDrivenQI(static_cast<void*>(_ptr),                             \
                        aIID, aInstancePtr, table);

#define NS_INTERFACE_TABLE_END                                                \
  NS_INTERFACE_TABLE_END_WITH_PTR(this)

#define NS_INTERFACE_TABLE_TAIL                                               \
  return rv;                                                                  \
}

#define NS_INTERFACE_TABLE_TAIL_INHERITING(_baseclass)                        \
  if (NS_SUCCEEDED(rv))                                                       \
    return rv;                                                                \
  return _baseclass::QueryInterface(aIID, aInstancePtr);                      \
}

#define NS_INTERFACE_TABLE_TAIL_USING_AGGREGATOR(_aggregator)                 \
  if (NS_SUCCEEDED(rv))                                                       \
    return rv;                                                                \
  NS_ASSERTION(_aggregator, "null aggregator");                               \
  return _aggregator->QueryInterface(aIID, aInstancePtr)                      \
}

/**
 * This implements query interface with two assumptions: First, the
 * class in question implements nsISupports and its own interface and
 * nothing else. Second, the implementation of the class's primary
 * inheritance chain leads to its own interface.
 *
 * @param _class The name of the class implementing the method
 * @param _classiiddef The name of the #define symbol that defines the IID
 * for the class (e.g. NS_ISUPPORTS_IID)
 */

#define NS_IMPL_QUERY_HEAD(_class)                                            \
NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr)      \
{                                                                             \
  NS_ASSERTION(aInstancePtr,                                                  \
               "QueryInterface requires a non-NULL destination!");            \
  nsISupports* foundInterface;

#define NS_IMPL_QUERY_BODY(_interface)                                        \
  if ( aIID.Equals(NS_GET_IID(_interface)) )                                  \
    foundInterface = static_cast<_interface*>(this);                          \
  else

#define NS_IMPL_QUERY_BODY_CONDITIONAL(_interface, condition)                 \
  if ( (condition) && aIID.Equals(NS_GET_IID(_interface)))                    \
    foundInterface = static_cast<_interface*>(this);                          \
  else

#define NS_IMPL_QUERY_BODY_AMBIGUOUS(_interface, _implClass)                  \
  if ( aIID.Equals(NS_GET_IID(_interface)) )                                  \
    foundInterface = static_cast<_interface*>(                                \
                                    static_cast<_implClass*>(this));          \
  else

#define NS_IMPL_QUERY_BODY_AGGREGATED(_interface, _aggregate)                 \
  if ( aIID.Equals(NS_GET_IID(_interface)) )                                  \
    foundInterface = static_cast<_interface*>(_aggregate);                    \
  else

#define NS_IMPL_QUERY_TAIL_GUTS                                               \
    foundInterface = 0;                                                       \
  nsresult status;                                                            \
  if ( !foundInterface )                                                      \
    {                                                                         \
      /* nsISupports should be handled by this point. If not, fail. */        \
      MOZ_ASSERT(!aIID.Equals(NS_GET_IID(nsISupports)));                      \
      status = NS_NOINTERFACE;                                                \
    }                                                                         \
  else                                                                        \
    {                                                                         \
      NS_ADDREF(foundInterface);                                              \
      status = NS_OK;                                                         \
    }                                                                         \
  *aInstancePtr = foundInterface;                                             \
  return status;                                                              \
}

#define NS_IMPL_QUERY_TAIL_INHERITING(_baseclass)                             \
    foundInterface = 0;                                                       \
  nsresult status;                                                            \
  if ( !foundInterface )                                                      \
    status = _baseclass::QueryInterface(aIID, (void**)&foundInterface);       \
  else                                                                        \
    {                                                                         \
      NS_ADDREF(foundInterface);                                              \
      status = NS_OK;                                                         \
    }                                                                         \
  *aInstancePtr = foundInterface;                                             \
  return status;                                                              \
}

#define NS_IMPL_QUERY_TAIL_USING_AGGREGATOR(_aggregator)                      \
  NS_IMPL_QUERY_TAIL_GUTS


/*
  This is the new scheme.  Using this notation now will allow us to switch to
  a table driven mechanism when it's ready.  Note the difference between this
  and the (currently) underlying NS_IMPL_QUERY_INTERFACE mechanism.  You must
  explicitly mention |nsISupports| when using the interface maps.
*/
#define NS_INTERFACE_MAP_BEGIN(_implClass)      NS_IMPL_QUERY_HEAD(_implClass)
#define NS_INTERFACE_MAP_ENTRY(_interface)      NS_IMPL_QUERY_BODY(_interface)
#define NS_INTERFACE_MAP_ENTRY_CONDITIONAL(_interface, condition)             \
  NS_IMPL_QUERY_BODY_CONDITIONAL(_interface, condition)
#define NS_INTERFACE_MAP_ENTRY_AGGREGATED(_interface,_aggregate)              \
  NS_IMPL_QUERY_BODY_AGGREGATED(_interface,_aggregate)

#define NS_INTERFACE_MAP_END                    NS_IMPL_QUERY_TAIL_GUTS
#define NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(_interface, _implClass)              \
  NS_IMPL_QUERY_BODY_AMBIGUOUS(_interface, _implClass)
#define NS_INTERFACE_MAP_END_INHERITING(_baseClass)                           \
  NS_IMPL_QUERY_TAIL_INHERITING(_baseClass)
#define NS_INTERFACE_MAP_END_AGGREGATED(_aggregator)                          \
  NS_IMPL_QUERY_TAIL_USING_AGGREGATOR(_aggregator)

#define NS_INTERFACE_TABLE0(_class)                                           \
  NS_INTERFACE_TABLE_BEGIN                                                    \
    NS_INTERFACE_TABLE_ENTRY(_class, nsISupports)                             \
  NS_INTERFACE_TABLE_END

#define NS_INTERFACE_TABLE(aClass, ...)                                       \
  MOZ_STATIC_ASSERT_VALID_ARG_COUNT(__VA_ARGS__);                             \
  NS_INTERFACE_TABLE_BEGIN                                                    \
    MOZ_FOR_EACH(NS_INTERFACE_TABLE_ENTRY, (aClass,), (__VA_ARGS__))          \
    NS_INTERFACE_TABLE_ENTRY_AMBIGUOUS(aClass, nsISupports,                   \
                                       MOZ_ARG_1(__VA_ARGS__))                \
  NS_INTERFACE_TABLE_END

#define NS_IMPL_QUERY_INTERFACE0(_class)                                      \
  NS_INTERFACE_TABLE_HEAD(_class)                                             \
  NS_INTERFACE_TABLE0(_class)                                                 \
  NS_INTERFACE_TABLE_TAIL

#define NS_IMPL_QUERY_INTERFACE(aClass, ...)                                  \
  NS_INTERFACE_TABLE_HEAD(aClass)                                             \
  NS_INTERFACE_TABLE(aClass, __VA_ARGS__)                                     \
  NS_INTERFACE_TABLE_TAIL

/**
 * Declare that you're going to inherit from something that already
 * implements nsISupports, but also implements an additional interface, thus
 * causing an ambiguity. In this case you don't need another mRefCnt, you
 * just need to forward the definitions to the appropriate superclass. E.g.
 *
 * class Bar : public Foo, public nsIBar {  // both provide nsISupports
 * public:
 *   NS_DECL_ISUPPORTS_INHERITED
 *   ...other nsIBar and Bar methods...
 * };
 */
#define NS_DECL_ISUPPORTS_INHERITED                                           \
public:                                                                       \
  NS_IMETHOD QueryInterface(REFNSIID aIID,                                    \
                            void** aInstancePtr) MOZ_OVERRIDE;                \
  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) MOZ_OVERRIDE;             \
  NS_IMETHOD_(MozExternalRefCountType) Release(void) MOZ_OVERRIDE;            \

/**
 * These macros can be used in conjunction with NS_DECL_ISUPPORTS_INHERITED
 * to implement the nsISupports methods, forwarding the invocations to a
 * superclass that already implements nsISupports.
 *
 * Note that I didn't make these inlined because they're virtual methods.
 */

#define NS_IMPL_ADDREF_INHERITED(Class, Super)                                \
  NS_IMPL_QUERY_INTERFACE0(_class)

#define NS_IMPL_ISUPPORTS(aClass, ...)                                        \
  NS_IMPL_ADDREF(aClass)                                                      \
  NS_IMPL_RELEASE(aClass)                                                     \
  NS_IMPL_QUERY_INTERFACE(aClass, __VA_ARGS__)

#define NS_IMPL_ISUPPORTS_INHERITED0(aClass, aSuper)                          \
    NS_IMPL_QUERY_INTERFACE_INHERITED0(aClass, aSuper)                        \
    NS_IMPL_ADDREF_INHERITED(aClass, aSuper)                                  \
    NS_IMPL_RELEASE_INHERITED(aClass, aSuper)                                 \

#define NS_IMPL_ISUPPORTS_INHERITED(aClass, aSuper, ...)                      \
  NS_IMPL_QUERY_INTERFACE_INHERITED(aClass, aSuper, __VA_ARGS__)              \
  NS_IMPL_ADDREF_INHERITED(aClass, aSuper)                                    \
  NS_IMPL_RELEASE_INHERITED(aClass, aSuper)

/*
 * Macro to glue together a QI that starts with an interface table
 * and segues into an interface map (e.g. it uses singleton classinfo
 * or tearoffs).
/**
 * Macro to generate nsIClassInfo methods for classes which do not have
 * corresponding nsIFactory implementations.
 */
#define NS_IMPL_THREADSAFE_CI(_class)                                         \
NS_IMETHODIMP                                                                 \
_class::GetInterfaces(uint32_t* _count, nsIID*** _array)                      \
{                                                                             \
  return NS_CI_INTERFACE_GETTER_NAME(_class)(_count, _array);                 \
}                                                                             \
                                                                              \
NS_IMETHODIMP                                                                 \
_class::GetHelperForLanguage(uint32_t _language, nsISupports** _retval)       \
{                                                                             \
  *_retval = nullptr;                                                         \
  return NS_OK;                                                               \
}                                                                             \
                                                                              \
NS_IMETHODIMP                                                                 \
_class::GetContractID(char** _contractID)                                     \
{                                                                             \
  *_contractID = nullptr;                                                     \
  return NS_OK;                                                               \
}                                                                             \
                                                                              \
  return NS_ERROR_NOT_AVAILABLE;                                              \
}

#endif
# 1132 "../../dist/include/nsISupportsImpl.h"
# 15 "../../dist/include/nsISupportsUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsISupportsUtils.h"

/**
 * Macro for adding a reference to an interface.
 * @param _ptr The interface pointer.
 */
#define NS_ADDREF(_ptr) \
  (_ptr)->AddRef()

/**
 * Macro for adding a reference to this. This macro should be used
 * because NS_ADDREF (when tracing) may require an ambiguous cast
 * from the pointers primary type to nsISupports. This macro sidesteps
 * that entire problem.
 */
#define NS_ADDREF_THIS() \
  AddRef()


extern "C++" {
// ...because some one is accidentally including this file inside
// an |extern "C"|


// Making this a |inline| |template| allows |aExpr| to be evaluated only once,
// yet still denies you the ability to |AddRef()| an |nsCOMPtr|.
template<class T>
inline void
ns_if_addref(T aExpr)
{
  if (aExpr) {
    aExpr->AddRef();
  }
}

} /* extern "C++" */

/**
 * Macro for adding a reference to an interface that checks for nullptr.
 * @param _expr The interface pointer.
 */
#define NS_IF_ADDREF(_expr) ns_if_addref(_expr)

/*
 * Given these declarations, it explicitly OK and efficient to end a `getter' with:
 *
 *    NS_IF_ADDREF(*result = mThing);
 *
 * even if |mThing| is an |nsCOMPtr|.  If |mThing| is an |nsCOMPtr|, however, it is still
 * _illegal_ to say |NS_IF_ADDREF(mThing)|.
 */

/**
 * Macro for releasing a reference to an interface that checks for nullptr;
 * @param _ptr The interface pointer.
 */
#define NS_IF_RELEASE(_ptr)                                                   \
  do {                                                                        \
    if (_ptr) {                                                               \
      (_ptr)->Release();                                                      \
      (_ptr) = 0;                                                             \
    }                                                                         \
  } while (0)

/*
 * Often you have to cast an implementation pointer, e.g., |this|, to an
 * |nsISupports*|, but because you have multiple inheritance, a simple cast
 * is ambiguous.  One could simply say, e.g., (given a base |nsIBase|),
 * |static_cast<nsIBase*>(this)|; but that disguises the fact that what
 * you are really doing is disambiguating the |nsISupports|.  You could make
 * that more obvious with a double cast, e.g., |static_cast<nsISupports*>
                                                           (* static_cast<nsIBase*>(this))|, but that is bulky and harder to read...
 *
 * The following macro is clean, short, and obvious.  In the example above,
 * you would use it like this: |NS_ISUPPORTS_CAST(nsIBase*, this)|.
 */

#define NS_ISUPPORTS_CAST(__unambiguousBase, __expr) \
  static_cast<nsISupports*>(static_cast<__unambiguousBase>(__expr))

// a type-safe shortcut for calling the |QueryInterface()| member function
template<class T, class DestinationType>
inline nsresult
CallQueryInterface(T* aSource, DestinationType** aDestination)
{
  // We permit nsISupports-to-nsISupports here so that one can still obtain
  // the canonical nsISupports pointer with CallQueryInterface.
  static_assert(!mozilla::IsSame<T, DestinationType>::value ||
                mozilla::IsSame<DestinationType, nsISupports>::value,
                "don't use CallQueryInterface for compile-time-determinable casts");

  NS_PRECONDITION(aSource, "null parameter");
  NS_PRECONDITION(aDestination, "null parameter");

  return aSource->QueryInterface(NS_GET_TEMPLATE_IID(DestinationType),
                                 reinterpret_cast<void**>(aDestination));
}

#endif /* __nsISupportsUtils_h */
# 145 "../../dist/include/nsISupportsUtils.h"
# 124 "../../dist/include/nsISupports.h" 2

#endif /* __gen_nsISupports_h__ */
# 126 "../../dist/include/nsISupports.h"
# 11 "../../dist/include/nsIDOMCanvasRenderingContext2D.h" 2
#endif
# 12 "../../dist/include/nsIDOMCanvasRenderingContext2D.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE

nsDOMCanvasRenderingContext2D::~nsDOMCanvasRenderingContext2D()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 85 "../../dist/include/nsIDOMCanvasRenderingContext2D.h"


#endif /* __gen_nsIDOMCanvasRenderingContext2D_h__ */
# 88 "../../dist/include/nsIDOMCanvasRenderingContext2D.h"
# 11 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsICanvasRenderingContextInternal.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/canvas/nsICanvasRenderingContextInternal.h" 1
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsICanvasRenderingContextInternal_h___
#define nsICanvasRenderingContextInternal_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/2D.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _MOZILLA_GFX_2D_H
#define _MOZILLA_GFX_2D_H

#if 0 /* expanded by -frewrite-includes */
#include "Types.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/Types.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_TYPES_H_
#define MOZILLA_GFX_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#if !defined(_SIZE_T) || __has_feature(modules)
/* Always define size_t when modules are available. */
#if !__has_feature(modules)
#define _SIZE_T
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 68 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#undef NULL
#ifdef __cplusplus
#  if !defined(__MINGW32__) && !defined(_MSC_VER)
#    define NULL __null
#  else
# 74 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#    define NULL 0
#  endif
# 76 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#else
# 77 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#  define NULL ((void*)0)
#endif
# 79 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#ifdef __cplusplus
#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
namespace std { typedef decltype(nullptr) nullptr_t; }
using ::std::nullptr_t;
#endif
# 85 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#define offsetof(t, d) __builtin_offsetof(t, d)

#endif /* __STDDEF_H */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 10 "../../dist/include/mozilla/gfx/Types.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/gfx/Types.h"

namespace mozilla {
namespace gfx {

typedef float Float;

enum class SurfaceType : int8_t {
  DATA, /* Data surface - bitmap in memory */
  D2D1_BITMAP, /* Surface wrapping a ID2D1Bitmap */
  D2D1_DRAWTARGET, /* Surface made from a D2D draw target */
  CAIRO, /* Surface wrapping a cairo surface */
  CAIRO_IMAGE, /* Data surface wrapping a cairo image surface */
  COREGRAPHICS_IMAGE, /* Surface wrapping a CoreGraphics Image */
  COREGRAPHICS_CGCONTEXT, /* Surface wrapping a CG context */
  SKIA, /* Surface wrapping a Skia bitmap */
  DUAL_DT, /* Snapshot of a dual drawtarget */
  D2D1_1_IMAGE, /* A D2D 1.1 ID2D1Image SourceSurface */
  RECORDING, /* Surface used for recording */
  TILED /* Surface from a tiled DrawTarget */
};

enum class SurfaceFormat : int8_t {
  B8G8R8A8,
  B8G8R8X8,
  R8G8B8A8,
  R8G8B8X8,
  R5G6B5,
  A8,
  YUV,
  UNKNOWN
};

inline bool IsOpaque(SurfaceFormat aFormat)
{
  switch (aFormat) {
  case SurfaceFormat::B8G8R8X8:
  case SurfaceFormat::R8G8B8X8:
  case SurfaceFormat::R5G6B5:
  case SurfaceFormat::YUV:
    return true;
  default:
    return false;
  }
}

enum class FilterType : int8_t {
  BLEND = 0,
  TRANSFORM,
  MORPHOLOGY,
  COLOR_MATRIX,
  FLOOD,
  TILE,
  TABLE_TRANSFER,
  DISCRETE_TRANSFER,
  LINEAR_TRANSFER,
  GAMMA_TRANSFER,
  CONVOLVE_MATRIX,
  DISPLACEMENT_MAP,
  TURBULENCE,
  ARITHMETIC_COMBINE,
  COMPOSITE,
  DIRECTIONAL_BLUR,
  GAUSSIAN_BLUR,
  POINT_DIFFUSE,
  POINT_SPECULAR,
  SPOT_DIFFUSE,
  SPOT_SPECULAR,
  DISTANT_DIFFUSE,
  DISTANT_SPECULAR,
  CROP,
  PREMULTIPLY,
  UNPREMULTIPLY
};

enum class DrawTargetType : int8_t {
  SOFTWARE_RASTER = 0,
  HARDWARE_RASTER,
  VECTOR
};

enum class BackendType : int8_t {
  NONE = 0,
  DIRECT2D,
  COREGRAPHICS,
  COREGRAPHICS_ACCELERATED,
  CAIRO,
  SKIA,
  RECORDING,
  DIRECT2D1_1
};

enum class FontType : int8_t {
  DWRITE,
  GDI,
  MAC,
  SKIA,
  CAIRO,
  COREGRAPHICS
};

enum class NativeSurfaceType : int8_t {
  D3D10_TEXTURE,
  CAIRO_SURFACE,
  CAIRO_CONTEXT,
  CGCONTEXT,
  CGCONTEXT_ACCELERATED,
  OPENGL_TEXTURE
};

enum class NativeFontType : int8_t {
  DWRITE_FONT_FACE,
  GDI_FONT_FACE,
  MAC_FONT_FACE,
  SKIA_FONT_FACE,
  CAIRO_FONT_FACE
};

enum class FontStyle : int8_t {
  NORMAL,
  ITALIC,
  BOLD,
  BOLD_ITALIC
};

enum class FontHinting : int8_t {
  NONE,
  LIGHT,
  NORMAL,
  FULL
};

enum class CompositionOp : int8_t {
  OP_OVER,
  OP_ADD,
  OP_ATOP,
  OP_OUT,
  OP_IN,
  OP_SOURCE,
  OP_DEST_IN,
  OP_DEST_OUT,
  OP_DEST_OVER,
  OP_DEST_ATOP,
  OP_XOR,
  OP_MULTIPLY,
  OP_SCREEN,
  OP_OVERLAY,
  OP_DARKEN,
  OP_LIGHTEN,
  OP_COLOR_DODGE,
  OP_COLOR_BURN,
  OP_HARD_LIGHT,
  OP_SOFT_LIGHT,
  OP_DIFFERENCE,
  OP_EXCLUSION,
  OP_HUE,
  OP_SATURATION,
  OP_COLOR,
  OP_LUMINOSITY,
  OP_COUNT
};

enum class ExtendMode : int8_t {
  CLAMP,
  REPEAT,
  REFLECT
};

enum class FillRule : int8_t {
  FILL_WINDING,
  FILL_EVEN_ODD
};

enum class AntialiasMode : int8_t {
  NONE,
  GRAY,
  SUBPIXEL,
  DEFAULT
};

enum class Filter : int8_t {
  GOOD,
  LINEAR,
  POINT
};

enum class PatternType : int8_t {
  COLOR,
  SURFACE,
  LINEAR_GRADIENT,
  RADIAL_GRADIENT
};

enum class JoinStyle : int8_t {
  BEVEL,
  ROUND,
  MITER, //!< Mitered if within the miter limit, else, if the backed supports
         //!< it (D2D), the miter is clamped. If the backend does not support
         //!< miter clamping the behavior is as for MITER_OR_BEVEL.
  MITER_OR_BEVEL //!< Mitered if within the miter limit, else beveled.
};

enum class CapStyle : int8_t {
  BUTT,
  ROUND,
  SQUARE
};

enum class SamplingBounds : int8_t {
  UNBOUNDED,
  BOUNDED
};

/* Color is stored in non-premultiplied form */
struct Color
{
public:
  Color()
    : r(0.0f), g(0.0f), b(0.0f), a(0.0f)
  {}
  Color(Float aR, Float aG, Float aB, Float aA)
    : r(aR), g(aG), b(aB), a(aA)
  {}
  Color(Float aR, Float aG, Float aB)
    : r(aR), g(aG), b(aB), a(1.0f)
  {}

  static Color FromABGR(uint32_t aColor)
  {
    Color newColor(((aColor >> 0) & 0xff) * (1.0f / 255.0f),
                   ((aColor >> 8) & 0xff) * (1.0f / 255.0f),
                   ((aColor >> 16) & 0xff) * (1.0f / 255.0f),
                   ((aColor >> 24) & 0xff) * (1.0f / 255.0f));

    return newColor;
  }

  uint32_t ToARGB() const
  {
    return uint32_t(b * 255.0f) | uint32_t(g * 255.0f) << 8 |
           uint32_t(r * 255.0f) << 16 | uint32_t(a * 255.0f) << 24;
  }

  Float r, g, b, a;
};

struct GradientStop
{
  

  Float offset;
  Color color;
};

}
}

#if defined(XP_WIN) && defined(MOZ_GFX)
#ifdef GFX2D_INTERNAL
#define GFX2D_API __declspec(dllexport)
#else
# 289 "../../dist/include/mozilla/gfx/Types.h"
#define GFX2D_API __declspec(dllimport)
#endif
# 291 "../../dist/include/mozilla/gfx/Types.h"
#else
# 292 "../../dist/include/mozilla/gfx/Types.h"
#define GFX2D_API
#endif
# 294 "../../dist/include/mozilla/gfx/Types.h"

namespace mozilla {

// We can't use MOZ_BEGIN_ENUM_CLASS here because that prevents the enum
// values from being used for indexing. Wrapping the enum in a struct does at
// least gives us name scoping.
struct RectCorner {
  enum {
    // This order is important since Rect::AtCorner, AppendRoundedRectToPath
    // and other code depends on it!
    TopLeft = 0,
    TopRight = 1,
    BottomRight = 2,
    BottomLeft = 3,
    Count = 4
  };
};

// Side constants for use in various places.
enum Side { eSideTop, eSideRight, eSideBottom, eSideLeft };

enum SideBits {
  eSideBitsNone   = 0,
  eSideBitsTop    = 1 << eSideTop,
  eSideBitsRight  = 1 << eSideRight,
  eSideBitsBottom = 1 << eSideBottom,
  eSideBitsLeft   = 1 << eSideLeft,
  eSideBitsTopBottom = eSideBitsTop  | eSideBitsBottom,
  eSideBitsLeftRight = eSideBitsLeft | eSideBitsRight,
  eSideBitsAll = eSideBitsTopBottom | eSideBitsLeftRight
};
} // namespace mozilla

#define NS_SIDE_TOP    mozilla::eSideTop
#define NS_SIDE_RIGHT  mozilla::eSideRight
#define NS_SIDE_BOTTOM mozilla::eSideBottom
#define NS_SIDE_LEFT   mozilla::eSideLeft

#endif /* MOZILLA_GFX_TYPES_H_ */
# 333 "../../dist/include/mozilla/gfx/Types.h"
# 10 "../../dist/include/mozilla/gfx/2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "Point.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/Point.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_POINT_H_
#define MOZILLA_GFX_POINT_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/Point.h"
#if 0 /* expanded by -frewrite-includes */
#include "Types.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/gfx/Point.h"
#if 0 /* expanded by -frewrite-includes */
#include "Coord.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/Coord.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_COORD_H_
#define MOZILLA_GFX_COORD_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/Coord.h"
#if 0 /* expanded by -frewrite-includes */
#include "Types.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/gfx/Coord.h"
#if 0 /* expanded by -frewrite-includes */
#include "BaseCoord.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/BaseCoord.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_BASECOORD_H_
#define MOZILLA_GFX_BASECOORD_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/BaseCoord.h"

namespace mozilla {
namespace gfx {

/**
 * Do not use this class directly. Subclass it, pass that subclass as the
 * Sub parameter, and only use that subclass. This allows methods to safely
 * cast 'this' to 'Sub*'.
 */
template <class T, class Sub>
struct BaseCoord {
  T value;

  // Constructors
  MOZ_CONSTEXPR 
  explicit MOZ_CONSTEXPR BaseCoord(T aValue) : value(aValue) {}

  // Note that '=' isn't defined so we'll get the
  // compiler generated default assignment operator

  operator T() const { return value; }

  
  

  
  
  
  
  
  
  
  

  
};

}
}

#endif /* MOZILLA_GFX_BASECOORD_H_ */
# 111 "../../dist/include/mozilla/gfx/BaseCoord.h"
# 12 "../../dist/include/mozilla/gfx/Coord.h" 2

#if 0 /* expanded by -frewrite-includes */
#include <cmath>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 1 3
// -*- C++ -*-
//===---------------------------- cmath -----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CMATH
#define _LIBCPP_CMATH

/*
    cmath synopsis

Macros:

    HUGE_VAL
 * License for the specific language governing rights and limitations
 * under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef __MATH_H__
#define __MATH_H__

#ifndef __MATH__
#define __MATH__
#endif
# 29 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 31 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4

__BEGIN_DECLS

/******************************************************************************
 * Floating point data types                                                  *
 ******************************************************************************/

/*  Define float_t and double_t per C standard, ISO/IEC 9899:2011 7.12 2,
    taking advantage of GCC's __FLT_EVAL_METHOD__ (which a compiler may
    define anytime and GCC does) that shadows FLT_EVAL_METHOD (which a
    compiler must define only in float.h).                                    */
#if __FLT_EVAL_METHOD__ == 0
    typedef float float_t;
    typedef double double_t;
#elif __FLT_EVAL_METHOD__ == 1
# 47 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4
    typedef double float_t;
    typedef double double_t;
#elif __FLT_EVAL_METHOD__ == 2 || __FLT_EVAL_METHOD__ == -1
#   define    HUGE_VAL     1e500
#   define    HUGE_VALF    1e50f
#   define    HUGE_VALL    1e5000L
#   define    NAN          __nan()
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4

#define INFINITY    HUGE_VALF

/******************************************************************************
 *      Taxonomy of floating point data types                                 *
 ******************************************************************************/

#define FP_NAN          1
#define FP_ILOGB0      (-2147483647 - 1)
#define FP_ILOGBNAN    (-2147483647 - 1)

/* Bitmasks for the math_errhandling macro.  */
#define MATH_ERRNO        1    /* errno set by math functions.  */
#define MATH_ERREXCEPT    2    /* Exceptions raised by math functions.  */

#define math_errhandling (__math_errhandling())
;

/******************************************************************************
 *                                                                            *
 *                              Inquiry macros                                *
 *                                                                            *
 *  fpclassify      Returns one of the FP_* values.                           *
 *  isnormal        Non-zero if and only if the argument x is normalized.     *
 *  isfinite        Non-zero if and only if the argument x is finite.         *
 *  isnan           Non-zero if and only if the argument x is a NaN.          *
 *  signbit         Non-zero if and only if the sign of the argument x is     *
 *                  negative.  This includes, NaNs, infinities and zeros.     *
 *                                                                            *
 ******************************************************************************/

#if (defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 1080) || \
    (defined __IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < 60000)
#   if defined __i386__ || defined __x86_64__
#       define __fpclassifyl __fpclassify
#       define __isnormall   __isnormal
#       define __isfinitel   __isfinite
#       define __isinfl      __isinf
#       define __isnanl      __isnan
#   elif defined __arm__
# 135 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4
#       define __fpclassifyd __fpclassify
#   endif
# 137 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4
#endif
# 138 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4

#define fpclassify(x)                                                    \
    ( sizeof(x) == sizeof(float)  ? __fpclassifyf((float)(x))            \
    : sizeof(x) == sizeof(double) ? __fpclassifyd((double)(x))           \
                                  : __fpclassifyl((long double)(x)))

extern int __fpclassifyf(float);
extern int __fpclassifyd(double);
extern int __fpclassifyl(long double);

#if (defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__) || \
    (defined __IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED < 60000 && defined __arm__)
__header_always_inline int __inline_isnormalf(float);
__header_always_inline int __inline_isnormald(double);
__header_always_inline int __inline_isnormall(long double);
__header_always_inline int __inline_signbitf(float);
__header_always_inline int __inline_signbitd(double);
__header_always_inline int __inline_signbitl(long double);
    
__header_always_inline int __inline_isfinitef(float __x) {
    return __x == __x && __builtin_fabsf(__x) != __builtin_inff();
}
__header_always_inline int __inline_isfinited(double __x) {
    return __x == __x && __builtin_fabs(__x) != __builtin_inf();
}
__header_always_inline int __inline_isfinitel(long double __x) {
    return __x == __x && __builtin_fabsl(__x) != __builtin_infl();
}
__header_always_inline int __inline_isinff(float __x) {
    return __builtin_fabsf(__x) == __builtin_inff();
}
__header_always_inline int __inline_isinfd(double __x) {
    return __builtin_fabs(__x) == __builtin_inf();
}
__header_always_inline int __inline_isinfl(long double __x) {
    return __builtin_fabsl(__x) == __builtin_infl();
}
__header_always_inline int __inline_isnanf(float __x) {
    return __x != __x;
}
__header_always_inline int __inline_isnand(double __x) {
    return __x != __x;
}
__header_always_inline int __inline_isnanl(long double __x) {
    return __x != __x;
}
__header_always_inline int __inline_signbitf(float __x) {
    union { float __f; unsigned int __u; } __u;
    __u.__f = __x;
    return (int)(__u.__u >> 31);
}
__header_always_inline int __inline_signbitd(double __x) {
    union { double __f; unsigned long long __u; } __u;
    __u.__f = __x;
    return (int)(__u.__u >> 63);
}
#if defined __i386__ || defined __x86_64__
__header_always_inline int __inline_signbitl(long double __x) {
    union {
        long double __ld;
        struct{ unsigned long long __m; unsigned short __sexp; } __p;
    } __u;
    __u.__ld = __x;
    return (int)(__u.__p.__sexp >> 15);
}
#else
# 251 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4
__header_always_inline int __inline_signbitl(long double __x) {
    union { long double __f; unsigned long long __u;} __u;
    __u.__f = __x;
    return (int)(__u.__u >> 63);
}
#endif
# 257 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4
__header_always_inline int __inline_isnormalf(float __x) {
    return __inline_isfinitef(__x) && __builtin_fabsf(__x) >= __FLT_MIN__;
}
__header_always_inline int __inline_isnormald(double __x) {
    return __inline_isfinited(__x) && __builtin_fabs(__x) >= __DBL_MIN__;
}
__header_always_inline int __inline_isnormall(long double __x) {
    return __inline_isfinitel(__x) && __builtin_fabsl(__x) >= __LDBL_MIN__;
}
    
#else /* defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__ */
# 268 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4

/*  Implementations making function calls to fall back on when -ffast-math
    or similar is specified.  These are not available in iOS versions prior
    to 6.0.  If you need them, you must target that version or later.         */
    
#define isnormal(x)                                               \
    ( sizeof(x) == sizeof(float)  ? __isnormalf((float)(x))       \
    : sizeof(x) == sizeof(double) ? __isnormald((double)(x))      \
                                  : __isnormall((long double)(x)))
    
#define isfinite(x)                                               \
    ( sizeof(x) == sizeof(float)  ? __isfinitef((float)(x))       \
    : sizeof(x) == sizeof(double) ? __isfinited((double)(x))      \
                                  : __isfinitel((long double)(x)))
    
#endif /* defined(__GNUC__) && 0 == __FINITE_MATH_ONLY__ */
# 315 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4

/******************************************************************************
 *                                                                            *
 *                              Math Functions                                *
 *                                                                            *
 ******************************************************************************/
    
;
;
;
    
;
;
;
    
;
;
;
    
;
;
;
    
extern float cosf(float);
extern double cos(double);
;
    
extern float sinf(float);
extern double sin(double);
;
    
;
extern double tan(double);
;
    
;
;

extern float fabsf(float);
extern double fabs(double);
extern long double fabsl(long double);

;
;
;

;
;
;

;
;
;

;
extern double sqrt(double);
;

;
;
;

;
;
;

/*	lgammaf, lgamma, and lgammal are not thread-safe. The thread-safe
    variants lgammaf_r, lgamma_r, and lgammal_r are made available if
    you define the _REENTRANT symbol before including <math.h>                */
;
;
;

;
;
;

extern float ceilf(float);
extern double ceil(double);
;

extern float floorf(float);
extern double floor(double);
;

 __OSX_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA);

/******************************************************************************
 *  Reentrant variants of lgamma[fl]                                          *
 ******************************************************************************/

#ifdef _REENTRANT
/*  Reentrant variants of the lgamma[fl] functions.                           */
extern float lgammaf_r(float, int *) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_1);
extern double lgamma_r(double, int *) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_1);
extern long double lgammal_r(long double, int *) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_1);
#endif /* _REENTRANT */
# 581 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4

/******************************************************************************
 *  Apple extensions to the C standard                                        *
/*  __sincos(x,sinp,cosp) computes the sine and cosine of x with a single
    function call, storing the sine in the memory pointed to by sinp, and
 *  POSIX/UNIX extensions to the C standard                                   *
 ******************************************************************************/

#if __DARWIN_C_LEVEL >= 199506L
 __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_3_2); 
 __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_3_2); 
 __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_3_2); 
 __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_3_2); 
 __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_3_2); 
 __OSX_AVAILABLE_STARTING(__MAC_10_0,__IPHONE_3_2); 
; 
extern int signgam;

/*  Even though these might be more useful as long doubles, POSIX requires
    that they be double-precision literals.                                   */
#define M_E         2.71828182845904523536028747135266250   /* e              */
#define M_LOG2E     1.44269504088896340735992468100189214   /* log2(e)        */

/* Legacy BSD API: please use C99 lrint( ) instead.                           */
 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
/* Legacy BSD API: please use C99 lround( ) instead.                          */
 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
/* Legacy BSD API: please use C99 remainder( ) instead.                       */
 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
/* Legacy BSD API: please use C99 isfinite( ) instead.                        */
 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
/* Legacy BSD API: please use C99 tgamma( ) instead.                          */
 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
/* Legacy BSD API: please use C99 frexp( ) instead.                           */
 __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);

#if !defined __cplusplus
struct exception {
    int type;
    char *name;
    double arg1;
    double arg2;
    double retval;
};
/* Legacy API: does not do anything useful.                                   */
extern int matherr(struct exception *) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
#endif /* !defined __cplusplus */
# 735 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
# 736 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4

__END_DECLS
#endif /* __MATH_H__ */
# 739 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/math.h" 3 4
# 302 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <type_traits>
#endif /* expanded by -frewrite-includes */
# 303 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3

#ifdef _LIBCPP_MSVCRT
#if 0 /* expanded by -frewrite-includes */
#include "support/win32/math_win32.h"
#endif /* expanded by -frewrite-includes */
# 306 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3
#endif
# 307 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 310 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3
#endif
# 311 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3

// signbit

#ifdef signbit

template <class _A1>
_LIBCPP_ALWAYS_INLINE
bool
template <class _A1>
_LIBCPP_ALWAYS_INLINE
int
__libcpp_fpclassify(_A1 __x) _NOEXCEPT
{
    return fpclassify(__x);
}

#undef fpclassify



#endif  // fpclassify
# 359 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3

// isfinite
# 383 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3

// isinf

#ifdef isinf

template <class _A1>
_LIBCPP_ALWAYS_INLINE
bool
__libcpp_isinf(_A1 __x) _NOEXCEPT
{
    return isinf(__x);
}

#undef isinf



#endif  // isunordered
# 635 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3

_LIBCPP_BEGIN_NAMESPACE_STD















using ::float_t;
using ::double_t;

// abs

#if !defined(_AIX)







#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))


#endif
# 727 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3



// ceil

using ::ceil;
using ::ceilf;

#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))


#endif
# 753 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3



// cos

using ::cos;
using ::cosf;

#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))


#endif



// fabs

using ::fabs;
using ::fabsf;

#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
inline _LIBCPP_INLINE_VISIBILITY float       fabs(float __x) _NOEXCEPT       {return fabsf(__x);}
inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) _NOEXCEPT {return fabsl(__x);}
#endif
# 817 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3





// sqrt

#endif // __sun__
# 1002 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3
using ::sqrt;



#if !(defined(_LIBCPP_MSVCRT) || defined(__sun__) || defined(_AIX))


#endif
# 1010 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3



// tan

using ::tan;

#ifndef __sun__

#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))


#endif
# 1026 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3



// tanh




#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))


#endif
# 1041 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3



// acosh

#ifndef _LIBCPP_MSVCRT













#endif // !_LIBCPP_MSVCRT
# 1682 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3

#else 
# 1684 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3
using ::lgamma;
using ::lgammaf;
#endif // __sun__
# 1687 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3
_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_CMATH
# 1690 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath" 3
# 14 "../../dist/include/mozilla/gfx/Coord.h" 2

namespace mozilla {

template <typename> struct IsPixel;

namespace gfx {

template <class units> struct IntCoordTyped;
template <class units> struct CoordTyped;

// CommonType<coord, primitive> is a metafunction that returns the type of the
// result of an arithmetic operation on the underlying type of a strongly-typed
// coordinate type 'coord', and a primitive type 'primitive'. C++ rules for
// arithmetic conversions are designed to avoid losing information - for
// example, the result of adding an int and a float is a float - and we want
// the same behaviour when mixing our coordinate types with primitive types.
// We get C++ to compute the desired result type using 'decltype'.

template <class coord, class primitive>
struct CommonType;

template <class units, class primitive>
struct CommonType<IntCoordTyped<units>, primitive> {
    typedef decltype(int32_t() + primitive()) type;
};

template <class units, class primitive>
struct CommonType<CoordTyped<units>, primitive> {
    typedef decltype(Float() + primitive()) type;
};

// This is a base class that provides mixed-type operator overloads between
// a strongly-typed Coord and a primitive value. It is needed to avoid
// ambiguities at mixed-type call sites, because Coord classes are implicitly
// convertible to their underlying value type. As we transition more of our code
// to strongly-typed classes, we may be able to remove some or all of these
// overloads.
template <class coord, class primitive>
struct CoordOperatorsHelper {
  
  
  
  

  typedef typename CommonType<coord, primitive>::type result_type;

  
  
  
  
  
  
  
  // 'scale / coord' is intentionally omitted because it doesn't make sense.
};

// Note: 'IntCoordTyped<units>' and 'CoordTyped<units>' do not derive from
// 'units' to work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61959.

template<class units>
struct IntCoordTyped :
  public BaseCoord< int32_t, IntCoordTyped<units> >,
  public CoordOperatorsHelper< IntCoordTyped<units>, float >,
  public CoordOperatorsHelper< IntCoordTyped<units>, double > {
  static_assert(IsPixel<units>::value,
                "'units' must be a coordinate system tag");

  typedef BaseCoord< int32_t, IntCoordTyped<units> > Super;

  MOZ_CONSTEXPR 
  MOZ_CONSTEXPR MOZ_IMPLICIT IntCoordTyped(int32_t aValue) : Super(aValue) {}
};

template<class units>
struct CoordTyped :
  public BaseCoord< Float, CoordTyped<units> >,
  public CoordOperatorsHelper< CoordTyped<units>, int32_t >,
  public CoordOperatorsHelper< CoordTyped<units>, uint32_t >,
  public CoordOperatorsHelper< CoordTyped<units>, double > {
  static_assert(IsPixel<units>::value,
                "'units' must be a coordinate system tag");

  typedef BaseCoord< Float, CoordTyped<units> > Super;

  MOZ_CONSTEXPR 
  MOZ_CONSTEXPR MOZ_IMPLICIT CoordTyped(Float aValue) : Super(aValue) {}
  

  
  

  
  
};

}
}

#endif /* MOZILLA_GFX_COORD_H_ */
# 143 "../../dist/include/mozilla/gfx/Coord.h"
# 12 "../../dist/include/mozilla/gfx/Point.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "BaseCoord.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/gfx/Point.h"
#if 0 /* expanded by -frewrite-includes */
#include "BasePoint.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/BasePoint.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_BASEPOINT_H_
#define MOZILLA_GFX_BASEPOINT_H_

#if 0 /* expanded by -frewrite-includes */
#include <cmath>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/BasePoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/gfx/BasePoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ToString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ToString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Utilities for converting an object to a string representation. */

#ifndef mozilla_ToString_h
#define mozilla_ToString_h

#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 1 3
// -*- C++ -*-
//===--------------------------- string -----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_STRING
#define _LIBCPP_STRING

/*
    string synopsis

namespace std
{

template <class stateT>
class fpos

template <class stateT> streamoff operator-(const fpos<stateT>& x, const fpos<stateT>& y);
#endif /* expanded by -frewrite-includes */
# 435 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
#if 0 /* expanded by -frewrite-includes */
#include <iosfwd>
#endif /* expanded by -frewrite-includes */
# 436 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
#if 0 /* expanded by -frewrite-includes */
#include <cstring>
#endif /* expanded by -frewrite-includes */
# 437 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
#if 0 /* expanded by -frewrite-includes */
#include <cstdio>  // For EOF.
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdio" 1 3
// -*- C++ -*-
//===---------------------------- cstdio ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CSTDIO
#define _LIBCPP_CSTDIO

/*
    cstdio synopsis

                 mbstate_t* restrict ps);

}  // std

*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 107 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar" 3
#if 0 /* expanded by -frewrite-includes */
#include <cwctype>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype" 1 3
// -*- C++ -*-
//===--------------------------- cwctype ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CWCTYPE
#define _LIBCPP_CWCTYPE

/*
    cwctype synopsis

Macros:

*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 54 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype" 3
#if 0 /* expanded by -frewrite-includes */
#include <cctype>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 1 3
// -*- C++ -*-
//===---------------------------- cctype ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CCTYPE
#define _LIBCPP_CCTYPE

/*
    cctype synopsis

namespace std
{

int isalnum(int c);
int isalpha(int c);
int isblank(int c);  // C99
#include <__config>
#endif /* expanded by -frewrite-includes */
# 39 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 3
#if 0 /* expanded by -frewrite-includes */
#include <ctype.h>
#endif /* expanded by -frewrite-includes */
# 40 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 3
#if defined(_LIBCPP_MSVCRT)
#if 0 /* expanded by -frewrite-includes */
#include "support/win32/support.h"
#endif /* expanded by -frewrite-includes */
# 42 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 3
#endif // _LIBCPP_MSVCRT
# 43 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 46 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 3
#endif
# 47 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 3

_LIBCPP_BEGIN_NAMESPACE_STD

#ifdef isalnum
inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalnum(int __c) {return isalnum(__c);}
#undef isalnum
using ::tolower;
#endif  // tolower
# 153 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 3

#ifdef toupper
inline _LIBCPP_INLINE_VISIBILITY int __libcpp_toupper(int __c) {return toupper(__c);}
#undef toupper
inline _LIBCPP_INLINE_VISIBILITY int toupper(int __c) {return __libcpp_toupper(__c);}
#else  // toupper
# 159 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 3
using ::toupper;
#endif  // toupper
# 161 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 3

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_CCTYPE
# 165 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cctype" 3
# 55 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <wctype.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 1 3 4
/*-
 * Copyright (c)1999 Citrus Project,
 * 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.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
 *
 *	citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp
 *	$NetBSD: wctype.h,v 1.3 2000/12/22 14:16:16 itojun Exp $
 * $FreeBSD: /repoman/r/ncvs/src/include/wctype.h,v 1.10 2002/08/21 16:19:55 mike Exp $
 */

#ifndef _WCTYPE_H_
#define	_WCTYPE_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types/_wctrans_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_wctrans_t.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _WCTRANS_T 
#define _WCTRANS_T 
typedef	__darwin_wctrans_t wctrans_t;
#endif /* _WCTRANS_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_wctrans_t.h" 3 4
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 2 3 4

#define __DARWIN_WCTYPE_TOP_inline	__header_inline

#if 0 /* expanded by -frewrite-includes */
#include <_wctype.h>
#endif /* expanded by -frewrite-includes */
# 41 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <ctype.h>
#endif /* expanded by -frewrite-includes */
# 42 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4

/*
 * Use inline functions if we are allowed to and the compiler supports them.
 */
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
    (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))

__DARWIN_WCTYPE_TOP_inline int
iswblank(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_B));
}

#if !defined(_ANSI_SOURCE)
__DARWIN_WCTYPE_TOP_inline int
iswascii(wint_t _wc)
{
	return ((_wc & ~0x7F) == 0);
}

__DARWIN_WCTYPE_TOP_inline int
iswhexnumber(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_X));
}

__DARWIN_WCTYPE_TOP_inline int
iswideogram(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_I));
}

__DARWIN_WCTYPE_TOP_inline int
iswnumber(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_D));
}

__DARWIN_WCTYPE_TOP_inline int
iswphonogram(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_Q));
}

__DARWIN_WCTYPE_TOP_inline int
iswrune(wint_t _wc)
{
	return (__istype(_wc, 0xFFFFFFF0L));
}

__DARWIN_WCTYPE_TOP_inline int
iswspecial(wint_t _wc)
{
	return (__istype(_wc, _CTYPE_T));
}
#endif /* !_ANSI_SOURCE */
# 98 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4

#else /* not using inlines */
# 100 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4

__BEGIN_DECLS
int	iswblank(wint_t);

#if !defined(_ANSI_SOURCE)
wint_t	iswascii(wint_t);
wint_t	iswhexnumber(wint_t);
wint_t	iswideogram(wint_t);
wint_t	iswnumber(wint_t);
wint_t	iswphonogram(wint_t);
wint_t	iswrune(wint_t);
wint_t	iswspecial(wint_t);
#endif
# 113 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4
__END_DECLS

#endif /* using inlines */
# 116 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4

__BEGIN_DECLS
#if !defined(_ANSI_SOURCE) && (!defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE))
;
#endif
# 121 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4
;
;
__END_DECLS

#ifdef _USE_EXTENDED_LOCALES_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_wctype.h>
#endif /* expanded by -frewrite-includes */
# 128 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4
#endif /* _USE_EXTENDED_LOCALES_ */
# 129 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4

#endif		/* _WCTYPE_H_ */
# 131 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/wctype.h" 3 4
# 56 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 59 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype" 3
#endif
# 60 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype" 3

_LIBCPP_BEGIN_NAMESPACE_STD

using ::wint_t;
using ::wctrans_t;
using ::wctype_t;

#ifdef iswalnum
#endif
# 82 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype" 3

#ifdef iswblank
#else  // wctrans
# 208 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype" 3

#endif
# 210 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype" 3

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_CWCTYPE
# 214 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype" 3
# 108 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar" 2 3
#if 0 /* expanded by -frewrite-includes */
#endif
# 116 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar" 3

_LIBCPP_BEGIN_NAMESPACE_STD

using ::mbstate_t;
using ::size_t;
using ::tm;
using ::wint_t;
using ::FILE;



using ::vfwprintf;
using ::vswprintf;
using ::vwprintf;
using ::wmemcmp;
using ::wmemcpy;
using ::wmemmove;
using ::wmemset;
using ::wcsftime;





using ::wcrtomb;



_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_CWCHAR
# 218 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar" 3
# 439 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 440 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
#if 0 /* expanded by -frewrite-includes */
#include <iterator>
#endif /* expanded by -frewrite-includes */
# 441 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
#if 0 /* expanded by -frewrite-includes */
#include <utility>
#endif /* expanded by -frewrite-includes */
# 442 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
#if 0 /* expanded by -frewrite-includes */
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

/*
 * Unlike other ANSI header files, <assert.h> may usefully be included
 * multiple times, with and without NDEBUG defined.
 */

#undef assert
#undef __assert

#ifdef NDEBUG
#define	assert(e)	((void)0)
#else
# 58 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

#ifndef __GNUC__

__BEGIN_DECLS
void __assert_rtn(const char *, const char *, int, const char *) __dead2;
#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
void __eprintf(const char *, const char *, unsigned, const char *) __dead2;
#endif
# 80 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
__END_DECLS

#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
#define __assert(e, file, line) \
    __eprintf ("%s:%u: failed assertion `%s'\n", file, line, e)
#else
# 86 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
/* 8462256: modified __assert_rtn() replaces deprecated __eprintf() */
#define __assert(e, file, line) \
    __assert_rtn ((const char *)-1L, file, line, e)
#endif
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

#if __DARWIN_UNIX03
#define	assert(e) \
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
#else /* !__DARWIN_UNIX03 */
# 95 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
#define assert(e)  \
    (__builtin_expect(!(e), 0) ? __assert (#e, __FILE__, __LINE__) : (void)0)
#endif /* __DARWIN_UNIX03 */
# 98 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

#endif /* __GNUC__ */
# 100 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
#endif /* NDEBUG */
# 101 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
# 22 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 25 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 3
#endif
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 3
# 452 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 2 3
#endif
# 453 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifdef min
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro min is incompatible with C++.  Try #define NOMINMAX "
#warning: macro max is incompatible with C++.  #undefing max
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
#endif
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 455 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 458 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
#endif
# 459 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

_LIBCPP_BEGIN_NAMESPACE_STD

// fpos

template <class _StateT>
class _LIBCPP_TYPE_VIS_ONLY fpos
{
private:
    _StateT __st_;
    streamoff __off_;
public:
    _LIBCPP_INLINE_VISIBILITY fpos(streamoff __off = streamoff()) : __st_(), __off_(__off) {}

    _LIBCPP_INLINE_VISIBILITY operator streamoff() const {return __off_;}

    _LIBCPP_INLINE_VISIBILITY _StateT state() const {return __st_;}
    _LIBCPP_INLINE_VISIBILITY void state(_StateT __st) {__st_ = __st;}

    _LIBCPP_INLINE_VISIBILITY fpos& operator+=(streamoff __off) {__off_ += __off; return *this;}
    _LIBCPP_INLINE_VISIBILITY fpos  operator+ (streamoff __off) const {fpos __t(*this); __t += __off; return __t;}
    _LIBCPP_INLINE_VISIBILITY fpos& operator-=(streamoff __off) {__off_ -= __off; return *this;}
    _LIBCPP_INLINE_VISIBILITY fpos  operator- (streamoff __off) const {fpos __t(*this); __t -= __off; return __t;}
};







// char_traits

template <class _CharT>
struct _LIBCPP_TYPE_VIS_ONLY char_traits
{
    typedef _CharT    char_type;
    typedef int       int_type;
    typedef streamoff off_type;
    typedef streampos pos_type;
    typedef mbstate_t state_type;

    _LIBCPP_INLINE_VISIBILITY
    static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
        {__c1 = __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
        {return __c1 == __c2;}
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type  to_int_type(char_type __c) _NOEXCEPT
        {return int_type(__c);}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool      eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
        {return __c1 == __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type  eof() _NOEXCEPT
        {return int_type(EOF);}
};













// char_traits<char>

template <>
struct _LIBCPP_TYPE_VIS_ONLY char_traits<char>
{
    typedef char      char_type;
    typedef int       int_type;
    typedef streamoff off_type;
    typedef streampos pos_type;
    static size_t length(const char_type* __s) {return strlen(__s);}
    _LIBCPP_INLINE_VISIBILITY
    static const char_type* find(const char_type* __s, size_t __n, const char_type& __a)
        {return (const char_type*)memchr(__s, to_int_type(__a), __n);}
    _LIBCPP_INLINE_VISIBILITY
    static char_type* move(char_type* __s1, const char_type* __s2, size_t __n)
        {return (char_type*)memmove(__s1, __s2, __n);}
    _LIBCPP_INLINE_VISIBILITY
    static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n)
        {
            _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
            return (char_type*)memcpy(__s1, __s2, __n);
        }
    _LIBCPP_INLINE_VISIBILITY
    static char_type* assign(char_type* __s, size_t __n, char_type __a)
        {return (char_type*)memset(__s, to_int_type(__a), __n);}

    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
        {return eq_int_type(__c, eof()) ? ~eof() : __c;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
        {return char_type(__c);}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
        {return int_type((unsigned char)__c);}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
        {return __c1 == __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type  eof() _NOEXCEPT
        {return int_type(EOF);}
};

// char_traits<wchar_t>

template <>
struct _LIBCPP_TYPE_VIS_ONLY char_traits<wchar_t>
{
    typedef wchar_t   char_type;
    typedef wint_t    int_type;
    typedef streamoff off_type;
    typedef streampos pos_type;
    typedef mbstate_t state_type;

    _LIBCPP_INLINE_VISIBILITY
    static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
        {__c1 = __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
        {return __c1 == __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
        {return __c1 < __c2;}

    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
        {return __c1 == __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
        {return int_type(WEOF);}
};

#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS

template <>
struct _LIBCPP_TYPE_VIS_ONLY char_traits<char16_t>
{
    typedef char16_t       char_type;
    typedef uint_least16_t int_type;
    typedef streamoff      off_type;
    typedef u16streampos   pos_type;
    typedef mbstate_t      state_type;

    _LIBCPP_INLINE_VISIBILITY
    static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
        {__c1 = __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
        {return __c1 == __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
        {return __c1 < __c2;}

    static int              compare(const char_type* __s1, const char_type* __s2, size_t __n);
    static size_t           length(const char_type* __s);
    static const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
    static char_type*       move(char_type* __s1, const char_type* __s2, size_t __n);
    static char_type*       copy(char_type* __s1, const char_type* __s2, size_t __n);
    static char_type*       assign(char_type* __s, size_t __n, char_type __a);

    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
        {return eq_int_type(__c, eof()) ? ~eof() : __c;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
        {return char_type(__c);}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
        {return int_type(__c);}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
        {return __c1 == __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
        {return int_type(0xDFFF);}
};

inline _LIBCPP_INLINE_VISIBILITY
int
char_traits<char16_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
{
    for (; __n; --__n, ++__s1, ++__s2)
    {
        if (lt(*__s1, *__s2))
            return -1;
        if (lt(*__s2, *__s1))
            return 1;
    }
    return 0;
}

inline _LIBCPP_INLINE_VISIBILITY
size_t
char_traits<char16_t>::length(const char_type* __s)
{
    size_t __len = 0;
    for (; !eq(*__s, char_type(0)); ++__s)
        ++__len;
    return __len;
}

inline _LIBCPP_INLINE_VISIBILITY
const char16_t*
char_traits<char16_t>::find(const char_type* __s, size_t __n, const char_type& __a)
{
    for (; __n; --__n)
    {
        if (eq(*__s, __a))
            return __s;
        ++__s;
    }
    return 0;
}

inline _LIBCPP_INLINE_VISIBILITY
char16_t*
char_traits<char16_t>::move(char_type* __s1, const char_type* __s2, size_t __n)
{
    char_type* __r = __s1;
    if (__s1 < __s2)
    {
        for (; __n; --__n, ++__s1, ++__s2)
            assign(*__s1, *__s2);
    }
    else if (__s2 < __s1)
    {
        __s1 += __n;
        __s2 += __n;
        for (; __n; --__n)
            assign(*--__s1, *--__s2);
    }
    return __r;
}

inline _LIBCPP_INLINE_VISIBILITY
char16_t*
char_traits<char16_t>::copy(char_type* __s1, const char_type* __s2, size_t __n)
{
    _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
    char_type* __r = __s1;
    for (; __n; --__n, ++__s1, ++__s2)
        assign(*__s1, *__s2);
    return __r;
}

inline _LIBCPP_INLINE_VISIBILITY
char16_t*
char_traits<char16_t>::assign(char_type* __s, size_t __n, char_type __a)
{
    char_type* __r = __s;
    for (; __n; --__n, ++__s)
        assign(*__s, __a);
    return __r;
}

template <>
struct _LIBCPP_TYPE_VIS_ONLY char_traits<char32_t>
{
    typedef char32_t       char_type;
    typedef uint_least32_t int_type;
    typedef streamoff      off_type;
    typedef u32streampos   pos_type;
    typedef mbstate_t      state_type;

    _LIBCPP_INLINE_VISIBILITY
    static void assign(char_type& __c1, const char_type& __c2) _NOEXCEPT
        {__c1 = __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool eq(char_type __c1, char_type __c2) _NOEXCEPT
        {return __c1 == __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool lt(char_type __c1, char_type __c2) _NOEXCEPT
        {return __c1 < __c2;}

    static int              compare(const char_type* __s1, const char_type* __s2, size_t __n);
    static size_t           length(const char_type* __s);
    static const char_type* find(const char_type* __s, size_t __n, const char_type& __a);
    static char_type*       move(char_type* __s1, const char_type* __s2, size_t __n);
    static char_type*       copy(char_type* __s1, const char_type* __s2, size_t __n);
    static char_type*       assign(char_type* __s, size_t __n, char_type __a);

    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type  not_eof(int_type __c) _NOEXCEPT
        {return eq_int_type(__c, eof()) ? ~eof() : __c;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR char_type to_char_type(int_type __c) _NOEXCEPT
        {return char_type(__c);}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type to_int_type(char_type __c) _NOEXCEPT
        {return int_type(__c);}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR bool eq_int_type(int_type __c1, int_type __c2) _NOEXCEPT
        {return __c1 == __c2;}
    _LIBCPP_INLINE_VISIBILITY
    static _LIBCPP_CONSTEXPR int_type eof() _NOEXCEPT
        {return int_type(0xFFFFFFFF);}
};

inline _LIBCPP_INLINE_VISIBILITY
int
char_traits<char32_t>::compare(const char_type* __s1, const char_type* __s2, size_t __n)
{
    for (; __n; --__n, ++__s1, ++__s2)
    {
        if (lt(*__s1, *__s2))
            return -1;
        if (lt(*__s2, *__s1))
            return 1;
    }
    return 0;
}

inline _LIBCPP_INLINE_VISIBILITY
size_t
char_traits<char32_t>::length(const char_type* __s)
{
    size_t __len = 0;
    for (; !eq(*__s, char_type(0)); ++__s)
        ++__len;
    return __len;
}

inline _LIBCPP_INLINE_VISIBILITY
const char32_t*
char_traits<char32_t>::find(const char_type* __s, size_t __n, const char_type& __a)
{
    for (; __n; --__n)
    {
        if (eq(*__s, __a))
            return __s;
        ++__s;
    }
    return 0;
}

inline _LIBCPP_INLINE_VISIBILITY
char32_t*
char_traits<char32_t>::move(char_type* __s1, const char_type* __s2, size_t __n)
{
    char_type* __r = __s1;
    if (__s1 < __s2)
    {
        for (; __n; --__n, ++__s1, ++__s2)
            assign(*__s1, *__s2);
    }
    else if (__s2 < __s1)
    {
        __s1 += __n;
        __s2 += __n;
        for (; __n; --__n)
            assign(*--__s1, *--__s2);
    }
    return __r;
}

inline _LIBCPP_INLINE_VISIBILITY
char32_t*
char_traits<char32_t>::copy(char_type* __s1, const char_type* __s2, size_t __n)
{
    _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
    char_type* __r = __s1;
    for (; __n; --__n, ++__s1, ++__s2)
        assign(*__s1, *__s2);
    return __r;
}

inline _LIBCPP_INLINE_VISIBILITY
char32_t*
char_traits<char32_t>::assign(char_type* __s, size_t __n, char_type __a)
{
    char_type* __r = __s;
    for (; __n; --__n, ++__s)
        assign(*__s, __a);
    return __r;
}

#endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
# 990 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

// helper fns for basic_string

template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_INLINE_VISIBILITY __find_first_of(const _CharT *__p, _SizeT __sz,
    const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
{
    if (__pos >= __sz || __n == 0)
        return __npos;
    const _CharT* __r = _VSTD::find_first_of
        (__p + __pos, __p + __sz, __s, __s + __n, _Traits::eq );
    if (__r == __p + __sz)
        return __npos;
    return static_cast<_SizeT>(__r - __p);
}

template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_INLINE_VISIBILITY __find_last_of(const _CharT *__p, _SizeT __sz,
    const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
    {
    if (__n != 0)
    {
        if (__pos < __sz)
            ++__pos;
        else
            __pos = __sz;
        for (const _CharT* __ps = __p + __pos; __ps != __p;)
        {
            const _CharT* __r = _Traits::find(__s, __n, *--__ps);
            if (__r)
                return static_cast<_SizeT>(__ps - __p);
        }
    }
    return __npos;
}


template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_INLINE_VISIBILITY __find_first_not_of(const _CharT *__p, _SizeT __sz,
    const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
{
    if (__pos < __sz)
    {
        const _CharT* __pe = __p + __sz;
        for (const _CharT* __ps = __p + __pos; __ps != __pe; ++__ps)
            if (_Traits::find(__s, __n, *__ps) == 0)
                return static_cast<_SizeT>(__ps - __p);
    }
    return __npos;
}





template<class _CharT, class _SizeT, class _Traits, _SizeT __npos>
_SizeT _LIBCPP_INLINE_VISIBILITY __find_last_not_of(const _CharT *__p, _SizeT __sz,
        const _CharT* __s, _SizeT __pos, _SizeT __n) _NOEXCEPT
{
    if (__pos < __sz)
        ++__pos;
    else
        __pos = __sz;
    for (const _CharT* __ps = __p + __pos; __ps != __p;)
        if (_Traits::find(__s, __n, *--__ps) == 0)
            return static_cast<_SizeT>(__ps - __p);
    return __npos;
}




template<class _Ptr>
size_t _LIBCPP_INLINE_VISIBILITY __do_string_hash(_Ptr __p, _Ptr __e)
{
    typedef typename iterator_traits<_Ptr>::value_type value_type;
    return __murmur2_or_cityhash<size_t>()(__p, (__e-__p)*sizeof(value_type));
}

// basic_string

template<class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x,
          const basic_string<_CharT, _Traits, _Allocator>& __y);

template<class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>
operator+(const _CharT* __x, const basic_string<_CharT,_Traits,_Allocator>& __y);

template<class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>
operator+(_CharT __x, const basic_string<_CharT,_Traits,_Allocator>& __y);

template<class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const _CharT* __y);

template<class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y);

template <bool>
class _LIBCPP_TYPE_VIS_ONLY __basic_string_common
{
protected:
    void __throw_length_error() const;
    ;
};

template <bool __b>
void
__basic_string_common<__b>::__throw_length_error() const
{
#ifndef _LIBCPP_NO_EXCEPTIONS
    throw length_error("basic_string");
#else
# 1131 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    assert(!"basic_string length_error");
#endif
# 1133 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}



#ifdef _LIBCPP_MSVC
#pragma warning( push )
#pragma warning( disable: 4231 )
#endif // _LIBCPP_MSVC
# 1150 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS __basic_string_common<true>)
#ifdef _LIBCPP_MSVC
#pragma warning( pop )
#endif // _LIBCPP_MSVC
# 1154 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT

template <class _CharT, size_t = sizeof(_CharT)>
struct __padding
{
    unsigned char __xx[sizeof(_CharT)-1];
};

template <class _CharT>
struct __padding<_CharT, 1>
{
};

#endif  // _LIBCPP_ALTERNATE_STRING_LAYOUT
# 1169 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

template<class _CharT, class _Traits, class _Allocator>
class _LIBCPP_TYPE_VIS_ONLY basic_string
    : private __basic_string_common<true>
{
public:
    typedef basic_string                                 __self;
    typedef _Traits                                      traits_type;
    typedef typename traits_type::char_type              value_type;
    typedef _Allocator                                   allocator_type;
    typedef allocator_traits<allocator_type>             __alloc_traits;
    typedef typename __alloc_traits::size_type           size_type;
    typedef typename __alloc_traits::difference_type     difference_type;
    typedef value_type&                                  reference;
    typedef const value_type&                            const_reference;
    typedef typename __alloc_traits::pointer             pointer;
    typedef typename __alloc_traits::const_pointer       const_pointer;

    static_assert(is_pod<value_type>::value, "Character type of basic_string must be a POD");
    static_assert((is_same<_CharT, value_type>::value),
                  "traits_type::char_type must be the same type as CharT");
    static_assert((is_same<typename allocator_type::value_type, value_type>::value),
                  "Allocator::value_type must be same type as value_type");
#if defined(_LIBCPP_RAW_ITERATORS)
    typedef pointer                                      iterator;
    typedef const_pointer                                const_iterator;
#else  // defined(_LIBCPP_RAW_ITERATORS)
# 1196 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    typedef __wrap_iter<pointer>                         iterator;
    typedef __wrap_iter<const_pointer>                   const_iterator;
#endif  // defined(_LIBCPP_RAW_ITERATORS)
# 1199 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    typedef _VSTD::reverse_iterator<iterator>             reverse_iterator;
    typedef _VSTD::reverse_iterator<const_iterator>       const_reverse_iterator;

private:

#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT

    struct __long
    {
        pointer   __data_;
        size_type __size_;
        size_type __cap_;
    };

#if _LIBCPP_BIG_ENDIAN
    enum {__short_mask = 0x01};
    enum {__long_mask  = 0x1ul};
#else  // _LIBCPP_BIG_ENDIAN
# 1217 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    enum {__short_mask = 0x80};
    enum {__long_mask  = ~(size_type(~0) >> 1)};
#endif  // _LIBCPP_BIG_ENDIAN
# 1220 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?
                      (sizeof(__long) - 1)/sizeof(value_type) : 2};

    struct __short
    {
        value_type __data_[__min_cap];
        struct
            : __padding<value_type>
        {
            unsigned char __size_;
        };
    };

#else
# 1235 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    struct __long
    {
        size_type __cap_;
        size_type __size_;
        pointer   __data_;
    };

#if _LIBCPP_BIG_ENDIAN
    enum {__short_mask = 0x80};
    enum {__long_mask  = ~(size_type(~0) >> 1)};
#else  // _LIBCPP_BIG_ENDIAN
# 1247 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    enum {__short_mask = 0x01};
    enum {__long_mask  = 0x1ul};
#endif  // _LIBCPP_BIG_ENDIAN
# 1250 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ?
                      (sizeof(__long) - 1)/sizeof(value_type) : 2};

    struct __short
    {
        union
        {
            unsigned char __size_;
            value_type __lx;
        };
        value_type __data_[__min_cap];
    };

#endif  // _LIBCPP_ALTERNATE_STRING_LAYOUT
# 1265 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    union __ulx{__long __lx; __short __lxx;};

    enum {__n_words = sizeof(__ulx) / sizeof(size_type)};

    struct __raw
    {
        size_type __words[__n_words];
    };

    struct __rep
    {
        union
        {
            __long  __l;
            __short __s;
            __raw   __r;
        };
    };

    __compressed_pair<__rep, allocator_type> __r_;

public:
    static const size_type npos = -1;

    _LIBCPP_INLINE_VISIBILITY basic_string()
        _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
    _LIBCPP_INLINE_VISIBILITY explicit basic_string(const allocator_type& __a);
    basic_string(const basic_string& __str);
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    basic_string(basic_string&& __str)
        _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
    _LIBCPP_INLINE_VISIBILITY
    basic_string(basic_string&& __str, const allocator_type& __a);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1302 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    _LIBCPP_INLINE_VISIBILITY basic_string(const value_type* __s);
    _LIBCPP_INLINE_VISIBILITY
    basic_string(const value_type* __s, const allocator_type& __a);
    _LIBCPP_INLINE_VISIBILITY
    basic_string(const value_type* __s, size_type __n);
    _LIBCPP_INLINE_VISIBILITY
    basic_string(const value_type* __s, size_type __n, const allocator_type& __a);
    _LIBCPP_INLINE_VISIBILITY
    basic_string(size_type __n, value_type __c);
    _LIBCPP_INLINE_VISIBILITY
    basic_string(size_type __n, value_type __c, const allocator_type& __a);
    ;
    template<class _InputIterator>
        _LIBCPP_INLINE_VISIBILITY
        basic_string(_InputIterator __first, _InputIterator __last);
    template<class _InputIterator>
        _LIBCPP_INLINE_VISIBILITY
        basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    basic_string(initializer_list<value_type> __il);
    _LIBCPP_INLINE_VISIBILITY
    basic_string(initializer_list<value_type> __il, const allocator_type& __a);
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1327 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    ~basic_string();

    basic_string& operator=(const basic_string& __str);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    basic_string& operator=(basic_string&& __str)
        _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
                   is_nothrow_move_assignable<allocator_type>::value);
#endif
# 1337 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1343 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_INLINE_VISIBILITY
    iterator begin() _NOEXCEPT
        {return iterator(this, __get_pointer());}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator begin() const _NOEXCEPT
        {return const_iterator(this, __get_pointer());}
    _LIBCPP_INLINE_VISIBILITY
    iterator end() _NOEXCEPT
        {return iterator(this, __get_pointer() + size());}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator end() const _NOEXCEPT
        {return const_iterator(this, __get_pointer() + size());}
#else
# 1358 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    _LIBCPP_INLINE_VISIBILITY
    iterator begin() _NOEXCEPT
        {return iterator(__get_pointer());}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator begin() const _NOEXCEPT
        {return const_iterator(__get_pointer());}
    _LIBCPP_INLINE_VISIBILITY
    iterator end() _NOEXCEPT
        {return iterator(__get_pointer() + size());}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator end() const _NOEXCEPT
        {return const_iterator(__get_pointer() + size());}
#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 1371 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    _LIBCPP_INLINE_VISIBILITY
    reverse_iterator rbegin() _NOEXCEPT
        {return reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rbegin() const _NOEXCEPT
        {return const_reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
    reverse_iterator rend() _NOEXCEPT
        {return reverse_iterator(begin());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rend() const _NOEXCEPT
        {return const_reverse_iterator(begin());}

    _LIBCPP_INLINE_VISIBILITY
    const_iterator cbegin() const _NOEXCEPT
        {return begin();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator cend() const _NOEXCEPT
        {return end();}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crbegin() const _NOEXCEPT
        {return rbegin();}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crend() const _NOEXCEPT
        {return rend();}

    _LIBCPP_INLINE_VISIBILITY size_type size() const _NOEXCEPT
        {return __is_long() ? __get_long_size() : __get_short_size();}
    _LIBCPP_INLINE_VISIBILITY size_type length() const _NOEXCEPT {return size();}
    _LIBCPP_INLINE_VISIBILITY size_type max_size() const _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY size_type capacity() const _NOEXCEPT
        {return (__is_long() ? __get_long_cap() : __min_cap) - 1;}

    void resize(size_type __n, value_type __c);
    _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}

    void reserve(size_type res_arg = 0);
    _LIBCPP_INLINE_VISIBILITY
    void shrink_to_fit() _NOEXCEPT {reserve();}
    _LIBCPP_INLINE_VISIBILITY
    void clear() _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY bool empty() const _NOEXCEPT {return size() == 0;}

    _LIBCPP_INLINE_VISIBILITY const_reference operator[](size_type __pos) const;
    _LIBCPP_INLINE_VISIBILITY reference       operator[](size_type __pos);

    ;
    ;

    _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const basic_string& __str) {return append(__str);}
    _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const value_type* __s)         {return append(__s);}
    _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c)            {push_back(__c); return *this;}
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(initializer_list<value_type> __il) {return append(__il);}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1426 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    _LIBCPP_INLINE_VISIBILITY
    basic_string& append(const basic_string& __str);
    ;
    basic_string& append(const value_type* __s, size_type __n);
    basic_string& append(const value_type* __s);
    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1452 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    void push_back(value_type __c);
    _LIBCPP_INLINE_VISIBILITY
    void pop_back();
    _LIBCPP_INLINE_VISIBILITY reference       front();
    _LIBCPP_INLINE_VISIBILITY const_reference front() const;
    _LIBCPP_INLINE_VISIBILITY reference       back();
    _LIBCPP_INLINE_VISIBILITY const_reference back() const;

    _LIBCPP_INLINE_VISIBILITY
    basic_string& assign(const basic_string& __str);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    basic_string& assign(basic_string&& str)
        {*this = _VSTD::move(str); return *this;}
#endif
# 1468 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    ;
    ;
    ;
    ;
    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    iterator insert(const_iterator __pos, initializer_list<value_type> __il)
                    {return insert(__pos, __il.begin(), __il.end());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1521 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    ;
    _LIBCPP_INLINE_VISIBILITY
    iterator      erase(const_iterator __pos);
    _LIBCPP_INLINE_VISIBILITY
    iterator      erase(const_iterator __first, const_iterator __last);

    _LIBCPP_INLINE_VISIBILITY
    basic_string& replace(size_type __pos1, size_type __n1, const basic_string& __str);
    ;
    ;
    ;
    ;
    _LIBCPP_INLINE_VISIBILITY
    basic_string& replace(const_iterator __i1, const_iterator __i2, const basic_string& __str);
    _LIBCPP_INLINE_VISIBILITY
    basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s, size_type __n);
    _LIBCPP_INLINE_VISIBILITY
    basic_string& replace(const_iterator __i1, const_iterator __i2, const value_type* __s);
    _LIBCPP_INLINE_VISIBILITY
    basic_string& replace(const_iterator __i1, const_iterator __i2, size_type __n, value_type __c);
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list<value_type> __il)
        {return replace(__i1, __i2, __il.begin(), __il.end());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1554 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    ;
    _LIBCPP_INLINE_VISIBILITY
    basic_string substr(size_type __pos = 0, size_type __n = npos) const;

    _LIBCPP_INLINE_VISIBILITY
    void swap(basic_string& __str)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<allocator_type>::value);

    _LIBCPP_INLINE_VISIBILITY
    const value_type* c_str() const _NOEXCEPT {return data();}
    _LIBCPP_INLINE_VISIBILITY
    const value_type* data() const _NOEXCEPT  {return _VSTD::__to_raw_pointer(__get_pointer());}

    _LIBCPP_INLINE_VISIBILITY
    allocator_type get_allocator() const _NOEXCEPT {return __alloc();}

    _LIBCPP_INLINE_VISIBILITY
    size_type find(const basic_string& __str, size_type __pos = 0) const _NOEXCEPT;
    size_type find(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY
    size_type find(const value_type* __s, size_type __pos = 0) const _NOEXCEPT;
    size_type find(value_type __c, size_type __pos = 0) const _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY
    size_type rfind(const basic_string& __str, size_type __pos = npos) const _NOEXCEPT;
    size_type rfind(const value_type* __s, size_type __pos, size_type __n) const _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY
    bool __is_long() const _NOEXCEPT
        {return bool(__r_.first().__s.__size_ & __short_mask);}

#if _LIBCPP_DEBUG_LEVEL >= 2

    bool __dereferenceable(const const_iterator* __i) const;
    bool __decrementable(const const_iterator* __i) const;
    bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
    bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 1641 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

private:
    _LIBCPP_INLINE_VISIBILITY
    allocator_type& __alloc() _NOEXCEPT
        {return __r_.second();}
    _LIBCPP_INLINE_VISIBILITY
    const allocator_type& __alloc() const _NOEXCEPT
        {return __r_.second();}

#ifdef _LIBCPP_ALTERNATE_STRING_LAYOUT

    _LIBCPP_INLINE_VISIBILITY
    void __set_short_size(size_type __s) _NOEXCEPT
#   if _LIBCPP_BIG_ENDIAN
        {__r_.first().__s.__size_ = (unsigned char)(__s << 1);}
#   else
# 1657 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
        {__r_.first().__s.__size_ = (unsigned char)(__s);}
#   endif
# 1659 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    _LIBCPP_INLINE_VISIBILITY
    size_type __get_short_size() const _NOEXCEPT
#   if _LIBCPP_BIG_ENDIAN
        {return __r_.first().__s.__size_ >> 1;}
#   else
# 1665 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
        {return __r_.first().__s.__size_;}
#   endif
# 1667 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

#else  // _LIBCPP_ALTERNATE_STRING_LAYOUT
# 1669 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    _LIBCPP_INLINE_VISIBILITY
    void __set_short_size(size_type __s) _NOEXCEPT
#   if _LIBCPP_BIG_ENDIAN
        {__r_.first().__s.__size_ = (unsigned char)(__s);}
#   else
# 1675 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
        {__r_.first().__s.__size_ = (unsigned char)(__s << 1);}
#   endif
# 1677 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    _LIBCPP_INLINE_VISIBILITY
    size_type __get_short_size() const _NOEXCEPT
#   if _LIBCPP_BIG_ENDIAN
        {return __r_.first().__s.__size_;}
#   else
# 1683 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
        {return __r_.first().__s.__size_ >> 1;}
#   endif
# 1685 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

#endif  // _LIBCPP_ALTERNATE_STRING_LAYOUT
# 1687 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    _LIBCPP_INLINE_VISIBILITY
    void __set_long_size(size_type __s) _NOEXCEPT
        {__r_.first().__l.__size_ = __s;}
    _LIBCPP_INLINE_VISIBILITY
    size_type __get_long_size() const _NOEXCEPT
        {return __r_.first().__l.__size_;}
    _LIBCPP_INLINE_VISIBILITY
    void __set_size(size_type __s) _NOEXCEPT
        {if (__is_long()) __set_long_size(__s); else __set_short_size(__s);}

    _LIBCPP_INLINE_VISIBILITY
    void __set_long_cap(size_type __s) _NOEXCEPT
        {__r_.first().__l.__cap_  = __long_mask | __s;}
    _LIBCPP_INLINE_VISIBILITY
    size_type __get_long_cap() const _NOEXCEPT
        {return __r_.first().__l.__cap_ & size_type(~__long_mask);}

    _LIBCPP_INLINE_VISIBILITY
    void __set_long_pointer(pointer __p) _NOEXCEPT
        {__r_.first().__l.__data_ = __p;}
    _LIBCPP_INLINE_VISIBILITY
    pointer __get_long_pointer() _NOEXCEPT
        {return __r_.first().__l.__data_;}
    _LIBCPP_INLINE_VISIBILITY
    const_pointer __get_long_pointer() const _NOEXCEPT
        {return __r_.first().__l.__data_;}
    _LIBCPP_INLINE_VISIBILITY
    pointer __get_short_pointer() _NOEXCEPT
        {return pointer_traits<pointer>::pointer_to(__r_.first().__s.__data_[0]);}
    _LIBCPP_INLINE_VISIBILITY
    const_pointer __get_short_pointer() const _NOEXCEPT
        {return pointer_traits<const_pointer>::pointer_to(__r_.first().__s.__data_[0]);}
    _LIBCPP_INLINE_VISIBILITY
    pointer __get_pointer() _NOEXCEPT
        {return __is_long() ? __get_long_pointer() : __get_short_pointer();}
    _LIBCPP_INLINE_VISIBILITY
    const_pointer __get_pointer() const _NOEXCEPT
        {return __is_long() ? __get_long_pointer() : __get_short_pointer();}

    _LIBCPP_INLINE_VISIBILITY
    void __zero() _NOEXCEPT
        {
            size_type (&__a)[__n_words] = __r_.first().__r.__words;
            for (unsigned __i = 0; __i < __n_words; ++__i)
                __a[__i] = 0;
        }

    template <size_type __a> static
        _LIBCPP_INLINE_VISIBILITY
        size_type __align_it(size_type __s) _NOEXCEPT
            {return __s + (__a-1) & ~(__a-1);}
    enum {__alignment = 16};
    static _LIBCPP_INLINE_VISIBILITY
    size_type __recommend(size_type __s) _NOEXCEPT
        {return (__s < __min_cap ? __min_cap :
                 __align_it<sizeof(value_type) < __alignment ?
                            __alignment/sizeof(value_type) : 1 > (__s+1)) - 1;}

    ;
    void __init(const value_type* __s, size_type __sz);
    void __init(size_type __n, value_type __c);

    ;

    template <class _ForwardIterator>
    typename enable_if
    <
        __is_forward_iterator<_ForwardIterator>::value,
        void
    >::type
    __init(_ForwardIterator __first, _ForwardIterator __last);

    void __grow_by(size_type __old_cap, size_type __delta_cap, size_type __old_sz,
                   size_type __n_copy,  size_type __n_del,     size_type __n_add = 0);
    void __grow_by_and_replace(size_type __old_cap, size_type __delta_cap, size_type __old_sz,
                               size_type __n_copy,  size_type __n_del,
                               size_type __n_add, const value_type* __p_new_stuff);

    _LIBCPP_INLINE_VISIBILITY
    void __erase_to_end(size_type __pos);

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const basic_string& __str)
        {__copy_assign_alloc(__str, integral_constant<bool,
                      __alloc_traits::propagate_on_container_copy_assignment::value>());}

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const basic_string& __str, true_type)
        {
            if (__alloc() != __str.__alloc())
            {
                clear();
                shrink_to_fit();
            }
            __alloc() = __str.__alloc();
        }

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const basic_string&, false_type) _NOEXCEPT
        {}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    void __move_assign(basic_string& __str, false_type);
    _LIBCPP_INLINE_VISIBILITY
    void __move_assign(basic_string& __str, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
#endif
# 1803 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

    _LIBCPP_INLINE_VISIBILITY
    void
    __move_assign_alloc(basic_string& __str)
        _NOEXCEPT_(
            !__alloc_traits::propagate_on_container_move_assignment::value ||
            is_nothrow_move_assignable<allocator_type>::value)
    {__move_assign_alloc(__str, integral_constant<bool,
                      __alloc_traits::propagate_on_container_move_assignment::value>());}

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(basic_string& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
        {
            __alloc() = _VSTD::move(__c.__alloc());
        }

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(basic_string&, false_type)
        _NOEXCEPT
        {}

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(allocator_type& __x, allocator_type& __y)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<allocator_type>::value)
        {__swap_alloc(__x, __y, integral_constant<bool,
                      __alloc_traits::propagate_on_container_swap::value>());}

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
        _NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
        {
            using _VSTD::swap;
            swap(__x, __y);
        }
    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(allocator_type&, allocator_type&, false_type) _NOEXCEPT
        {}

    _LIBCPP_INLINE_VISIBILITY void __invalidate_all_iterators();
    _LIBCPP_INLINE_VISIBILITY void __invalidate_iterators_past(size_type);

    friend basic_string operator+<>(const basic_string&, const basic_string&);
    friend basic_string operator+<>(const value_type*, const basic_string&);
    friend basic_string operator+<>(value_type, const basic_string&);
    friend basic_string operator+<>(const basic_string&, const value_type*);
    friend basic_string operator+<>(const basic_string&, value_type);
};

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
basic_string<_CharT, _Traits, _Allocator>::__invalidate_all_iterators()
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__invalidate_all(this);
#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 1861 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
basic_string<_CharT, _Traits, _Allocator>::__invalidate_iterators_past(size_type
#if _LIBCPP_DEBUG_LEVEL >= 2
                                                                        __pos
#endif
# 1870 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
                                                                      )
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __c_node* __c = __get_db()->__find_c_and_lock(this);
    if (__c)
    {
        const_pointer __new_last = __get_pointer() + __pos;
        for (__i_node** __p = __c->end_; __p != __c->beg_; )
        {
            --__p;
            const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
            if (__i->base() > __new_last)
            {
                (*__p)->__c_ = nullptr;
                if (--__c->end_ != __p)
                    memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
            }
        }
        __get_db()->unlock();
    }
#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 1891 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, const allocator_type& __a)
    : __r_(__a)
{
    _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
    __init(__s, traits_type::length(__s));
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1984 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, size_type __n)
{
    _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
    __init(__s, __n);
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1995 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(const value_type* __s, size_type __n, const allocator_type& __a)
    : __r_(__a)
{
    _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
    __init(__s, __n);
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 2007 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}

template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str)
    : __r_(__alloc_traits::select_on_container_copy_construction(__str.__alloc()))
{
    if (!__str.__is_long())
        __r_.first().__r = __str.__r_.first().__r;
    else
        __init(_VSTD::__to_raw_pointer(__str.__get_long_pointer()), __str.__get_long_size());
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 2020 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}



#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str)
        _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
    : __r_(_VSTD::move(__str.__r_))
{
#endif
# 2102 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, value_type __c, const allocator_type& __a)
    : __r_(__a)
{
    __init(__n, __c);
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 2113 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}





template <class _CharT, class _Traits, class _Allocator>
template <class _ForwardIterator>
typename enable_if
<
    __is_forward_iterator<_ForwardIterator>::value,
    void
>::type
basic_string<_CharT, _Traits, _Allocator>::__init(_ForwardIterator __first, _ForwardIterator __last)
{
    size_type __sz = static_cast<size_type>(_VSTD::distance(__first, __last));
    if (__sz > max_size())
        this->__throw_length_error();
    pointer __p;
    if (__sz < __min_cap)
    {
        __set_short_size(__sz);
        __p = __get_short_pointer();
    }
    else
    {
        size_type __cap = __recommend(__sz);
        __p = __alloc_traits::allocate(__alloc(), __cap+1);
        __set_long_pointer(__p);
        __set_long_cap(__cap+1);
        __set_long_size(__sz);
    }
    for (; __first != __last; ++__first, ++__p)
        traits_type::assign(*__p, *__first);
    traits_type::assign(*__p, value_type());
}

template <class _CharT, class _Traits, class _Allocator>
template<class _InputIterator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last)
{
    __init(__first, __last);
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 2197 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}

template <class _CharT, class _Traits, class _Allocator>
template<class _InputIterator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last,
                                                        const allocator_type& __a)
    : __r_(__a)
{
    __init(__first, __last);
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 2210 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}

#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>::basic_string(initializer_list<value_type> __il)
{
    __init(__il.begin(), __il.end());
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 2222 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}

template <class _CharT, class _Traits, class _Allocator>
void
basic_string<_CharT, _Traits, _Allocator>::__move_assign(basic_string& __str, true_type)
    _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
{
    clear();
    shrink_to_fit();
    __r_.first() = __str.__r_.first();
    __move_assign_alloc(__str);
    __str.__zero();
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::operator=(basic_string&& __str)
    _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
               is_nothrow_move_assignable<allocator_type>::value)
{
    __move_assign(__str, integral_constant<bool,
          __alloc_traits::propagate_on_container_move_assignment::value>());
    return *this;
}

#endif
# 2423 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3





template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(const basic_string& __str)
{
    return assign(__str.data(), __str.size());
}

template <class _CharT, class _Traits, class _Allocator>
void
basic_string<_CharT, _Traits, _Allocator>::push_back(value_type __c)
{
    bool __is_short = !__is_long();
    size_type __cap;
    size_type __sz;
    if (__is_short)
    {
        __cap = __min_cap - 1;
        __sz = __get_short_size();
    }
    else
    {
        __cap = __get_long_cap() - 1;
        __sz = __get_long_size();
    }
    if (__sz == __cap)
    {
        __grow_by(__cap, 1, __sz, __sz, 0);
        __is_short = !__is_long();
    }
    pointer __p;
    if (__is_short)
    {
        __p = __get_short_pointer() + __sz;
        __set_short_size(__sz+1);
    }
    else
    {
        __p = __get_long_pointer() + __sz;
        __set_long_size(__sz+1);
    }
    traits_type::assign(*__p, __c);
    traits_type::assign(*++__p, value_type());
}





template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::append(const basic_string& __str)
{
    return append(__str.data(), __str.size());
}



template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s)
{
    _LIBCPP_ASSERT(__s != nullptr, "string::append recieved nullptr");
    return append(__s, traits_type::length(__s));
}

// insert




template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __pos)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__pos) == this,
        "string::erase(iterator) called with an iterator not"
        " referring to this string");
#endif
# 3051 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    _LIBCPP_ASSERT(__pos != end(),
        "string::erase(iterator) called with a non-dereferenceable iterator");
    iterator __b = begin();
    size_type __r = static_cast<size_type>(__pos - __b);
    erase(__r, 1);
    return __b + static_cast<difference_type>(__r);
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::iterator
basic_string<_CharT, _Traits, _Allocator>::erase(const_iterator __first, const_iterator __last)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__first) == this,
        "string::erase(iterator,  iterator) called with an iterator not"
        " referring to this string");
#endif
# 3069 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    _LIBCPP_ASSERT(__first <= __last, "string::erase(first, last) called with invalid range");
    iterator __b = begin();
    size_type __r = static_cast<size_type>(__first - __b);
    erase(__r, static_cast<size_type>(__last - __first));
    return __b + static_cast<difference_type>(__r);
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
basic_string<_CharT, _Traits, _Allocator>::pop_back()
{
    _LIBCPP_ASSERT(!empty(), "string::pop_back(): string is already empty");
    size_type __sz;
    if (__is_long())
    {
        __sz = __get_long_size() - 1;
        __set_long_size(__sz);
        traits_type::assign(*(__get_long_pointer() + __sz), value_type());
    }
    size_type __m = __alloc_traits::max_size(__alloc());
#if _LIBCPP_BIG_ENDIAN
    return (__m <= ~__long_mask ? __m : __m/2) - __alignment;
#else
# 3154 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
    return __m - __alignment;
#endif
# 3156 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
}

template <class _CharT, class _Traits, class _Allocator>
void
basic_string<_CharT, _Traits, _Allocator>::reserve(size_type __res_arg)
{
    if (__res_arg > max_size())
        this->__throw_length_error();
    size_type __cap = capacity();
    size_type __sz = size();
    __res_arg = _VSTD::max(__res_arg, __sz);
    __res_arg = __recommend(__res_arg);
    if (__res_arg != __cap)
    {
        pointer __new_data, __p;
        bool __was_long, __now_long;
        if (__res_arg == __min_cap - 1)
        {
            __was_long = true;
            __now_long = false;
            __new_data = __get_short_pointer();
            __p = __get_long_pointer();
        }
        else
        {
            if (__res_arg > __cap)
                __new_data = __alloc_traits::allocate(__alloc(), __res_arg+1);
            else
            {
            #ifndef _LIBCPP_NO_EXCEPTIONS
                try
                {
            #endif  // _LIBCPP_NO_EXCEPTIONS
# 3189 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
                    __new_data = __alloc_traits::allocate(__alloc(), __res_arg+1);
            #ifndef _LIBCPP_NO_EXCEPTIONS
                }
                catch (...)
                {
                    return;
                }
            #else  // _LIBCPP_NO_EXCEPTIONS
# 3197 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
                if (__new_data == nullptr)
                    return;
            #endif  // _LIBCPP_NO_EXCEPTIONS
# 3200 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3
            }
            __now_long = true;
            __was_long = __is_long();
            __p = __get_pointer();
        }
        traits_type::copy(_VSTD::__to_raw_pointer(__new_data),
                          _VSTD::__to_raw_pointer(__p), size()+1);
        if (__was_long)
            __alloc_traits::deallocate(__alloc(), __p, __cap+1);
        if (__now_long)
        {
            __set_long_cap(__res_arg+1);
            __set_long_size(__sz);
            __set_long_pointer(__new_data);
        }
        else
            __set_short_size(__sz);
        __invalidate_all_iterators();
    }
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::const_reference
basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos) const
{
    _LIBCPP_ASSERT(__pos <= size(), "string index out of bounds");
    return *(data() + __pos);
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::reference
basic_string<_CharT, _Traits, _Allocator>::operator[](size_type __pos)
{
    _LIBCPP_ASSERT(__pos <= size(), "string index out of bounds");
    return *(__get_pointer() + __pos);
}





template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::reference
basic_string<_CharT, _Traits, _Allocator>::front()
{
    _LIBCPP_ASSERT(!empty(), "string::front(): string is empty");
    return *__get_pointer();
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::const_reference
basic_string<_CharT, _Traits, _Allocator>::front() const
{
    _LIBCPP_ASSERT(!empty(), "string::front(): string is empty");
    return *data();
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::reference
basic_string<_CharT, _Traits, _Allocator>::back()
{
    _LIBCPP_ASSERT(!empty(), "string::back(): string is empty");
    return *(__get_pointer() + size() - 1);
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::const_reference
basic_string<_CharT, _Traits, _Allocator>::back() const
{
    _LIBCPP_ASSERT(!empty(), "string::back(): string is empty");
    return *(data() + size() - 1);
}

template <class _Traits>
struct _LIBCPP_HIDDEN __traits_eq
{
    typedef typename _Traits::char_type char_type;
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const char_type& __x, const char_type& __y) _NOEXCEPT
        {return _Traits::eq(__x, __y);}
};

template<class _CharT, class _Traits, class _Allocator>
typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
                                                size_type __pos,
                                                size_type __n) const _NOEXCEPT
{
    _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find(): recieved nullptr");
    size_type __sz = size();
    if (__pos > __sz || __sz - __pos < __n)
        return npos;
    if (__n == 0)
        return __pos;
    const value_type* __p = data();
    const value_type* __r = _VSTD::search(__p + __pos, __p + __sz, __s, __s + __n,
                                     __traits_eq<traits_type>());
    if (__r == __p + __sz)
        return npos;
    return static_cast<size_type>(__r - __p);
}

template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const basic_string& __str,
                                                size_type __pos) const _NOEXCEPT
{
    return find(__str.data(), __pos, __str.size());
}

template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
                                                size_type __pos) const _NOEXCEPT
{
    _LIBCPP_ASSERT(__s != nullptr, "string::find(): recieved nullptr");
    return find(__s, __pos, traits_type::length(__s));
}

template<class _CharT, class _Traits, class _Allocator>
typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::find(value_type __c,
                                                size_type __pos) const _NOEXCEPT
{
    size_type __sz = size();
    if (__pos >= __sz)
        return npos;
    const value_type* __p = data();
    const value_type* __r = traits_type::find(__p + __pos, __sz - __pos, __c);
    if (__r == 0)
        return npos;
    return static_cast<size_type>(__r - __p);
}

// rfind

template<class _CharT, class _Traits, class _Allocator>
typename basic_string<_CharT, _Traits, _Allocator>::size_type
basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,
                                                 size_type __pos,
                                                 size_type __n) const _NOEXCEPT
{
    _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::rfind(): recieved nullptr");
    size_type __sz = size();
    __pos = _VSTD::min(__pos, __sz);
    if (__n < __sz - __pos)
        __pos += __n;
    else
        __pos = __sz;
    const value_type* __p = data();
}

;

;

;

;


#if _LIBCPP_DEBUG_LEVEL >= 2

template<class _CharT, class _Traits, class _Allocator>
bool
basic_string<_CharT, _Traits, _Allocator>::__dereferenceable(const const_iterator* __i) const
{
    return this->data() <= _VSTD::__to_raw_pointer(__i->base()) &&
           _VSTD::__to_raw_pointer(__i->base()) < this->data() + this->size();
}

template<class _CharT, class _Traits, class _Allocator>
bool
basic_string<_CharT, _Traits, _Allocator>::__decrementable(const const_iterator* __i) const
{
    return this->data() < _VSTD::__to_raw_pointer(__i->base()) &&
    basic_string<char32_t> operator "" s( const char32_t *__str, size_t __len )
    {
        return basic_string<char32_t> (__str, __len);
    }
  }
}
#endif
# 4241 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string" 3

_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_string<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_string<wchar_t>)
_LIBCPP_EXTERN_TEMPLATE(string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&))

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_STRING
#ifndef _LIBCPP_SSTREAM
#define _LIBCPP_SSTREAM

/*
    sstream synopsis

template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
class basic_stringbuf
    : public basic_streambuf<charT, traits>
{
public:
    typedef charT                          char_type;
    typedef traits                         traits_type;
    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;
typedef basic_stringstream<char>    stringstream;
typedef basic_stringstream<wchar_t> wstringstream;

}  // std

*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 174 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3
#if 0 /* expanded by -frewrite-includes */
#include <ostream>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 1 3
// -*- C++ -*-
//===-------------------------- ostream -----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_OSTREAM
#define _LIBCPP_OSTREAM

/*

template<class charT, class traits>
  basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>&, char);
}  // std

*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 131 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
#if 0 /* expanded by -frewrite-includes */
#include <ios>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 1 3
// -*- C++ -*-
//===---------------------------- ios -------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_IOS
#define _LIBCPP_IOS

/*
    ios synopsis

#include <iosfwd>
{
    stream = 1
};
#endif /* expanded by -frewrite-includes */
# 216 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3
#if 0 /* expanded by -frewrite-includes */
#include <__locale>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP___LOCALE
#define _LIBCPP___LOCALE

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
#if 0 /* expanded by -frewrite-includes */
#include <memory>
#endif /* expanded by -frewrite-includes */
# 17 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
#if 0 /* expanded by -frewrite-includes */
#include <utility>
#endif /* expanded by -frewrite-includes */
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
#if 0 /* expanded by -frewrite-includes */
#include <mutex>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 1 3
// -*- C++ -*-
//===--------------------------- mutex ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_MUTEX
#define _LIBCPP_MUTEX

/*
    mutex synopsis

namespace std
{

class mutex
{
public:
     constexpr mutex() noexcept;
     ~mutex();

#include <__mutex_base>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP___MUTEX_BASE
#define _LIBCPP___MUTEX_BASE

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 3
#if 0 /* expanded by -frewrite-includes */
#include <chrono>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono" 1 3
// -*- C++ -*-
//===---------------------------- chrono ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CHRONO
#define _LIBCPP_CHRONO

/*
    chrono synopsis

namespace std
{
namespace chrono
{

template <class ToDuration, class Rep, class Period>
constexpr
ToDuration
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ctime" 1 3
// -*- C++ -*-
//===---------------------------- ctime -----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CTIME
#define _LIBCPP_CTIME

/*
typedef ratio<1000000000000000000000000, 1> yotta;  // not supported

}
*/

#ifdef min
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro min is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing min")
#else
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro min is incompatible with C++.  #undefing min
#endif
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef min
#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 77 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3
#endif
# 78 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3

_LIBCPP_BEGIN_NAMESPACE_STD

// __static_gcd

template <intmax_t _Xp, intmax_t _Yp>
struct __static_gcd
{
    static const intmax_t value = __static_gcd<_Yp, _Xp % _Yp>::value;
};

template <intmax_t _Xp>
struct __static_gcd<_Xp, 0>
{
    static const intmax_t value = _Xp;
};

template <>
struct __static_gcd<0, 0>
{
    static const intmax_t value = 1;
};

// __static_lcm

template <intmax_t _Xp, intmax_t _Yp>
struct __static_lcm
{
    static const intmax_t value = _Xp / __static_gcd<_Xp, _Yp>::value * _Yp;
};

template <intmax_t _Xp>
struct __static_abs
{
    static const intmax_t value = _Xp < 0 ? -_Xp : _Xp;
};

template <intmax_t _Xp>
struct __static_sign
{
    static const intmax_t value = _Xp == 0 ? 0 : (_Xp < 0 ? -1 : 1);
};

template <intmax_t _Xp, intmax_t _Yp, intmax_t = __static_sign<_Yp>::value>
class __ll_add;

template <intmax_t _Xp, intmax_t _Yp>
class __ll_add<_Xp, _Yp, 1>
{
    static const intmax_t min = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1)) + 1;
    static const intmax_t max = -min;

    static_assert(_Xp <= max - _Yp, "overflow in __ll_add");
public:
    static const intmax_t value = _Xp + _Yp;
};

template <intmax_t _Xp, intmax_t _Yp>
class __ll_add<_Xp, _Yp, 0>
{
public:
    static const intmax_t value = _Xp;
};

template <intmax_t _Xp, intmax_t _Yp>
class __ll_add<_Xp, _Yp, -1>
{
    static const intmax_t min = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1)) + 1;
    static const intmax_t max = -min;

    static_assert(min - _Yp <= _Xp, "overflow in __ll_add");
public:
    static const intmax_t value = _Xp + _Yp;
};

template <intmax_t _Xp, intmax_t _Yp, intmax_t = __static_sign<_Yp>::value>
class __ll_sub;

template <intmax_t _Xp, intmax_t _Yp>
class __ll_sub<_Xp, _Yp, 1>
{
    static const intmax_t min = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1)) + 1;
    static const intmax_t max = -min;

    static_assert(min + _Yp <= _Xp, "overflow in __ll_sub");
public:
    static const intmax_t value = _Xp - _Yp;
};

template <intmax_t _Xp, intmax_t _Yp>
class __ll_sub<_Xp, _Yp, 0>
{
public:
    static const intmax_t value = _Xp;
};

template <intmax_t _Xp, intmax_t _Yp>
class __ll_sub<_Xp, _Yp, -1>
{
    static const intmax_t min = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1)) + 1;
    static const intmax_t max = -min;

    static_assert(_Xp <= max + _Yp, "overflow in __ll_sub");
public:
    static const intmax_t value = _Xp - _Yp;
};

template <intmax_t _Xp, intmax_t _Yp>
class __ll_mul
{
    static const intmax_t nan = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1));
    static const intmax_t min = nan + 1;
    static const intmax_t max = -min;
    static const intmax_t __a_x = __static_abs<_Xp>::value;
    static const intmax_t __a_y = __static_abs<_Yp>::value;

    static_assert(_Xp != nan && _Yp != nan && __a_x <= max / __a_y, "overflow in __ll_mul");
public:
    static const intmax_t value = _Xp * _Yp;
};

template <intmax_t _Yp>
class __ll_mul<0, _Yp>
{
public:
    static const intmax_t value = 0;
};

template <intmax_t _Xp>
class __ll_mul<_Xp, 0>
{
public:
    static const intmax_t value = 0;
};

template <>
class __ll_mul<0, 0>
{
public:
    static const intmax_t value = 0;
};

// Not actually used but left here in case needed in future maintenance
template <intmax_t _Xp, intmax_t _Yp>
class __ll_div
{
    static const intmax_t nan = (1LL << (sizeof(intmax_t) * CHAR_BIT - 1));
    static const intmax_t min = nan + 1;
    static const intmax_t max = -min;

    static_assert(_Xp != nan && _Yp != nan && _Yp != 0, "overflow in __ll_div");
public:
    static const intmax_t value = _Xp / _Yp;
};

template <intmax_t _Num, intmax_t _Den = 1>
class _LIBCPP_TYPE_VIS_ONLY ratio
{
    static_assert(__static_abs<_Num>::value >= 0, "ratio numerator is out of range");
    static_assert(_Den != 0, "ratio divide by 0");
    static_assert(__static_abs<_Den>::value >  0, "ratio denominator is out of range");
    static const intmax_t __na = __static_abs<_Num>::value;
    static const intmax_t __da = __static_abs<_Den>::value;
    static const intmax_t __s = __static_sign<_Num>::value * __static_sign<_Den>::value;
    static const intmax_t __gcd = __static_gcd<__na, __da>::value;
public:
    static const intmax_t num = __s * __na / __gcd;
    static const intmax_t den = __da / __gcd;

    typedef ratio<num, den> type;
};

template <intmax_t _Num, intmax_t _Den> const intmax_t ratio<_Num, _Den>::num;
template <intmax_t _Num, intmax_t _Den> const intmax_t ratio<_Num, _Den>::den;

template <class _Tp>                    struct __is_ratio                     : false_type {};
template <intmax_t _Num, intmax_t _Den> struct __is_ratio<ratio<_Num, _Den> > : true_type  {};

typedef ratio<1LL, 1000000000000000000LL> atto;
typedef ratio<1LL,    1000000000000000LL> femto;
typedef ratio<1LL,       1000000000000LL> pico;
typedef ratio<1LL,          1000000000LL> nano;
typedef ratio<1LL,             1000000LL> micro;
typedef ratio<1LL,                1000LL> milli;
typedef ratio<1LL,                 100LL> centi;
typedef ratio<1LL,                  10LL> deci;
typedef ratio<                 10LL, 1LL> deca;
typedef ratio<                100LL, 1LL> hecto;
typedef ratio<               1000LL, 1LL> kilo;
typedef ratio<            1000000LL, 1LL> mega;
typedef ratio<         1000000000LL, 1LL> giga;
typedef ratio<      1000000000000LL, 1LL> tera;
typedef ratio<   1000000000000000LL, 1LL> peta;
typedef ratio<1000000000000000000LL, 1LL> exa;

template <class _R1, class _R2>
struct __ratio_multiply
{
private:
    static const intmax_t __gcd_n1_d2 = __static_gcd<_R1::num, _R2::den>::value;
    static const intmax_t __gcd_d1_n2 = __static_gcd<_R1::den, _R2::num>::value;
public:
    typedef typename ratio
        <
            __ll_mul<_R1::num / __gcd_n1_d2, _R2::num / __gcd_d1_n2>::value,
            __ll_mul<_R2::den / __gcd_n1_d2, _R1::den / __gcd_d1_n2>::value
        >::type type;
};

#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES

template <class _R1, class _R2> using ratio_multiply
                                    = typename __ratio_multiply<_R1, _R2>::type;

#else  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 293 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3

template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_multiply
    : public __ratio_multiply<_R1, _R2>::type {};

#endif  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 299 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3

template <class _R1, class _R2>
struct __ratio_divide
{
private:
    static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
    static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value;
public:
    typedef typename ratio
        <
            __ll_mul<_R1::num / __gcd_n1_n2, _R2::den / __gcd_d1_d2>::value,
            __ll_mul<_R2::num / __gcd_n1_n2, _R1::den / __gcd_d1_d2>::value
        >::type type;
};

#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES

template <class _R1, class _R2> using ratio_divide
                                      = typename __ratio_divide<_R1, _R2>::type;

#else  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 320 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3

template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_divide
    : public __ratio_divide<_R1, _R2>::type {};

#endif  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 326 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3

template <class _R1, class _R2>
struct __ratio_add
{
private:
    static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
    static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value;
public:
    typedef typename ratio_multiply
        <
            ratio<__gcd_n1_n2, _R1::den / __gcd_d1_d2>,
            ratio
            <
                __ll_add
                <
                    __ll_mul<_R1::num / __gcd_n1_n2, _R2::den / __gcd_d1_d2>::value,
                    __ll_mul<_R2::num / __gcd_n1_n2, _R1::den / __gcd_d1_d2>::value
                >::value,
                _R2::den
            >
        >::type type;
};

#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES

template <class _R1, class _R2> using ratio_add
                                         = typename __ratio_add<_R1, _R2>::type;

#else  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 355 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3

template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_add
    : public __ratio_add<_R1, _R2>::type {};

#endif  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 361 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3

template <class _R1, class _R2>
struct __ratio_subtract
{
private:
    static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
    static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value;
public:
    typedef typename ratio_multiply
        <
            ratio<__gcd_n1_n2, _R1::den / __gcd_d1_d2>,
            ratio
            <
                __ll_sub
                <
                    __ll_mul<_R1::num / __gcd_n1_n2, _R2::den / __gcd_d1_d2>::value,
                    __ll_mul<_R2::num / __gcd_n1_n2, _R1::den / __gcd_d1_d2>::value
                >::value,
                _R2::den
            >
        >::type type;
};

#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES

template <class _R1, class _R2> using ratio_subtract
                                    = typename __ratio_subtract<_R1, _R2>::type;

#else  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 390 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3

template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_subtract
    : public __ratio_subtract<_R1, _R2>::type {};

#endif  // _LIBCPP_HAS_NO_TEMPLATE_ALIASES
# 396 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3

// ratio_equal

template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_equal
    : public integral_constant<bool, _R1::num == _R2::num && _R1::den == _R2::den> {};

template <class _R1, class _R2>
struct _LIBCPP_TYPE_VIS_ONLY ratio_not_equal
    : public integral_constant<bool, !ratio_equal<_R1, _R2>::value> {};

// ratio_less

template <class _R1, class _R2, bool _Odd = false,
          intmax_t _Q1 = _R1::num / _R1::den, intmax_t _M1 = _R1::num % _R1::den,
          intmax_t _Q2 = _R2::num / _R2::den, intmax_t _M2 = _R2::num % _R2::den>
struct __ratio_less1
{
    static const bool value = _Odd ? _Q2 < _Q1 : _Q1 < _Q2;
};

template <class _R1, class _R2, bool _Odd, intmax_t _Qp>
struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, 0>
{
    static const bool value = false;
};

template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M2>
struct __ratio_less1<_R1, _R2, _Odd, _Qp, 0, _Qp, _M2>
{
    static const bool value = !_Odd;
};

template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M1>
struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, 0>
{
    static const bool value = _Odd;
};

template <class _R1, class _R2, bool _Odd, intmax_t _Qp, intmax_t _M1,
                                                        intmax_t _M2>
struct __ratio_less1<_R1, _R2, _Odd, _Qp, _M1, _Qp, _M2>
{
    static const bool value = __ratio_less1<ratio<_R1::den, _M1>,
                                            ratio<_R2::den, _M2>, !_Odd>::value;
};

template <class _R1, class _R2, intmax_t _S1 = __static_sign<_R1::num>::value,
                                intmax_t _S2 = __static_sign<_R2::num>::value>
struct __ratio_less
{
    static const bool value = _S1 < _S2;
};

template <class _R1, class _R2>
struct __ratio_less<_R1, _R2, 1LL, 1LL>
{
    static const bool value = __ratio_less1<_R1, _R2>::value;
};

template <class _R1, class _R2>
struct __ratio_less<_R1, _R2, -1LL, -1LL>
{
    static const bool value = __ratio_less1<ratio<-_R2::num, _R2::den>, ratio<-_R1::num, _R1::den> >::value;
};

template <class _R1, class _R2>
struct __ratio_gcd
{
    typedef ratio<__static_gcd<_R1::num, _R2::num>::value,
                  __static_lcm<_R1::den, _R2::den>::value> type;
};

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_RATIO
# 488 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ratio" 3
# 282 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <limits>
#endif /* expanded by -frewrite-includes */
# 283 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono" 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifdef min
#if defined(_MSC_VER) && ! defined(__clang__)
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro max is incompatible with C++.  #undefing max
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
#endif
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 285 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 288 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono" 3
#endif
# 289 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono" 3

_LIBCPP_BEGIN_NAMESPACE_STD

namespace chrono
{

template <class _Rep, class _Period = ratio<1> > class _LIBCPP_TYPE_VIS_ONLY duration;

template <class _Tp>
struct __is_duration : false_type {};

template <class _Rep, class _Period>
struct __is_duration<duration<_Rep, _Period> > : true_type  {};

template <class _Rep, class _Period>
struct __is_duration<const duration<_Rep, _Period> > : true_type  {};

template <class _Rep, class _Period>
struct __is_duration<volatile duration<_Rep, _Period> > : true_type  {};

template <class _Rep, class _Period>
struct __is_duration<const volatile duration<_Rep, _Period> > : true_type  {};

} // chrono

template <class _Rep1, class _Period1, class _Rep2, class _Period2>
struct _LIBCPP_TYPE_VIS_ONLY common_type<chrono::duration<_Rep1, _Period1>,
                                         chrono::duration<_Rep2, _Period2> >
{
    typedef chrono::duration<typename common_type<_Rep1, _Rep2>::type,
                             typename __ratio_gcd<_Period1, _Period2>::type> type;
};

namespace chrono {

// duration_cast

template <class _FromDuration, class _ToDuration,
          class _Period = typename ratio_divide<typename _FromDuration::period, typename _ToDuration::period>::type,
          bool = _Period::num == 1,
          bool = _Period::den == 1>
struct __duration_cast;

template <class _FromDuration, class _ToDuration, class _Period>
struct __duration_cast<_FromDuration, _ToDuration, _Period, true, true>
{
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
    _ToDuration operator()(const _FromDuration& __fd) const
    {
        return _ToDuration(static_cast<typename _ToDuration::rep>(__fd.count()));
    }
};

template <class _FromDuration, class _ToDuration, class _Period>
struct __duration_cast<_FromDuration, _ToDuration, _Period, true, false>
{
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
    _ToDuration operator()(const _FromDuration& __fd) const
    {
        typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
        return _ToDuration(static_cast<typename _ToDuration::rep>(
                           static_cast<_Ct>(__fd.count()) / static_cast<_Ct>(_Period::den)));
    }
};

template <class _FromDuration, class _ToDuration, class _Period>
struct __duration_cast<_FromDuration, _ToDuration, _Period, false, true>
{
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
    _ToDuration operator()(const _FromDuration& __fd) const
    {
        typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
        return _ToDuration(static_cast<typename _ToDuration::rep>(
                           static_cast<_Ct>(__fd.count()) * static_cast<_Ct>(_Period::num)));
    }
};

template <class _FromDuration, class _ToDuration, class _Period>
struct __duration_cast<_FromDuration, _ToDuration, _Period, false, false>
{
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
    _ToDuration operator()(const _FromDuration& __fd) const
    {
        typedef typename common_type<typename _ToDuration::rep, typename _FromDuration::rep, intmax_t>::type _Ct;
        return _ToDuration(static_cast<typename _ToDuration::rep>(
                           static_cast<_Ct>(__fd.count()) * static_cast<_Ct>(_Period::num)
                                                          / static_cast<_Ct>(_Period::den)));
    }
};

template <class _ToDuration, class _Rep, class _Period>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
typename enable_if
<
    __is_duration<_ToDuration>::value,
    _ToDuration
>::type
duration_cast(const duration<_Rep, _Period>& __fd)
{
    return __duration_cast<duration<_Rep, _Period>, _ToDuration>()(__fd);
}

template <class _Rep>
struct _LIBCPP_TYPE_VIS_ONLY treat_as_floating_point : is_floating_point<_Rep> {};

template <class _Rep>
struct _LIBCPP_TYPE_VIS_ONLY duration_values
{
public:
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep zero() {return _Rep(0);}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep max()  {return numeric_limits<_Rep>::max();}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR _Rep min()  {return numeric_limits<_Rep>::lowest();}
};

// duration

template <class _Rep, class _Period>
class _LIBCPP_TYPE_VIS_ONLY duration
{
    static_assert(!__is_duration<_Rep>::value, "A duration representation can not be a duration");
    static_assert(__is_ratio<_Period>::value, "Second template parameter of duration must be a std::ratio");
    static_assert(_Period::num > 0, "duration period must be positive");

    template <class _R1, class _R2>
    struct __no_overflow
    {
    private:
        static const intmax_t __gcd_n1_n2 = __static_gcd<_R1::num, _R2::num>::value;
        static const intmax_t __gcd_d1_d2 = __static_gcd<_R1::den, _R2::den>::value;
        static const intmax_t __n1 = _R1::num / __gcd_n1_n2;
        static const intmax_t __d1 = _R1::den / __gcd_d1_d2;
        static const intmax_t __n2 = _R2::num / __gcd_n1_n2;
        static const intmax_t __d2 = _R2::den / __gcd_d1_d2;
        static const intmax_t max = -((intmax_t(1) << (sizeof(intmax_t) * CHAR_BIT - 1)) + 1);

        template <intmax_t _Xp, intmax_t _Yp, bool __overflow>
        struct __mul    // __overflow == false
        {
            static const intmax_t value = _Xp * _Yp;
        };

        template <intmax_t _Xp, intmax_t _Yp>
        struct __mul<_Xp, _Yp, true>
        {
            static const intmax_t value = 1;
        };

    public:
        static const bool value = (__n1 <= max / __d2) && (__n2 <= max / __d1);
        typedef ratio<__mul<__n1, __d2, !value>::value,
                      __mul<__n2, __d1, !value>::value> type;
    };
    
public:
    typedef _Rep rep;
    typedef _Period period;
private:
    rep __rep_;
public:

    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
#ifndef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
        duration() = default;
#else
# 454 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono" 3
        duration() {}
#endif
# 456 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono" 3

    template <class _Rep2>
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
        explicit duration(const _Rep2& __r,
            typename enable_if
            <
               is_convertible<_Rep2, rep>::value &&
               (treat_as_floating_point<rep>::value ||
               !treat_as_floating_point<_Rep2>::value)
            >::type* = 0)
                : __rep_(__r) {}

    // conversions
    template <class _Rep2, class _Period2>
        _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
        duration(const duration<_Rep2, _Period2>& __d,
            typename enable_if
            <
                __no_overflow<_Period2, period>::value && (
                treat_as_floating_point<rep>::value ||
                (__no_overflow<_Period2, period>::type::den == 1 &&
                 !treat_as_floating_point<_Rep2>::value))
            >::type* = 0)
                : __rep_(_VSTD::chrono::duration_cast<duration>(__d).count()) {}

    // observer

    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR rep count() const {return __rep_;}

    // arithmetic

    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration  operator+() const {return *this;}
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration  operator-() const {return duration(-__rep_);}
    _LIBCPP_INLINE_VISIBILITY duration& operator++()      {++__rep_; return *this;}
    _LIBCPP_INLINE_VISIBILITY duration  operator++(int)   {return duration(__rep_++);}
    _LIBCPP_INLINE_VISIBILITY duration& operator--()      {--__rep_; return *this;}
    _LIBCPP_INLINE_VISIBILITY duration  operator--(int)   {return duration(__rep_--);}

    _LIBCPP_INLINE_VISIBILITY duration& operator+=(const duration& __d) {__rep_ += __d.count(); return *this;}
    _LIBCPP_INLINE_VISIBILITY duration& operator-=(const duration& __d) {__rep_ -= __d.count(); return *this;}

    _LIBCPP_INLINE_VISIBILITY duration& operator*=(const rep& rhs) {__rep_ *= rhs; return *this;}
    _LIBCPP_INLINE_VISIBILITY duration& operator/=(const rep& rhs) {__rep_ /= rhs; return *this;}
    _LIBCPP_INLINE_VISIBILITY duration& operator%=(const rep& rhs) {__rep_ %= rhs; return *this;}
    _LIBCPP_INLINE_VISIBILITY duration& operator%=(const duration& rhs) {__rep_ %= rhs.count(); return *this;}

    // special values

    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration zero() {return duration(duration_values<rep>::zero());}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration min()  {return duration(duration_values<rep>::min());}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR duration max()  {return duration(duration_values<rep>::max());}
};

typedef duration<long long,         nano> nanoseconds;
typedef duration<long long,        micro> microseconds;
typedef duration<long long,        milli> milliseconds;
typedef duration<long long              > seconds;
typedef duration<     long, ratio<  60> > minutes;
typedef duration<     long, ratio<3600> > hours;

// Duration ==

template <class _LhsDuration, class _RhsDuration>
struct __duration_eq
{
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
    bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs) const
        {
            typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
            return _Ct(__lhs).count() == _Ct(__rhs).count();
        }
};

template <class _LhsDuration>
struct __duration_eq<_LhsDuration, _LhsDuration>
{
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
    bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const
        {return __lhs.count() == __rhs.count();}
};



// Duration !=



// Duration <

template <class _LhsDuration, class _RhsDuration>
struct __duration_lt
{
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
    bool operator()(const _LhsDuration& __lhs, const _RhsDuration& __rhs) const
        {
            typedef typename common_type<_LhsDuration, _RhsDuration>::type _Ct;
            return _Ct(__lhs).count() < _Ct(__rhs).count();
        }
};

template <class _LhsDuration>
struct __duration_lt<_LhsDuration, _LhsDuration>
{
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
    bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const
        {return __lhs.count() < __rhs.count();}
};



// Duration >



// Duration <=



// Duration >=

template <class _Rep1, class _Period1, class _Rep2, class _Period2>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs)
{
    typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
    return _Cd(_Cd(__lhs).count() - _Cd(__rhs).count());
}

// Duration *

template <class _Rep1, class _Period, class _Rep2>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
typename enable_if
<
    is_convertible<_Rep2, typename common_type<_Rep1, _Rep2>::type>::value,
    duration<typename common_type<_Rep1, _Rep2>::type, _Period>
>::type
operator*(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
{
    typedef typename common_type<_Rep1, _Rep2>::type _Cr;
    typedef duration<_Cr, _Period> _Cd;
    return _Cd(_Cd(__d).count() * static_cast<_Cr>(__s));
}



// Duration /

template <class _Duration, class _Rep, bool = __is_duration<_Rep>::value>
struct __duration_divide_result
{
};

template <class _Duration, class _Rep2,
    bool = is_convertible<_Rep2,
                          typename common_type<typename _Duration::rep, _Rep2>::type>::value>
struct __duration_divide_imp
{
};

template <class _Rep1, class _Period, class _Rep2>
struct __duration_divide_imp<duration<_Rep1, _Period>, _Rep2, true>
{
    typedef duration<typename common_type<_Rep1, _Rep2>::type, _Period> type;
};

template <class _Rep1, class _Period, class _Rep2>
struct __duration_divide_result<duration<_Rep1, _Period>, _Rep2, false>
    : __duration_divide_imp<duration<_Rep1, _Period>, _Rep2>
{
};

template <class _Rep1, class _Period, class _Rep2>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
operator/(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
{
    typedef typename common_type<_Rep1, _Rep2>::type _Cr;
    typedef duration<_Cr, _Period> _Cd;
    return _Cd(_Cd(__d).count() / static_cast<_Cr>(__s));
}



// Duration %

template <class _Rep1, class _Period, class _Rep2>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
typename __duration_divide_result<duration<_Rep1, _Period>, _Rep2>::type
operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s)
{
    typedef typename common_type<_Rep1, _Rep2>::type _Cr;
    typedef duration<_Cr, _Period> _Cd;
    return _Cd(_Cd(__d).count() % static_cast<_Cr>(__s));
}



//////////////////////////////////////////////////////////
///////////////////// time_point /////////////////////////
//////////////////////////////////////////////////////////

template <class _Clock, class _Duration = typename _Clock::duration>
class _LIBCPP_TYPE_VIS_ONLY time_point
{
    static_assert(__is_duration<_Duration>::value,
                  "Second template parameter of time_point must be a std::chrono::duration");
public:
    typedef _Clock                    clock;
    typedef _Duration                 duration;
    typedef typename duration::rep    rep;
    typedef typename duration::period period;
private:
    duration __d_;

public:
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 time_point() : __d_(duration::zero()) {}
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 explicit time_point(const duration& __d) : __d_(__d) {}

    // conversions
    template <class _Duration2>
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
    time_point(const time_point<clock, _Duration2>& t,
        typename enable_if
        <
            is_convertible<_Duration2, duration>::value
        >::type* = 0)
            : __d_(t.time_since_epoch()) {}

    // observer

    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 duration time_since_epoch() const {return __d_;}

    // arithmetic

    _LIBCPP_INLINE_VISIBILITY time_point& operator+=(const duration& __d) {__d_ += __d; return *this;}
    _LIBCPP_INLINE_VISIBILITY time_point& operator-=(const duration& __d) {__d_ -= __d; return *this;}

    // special values

    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR time_point min() {return time_point(duration::min());}
    _LIBCPP_INLINE_VISIBILITY static _LIBCPP_CONSTEXPR time_point max() {return time_point(duration::max());}
};

} // chrono

template <class _Clock, class _Duration1, class _Duration2>
struct _LIBCPP_TYPE_VIS_ONLY common_type<chrono::time_point<_Clock, _Duration1>,
                                         chrono::time_point<_Clock, _Duration2> >
{
    typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type;
};

namespace chrono {



// time_point ==



// time_point !=




//////////////////////////////////////////////////////////
/////////////////////// clocks ///////////////////////////
//////////////////////////////////////////////////////////

class _LIBCPP_TYPE_VIS system_clock
{
public:
    typedef microseconds                     duration;
    typedef duration::rep                    rep;
    typedef duration::period                 period;
    typedef chrono::time_point<system_clock> time_point;
    static _LIBCPP_CONSTEXPR_AFTER_CXX11 const bool is_steady = false;

    static time_point now() _NOEXCEPT;
    static time_t     to_time_t  (const time_point& __t) _NOEXCEPT;
    static time_point from_time_t(time_t __t) _NOEXCEPT;
};

class _LIBCPP_TYPE_VIS steady_clock
{
public:
    typedef nanoseconds                                   duration;
    typedef duration::rep                                 rep;
    typedef duration::period                              period;
    typedef chrono::time_point<steady_clock, duration>    time_point;
    static _LIBCPP_CONSTEXPR_AFTER_CXX11 const bool is_steady = true;

    static time_point now() _NOEXCEPT;
};

typedef steady_clock high_resolution_clock;

} // chrono

#if _LIBCPP_STD_VER > 11
// Suffixes for duration literals [time.duration.literals]
inline namespace literals
{ 
  inline namespace chrono_literals
  {
        return chrono::duration<long double, nano> (__ns);
    }

}}

namespace chrono { // hoist the literals into namespace std::chrono
   using namespace literals::chrono_literals;
}

#endif
# 1024 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono" 3

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_CHRONO
# 1028 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/chrono" 3
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <system_error>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 1 3
// -*- C++ -*-
//===---------------------------- system_error ----------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_SYSTEM_ERROR
#define _LIBCPP_SYSTEM_ERROR

/*
    system_error synopsis

namespace std
    : true_type { }

error_code make_error_code(errc e) noexcept;
error_condition make_error_condition(errc e) noexcept;

// Comparison operators:
bool operator==(const error_code& lhs, const error_code& rhs) noexcept;
bool operator==(const error_code& lhs, const error_condition& rhs) noexcept;
bool operator==(const error_condition& lhs, const error_code& rhs) noexcept;
bool operator==(const error_condition& lhs, const error_condition& rhs) noexcept;
#include <cerrno>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 1 3
// -*- C++ -*-
//===-------------------------- cerrno ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CERRNO
#define _LIBCPP_CERRNO

/*
 *	California, Berkeley and its contributors.
 * 4. 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.
 *
 *	@(#)errno.h	8.5 (Berkeley) 1/21/94
 */

#ifndef	_SYS_ERRNO_H_
#define	_SYS_ERRNO_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 73 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/errno.h" 3 4


#if defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_errno_t.h>
#endif /* expanded by -frewrite-includes */
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/errno.h" 3 4
#endif
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/errno.h" 3 4

__BEGIN_DECLS
;
#define errno (*__error())
__END_DECLS

/*
 * Error codes
 */

#define	EPERM		1		/* Operation not permitted */
#define	ENOENT		2		/* No such file or directory */
#define	ESRCH		3		/* No such process */
#define	EINTR		4		/* Interrupted system call */
#define	EIO		5		/* Input/output error */
# 207 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/errno.h" 3 4

#define	ENOLCK		77		/* No locks available */
#define	ENOSYS		78		/* Function not implemented */

#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define	EFTYPE		79		/* Inappropriate file type or format */
#define	EAUTH		80		/* Authentication error */
#define	ENEEDAUTH	81		/* Need authenticator */

/* Intelligent device errors */
#define	EPWROFF		82	/* Device power is off */
#define	EDEVERR		83	/* Device error, e.g. paper out */
#endif
# 220 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/errno.h" 3 4

#define	EOVERFLOW	84		/* Value too large to be stored in data type */

/* Program loading errors */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define EBADEXEC	85	/* Bad executable */
#define EBADARCH	86	/* Bad CPU type in executable */
#define ESHLIBVERS	87	/* Shared library version mismatch */
#define EBADMACHO	88	/* Malformed Macho file */
#endif
# 230 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/errno.h" 3 4

#define	ECANCELED	89		/* Operation canceled */

#define EIDRM		90		/* Identifier removed */
#define ENOMSG		91		/* No message of desired type */   
#define EILSEQ		92		/* Illegal byte sequence */
#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL
#define ENOATTR		93		/* Attribute not found */
#endif
# 239 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/errno.h" 3 4

#define EBADMSG		94		/* Bad message */
#define EMULTIHOP	95		/* Reserved */
#define	ENODATA		96		/* No message available on STREAM */
#define ENOLINK		97		/* Reserved */
#define ENOSR		98		/* No STREAM resources */
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
# 57 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#define ENOTRECOVERABLE __elast1
#ifdef ELAST
#undef ELAST
#define ELAST ENOTRECOVERABLE
#endif
# 63 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#else  // defined(EOWNERDEAD)
# 65 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#define EOWNERDEAD __elast1
#define ENOTRECOVERABLE __elast2
#ifdef ELAST
#undef ELAST
#define ELAST ENOTRECOVERABLE
#endif
# 72 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#endif  // defined(EOWNERDEAD)
# 74 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#endif  // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE)
# 76 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

//  supply errno values likely to be missing, particularly on Windows

#ifndef EAFNOSUPPORT
#define EAFNOSUPPORT 9901
#endif
# 82 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EADDRINUSE
#define EADDRINUSE 9902
#endif
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EADDRNOTAVAIL
#define EADDRNOTAVAIL 9903
#endif
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EISCONN
#define EISCONN 9904
#endif
# 94 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EBADMSG
#define EBADMSG 9905
#endif
# 98 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ECONNABORTED
#define ECONNABORTED 9906
#endif
# 102 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EALREADY
#define EALREADY 9907
#endif
# 106 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ECONNREFUSED
#define ECONNREFUSED 9908
#endif
# 110 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ECONNRESET
#define ECONNRESET 9909
#endif
# 114 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EDESTADDRREQ
#define EDESTADDRREQ 9910
#endif
# 118 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EHOSTUNREACH
#define EHOSTUNREACH 9911
#endif
# 122 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EIDRM
#define EIDRM 9912
#endif
# 126 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EMSGSIZE
#define EMSGSIZE 9913
#endif
# 130 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENETDOWN
#define ENETDOWN 9914
#endif
# 134 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENETRESET
#define ENETRESET 9915
#endif
# 138 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENETUNREACH
#define ENETUNREACH 9916
#endif
# 142 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENOBUFS
#define ENOBUFS 9917
#endif
# 146 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENOLINK
#define ENOLINK 9918
#endif
# 150 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENODATA
#define ENODATA 9919
#endif
#ifndef EPROTO
#define EPROTO 9932
#endif
# 206 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EPROTONOSUPPORT
#define EPROTONOSUPPORT 9933
#endif
# 210 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENOTRECOVERABLE
#define ENOTRECOVERABLE 9934
#endif
# 214 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ETIME
#define ETIME 9935
#endif
# 218 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ETXTBSY
#define ETXTBSY 9936
#endif
# 222 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ETIMEDOUT
#define ETIMEDOUT 9938
#endif
# 226 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ELOOP
#define ELOOP 9939
#endif
# 230 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EOVERFLOW
#define EOVERFLOW 9940
#endif
# 234 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EPROTOTYPE
#define EPROTOTYPE 9941
#endif
# 238 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENOSYS
#define ENOSYS 9942
#endif
# 242 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EINVAL
#define EINVAL 9943
#endif
# 246 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ERANGE
#define ERANGE 9944
#endif
# 250 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EILSEQ
#define EILSEQ 9945
#endif
# 254 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

//  Windows Mobile doesn't appear to define these:

#ifndef E2BIG
#define E2BIG 9946
#endif
# 260 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EDOM
#define EDOM 9947
#endif
# 264 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EFAULT
#define EFAULT 9948
#endif
# 268 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EBADF
#define EBADF 9949
#endif
# 272 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EPIPE
#define EPIPE 9950
#endif
# 276 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EXDEV
#define EXDEV 9951
#endif
# 280 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EBUSY
#define EBUSY 9952
#endif
# 284 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENOTEMPTY
#define ENOTEMPTY 9953
#endif
# 288 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENOEXEC
#define ENOEXEC 9954
#endif
# 292 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EEXIST
#define EEXIST 9955
#endif
# 296 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EFBIG
#define EFBIG 9956
#endif
# 300 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENAMETOOLONG
#define ENAMETOOLONG 9957
#endif
# 304 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENOTTY
#define ENOTTY 9958
#endif
# 308 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EINTR
#define EINTR 9959
#endif
# 312 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ESPIPE
#define ESPIPE 9960
#endif
# 316 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EIO
#define EIO 9961
#endif
# 320 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EISDIR
#define EISDIR 9962
#endif
# 324 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ECHILD
#define ECHILD 9963
#endif
#ifndef EAGAIN
#define EAGAIN 9976
#endif
# 380 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef ENFILE
#define ENFILE 9977
#endif
# 384 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EMFILE
#define EMFILE 9978
#endif
# 388 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#ifndef EMLINK
#define EMLINK 9979
#endif
# 392 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3

#endif  // _LIBCPP_CERRNO
# 394 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cerrno" 3
# 223 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <type_traits>
#endif /* expanded by -frewrite-includes */
# 224 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 3
#if 0 /* expanded by -frewrite-includes */
#include <stdexcept>
#endif /* expanded by -frewrite-includes */
# 225 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 3
#if 0 /* expanded by -frewrite-includes */
#include <__functional_base>
#endif /* expanded by -frewrite-includes */
# 226 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 229 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 3
#endif
# 230 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 3

_LIBCPP_BEGIN_NAMESPACE_STD

// is_error_code_enum

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum
    : public false_type {};

// is_error_condition_enum

template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_error_condition_enum
    : public false_type {};

// Some error codes are not present on all platforms, so we provide equivalents
// for them:

//enum class errc
_LIBCPP_DECLARE_STRONG_ENUM(errc)
{
    address_family_not_supported        = EAFNOSUPPORT,
    address_in_use                      = EADDRINUSE,
    address_not_available               = EADDRNOTAVAIL,
    already_connected                   = EISCONN,
    argument_list_too_long              = E2BIG,
    argument_out_of_domain              = EDOM,
    bad_address                         = EFAULT,
    bad_file_descriptor                 = EBADF,
    bad_message                         = EBADMSG,
    broken_pipe                         = EPIPE,
    connection_aborted                  = ECONNABORTED,
    connection_already_in_progress      = EALREADY,
    invalid_argument                    = EINVAL,
    invalid_seek                        = ESPIPE,
    io_error                            = EIO,
    is_a_directory                      = EISDIR,
    message_size                        = EMSGSIZE,
    network_down                        = ENETDOWN,
    network_reset                       = ENETRESET,
    too_many_files_open_in_system       = ENFILE,
    too_many_files_open                 = EMFILE,
    too_many_links                      = EMLINK,
    too_many_symbolic_link_levels       = ELOOP,
    value_too_large                     = EOVERFLOW,
    wrong_protocol_type                 = EPROTOTYPE
};
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(errc)

template <>
struct _LIBCPP_TYPE_VIS_ONLY is_error_condition_enum<errc>
    : true_type { };

#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
template <>
struct _LIBCPP_TYPE_VIS_ONLY is_error_condition_enum<errc::__lx>
    : true_type { };
#endif
# 357 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 3

class _LIBCPP_TYPE_VIS error_condition;
class _LIBCPP_TYPE_VIS error_code;

// class error_category

class _LIBCPP_HIDDEN __do_message;

class _LIBCPP_TYPE_VIS error_category
{
public:
    virtual ~error_category() _NOEXCEPT;

#ifdef _LIBCPP_BUILDING_SYSTEM_ERROR
    error_category() _NOEXCEPT;
#else
# 373 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 3
    _LIBCPP_ALWAYS_INLINE
    _LIBCPP_CONSTEXPR_AFTER_CXX11 error_category() _NOEXCEPT _LIBCPP_DEFAULT;
#endif
# 376 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 3
private:
    ;// = delete;
    ;// = delete;

public:
    ;
    virtual error_condition default_error_condition(int __ev) const _NOEXCEPT;
    virtual bool equivalent(int __code, const error_condition& __condition) const _NOEXCEPT;
    virtual bool equivalent(const error_code& __code, int __condition) const _NOEXCEPT;
    ;

    _LIBCPP_ALWAYS_INLINE
    bool operator==(const error_category& __rhs) const _NOEXCEPT {return this == &__rhs;}

    _LIBCPP_ALWAYS_INLINE
    bool operator!=(const error_category& __rhs) const _NOEXCEPT {return !(*this == __rhs);}

    _LIBCPP_ALWAYS_INLINE
    bool operator< (const error_category& __rhs) const _NOEXCEPT {return this < &__rhs;}

    friend class _LIBCPP_HIDDEN __do_message;
};

class _LIBCPP_HIDDEN __do_message
    : public error_category
{
public:
    ;
};

_LIBCPP_FUNC_VIS const error_category& generic_category() _NOEXCEPT;
_LIBCPP_FUNC_VIS const error_category& system_category() _NOEXCEPT;

class _LIBCPP_TYPE_VIS error_condition
{
    int __val_;
    const error_category* __cat_;
public:
    _LIBCPP_ALWAYS_INLINE
    error_condition() _NOEXCEPT : __val_(0), __cat_(&generic_category()) {}

    _LIBCPP_ALWAYS_INLINE
    error_condition(int __val, const error_category& __cat) _NOEXCEPT
        : __val_(__val), __cat_(&__cat) {}

    template <class _Ep>
        _LIBCPP_ALWAYS_INLINE
        error_condition(_Ep __e,
              typename enable_if<is_error_condition_enum<_Ep>::value>::type* = 0
                                                                     ) _NOEXCEPT
            {*this = make_error_condition(__e);}

    _LIBCPP_ALWAYS_INLINE
    void assign(int __val, const error_category& __cat) _NOEXCEPT
    {
        __val_ = __val;
        __cat_ = &__cat;
    }

    template <class _Ep>
        _LIBCPP_ALWAYS_INLINE
        typename enable_if
        <
            is_error_condition_enum<_Ep>::value,
            error_condition&
        >::type
        operator=(_Ep __e) _NOEXCEPT
            {*this = make_error_condition(__e); return *this;}

    _LIBCPP_ALWAYS_INLINE
    void clear() _NOEXCEPT
    {
        __val_ = 0;
        __cat_ = &generic_category();
    }

    _LIBCPP_ALWAYS_INLINE
    int value() const _NOEXCEPT {return __val_;}

    _LIBCPP_ALWAYS_INLINE
    const error_category& category() const _NOEXCEPT {return *__cat_;}
    ;

    _LIBCPP_ALWAYS_INLINE
        _LIBCPP_EXPLICIT
        operator bool() const _NOEXCEPT {return __val_ != 0;}
};





// error_code

class _LIBCPP_TYPE_VIS error_code
{
    int __val_;
    const error_category* __cat_;
public:
    _LIBCPP_ALWAYS_INLINE
    error_code() _NOEXCEPT : __val_(0), __cat_(&system_category()) {}

    _LIBCPP_ALWAYS_INLINE
    error_code(int __val, const error_category& __cat) _NOEXCEPT
        : __val_(__val), __cat_(&__cat) {}

    template <class _Ep>
        _LIBCPP_ALWAYS_INLINE
        error_code(_Ep __e,
                   typename enable_if<is_error_code_enum<_Ep>::value>::type* = 0
                                                                     ) _NOEXCEPT
            {*this = make_error_code(__e);}


    _LIBCPP_ALWAYS_INLINE
    void clear() _NOEXCEPT
    {
        __val_ = 0;
        __cat_ = &system_category();
    }

    _LIBCPP_ALWAYS_INLINE
    int value() const _NOEXCEPT {return __val_;}

    _LIBCPP_ALWAYS_INLINE
    const error_category& category() const _NOEXCEPT {return *__cat_;}

    _LIBCPP_ALWAYS_INLINE
    error_condition default_error_condition() const _NOEXCEPT
        {return __cat_->default_error_condition(__val_);}

    ;

    _LIBCPP_ALWAYS_INLINE
        _LIBCPP_EXPLICIT
        operator bool() const _NOEXCEPT {return __val_ != 0;}
};







inline _LIBCPP_INLINE_VISIBILITY
bool
operator==(const error_code& __x, const error_condition& __y) _NOEXCEPT
{
    return __x.category().equivalent(__x.value(), __y)
        || __y.category().equivalent(__x, __y.value());
}










class _LIBCPP_TYPE_VIS system_error
    : public runtime_error
{
    error_code __ec_;
public:
    ;
    ;
    ;
    system_error(int __ev, const error_category& __ecat, const string& __what_arg);
    system_error(int __ev, const error_category& __ecat, const char* __what_arg);
    system_error(int __ev, const error_category& __ecat);
    ~system_error() _NOEXCEPT;

    _LIBCPP_ALWAYS_INLINE
    const error_code& code() const _NOEXCEPT {return __ec_;}

private:
    static string __init(const error_code&, string);
};

_LIBCPP_FUNC_VIS void __throw_system_error(int ev, const char* what_arg);

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_SYSTEM_ERROR
# 643 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/system_error" 3
# 17 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <pthread.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 1 3 4
/*
 * POSIX Threads - IEEE 1003.1c
 */

#ifndef _PTHREAD_H
#define _PTHREAD_H

#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 56 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4
#ifndef __POSIX_LIB__
#if 0 /* expanded by -frewrite-includes */
#include <pthread/pthread_impl.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/pthread_impl.h" 1 3 4
/*
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _PTHREAD_IMPL_H_
#define _PTHREAD_IMPL_H_
/*
 * Internal implementation details
 */

/* This whole header file will disappear, so don't depend on it... */

#ifndef __POSIX_LIB__

/*
 * [Internal] data structure signatures
 */
#define _PTHREAD_MUTEX_SIG_init		0x32AAABA7

#define _PTHREAD_ERRORCHECK_MUTEX_SIG_init      0x32AAABA1
#define _PTHREAD_RECURSIVE_MUTEX_SIG_init       0x32AAABA2
#define _PTHREAD_FIRSTFIT_MUTEX_SIG_init       0x32AAABA3

#define _PTHREAD_COND_SIG_init		0x3CB0B1BB
#define _PTHREAD_ONCE_SIG_init		0x30B1BCBA
#define _PTHREAD_RWLOCK_SIG_init    0x2DA8B3B4

/*
 * POSIX scheduling policies
 */
#define SCHED_OTHER                1
#define SCHED_FIFO                 4
#define SCHED_RR                   2

#define __SCHED_PARAM_SIZE__       4

#endif /* __POSIX_LIB__ */
# 57 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/pthread_impl.h" 3 4

#endif /* _PTHREAD_IMPL_H_ */
# 59 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/pthread_impl.h" 3 4
# 58 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 2 3 4
#endif
# 59 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <pthread/sched.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/sched.h" 1 3 4
/*
 * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _SCHED_H_
#define _SCHED_H_

#if 0 /* expanded by -frewrite-includes */
#include <pthread_impl.h>
#endif /* expanded by -frewrite-includes */
# 28 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/sched.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 29 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/sched.h" 3 4

__BEGIN_DECLS
/*
 * Scheduling paramters
 */
#ifndef __POSIX_LIB__
struct sched_param { int sched_priority;  char __opaque[__SCHED_PARAM_SIZE__]; };
#endif
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/sched.h" 3 4

extern int sched_yield(void);
;
;
__END_DECLS

#endif /* _SCHED_H_ */
# 44 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/sched.h" 3 4

# 60 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <time.h>
#endif /* expanded by -frewrite-includes */
# 61 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_types.h>
#endif /* expanded by -frewrite-includes */
# 62 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_attr_t.h>
#endif /* expanded by -frewrite-includes */
# 63 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthread/_pthread_t.h>
#endif /* expanded by -frewrite-includes */
# 72 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <pthread/qos.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/qos.h" 1 3 4
/*
 * Copyright (c) 2013-2014 Apple Inc. All rights reserved.
 *
 *
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _PTHREAD_QOS_H
#define _PTHREAD_QOS_H

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 28 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/qos.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 29 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/qos.h" 3 4

#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL

#if 0 /* expanded by -frewrite-includes */
#include <sys/qos.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/qos.h" 1 3 4
/*
 * Copyright (c) 2013-2014 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 *
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 *
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 *
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _SYS_QOS_H
#define _SYS_QOS_H

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 28 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/qos.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 29 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/qos.h" 3 4

/*!
 * @typedef qos_class_t
 *
 * @abstract
 * An abstract thread quality of service (QOS) classification.
 *
 * @discussion
 * @constant QOS_MIN_RELATIVE_PRIORITY
 * @abstract The minimum relative priority that may be specified within a
 * QOS class. These priorities are relative only within a given QOS class
 * and meaningful only for the current process.
 */
#define QOS_MIN_RELATIVE_PRIORITY (-15)

/* Userspace (only) definitions */

#ifndef KERNEL

__BEGIN_DECLS

/*!
 * @function qos_class_self
 *
 * The QOS class that the main thread of a process is created with depends on
 * the type of process (e.g. application or daemon) and on how it has been
 * launched.
 *
 * This function returns that initial requested QOS class value chosen by the
 * system to enable propagation of that classification to matching work not
 * executing on the main thread.
 *
 * @return
 * One of the QOS class values in qos_class_t.
 */
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0)
;

__END_DECLS

#endif // KERNEL
# 193 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/qos.h" 3 4

#endif // _SYS_QOS_H
# 195 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/qos.h" 3 4
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/qos.h" 2 3 4

#ifndef KERNEL

__BEGIN_DECLS

/*!
 * @function pthread_attr_set_qos_class_np
 *
 * @abstract
 * Sets the QOS class and relative priority of a pthread attribute structure
 * Zero if successful, otherwise an errno value.
 */
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0)
;

__END_DECLS

#endif // KERNEL
# 293 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/qos.h" 3 4

#endif // __DARWIN_C_LEVEL >= __DARWIN_C_FULL
# 295 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/qos.h" 3 4

#endif // _PTHREAD_QOS_H
# 297 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread/qos.h" 3 4
# 74 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 2 3 4

#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_mach_port_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_mach_port_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 *	Often, various rights for a port held in a single name space
 *	will coalesce and are, therefore, be identified by a single name
 *	[this is the case for send and receive rights].  But not
 *	always [send-once rights currently get a unique name for
 *	each right].      
 *
 *	This definition of mach_port_t is only for user-space.
 *
 */

#ifndef _MACH_PORT_T
#define _MACH_PORT_T
typedef __darwin_mach_port_t mach_port_t;
#endif /* _MACH_PORT_T */
# 51 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_mach_port_t.h" 3 4
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_sigset_t.h>
#endif /* expanded by -frewrite-includes */
# 79 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4

#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
# 81 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4

/*
 * These symbols indicate which [optional] features are available
 * They can be tested at compile time via '#ifdef XXX'
 * The way to check for pthreads is like so:

 * #include <unistd.h>
 * #ifdef _POSIX_THREADS
 * #include <pthread.h>
 * #endif

 */


__BEGIN_DECLS
#define PTHREAD_MUTEX_NORMAL		0
#define PTHREAD_MUTEX_ERRORCHECK	1
#define PTHREAD_MUTEX_RECURSIVE		2
#define PTHREAD_MUTEX_DEFAULT		PTHREAD_MUTEX_NORMAL

/*
 * RWLock variables
 */
#define PTHREAD_RWLOCK_INITIALIZER {_PTHREAD_RWLOCK_SIG_init, {0}}

/*
 * Mutex variables
 */
#define PTHREAD_MUTEX_INITIALIZER {_PTHREAD_MUTEX_SIG_init, {0}}

/* <rdar://problem/10854763> */
#if ((__MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) || (__IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED >= 50000))
#	if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
#		define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER {_PTHREAD_ERRORCHECK_MUTEX_SIG_init, {0}}
#		define PTHREAD_RECURSIVE_MUTEX_INITIALIZER {_PTHREAD_RECURSIVE_MUTEX_SIG_init, {0}}
#	endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
# 188 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4
#endif
# 189 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4

/*
 * Condition variable attributes
 */

/*
 * Condition variables
 */

#define PTHREAD_COND_INITIALIZER {_PTHREAD_COND_SIG_init, {0}}

/*
 * Initialization control (once) variables
 */


__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
void pthread_testcancel(void) __DARWIN_ALIAS(pthread_testcancel);

#if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)

/* returns non-zero if pthread_create or cthread_fork have been called */
__OSX_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0)
;

#endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
# 518 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4
__END_DECLS
#endif /* _PTHREAD_H */
# 520 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/pthread.h" 3 4
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 21 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 3
#endif
# 22 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 3

_LIBCPP_BEGIN_NAMESPACE_STD

class _LIBCPP_TYPE_VIS mutex
{
    pthread_mutex_t __m_;

public:
    _LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {}
#else
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 3
     mutex() _NOEXCEPT {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;}
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 3
     ;

private:
    ;// = delete;
    ;// = delete;

public:
    ;
    bool try_lock() _NOEXCEPT;
    void unlock() _NOEXCEPT;

    typedef pthread_mutex_t* native_handle_type;
    _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
};

struct _LIBCPP_TYPE_VIS defer_lock_t {};
struct _LIBCPP_TYPE_VIS try_to_lock_t {};
struct _LIBCPP_TYPE_VIS adopt_lock_t {};

#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX)

extern const defer_lock_t  defer_lock;
extern const try_to_lock_t try_to_lock;
extern const adopt_lock_t  adopt_lock;

#else
# 62 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 3

constexpr defer_lock_t  defer_lock  = defer_lock_t();
constexpr try_to_lock_t try_to_lock = try_to_lock_t();
constexpr adopt_lock_t  adopt_lock  = adopt_lock_t();

#endif
# 68 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 3

template <class _Mutex>
class _LIBCPP_TYPE_VIS_ONLY lock_guard
{
public:
    typedef _Mutex mutex_type;

private:
    mutex_type& __m_;
public:

    _LIBCPP_INLINE_VISIBILITY
    explicit lock_guard(mutex_type& __m)
        : __m_(__m) {__m_.lock();}
    _LIBCPP_INLINE_VISIBILITY
    lock_guard(mutex_type& __m, adopt_lock_t)
        : __m_(__m) {}
    _LIBCPP_INLINE_VISIBILITY
    ~lock_guard() {__m_.unlock();}

private:
    ;// = delete;
    ;// = delete;
};

template <class _Mutex>
class _LIBCPP_TYPE_VIS_ONLY unique_lock
{
public:
    typedef _Mutex mutex_type;

private:
    mutex_type* __m_;
    bool __owns_;

public:
    _LIBCPP_INLINE_VISIBILITY
    unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {}
    _LIBCPP_INLINE_VISIBILITY
    explicit unique_lock(mutex_type& __m)
        : __m_(&__m), __owns_(true) {__m_->lock();}
    _LIBCPP_INLINE_VISIBILITY
    unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT
        : __m_(&__m), __owns_(false) {}
    _LIBCPP_INLINE_VISIBILITY
    unique_lock(mutex_type& __m, try_to_lock_t)
        : __m_(&__m), __owns_(__m.try_lock()) {}
    _LIBCPP_INLINE_VISIBILITY
    unique_lock(mutex_type& __m, adopt_lock_t)
        : __m_(&__m), __owns_(true) {}
    template <class _Clock, class _Duration>
    _LIBCPP_INLINE_VISIBILITY
        unique_lock(mutex_type& __m, const chrono::time_point<_Clock, _Duration>& __t)
            : __m_(&__m), __owns_(__m.try_lock_until(__t)) {}
    template <class _Rep, class _Period>
    _LIBCPP_INLINE_VISIBILITY
        unique_lock(mutex_type& __m, const chrono::duration<_Rep, _Period>& __d)
            : __m_(&__m), __owns_(__m.try_lock_for(__d)) {}
    _LIBCPP_INLINE_VISIBILITY
    ~unique_lock()
    {
        if (__owns_)
            __m_->unlock();
    }

    ;

    _LIBCPP_INLINE_VISIBILITY
    void swap(unique_lock& __u) _NOEXCEPT
    {
        _VSTD::swap(__m_, __u.__m_);
        _VSTD::swap(__owns_, __u.__owns_);
    }
    _LIBCPP_INLINE_VISIBILITY
    mutex_type* release() _NOEXCEPT
    {
        mutex_type* __m = __m_;
        __m_ = nullptr;
        __owns_ = false;
        return __m;
    }

    _LIBCPP_INLINE_VISIBILITY
    bool owns_lock() const _NOEXCEPT {return __owns_;}
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_EXPLICIT
        operator bool () const _NOEXCEPT {return __owns_;}
    _LIBCPP_INLINE_VISIBILITY
    mutex_type* mutex() const _NOEXCEPT {return __m_;}
};



_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(cv_status)

class _LIBCPP_TYPE_VIS condition_variable
{
    pthread_cond_t __cv_;
public:
    _LIBCPP_INLINE_VISIBILITY
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
    constexpr condition_variable() : __cv_(PTHREAD_COND_INITIALIZER) {}
#else
# 273 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 3
    condition_variable() {__cv_ = (pthread_cond_t)PTHREAD_COND_INITIALIZER;}
#endif
# 275 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 3
    ;


    ;

    typedef pthread_cond_t* native_handle_type;
    _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__cv_;}

private:
    ;
};













_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP___MUTEX_BASE
# 402 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__mutex_base" 3
# 177 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <functional>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 1 3
// -*- C++ -*-
//===------------------------ functional ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_FUNCTIONAL
#define _LIBCPP_FUNCTIONAL

/*
    functional synopsis

#include <__config>
#endif /* expanded by -frewrite-includes */
# 478 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
#if 0 /* expanded by -frewrite-includes */
#include <tuple>
#endif /* expanded by -frewrite-includes */
# 479 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

#if 0 /* expanded by -frewrite-includes */
#include <__functional_base>
#endif /* expanded by -frewrite-includes */
# 481 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 484 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
#endif
# 485 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

_LIBCPP_BEGIN_NAMESPACE_STD

#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
#else
# 491 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
template <class _Tp>
#endif
# 493 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
struct _LIBCPP_TYPE_VIS_ONLY plus : binary_function<_Tp, _Tp, _Tp>
{
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    _Tp operator()(const _Tp& __x, const _Tp& __y) const
        {return __x + __y;}
};

#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY plus<void>
{
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) + _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 511 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY minus<void>
{
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) - _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 536 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3


#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) * _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 561 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3


#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
#else
# 566 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
template <class _Tp>
#endif
# 568 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
struct _LIBCPP_TYPE_VIS_ONLY divides : binary_function<_Tp, _Tp, _Tp>
{
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    _Tp operator()(const _Tp& __x, const _Tp& __y) const
        {return __x / __y;}
};

#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY divides<void>
{
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) / _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 586 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3


#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
#else
# 591 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
template <class _Tp>
#endif
# 593 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
struct _LIBCPP_TYPE_VIS_ONLY modulus : binary_function<_Tp, _Tp, _Tp>
{
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    _Tp operator()(const _Tp& __x, const _Tp& __y) const
        {return __x % __y;}
};

#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY modulus<void>
{
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) % _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 611 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY negate<void>
{
    template <class _Tp>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_Tp&& __x) const
        { return -_VSTD::forward<_Tp>(__x); }
    typedef void is_transparent;
};
#endif
# 636 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3


#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
#else
# 641 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
template <class _Tp>
#endif
# 643 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
struct _LIBCPP_TYPE_VIS_ONLY equal_to : binary_function<_Tp, _Tp, bool>
{
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Tp& __x, const _Tp& __y) const
        {return __x == __y;}
};

#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY equal_to<void>
{
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) == _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 661 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3


#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
#else
# 666 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
template <class _Tp>
#endif
# 668 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
struct _LIBCPP_TYPE_VIS_ONLY not_equal_to : binary_function<_Tp, _Tp, bool>
{
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Tp& __x, const _Tp& __y) const
        {return __x != __y;}
};

#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY not_equal_to<void>
{
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) != _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 686 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3


#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
#else
# 691 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
template <class _Tp>
#endif
# 693 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
struct _LIBCPP_TYPE_VIS_ONLY greater : binary_function<_Tp, _Tp, bool>
{
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Tp& __x, const _Tp& __y) const
        {return __x > __y;}
};

#if _LIBCPP_STD_VER > 11
template <>
};
#endif
# 788 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3


#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
#else
# 793 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
template <class _Tp>
#endif
# 795 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
struct _LIBCPP_TYPE_VIS_ONLY logical_or : binary_function<_Tp, _Tp, bool>
{
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Tp& __x, const _Tp& __y) const
        {return __x || __y;}
};

#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY logical_or<void>
{
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) || _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 813 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3


#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
#else
# 818 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
template <class _Tp>
#endif
# 820 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
struct _LIBCPP_TYPE_VIS_ONLY logical_not : unary_function<_Tp, bool>
{
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Tp& __x) const
        {return !__x;}
};

#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY logical_not<void>
{
    template <class _Tp>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_Tp&& __x) const
        { return !_VSTD::forward<_Tp>(__x); }
    typedef void is_transparent;
};
#endif

#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY bit_and<void>
{
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) & _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 863 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3


#if _LIBCPP_STD_VER > 11
{
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
        { return _VSTD::forward<_T1>(__t) | _VSTD::forward<_T2>(__u); }
    typedef void is_transparent;
};
#endif
# 888 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3


#if _LIBCPP_STD_VER > 11
template <class _Tp = void>
#else
# 893 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
template <class _Tp>
#endif
# 895 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
struct _LIBCPP_TYPE_VIS_ONLY bit_xor : binary_function<_Tp, _Tp, _Tp>
{
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    _Tp operator()(const _Tp& __x, const _Tp& __y) const
        {return __x ^ __y;}
};

#if _LIBCPP_STD_VER > 11
template <>
struct _LIBCPP_TYPE_VIS_ONLY bit_xor<void>
{
    template <class _T1, class _T2>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_T1&& __t, _T2&& __u) const
template <>
struct _LIBCPP_TYPE_VIS_ONLY bit_not<void>
{
    template <class _Tp>
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    auto operator()(_Tp&& __x) const
        { return ~_VSTD::forward<_Tp>(__x); }
    typedef void is_transparent;
};
#endif
# 934 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

template <class _Predicate>
class _LIBCPP_TYPE_VIS_ONLY unary_negate
    : public unary_function<typename _Predicate::argument_type, bool>
{
    _Predicate __pred_;
public:
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    explicit unary_negate(const _Predicate& __pred)
        : __pred_(__pred) {}
    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    bool operator()(const typename _Predicate::argument_type& __x) const
        {return !__pred_(__x);}
};



template <class _Predicate>
class _LIBCPP_TYPE_VIS_ONLY binary_negate
    : public binary_function<typename _Predicate::first_argument_type,
                             typename _Predicate::second_argument_type,
                             bool>
{
    _Predicate __pred_;
public:
    _LIBCPP_INLINE_VISIBILITY explicit _LIBCPP_CONSTEXPR_AFTER_CXX11 
    binary_negate(const _Predicate& __pred) : __pred_(__pred) {}

    _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
    bool operator()(const typename _Predicate::first_argument_type& __x,
                    const typename _Predicate::second_argument_type& __y) const
        {return !__pred_(__x, __y);}
};



template <class __Operation>
class _LIBCPP_TYPE_VIS_ONLY binder1st
    : public unary_function<typename __Operation::second_argument_type,
                            typename __Operation::result_type>
{
protected:
    __Operation                               op;
    typename __Operation::first_argument_type value;
public:
    _LIBCPP_INLINE_VISIBILITY binder1st(const __Operation& __x,
                               const typename __Operation::first_argument_type __y)
        : op(__x), value(__y) {}
    _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
        (typename __Operation::second_argument_type& __x) const
            {return op(value, __x);}
    _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
        (const typename __Operation::second_argument_type& __x) const
            {return op(value, __x);}
};



template <class __Operation>
class _LIBCPP_TYPE_VIS_ONLY binder2nd
    : public unary_function<typename __Operation::first_argument_type,
                            typename __Operation::result_type>
{
protected:
    __Operation                                op;
    typename __Operation::second_argument_type value;
public:
    _LIBCPP_INLINE_VISIBILITY
    binder2nd(const __Operation& __x, const typename __Operation::second_argument_type __y)
        : op(__x), value(__y) {}
    _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
        (      typename __Operation::first_argument_type& __x) const
            {return op(__x, value);}
    _LIBCPP_INLINE_VISIBILITY typename __Operation::result_type operator()
        (const typename __Operation::first_argument_type& __x) const
            {return op(__x, value);}
};



template <class _Arg, class _Result>
class _LIBCPP_TYPE_VIS_ONLY pointer_to_unary_function
    : public unary_function<_Arg, _Result>
{
    _Result (*__f_)(_Arg);
public:
    _LIBCPP_INLINE_VISIBILITY explicit pointer_to_unary_function(_Result (*__f)(_Arg))
        : __f_(__f) {}
    _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg __x) const
        {return __f_(__x);}
};



template <class _Arg1, class _Arg2, class _Result>
class _LIBCPP_TYPE_VIS_ONLY pointer_to_binary_function
    : public binary_function<_Arg1, _Arg2, _Result>
{
    _Result (*__f_)(_Arg1, _Arg2);
public:
    _LIBCPP_INLINE_VISIBILITY explicit pointer_to_binary_function(_Result (*__f)(_Arg1, _Arg2))
        : __f_(__f) {}
    _LIBCPP_INLINE_VISIBILITY _Result operator()(_Arg1 __x, _Arg2 __y) const
        {return __f_(__x, __y);}
};



template<class _Sp, class _Tp>
class _LIBCPP_TYPE_VIS_ONLY mem_fun_t : public unary_function<_Tp*, _Sp>
{
    _Sp (_Tp::*__p_)();
public:
    _LIBCPP_INLINE_VISIBILITY explicit mem_fun_t(_Sp (_Tp::*__p)())
        : __p_(__p) {}
    _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p) const
        {return (__p->*__p_)();}
};

template<class _Sp, class _Tp, class _Ap>
class _LIBCPP_TYPE_VIS_ONLY mem_fun1_t : public binary_function<_Tp*, _Ap, _Sp>
{
    _Sp (_Tp::*__p_)(_Ap);
public:
    _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_t(_Sp (_Tp::*__p)(_Ap))
        : __p_(__p) {}
    _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp* __p, _Ap __x) const
        {return (__p->*__p_)(__x);}
};





template<class _Sp, class _Tp>
class _LIBCPP_TYPE_VIS_ONLY mem_fun_ref_t : public unary_function<_Tp, _Sp>
{
    _Sp (_Tp::*__p_)();
public:
    _LIBCPP_INLINE_VISIBILITY explicit mem_fun_ref_t(_Sp (_Tp::*__p)())
        : __p_(__p) {}
    _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p) const
        {return (__p.*__p_)();}
};

template<class _Sp, class _Tp, class _Ap>
class _LIBCPP_TYPE_VIS_ONLY mem_fun1_ref_t : public binary_function<_Tp, _Ap, _Sp>
{
    _Sp (_Tp::*__p_)(_Ap);
public:
    _LIBCPP_INLINE_VISIBILITY explicit mem_fun1_ref_t(_Sp (_Tp::*__p)(_Ap))
        : __p_(__p) {}
    _LIBCPP_INLINE_VISIBILITY _Sp operator()(_Tp& __p, _Ap __x) const
        {return (__p.*__p_)(__x);}
};





template <class _Sp, class _Tp>
class _LIBCPP_TYPE_VIS_ONLY const_mem_fun_t : public unary_function<const _Tp*, _Sp>
{
    _Sp (_Tp::*__p_)() const;
public:
    _LIBCPP_INLINE_VISIBILITY explicit const_mem_fun_t(_Sp (_Tp::*__p)() const)
        : __p_(__p) {}
    _LIBCPP_INLINE_VISIBILITY _Sp operator()(const _Tp* __p) const
        {return (__p->*__p_)();}
};

template <class _Sp, class _Tp, class _Ap>
class _LIBCPP_TYPE_VIS_ONLY const_mem_fun1_t : public binary_function<const _Tp*, _Ap, _Sp>
{
    _Sp (_Tp::*__p_)(_Ap) const;
public:
};





#ifdef _LIBCPP_HAS_NO_VARIADICS

#if 0 /* expanded by -frewrite-includes */
#include <__functional_03>
#endif /* expanded by -frewrite-includes */
# 1204 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

#else  // _LIBCPP_HAS_NO_VARIADICS
# 1206 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

template <class _Tp>
class __mem_fn
    : public __weak_result_type<_Tp>
{
public:
};

template<class _Rp, class _Tp>
inline _LIBCPP_INLINE_VISIBILITY
__mem_fn<_Rp _Tp::*>
mem_fn(_Rp _Tp::* __pm)
{
    return __mem_fn<_Rp _Tp::*>(__pm);
}

// bad_function_call

class _LIBCPP_EXCEPTION_ABI bad_function_call
    : public exception
{
};

template<class _Fp> class _LIBCPP_TYPE_VIS_ONLY function; // undefined

namespace __function
{

template<class _Rp, class ..._ArgTypes>
struct __maybe_derive_from_unary_function
{
};

template<class _Rp, class _A1>
struct __maybe_derive_from_unary_function<_Rp(_A1)>
    : public unary_function<_A1, _Rp>
{
};

template<class _Rp, class ..._ArgTypes>
struct __maybe_derive_from_binary_function
{
};

template<class _Rp, class _A1, class _A2>
struct __maybe_derive_from_binary_function<_Rp(_A1, _A2)>
    : public binary_function<_A1, _A2, _Rp>
{
};

template<class _Fp> class __base;

template<class _Rp, class ..._ArgTypes>
class __base<_Rp(_ArgTypes...)>
{
    __base(const __base&);
    __base& operator=(const __base&);
public:
    _LIBCPP_INLINE_VISIBILITY __base() {}
    _LIBCPP_INLINE_VISIBILITY virtual ~__base() {}
    virtual __base* __clone() const = 0;
    virtual void __clone(__base*) const = 0;
    virtual void destroy() _NOEXCEPT = 0;
    virtual void destroy_deallocate() _NOEXCEPT = 0;
    virtual _Rp operator()(_ArgTypes&& ...) = 0;
#ifndef _LIBCPP_NO_RTTI
    virtual const void* target(const type_info&) const _NOEXCEPT = 0;
    virtual const std::type_info& target_type() const _NOEXCEPT = 0;
#endif  // _LIBCPP_NO_RTTI
# 1291 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
};

template<class _FD, class _Alloc, class _FB> class __func;

template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
class __func<_Fp, _Alloc, _Rp(_ArgTypes...)>
    : public  __base<_Rp(_ArgTypes...)>
{
    __compressed_pair<_Fp, _Alloc> __f_;
public:
    _LIBCPP_INLINE_VISIBILITY
    explicit __func(_Fp&& __f)
        : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)),
                                    _VSTD::forward_as_tuple()) {}
    _LIBCPP_INLINE_VISIBILITY
    explicit __func(const _Fp& __f, const _Alloc& __a)
        : __f_(piecewise_construct, _VSTD::forward_as_tuple(__f),
                                    _VSTD::forward_as_tuple(__a)) {}

    _LIBCPP_INLINE_VISIBILITY
    explicit __func(const _Fp& __f, _Alloc&& __a)
        : __f_(piecewise_construct, _VSTD::forward_as_tuple(__f),
                                    _VSTD::forward_as_tuple(_VSTD::move(__a))) {}

    _LIBCPP_INLINE_VISIBILITY
    explicit __func(_Fp&& __f, _Alloc&& __a)
        : __f_(piecewise_construct, _VSTD::forward_as_tuple(_VSTD::move(__f)),
                                    _VSTD::forward_as_tuple(_VSTD::move(__a))) {}
    virtual __base<_Rp(_ArgTypes...)>* __clone() const;
    virtual void __clone(__base<_Rp(_ArgTypes...)>*) const;
    virtual void destroy() _NOEXCEPT;
    virtual void destroy_deallocate() _NOEXCEPT;
    virtual _Rp operator()(_ArgTypes&& ... __arg);
#ifndef _LIBCPP_NO_RTTI
    virtual const void* target(const type_info&) const _NOEXCEPT;
    virtual const std::type_info& target_type() const _NOEXCEPT;
#endif  // _LIBCPP_NO_RTTI
# 1328 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
};

template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
__base<_Rp(_ArgTypes...)>*
__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::__clone() const
{
    typedef typename _Alloc::template rebind<__func>::other _Ap;
    _Ap __a(__f_.second());
    typedef __allocator_destructor<_Ap> _Dp;
    unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
}

template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
void
__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::destroy_deallocate() _NOEXCEPT
{
    typedef typename _Alloc::template rebind<__func>::other _Ap;
    _Ap __a(__f_.second());
    __f_.~__compressed_pair<_Fp, _Alloc>();
    __a.deallocate(this, 1);
}

template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
_Rp
__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::operator()(_ArgTypes&& ... __arg)
{
    return __invoke(__f_.first(), _VSTD::forward<_ArgTypes>(__arg)...);
}

#ifndef _LIBCPP_NO_RTTI

template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
const void*
__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target(const type_info& __ti) const _NOEXCEPT
{
    if (__ti == typeid(_Fp))
        return &__f_.first();
    return (const void*)0;
}

template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
const std::type_info&
__func<_Fp, _Alloc, _Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
{
    return typeid(_Fp);
}

#endif  // _LIBCPP_NO_RTTI
# 1392 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

}  // __function

template<class _Rp, class ..._ArgTypes>
class _LIBCPP_TYPE_VIS_ONLY function<_Rp(_ArgTypes...)>
    : public __function::__maybe_derive_from_unary_function<_Rp(_ArgTypes...)>,
      public __function::__maybe_derive_from_binary_function<_Rp(_ArgTypes...)>
{
    typedef __function::__base<_Rp(_ArgTypes...)> __base;
    typename aligned_storage<3*sizeof(void*)>::type __buf_;
    __base* __f_;

    template <class _Fp>
        _LIBCPP_INLINE_VISIBILITY
        static bool __not_null(const _Fp&) {return true;}
    template <class _R2, class ..._Ap>
        _LIBCPP_INLINE_VISIBILITY
        static bool __not_null(_R2 (*__p)(_Ap...)) {return __p;}
    template <class _R2, class _Cp, class ..._Ap>
        _LIBCPP_INLINE_VISIBILITY
        static bool __not_null(_R2 (_Cp::*__p)(_Ap...)) {return __p;}
    template <class _R2, class _Cp, class ..._Ap>
        _LIBCPP_INLINE_VISIBILITY
        static bool __not_null(_R2 (_Cp::*__p)(_Ap...) const) {return __p;}
    template <class _R2, class _Cp, class ..._Ap>
        _LIBCPP_INLINE_VISIBILITY
        static bool __not_null(_R2 (_Cp::*__p)(_Ap...) volatile) {return __p;}
    template <class _R2, class _Cp, class ..._Ap>
        _LIBCPP_INLINE_VISIBILITY
        static bool __not_null(_R2 (_Cp::*__p)(_Ap...) const volatile) {return __p;}
    template <class _R2, class ..._Ap>
        _LIBCPP_INLINE_VISIBILITY
        static bool __not_null(const function<_Rp(_Ap...)>& __p) {return __p;}

    template <class _Fp, bool = !is_same<_Fp, function>::value &&
                                __invokable<_Fp&, _ArgTypes...>::value>
        struct __callable;
    template <class _Fp>
        struct __callable<_Fp, true>
        {
            static const bool value =
                is_convertible<typename __invoke_of<_Fp&, _ArgTypes...>::type,
                               _Rp>::value;
        };
    template <class _Fp>
        struct __callable<_Fp, false>
        {
            static const bool value = false;
        };
public:
    typedef _Rp result_type;

    // construct/copy/destroy:
    _LIBCPP_INLINE_VISIBILITY
    function() _NOEXCEPT : __f_(0) {}
    _LIBCPP_INLINE_VISIBILITY
    function(nullptr_t) _NOEXCEPT : __f_(0) {}
    function(const function&);
    function(function&&) _NOEXCEPT;
    template<class _Fp>
      function(_Fp, typename enable_if
                                     <
                                        __callable<_Fp>::value &&
                                        !is_same<_Fp, function>::value
                                      >::type* = 0);

    template<class _Alloc>
      _LIBCPP_INLINE_VISIBILITY
      function(allocator_arg_t, const _Alloc&) _NOEXCEPT : __f_(0) {}
    template<class _Alloc>
      _LIBCPP_INLINE_VISIBILITY
      function(allocator_arg_t, const _Alloc&, nullptr_t) _NOEXCEPT : __f_(0) {}
    template<class _Alloc>
      function(allocator_arg_t, const _Alloc&, const function&);
    template<class _Alloc>
      function(allocator_arg_t, const _Alloc&, function&&);
    template<class _Fp, class _Alloc>
      function(allocator_arg_t, const _Alloc& __a, _Fp __f,
               typename enable_if<__callable<_Fp>::value>::type* = 0);

    function& operator=(const function&);
    function& operator=(function&&) _NOEXCEPT;
    function& operator=(nullptr_t) _NOEXCEPT;
    template<class _Fp>
      typename enable_if
      <
        __callable<typename decay<_Fp>::type>::value &&
        !is_same<typename remove_reference<_Fp>::type, function>::value,
        function&
      >::type
      operator=(_Fp&&);

    ~function();

    // function modifiers:
    void swap(function&) _NOEXCEPT;
    template<class _Fp, class _Alloc>
      _LIBCPP_INLINE_VISIBILITY
      void assign(_Fp&& __f, const _Alloc& __a)
        {function(allocator_arg, __a, _VSTD::forward<_Fp>(__f)).swap(*this);}

    // function capacity:
    _LIBCPP_INLINE_VISIBILITY
        _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return __f_;}

    // deleted overloads close possible hole in the type system
    template<class _R2, class... _ArgTypes2>
      bool operator==(const function<_R2(_ArgTypes2...)>&) const = delete;
    template<class _R2, class... _ArgTypes2>
      bool operator!=(const function<_R2(_ArgTypes2...)>&) const = delete;
public:
    // function invocation:
    _Rp operator()(_ArgTypes...) const;

#ifndef _LIBCPP_NO_RTTI
    // function target access:
    const std::type_info& target_type() const _NOEXCEPT;
    template <typename _Tp> _Tp* target() _NOEXCEPT;
    template <typename _Tp> const _Tp* target() const _NOEXCEPT;
#endif  // _LIBCPP_NO_RTTI
# 1512 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
};

template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>::function(const function& __f)
{
    if (__f.__f_ == 0)
        __f_ = 0;
    else if (__f.__f_ == (const __base*)&__f.__buf_)
    {
        __f_ = (__base*)&__buf_;
        __f.__f_->__clone(__f_);
    }
    else
        __f_ = __f.__f_->__clone();
}


template<class _Rp, class ..._ArgTypes>
template <class _Alloc>
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc&,
                                     function&& __f)
{
    if (__f.__f_ == 0)
        __f_ = 0;
    else if (__f.__f_ == (__base*)&__f.__buf_)
    {
        __f_ = (__base*)&__buf_;
        __f.__f_->__clone(__f_);
    }
    else
    {
        __f_ = __f.__f_;
        __f.__f_ = 0;
    }
}

template<class _Rp, class ..._ArgTypes>
template <class _Fp>
function<_Rp(_ArgTypes...)>::function(_Fp __f,
                                     typename enable_if
                                     <
                                        __callable<_Fp>::value &&
                                        !is_same<_Fp, function>::value
                                     >::type*)
    : __f_(0)
{
    if (__not_null(__f))
    {
        typedef __function::__func<_Fp, allocator<_Fp>, _Rp(_ArgTypes...)> _FF;
        if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_Fp>::value)
        {
            __f_ = (__base*)&__buf_;
            ::new (__f_) _FF(_VSTD::move(__f));
        }
        else
        {
            typedef allocator<_FF> _Ap;
            _Ap __a;
            typedef __allocator_destructor<_Ap> _Dp;
            unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
            ::new (__hold.get()) _FF(_VSTD::move(__f), allocator<_Fp>(__a));
            __f_ = __hold.release();
        }
    }
}

template<class _Rp, class ..._ArgTypes>
template <class _Fp, class _Alloc>
function<_Rp(_ArgTypes...)>::function(allocator_arg_t, const _Alloc& __a0, _Fp __f,
                                     typename enable_if<__callable<_Fp>::value>::type*)
    : __f_(0)
{
    typedef allocator_traits<_Alloc> __alloc_traits;
    if (__not_null(__f))
    {
        typedef __function::__func<_Fp, _Alloc, _Rp(_ArgTypes...)> _FF;
        if (sizeof(_FF) <= sizeof(__buf_) && is_nothrow_copy_constructible<_Fp>::value)
        {
            __f_ = (__base*)&__buf_;
            ::new (__f_) _FF(_VSTD::move(__f));
        }
        else
        {
            typedef typename __alloc_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
                rebind_alloc<_FF>
#else
# 1631 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
                rebind_alloc<_FF>::other
#endif
# 1633 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
                                                         _Ap;
            _Ap __a(__a0);
            typedef __allocator_destructor<_Ap> _Dp;
            unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
            ::new (__hold.get()) _FF(_VSTD::move(__f), _Alloc(__a));
            __f_ = __hold.release();
        }
    }
}

template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>&
function<_Rp(_ArgTypes...)>::operator=(const function& __f)
{
    function(__f).swap(*this);
    return *this;
}

template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>&
function<_Rp(_ArgTypes...)>::operator=(function&& __f) _NOEXCEPT
{
    if (__f_ == (__base*)&__buf_)
        __f_->destroy();
    else if (__f_)
        __f_->destroy_deallocate();
    __f_ = 0;
    if (__f.__f_ == 0)
        __f_ = 0;
    else if (__f.__f_ == (__base*)&__f.__buf_)
    {
        __f_ = (__base*)&__buf_;
        __f.__f_->__clone(__f_);
    }
    else
    {
        __f_ = __f.__f_;
        __f.__f_ = 0;
    }
    return *this;
}

template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>&
function<_Rp(_ArgTypes...)>::operator=(nullptr_t) _NOEXCEPT
{
    if (__f_ == (__base*)&__buf_)
        __f_->destroy();
    else if (__f_)
        __f_->destroy_deallocate();
    __f_ = 0;
    return *this;
}

template<class _Rp, class ..._ArgTypes>
template <class _Fp>
typename enable_if
<
    function<_Rp(_ArgTypes...)>::template __callable<typename decay<_Fp>::type>::value &&
    !is_same<typename remove_reference<_Fp>::type, function<_Rp(_ArgTypes...)>>::value,
    function<_Rp(_ArgTypes...)>&
>::type
function<_Rp(_ArgTypes...)>::operator=(_Fp&& __f)
{
    function(_VSTD::forward<_Fp>(__f)).swap(*this);
    return *this;
}

template<class _Rp, class ..._ArgTypes>
function<_Rp(_ArgTypes...)>::~function()
{
    if (__f_ == (__base*)&__buf_)
        __f_->destroy();
    else if (__f_)
        __f_->destroy_deallocate();
}

template<class _Rp, class ..._ArgTypes>
void
function<_Rp(_ArgTypes...)>::swap(function& __f) _NOEXCEPT
{
    if (__f_ == (__base*)&__buf_ && __f.__f_ == (__base*)&__f.__buf_)
    {
        typename aligned_storage<sizeof(__buf_)>::type __tempbuf;
        __base* __t = (__base*)&__tempbuf;
        __f.__f_ = (__base*)&__f.__buf_;
    }
    else if (__f.__f_ == (__base*)&__f.__buf_)
    {
        __f.__f_->__clone((__base*)&__buf_);
        __f.__f_->destroy();
        __f.__f_ = __f_;
        __f_ = (__base*)&__buf_;
    }
    else
        _VSTD::swap(__f_, __f.__f_);
}

template<class _Rp, class ..._ArgTypes>
_Rp
function<_Rp(_ArgTypes...)>::operator()(_ArgTypes... __arg) const
{
#ifndef _LIBCPP_NO_EXCEPTIONS
    if (__f_ == 0)
        throw bad_function_call();
#endif  // _LIBCPP_NO_EXCEPTIONS
# 1755 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
    return (*__f_)(_VSTD::forward<_ArgTypes>(__arg)...);
}

#ifndef _LIBCPP_NO_RTTI

template<class _Rp, class ..._ArgTypes>
const std::type_info&
function<_Rp(_ArgTypes...)>::target_type() const _NOEXCEPT
{
    if (__f_ == 0)
const _Tp*
function<_Rp(_ArgTypes...)>::target() const _NOEXCEPT
{
    if (__f_ == 0)
        return (const _Tp*)0;
    return (const _Tp*)__f_->target(typeid(_Tp));
}

#endif  // _LIBCPP_NO_RTTI
# 1790 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

template <class _Rp, class... _ArgTypes>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator==(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return !__f;}

template <class _Rp, class... _ArgTypes>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator==(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return !__f;}

template <class _Rp, class... _ArgTypes>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator!=(const function<_Rp(_ArgTypes...)>& __f, nullptr_t) _NOEXCEPT {return (bool)__f;}

template <class _Rp, class... _ArgTypes>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator!=(nullptr_t, const function<_Rp(_ArgTypes...)>& __f) _NOEXCEPT {return (bool)__f;}

template <class _Rp, class... _ArgTypes>
inline _LIBCPP_INLINE_VISIBILITY
void
swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
{return __x.swap(__y);}

template<class _Tp> struct __is_bind_expression : public false_type {};
template<class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_bind_expression
    : public __is_bind_expression<typename remove_cv<_Tp>::type> {};

template<class _Tp> struct __is_placeholder : public integral_constant<int, 0> {};
template<class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_placeholder
    : public __is_placeholder<typename remove_cv<_Tp>::type> {};

namespace placeholders
{

template <int _Np> struct __ph {};

_LIBCPP_FUNC_VIS extern __ph<1>   _1;
_LIBCPP_FUNC_VIS extern __ph<2>   _2;
_LIBCPP_FUNC_VIS extern __ph<3>   _3;
_LIBCPP_FUNC_VIS extern __ph<4>   _4;
_LIBCPP_FUNC_VIS extern __ph<5>   _5;
_LIBCPP_FUNC_VIS extern __ph<6>   _6;
_LIBCPP_FUNC_VIS extern __ph<7>   _7;
_LIBCPP_FUNC_VIS extern __ph<8>   _8;
_LIBCPP_FUNC_VIS extern __ph<9>   _9;
_LIBCPP_FUNC_VIS extern __ph<10> _10;

}  // placeholders

template<int _Np>
struct __is_placeholder<placeholders::__ph<_Np> >
    : public integral_constant<int, _Np> {};

template <class _Tp, class _Uj>
inline _LIBCPP_INLINE_VISIBILITY
_Tp&
__mu(reference_wrapper<_Tp> __t, _Uj&)
{
    return __t.get();
}

template <class _Ti, class ..._Uj, size_t ..._Indx>
inline _LIBCPP_INLINE_VISIBILITY
typename __invoke_of<_Ti&, _Uj...>::type
__mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>)
{
    return __ti(_VSTD::forward<_Uj>(get<_Indx>(__uj))...);
}

template <class _Ti, class ..._Uj>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    is_bind_expression<_Ti>::value,
    typename __invoke_of<_Ti&, _Uj...>::type
>::type
__mu(_Ti& __ti, tuple<_Uj...>& __uj)
{
    typedef typename __make_tuple_indices<sizeof...(_Uj)>::type __indices;
    return  __mu_expand(__ti, __uj, __indices());
}

template <bool IsPh, class _Ti, class _Uj>
struct __mu_return2 {};

template <class _Ti, class _Uj>
struct __mu_return2<true, _Ti, _Uj>
{
    typedef typename tuple_element<is_placeholder<_Ti>::value - 1, _Uj>::type type;
};

template <class _Ti, class _Uj>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    0 < is_placeholder<_Ti>::value,
    typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
>::type
__mu(_Ti&, _Uj& __uj)
{
    const size_t _Indx = is_placeholder<_Ti>::value - 1;
    return _VSTD::forward<typename tuple_element<_Indx, _Uj>::type>(get<_Indx>(__uj));
}

template <class _Ti, class _Uj>
inline _LIBCPP_INLINE_VISIBILITY
typename enable_if
<
    !is_bind_expression<_Ti>::value &&
    is_placeholder<_Ti>::value == 0 &&
    !__is_reference_wrapper<_Ti>::value,
    _Ti&
>::type
__mu(_Ti& __ti, _Uj&)
{
    return __ti;
}

template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh,
          class _TupleUj>
struct ____mu_return;

template <bool _Invokable, class _Ti, class ..._Uj>
struct ____mu_return_invokable  // false
{
    typedef __nat type;
};

template <class _Ti, class ..._Uj>
struct ____mu_return_invokable<true, _Ti, _Uj...>
{
    typedef typename __invoke_of<_Ti&, _Uj...>::type type;
};

template <class _Ti, class ..._Uj>
struct ____mu_return<_Ti, false, true, false, tuple<_Uj...> >
    : public ____mu_return_invokable<__invokable<_Ti&, _Uj...>::value, _Ti, _Uj...>
{
};

template <class _Ti, class _TupleUj>
struct ____mu_return<_Ti, false, false, true, _TupleUj>
{
    typedef typename tuple_element<is_placeholder<_Ti>::value - 1,
                                   _TupleUj>::type&& type;
};

template <class _Ti, class _TupleUj>
struct ____mu_return<_Ti, true, false, false, _TupleUj>
{
    typedef typename _Ti::type& type;
};

template <class _Ti, class _TupleUj>
struct ____mu_return<_Ti, false, false, false, _TupleUj>
{
    typedef _Ti& type;
};

template <class _Ti, class _TupleUj>
struct __mu_return
    : public ____mu_return<_Ti,
                           __is_reference_wrapper<_Ti>::value,
                           is_bind_expression<_Ti>::value,
                           0 < is_placeholder<_Ti>::value &&
                           is_placeholder<_Ti>::value <= tuple_size<_TupleUj>::value,
                           _TupleUj>
{
};

template <class _Fp, class _BoundArgs, class _TupleUj>
struct _is_valid_bind_return
{
    static const bool value = false;
};

template <class _Fp, class ..._BoundArgs, class _TupleUj>
struct _is_valid_bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj>
{
    static const bool value = __invokable<_Fp,
                    typename __mu_return<_BoundArgs, _TupleUj>::type...>::value;
};

template <class _Fp, class ..._BoundArgs, class _TupleUj>
struct _is_valid_bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj>
{
    static const bool value = __invokable<_Fp,
                    typename __mu_return<const _BoundArgs, _TupleUj>::type...>::value;
};

template <class _Fp, class _BoundArgs, class _TupleUj,
          bool = _is_valid_bind_return<_Fp, _BoundArgs, _TupleUj>::value>
struct __bind_return;

template <class _Fp, class ..._BoundArgs, class _TupleUj>
struct __bind_return<_Fp, tuple<_BoundArgs...>, _TupleUj, true>
{
    typedef typename __invoke_of
    <
        _Fp&,
        typename __mu_return
        <
            _BoundArgs,
            _TupleUj
        >::type...
    >::type type;
};

template <class _Fp, class ..._BoundArgs, class _TupleUj>
struct __bind_return<_Fp, const tuple<_BoundArgs...>, _TupleUj, true>
{
    typedef typename __invoke_of
    <
        _Fp&,
        typename __mu_return
        <
            const _BoundArgs,
            _TupleUj
        >::type...
    >::type type;
};

template <class _Fp, class _BoundArgs, size_t ..._Indx, class _Args>
inline _LIBCPP_INLINE_VISIBILITY
typename __bind_return<_Fp, _BoundArgs, _Args>::type
__apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
                _Args&& __args)
{
    return __invoke(__f, __mu(get<_Indx>(__bound_args), __args)...);
}

template<class _Fp, class ..._BoundArgs>
class __bind
    : public __weak_result_type<typename decay<_Fp>::type>
{
protected:
    typedef typename decay<_Fp>::type _Fd;
    typedef tuple<typename decay<_BoundArgs>::type...> _Td;
private:
    _Fd __f_;
    _Td __bound_args_;

    typedef typename __make_tuple_indices<sizeof...(_BoundArgs)>::type __indices;
public:
#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS

    _LIBCPP_INLINE_VISIBILITY
    __bind(const __bind& __b)
        : __f_(__b.__f_),
          __bound_args_(__b.__bound_args_) {}

    _LIBCPP_INLINE_VISIBILITY
    __bind& operator=(const __bind& __b)
    {
        __f_ = __b.__f_;
        __bound_args_ = __b.__bound_args_;
        return *this;
    }

    _LIBCPP_INLINE_VISIBILITY
    __bind(__bind&& __b)
        : __f_(_VSTD::move(__b.__f_)),
          __bound_args_(_VSTD::move(__b.__bound_args_)) {}

    _LIBCPP_INLINE_VISIBILITY
    __bind& operator=(__bind&& __b)
    {
        __f_ = _VSTD::move(__b.__f_);
        __bound_args_ = _VSTD::move(__b.__bound_args_);
        return *this;
    }

#endif  // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
# 2067 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

    template <class _Gp, class ..._BA,
              class = typename enable_if
                               <
                                  is_constructible<_Fd, _Gp>::value &&
                                  !is_same<typename remove_reference<_Gp>::type,
                                           __bind>::value
                               >::type>
      _LIBCPP_INLINE_VISIBILITY
      explicit __bind(_Gp&& __f, _BA&& ...__bound_args)
        : __f_(_VSTD::forward<_Gp>(__f)),
          __bound_args_(_VSTD::forward<_BA>(__bound_args)...) {}

    template <class ..._Args>
        _LIBCPP_INLINE_VISIBILITY
        typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
        operator()(_Args&& ...__args)
        {
            return __apply_functor(__f_, __bound_args_, __indices(),
                                  tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
        }

    template <class ..._Args>
        _LIBCPP_INLINE_VISIBILITY
        typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
        operator()(_Args&& ...__args) const
        {
            return __apply_functor(__f_, __bound_args_, __indices(),
                                   tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
        }
};

template<class _Fp, class ..._BoundArgs>
struct __is_bind_expression<__bind<_Fp, _BoundArgs...> > : public true_type {};

template<class _Rp, class _Fp, class ..._BoundArgs>
class __bind_r
    : public __bind<_Fp, _BoundArgs...>
{
    typedef __bind<_Fp, _BoundArgs...> base;
    typedef typename base::_Fd _Fd;
    typedef typename base::_Td _Td;
public:
    typedef _Rp result_type;

#ifdef _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS

    _LIBCPP_INLINE_VISIBILITY
    {
        base::operator=(_VSTD::forward<base>(__b));
        return *this;
    }

#endif  // _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS
# 2137 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

    template <class _Gp, class ..._BA,
              class = typename enable_if
                               <
                                  is_constructible<_Fd, _Gp>::value &&
                                  !is_same<typename remove_reference<_Gp>::type,
                                           __bind_r>::value
                               >::type>
      _LIBCPP_INLINE_VISIBILITY
      explicit __bind_r(_Gp&& __f, _BA&& ...__bound_args)
        : base(_VSTD::forward<_Gp>(__f),
               _VSTD::forward<_BA>(__bound_args)...) {}

    template <class ..._Args>
        _LIBCPP_INLINE_VISIBILITY
        typename enable_if
        <
            is_convertible<typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type,
                           result_type>::value,
            result_type
        >::type
        operator()(_Args&& ...__args)
        {
            return base::operator()(_VSTD::forward<_Args>(__args)...);
        }

    template <class ..._Args>
        _LIBCPP_INLINE_VISIBILITY
        typename enable_if
        <
            is_convertible<typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type,
                           result_type>::value,
            result_type
        >::type
        operator()(_Args&& ...__args) const
        {
            return base::operator()(_VSTD::forward<_Args>(__args)...);
        }
};

template<class _Rp, class _Fp, class ..._BoundArgs>
struct __is_bind_expression<__bind_r<_Rp, _Fp, _BoundArgs...> > : public true_type {};

template<class _Fp, class ..._BoundArgs>
inline _LIBCPP_INLINE_VISIBILITY
__bind<_Fp, _BoundArgs...>
bind(_Fp&& __f, _BoundArgs&&... __bound_args)
{
    typedef __bind<_Fp, _BoundArgs...> type;
    return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
}

template<class _Rp, class _Fp, class ..._BoundArgs>
inline _LIBCPP_INLINE_VISIBILITY
__bind_r<_Rp, _Fp, _BoundArgs...>
bind(_Fp&& __f, _BoundArgs&&... __bound_args)
{
    typedef __bind_r<_Rp, _Fp, _BoundArgs...> type;
    return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2199 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<bool>
    : public unary_function<bool, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(bool __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned char>
    : public unary_function<unsigned char, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(unsigned char __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};

#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<char16_t>
    : public unary_function<char16_t, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(char16_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<char32_t>
    : public unary_function<char32_t, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(char32_t __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};

#endif  // _LIBCPP_HAS_NO_UNICODE_CHARS
# 2251 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<wchar_t>
    : public unary_function<wchar_t, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(unsigned short __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<int>
    : public unary_function<int, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(int __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned int>
    : public unary_function<unsigned int, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(unsigned long __v) const _NOEXCEPT {return static_cast<size_t>(__v);}
};

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<long long>
    : public __scalar_hash<long long>
{
};

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<unsigned long long>
    : public __scalar_hash<unsigned long long>
{
};

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<float>
    : public __scalar_hash<float>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(float __v) const _NOEXCEPT
    {
        // -0.0 and 0.0 should return same hash
       if (__v == 0)
           return 0;
        return __scalar_hash<float>::operator()(__v);
    }
};

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<double>
    : public __scalar_hash<double>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(double __v) const _NOEXCEPT
    {
        // -0.0 and 0.0 should return same hash
       if (__v == 0)
           return 0;
        return __scalar_hash<double>::operator()(__v);
    }
};

template <>
struct _LIBCPP_TYPE_VIS_ONLY hash<long double>
    : public __scalar_hash<long double>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(long double __v) const _NOEXCEPT
    {
        // -0.0 and 0.0 should return same hash
        if (__v == 0)
            return 0;
#if defined(__i386__)
        // Zero out padding bits
        union
        {
            long double __t;
            struct
            {
                size_t __a;
                size_t __b;
                size_t __c;
            {
                size_t __a;
                size_t __b;
            };
        } __u;
        __u.__a = 0;
        __u.__b = 0;
        __u.__t = __v;
        return __u.__a ^ __u.__b;
#else
# 2393 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
        return __scalar_hash<long double>::operator()(__v);
#endif
# 2395 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
    }
};
# 2413 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3

// struct hash<T*> in <memory>

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_FUNCTIONAL
# 2419 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional" 3
# 178 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 2 3
#ifndef _LIBCPP_HAS_NO_VARIADICS
#if 0 /* expanded by -frewrite-includes */
#include <tuple>
#endif /* expanded by -frewrite-includes */
# 180 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3
#endif
# 181 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifdef min
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro min is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing min")
#else
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro min is incompatible with C++.  #undefing min
#endif
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef min
#endif
# 20 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3

#ifdef max
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro max is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing max")
#else
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro max is incompatible with C++.  #undefing max
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
#endif
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 183 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 186 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3
#endif
# 187 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3

_LIBCPP_BEGIN_NAMESPACE_STD

class _LIBCPP_TYPE_VIS recursive_mutex
{
    pthread_mutex_t __m_;

public:
     ;
     ;

private:
    ; // = delete;
    ; // = delete;

    ; // = delete;
    ; // = delete;

public:
    ;
    bool try_lock() _NOEXCEPT;
    template <class _Rep, class _Period>
        _LIBCPP_INLINE_VISIBILITY
        bool try_lock_for(const chrono::duration<_Rep, _Period>& __d)
            {return try_lock_until(chrono::steady_clock::now() + __d);}
    ;
    void unlock() _NOEXCEPT;
};





#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _L0, class _L1, class _L2, class... _L3>
int
try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3)
{
    int __r = 0;
    unique_lock<_L0> __u0(__l0, try_to_lock);
    if (__u0.owns_lock())
    {
        __r = try_lock(__l1, __l2, __l3...);
        if (__r == -1)
            __u0.release();
        else
            ++__r;
    }
    return __r;
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 344 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3



#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _L0, class _L1, class _L2, class ..._L3>
void
__lock_first(int __i, _L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
{
    while (true)
    {
        switch (__i)
        {
        case 0:
            {
                unique_lock<_L0> __u0(__l0);
                __i = try_lock(__l1, __l2, __l3...);
                if (__i == -1)
                {
                    __u0.release();
                    return;
                }
            }
            ++__i;
            sched_yield();
            break;
        default:
            __lock_first(__i - 2, __l2, __l3..., __l0, __l1);
            return;
        }
    }
}

template <class _L0, class _L1, class _L2, class ..._L3>
inline _LIBCPP_INLINE_VISIBILITY
void
lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3& ...__l3)
{
    __lock_first(0, __l0, __l1, __l2, __l3...);
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 427 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3

struct _LIBCPP_TYPE_VIS once_flag;

#ifndef _LIBCPP_HAS_NO_VARIADICS

template<class _Callable, class... _Args>
_LIBCPP_INLINE_VISIBILITY
void call_once(once_flag&, _Callable&&, _Args&&...);

#else  // _LIBCPP_HAS_NO_VARIADICS
# 437 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3

template<class _Callable>
_LIBCPP_INLINE_VISIBILITY
void call_once(once_flag&, _Callable);

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 443 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3

struct _LIBCPP_TYPE_VIS_ONLY once_flag
{
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_CONSTEXPR
        once_flag() _NOEXCEPT : __state_(0) {}

private:
    ; // = delete;
    ; // = delete;

    unsigned long __state_;

#ifndef _LIBCPP_HAS_NO_VARIADICS
    template<class _Callable, class... _Args>
    friend
    void call_once(once_flag&, _Callable&&, _Args&&...);
#else  // _LIBCPP_HAS_NO_VARIADICS
# 461 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3
    template<class _Callable>
    friend
    void call_once(once_flag&, _Callable);
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 465 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3
};

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Fp>
class __call_once_param
{
    _Fp __f_;
public:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    explicit __call_once_param(_Fp&& __f) : __f_(_VSTD::move(__f)) {}
#else
# 478 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3
    _LIBCPP_INLINE_VISIBILITY
    explicit __call_once_param(const _Fp& __f) : __f_(__f) {}
#endif
# 481 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3

    _LIBCPP_INLINE_VISIBILITY
    void operator()()
    {
        typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
        __execute(_Index());
    }

private:
    template <size_t ..._Indices>
    _LIBCPP_INLINE_VISIBILITY
    void __execute(__tuple_indices<_Indices...>)
    {
        __invoke(_VSTD::move(_VSTD::get<0>(__f_)), _VSTD::move(_VSTD::get<_Indices>(__f_))...);
    }
};

#else

    _LIBCPP_INLINE_VISIBILITY
    void operator()()
    {
        __f_();
    }
};

#endif
# 521 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3

template <class _Fp>
void
__call_once_proxy(void* __vp)
{
    __call_once_param<_Fp>* __p = static_cast<__call_once_param<_Fp>*>(__vp);
    (*__p)();
}

_LIBCPP_FUNC_VIS void __call_once(volatile unsigned long&, void*, void(*)(void*));

#ifndef _LIBCPP_HAS_NO_VARIADICS

template<class _Callable, class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void
call_once(once_flag& __flag, _Callable&& __func, _Args&&... __args)
{
    if (__flag.__state_ != ~0ul)
    {
        typedef tuple<typename decay<_Callable>::type, typename decay<_Args>::type...> _Gp;
        __call_once_param<_Gp> __p(_Gp(__decay_copy(_VSTD::forward<_Callable>(__func)),
                                __decay_copy(_VSTD::forward<_Args>(__args))...));
        __call_once(__flag.__state_, &__p, &__call_once_proxy<_Gp>);
    }
}

#else  // _LIBCPP_HAS_NO_VARIADICS
# 549 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3

template<class _Callable>
inline _LIBCPP_INLINE_VISIBILITY
void
call_once(once_flag& __flag, _Callable __func)
{
    if (__flag.__state_ != ~0ul)
    {
        __call_once_param<_Callable> __p(__func);
        __call_once(__flag.__state_, &__p, &__call_once_proxy<_Callable>);
    }
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 563 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_MUTEX
# 567 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/mutex" 3
# 19 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <cstdint>
#endif /* expanded by -frewrite-includes */
# 20 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
#if 0 /* expanded by -frewrite-includes */
#include <cctype>
#endif /* expanded by -frewrite-includes */
# 21 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
#if 0 /* expanded by -frewrite-includes */
#include <locale.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/locale.h" 1 3 4
/*
 * Copyright (c) 1991, 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
 * 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.
 *
 *	@(#)locale.h	8.1 (Berkeley) 6/2/93
 * $FreeBSD: /repoman/r/ncvs/src/include/locale.h,v 1.7 2002/10/09 09:19:27 tjr Exp $
 */

#ifndef _LOCALE_H_
#define _LOCALE_H_

#if 0 /* expanded by -frewrite-includes */
#include <_locale.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_locale.h" 1 3 4
/*
 * Copyright (c) 1991, 1993
 *	The Regents of the University of California.  All rights reserved.
 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _XLOCALE_H_
#define _XLOCALE_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 28 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4

#ifndef _USE_EXTENDED_LOCALES_
#define _USE_EXTENDED_LOCALES_
#endif /* _USE_EXTENDED_LOCALES_ */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4

struct _xlocale; /* forward reference */
typedef struct _xlocale *		locale_t;

#if 0 /* expanded by -frewrite-includes */
#include <_locale.h>
#endif /* expanded by -frewrite-includes */
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_xlocale.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_xlocale.h" 1 3 4
/*
 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef __XLOCALE_H_
#define __XLOCALE_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 28 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_xlocale.h" 3 4

__BEGIN_DECLS
int		___mb_cur_max(void);
int		___mb_cur_max_l(locale_t);
__END_DECLS

#endif /* __XLOCALE_H_ */
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_xlocale.h" 3 4
# 38 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 2 3 4

#define LC_ALL_MASK			(  LC_COLLATE_MASK \
					 | LC_CTYPE_MASK \
					 | LC_MESSAGES_MASK \
					 | LC_MONETARY_MASK \
					 | LC_NUMERIC_MASK \
					 | LC_TIME_MASK )
#define LC_COLLATE_MASK			(1 << 0)
#define LC_CTYPE_MASK			(1 << 1)
#define LC_MESSAGES_MASK		(1 << 2)
#define LC_MONETARY_MASK		(1 << 3)
#define LC_NUMERIC_MASK			(1 << 4)
#define LC_TIME_MASK			(1 << 5)

#define _LC_NUM_MASK			6
#define _LC_LAST_MASK			(1 << (_LC_NUM_MASK - 1))

#define LC_GLOBAL_LOCALE		((locale_t)-1)

#ifdef MB_CUR_MAX
#undef MB_CUR_MAX
#define MB_CUR_MAX			(___mb_cur_max())
#ifndef MB_CUR_MAX_L
#define MB_CUR_MAX_L(x)			(___mb_cur_max_l(x))
#endif /* !MB_CUR_MAX_L */
# 63 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
#endif /* MB_CUR_MAX */
# 64 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4

__BEGIN_DECLS
extern const locale_t _c_locale;

locale_t	duplocale(locale_t);
int		freelocale(locale_t);
struct lconv *	localeconv_l(locale_t);
locale_t	newlocale(int, __const char *, locale_t);
__const char *	querylocale(int, locale_t);
locale_t	uselocale(locale_t);
__END_DECLS

#ifdef _CTYPE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_ctype.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_ctype.h" 1 3 4
/*
 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _XLOCALE__CTYPE_H_
#define _XLOCALE__CTYPE_H_

/*
 * Use inline functions if we are allowed to and the compiler supports them.
 */
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
    (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))

/* See comments in <machine/_type.h> about __darwin_ct_rune_t. */
__BEGIN_DECLS
unsigned long		___runetype_l(__darwin_ct_rune_t, locale_t);
__darwin_ct_rune_t	___tolower_l(__darwin_ct_rune_t, locale_t);
__darwin_ct_rune_t	___toupper_l(__darwin_ct_rune_t, locale_t);
__END_DECLS

__BEGIN_DECLS
int             	__maskrune_l(__darwin_ct_rune_t, unsigned long, locale_t);
__END_DECLS

__DARWIN_CTYPE_inline int
__istype_l(__darwin_ct_rune_t _c, unsigned long _f, locale_t _l)
{
	return !!(isascii(_c) ? (_DefaultRuneLocale.__runetype[_c] & _f)
		: __maskrune_l(_c, _f, _l));
}

__DARWIN_CTYPE_inline __darwin_ct_rune_t
__toupper_l(__darwin_ct_rune_t _c, locale_t _l)
{
	return isascii(_c) ? _DefaultRuneLocale.__mapupper[_c]
		: ___toupper_l(_c, _l);
}

__DARWIN_CTYPE_inline __darwin_ct_rune_t
__tolower_l(__darwin_ct_rune_t _c, locale_t _l)
{
	return isascii(_c) ? _DefaultRuneLocale.__maplower[_c]
		: ___tolower_l(_c, _l);
}

__DARWIN_CTYPE_inline int
__wcwidth_l(__darwin_ct_rune_t _c, locale_t _l)
{
	unsigned int _x;

	if (_c == 0)
		return (0);
	_x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, _l);
	if ((_x & _CTYPE_SWM) != 0)
		return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
	return ((_x & _CTYPE_R) != 0 ? 1 : -1);
}

#ifndef _EXTERNALIZE_CTYPE_INLINES_

__DARWIN_CTYPE_TOP_inline int
digittoint_l(int c, locale_t l)
{
	return (__maskrune_l(c, 0x0F, l));
}

__DARWIN_CTYPE_TOP_inline int
isalnum_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_A|_CTYPE_D, l));
}

__DARWIN_CTYPE_TOP_inline int
isalpha_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_A, l));
}

__DARWIN_CTYPE_TOP_inline int
isblank_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_B, l));
}

__DARWIN_CTYPE_TOP_inline int
iscntrl_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_C, l));
}

__DARWIN_CTYPE_TOP_inline int
isdigit_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_D, l));
}

__DARWIN_CTYPE_TOP_inline int
isgraph_l(int c, locale_t l)
{
}

__DARWIN_CTYPE_TOP_inline int
isprint_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_R, l));
}

__DARWIN_CTYPE_TOP_inline int
ispunct_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_P, l));
}

__DARWIN_CTYPE_TOP_inline int
isrune_l(int c, locale_t l)
{
	return (__istype_l(c, 0xFFFFFFF0L, l));
}

__DARWIN_CTYPE_TOP_inline int
isspace_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_S, l));
}

__DARWIN_CTYPE_TOP_inline int
isspecial_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_T, l));
}

__DARWIN_CTYPE_TOP_inline int
isupper_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_U, l));
}

__DARWIN_CTYPE_TOP_inline int
isxdigit_l(int c, locale_t l)
{
	return (__istype_l(c, _CTYPE_X, l));
}

__DARWIN_CTYPE_TOP_inline int
tolower_l(int c, locale_t l)
{
        return (__tolower_l(c, l));
}

__DARWIN_CTYPE_TOP_inline int
toupper_l(int c, locale_t l)
{
        return (__toupper_l(c, l));
}
#endif /* _EXTERNALIZE_CTYPE_INLINES_ */
# 206 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_ctype.h" 3 4

#else /* not using inlines */
# 208 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_ctype.h" 3 4

__BEGIN_DECLS
int     digittoint_l(int, locale_t);
int     isalnum_l(int, locale_t);
int     isalpha_l(int, locale_t);
int     isblank_l(int, locale_t);
int     toupper_l(int, locale_t);
__END_DECLS
#endif /* using inlines */
# 233 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_ctype.h" 3 4

#endif /* _XLOCALE__CTYPE_H_ */
# 235 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_ctype.h" 3 4
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 2 3 4
#endif /* _CTYPE_H_ */
# 79 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
#ifdef __WCTYPE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/__wctype.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/__wctype.h" 1 3 4
/*
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _XLOCALE___WCTYPE_H_
#define _XLOCALE___WCTYPE_H_

#if !defined(_DONT_USE_CTYPE_INLINE_) && \
    (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))

__DARWIN_WCTYPE_TOP_inline int
iswalnum_l(wint_t _wc, locale_t _l)
{
	return (__istype_l(_wc, _CTYPE_A|_CTYPE_D, _l));
}

__DARWIN_WCTYPE_TOP_inline int
iswalpha_l(wint_t _wc, locale_t _l)
{
	return (__istype_l(_wc, _CTYPE_A, _l));
}

__DARWIN_WCTYPE_TOP_inline int
iswcntrl_l(wint_t _wc, locale_t _l)
{
	return (__istype_l(_wc, _CTYPE_C, _l));
}

__DARWIN_WCTYPE_TOP_inline int
iswctype_l(wint_t _wc, wctype_t _charclass, locale_t _l)
{
	return (__istype_l(_wc, _charclass, _l));
}

__DARWIN_WCTYPE_TOP_inline int
iswdigit_l(wint_t _wc, locale_t _l)
{
int	iswalnum_l(wint_t, locale_t);
int	iswalpha_l(wint_t, locale_t);
int	iswcntrl_l(wint_t, locale_t);
int	iswctype_l(wint_t, wctype_t, locale_t);
int	iswdigit_l(wint_t, locale_t);
int	iswgraph_l(wint_t, locale_t);
int	iswlower_l(wint_t, locale_t);
int	iswprint_l(wint_t, locale_t);
int	iswpunct_l(wint_t, locale_t);
int	iswspace_l(wint_t, locale_t);
int	iswupper_l(wint_t, locale_t);
int	iswxdigit_l(wint_t, locale_t);
wint_t	towlower_l(wint_t, locale_t);
wint_t	towupper_l(wint_t, locale_t);
__END_DECLS

#endif /* using inlines */
# 134 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/__wctype.h" 3 4

__BEGIN_DECLS
wctype_t
	wctype_l(const char *, locale_t);
__END_DECLS

#endif /* _XLOCALE___WCTYPE_H_ */
#endif /* _LANGINFO_H_ */
# 88 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
#ifdef _MONETARY_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_monetary.h>
#endif /* expanded by -frewrite-includes */
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
#endif /* _MONETARY_H_ */
# 91 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
#ifdef _REGEX_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_regex.h>
#endif /* expanded by -frewrite-includes */
# 93 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
#endif /* _REGEX_H_ */
# 94 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
#ifdef _STDIO_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_stdio.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_stdio.h" 1 3 4
/*
 * Copyright (c) 2005, 2009, 2010 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _XLOCALE__STDIO_H_
#define _XLOCALE__STDIO_H_

__BEGIN_DECLS
# 60 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_stdio.h" 3 4
#if !__DARWIN_NO_LONG_LONG
long long
	 atoll_l(const char *, locale_t);
#endif /* !__DARWIN_NO_LONG_LONG */
/* Poison the following routines if -fshort-wchar is set */
#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
#pragma GCC poison mbstowcs_l mbtowc_l wcstombs_l wctomb_l
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_stdlib.h" 3 4
__END_DECLS

#endif /* _XLOCALE__STDLIB_H_ */
# 70 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_stdlib.h" 3 4
# 99 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 2 3 4
#endif /* _STDLIB_H_ */
# 100 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
#ifdef _STRING_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_string.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_string.h" 1 3 4
/*
 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
__BEGIN_DECLS
size_t	 strftime_l(char * __restrict, size_t, const char * __restrict,
		const struct tm * __restrict, locale_t)
		__DARWIN_ALIAS(strftime_l) __strftimelike(3);
char	*strptime_l(const char * __restrict, const char * __restrict,
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _XLOCALE__WCHAR_H_
#define _XLOCALE__WCHAR_H_

/* Initially added in Issue 4 */
__BEGIN_DECLS
wint_t	btowc_l(int, locale_t);
__END_DECLS
 
/* Additional functionality provided by:
 * POSIX.1-2008
 */

#if __DARWIN_C_LEVEL >= 200809L
__BEGIN_DECLS
size_t	mbsnrtowcs_l(wchar_t * __restrict, const char ** __restrict, size_t,
	    size_t, mbstate_t * __restrict, locale_t);
int     wcscasecmp_l(const wchar_t *, const wchar_t *, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
int     wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t n, locale_t) __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_4_3);
size_t	wcsnrtombs_l(char * __restrict, const wchar_t ** __restrict, size_t,
	    size_t, mbstate_t * __restrict, locale_t);
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 200809L */
#if !defined(__cplusplus) && defined(__WCHAR_MAX__) && __WCHAR_MAX__ <= 0xffffU
#pragma GCC poison fgetwln_l fgetws_l fputwc_l fputws_l fwprintf_l fwscanf_l mbrtowc_l mbsnrtowcs_l mbsrtowcs_l putwc_l putwchar_l swprintf_l swscanf_l vfwprintf_l vfwscanf_l vswprintf_l vswscanf_l vwprintf_l vwscanf_l wcrtomb_l wcscoll_l wcsftime_l wcsftime_l wcsnrtombs_l wcsrtombs_l wcstod_l wcstof_l wcstol_l wcstold_l wcstoll_l wcstoul_l wcstoull_l wcswidth_l wcsxfrm_l wcwidth_l wprintf_l wscanf_l
#endif
# 140 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_wchar.h" 3 4

#endif /* _XLOCALE__WCHAR_H_ */
# 142 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_wchar.h" 3 4
# 108 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 2 3 4
#endif /*WCHAR_CTYPE_H_ */
# 109 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
#ifdef _WCTYPE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_wctype.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_wctype.h" 1 3 4
/*
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_LICENSE_HEADER_END@
 */

#ifndef _XLOCALE__WCTYPE_H_
#define _XLOCALE__WCTYPE_H_

#if !defined(_DONT_USE_CTYPE_INLINE_) && \
    (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))

__DARWIN_WCTYPE_TOP_inline int
iswblank_l(wint_t _wc, locale_t _l)
{
	return (__istype_l(_wc, _CTYPE_B, _l));
}

__DARWIN_WCTYPE_TOP_inline int
iswhexnumber_l(wint_t _wc, locale_t _l)
{
	return (__istype_l(_wc, _CTYPE_X, _l));
}

__DARWIN_WCTYPE_TOP_inline int
iswideogram_l(wint_t _wc, locale_t _l)
{
	return (__istype_l(_wc, _CTYPE_I, _l));
}

__DARWIN_WCTYPE_TOP_inline int
iswnumber_l(wint_t _wc, locale_t _l)
{
	return (__istype_l(_wc, _CTYPE_D, _l));
}

__DARWIN_WCTYPE_TOP_inline int
iswphonogram_l(wint_t _wc, locale_t _l)
{
	return (__istype_l(_wc, _CTYPE_Q, _l));
}

__DARWIN_WCTYPE_TOP_inline int
iswrune_l(wint_t _wc, locale_t _l)
{
	return (__istype_l(_wc, 0xFFFFFFF0L, _l));
}

__DARWIN_WCTYPE_TOP_inline int
iswspecial_l(wint_t _wc, locale_t _l)
{
	return (__istype_l(_wc, _CTYPE_T, _l));
}

#else /* not using inlines */
# 73 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_wctype.h" 3 4

__BEGIN_DECLS
int	iswblank_l(wint_t, locale_t);
wint_t	iswhexnumber_l(wint_t, locale_t);
wint_t	iswideogram_l(wint_t, locale_t);
wint_t	iswnumber_l(wint_t, locale_t);
wint_t	iswphonogram_l(wint_t, locale_t);
wint_t	iswrune_l(wint_t, locale_t);
wint_t	iswspecial_l(wint_t, locale_t);
__END_DECLS

#endif /* using inlines */
# 85 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_wctype.h" 3 4

__BEGIN_DECLS
wint_t	nextwctype_l(wint_t, wctype_t, locale_t);
wint_t	towctrans_l(wint_t, wctrans_t, locale_t);
wctrans_t
	wctrans_l(const char *, locale_t);
__END_DECLS

#endif /* _XLOCALE__WCTYPE_H_ */
# 94 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale/_wctype.h" 3 4
# 111 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 2 3 4
#endif /* _WCTYPE_H_ */
# 112 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4

#endif /* _XLOCALE_H_ */
# 114 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/xlocale.h" 3 4
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 2 3
#endif  // _WIN32 || __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
# 29 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 32 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
#endif
# 33 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3

_LIBCPP_BEGIN_NAMESPACE_STD

class _LIBCPP_TYPE_VIS locale;

template <class _Facet>
_LIBCPP_INLINE_VISIBILITY
bool
has_facet(const locale&) _NOEXCEPT;

template <class _Facet>
_LIBCPP_INLINE_VISIBILITY
const _Facet&
use_facet(const locale&);

class _LIBCPP_TYPE_VIS locale
{
public:
    // types:
    class _LIBCPP_TYPE_VIS facet;
    class _LIBCPP_TYPE_VIS id;

    typedef int category;
    static const category // values assigned here are for exposition only
        none     = 0,
        collate  = LC_COLLATE_MASK,
        ctype    = LC_CTYPE_MASK,
        monetary = LC_MONETARY_MASK,
        numeric  = LC_NUMERIC_MASK,
        time     = LC_TIME_MASK,
        messages = LC_MESSAGES_MASK,
        all = collate | ctype | monetary | numeric | time | messages;

    // construct/copy/destroy:
    locale()  _NOEXCEPT;
    locale(const locale&)  _NOEXCEPT;
    ;
    ;
    ;
    ;
    template <class _Facet>
        _LIBCPP_INLINE_VISIBILITY locale(const locale&, _Facet*);
    ;

    ~locale();

    const locale& operator=(const locale&)  _NOEXCEPT;

    ;

    // locale operations:
    ;
    ;
    
    ;

    // global locale objects:
    ;
    ;

private:
    class __imp;
    __imp* __locale_;

    void __install_ctor(const locale&, facet*, long);
    ;
    bool has_facet(id&) const;
    const facet* use_facet(id&) const;

    template <class _Facet> friend bool has_facet(const locale&)  _NOEXCEPT;
    template <class _Facet> friend const _Facet& use_facet(const locale&);
};

class _LIBCPP_TYPE_VIS locale::facet
    : public __shared_count
{
protected:
    _LIBCPP_INLINE_VISIBILITY
    explicit facet(size_t __refs = 0)
        : __shared_count(static_cast<long>(__refs)-1) {}

    virtual ~facet();

//    facet(const facet&) = delete;     // effectively done in __shared_count
//    void operator=(const facet&) = delete;
private:
    virtual void __on_zero_shared() _NOEXCEPT;
};

class _LIBCPP_TYPE_VIS locale::id
{
    once_flag      __flag_;
    int32_t        __id_;

    static int32_t __next_id;
public:
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR id() :__id_(0) {}
private:
    ;
    ; // = delete;
    ; // = delete;
public:  // only needed for tests
    ;

    friend class locale;
    friend class locale::__imp;
};

template <class _Facet>
inline _LIBCPP_INLINE_VISIBILITY
locale::locale(const locale& __other, _Facet* __f)
{
    __install_ctor(__other, __f, __f ? __f->id.__get() : 0);
}



template <class _Facet>
inline _LIBCPP_INLINE_VISIBILITY
bool
has_facet(const locale& __l)  _NOEXCEPT
{
    return __l.has_facet(_Facet::id);
}

template <class _Facet>
inline _LIBCPP_INLINE_VISIBILITY
const _Facet&
use_facet(const locale& __l)
{
    return static_cast<const _Facet&>(*__l.use_facet(_Facet::id));
}

// template <class _CharT> class collate;

template <class _CharT>
class _LIBCPP_TYPE_VIS_ONLY collate
    : public locale::facet
{
public:
    typedef _CharT char_type;
    typedef basic_string<char_type> string_type;

    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_INLINE_VISIBILITY
    long hash(const char_type* __lo, const char_type* __hi) const
    {
        return do_hash(__lo, __hi);
    }

    static locale::id id;

protected:
    ;
    virtual int do_compare(const char_type* __lo1, const char_type* __hi1,
                           const char_type* __lo2, const char_type* __hi2) const;
    virtual string_type do_transform(const char_type* __lo, const char_type* __hi) const
        {return string_type(__lo, __hi);}
    virtual long do_hash(const char_type* __lo, const char_type* __hi) const;
};

template <class _CharT> locale::id collate<_CharT>::id;



template <class _CharT>
int
collate<_CharT>::do_compare(const char_type* __lo1, const char_type* __hi1,
                            const char_type* __lo2, const char_type* __hi2) const
{
    for (; __lo2 != __hi2; ++__lo1, ++__lo2)
    {
        if (__lo1 == __hi1 || *__lo1 < *__lo2)
            return -1;
        if (*__lo2 < *__lo1)
            return 1;
    }
    return __lo1 != __hi1;
}

template <class _CharT>
long
collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
{
    size_t __h = 0;
    const size_t __sr = __CHAR_BIT__ * sizeof(size_t) - 8;
    const size_t __mask = size_t(0xF) << (__sr + 4);
    for(const char_type* __p = __lo; __p != __hi; ++__p)
    {
        __h = (__h << 4) + static_cast<size_t>(*__p);
        size_t __g = __h & __mask;
        __h ^= __g | (__g >> __sr);
    }
    return static_cast<long>(__h);
}

_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS collate<char>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS collate<wchar_t>)

// template <class CharT> class collate_byname;

template <class _CharT> class _LIBCPP_TYPE_VIS_ONLY collate_byname;

template <>
class _LIBCPP_TYPE_VIS collate_byname<char>
    : public collate<char>
{
    locale_t __l;
public:
    typedef char char_type;
    typedef basic_string<char_type> string_type;

    ;
    ;

protected:
    ;
    ;
    ;
};

template <>
class _LIBCPP_TYPE_VIS collate_byname<wchar_t>
    : public collate<wchar_t>
{
    locale_t __l;
public:
    typedef wchar_t char_type;
    typedef basic_string<char_type> string_type;

    ;
    ;

protected:
    ;

    ;
    ;
};



// template <class charT> class ctype

class _LIBCPP_TYPE_VIS ctype_base
{
public:
#ifdef __GLIBC__
    typedef unsigned short mask;
    static const mask space  = _ISspace;
    static const mask print  = _ISprint;
    static const mask cntrl  = _IScntrl;
    static const mask upper  = _ISupper;
    static const mask lower  = _ISlower;
    static const mask alpha  = _ISalpha;
    static const mask digit  = _ISdigit;
    static const mask space  = _ISSPACE;
    static const mask print  = _ISPRINT;
    static const mask cntrl  = _ISCNTRL;
    static const mask upper  = _ISUPPER;
    static const mask lower  = _ISLOWER;
    static const mask alpha  = _ISALPHA;
    static const mask digit  = _ISDIGIT;
    static const mask punct  = _ISPUNCT;
    static const mask xdigit = _ISXDIGIT;
    static const mask blank  = _ISBLANK;
#else  // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__ || __EMSCRIPTEN__ || __sun__
# 379 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
    typedef unsigned long mask;
    static const mask space  = 1<<0;
    static const mask print  = 1<<1;
    static const mask cntrl  = 1<<2;
    static const mask upper  = 1<<3;
    static const mask lower  = 1<<4;
    static const mask alpha  = 1<<5;
    static const mask digit  = 1<<6;
    static const mask punct  = 1<<7;
    static const mask xdigit = 1<<8;
    static const mask blank  = 1<<9;
#endif  // __GLIBC__ || _WIN32 || __APPLE__ || __FreeBSD__
# 391 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
    static const mask alnum  = alpha | digit;
    static const mask graph  = alnum | punct;

    _LIBCPP_ALWAYS_INLINE ctype_base() {}
};

template <class _CharT> class _LIBCPP_TYPE_VIS_ONLY ctype;

template <>
class _LIBCPP_TYPE_VIS ctype<wchar_t>
    : public locale::facet,
      public ctype_base
{
public:
    typedef wchar_t char_type;

    _LIBCPP_ALWAYS_INLINE
    explicit ctype(size_t __refs = 0)
        : locale::facet(__refs) {}

    _LIBCPP_ALWAYS_INLINE
    bool is(mask __m, char_type __c) const
    {
        return do_is(__m, __c);
    }
    const char_type* narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const
    {
        return do_narrow(__low, __high, __dfault, __to);
    }

    static locale::id id;

protected:
    ;
    virtual bool do_is(mask __m, char_type __c) const;
    virtual const char_type* do_is(const char_type* __low, const char_type* __high, mask* __vec) const;
    virtual const char_type* do_scan_is(mask __m, const char_type* __low, const char_type* __high) const;
    virtual const char_type* do_scan_not(mask __m, const char_type* __low, const char_type* __high) const;
    virtual char_type do_toupper(char_type) const;
    virtual const char_type* do_toupper(char_type* __low, const char_type* __high) const;
    virtual char_type do_tolower(char_type) const;
    virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const;
    virtual char_type do_widen(char) const;
    virtual const char* do_widen(const char* __low, const char* __high, char_type* __dest) const;
    virtual char do_narrow(char_type, char __dfault) const;
    virtual const char_type* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __dest) const;
};

template <>
class _LIBCPP_TYPE_VIS ctype<char>
    : public locale::facet, public ctype_base
{
    const mask* __tab_;
    bool        __del_;
public:
    typedef char char_type;

    ;

    _LIBCPP_ALWAYS_INLINE
    bool is(mask __m, char_type __c) const
    {
        return isascii(__c) ? (__tab_[static_cast<int>(__c)] & __m) !=0 : false;
    }

    _LIBCPP_ALWAYS_INLINE
    const char_type* is(const char_type* __low, const char_type* __high, mask* __vec) const
    {
        for (; __low != __high; ++__low, ++__vec)
            *__vec = isascii(*__low) ? __tab_[static_cast<int>(*__low)] : 0;
        return __low;
    }

    _LIBCPP_ALWAYS_INLINE
    const char_type* scan_is (mask __m, const char_type* __low, const char_type* __high) const
    {
        for (; __low != __high; ++__low)
            if (isascii(*__low) && (__tab_[static_cast<int>(*__low)] & __m))
                break;
        return __low;
    }

    _LIBCPP_ALWAYS_INLINE
    const char_type* scan_not(mask __m, const char_type* __low, const char_type* __high) const
    {
        for (; __low != __high; ++__low)
            if (!(isascii(*__low) && (__tab_[static_cast<int>(*__low)] & __m)))
                break;
        return __low;
    }

    _LIBCPP_ALWAYS_INLINE
    char_type toupper(char_type __c) const
    {
        return do_toupper(__c);
    }

    _LIBCPP_ALWAYS_INLINE
    const char_type* toupper(char_type* __low, const char_type* __high) const
    {
        return do_toupper(__low, __high);
    }

    _LIBCPP_ALWAYS_INLINE
    char_type tolower(char_type __c) const
    {
        return do_tolower(__c);
    }

    _LIBCPP_ALWAYS_INLINE
    const char_type* tolower(char_type* __low, const char_type* __high) const
    {
        return do_tolower(__low, __high);
    }

    _LIBCPP_ALWAYS_INLINE
    char_type widen(char __c) const
    {
        return do_widen(__c);
    }

    _LIBCPP_ALWAYS_INLINE
    const char* widen(const char* __low, const char* __high, char_type* __to) const
    {
        return do_widen(__low, __high, __to);
    }

    _LIBCPP_ALWAYS_INLINE
    char narrow(char_type __c, char __dfault) const
    {
        return do_narrow(__c, __dfault);
    }

    _LIBCPP_ALWAYS_INLINE
    const char* narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const
    {
        return do_narrow(__low, __high, __dfault, __to);
    }

    static locale::id id;

#ifdef _CACHED_RUNES
    static const size_t table_size = _CACHED_RUNES;
#else
# 597 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
    static const size_t table_size = 256;  // FIXME: Don't hardcode this.
#endif
# 599 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
    _LIBCPP_ALWAYS_INLINE const mask* table() const  _NOEXCEPT {return __tab_;}
    static const mask* classic_table()  _NOEXCEPT;
#if defined(__GLIBC__) || defined(__EMSCRIPTEN__)
    static const int* __classic_upper_table() _NOEXCEPT;
    static const int* __classic_lower_table() _NOEXCEPT;
#endif
# 605 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
#if defined(__NetBSD__)
    static const short* __classic_upper_table() _NOEXCEPT;
    static const short* __classic_lower_table() _NOEXCEPT;
#endif
# 609 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3

protected:
    ;
    virtual char_type do_toupper(char_type __c) const;
    virtual const char_type* do_toupper(char_type* __low, const char_type* __high) const;
    virtual char_type do_tolower(char_type __c) const;
    virtual const char_type* do_tolower(char_type* __low, const char_type* __high) const;
    virtual char_type do_widen(char __c) const;
    virtual const char* do_widen(const char* __low, const char* __high, char_type* __to) const;
    virtual char do_narrow(char_type __c, char __dfault) const;
    virtual const char* do_narrow(const char_type* __low, const char_type* __high, char __dfault, char* __to) const;
};

// template <class CharT> class ctype_byname;

template <class _CharT> class _LIBCPP_TYPE_VIS_ONLY ctype_byname;

template <>
class _LIBCPP_TYPE_VIS ctype_byname<char>
    : public ctype<char>
{
    locale_t __l;

public:
    ;
    ;

protected:
    ;
    ;
    ;
    ;
    ;
};

template <>
class _LIBCPP_TYPE_VIS ctype_byname<wchar_t>
    : public ctype<wchar_t>
{
    ;
    ;
    ;
    ;
};











// codecvt_base

class _LIBCPP_TYPE_VIS codecvt_base
{
public:
    _LIBCPP_ALWAYS_INLINE codecvt_base() {}
    enum result {ok, partial, error, noconv};
};

// template <class internT, class externT, class stateT> class codecvt;

template <class _InternT, class _ExternT, class _StateT> class _LIBCPP_TYPE_VIS_ONLY codecvt;

// template <> class codecvt<char, char, mbstate_t>

template <>
class _LIBCPP_TYPE_VIS codecvt<char, char, mbstate_t>
    : public locale::facet,
      public codecvt_base
{
public:
    typedef char      intern_type;
    typedef char      extern_type;
    typedef mbstate_t state_type;

    _LIBCPP_ALWAYS_INLINE
    virtual result do_in(state_type& __st,
                         const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
                         intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
    virtual result do_unshift(state_type& __st,
                              extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
    virtual int do_encoding() const  _NOEXCEPT;
    virtual bool do_always_noconv() const  _NOEXCEPT;
    virtual int do_length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
    virtual int do_max_length() const  _NOEXCEPT;
};

// template <> class codecvt<wchar_t, char, mbstate_t>

template <>
class _LIBCPP_TYPE_VIS codecvt<wchar_t, char, mbstate_t>
    : public locale::facet,
      public codecvt_base
{
    locale_t __l;
public:
    typedef wchar_t   intern_type;
    typedef char      extern_type;
    typedef mbstate_t state_type;

    ;

    _LIBCPP_ALWAYS_INLINE
    result out(state_type& __st,
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
    {
        return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
    }

    _LIBCPP_ALWAYS_INLINE
    result unshift(state_type& __st,
                   extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
    {
        return do_unshift(__st, __to, __to_end, __to_nxt);
    }

    _LIBCPP_ALWAYS_INLINE
    result in(state_type& __st,
              const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
              intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
    {
        return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
    }

    _LIBCPP_ALWAYS_INLINE
    int encoding() const  _NOEXCEPT
    {
        return do_encoding();
    }

    _LIBCPP_ALWAYS_INLINE
    bool always_noconv() const  _NOEXCEPT
    {
        return do_always_noconv();
    }

    _LIBCPP_ALWAYS_INLINE
    int length(state_type& __st, const extern_type* __frm, const extern_type* __end, size_t __mx) const
    {
        return do_length(__st, __frm, __end, __mx);
    }

    _LIBCPP_ALWAYS_INLINE
    int max_length() const  _NOEXCEPT
    {
        return do_max_length();
    }

    static locale::id id;

protected:
    ;

    ;

    virtual result do_out(state_type& __st,
                          const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
                          extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
    virtual result do_in(state_type& __st,
                         const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
                         intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
    virtual result do_unshift(state_type& __st,
                              extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
    virtual int do_encoding() const  _NOEXCEPT;
    virtual bool do_always_noconv() const  _NOEXCEPT;
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
    virtual int do_max_length() const  _NOEXCEPT;
};

// template <> class codecvt<char16_t, char, mbstate_t>

template <>
class _LIBCPP_TYPE_VIS codecvt<char16_t, char, mbstate_t>
    : public locale::facet,
      public codecvt_base
{
public:
    typedef char16_t  intern_type;
    typedef char      extern_type;
    typedef mbstate_t state_type;

    _LIBCPP_ALWAYS_INLINE
    explicit codecvt(size_t __refs = 0)
        : locale::facet(__refs) {}

    _LIBCPP_ALWAYS_INLINE
    result out(state_type& __st,
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
    {
        return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
    }

    virtual result do_out(state_type& __st,
                          const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
                          extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
    virtual result do_in(state_type& __st,
                         const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
                         intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
    virtual result do_unshift(state_type& __st,
                              extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
    virtual int do_encoding() const  _NOEXCEPT;
    virtual bool do_always_noconv() const  _NOEXCEPT;
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
    virtual int do_max_length() const  _NOEXCEPT;
};

// template <> class codecvt<char32_t, char, mbstate_t>

template <>
class _LIBCPP_TYPE_VIS codecvt<char32_t, char, mbstate_t>
    : public locale::facet,
      public codecvt_base
{
public:
    typedef char32_t  intern_type;
    typedef char      extern_type;
    typedef mbstate_t state_type;

    _LIBCPP_ALWAYS_INLINE
    explicit codecvt(size_t __refs = 0)
        : locale::facet(__refs) {}

    _LIBCPP_ALWAYS_INLINE
    result out(state_type& __st,
               const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
               extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
    {
        return do_out(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
    }

    _LIBCPP_ALWAYS_INLINE
    result unshift(state_type& __st,
                   extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const
    {
        return do_unshift(__st, __to, __to_end, __to_nxt);
    }

    _LIBCPP_ALWAYS_INLINE
    result in(state_type& __st,
              const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
              intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const
    {
        return do_in(__st, __frm, __frm_end, __frm_nxt, __to, __to_end, __to_nxt);
    }

    _LIBCPP_ALWAYS_INLINE
    int encoding() const  _NOEXCEPT
    {
        return do_encoding();
    }

    _LIBCPP_ALWAYS_INLINE
    bool always_noconv() const  _NOEXCEPT
    {
        return do_always_noconv();
    }
    _LIBCPP_ALWAYS_INLINE
    explicit codecvt(const char*, size_t __refs = 0)
        : locale::facet(__refs) {}

    ~codecvt();

    virtual result do_out(state_type& __st,
                          const intern_type* __frm, const intern_type* __frm_end, const intern_type*& __frm_nxt,
                          extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
    virtual result do_in(state_type& __st,
                         const extern_type* __frm, const extern_type* __frm_end, const extern_type*& __frm_nxt,
                         intern_type* __to, intern_type* __to_end, intern_type*& __to_nxt) const;
    virtual result do_unshift(state_type& __st,
                              extern_type* __to, extern_type* __to_end, extern_type*& __to_nxt) const;
    virtual int do_encoding() const  _NOEXCEPT;
    virtual bool do_always_noconv() const  _NOEXCEPT;
    virtual int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const;
    virtual int do_max_length() const  _NOEXCEPT;
};

// template <class _InternT, class _ExternT, class _StateT> class codecvt_byname

template <class _InternT, class _ExternT, class _StateT>
class _LIBCPP_TYPE_VIS_ONLY codecvt_byname
    : public codecvt<_InternT, _ExternT, _StateT>
{
public:
    _LIBCPP_ALWAYS_INLINE
    explicit codecvt_byname(const char* __nm, size_t __refs = 0)
        : codecvt<_InternT, _ExternT, _StateT>(__nm, __refs) {}
    _LIBCPP_ALWAYS_INLINE
    explicit codecvt_byname(const string& __nm, size_t __refs = 0)
        : codecvt<_InternT, _ExternT, _StateT>(__nm.c_str(), __refs) {}
protected:
    ;
};



_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<char, char, mbstate_t>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<wchar_t, char, mbstate_t>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<char16_t, char, mbstate_t>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS codecvt_byname<char32_t, char, mbstate_t>)

_LIBCPP_FUNC_VIS void __throw_runtime_error(const char*);

template <size_t _Np>
struct __narrow_to_utf8
{
    ;
};

template <>
struct __narrow_to_utf8<8>
{
    template <class _OutputIterator, class _CharT>
    _LIBCPP_ALWAYS_INLINE
    _OutputIterator
    operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const
    {
        for (; __wb < __we; ++__wb, ++__s)
            *__s = *__wb;
        return __s;
    }
};

template <>
struct __narrow_to_utf8<16>
    : public codecvt<char16_t, char, mbstate_t>
{
    _LIBCPP_ALWAYS_INLINE
    __narrow_to_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}

    ;

    template <class _OutputIterator, class _CharT>
    _LIBCPP_ALWAYS_INLINE
    _OutputIterator
    operator()(_OutputIterator __s, const _CharT* __wb, const _CharT* __we) const
    {
        result __r = ok;
        mbstate_t __mb;
        while (__wb < __we && __r != error)
        {
            const int __sz = 32;
            char __buf[__sz];
            char* __bn;
            const char16_t* __wn = (const char16_t*)__wb;
            __r = do_out(__mb, (const char16_t*)__wb, (const char16_t*)__we, __wn,
                         __buf, __buf+__sz, __bn);
            if (__r == codecvt_base::error || __wn == (const char16_t*)__wb)
                __throw_runtime_error("locale not supported");
            for (const char* __p = __buf; __p < __bn; ++__p, ++__s)
                *__s = *__p;
            __wb = (const _CharT*)__wn;
            for (const char* __p = __buf; __p < __bn; ++__p, ++__s)
                *__s = *__p;
            __wb = (const _CharT*)__wn;
        }
        return __s;
    }
};

template <size_t _Np>
struct __widen_from_utf8
{
    ;
};

template <>
struct __widen_from_utf8<8>
{
    template <class _OutputIterator>
    _LIBCPP_ALWAYS_INLINE
    _OutputIterator
    operator()(_OutputIterator __s, const char* __nb, const char* __ne) const
    {
        for (; __nb < __ne; ++__nb, ++__s)
            *__s = *__nb;
        return __s;
    }
};

template <>
struct __widen_from_utf8<16>
    : public codecvt<char16_t, char, mbstate_t>
{
    _LIBCPP_ALWAYS_INLINE
    __widen_from_utf8() : codecvt<char16_t, char, mbstate_t>(1) {}

    ;

    template <class _OutputIterator>
    _LIBCPP_ALWAYS_INLINE
    _OutputIterator
    operator()(_OutputIterator __s, const char* __nb, const char* __ne) const
    {
        result __r = ok;
        mbstate_t __mb;
        while (__nb < __ne && __r != error)
        {
            const int __sz = 32;
            char16_t __buf[__sz];
            char16_t* __bn;
            const char* __nn = __nb;
            __r = do_in(__mb, __nb, __ne - __nb > __sz ? __nb+__sz : __ne, __nn,
                        __buf, __buf+__sz, __bn);
            if (__r == codecvt_base::error || __nn == __nb)
                __throw_runtime_error("locale not supported");
            for (const char16_t* __p = __buf; __p < __bn; ++__p, ++__s)
                *__s = (wchar_t)*__p;
            __nb = __nn;
        }
        return __s;
    }
};

template <>
struct __widen_from_utf8<32>
    : public codecvt<char32_t, char, mbstate_t>
{
    _LIBCPP_ALWAYS_INLINE
    __widen_from_utf8() : codecvt<char32_t, char, mbstate_t>(1) {}

    ;

    ;
    ;

protected:
    ;

private:
    ;
};

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP___LOCALE
# 1446 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale" 3
# 217 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <system_error>
#endif /* expanded by -frewrite-includes */
# 218 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3

#if __has_feature(cxx_atomic)
#if 0 /* expanded by -frewrite-includes */
#include <atomic>     // for __xindex_
#endif /* expanded by -frewrite-includes */
# 221 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3
#endif
# 222 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 225 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3
#endif
# 226 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3

_LIBCPP_BEGIN_NAMESPACE_STD

typedef ptrdiff_t streamsize;

class _LIBCPP_TYPE_VIS ios_base
{
public:
    class _LIBCPP_TYPE_VIS failure;

    typedef unsigned int fmtflags;
    static const fmtflags boolalpha   = 0x0001;
    static const fmtflags dec         = 0x0002;
    static const fmtflags fixed       = 0x0004;
    static const fmtflags hex         = 0x0008;
    static const fmtflags internal    = 0x0010;
    static const fmtflags left        = 0x0020;
    static const fmtflags oct         = 0x0040;
    static const fmtflags right       = 0x0080;
    static const fmtflags scientific  = 0x0100;
    static const fmtflags showbase    = 0x0200;
    static const fmtflags showpoint   = 0x0400;
    static const fmtflags showpos     = 0x0800;
    static const fmtflags skipws      = 0x1000;
    static const fmtflags unitbuf     = 0x2000;
    static const fmtflags uppercase   = 0x4000;
    static const fmtflags adjustfield = left | right | internal;
    static const fmtflags basefield   = dec | oct | hex;
    static const fmtflags floatfield  = scientific | fixed;

    typedef unsigned int iostate;
    typedef iostate      io_state;
    static const iostate badbit  = 0x1;
    static const iostate eofbit  = 0x2;
    static const iostate failbit = 0x4;
    static const iostate goodbit = 0x0;

    typedef unsigned int openmode;
    typedef openmode     open_mode;
    static const openmode app    = 0x01;
    static const openmode ate    = 0x02;
    static const openmode binary = 0x04;
    static const openmode in     = 0x08;
    static const openmode out    = 0x10;
    static const openmode trunc  = 0x20;

    enum seekdir {beg, cur, end};
    typedef seekdir seek_dir;

    typedef _VSTD::streamoff streamoff;
    typedef _VSTD::streampos streampos;

    class _LIBCPP_TYPE_VIS Init;

    // 27.5.2.2 fmtflags state:
    _LIBCPP_INLINE_VISIBILITY fmtflags flags() const;
    _LIBCPP_INLINE_VISIBILITY fmtflags flags(fmtflags __fmtfl);
    _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl);
    _LIBCPP_INLINE_VISIBILITY fmtflags setf(fmtflags __fmtfl, fmtflags __mask);
    _LIBCPP_INLINE_VISIBILITY void unsetf(fmtflags __mask);

    _LIBCPP_INLINE_VISIBILITY streamsize precision() const;
    _LIBCPP_INLINE_VISIBILITY streamsize precision(streamsize __prec);
    _LIBCPP_INLINE_VISIBILITY streamsize width() const;
    _LIBCPP_INLINE_VISIBILITY streamsize width(streamsize __wide);

    // 27.5.2.3 locales:
    locale imbue(const locale& __loc);
    locale getloc() const;

    // 27.5.2.5 storage:
    ;
    ;
    ;

    // destructor
    virtual ~ios_base();

    // 27.5.2.6 callbacks;
    enum event { erase_event, imbue_event, copyfmt_event };
    typedef void (*event_callback)(event, ios_base&, int __index);
    ;

private:
    ; // = delete;
    ; // = delete;

public:
    ;

    _LIBCPP_INLINE_VISIBILITY iostate rdstate() const;
    void clear(iostate __state = goodbit);
    _LIBCPP_INLINE_VISIBILITY void setstate(iostate __state);

    _LIBCPP_INLINE_VISIBILITY bool good() const;
    _LIBCPP_INLINE_VISIBILITY bool eof() const;
    _LIBCPP_INLINE_VISIBILITY bool fail() const;
    _LIBCPP_INLINE_VISIBILITY bool bad() const;

    _LIBCPP_INLINE_VISIBILITY iostate exceptions() const;
    _LIBCPP_INLINE_VISIBILITY void exceptions(iostate __iostate);

    ;

    ;
    ;
    void move(ios_base&);
    void swap(ios_base&) _NOEXCEPT;

    _LIBCPP_ALWAYS_INLINE
    void set_rdbuf(void* __sb)
    {
        __rdbuf_ = __sb;
    }

private:
    // All data members must be scalars
    fmtflags        __fmtflags_;
    streamsize      __precision_;
    streamsize      __width_;
    iostate         __rdstate_;
    iostate         __exceptions_;
    void*           __rdbuf_;
    void*           __loc_;
    event_callback* __fn_;
    int*            __index_;
    size_t          __event_size_;
    size_t          __event_cap_;
#if __has_feature(cxx_atomic)
    static atomic<int> __xindex_;
#else
# 373 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3
    static int      __xindex_;
#endif
# 375 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3
    long*           __iarray_;
    size_t          __iarray_size_;
    size_t          __iarray_cap_;
    void**          __parray_;
    size_t          __parray_size_;
    size_t          __parray_cap_;
};

//enum class io_errc
_LIBCPP_DECLARE_STRONG_ENUM(io_errc)
{
    stream = 1
};
_LIBCPP_DECLARE_STRONG_ENUM_EPILOG(io_errc)

template <>
struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum<io_errc> : public true_type { };

#ifdef _LIBCPP_HAS_NO_STRONG_ENUMS
template <>
struct _LIBCPP_TYPE_VIS_ONLY is_error_code_enum<io_errc::__lx> : public true_type { };
#endif
# 397 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3

_LIBCPP_FUNC_VIS
const error_category& iostream_category() _NOEXCEPT;





class _LIBCPP_EXCEPTION_ABI ios_base::failure
    : public system_error
{
public:
    ;
    ;
    ;
};

class _LIBCPP_TYPE_VIS ios_base::Init
{
public:
    ;
    ;
};

// fmtflags

inline _LIBCPP_INLINE_VISIBILITY
ios_base::fmtflags
ios_base::setf(fmtflags __fmtfl, fmtflags __mask)
{
    fmtflags __r = __fmtflags_;
    unsetf(__mask);
    __fmtflags_ |= __fmtfl & __mask;
    return __r;
}

// precision

inline _LIBCPP_INLINE_VISIBILITY
streamsize
ios_base::precision() const
{
    return __precision_;
}

inline _LIBCPP_INLINE_VISIBILITY
streamsize
ios_base::precision(streamsize __prec)
{
    streamsize __r = __precision_;
    __precision_ = __prec;
    return __r;
}

// width

inline _LIBCPP_INLINE_VISIBILITY
bool
ios_base::good() const
{
    return __rdstate_ == 0;
}

inline _LIBCPP_INLINE_VISIBILITY
bool
ios_base::eof() const
{
    return (__rdstate_ & eofbit) != 0;
}

inline _LIBCPP_INLINE_VISIBILITY
bool
ios_base::fail() const
{
    return (__rdstate_ & (failbit | badbit)) != 0;
}

inline _LIBCPP_INLINE_VISIBILITY
bool
ios_base::bad() const
{
    return (__rdstate_ & badbit) != 0;
}

inline _LIBCPP_INLINE_VISIBILITY
ios_base::iostate
ios_base::exceptions() const
{
    return __exceptions_;
}

inline _LIBCPP_INLINE_VISIBILITY
void
ios_base::exceptions(iostate __iostate)
{
    __exceptions_ = __iostate;
    clear(__rdstate_);
}

template <class _CharT, class _Traits>
class _LIBCPP_TYPE_VIS_ONLY basic_ios
    : public ios_base
{
public:
    // types:
    typedef _CharT char_type;
    typedef _Traits traits_type;

    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;

    _LIBCPP_ALWAYS_INLINE
        _LIBCPP_EXPLICIT
        operator bool() const {return !fail();}
    _LIBCPP_ALWAYS_INLINE bool operator!() const    {return  fail();}
    _LIBCPP_ALWAYS_INLINE iostate rdstate() const   {return ios_base::rdstate();}
    _LIBCPP_ALWAYS_INLINE void clear(iostate __state = goodbit) {ios_base::clear(__state);}
    _LIBCPP_ALWAYS_INLINE void setstate(iostate __state) {ios_base::setstate(__state);}
    _LIBCPP_ALWAYS_INLINE bool good() const {return ios_base::good();}
    _LIBCPP_ALWAYS_INLINE bool eof() const  {return ios_base::eof();}
    _LIBCPP_INLINE_VISIBILITY 
    char narrow(char_type __c, char __dfault) const;
    _LIBCPP_INLINE_VISIBILITY 
    char_type widen(char __c) const;

protected:
    _LIBCPP_ALWAYS_INLINE
    basic_ios() {// purposefully does no initialization
                }
    _LIBCPP_INLINE_VISIBILITY 
    void init(basic_streambuf<char_type, traits_type>* __sb);

    _LIBCPP_INLINE_VISIBILITY 
    void move(basic_ios& __rhs);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_ALWAYS_INLINE
    void move(basic_ios&& __rhs) {move(__rhs);}
#endif
# 642 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3
    _LIBCPP_INLINE_VISIBILITY 
    void swap(basic_ios& __rhs) _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY 
    void set_rdbuf(basic_streambuf<char_type, traits_type>* __sb);
private:
    basic_ostream<char_type, traits_type>* __tie_;
     mutable int_type __fill_;
};

template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY


ios_base&
dec(ios_base& __str)
{
    __str.setf(ios_base::dec, ios_base::basefield);
    return __str;
}













template <class _CharT, class _Traits>
class __save_flags
{
    typedef basic_ios<_CharT, _Traits> __stream_type;
    typedef typename __stream_type::fmtflags fmtflags;

    __stream_type& __stream_;
    fmtflags       __fmtflags_;
    _CharT         __fill_;

    ;
    ;
public:
    _LIBCPP_INLINE_VISIBILITY
    explicit __save_flags(__stream_type& __stream)
        : __stream_(__stream),
          __fmtflags_(__stream.flags()),
          __fill_(__stream.fill())
        {}
    _LIBCPP_INLINE_VISIBILITY
    ~__save_flags()
    {
        __stream_.flags(__fmtflags_);
        __stream_.fill(__fill_);
    }
};

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_IOS
# 1024 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios" 3
# 132 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <streambuf>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/streambuf" 1 3
// -*- C++ -*-
//===------------------------- streambuf ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_STEAMBUF
#define _LIBCPP_STEAMBUF

/*
    streambuf synopsis

namespace std
{

template <class charT, class traits = char_traits<charT> >
#endif /* expanded by -frewrite-includes */
# 112 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/streambuf" 3
#if 0 /* expanded by -frewrite-includes */
#include <iosfwd>
#endif /* expanded by -frewrite-includes */
# 113 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/streambuf" 3
#if 0 /* expanded by -frewrite-includes */
#include <ios>
#endif /* expanded by -frewrite-includes */
# 114 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/streambuf" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 117 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/streambuf" 3
#endif
# 118 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/streambuf" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _CharT, class _Traits>
class _LIBCPP_TYPE_VIS_ONLY basic_streambuf
{
public:
    // types:
    typedef _CharT                         char_type;
    typedef _Traits                        traits_type;
    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;

    virtual ~basic_streambuf();

    // 27.6.2.2.1 locales:
    ;
    ;
    ;
    ;

    // 27.6.2.2.5 Put area:
    int_type sputc(char_type __c);
    streamsize sputn(const char_type* __s, streamsize __n);

protected:
    basic_streambuf();
    ;
    ;
    ;

    // 27.6.2.3.2 Get area:
    _LIBCPP_ALWAYS_INLINE char_type* eback() const {return __binp_;}
    _LIBCPP_ALWAYS_INLINE char_type* gptr()  const {return __ninp_;}
    _LIBCPP_ALWAYS_INLINE char_type* egptr() const {return __einp_;}
    ;
    void setg(char_type* __gbeg, char_type* __gnext, char_type* __gend);

    // 27.6.2.3.3 Put area:
    _LIBCPP_ALWAYS_INLINE char_type* pbase() const {return __bout_;}
    _LIBCPP_ALWAYS_INLINE char_type* pptr()  const {return __nout_;}
    _LIBCPP_ALWAYS_INLINE char_type* epptr() const {return __eout_;}
    void pbump(int __n);
    void setp(char_type* __pbeg, char_type* __pend);

    // 27.6.2.4 virtual functions:
    // 27.6.2.4.1 Locales:
    virtual void imbue(const locale& __loc);

    // 27.6.2.4.2 Buffer management and positioning:
    virtual basic_streambuf* setbuf(char_type* __s, streamsize __n);
    ;
    ;
    virtual int sync();

    // 27.6.2.4.3 Get area:
    virtual streamsize showmanyc();
    virtual streamsize xsgetn(char_type* __s, streamsize __n);
    virtual int_type underflow();
    virtual int_type uflow();

    // 27.6.2.4.4 Putback:
    ;

    // 27.6.2.4.5 Put area:
    virtual streamsize xsputn(const char_type* __s, streamsize __n);
    virtual int_type overflow(int_type __c = traits_type::eof());

private:
    locale __loc_;
    char_type* __binp_;
    char_type* __ninp_;
    char_type* __einp_;
    char_type* __bout_;
    char_type* __nout_;
    char_type* __eout_;
};

template <class _CharT, class _Traits>
basic_streambuf<_CharT, _Traits>::~basic_streambuf()
{
}







template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
streamsize
basic_streambuf<_CharT, _Traits>::sputn(const char_type* __s, streamsize __n)
{
    return xsputn(__s, __n);
}

template <class _CharT, class _Traits>
basic_streambuf<_CharT, _Traits>::basic_streambuf()
    : __binp_(0),
      __ninp_(0),
      __einp_(0),
      __bout_(0),
      __nout_(0),
      __eout_(0)
{
}









template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
void
basic_streambuf<_CharT, _Traits>::setg(char_type* __gbeg, char_type* __gnext,
                                                          char_type* __gend)
{
    __binp_ = __gbeg;
    __ninp_ = __gnext;
    __einp_ = __gend;
}

template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
void
basic_streambuf<_CharT, _Traits>::imbue(const locale&)
{
}

template <class _CharT, class _Traits>
basic_streambuf<_CharT, _Traits>*
basic_streambuf<_CharT, _Traits>::setbuf(char_type*, streamsize)
{
    return this;
}





template <class _CharT, class _Traits>
int
basic_streambuf<_CharT, _Traits>::sync()
{
    return 0;
}

template <class _CharT, class _Traits>
streamsize
basic_streambuf<_CharT, _Traits>::showmanyc()
{
    return 0;
}

template <class _CharT, class _Traits>
streamsize
basic_streambuf<_CharT, _Traits>::xsgetn(char_type* __s, streamsize __n)
{
    const int_type __eof = traits_type::eof();
    int_type __c;
    streamsize __i = 0;
    for (;__i < __n; ++__i, ++__s)
    {
        if (__ninp_ < __einp_)
            *__s = *__ninp_++;
        else if ((__c = uflow()) != __eof)
            *__s = traits_type::to_char_type(__c);
        else
            break;
    }
    return __i;
}



template <class _CharT, class _Traits>
streamsize
basic_streambuf<_CharT, _Traits>::xsputn(const char_type* __s, streamsize __n)
{
    streamsize __i = 0;
    int_type __eof = traits_type::eof();
    for (; __i < __n; ++__s, ++__i)
    {
        if (__nout_ < __eout_)
            *__nout_++ = *__s;
        else if (overflow(traits_type::to_int_type(*__s)) == __eof)
            break;
    }
    return __i;
}

template <class _CharT, class _Traits>
typename basic_streambuf<_CharT, _Traits>::int_type
basic_streambuf<_CharT, _Traits>::overflow(int_type)
{
    return traits_type::eof();
}

_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_streambuf<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_streambuf<wchar_t>)

_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ios<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ios<wchar_t>)

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_STEAMBUF
# 565 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/streambuf" 3
# 133 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <locale>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 1 3
// -*- C++ -*-
//===-------------------------- locale ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_LOCALE
#define _LIBCPP_LOCALE

/*
    locale synopsis

namespace std
{

class locale
{
public:
    // types:
    class facet;
    class id;
class wstring_convert
{
public:
    typedef basic_string<char, char_traits<char>, Byte_alloc> byte_string;
    typedef basic_string<Elem, char_traits<Elem>, Wide_alloc> wide_string;
    typedef typename Codecvt::state_type                      state_type;
    typedef typename wide_string::traits_type::int_type       int_type;

    explicit wstring_convert(Codecvt* pcvt = new Codecvt);          // explicit in C++14
    wstring_convert(Codecvt* pcvt, state_type state);
    explicit wstring_convert(const byte_string& byte_err,           // explicit in C++14
                    const wide_string& wide_err = wide_string());
    wstring_convert(const wstring_convert&) = delete;               // C++14
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 1 3
// -*- C++ -*-
//===--------------------------- cstdlib ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_CSTDLIB
#define _LIBCPP_CSTDLIB

/*
    cstdlib synopsis

void *aligned_alloc(size_t alignment, size_t size);                       // C11

}  // std

*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3
#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 87 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3
#ifdef _LIBCPP_MSVCRT
#if 0 /* expanded by -frewrite-includes */
#include "support/win32/locale_win32.h"
#endif /* expanded by -frewrite-includes */
# 89 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3
#endif // _LIBCPP_MSVCRT
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 93 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3
#endif
# 94 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3

_LIBCPP_BEGIN_NAMESPACE_STD
using ::free;
#ifdef _LIBCPP_HAS_C11_FEATURES
using ::aligned_alloc;
#endif
# 156 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3

// MSVCRT already has the correct prototype in <stdlib.h> #ifdef __cplusplus
#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX)

#ifndef _LIBCPP_HAS_NO_LONG_LONG

#endif // _LIBCPP_HAS_NO_LONG_LONG
# 163 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3


#ifndef _LIBCPP_HAS_NO_LONG_LONG

#endif // _LIBCPP_HAS_NO_LONG_LONG
# 168 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3
#endif // _LIBCPP_MSVCRT
# 169 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_CSTDLIB
# 173 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstdlib" 3
# 193 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <ctime>
#endif /* expanded by -frewrite-includes */
# 194 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
#if 0 /* expanded by -frewrite-includes */
#include <support/win32/locale_win32.h>
#endif /* expanded by -frewrite-includes */
# 196 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
#else // _LIBCPP_MSVCRT
# 197 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
#if 0 /* expanded by -frewrite-includes */
#include <nl_types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/nl_types.h" 1 3 4
/*	$NetBSD: nl_types.h,v 1.9 2000/10/03 19:53:32 sommerfeld Exp $	*/

/*-
 * Copyright (c) 1996 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
 *
 * $FreeBSD: src/include/nl_types.h,v 1.11 2005/02/27 16:20:53 phantom Exp $
 */

#ifndef _NL_TYPES_H_
#define _NL_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 45 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/nl_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/nl_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 47 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/nl_types.h" 3 4

#ifdef _NLS_PRIVATE
/*
 * MESSAGE CATALOG FILE FORMAT.
 *
 * The NetBSD/FreeBSD message catalog format is similar to the format used by
 * Svr4 systems.  The differences are:
 *   * fixed byte order (big endian)
 *   * fixed data field sizes
 *
 * A message catalog contains four data types: a catalog header, one
 * or more set headers, one or more message headers, and one or more
 * text strings.
 */

#define _NLS_MAGIC	0xff88ff89
	int32_t __msgno;	/* msg number: 0 < x <= NL_MSGMAX */
	int32_t __msglen;
	int32_t __offset;
} ;

#endif	/* _NLS_PRIVATE */
# 85 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/nl_types.h" 3 4

#define	NL_SETD		1
#define	NL_CAT_LOCALE	1

typedef struct __nl_cat_d {
	void	*__data;
	int	__size;
} *nl_catd;

#if 0 /* expanded by -frewrite-includes */
#include <_types/_nl_item.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_nl_item.h" 1 3 4
/*
 * Copyright (c) 2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
#ifndef _NL_ITEM
#define _NL_ITEM 
typedef __darwin_nl_item nl_item;
#endif /* _NL_ITEM */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/_types/_nl_item.h" 3 4
# 95 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/nl_types.h" 2 3 4

__BEGIN_DECLS
nl_catd  catopen(const char *, int);
char    *catgets(nl_catd, int, int, const char *)
	__attribute__((__format_arg__(4)));
int	 catclose(nl_catd);
__END_DECLS

#endif	/* _NL_TYPES_H_ */
# 104 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/nl_types.h" 3 4
# 198 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 2 3
#endif  // !_LIBCPP_MSVCRT
# 199 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3

#ifdef __APPLE__
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 202 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
#endif
# 203 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifdef min
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro min is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing min")
#else
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro min is incompatible with C++.  #undefing min
#endif
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef min
#endif
# 20 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3

#ifdef max
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro max is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing max")
#else
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro max is incompatible with C++.  #undefing max
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
#endif
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 205 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 208 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
#endif
# 209 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3

_LIBCPP_BEGIN_NAMESPACE_STD

#if defined(__APPLE__) || defined(__FreeBSD__)
#  define _LIBCPP_GET_C_LOCALE 0
#elif defined(__NetBSD__)
# 215 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
#  define _LIBCPP_GET_C_LOCALE LC_C_LOCALE
#else
# 217 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
#  define _LIBCPP_GET_C_LOCALE __cloc()
   // Get the C locale object
   _LIBCPP_FUNC_VIS locale_t __cloc();
#define __cloc_defined
#endif
# 222 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3

typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
typedef _VSTD::unique_ptr<__locale_struct, decltype(&freelocale)> __locale_unique_ptr;
#ifndef _LIBCPP_LOCALE__L_EXTENSIONS
typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
#endif
# 228 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3

// OSX has nice foo_l() functions that let you turn off use of the global
// locale.  Linux, not so much.  The following functions avoid the locale when
// that's possible and otherwise do the wrong thing.  FIXME.
#if defined(__linux__) || defined(__EMSCRIPTEN__) || defined(_AIX)

#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
decltype(MB_CUR_MAX_L(_VSTD::declval<locale_t>()))
inline _LIBCPP_INLINE_VISIBILITY
__mb_cur_max_l(locale_t __l)
{
  return MB_CUR_MAX_L(__l);
}
#else  // _LIBCPP_LOCALE__L_EXTENSIONS
# 242 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3

#endif // _LIBCPP_LOCALE__L_EXTENSIONS
# 249 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3











  va_list __va;
  va_start(__va, __format);
#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
  int __res = vsscanf_l(__s, __l, __format, __va);
#else
# 399 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
  __locale_raii __current(uselocale(__l), uselocale);
  int __res = vsscanf(__s, __format, __va);
#endif
# 402 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
  va_end(__va);
  return __res;
}

#endif  // __linux__
# 407 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
//  Keywords:  "a", "abb"
//  If the input is "a", the first keyword matches and eofbit is set.
//  If the input is "abc", no match is found and "ab" are consumed.
template <class _InputIterator, class _ForwardIterator, class _Ctype>
_LIBCPP_HIDDEN
_ForwardIterator
__scan_keyword(_InputIterator& __b, _InputIterator __e,
               _ForwardIterator __kb, _ForwardIterator __ke,
               const _Ctype& __ct, ios_base::iostate& __err,
               bool __case_sensitive = true)
{
    typedef typename iterator_traits<_InputIterator>::value_type _CharT;
    size_t __nkw = static_cast<size_t>(_VSTD::distance(__kb, __ke));
    const unsigned char __doesnt_match = '\0';
    const unsigned char __might_match = '\1';
    const unsigned char __does_match = '\2';
    unsigned char __statbuf[100];
    unsigned char* __status = __statbuf;
    unique_ptr<unsigned char, void(*)(void*)> __stat_hold(0, free);
    if (__nkw > sizeof(__statbuf))
    {
        __status = (unsigned char*)malloc(__nkw);
        if (__status == 0)
            __throw_bad_alloc();
        __stat_hold.reset(__status);
    }
    size_t __n_might_match = __nkw;  // At this point, any keyword might match
    size_t __n_does_match = 0;       // but none of them definitely do
    // Initialize all statuses to __might_match, except for "" keywords are __does_match
    unsigned char* __st = __status;
    for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, ++__st)
    {
        if (!__ky->empty())
            *__st = __might_match;
        else
        {
            *__st = __does_match;
            --__n_might_match;
            ++__n_does_match;
        }
    }
    // While there might be a match, test keywords against the next CharT
    for (size_t __indx = 0; __b != __e && __n_might_match > 0; ++__indx)
    {
        // Peek at the next CharT but don't consume it
        _CharT __c = *__b;
        if (!__case_sensitive)
            __c = __ct.toupper(__c);
        bool __consume = false;
        // consume if we matched a character
        if (__consume)
        {
            ++__b;
            // If we consumed a character and there might be a matched keyword that
            //   was marked matched on a previous iteration, then such keywords
            //   which are now marked as not matching.
            if (__n_might_match + __n_does_match > 1)
            {
                __st = __status;
                for (_ForwardIterator __ky = __kb; __ky != __ke; ++__ky, ++__st)
                {
                    if (*__st == __does_match && __ky->size() != __indx+1)
                    {
                        *__st = __doesnt_match;
                        --__n_does_match;
                    }
                }
            }
        }
    }
    // We've exited the loop because we hit eof and/or we have no more "might matches".
    if (__b == __e)
        __err |= ios_base::eofbit;
    // Return the first matching result
    for (__st = __status; __kb != __ke; ++__kb, ++__st)
        if (*__st == __does_match)
            break;
    if (__kb == __ke)
        __err |= ios_base::failbit;
    return __kb;
}

struct _LIBCPP_TYPE_VIS __num_get_base
{
    static const int __num_get_buf_sz = 40;

    ;
    static const char __src[33];
};

_LIBCPP_FUNC_VIS
void __check_grouping(const string& __grouping, unsigned* __g, unsigned* __g_end,
                      ios_base::iostate& __err);

template <class _CharT>
struct __num_get
    : protected __num_get_base
{
    ;
    ;
    static int __stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end,
                  unsigned& __dc, _CharT __thousands_sep, const string& __grouping,
                  unsigned* __g, unsigned*& __g_end, _CharT* __atoms);
    ;
};





template <class _CharT>
int
__num_get<_CharT>::__stage2_int_loop(_CharT __ct, int __base, char* __a, char*& __a_end,
                  unsigned& __dc, _CharT __thousands_sep, const string& __grouping,
                  unsigned* __g, unsigned*& __g_end, _CharT* __atoms)
{
    if (__a_end == __a && (__ct == __atoms[24] || __ct == __atoms[25]))
    {
        *__a_end++ = __ct == __atoms[24] ? '+' : '-';
        __dc = 0;
        return 0;
    }
    if (__grouping.size() != 0 && __ct == __thousands_sep)
    {
        if (__g_end-__g < __num_get_buf_sz)
        {
            *__g_end++ = __dc;
            __dc = 0;
        }
        return 0;
    }
    ptrdiff_t __f = find(__atoms, __atoms + 26, __ct) - __atoms;
    if (__f >= 24)
        return -1;
    switch (__base)
    {
    case 8:
    case 10:
        if (__f >= __base)
            return -1;
        break;
    case 16:
        if (__f < 22)
            break;
        if (__a_end != __a && __a_end - __a <= 2 && __a_end[-1] == '0')
        {
            __dc = 0;
            *__a_end++ = __src[__f];
            return 0;
        }
        return -1;
    }
    *__a_end++ = __src[__f];
    ++__dc;
    return 0;
}



_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_get<char>)
_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_get<wchar_t>)

template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY num_get
    : public locale::facet,
      private __num_get<_CharT>
{
public:
    typedef _CharT char_type;
    typedef _InputIterator iter_type;

    _LIBCPP_ALWAYS_INLINE
    explicit num_get(size_t __refs = 0)
        : locale::facet(__refs) {}

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, bool& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, long& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, long long& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, unsigned short& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, unsigned int& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, unsigned long& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, unsigned long long& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, float& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, double& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, long double& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, void*& __v) const
    {
        return do_get(__b, __e, __iob, __err, __v);
    }

    static locale::id id;

protected:
    _LIBCPP_ALWAYS_INLINE

    

    

    

    

    

    

    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
                             ios_base::iostate& __err, void*& __v) const;
};

// unsigned



// floating point



template <class _CharT, class _InputIterator>
_InputIterator
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
                                        ios_base& __iob,
                                        ios_base::iostate& __err,
                                        void*& __v) const
{
    // Stage 1
    int __base = 16;
    // Stage 2
    char_type __atoms[26];
    char_type __thousands_sep = 0;
    string __grouping;
    use_facet<ctype<_CharT> >(__iob.getloc()).widen(__num_get_base::__src,
                                                    __num_get_base::__src + 26, __atoms);
        __err = ios_base::failbit;
    // EOF checked
    if (__b == __e)
        __err |= ios_base::eofbit;
    return __b;
}

_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_get<char>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_get<wchar_t>)

struct _LIBCPP_TYPE_VIS __num_put_base
{
protected:
    ;
    ;
    ;
};

template <class _CharT>
struct __num_put
    : protected __num_put_base
{
    ;
    ;
};





_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_put<char>)
_LIBCPP_EXTERN_TEMPLATE2(struct _LIBCPP_TYPE_VIS __num_put<wchar_t>)

template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY num_put
    : public locale::facet,
      private __num_put<_CharT>
{
public:
    typedef _CharT char_type;
    typedef _OutputIterator iter_type;

    _LIBCPP_ALWAYS_INLINE
    explicit num_put(size_t __refs = 0)
        : locale::facet(__refs) {}

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                  bool __v) const
    {
        return do_put(__s, __iob, __fl, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                  long __v) const
    {
        return do_put(__s, __iob, __fl, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                  long long __v) const
    {
        return do_put(__s, __iob, __fl, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                  unsigned long __v) const
    {
        return do_put(__s, __iob, __fl, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                  unsigned long long __v) const
    {
        return do_put(__s, __iob, __fl, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                  double __v) const
    {
        return do_put(__s, __iob, __fl, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                  long double __v) const
    {
        return do_put(__s, __iob, __fl, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                  const void* __v) const
    {
        return do_put(__s, __iob, __fl, __v);
    }

    static locale::id id;

protected:
    _LIBCPP_ALWAYS_INLINE
    ~num_put() {}

    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
};

template <class _CharT, class _OutputIterator>
locale::id
num_put<_CharT, _OutputIterator>::id;

template <class _CharT, class _OutputIterator>
_LIBCPP_HIDDEN
_OutputIterator
__pad_and_output(_OutputIterator __s,
                 const _CharT* __ob, const _CharT* __op, const _CharT* __oe,
                 ios_base& __iob, _CharT __fl)
{
    streamsize __sz = __oe - __ob;
    streamsize __ns = __iob.width();
    if (__ns > __sz)
        __ns -= __sz;
    else
        __ns = 0;
    for (;__ob < __op; ++__ob, ++__s)
        *__s = *__ob;
    for (; __ns; --__ns, ++__s)
        *__s = __fl;
    for (; __ob < __oe; ++__ob, ++__s)
        *__s = *__ob;
    __iob.width(0);
    return __s;
}

#if !defined(__APPLE__) || \
    (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_8) || \
    (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0)

template <class _CharT, class _Traits>
_LIBCPP_HIDDEN
ostreambuf_iterator<_CharT, _Traits>
__pad_and_output(ostreambuf_iterator<_CharT, _Traits> __s,
                 const _CharT* __ob, const _CharT* __op, const _CharT* __oe,
                 ios_base& __iob, _CharT __fl)
        {
            __s.__sbuf_ = nullptr;
            return __s;
        }
    }
    __iob.width(0);
    return __s;
}

#endif
# 1520 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3


_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS num_put<wchar_t>)

template <class _CharT, class _InputIterator>
_LIBCPP_HIDDEN
int
__get_up_to_n_digits(_InputIterator& __b, _InputIterator __e,
                     ios_base::iostate& __err, const ctype<_CharT>& __ct, int __n)
{
    // Precondition:  __n >= 1
    if (__b == __e)
    {
        __err |= ios_base::eofbit | ios_base::failbit;
        return 0;
    }
    // get first digit
    _CharT __c = *__b;
    if (!__ct.is(ctype_base::digit, __c))
    {
        __err |= ios_base::failbit;
        return 0;
    }
    int __r = __ct.narrow(__c, 0) - '0';
    for (++__b, --__n; __b != __e && __n > 0; ++__b, --__n)
    {
        // get next digit
        __c = *__b;
        if (!__ct.is(ctype_base::digit, __c))
            return __r;
        __r = __r * 10 + __ct.narrow(__c, 0) - '0';
    }
    if (__b == __e)
        __err |= ios_base::eofbit;
    return __r;
}

class _LIBCPP_TYPE_VIS time_base
{
public:
    enum dateorder {no_order, dmy, mdy, ymd, ydm};
};

template <class _CharT>
class _LIBCPP_TYPE_VIS __time_get_c_storage
{
protected:
    typedef basic_string<_CharT> string_type;

    virtual const string_type* __weeks() const;
    virtual const string_type* __months() const;
    virtual const string_type* __am_pm() const;
    virtual const string_type& __c() const;
    ;
    virtual const string_type& __x() const;
    virtual const string_type& __X() const;
};

template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY time_get
    : public locale::facet,
      public time_base,
      private __time_get_c_storage<_CharT>
{
public:
    typedef _CharT                  char_type;
    typedef _InputIterator          iter_type;
    typedef time_base::dateorder    dateorder;
    typedef basic_string<char_type> string_type;

    _LIBCPP_ALWAYS_INLINE
    explicit time_get(size_t __refs = 0)
        : locale::facet(__refs) {}

    _LIBCPP_ALWAYS_INLINE
    dateorder date_order() const
    {
        return this->do_date_order();
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get_time(iter_type __b, iter_type __e, ios_base& __iob,
                       ios_base::iostate& __err, tm* __tm) const
    {
        return do_get_time(__b, __e, __iob, __err, __tm);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get_date(iter_type __b, iter_type __e, ios_base& __iob,
                       ios_base::iostate& __err, tm* __tm) const
    {
        return do_get_date(__b, __e, __iob, __err, __tm);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get_weekday(iter_type __b, iter_type __e, ios_base& __iob,
                          ios_base::iostate& __err, tm* __tm) const
    {
        return do_get_weekday(__b, __e, __iob, __err, __tm);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get_monthname(iter_type __b, iter_type __e, ios_base& __iob,
                            ios_base::iostate& __err, tm* __tm) const
    {
        return do_get_monthname(__b, __e, __iob, __err, __tm);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get_year(iter_type __b, iter_type __e, ios_base& __iob,
                       ios_base::iostate& __err, tm* __tm) const
    {
        return do_get_year(__b, __e, __iob, __err, __tm);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, ios_base& __iob,
                  ios_base::iostate& __err, tm *__tm,
                  char __fmt, char __mod = 0) const
    {
        return do_get(__b, __e, __iob, __err, __tm, __fmt, __mod);
    }

    ;

    static locale::id id;

protected:
    _LIBCPP_ALWAYS_INLINE
    ~time_get() {}

    virtual dateorder do_date_order() const;
    virtual iter_type do_get_time(iter_type __b, iter_type __e, ios_base& __iob,
                                  ios_base::iostate& __err, tm* __tm) const;
    virtual iter_type do_get_date(iter_type __b, iter_type __e, ios_base& __iob,
                                  ios_base::iostate& __err, tm* __tm) const;
    virtual iter_type do_get_weekday(iter_type __b, iter_type __e, ios_base& __iob,
                                     ios_base::iostate& __err, tm* __tm) const;
    virtual iter_type do_get_monthname(iter_type __b, iter_type __e, ios_base& __iob,
                                       ios_base::iostate& __err, tm* __tm) const;
    virtual iter_type do_get_year(iter_type __b, iter_type __e, ios_base& __iob,
                                  ios_base::iostate& __err, tm* __tm) const;
    virtual iter_type do_get(iter_type __b, iter_type __e, ios_base& __iob,
                             ios_base::iostate& __err, tm* __tm,
                             char __fmt, char __mod) const;
private:
    void __get_white_space(iter_type& __b, iter_type __e,
                           ios_base::iostate& __err, const ctype<char_type>& __ct) const;
    void __get_percent(iter_type& __b, iter_type __e, ios_base::iostate& __err,
                       const ctype<char_type>& __ct) const;

    void __get_weekdayname(int& __m,
                           iter_type& __b, iter_type __e,
                           ios_base::iostate& __err,
                           const ctype<char_type>& __ct) const;
    void __get_monthname(int& __m,
                         iter_type& __b, iter_type __e,
                         ios_base::iostate& __err,
                         const ctype<char_type>& __ct) const;
    void __get_day(int& __d,
                   iter_type& __b, iter_type __e,
                   ios_base::iostate& __err,
                   const ctype<char_type>& __ct) const;
    void __get_month(int& __m,
                     iter_type& __b, iter_type __e,
                     ios_base::iostate& __err,
                     const ctype<char_type>& __ct) const;
    void __get_year(int& __y,
                   iter_type& __b, iter_type __e,
                   ios_base::iostate& __err,
                   const ctype<char_type>& __ct) const;
    void __get_year4(int& __y,
                    iter_type& __b, iter_type __e,
                    ios_base::iostate& __err,
                    const ctype<char_type>& __ct) const;
    void __get_hour(int& __d,
                    iter_type& __b, iter_type __e,
                    ios_base::iostate& __err,
                    const ctype<char_type>& __ct) const;
    void __get_12_hour(int& __h,
                       iter_type& __b, iter_type __e,
                       ios_base::iostate& __err,
                       const ctype<char_type>& __ct) const;
    void __get_am_pm(int& __h,
                     iter_type& __b, iter_type __e,
                     ios_base::iostate& __err,
                     const ctype<char_type>& __ct) const;
    void __get_minute(int& __m,
                      iter_type& __b, iter_type __e,
                      ios_base::iostate& __err,
                      const ctype<char_type>& __ct) const;
    void __get_second(int& __s,
                      iter_type& __b, iter_type __e,
                      ios_base::iostate& __err,
                      const ctype<char_type>& __ct) const;
    void __get_weekday(int& __w,
                       iter_type& __b, iter_type __e,
                       ios_base::iostate& __err,
                       const ctype<char_type>& __ct) const;
    void __get_day_year_num(int& __w,
                            iter_type& __b, iter_type __e,
                            ios_base::iostate& __err,
                            const ctype<char_type>& __ct) const;
};

template <class _CharT, class _InputIterator>
locale::id
time_get<_CharT, _InputIterator>::id;

// time_get primatives

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_weekdayname(int& __w,
                                                    iter_type& __b, iter_type __e,
                                                    ios_base::iostate& __err,
                                                    const ctype<char_type>& __ct) const
{
    // Note:  ignoring case comes from the POSIX strptime spec
    const string_type* __wk = this->__weeks();
    ptrdiff_t __i = __scan_keyword(__b, __e, __wk, __wk+14, __ct, __err, false) - __wk;
    if (__i < 14)
        __w = __i % 7;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_monthname(int& __m,
                                                  iter_type& __b, iter_type __e,
                                                  ios_base::iostate& __err,
                                                  const ctype<char_type>& __ct) const
{
    // Note:  ignoring case comes from the POSIX strptime spec
    const string_type* __month = this->__months();
    ptrdiff_t __i = __scan_keyword(__b, __e, __month, __month+24, __ct, __err, false) - __month;
    if (__i < 24)
        __m = __i % 12;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_day(int& __d,
                                            iter_type& __b, iter_type __e,
                                            ios_base::iostate& __err,
                                            const ctype<char_type>& __ct) const
{
    int __t = __get_up_to_n_digits(__b, __e, __err, __ct, 2);
    if (!(__err & ios_base::failbit) && 1 <= __t && __t <= 31)
        __d = __t;
    else
        __err |= ios_base::failbit;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_month(int& __m,
                                              iter_type& __b, iter_type __e,
                                              ios_base::iostate& __err,
                                              const ctype<char_type>& __ct) const
{
    int __t = __get_up_to_n_digits(__b, __e, __err, __ct, 2) - 1;
    if (!(__err & ios_base::failbit) && __t <= 11)
        __m = __t;
    else
        __err |= ios_base::failbit;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_year(int& __y,
                                             iter_type& __b, iter_type __e,
                                             ios_base::iostate& __err,
                                             const ctype<char_type>& __ct) const
{
    int __t = __get_up_to_n_digits(__b, __e, __err, __ct, 4);
    if (!(__err & ios_base::failbit))
    {
        if (__t < 69)
            __t += 2000;
        else if (69 <= __t && __t <= 99)
            __t += 1900;
        __y = __t - 1900;
    }
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_year4(int& __y,
                                              iter_type& __b, iter_type __e,
                                              ios_base::iostate& __err,
                                              const ctype<char_type>& __ct) const
{
    int __t = __get_up_to_n_digits(__b, __e, __err, __ct, 4);
    if (!(__err & ios_base::failbit))
        __y = __t - 1900;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_hour(int& __h,
                                             iter_type& __b, iter_type __e,
                                             ios_base::iostate& __err,
                                             const ctype<char_type>& __ct) const
{
    int __t = __get_up_to_n_digits(__b, __e, __err, __ct, 2);
    if (!(__err & ios_base::failbit) && __t <= 23)
        __err |= ios_base::failbit;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_minute(int& __m,
                                               iter_type& __b, iter_type __e,
                                               ios_base::iostate& __err,
                                               const ctype<char_type>& __ct) const
{
    int __t = __get_up_to_n_digits(__b, __e, __err, __ct, 2);
    if (!(__err & ios_base::failbit) && __t <= 59)
        __m = __t;
    else
        __err |= ios_base::failbit;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_second(int& __s,
                                               iter_type& __b, iter_type __e,
                                               ios_base::iostate& __err,
                                               const ctype<char_type>& __ct) const
{
    int __t = __get_up_to_n_digits(__b, __e, __err, __ct, 2);
    if (!(__err & ios_base::failbit) && __t <= 60)
        __s = __t;
    else
        __err |= ios_base::failbit;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_weekday(int& __w,
                                                iter_type& __b, iter_type __e,
                                                ios_base::iostate& __err,
                                                const ctype<char_type>& __ct) const
{
    int __t = __get_up_to_n_digits(__b, __e, __err, __ct, 1);
    if (!(__err & ios_base::failbit) && __t <= 6)
        __w = __t;
    else
        __err |= ios_base::failbit;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_day_year_num(int& __d,
                                                     iter_type& __b, iter_type __e,
                                                     ios_base::iostate& __err,
                                                     const ctype<char_type>& __ct) const
{
    int __t = __get_up_to_n_digits(__b, __e, __err, __ct, 3);
    if (!(__err & ios_base::failbit) && __t <= 365)
        __d = __t;
    else
        __err |= ios_base::failbit;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_white_space(iter_type& __b, iter_type __e,
                                                    ios_base::iostate& __err,
                                                    const ctype<char_type>& __ct) const
{
    for (; __b != __e && __ct.is(ctype_base::space, *__b); ++__b)
        ;
    if (__b == __e)
        __err |= ios_base::eofbit;
}

template <class _CharT, class _InputIterator>
void
time_get<_CharT, _InputIterator>::__get_am_pm(int& __h,
                                              iter_type& __b, iter_type __e,
                                              ios_base::iostate& __err,
                                              const ctype<char_type>& __ct) const
{
    const string_type* __ap = this->__am_pm();
    if (__ap[0].size() + __ap[1].size() == 0)
    {
        __err |= ios_base::failbit;
        return;
    }
    ptrdiff_t __i = __scan_keyword(__b, __e, __ap, __ap+2, __ct, __err, false) - __ap;
    return mdy;
}

template <class _CharT, class _InputIterator>
_InputIterator
time_get<_CharT, _InputIterator>::do_get_time(iter_type __b, iter_type __e,
                                              ios_base& __iob,
                                              ios_base::iostate& __err,
                                              tm* __tm) const
{
    const char_type __fmt[] = {'%', 'H', ':', '%', 'M', ':', '%', 'S'};
    return get(__b, __e, __iob, __err, __tm, __fmt, __fmt + sizeof(__fmt)/sizeof(__fmt[0]));
}

template <class _CharT, class _InputIterator>
_InputIterator
time_get<_CharT, _InputIterator>::do_get_date(iter_type __b, iter_type __e,
                                              ios_base& __iob,
                                              ios_base::iostate& __err,
                                              tm* __tm) const
{
    const string_type& __fmt = this->__x();
    return get(__b, __e, __iob, __err, __tm, __fmt.data(), __fmt.data() + __fmt.size());
}

template <class _CharT, class _InputIterator>
_InputIterator
time_get<_CharT, _InputIterator>::do_get_weekday(iter_type __b, iter_type __e,
                                                 ios_base& __iob,
                                                 ios_base::iostate& __err,
                                                 tm* __tm) const
{
    const ctype<char_type>& __ct = use_facet<ctype<char_type> >(__iob.getloc());
    __get_weekdayname(__tm->tm_wday, __b, __e, __err, __ct);
    return __b;
}

template <class _CharT, class _InputIterator>
_InputIterator
time_get<_CharT, _InputIterator>::do_get_monthname(iter_type __b, iter_type __e,
                                                   ios_base& __iob,
                                                   ios_base::iostate& __err,
                                                   tm* __tm) const
{
    const ctype<char_type>& __ct = use_facet<ctype<char_type> >(__iob.getloc());
    __get_monthname(__tm->tm_mon, __b, __e, __err, __ct);
    return __b;
}

template <class _CharT, class _InputIterator>
_InputIterator
time_get<_CharT, _InputIterator>::do_get_year(iter_type __b, iter_type __e,
                                              ios_base& __iob,
                                              ios_base::iostate& __err,
                                              tm* __tm) const
{
    const ctype<char_type>& __ct = use_facet<ctype<char_type> >(__iob.getloc());
    __get_year(__tm->tm_year, __b, __e, __err, __ct);
    return __b;
}

template <class _CharT, class _InputIterator>
_InputIterator
time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
                                         ios_base& __iob,
                                         ios_base::iostate& __err, tm* __tm,
                                         char __fmt, char) const
{
    __err = ios_base::goodbit;
    const ctype<char_type>& __ct = use_facet<ctype<char_type> >(__iob.getloc());
    switch (__fmt)
    {
    case 'a':
    case 'A':
        __get_weekdayname(__tm->tm_wday, __b, __e, __err, __ct);
        break;
    case 'T':
        {
        const char_type __fm[] = {'%', 'H', ':', '%', 'M', ':', '%', 'S'};
        __b = get(__b, __e, __iob, __err, __tm, __fm, __fm + sizeof(__fm)/sizeof(__fm[0]));
        }
        break;
    case 'w':
        __get_weekday(__tm->tm_wday, __b, __e, __err, __ct);
        break;
    case 'x':
        return do_get_date(__b, __e, __iob, __err, __tm);
    case 'X':
        {
        const string_type& __fm = this->__X();
        __b = get(__b, __e, __iob, __err, __tm, __fm.data(), __fm.data() + __fm.size());
        }
        break;
    case 'y':
        __get_year(__tm->tm_year, __b, __e, __err, __ct);
        break;
    case 'Y':
        __get_year4(__tm->tm_year, __b, __e, __err, __ct);
        break;
    case '%':
        __get_percent(__b, __e, __err, __ct);
        break;
    default:
        __err |= ios_base::failbit;
    }
    return __b;
}

_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get<char>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get<wchar_t>)

class _LIBCPP_TYPE_VIS __time_get
{
protected:
    locale_t __loc_;

    ;
    ;
    ;
};

template <class _CharT>
class _LIBCPP_TYPE_VIS __time_get_storage
    : public __time_get
{
protected:
    typedef basic_string<_CharT> string_type;

    string_type __weeks_[14];
    string_type __months_[24];
    string_type __am_pm_[2];
    string_type __c_;
    string_type __r_;
    string_type __x_;
    string_type __X_;

    ;
    ;

    _LIBCPP_ALWAYS_INLINE ~__time_get_storage() {}

    time_base::dateorder __do_date_order() const;

private:
    ;
    ;
};

template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY time_get_byname
    : public time_get<_CharT, _InputIterator>,
      private __time_get_storage<_CharT>
{
public:
    typedef time_base::dateorder    dateorder;
    typedef _InputIterator          iter_type;
    typedef _CharT                  char_type;
    typedef basic_string<char_type> string_type;

    _LIBCPP_INLINE_VISIBILITY
    explicit time_get_byname(const char* __nm, size_t __refs = 0)
        : time_get<_CharT, _InputIterator>(__refs),
          __time_get_storage<_CharT>(__nm) {}
    _LIBCPP_INLINE_VISIBILITY
    explicit time_get_byname(const string& __nm, size_t __refs = 0)
        : time_get<_CharT, _InputIterator>(__refs),
          __time_get_storage<_CharT>(__nm) {}

protected:
    _LIBCPP_INLINE_VISIBILITY
    ~time_get_byname() {}
    _LIBCPP_INLINE_VISIBILITY
    virtual const string_type& __X() const      {return this->__X_;}
};

_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get_byname<char>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_get_byname<wchar_t>)

class _LIBCPP_TYPE_VIS __time_put
{
    locale_t __loc_;
protected:
    _LIBCPP_ALWAYS_INLINE __time_put() : __loc_(_LIBCPP_GET_C_LOCALE) {}
    __time_put(const char* __nm);
    __time_put(const string& __nm);
    ;
    ;
    ;
};

template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY time_put
    : public locale::facet,
      private __time_put
{
public:
    typedef _CharT char_type;
    typedef _OutputIterator iter_type;

    _LIBCPP_ALWAYS_INLINE
    explicit time_put(size_t __refs = 0)
        : locale::facet(__refs) {}

    ;

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, ios_base& __iob, char_type __fl,
                  const tm* __tm, char __fmt, char __mod = 0) const
    {
        return do_put(__s, __iob, __fl, __tm, __fmt, __mod);
    }

    static locale::id id;

protected:
    _LIBCPP_ALWAYS_INLINE
    ~time_put() {}
    virtual iter_type do_put(iter_type __s, ios_base&, char_type, const tm* __tm,
                             char __fmt, char __mod) const;

    _LIBCPP_ALWAYS_INLINE
    explicit time_put(const char* __nm, size_t __refs)
        : locale::facet(__refs),
          __time_put(__nm) {}
    _LIBCPP_ALWAYS_INLINE
    explicit time_put(const string& __nm, size_t __refs)
        : locale::facet(__refs),
          __time_put(__nm) {}
};

template <class _CharT, class _OutputIterator>
locale::id
time_put<_CharT, _OutputIterator>::id;



template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY time_put_byname
    : public time_put<_CharT, _OutputIterator>
{
public:
    _LIBCPP_ALWAYS_INLINE
    explicit time_put_byname(const char* __nm, size_t __refs = 0)
        : time_put<_CharT, _OutputIterator>(__nm, __refs) {}

    _LIBCPP_ALWAYS_INLINE
    explicit time_put_byname(const string& __nm, size_t __refs = 0)
        : time_put<_CharT, _OutputIterator>(__nm, __refs) {}

protected:
    _LIBCPP_ALWAYS_INLINE
    ~time_put_byname() {}
};

_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put_byname<char>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS time_put_byname<wchar_t>)

// money_base

class _LIBCPP_TYPE_VIS money_base
{
public:
    enum part {none, space, symbol, sign, value};
    struct pattern {char field[4];};

    _LIBCPP_ALWAYS_INLINE money_base() {}
};

// moneypunct

template <class _CharT, bool _International = false>
class _LIBCPP_TYPE_VIS_ONLY moneypunct
    : public locale::facet,
      public money_base
{
public:
    typedef _CharT                  char_type;
    typedef basic_string<char_type> string_type;

    _LIBCPP_ALWAYS_INLINE
    explicit moneypunct(size_t __refs = 0)
        : locale::facet(__refs) {}

    _LIBCPP_ALWAYS_INLINE char_type   decimal_point() const {return do_decimal_point();}
    _LIBCPP_ALWAYS_INLINE char_type   thousands_sep() const {return do_thousands_sep();}
    _LIBCPP_ALWAYS_INLINE string      grouping()      const {return do_grouping();}
    _LIBCPP_ALWAYS_INLINE string_type curr_symbol()   const {return do_curr_symbol();}
    _LIBCPP_ALWAYS_INLINE string_type positive_sign() const {return do_positive_sign();}
    _LIBCPP_ALWAYS_INLINE string_type negative_sign() const {return do_negative_sign();}
    _LIBCPP_ALWAYS_INLINE int         frac_digits()   const {return do_frac_digits();}
    _LIBCPP_ALWAYS_INLINE pattern     pos_format()    const {return do_pos_format();}
    _LIBCPP_ALWAYS_INLINE pattern     neg_format()    const {return do_neg_format();}

    static locale::id id;
    static const bool intl = _International;

protected:
    _LIBCPP_ALWAYS_INLINE
    ~moneypunct() {}

    virtual char_type   do_decimal_point() const {return numeric_limits<char_type>::max();}
    virtual char_type   do_thousands_sep() const {return numeric_limits<char_type>::max();}
    virtual string      do_grouping()      const {return string();}
    virtual string_type do_curr_symbol()   const {return string_type();}
    virtual string_type do_positive_sign() const {return string_type();}
    virtual string_type do_negative_sign() const {return string_type(1, '-');}
    virtual int         do_frac_digits()   const {return 0;}
    virtual pattern     do_pos_format()    const
        {pattern __p = {{symbol, sign, none, value}}; return __p;}
    virtual pattern     do_neg_format()    const
        {pattern __p = {{symbol, sign, none, value}}; return __p;}
};

template <class _CharT, bool _International>
locale::id
moneypunct<_CharT, _International>::id;

template <class _CharT, bool _International>
const bool
moneypunct<_CharT, _International>::intl;

_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<char, false>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<char, true>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<wchar_t, false>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct<wchar_t, true>)

// moneypunct_byname

template <class _CharT, bool _International = false>
class _LIBCPP_TYPE_VIS_ONLY moneypunct_byname
    : public moneypunct<_CharT, _International>
{
public:
    typedef money_base::pattern  pattern;
    typedef _CharT                  char_type;
    typedef basic_string<char_type> string_type;

    _LIBCPP_ALWAYS_INLINE

    void init(const char*);
};

template<> void moneypunct_byname<char, false>::init(const char*);
template<> void moneypunct_byname<char, true>::init(const char*);
template<> void moneypunct_byname<wchar_t, false>::init(const char*);
template<> void moneypunct_byname<wchar_t, true>::init(const char*);

_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<char, false>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<char, true>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<wchar_t, false>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS moneypunct_byname<wchar_t, true>)

// money_get

template <class _CharT>
class __money_get
{
protected:
    typedef _CharT                  char_type;
    typedef basic_string<char_type> string_type;

    _LIBCPP_ALWAYS_INLINE __money_get() {}

    ;
};



_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_get<char>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_get<wchar_t>)

template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY money_get
    : public locale::facet,
      private __money_get<_CharT>
{
public:
    typedef _CharT                  char_type;
    typedef _InputIterator          iter_type;
    typedef basic_string<char_type> string_type;

    _LIBCPP_ALWAYS_INLINE
    explicit money_get(size_t __refs = 0)
        : locale::facet(__refs) {}

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, bool __intl, ios_base& __iob,
                  ios_base::iostate& __err, long double& __v) const
    {
        return do_get(__b, __e, __intl, __iob, __err, __v);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type get(iter_type __b, iter_type __e, bool __intl, ios_base& __iob,
                  ios_base::iostate& __err, string_type& __v) const
    {
        return do_get(__b, __e, __intl, __iob, __err, __v);
    }

    static locale::id id;

protected:

    _LIBCPP_ALWAYS_INLINE
    ~money_get() {}

    ;
    ;

private:
    ;
};

template <class _CharT, class _InputIterator>
locale::id
money_get<_CharT, _InputIterator>::id;

_LIBCPP_FUNC_VIS void __do_nothing(void*);

template <class _Tp>
_LIBCPP_HIDDEN
void
__double_or_nothing(unique_ptr<_Tp, void(*)(void*)>& __b, _Tp*& __n, _Tp*& __e)
{
    bool __owns = __b.get_deleter() != __do_nothing;
    size_t __cur_cap = static_cast<size_t>(__e-__b.get()) * sizeof(_Tp);
    size_t __new_cap = __cur_cap < numeric_limits<size_t>::max() / 2 ?
                       2 * __cur_cap : numeric_limits<size_t>::max();
    size_t __n_off = static_cast<size_t>(__n - __b.get());
    _Tp* __t = (_Tp*)realloc(__owns ? __b.get() : 0, __new_cap);
    if (__t == 0)
        __throw_bad_alloc();
    if (__owns)
        __b.release();
    __b = unique_ptr<_Tp, void(*)(void*)>(__t, free);
    __new_cap /= sizeof(_Tp);
    __n = __b.get() + __n_off;
    __e = __b.get() + __new_cap;
}

// true == success






_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_get<char>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_get<wchar_t>)

// money_put

template <class _CharT>
class __money_put
{
protected:
    typedef _CharT                  char_type;
    typedef basic_string<char_type> string_type;

    _LIBCPP_ALWAYS_INLINE __money_put() {}

    ;
    ;
};





_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_put<char>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS __money_put<wchar_t>)

template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
class _LIBCPP_TYPE_VIS_ONLY money_put
    : public locale::facet,
      private __money_put<_CharT>
{
public:
    typedef _CharT                  char_type;
    typedef _OutputIterator         iter_type;
    typedef basic_string<char_type> string_type;

    _LIBCPP_ALWAYS_INLINE
    explicit money_put(size_t __refs = 0)
        : locale::facet(__refs) {}

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, bool __intl, ios_base& __iob, char_type __fl,
                  long double __units) const
    {
        return do_put(__s, __intl, __iob, __fl, __units);
    }

    _LIBCPP_ALWAYS_INLINE
    iter_type put(iter_type __s, bool __intl, ios_base& __iob, char_type __fl,
                  const string_type& __digits) const
    {
        return do_put(__s, __intl, __iob, __fl, __digits);
    }

    static locale::id id;

protected:
    _LIBCPP_ALWAYS_INLINE
    ~money_put() {}

    ;
    ;
};

template <class _CharT, class _OutputIterator>
locale::id
money_put<_CharT, _OutputIterator>::id;





_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_put<char>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS money_put<wchar_t>)

// messages

class _LIBCPP_TYPE_VIS messages_base
{
public:
    typedef ptrdiff_t catalog;

    _LIBCPP_ALWAYS_INLINE messages_base() {}
};

template <class _CharT>
class _LIBCPP_TYPE_VIS_ONLY messages
    : public locale::facet,
      public messages_base
{
public:
    typedef _CharT               char_type;
    typedef basic_string<_CharT> string_type;

    _LIBCPP_ALWAYS_INLINE
    explicit messages(size_t __refs = 0)
        : locale::facet(__refs) {}

    _LIBCPP_ALWAYS_INLINE
    catalog open(const basic_string<char>& __nm, const locale& __loc) const
    {
        return do_open(__nm, __loc);
    }

    _LIBCPP_ALWAYS_INLINE
    string_type get(catalog __c, int __set, int __msgid,
                    const string_type& __dflt) const
    {
        return do_get(__c, __set, __msgid, __dflt);
    }

    _LIBCPP_ALWAYS_INLINE
    void close(catalog __c) const
    {
        do_close(__c);
    }

    static locale::id id;

protected:
    _LIBCPP_ALWAYS_INLINE
    ~messages() {}

    virtual catalog do_open(const basic_string<char>&, const locale&) const;
    virtual string_type do_get(catalog, int __set, int __msgid,
                               const string_type& __dflt) const;
    virtual void do_close(catalog) const;
};

template <class _CharT>
locale::id
messages<_CharT>::id;

template <class _CharT>
typename messages<_CharT>::catalog
messages<_CharT>::do_open(const basic_string<char>& __nm, const locale&) const
{
#ifdef _WIN32
    return -1;
#else // _WIN32
# 3679 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
    catalog __cat = (catalog)catopen(__nm.c_str(), NL_CAT_LOCALE);
    if (__cat != -1)
        __cat = static_cast<catalog>((static_cast<size_t>(__cat) >> 1));
    return __cat;
#endif // _WIN32
# 3684 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
}

template <class _CharT>
typename messages<_CharT>::string_type
messages<_CharT>::do_get(catalog __c, int __set, int __msgid,
                         const string_type& __dflt) const
{
#ifdef _WIN32
    return __dflt;
#else // _WIN32
# 3694 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
    string __ndflt;
    __narrow_to_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__ndflt),
                                                       __dflt.c_str(),
                                                       __dflt.c_str() + __dflt.size());
    if (__c != -1)
        __c <<= 1;
    nl_catd __cat = (nl_catd)__c;
    char* __n = catgets(__cat, __set, __msgid, __ndflt.c_str());
    string_type __w;
    __widen_from_utf8<sizeof(char_type)*__CHAR_BIT__>()(back_inserter(__w),
                                                        __n, __n + strlen(__n));
    return __w;
#endif // _WIN32
# 3707 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
}

template <class _CharT>
class _LIBCPP_TYPE_VIS_ONLY messages_byname
    : public messages<_CharT>
{
public:
    typedef messages_base::catalog catalog;
    typedef basic_string<_CharT> string_type;

    _LIBCPP_ALWAYS_INLINE
    explicit messages_byname(const char*, size_t __refs = 0)
        : messages<_CharT>(__refs) {}

    _LIBCPP_ALWAYS_INLINE
    explicit messages_byname(const string&, size_t __refs = 0)
        : messages<_CharT>(__refs) {}

protected:
    _LIBCPP_ALWAYS_INLINE
    ~messages_byname() {}
};

_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages_byname<char>)
_LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_TYPE_VIS messages_byname<wchar_t>)

template<class _Codecvt, class _Elem = wchar_t,
         class _Wide_alloc = allocator<_Elem>,
         class _Byte_alloc = allocator<char> >
class _LIBCPP_TYPE_VIS_ONLY wstring_convert
{
public:
    typedef basic_string<char, char_traits<char>, _Byte_alloc>   byte_string;
    typedef basic_string<_Elem, char_traits<_Elem>, _Wide_alloc> wide_string;
    typedef typename _Codecvt::state_type                        state_type;
    typedef typename wide_string::traits_type::int_type          int_type;

private:
    byte_string __byte_err_string_;
    wide_string __wide_err_string_;
    _Codecvt* __cvtptr_;
    state_type __cvtstate_;
    size_t __cvtcount_;

    ;
    ;
public:
    _LIBCPP_EXPLICIT_AFTER_CXX11 ;
    ;
    _LIBCPP_EXPLICIT_AFTER_CXX11 ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    wstring_convert(wstring_convert&& __wc);
#endif
# 3776 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
    ;

    _LIBCPP_ALWAYS_INLINE
    wide_string from_bytes(char __byte)
        {return from_bytes(&__byte, &__byte+1);}
    _LIBCPP_ALWAYS_INLINE
    wide_string from_bytes(const char* __ptr)
        {return from_bytes(__ptr, __ptr + char_traits<char>::length(__ptr));}
    _LIBCPP_ALWAYS_INLINE
    wide_string from_bytes(const byte_string& __str)
        {return from_bytes(__str.data(), __str.data() + __str.size());}
    state_type state() const {return __cvtstate_;}
};







#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
inline _LIBCPP_ALWAYS_INLINE
wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::
    wstring_convert(wstring_convert&& __wc)
        : __byte_err_string_(_VSTD::move(__wc.__byte_err_string_)),
          __wide_err_string_(_VSTD::move(__wc.__wide_err_string_)),
          __cvtptr_(__wc.__cvtptr_),
          __cvtstate_(__wc.__cvtstate_), __cvtcount_(__wc.__cvtstate_)
{
    __wc.__cvtptr_ = nullptr;
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 3846 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3







template <class _Codecvt, class _Elem = wchar_t, class _Tr = char_traits<_Elem> >
class _LIBCPP_TYPE_VIS_ONLY wbuffer_convert
    : public basic_streambuf<_Elem, _Tr>
{
public:
    // types:
    typedef _Elem                          char_type;
    typedef _Tr                            traits_type;
    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;
    typedef typename _Codecvt::state_type  state_type;

private:
    char*       __extbuf_;
    const char* __extbufnext_;
    const char* __extbufend_;
    char __extbuf_min_[8];
    size_t __ebs_;
    char_type* __intbuf_;
    size_t __ibs_;
    streambuf* __bufptr_;
    _Codecvt* __cv_;
    state_type __st_;
    ios_base::openmode __cm_;

private:
    ;
    ;
    ;
};









_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_LOCALE
# 4466 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/locale" 3
# 134 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <iterator>
#endif /* expanded by -frewrite-includes */
# 135 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
#if 0 /* expanded by -frewrite-includes */
#include <bitset>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 1 3
// -*- C++ -*-
//===---------------------------- bitset ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_BITSET
#define _LIBCPP_BITSET

/*
    bitset synopsis

namespace std
{

namespace std {

template <size_t N>
class bitset
#endif /* expanded by -frewrite-includes */
# 126 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3
#if 0 /* expanded by -frewrite-includes */
#include <iosfwd>

#undef assert
#undef __assert

#ifdef NDEBUG
#define	assert(e)	((void)0)
#else
# 58 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

#ifndef __GNUC__

__BEGIN_DECLS
#ifndef __cplusplus
void abort(void) __dead2;
#endif /* !__cplusplus */
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
# 80 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
__END_DECLS

#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) < 1070)
#define __assert(e, file, line) \
    __eprintf ("%s:%u: failed assertion `%s'\n", file, line, e)
#else
# 86 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
/* 8462256: modified __assert_rtn() replaces deprecated __eprintf() */
#define __assert(e, file, line) \
    __assert_rtn ((const char *)-1L, file, line, e)
#endif
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

#if __DARWIN_UNIX03
#define	assert(e) \
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
#else /* !__DARWIN_UNIX03 */
# 95 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
#define assert(e)  \
    (__builtin_expect(!(e), 0) ? __assert (#e, __FILE__, __LINE__) : (void)0)
#endif /* __DARWIN_UNIX03 */
# 98 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4

#endif /* __GNUC__ */
# 100 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
#endif /* NDEBUG */
# 101 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/assert.h" 3 4
# 22 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 25 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 3
#endif
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cassert" 3
# 130 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 2 3
#endif
# 131 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//

_LIBCPP_BEGIN_NAMESPACE_STD

template <size_t _N_words, size_t _Size>
class __bitset;

template <size_t _N_words, size_t _Size>
struct __has_storage_type<__bitset<_N_words, _Size> >
{
    static const bool value = true;
};

template <size_t _N_words, size_t _Size>
class __bitset
{
public:
    typedef ptrdiff_t              difference_type;
    typedef size_t                 size_type;
    typedef size_type              __storage_type;
protected:
    typedef __bitset __self;
    typedef       __storage_type*  __storage_pointer;
    typedef const __storage_type*  __const_storage_pointer;
    static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);

    friend class __bit_reference<__bitset>;
    friend class __bit_const_reference<__bitset>;
    friend class __bit_iterator<__bitset, false>;
    friend class __bit_iterator<__bitset, true>;
    friend struct __bit_array<__bitset>;

    __storage_type __first_[_N_words];

    typedef __bit_reference<__bitset>                  reference;
    typedef __bit_const_reference<__bitset>            const_reference;
    typedef __bit_iterator<__bitset, false>            iterator;
    typedef __bit_iterator<__bitset, true>             const_iterator;

    _LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
    explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
        {return reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
        {return const_reference(__first_ + __pos / __bits_per_word, __storage_type(1) << __pos % __bits_per_word);}
    _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
        {return iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
    _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
        {return const_iterator(__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}

    void operator&=(const __bitset& __v) _NOEXCEPT;
    void operator|=(const __bitset& __v) _NOEXCEPT;
    void operator^=(const __bitset& __v) _NOEXCEPT;

    void flip() _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY unsigned long to_ulong() const
        {return to_ulong(integral_constant<bool, _Size < sizeof(unsigned long) * CHAR_BIT>());}
    _LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const
        {return to_ullong(integral_constant<bool, _Size < sizeof(unsigned long long) * CHAR_BIT>());}

    bool all() const _NOEXCEPT;
    bool any() const _NOEXCEPT;
    size_t __hash_code() const _NOEXCEPT;
private:
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
    void __init(unsigned long long __v, false_type) _NOEXCEPT;
    void __init(unsigned long long __v, true_type) _NOEXCEPT;
#endif  // _LIBCPP_HAS_NO_CONSTEXPR
# 201 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3
    ;
    ;
    ;
    ;
    ;
    ;
};

template <size_t _N_words, size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
__bitset<_N_words, _Size>::__bitset() _NOEXCEPT
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
    : __first_{0}
#endif
# 216 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3
{
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
    _VSTD::fill_n(__first_, _N_words, __storage_type(0));
#endif
# 220 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3
}

#ifdef _LIBCPP_HAS_NO_CONSTEXPR

{
    __first_[0] = __v;
    _VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
}

#endif  // _LIBCPP_HAS_NO_CONSTEXPR
# 246 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3

template <size_t _N_words, size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
__bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
#ifndef _LIBCPP_HAS_NO_CONSTEXPR
#if __SIZE_WIDTH__ == 64
    : __first_{__v}
#elif __SIZE_WIDTH__ == 32
# 255 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3
    : __first_{__v, __v >> __bits_per_word}
#else
# 257 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3
#error This constructor has not been ported to this platform
#endif
# 259 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3
#endif
# 260 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3
{
#ifdef _LIBCPP_HAS_NO_CONSTEXPR
    __init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>());
#endif
# 264 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3
}

template <size_t _N_words, size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
void
__bitset<_N_words, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
{
    for (size_type __i = 0; __i < _N_words; ++__i)
        __first_[__i] &= __v.__first_[__i];
}

template <size_t _N_words, size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
void
__bitset<_N_words, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
{
    for (size_type __i = 0; __i < _N_words; ++__i)
        __first_[__i] |= __v.__first_[__i];
    size_type __n = _Size;
    __storage_pointer __p = __first_;
    for (; __n >= __bits_per_word; ++__p, __n -= __bits_per_word)
        *__p = ~*__p;
    // do last partial word
    if (__n > 0)
    {
        __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
        __storage_type __b = *__p & __m;
        *__p &= ~__m;
        *__p |= ~__b & __m;
    }
    return true;
}

template <size_t _N_words, size_t _Size>
bool
__bitset<_N_words, _Size>::any() const _NOEXCEPT
{
    // do middle whole words
    size_type __n = _Size;
    __const_storage_pointer __p = __first_;
    for (; __n >= __bits_per_word; ++__p, __n -= __bits_per_word)
        if (*__p)
            return true;
    // do last partial word
    if (__n > 0)
    {
        __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n);
        if (*__p & __m)
            return true;
    }
    return false;
}

template <size_t _N_words, size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
size_t
__bitset<_N_words, _Size>::__hash_code() const _NOEXCEPT
{
    size_t __h = 0;
    for (size_type __i = 0; __i < _N_words; ++__i)
        __h ^= __first_[__i];
    return __h;
}

template <size_t _Size>
class __bitset<1, _Size>
{
public:
    typedef ptrdiff_t              difference_type;
    typedef size_t                 size_type;
    typedef size_type              __storage_type;
protected:
    typedef __bitset __self;
    typedef       __storage_type*  __storage_pointer;
    typedef const __storage_type*  __const_storage_pointer;
    static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);

    friend class __bit_reference<__bitset>;
    friend class __bit_const_reference<__bitset>;
    friend class __bit_iterator<__bitset, false>;
    friend class __bit_iterator<__bitset, true>;
    friend struct __bit_array<__bitset>;

    __storage_type __first_;

    typedef __bit_reference<__bitset>                  reference;
    typedef __bit_const_reference<__bitset>            const_reference;
    typedef __bit_iterator<__bitset, false>            iterator;
    typedef __bit_iterator<__bitset, true>             const_iterator;

    _LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
    explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long __v) _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t __pos) _NOEXCEPT
        {return reference(&__first_, __storage_type(1) << __pos);}
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t __pos) const _NOEXCEPT
        {return const_reference(&__first_, __storage_type(1) << __pos);}
    _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t __pos) _NOEXCEPT
        {return iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}
    _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t __pos) const _NOEXCEPT
        {return const_iterator(&__first_ + __pos / __bits_per_word, __pos % __bits_per_word);}

    void operator&=(const __bitset& __v) _NOEXCEPT;
    void operator|=(const __bitset& __v) _NOEXCEPT;
    void operator^=(const __bitset& __v) _NOEXCEPT;

    void flip() _NOEXCEPT;

    ;
    ;

    bool all() const _NOEXCEPT;
    bool any() const _NOEXCEPT;

    size_t __hash_code() const _NOEXCEPT;
};

template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
__bitset<1, _Size>::__bitset() _NOEXCEPT
    : __first_(0)
{
}

template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
__bitset<1, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
    : __first_(static_cast<__storage_type>(__v))
{
}

template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
void
__bitset<1, _Size>::operator&=(const __bitset& __v) _NOEXCEPT
{
    __first_ &= __v.__first_;
}

template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
void
__bitset<1, _Size>::operator|=(const __bitset& __v) _NOEXCEPT
{
    __first_ |= __v.__first_;
}

template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
void
__bitset<1, _Size>::operator^=(const __bitset& __v) _NOEXCEPT
{
    __storage_type __m = ~__storage_type(0) >> (__bits_per_word - _Size);
    return __first_ & __m;
}

template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
size_t
__bitset<1, _Size>::__hash_code() const _NOEXCEPT
{
    return __first_;
}

template <>
class __bitset<0, 0>
{
public:
    typedef ptrdiff_t              difference_type;
    typedef size_t                 size_type;
    typedef size_type              __storage_type;
protected:
    typedef __bitset __self;
    typedef       __storage_type*  __storage_pointer;
    typedef const __storage_type*  __const_storage_pointer;
    static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);

    friend class __bit_reference<__bitset>;
    friend class __bit_const_reference<__bitset>;
    friend class __bit_iterator<__bitset, false>;
    friend class __bit_iterator<__bitset, true>;
    friend struct __bit_array<__bitset>;

    typedef __bit_reference<__bitset>                  reference;
    typedef __bit_const_reference<__bitset>            const_reference;
    typedef __bit_iterator<__bitset, false>            iterator;
    typedef __bit_iterator<__bitset, true>             const_iterator;

    _LIBCPP_CONSTEXPR __bitset() _NOEXCEPT;
    explicit _LIBCPP_CONSTEXPR __bitset(unsigned long long) _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY reference __make_ref(size_t) _NOEXCEPT
        {return reference(0, 1);}
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR const_reference __make_ref(size_t) const _NOEXCEPT
        {return const_reference(0, 1);}
    _LIBCPP_INLINE_VISIBILITY iterator __make_iter(size_t) _NOEXCEPT
        {return iterator(0, 0);}
    _LIBCPP_INLINE_VISIBILITY const_iterator __make_iter(size_t) const _NOEXCEPT
        {return const_iterator(0, 0);}

    _LIBCPP_INLINE_VISIBILITY void operator&=(const __bitset&) _NOEXCEPT {}
    _LIBCPP_INLINE_VISIBILITY void operator|=(const __bitset&) _NOEXCEPT {}
    _LIBCPP_INLINE_VISIBILITY void operator^=(const __bitset&) _NOEXCEPT {}

    _LIBCPP_INLINE_VISIBILITY void flip() _NOEXCEPT {}

    _LIBCPP_INLINE_VISIBILITY unsigned long to_ulong() const {return 0;}
    _LIBCPP_INLINE_VISIBILITY unsigned long long to_ullong() const {return 0;}

    _LIBCPP_INLINE_VISIBILITY bool all() const _NOEXCEPT {return true;}
    _LIBCPP_INLINE_VISIBILITY bool any() const _NOEXCEPT {return false;}

    _LIBCPP_INLINE_VISIBILITY size_t __hash_code() const _NOEXCEPT {return 0;}
};

inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
__bitset<0, 0>::__bitset() _NOEXCEPT
{
}

inline _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR
__bitset<0, 0>::__bitset(unsigned long long) _NOEXCEPT
{
}

template <size_t _Size> class _LIBCPP_TYPE_VIS_ONLY bitset;
template <size_t _Size> struct _LIBCPP_TYPE_VIS_ONLY hash<bitset<_Size> >;

template <size_t _Size>
class _LIBCPP_TYPE_VIS_ONLY bitset
    : private __bitset<_Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1, _Size>
{
public:
    static const unsigned __n_words = _Size == 0 ? 0 : (_Size - 1) / (sizeof(size_t) * CHAR_BIT) + 1;
    typedef __bitset<__n_words, _Size> base;

public:
    typedef typename base::reference       reference;
    typedef typename base::const_reference const_reference;

    // 23.3.5.1 constructors:
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR bitset() _NOEXCEPT {}
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
        bitset(unsigned long long __v) _NOEXCEPT : base(__v) {}
    ;
    ;

    // 23.3.5.2 bitset operations:
    bitset& operator&=(const bitset& __rhs) _NOEXCEPT;
    bitset& operator|=(const bitset& __rhs) _NOEXCEPT;
    bitset& operator^=(const bitset& __rhs) _NOEXCEPT;
    bitset& operator<<=(size_t __pos) _NOEXCEPT;
    bitset& operator>>=(size_t __pos) _NOEXCEPT;
    bitset& set() _NOEXCEPT;
    ;
    bitset& reset() _NOEXCEPT;
    ;
    bitset  operator~() const _NOEXCEPT;
    bitset& flip() _NOEXCEPT;
    ;

    // element access:
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
                              const_reference operator[](size_t __p) const {return base::__make_ref(__p);}
    _LIBCPP_INLINE_VISIBILITY       reference operator[](size_t __p)       {return base::__make_ref(__p);}
    ;
    ;
    ;
    ;
    ;
    ;
    size_t count() const _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR size_t size() const _NOEXCEPT {return _Size;}
    bool operator==(const bitset& __rhs) const _NOEXCEPT;
    bool operator!=(const bitset& __rhs) const _NOEXCEPT;
    ;
    bool all() const _NOEXCEPT;
    bool any() const _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY bool none() const _NOEXCEPT {return !any();}
    bitset operator<<(size_t __pos) const _NOEXCEPT;
    bitset operator>>(size_t __pos) const _NOEXCEPT;

private:

    _LIBCPP_INLINE_VISIBILITY
    size_t __hash_code() const _NOEXCEPT {return base::__hash_code();}

    friend struct hash<bitset>;
};





template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
bitset<_Size>&
bitset<_Size>::operator&=(const bitset& __rhs) _NOEXCEPT
{
    base::operator&=(__rhs);
    return *this;
}

template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
bitset<_Size>&
bitset<_Size>::operator|=(const bitset& __rhs) _NOEXCEPT
{
    base::operator|=(__rhs);
    return *this;
}

template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
bitset<_Size>&
bitset<_Size>::operator^=(const bitset& __rhs) _NOEXCEPT
{
    base::operator^=(__rhs);
    return *this;
}

template <size_t _Size>
bitset<_Size>&
bitset<_Size>::operator<<=(size_t __pos) _NOEXCEPT
{
    __pos = _VSTD::min(__pos, _Size);
    _VSTD::copy_backward(base::__make_iter(0), base::__make_iter(_Size - __pos), base::__make_iter(_Size));
    _VSTD::fill_n(base::__make_iter(0), __pos, false);
    return *this;
}

template <size_t _Size>
bitset<_Size>&
bitset<_Size>::operator>>=(size_t __pos) _NOEXCEPT
{
    __pos = _VSTD::min(__pos, _Size);
    _VSTD::copy(base::__make_iter(__pos), base::__make_iter(_Size), base::__make_iter(0));
    _VSTD::fill_n(base::__make_iter(_Size - __pos), __pos, false);
    return *this;
}

template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
bitset<_Size>&
bitset<_Size>::set() _NOEXCEPT
{
    _VSTD::fill_n(base::__make_iter(0), _Size, true);
    return *this;
}



template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
bitset<_Size>&
bitset<_Size>::reset() _NOEXCEPT
{
    _VSTD::fill_n(base::__make_iter(0), _Size, false);
    return *this;
}



template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
bitset<_Size>
bitset<_Size>::operator~() const _NOEXCEPT
{
    bitset __x(*this);
    __x.flip();
    return __x;
}

template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
bitset<_Size>&
bitset<_Size>::flip() _NOEXCEPT
{
    base::flip();
    return *this;
}















template <size_t _Size>
inline _LIBCPP_INLINE_VISIBILITY
bool
bitset<_Size>::operator!=(const bitset& __rhs) const _NOEXCEPT
{
    return !(*this == __rhs);
}

;

;

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_BITSET
# 1082 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/bitset" 3
# 136 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 139 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
#endif
# 140 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _CharT, class _Traits>
class _LIBCPP_TYPE_VIS_ONLY basic_ostream
    : virtual public basic_ios<_CharT, _Traits>
{
public:
    // types (inherited from basic_ios (27.5.4)):
    typedef _CharT                         char_type;
    typedef _Traits                        traits_type;
    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;

    // 27.7.2.2 Constructor/destructor:
    ;
    virtual ~basic_ostream();
protected:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    basic_ostream(basic_ostream&& __rhs);
#endif
# 163 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3

    // 27.7.2.3 Assign/swap
#if _LIBCPP_STD_VER > 11
    basic_ostream& operator=(const basic_ostream&) = delete;
#endif
# 168 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    basic_ostream& operator=(basic_ostream&& __rhs);
#endif
# 172 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
    ;
public:

    // 27.7.2.4 Prefix/suffix:
    class _LIBCPP_TYPE_VIS_ONLY sentry;

    // 27.7.2.6 Formatted output:
    ;
    ;
    ;
    ;
    ;
    ;
    basic_ostream& operator<<(int __n);
    ;
    ;
    ;
    ;
    ;
    basic_ostream& operator<<(float __f);
    ;
    ;
};

template <class _CharT, class _Traits>
class _LIBCPP_TYPE_VIS_ONLY basic_ostream<_CharT, _Traits>::sentry
{
    bool __ok_;
    basic_ostream<_CharT, _Traits>& __os_;

    ; // = delete;
    ; // = delete;

public:
    explicit sentry(basic_ostream<_CharT, _Traits>& __os);
    ~sentry();

    _LIBCPP_ALWAYS_INLINE
        _LIBCPP_EXPLICIT
        operator bool() const {return __ok_;}
};

template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>::sentry::sentry(basic_ostream<_CharT, _Traits>& __os)
    : __ok_(false),
      __os_(__os)
{
    if (__os.good())
    {
        if (__os.tie())
            __os.tie()->flush();
        __ok_ = true;
    }
}







template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(int __n)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
    try
    {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 474 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
        sentry __s(*this);
        if (__s)
        {
            ios_base::fmtflags __flags = ios_base::flags() & ios_base::basefield;
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
            const _Fp& __f = use_facet<_Fp>(this->getloc());
            if (__f.put(*this, *this, this->fill(),
                        __flags == ios_base::oct || __flags == ios_base::hex ?
                        static_cast<long>(static_cast<unsigned int>(__n))  :
                        static_cast<long>(__n)).failed())
                this->setstate(ios_base::badbit | ios_base::failbit);
        }
#ifndef _LIBCPP_NO_EXCEPTIONS
    }
    catch (...)
    {
        this->__set_badbit_and_consider_rethrow();
    }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 493 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
    return *this;
}











template <class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::operator<<(float __n)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
    try
    {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 634 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
        sentry __s(*this);
        if (__s)
        {
            typedef num_put<char_type, ostreambuf_iterator<char_type, traits_type> > _Fp;
            const _Fp& __f = use_facet<_Fp>(this->getloc());
            if (__f.put(*this, *this, this->fill(), static_cast<double>(__n)).failed())
                this->setstate(ios_base::badbit | ios_base::failbit);
        }
#ifndef _LIBCPP_NO_EXCEPTIONS
    }
    catch (...)
    {
        this->__set_badbit_and_consider_rethrow();
    }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 649 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
    return *this;
}







template<class _CharT, class _Traits>
basic_ostream<_CharT, _Traits>&
__put_character_sequence(basic_ostream<_CharT, _Traits>& __os,
                          const _CharT* __str, size_t __len)
{
#ifndef _LIBCPP_NO_EXCEPTIONS
    try
    {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 739 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
        typename basic_ostream<_CharT, _Traits>::sentry __s(__os);
        if (__s)
        {
            typedef ostreambuf_iterator<_CharT, _Traits> _Ip;
            if (__pad_and_output(_Ip(__os),
                                 __str,
                                 (__os.flags() & ios_base::adjustfield) == ios_base::left ?
                                     __str + __len :
                                     __str,
                                 __str + __len,
                                 __os,
                                 __os.fill()).failed())
                __os.setstate(ios_base::badbit | ios_base::failbit);
        }
#ifndef _LIBCPP_NO_EXCEPTIONS
    }
    catch (...)
    {
        __os.__set_badbit_and_consider_rethrow();
    }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 760 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
    return __os;
}






template<class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __os, char __c)
{
	return _VSTD::__put_character_sequence(__os, &__c, 1);
}









template<class _Traits>
basic_ostream<char, _Traits>&
operator<<(basic_ostream<char, _Traits>& __os, const char* __str)
{
	return _VSTD::__put_character_sequence(__os, __str, _Traits::length(__str));
}









_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ostream<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_ostream<wchar_t>)

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_OSTREAM
# 1102 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ostream" 3
# 175 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <istream>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 1 3
// -*- C++ -*-
//===--------------------------- istream ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_ISTREAM
#define _LIBCPP_ISTREAM

/*
    istream synopsis

typedef basic_iostream<char> iostream;
typedef basic_iostream<wchar_t> wiostream;

template <class charT, class traits>
  basic_istream<charT,traits>&
  ws(basic_istream<charT,traits>& is);

template <class charT, class traits, class T>
  basic_istream<charT, traits>&
  operator>>(basic_istream<charT, traits>&& is, T& x);

}  // std

*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 156 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3
#if 0 /* expanded by -frewrite-includes */
#include <ostream>
#endif /* expanded by -frewrite-includes */
# 157 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 159 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 2 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 162 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3
#endif
# 163 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _CharT, class _Traits>
class _LIBCPP_TYPE_VIS_ONLY basic_istream
    : virtual public basic_ios<_CharT, _Traits>
{
    streamsize __gc_;
public:
    // types (inherited from basic_ios (27.5.4)):
    typedef _CharT                         char_type;
    typedef _Traits                        traits_type;
    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;

    // 27.7.1.1.1 Constructor/destructor:
    explicit basic_istream(basic_streambuf<char_type, traits_type>* __sb);
    virtual ~basic_istream();
protected:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    basic_istream(basic_istream&& __rhs);
#endif
# 187 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3

    // 27.7.1.1.2 Assign/swap:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    basic_istream& operator=(basic_istream&& __rhs);
#endif
# 193 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3
    ;
public:

    // 27.7.1.1.3 Prefix/suffix:
    class _LIBCPP_TYPE_VIS_ONLY sentry;

    // 27.7.1.2 Formatted input:
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
};

template <class _CharT, class _Traits>
class _LIBCPP_TYPE_VIS_ONLY basic_istream<_CharT, _Traits>::sentry
{
    bool __ok_;

    ; // = delete;
    ; // = delete;

public:
    ;
//    ~sentry() = default;

    _LIBCPP_INLINE_VISIBILITY
        _LIBCPP_EXPLICIT
        operator bool() const {return __ok_;}
};



template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>::basic_istream(basic_streambuf<char_type, traits_type>* __sb)
    : __gc_(0)
{
    this->init(__sb);
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
    : __gc_(__rhs.__gc_)
{
    __rhs.__gc_ = 0;
    this->move(__rhs);
}

template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::operator=(basic_istream&& __rhs)
{
    swap(__rhs);
    return *this;
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 319 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3

template <class _CharT, class _Traits>
basic_istream<_CharT, _Traits>::~basic_istream()
{
}








template <class _CharT, class _Traits>
class _LIBCPP_TYPE_VIS_ONLY basic_iostream
    : public basic_istream<_CharT, _Traits>,
      public basic_ostream<_CharT, _Traits>
{
public:
    // types:
    typedef _CharT                         char_type;
    typedef _Traits                        traits_type;
    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;

    // constructor/destructor
    explicit basic_iostream(basic_streambuf<char_type, traits_type>* __sb);
    virtual ~basic_iostream();
protected:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    basic_iostream(basic_iostream&& __rhs);
#endif
# 1479 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3

    // assign/swap
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    basic_iostream& operator=(basic_iostream&& __rhs);
#endif
# 1485 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3
    ;
public:
};

template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
basic_iostream<_CharT, _Traits>::basic_iostream(basic_streambuf<char_type, traits_type>* __sb)
    : basic_istream<_CharT, _Traits>(__sb)
{
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
    : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs))
{
}

template <class _CharT, class _Traits>
inline _LIBCPP_INLINE_VISIBILITY
basic_iostream<_CharT, _Traits>&
basic_iostream<_CharT, _Traits>::operator=(basic_iostream&& __rhs)
{
    swap(__rhs);
    return *this;
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1515 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3

template <class _CharT, class _Traits>
basic_iostream<_CharT, _Traits>::~basic_iostream()
{
}









#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is,
        basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm)
{
    return getline(__is, __str, __dlm);
}

template<class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_istream<_CharT, _Traits>&
getline(basic_istream<_CharT, _Traits>&& __is,
        basic_string<_CharT, _Traits, _Allocator>& __str)
{
    return getline(__is, __str, __is.widen('\n'));
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1660 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3



_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_istream<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_istream<wchar_t>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_TYPE_VIS basic_iostream<char>)

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_ISTREAM
# 1717 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/istream" 3
# 176 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 177 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 182 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3
#endif
# 183 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3

_LIBCPP_BEGIN_NAMESPACE_STD

// basic_stringbuf

template <class _CharT, class _Traits, class _Allocator>
class _LIBCPP_TYPE_VIS_ONLY basic_stringbuf
    : public basic_streambuf<_CharT, _Traits>
{
public:
    typedef _CharT                         char_type;
    typedef _Traits                        traits_type;
    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;
    typedef _Allocator                     allocator_type;

    typedef basic_string<char_type, traits_type, allocator_type> string_type;

private:

    string_type __str_;
    mutable char_type* __hm_;
    ios_base::openmode __mode_;

public:
    // 27.8.1.1 Constructors:
    explicit basic_stringbuf(ios_base::openmode __wch = ios_base::in | ios_base::out);
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    basic_stringbuf(basic_stringbuf&& __rhs);
#endif
# 216 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3

    // 27.8.1.2 Assign and swap:
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    basic_stringbuf& operator=(basic_stringbuf&& __rhs);
#endif
# 221 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3
    ;

    // 27.8.1.3 Get and set:
    string_type str() const;
    void str(const string_type& __s);

protected:
    // 27.8.1.4 Overridden virtual functions:
    virtual int_type underflow();
    virtual int_type pbackfail(int_type __c = traits_type::eof());
    virtual int_type overflow (int_type __c = traits_type::eof());
    virtual pos_type seekoff(off_type __off, ios_base::seekdir __way,
                             ios_base::openmode __wch = ios_base::in | ios_base::out);
    virtual pos_type seekpos(pos_type __sp,
                             ios_base::openmode __wch = ios_base::in | ios_base::out);
};

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode __wch)
    : __hm_(0),
      __mode_(__wch)
{
    str(string_type());
}



#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _CharT, class _Traits, class _Allocator>
basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
    : __mode_(__rhs.__mode_)
{
    char_type* __p = const_cast<char_type*>(__rhs.__str_.data());
    ptrdiff_t __binp = -1;
    ptrdiff_t __ninp = -1;
    ptrdiff_t __einp = -1;
    if (__rhs.eback() != nullptr)
    {
        __binp = __rhs.eback() - __p;
        __ninp = __rhs.gptr() - __p;
        __einp = __rhs.egptr() - __p;
    }
    ptrdiff_t __bout = -1;
    ptrdiff_t __nout = -1;
    ptrdiff_t __eout = -1;
    if (__rhs.pbase() != nullptr)
    {
        __bout = __rhs.pbase() - __p;
        __nout = __rhs.pptr() - __p;
        __eout = __rhs.epptr() - __p;
    }
    ptrdiff_t __hm = __rhs.__hm_ == nullptr ? -1 : __rhs.__hm_ - __p;
    __str_ = _VSTD::move(__rhs.__str_);
    __p = const_cast<char_type*>(__str_.data());
    if (__binp != -1)
        this->setg(__p + __binp, __p + __ninp, __p + __einp);
    if (__bout != -1)
    {
        this->setp(__p + __bout, __p + __eout);
        this->pbump(__nout);
    }
    __hm_ = __hm == -1 ? nullptr : __p + __hm;
    __p = const_cast<char_type*>(__rhs.__str_.data());
    __rhs.setg(__p, __p, __p);
    __rhs.setp(__p, __p);
    __rhs.__hm_ = __p;
    this->pubimbue(__rhs.getloc());
}

template <class _CharT, class _Traits, class _Allocator>
basic_stringbuf<_CharT, _Traits, _Allocator>&
basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
{
    char_type* __p = const_cast<char_type*>(__rhs.__str_.data());
    ptrdiff_t __binp = -1;
    ptrdiff_t __ninp = -1;
    __rhs.__hm_ = __p;
    this->pubimbue(__rhs.getloc());
    return *this;
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 344 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3





template <class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>
basic_stringbuf<_CharT, _Traits, _Allocator>::str() const
{
    if (__mode_ & ios_base::out)
    {
        if (__hm_ < this->pptr())
            __hm_ = this->pptr();
        return string_type(this->pbase(), __hm_, __str_.get_allocator());
    }
    else if (__mode_ & ios_base::in)
        return string_type(this->eback(), this->egptr(), __str_.get_allocator());
    return string_type(__str_.get_allocator());
        __hm_ = this->pptr();
    if (__mode_ & ios_base::in)
    {
        if (this->egptr() < __hm_)
            this->setg(this->eback(), this->gptr(), __hm_);
        if (this->gptr() < this->egptr())
            return traits_type::to_int_type(*this->gptr());
    }
    return traits_type::eof();
}

template <class _CharT, class _Traits, class _Allocator>
typename basic_stringbuf<_CharT, _Traits, _Allocator>::int_type
basic_stringbuf<_CharT, _Traits, _Allocator>::pbackfail(int_type __c)
{
    if (__hm_ < this->pptr())
    return traits_type::eof();
}

template <class _CharT, class _Traits, class _Allocator>
typename basic_stringbuf<_CharT, _Traits, _Allocator>::int_type
basic_stringbuf<_CharT, _Traits, _Allocator>::overflow(int_type __c)
{
    if (!traits_type::eq_int_type(__c, traits_type::eof()))
    {
        ptrdiff_t __ninp = this->gptr()  - this->eback();
        if (this->pptr() == this->epptr())
        {
            if (!(__mode_ & ios_base::out))
                return traits_type::eof();
#ifndef _LIBCPP_NO_EXCEPTIONS
            try
            }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 541 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3
        }
        __hm_ = _VSTD::max(this->pptr() + 1, __hm_);
        if (__mode_ & ios_base::in)
        {
            char_type* __p = const_cast<char_type*>(__str_.data());
            this->setg(__p, __p + __ninp, __hm_);
        }
        return this->sputc(__c);
    }
    return traits_type::not_eof(__c);
}

template <class _CharT, class _Traits, class _Allocator>
typename basic_stringbuf<_CharT, _Traits, _Allocator>::pos_type
basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off,
                                                      ios_base::seekdir __way,
                                                      ios_base::openmode __wch)
{
    if (__hm_ < this->pptr())
        __hm_ = this->pptr();
    if ((__wch & (ios_base::in | ios_base::out)) == 0)
        return pos_type(-1);
    if ((__wch & (ios_base::in | ios_base::out)) == (ios_base::in | ios_base::out)
        && __way == ios_base::cur)
        return pos_type(-1);
    off_type __noff;
    switch (__way)
    {
    case ios_base::beg:
        __noff = 0;
        break;
    case ios_base::cur:
        if (__wch & ios_base::in)
            __noff = this->gptr() - this->eback();
        else
            __noff = this->pptr() - this->pbase();
        break;
    case ios_base::end:
        __noff = __hm_ - __str_.data();
        break;
    default:
        return pos_type(-1);
    }
    __noff += __off;
    if (__noff < 0 || __hm_ - __str_.data() < __noff)
        return pos_type(-1);
    if (__noff != 0)
    {
        if ((__wch & ios_base::in) && this->gptr() == 0)
            return pos_type(-1);
        if ((__wch & ios_base::out) && this->pptr() == 0)
            return pos_type(-1);
    }
    if (__wch & ios_base::in)
        this->setg(this->eback(), this->eback() + __noff, __hm_);
    if (__wch & ios_base::out)
    {
        this->setp(this->pbase(), this->epptr());
        this->pbump(__noff);
    }
    return pos_type(__noff);
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
typename basic_stringbuf<_CharT, _Traits, _Allocator>::pos_type
basic_stringbuf<_CharT, _Traits, _Allocator>::seekpos(pos_type __sp,
                                                      ios_base::openmode __wch)
{
    return seekoff(__sp, ios_base::beg, __wch);
}

// basic_istringstream

template <class _CharT, class _Traits, class _Allocator>
class _LIBCPP_TYPE_VIS_ONLY basic_istringstream
    : public basic_istream<_CharT, _Traits>
{
public:
    typedef _CharT                         char_type;
    typedef _Traits                        traits_type;
    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;
    typedef _Allocator                     allocator_type;

    typedef basic_string<char_type, traits_type, allocator_type> string_type;

private:
    basic_stringbuf<char_type, traits_type, allocator_type> __sb_;

public:
    // 27.8.2.1 Constructors:
    ;
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    basic_istringstream(basic_istringstream&& __rhs);

    // 27.8.2.2 Assign and swap:
    basic_istringstream& operator=(basic_istringstream&& __rhs);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 643 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3
    ;

    // 27.8.2.3 Members:
    ;
    ;
    ;
};





#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs)
    : basic_istream<_CharT, _Traits>(_VSTD::move(__rhs)),
      __sb_(_VSTD::move(__rhs.__sb_))
{
    basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_);
}

template <class _CharT, class _Traits, class _Allocator>
basic_istringstream<_CharT, _Traits, _Allocator>&
basic_istringstream<_CharT, _Traits, _Allocator>::operator=(basic_istringstream&& __rhs)
{
    basic_istream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
    __sb_ = _VSTD::move(__rhs.__sb_);
    return *this;
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 689 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3











// basic_ostringstream

template <class _CharT, class _Traits, class _Allocator>
class _LIBCPP_TYPE_VIS_ONLY basic_ostringstream
    : public basic_ostream<_CharT, _Traits>
{
public:
    typedef _CharT                         char_type;
    typedef _Traits                        traits_type;
    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;
    typedef _Allocator                     allocator_type;

    typedef basic_string<char_type, traits_type, allocator_type> string_type;

private:
    basic_stringbuf<char_type, traits_type, allocator_type> __sb_;

public:
    // 27.8.2.1 Constructors:
    explicit basic_ostringstream(ios_base::openmode __wch = ios_base::out);
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    basic_ostringstream(basic_ostringstream&& __rhs);

    // 27.8.2.2 Assign and swap:
    basic_ostringstream& operator=(basic_ostringstream&& __rhs);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 762 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3
    ;

    // 27.8.2.3 Members:
    ;
    string_type str() const;
    ;
};

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(ios_base::openmode __wch)
    : basic_ostream<_CharT, _Traits>(&__sb_),
      __sb_(__wch | ios_base::out)
{
}



#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs)
    : basic_ostream<_CharT, _Traits>(_VSTD::move(__rhs)),
      __sb_(_VSTD::move(__rhs.__sb_))
{
    basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_);
}

template <class _CharT, class _Traits, class _Allocator>
basic_ostringstream<_CharT, _Traits, _Allocator>&
basic_ostringstream<_CharT, _Traits, _Allocator>::operator=(basic_ostringstream&& __rhs)
{
    basic_ostream<char_type, traits_type>::operator=(_VSTD::move(__rhs));
    __sb_ = _VSTD::move(__rhs.__sb_);
    return *this;
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 808 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3







template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>
basic_ostringstream<_CharT, _Traits, _Allocator>::str() const
{
    return __sb_.str();
}



// basic_stringstream

template <class _CharT, class _Traits, class _Allocator>
class _LIBCPP_TYPE_VIS_ONLY basic_stringstream
    : public basic_iostream<_CharT, _Traits>
{
public:
    typedef _CharT                         char_type;
    typedef _Traits                        traits_type;
    typedef typename traits_type::int_type int_type;
    typedef typename traits_type::pos_type pos_type;
    typedef typename traits_type::off_type off_type;
    typedef _Allocator                     allocator_type;

    typedef basic_string<char_type, traits_type, allocator_type> string_type;

private:
    basic_stringbuf<char_type, traits_type, allocator_type> __sb_;

public:
    // 27.8.2.1 Constructors:
    explicit basic_stringstream(ios_base::openmode __wch = ios_base::in | ios_base::out);
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    basic_stringstream(basic_stringstream&& __rhs);

    // 27.8.2.2 Assign and swap:
    basic_stringstream& operator=(basic_stringstream&& __rhs);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 881 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3
    ;

    // 27.8.2.3 Members:
    ;
    string_type str() const;
    void str(const string_type& __s);
};

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(ios_base::openmode __wch)
    : basic_iostream<_CharT, _Traits>(&__sb_),
      __sb_(__wch)
{
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
basic_string<_CharT, _Traits, _Allocator>
basic_stringstream<_CharT, _Traits, _Allocator>::str() const
{
    return __sb_.str();
}

template <class _CharT, class _Traits, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
basic_stringstream<_CharT, _Traits, _Allocator>::str(const string_type& __s)
{
    __sb_.str(__s);
}

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_SSTREAM
# 973 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/sstream" 3
# 14 "../../dist/include/mozilla/ToString.h" 2

#ifndef mozilla_Casting_h
#define mozilla_Casting_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/Casting.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/Casting.h"

#if 0 /* expanded by -frewrite-includes */
#include <limits.h>
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/Casting.h"

namespace mozilla {

/**
 * Return a value of type |To|, containing the underlying bit pattern of
 * |aFrom|.
 *
 * |To| and |From| must be types of the same size; be careful of cross-platform
 * size differences, or this might fail to compile on some but not all
 * platforms.
 */
template<typename To, typename From>
inline To
BitwiseCast(const From aFrom)
{
  static_assert(sizeof(From) == sizeof(To),
                "To and From must have the same size");
  union
  {
    From mFrom;
    To mTo;
  } u;
  u.mFrom = aFrom;
  return u.mTo;
}

namespace detail {

enum ToSignedness { ToIsSigned, ToIsUnsigned };
enum FromSignedness { FromIsSigned, FromIsUnsigned };

template<typename From,
         typename To,
         FromSignedness = IsSigned<From>::value ? FromIsSigned : FromIsUnsigned,
         ToSignedness = IsSigned<To>::value ? ToIsSigned : ToIsUnsigned>
struct BoundsCheckImpl;

// Implicit conversions on operands to binary operations make this all a bit
// hard to verify.  Attempt to ease the pain below by *only* comparing values
// that are obviously the same type (and will undergo no further conversions),
// even when it's not strictly necessary, for explicitness.

enum UUComparison { FromIsBigger, FromIsNotBigger };

// Unsigned-to-unsigned range check

template<typename From, typename To,
         UUComparison = (sizeof(From) > sizeof(To))
                        ? FromIsBigger
                        : FromIsNotBigger>
struct UnsignedUnsignedCheck;

template<typename From, typename To>
struct UnsignedUnsignedCheck<From, To, FromIsBigger>
{
public:
  
};

template<typename From, typename To>
struct UnsignedUnsignedCheck<From, To, FromIsNotBigger>
{
public:
  static bool checkBounds(const From aFrom)
  {
    return true;
  }
};

template<typename From, typename To>
struct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsUnsigned>
{
public:
  static bool checkBounds(const From aFrom)
  {
    return UnsignedUnsignedCheck<From, To>::checkBounds(aFrom);
  }
};

// Signed-to-unsigned range check

template<typename From, typename To>
struct BoundsCheckImpl<From, To, FromIsSigned, ToIsUnsigned>
{
public:
  static bool checkBounds(const From aFrom)
  {
    if (aFrom < 0) {
      return false;
    }
    if (sizeof(To) >= sizeof(From)) {
      return true;
    }
    return aFrom <= From(To(-1));
  }
};

// Unsigned-to-signed range check

enum USComparison { FromIsSmaller, FromIsNotSmaller };

template<typename From, typename To,
         USComparison = (sizeof(From) < sizeof(To))
                        ? FromIsSmaller
                        : FromIsNotSmaller>
struct UnsignedSignedCheck;

template<typename From, typename To>
struct UnsignedSignedCheck<From, To, FromIsSmaller>
{
public:
  static bool checkBounds(const From aFrom)
  {
    return true;
  }
};

template<typename From, typename To>
struct UnsignedSignedCheck<From, To, FromIsNotSmaller>
{
public:
  static bool checkBounds(const From aFrom)
  {
    const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);
    return aFrom <= From(MaxValue);
  }
};

template<typename From, typename To>
struct BoundsCheckImpl<From, To, FromIsUnsigned, ToIsSigned>
{
public:
  static bool checkBounds(const From aFrom)
  {
    return UnsignedSignedCheck<From, To>::checkBounds(aFrom);
  }
};

// Signed-to-signed range check

template<typename From, typename To>
struct BoundsCheckImpl<From, To, FromIsSigned, ToIsSigned>
{
public:
  static bool checkBounds(const From aFrom)
  {
    if (sizeof(From) <= sizeof(To)) {
      return true;
    }
    const To MaxValue = To((1ULL << (CHAR_BIT * sizeof(To) - 1)) - 1);
    const To MinValue = -MaxValue - To(1);
    return From(MinValue) <= aFrom &&
           From(aFrom) <= From(MaxValue);
  }
};

template<typename From, typename To,
         bool TypesAreIntegral = IsIntegral<From>::value &&
                                 IsIntegral<To>::value>
class BoundsChecker;

template<typename From>
class BoundsChecker<From, From, true>
{
public:
  static bool checkBounds(const From aFrom) { return true; }
};

template<typename From, typename To>
class BoundsChecker<From, To, true>
{
public:
  static bool checkBounds(const From aFrom)
  {
    return BoundsCheckImpl<From, To>::checkBounds(aFrom);
  }
};

template<typename From, typename To>
inline bool
IsInBounds(const From aFrom)
{
  return BoundsChecker<From, To>::checkBounds(aFrom);
}

} // namespace detail

/**
 * Cast a value of integral type |From| to a value of integral type |To|,
 * asserting that the cast will be a safe cast per C++ (that is, that |to| is in
 * the range of values permitted for the type |From|).
 */
template<typename To, typename From>
inline To
AssertedCast(const From aFrom)
{
  MOZ_ASSERT((detail::IsInBounds<From, To>(aFrom)));
  return static_cast<To>(aFrom);
}

} // namespace mozilla

#endif /* mozilla_Casting_h */
# 222 "../../dist/include/mozilla/Casting.h"
# 15 "../../dist/include/mozilla/FloatingPoint.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MathAlgorithms.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/MathAlgorithms.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* mfbt maths algorithms. */

#ifndef mozilla_MathAlgorithms_h
#define mozilla_MathAlgorithms_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/MathAlgorithms.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/MathAlgorithms.h"

#if 0 /* expanded by -frewrite-includes */
#include <cmath>
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/MathAlgorithms.h"
#if 0 /* expanded by -frewrite-includes */
#include <limits.h>
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/MathAlgorithms.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/MathAlgorithms.h"

namespace mozilla {

// Greatest Common Divisor
template<typename IntegerType>
MOZ_ALWAYS_INLINE IntegerType
EuclidGCD(IntegerType aA, IntegerType aB)
{
  // Euclid's algorithm; O(N) in the worst case.  (There are better
  // ways, but we don't need them for the current use of this algo.)
  MOZ_ASSERT(aA > IntegerType(0));
  MOZ_ASSERT(aB > IntegerType(0));

  while (aA != aB) {
    if (aA > aB) {
      aA = aA - aB;
    } else {
      aB = aB - aA;
    }
  }

  return aA;
}

// Least Common Multiple
template<typename IntegerType>
MOZ_ALWAYS_INLINE IntegerType
EuclidLCM(IntegerType aA, IntegerType aB)
{
  // Divide first to reduce overflow risk.
  return (aA / EuclidGCD(aA, aB)) * aB;
}

namespace detail {

template<typename T>
struct AllowDeprecatedAbsFixed : FalseType {};

template<> struct AllowDeprecatedAbsFixed<int32_t> : TrueType {};
template<> struct AllowDeprecatedAbsFixed<int64_t> : TrueType {};

template<typename T>
struct AllowDeprecatedAbs : AllowDeprecatedAbsFixed<T> {};


template<typename T>
struct AbsReturnTypeFixed;

template<> struct AbsReturnTypeFixed<int8_t> { typedef uint8_t Type; };
template<> struct AbsReturnTypeFixed<int16_t> { typedef uint16_t Type; };
template<> struct AbsReturnTypeFixed<int32_t> { typedef uint32_t Type; };
template<> struct AbsReturnTypeFixed<int64_t> { typedef uint64_t Type; };

template<typename T>
struct AbsReturnType : AbsReturnTypeFixed<T> {};

template<> struct AbsReturnType<char> :
  EnableIf<char(-1) < char(0), unsigned char> {};
template<> struct AbsReturnType<signed char> { typedef unsigned char Type; };
template<> struct AbsReturnType<short> { typedef unsigned short Type; };
template<> struct AbsReturnType<int> { typedef unsigned int Type; };
template<> struct AbsReturnType<long> { typedef unsigned long Type; };
template<> struct AbsReturnType<long long> { typedef unsigned long long Type; };
template<> struct AbsReturnType<float> { typedef float Type; };
template<> struct AbsReturnType<double> { typedef double Type; };
template<> struct AbsReturnType<long double> { typedef long double Type; };

} // namespace detail

template<typename T>
inline typename detail::AbsReturnType<T>::Type
Abs(const T aValue)
{
  typedef typename detail::AbsReturnType<T>::Type ReturnType;
  return aValue >= 0 ? ReturnType(aValue) : ~ReturnType(aValue) + 1;
}

template<>
inline float
Abs<float>(const float aFloat)
{
  return std::fabs(aFloat);
}

template<>
inline double
Abs<double>(const double aDouble)
{
  return std::fabs(aDouble);
}

template<>
inline long double
Abs<long double>(const long double aLongDouble)
{
  return std::fabs(aLongDouble);
}

} // namespace mozilla

#if defined(_MSC_VER) && \
    (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64))
#  define MOZ_BITSCAN_WINDOWS

#if 0 /* expanded by -frewrite-includes */
#  include <intrin.h>
#endif /* expanded by -frewrite-includes */
# 154 "../../dist/include/mozilla/MathAlgorithms.h"
#  pragma intrinsic(_BitScanForward, _BitScanReverse)

#  if defined(_M_AMD64) || defined(_M_X64)
#    define MOZ_BITSCAN_WINDOWS64
#   pragma intrinsic(_BitScanForward64, _BitScanReverse64)
#  endif
# 160 "../../dist/include/mozilla/MathAlgorithms.h"

#endif
# 162 "../../dist/include/mozilla/MathAlgorithms.h"

namespace mozilla {

namespace detail {

#if defined(MOZ_BITSCAN_WINDOWS)

inline uint_fast8_t
}

#  ifdef MOZ_HAVE_BITSCAN64
#    undef MOZ_HAVE_BITSCAN64
#  endif
# 235 "../../dist/include/mozilla/MathAlgorithms.h"

#elif defined(__clang__) || defined(__GNUC__)
# 237 "../../dist/include/mozilla/MathAlgorithms.h"

#  if defined(__clang__)
#    if !__has_builtin(__builtin_ctz) || !__has_builtin(__builtin_clz)
#      error "A clang providing __builtin_c[lt]z is required to build"
#    endif
# 242 "../../dist/include/mozilla/MathAlgorithms.h"
#  else
# 243 "../../dist/include/mozilla/MathAlgorithms.h"
     // gcc has had __builtin_clz and friends since 3.4: no need to check.
#  endif
# 245 "../../dist/include/mozilla/MathAlgorithms.h"

inline uint_fast8_t
CountLeadingZeroes32(uint32_t aValue)
{
  return __builtin_clz(aValue);
}

inline uint_fast8_t
CountTrailingZeroes32(uint32_t aValue)
{
  return __builtin_ctz(aValue);
}

inline uint_fast8_t
CountPopulation32(uint32_t aValue)
{
  return __builtin_popcount(aValue);
}

inline uint_fast8_t
CountPopulation64(uint64_t aValue)
{
  return __builtin_popcountll(aValue);
}

inline uint_fast8_t
CountLeadingZeroes64(uint64_t aValue)
{
  return __builtin_clzll(aValue);
}

inline uint_fast8_t
CountTrailingZeroes64(uint64_t aValue)
{
  return __builtin_ctzll(aValue);
}

#else
# 283 "../../dist/include/mozilla/MathAlgorithms.h"
#  error "Implement these!"
inline uint_fast8_t CountLeadingZeroes32(uint32_t aValue) = delete;
inline uint_fast8_t CountTrailingZeroes32(uint32_t aValue) = delete;
inline uint_fast8_t CountPopulation32(uint32_t aValue) = delete;
inline uint_fast8_t CountPopulation64(uint64_t aValue) = delete;
inline uint_fast8_t CountLeadingZeroes64(uint64_t aValue) = delete;
inline uint_fast8_t CountTrailingZeroes64(uint64_t aValue) = delete;
#endif
# 291 "../../dist/include/mozilla/MathAlgorithms.h"

} // namespace detail

/**
 * Compute the number of high-order zero bits in the NON-ZERO number |aValue|.
 * That is, looking at the bitwise representation of the number, with the
 * highest- valued bits at the start, return the number of zeroes before the
 * first one is observed.
 *
 * CountLeadingZeroes32(0xF0FF1000) is 0;
 * CountLeadingZeroes32(0x7F8F0001) is 1;
 * CountLeadingZeroes32(0x3FFF0100) is 2;
  return detail::CountLeadingZeroes64(aValue);
}

/** Analogous to CountTrailingZeroes32, but for 64-bit numbers. */
inline uint_fast8_t
CountTrailingZeroes64(uint64_t aValue)
{
  MOZ_ASSERT(aValue != 0);
  return detail::CountTrailingZeroes64(aValue);
}

namespace detail {

template<typename T, size_t Size = sizeof(T)>
class CeilingLog2;

template<typename T>
class CeilingLog2<T, 4>
{
public:
  static uint_fast8_t compute(const T aValue)
  {
    // Check for <= 1 to avoid the == 0 undefined case.
    return aValue <= 1 ? 0u : 32u - CountLeadingZeroes32(aValue - 1);
  }
};

template<typename T>
class CeilingLog2<T, 8>
{
public:
  static uint_fast8_t compute(const T aValue)
  {
    // Check for <= 1 to avoid the == 0 undefined case.
    return aValue <= 1 ? 0u : 64u - CountLeadingZeroes64(aValue - 1);
  }
};

} // namespace detail

/**
 * Compute the log of the least power of 2 greater than or equal to |aValue|.
 *
 * CeilingLog2(0..1) is 0;
 * CeilingLog2(2) is 1;
 * CeilingLog2(3..4) is 2;
 * CeilingLog2(5..8) is 3;
 * CeilingLog2(9..16) is 4; and so on.
 */
template<typename T>
inline uint_fast8_t
CeilingLog2(const T aValue)
{
  return detail::CeilingLog2<T>::compute(aValue);
}

/** A CeilingLog2 variant that accepts only size_t. */
inline uint_fast8_t
CeilingLog2Size(size_t aValue)
{
  return CeilingLog2(aValue);
}

namespace detail {

template<typename T, size_t Size = sizeof(T)>
class FloorLog2;

template<typename T>
class FloorLog2<T, 4>
{
public:
  
};

template<typename T>
class FloorLog2<T, 8>
{
public:
  
};

} // namespace detail

/**
 * Compute the log of the greatest power of 2 less than or equal to |aValue|.
 *
 * FloorLog2(0..1) is 0;
 * FloorLog2(2..3) is 1;
 * FloorLog2(4..7) is 2;
 * FloorLog2(8..15) is 3; and so on.
 */


/** A FloorLog2 variant that accepts only size_t. */


/*
 * Compute the smallest power of 2 greater than or equal to |x|.  |x| must not
 * be so great that the computed value would overflow |size_t|.
 */
inline size_t
RoundUpPow2(size_t aValue)
{
  MOZ_ASSERT(aValue <= (size_t(1) << (sizeof(size_t) * CHAR_BIT - 1)),
             "can't round up -- will overflow!");
  return size_t(1) << CeilingLog2(aValue);
}

/**
 * Rotates the bits of the given value left by the amount of the shift width.
 */


/**
 * Rotates the bits of the given value right by the amount of the shift width.
 */


} /* namespace mozilla */

#endif /* mozilla_MathAlgorithms_h */
# 502 "../../dist/include/mozilla/MathAlgorithms.h"
# 16 "../../dist/include/mozilla/FloatingPoint.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Types.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/FloatingPoint.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/FloatingPoint.h"

namespace mozilla {

/*
 * It's reasonable to ask why we have this header at all.  Don't isnan,
 * copysign, the built-in comparison operators, and the like solve these
 * problems?  Unfortunately, they don't.  We've found that various compilers
 * (MSVC, MSVC when compiling with PGO, and GCC on OS X, at least) miscompile
 * the standard methods in various situations, so we can't use them.  Some of
 * these compilers even have problems compiling seemingly reasonable bitwise
 * algorithms!  But with some care we've found algorithms that seem to not
 * trigger those compiler bugs.
 *
 * For the aforementioned reasons, be very wary of making changes to any of
 * these algorithms.  If you must make changes, keep a careful eye out for
 * compiler bustage, particularly PGO-specific bustage.
 */

struct FloatTypeTraits
{
  typedef uint32_t Bits;

  static const unsigned kExponentBias = 127;
  static const unsigned kExponentShift = 23;

  static const Bits kSignBit         = 0x80000000UL;
  static const Bits kExponentBits    = 0x7F800000UL;
  static const Bits kSignificandBits = 0x007FFFFFUL;
};

struct DoubleTypeTraits
{
  typedef uint64_t Bits;

  static const unsigned kExponentBias = 1023;
  static const unsigned kExponentShift = 52;

  static const Bits kSignBit         = 0x8000000000000000ULL;
  static const Bits kExponentBits    = 0x7ff0000000000000ULL;
  static const Bits kSignificandBits = 0x000fffffffffffffULL;
};

template<typename T> struct SelectTrait;
template<> struct SelectTrait<float> : public FloatTypeTraits {};
template<> struct SelectTrait<double> : public DoubleTypeTraits {};

/*
 *  This struct contains details regarding the encoding of floating-point
 *  numbers that can be useful for direct bit manipulation. As of now, the
 *  template parameter has to be float or double.
 *
 *  The nested typedef |Bits| is the unsigned integral type with the same size
 *  as T: uint32_t for float and uint64_t for double (static assertions
 *  double-check these assumptions).
 *
 *  kExponentBias is the offset that is subtracted from the exponent when
 *  computing the value, i.e. one plus the opposite of the mininum possible
 *  exponent.
 *  kExponentShift is the shift that one needs to apply to retrieve the
 *  exponent component of the value.
 *
 *  kSignBit contains a bits mask. Bit-and-ing with this mask will result in
 *  obtaining the sign bit.
 *  kExponentBits contains the mask needed for obtaining the exponent bits and
 *  kSignificandBits contains the mask needed for obtaining the significand
 *  bits.
 *
 *  Full details of how floating point number formats are encoded are beyond
 *  the scope of this comment. For more information, see
 *  http://en.wikipedia.org/wiki/IEEE_floating_point
 *  http://en.wikipedia.org/wiki/Floating_point#IEEE_754:_floating_point_in_modern_computers
 */
template<typename T>
struct FloatingPoint : public SelectTrait<T>
{
  typedef SelectTrait<T> Base;
  typedef typename Base::Bits Bits;

  static_assert((Base::kSignBit & Base::kExponentBits) == 0,
                "sign bit shouldn't overlap exponent bits");
  static_assert((Base::kSignBit & Base::kSignificandBits) == 0,
                "sign bit shouldn't overlap significand bits");
  static_assert((Base::kExponentBits & Base::kSignificandBits) == 0,
                "exponent bits shouldn't overlap significand bits");

  static_assert((Base::kSignBit | Base::kExponentBits | Base::kSignificandBits) ==
                ~Bits(0),
                "all bits accounted for");

  /*
   * These implementations assume float/double are 32/64-bit single/double
   * format number types compatible with the IEEE-754 standard.  C++ don't
   * require this to be the case.  But we required this in implementations of
   * these algorithms that preceded this header, so we shouldn't break anything
   * if we keep doing so.
   */
  static_assert(sizeof(T) == sizeof(Bits), "Bits must be same size as T");
};

/** Determines whether a float/double is NaN. */
template<typename T>
static MOZ_ALWAYS_INLINE MOZ_CONSTEXPR bool
IsNaN(T aValue)
{
  /*
   * A float/double is NaN if all exponent bits are 1 and the significand
   * contains at least one non-zero bit.
   */
  typedef FloatingPoint<T> Traits;
  typedef typename Traits::Bits Bits;
  return (BitwiseCast<Bits>(aValue) & Traits::kExponentBits) == Traits::kExponentBits &&
         (BitwiseCast<Bits>(aValue) & Traits::kSignificandBits) != 0;
}

/** Determines whether a float/double is +Infinity or -Infinity. */


/** Determines whether a float/double is not NaN or infinite. */
template<typename T>
static MOZ_ALWAYS_INLINE bool
IsFinite(T aValue)
{
  /*
   * NaN and Infinities are the only non-finite floats/doubles, and both have
   * all exponent bits set to 1.
   */
  typedef FloatingPoint<T> Traits;
  typedef typename Traits::Bits Bits;
  Bits bits = BitwiseCast<Bits>(aValue);
  return (bits & Traits::kExponentBits) != Traits::kExponentBits;
}

/**
 * Determines whether a float/double is negative or -0.  It is an error
 * to call this method on a float/double which is NaN.
 */


/** Determines whether a float/double represents -0. */
template<typename T>
static MOZ_ALWAYS_INLINE bool
IsNegativeZero(T aValue)
{
  /* Only the sign bit is set if the value is -0. */
  typedef FloatingPoint<T> Traits;
  typedef typename Traits::Bits Bits;
  Bits bits = BitwiseCast<Bits>(aValue);
  return bits == Traits::kSignBit;
}

/**
 * Returns 0 if a float/double is NaN or infinite;
 * otherwise, the float/double is returned.
 */


/**
 * Returns the exponent portion of the float/double.
 *
 * Zero is not special-cased, so ExponentComponent(0.0) is
 * -int_fast16_t(Traits::kExponentBias).
 */


/** Returns +Infinity. */
template<typename T>
static MOZ_ALWAYS_INLINE T
PositiveInfinity()
{
  /*
   * Positive infinity has all exponent bits set, sign bit set to 0, and no
   * significand.
   */
  typedef FloatingPoint<T> Traits;
  return BitwiseCast<T>(Traits::kExponentBits);
}

/** Returns -Infinity. */
template<typename T>
static MOZ_ALWAYS_INLINE T
NegativeInfinity()
{
  /*
   * Negative infinity has all exponent bits set, sign bit set to 1, and no
   * significand.
   */
  typedef FloatingPoint<T> Traits;
  return BitwiseCast<T>(Traits::kSignBit | Traits::kExponentBits);
}


/** Constructs a NaN value with the specified sign bit and significand bits. */
template<typename T>
static MOZ_ALWAYS_INLINE T
SpecificNaN(int signbit, typename FloatingPoint<T>::Bits significand)
{
  typedef FloatingPoint<T> Traits;
  MOZ_ASSERT(signbit == 0 || signbit == 1);
  MOZ_ASSERT((significand & ~Traits::kSignificandBits) == 0);
  MOZ_ASSERT(significand & Traits::kSignificandBits);

  T t = BitwiseCast<T>((signbit ? Traits::kSignBit : 0) |
                       Traits::kExponentBits |
                       significand);
  MOZ_ASSERT(IsNaN(t));
  return t;
}

/** Computes the smallest non-zero positive float/double value. */


/**
 * If aValue is equal to some int32_t value, set *aInt32 to that value and
 * return true; otherwise return false.
 *
 * Note that negative zero is "equal" to zero here. To test whether a value can
 * be losslessly converted to int32_t and back, use NumberIsInt32 instead.
 */
template<typename T>
static MOZ_ALWAYS_INLINE bool
NumberEqualsInt32(T aValue, int32_t* aInt32)
{
  /*
   * XXX Casting a floating-point value that doesn't truncate to int32_t, to
   *     int32_t, induces undefined behavior.  We should definitely fix this
   *     (bug 744965), but as apparently it "works" in practice, it's not a
   *     pressing concern now.
   */
  return aValue == (*aInt32 = int32_t(aValue));
}

/**
 * If d can be converted to int32_t and back to an identical double value,
 * set *aInt32 to that value and return true; otherwise return false.
 *
 * The difference between this and NumberEqualsInt32 is that this method returns
 * false for negative zero.
 */
template<typename T>
static MOZ_ALWAYS_INLINE bool
NumberIsInt32(T aValue, int32_t* aInt32)
{
  return !IsNegativeZero(aValue) && NumberEqualsInt32(aValue, aInt32);
}

/**
 * Computes a NaN value.  Do not use this method if you depend upon a particular
 * NaN value being returned.
 */


/**
 * Compare two doubles for equality, *without* equating -0 to +0, and equating
 * any NaN value to any other NaN value.  (The normal equality operators equate
 * -0 with +0, and they equate NaN to no other value.)
 */


namespace detail {

template<typename T>
struct FuzzyEqualsEpsilon;

template<>
struct FuzzyEqualsEpsilon<float>
{
  // A number near 1e-5 that is exactly representable in a float.
  
};

template<>
struct FuzzyEqualsEpsilon<double>
{
  // A number near 1e-12 that is exactly representable in a double.
  
};

} // namespace detail

/**
 * Compare two floating point values for equality, modulo rounding error. That
 * is, the two values are considered equal if they are both not NaN and if they
 * are less than or equal to aEpsilon apart. The default value of aEpsilon is
 *
 * In most cases you will want to use this rather than FuzzyEqualsAdditive, as
 * this function effectively masks out differences in the bottom few bits of
 * the floating point numbers being compared, regardless of what order of
 * magnitude those numbers are at.
 */


/**
 * Returns true if the given value can be losslessly represented as an IEEE-754
 * single format number, false otherwise.  All NaN values are considered
 * representable (notwithstanding that the exact bit pattern of a double format
 * NaN value can't be exactly represented in single format).
 *
 * This function isn't inlined to avoid buggy optimizations by MSVC.
 */
MOZ_WARN_UNUSED_RESULT
extern MFBT_API bool
IsFloat32Representable(double aFloat32);

} /* namespace mozilla */

#endif /* mozilla_FloatingPoint_h */
# 424 "../../dist/include/mozilla/FloatingPoint.h"
# 13 "../../dist/include/mozilla/gfx/BasePoint.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/gfx/BasePoint.h"

namespace mozilla {
namespace gfx {

/**
 * Do not use this class directly. Subclass it, pass that subclass as the
 * Sub parameter, and only use that subclass. This allows methods to safely
 * cast 'this' to 'Sub*'.
 */
template <class T, class Sub, class Coord = T>
struct BasePoint {
  T x, y;

  // Constructors
  MOZ_CONSTEXPR BasePoint() : x(0), y(0) {}
  MOZ_CONSTEXPR BasePoint(Coord aX, Coord aY) : x(aX), y(aY) {}

  
  

  // Note that '=' isn't defined so we'll get the
  // compiler generated default assignment operator

  bool operator==(const Sub& aPoint) const {
    return x == aPoint.x && y == aPoint.y;
  }
  

  Sub operator+(const Sub& aPoint) const {
    return Sub(x + aPoint.x, y + aPoint.y);
  }
  Sub operator-(const Sub& aPoint) const {
    return Sub(x - aPoint.x, y - aPoint.y);
  }
  Sub& operator+=(const Sub& aPoint) {
    x += aPoint.x;
    y += aPoint.y;
    return *static_cast<Sub*>(this);
  }
  

  Sub operator*(T aScale) const {
    return Sub(x * aScale, y * aScale);
  }
  

  Sub operator-() const {
    return Sub(-x, -y);
  }

  

  // Round() is *not* rounding to nearest integer if the values are negative.
  // They are always rounding as floor(n + 0.5).
  // See https://bugzilla.mozilla.org/show_bug.cgi?id=410748#c14
  

  // "Finite" means not inf and not NaN
  

  

  

};

}
}

#endif /* MOZILLA_GFX_BASEPOINT_H_ */
# 109 "../../dist/include/mozilla/gfx/BasePoint.h"
# 14 "../../dist/include/mozilla/gfx/Point.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "BasePoint3D.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/BasePoint3D.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_BASEPOINT3D_H_
#define MOZILLA_BASEPOINT3D_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/BasePoint3D.h"

namespace mozilla {
namespace gfx {

/**
 * Do not use this class directly. Subclass it, pass that subclass as the
 * Sub parameter, and only use that subclass. This allows methods to safely
 * cast 'this' to 'Sub*'.
 */
template <class T, class Sub>
struct BasePoint3D {
  T x, y, z;

  // Constructors

  

  

  // Invalid for points with distance from origin of 0.
  
};

}
}

#endif /* MOZILLA_BASEPOINT3D_H_ */
# 118 "../../dist/include/mozilla/gfx/BasePoint3D.h"
# 15 "../../dist/include/mozilla/gfx/Point.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "BasePoint4D.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/BasePoint4D.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_BASEPOINT4D_H_
#define MOZILLA_BASEPOINT4D_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/BasePoint4D.h"

namespace mozilla {
namespace gfx {

/**
 * Do not use this class directly. Subclass it, pass that subclass as the
 * Sub parameter, and only use that subclass. This allows methods to safely
 * cast 'this' to 'Sub*'.
 */
template <class T, class Sub>
struct BasePoint4D {
  T x, y, z, w;

  // Constructors

  

  // Ignores the 4th component!
  

  

  

  
};

}
}

#endif /* MOZILLA_BASEPOINT4D_H_ */
# 127 "../../dist/include/mozilla/gfx/BasePoint4D.h"
# 16 "../../dist/include/mozilla/gfx/Point.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "BaseSize.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/BaseSize.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_BASESIZE_H_
#define MOZILLA_GFX_BASESIZE_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/BaseSize.h"

namespace mozilla {
namespace gfx {

/**
 * Do not use this class directly. Subclass it, pass that subclass as the
 * Sub parameter, and only use that subclass. This allows methods to safely
 * cast 'this' to 'Sub*'.
 */
template <class T, class Sub>
struct BaseSize {
  T width, height;

  // Constructors
  MOZ_CONSTEXPR BaseSize() : width(0), height(0) {}
  MOZ_CONSTEXPR BaseSize(T aWidth, T aHeight) : width(aWidth), height(aHeight) {}

  void SizeTo(T aWidth, T aHeight) { width = aWidth; height = aHeight; }

  

  // Note that '=' isn't defined so we'll get the
  // compiler generated default assignment operator

  bool operator==(const Sub& aSize) const {
    return width == aSize.width && height == aSize.height;
  }
  bool operator!=(const Sub& aSize) const {
    return width != aSize.width || height != aSize.height;
  }
  
  

  
  
  
  

  
  
  

  
  
};

}
}

#endif /* MOZILLA_GFX_BASESIZE_H_ */
# 89 "../../dist/include/mozilla/gfx/BaseSize.h"
# 17 "../../dist/include/mozilla/gfx/Point.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/gfx/Point.h"

#if 0 /* expanded by -frewrite-includes */
#include <cmath>
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/gfx/Point.h"

namespace mozilla {

template <typename> struct IsPixel;

namespace gfx {

// This should only be used by the typedefs below.
struct UnknownUnits {};

}  // close namespace 'gfx' because IsPixel specialization must be in 'mozilla'

template<> struct IsPixel<gfx::UnknownUnits> : TrueType {};

namespace gfx {

template<class units>
struct IntPointTyped :
  public BasePoint< int32_t, IntPointTyped<units>, IntCoordTyped<units> >,
  public units {
  static_assert(IsPixel<units>::value,
                "'units' must be a coordinate system tag");

  typedef IntCoordTyped<units> Coord;
  typedef BasePoint< int32_t, IntPointTyped<units>, IntCoordTyped<units> > Super;

  MOZ_CONSTEXPR IntPointTyped() : Super() {}
  MOZ_CONSTEXPR IntPointTyped(int32_t aX, int32_t aY) : Super(Coord(aX), Coord(aY)) {}
  // The mixed-type constructors (int, Coord) and (Coord, int) are needed to
  // avoid ambiguities because Coord is implicitly convertible to int.
  MOZ_CONSTEXPR 
  MOZ_CONSTEXPR IntPointTyped(Coord aX, int32_t aY) : Super(aX, Coord(aY)) {}
  MOZ_CONSTEXPR IntPointTyped(Coord aX, Coord aY) : Super(aX, aY) {}

  // XXX When all of the code is ported, the following functions to convert to and from
  // unknown types should be removed.

  static IntPointTyped<units> FromUnknownPoint(const IntPointTyped<UnknownUnits>& aPoint) {
    return IntPointTyped<units>(aPoint.x, aPoint.y);
  }

  IntPointTyped<UnknownUnits> ToUnknownPoint() const {
    return IntPointTyped<UnknownUnits>(this->x, this->y);
  }
};
typedef IntPointTyped<UnknownUnits> IntPoint;

template<class units>
struct PointTyped :
  public BasePoint< Float, PointTyped<units>, CoordTyped<units> >,
  public units {
  static_assert(IsPixel<units>::value,
                "'units' must be a coordinate system tag");

  typedef CoordTyped<units> Coord;
  typedef BasePoint< Float, PointTyped<units>, CoordTyped<units> > Super;

  MOZ_CONSTEXPR PointTyped() : Super() {}
  MOZ_CONSTEXPR PointTyped(Float aX, Float aY) : Super(Coord(aX), Coord(aY)) {}
  // The mixed-type constructors (Float, Coord) and (Coord, Float) are needed to
  // avoid ambiguities because Coord is implicitly convertible to Float.
  MOZ_CONSTEXPR PointTyped(Float aX, Coord aY) : Super(Coord(aX), aY) {}
  MOZ_CONSTEXPR 
  MOZ_CONSTEXPR 
  MOZ_CONSTEXPR MOZ_IMPLICIT PointTyped(const IntPointTyped<units>& point) : Super(float(point.x), float(point.y)) {}

  // XXX When all of the code is ported, the following functions to convert to and from
  // unknown types should be removed.

  

  
};
typedef PointTyped<UnknownUnits> Point;





template<class units>
struct Point3DTyped :
  public BasePoint3D< Float, Point3DTyped<units> > {
  static_assert(IsPixel<units>::value,
                "'units' must be a coordinate system tag");

  typedef BasePoint3D< Float, Point3DTyped<units> > Super;

  Point3DTyped() : Super() {}
  

  // XXX When all of the code is ported, the following functions to convert to and from
  // unknown types should be removed.

  

  
};
typedef Point3DTyped<UnknownUnits> Point3D;

template<class units>
struct Point4DTyped :
  public BasePoint4D< Float, Point4DTyped<units> > {
  static_assert(IsPixel<units>::value,
                "'units' must be a coordinate system tag");

  typedef BasePoint4D< Float, Point4DTyped<units> > Super;

  Point4DTyped() : Super() {}
  

  // XXX When all of the code is ported, the following functions to convert to and from
  // unknown types should be removed.

  

  

  
};
typedef Point4DTyped<UnknownUnits> Point4D;

template<class units>
struct IntSizeTyped :
  public BaseSize< int32_t, IntSizeTyped<units> >,
  public units {
  static_assert(IsPixel<units>::value,
                "'units' must be a coordinate system tag");

  typedef BaseSize< int32_t, IntSizeTyped<units> > Super;

  MOZ_CONSTEXPR IntSizeTyped() : Super() {}
  MOZ_CONSTEXPR IntSizeTyped(int32_t aWidth, int32_t aHeight) : Super(aWidth, aHeight) {}

  // XXX When all of the code is ported, the following functions to convert to and from
  // unknown types should be removed.

  

  
};
typedef IntSizeTyped<UnknownUnits> IntSize;

template<class units>
struct SizeTyped :
  public BaseSize< Float, SizeTyped<units> >,
  public units {
  static_assert(IsPixel<units>::value,
                "'units' must be a coordinate system tag");

  typedef BaseSize< Float, SizeTyped<units> > Super;

  MOZ_CONSTEXPR SizeTyped() : Super() {}
  MOZ_CONSTEXPR SizeTyped(Float aWidth, Float aHeight) : Super(aWidth, aHeight) {}
  explicit SizeTyped(const IntSizeTyped<units>& size) :
    Super(float(size.width), float(size.height)) {}

  // XXX When all of the code is ported, the following functions to convert to and from
  // unknown types should be removed.

  

  
};
typedef SizeTyped<UnknownUnits> Size;



}
}

#endif /* MOZILLA_GFX_POINT_H_ */
# 225 "../../dist/include/mozilla/gfx/Point.h"
# 11 "../../dist/include/mozilla/gfx/2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "Rect.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/Rect.h" 1
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_RECT_H_
#define MOZILLA_GFX_RECT_H_

#if 0 /* expanded by -frewrite-includes */
#include "BaseRect.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/BaseRect.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_BASERECT_H_
#define MOZILLA_GFX_BASERECT_H_

#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/BaseRect.h"
#if 0 /* expanded by -frewrite-includes */
#include <cmath>
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/gfx/BaseRect.h"
#if 0 /* expanded by -frewrite-includes */
#include <ostream>
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/gfx/BaseRect.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/gfx/BaseRect.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/FloatingPoint.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/gfx/BaseRect.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/gfx/BaseRect.h"
#if 0 /* expanded by -frewrite-includes */
#include "Types.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/gfx/BaseRect.h"

namespace mozilla {
namespace gfx {

/**
 * Rectangles have two interpretations: a set of (zero-size) points,
 * and a rectangular area of the plane. Most rectangle operations behave
 * the same no matter what interpretation is being used, but some operations
 * differ:
 * -- Equality tests behave differently. When a rectangle represents an area,
 * all zero-width and zero-height rectangles are equal to each other since they
 * represent the empty area. But when a rectangle represents a set of
 * mathematical points, zero-width and zero-height rectangles can be unequal.
 * -- The union operation can behave differently. When rectangles represent
 * areas, taking the union of a zero-width or zero-height rectangle with
 * another rectangle can just ignore the empty rectangle. But when rectangles
 * represent sets of mathematical points, we may need to extend the latter
 * rectangle to include the points of a zero-width or zero-height rectangle.
 *
 * To ensure that these interpretations are explicitly disambiguated, we
 * deny access to the == and != operators and require use of IsEqualEdges and
 * IsEqualInterior instead. Similarly we provide separate Union and UnionEdges
 * methods.
 *
 * Do not use this class directly. Subclass it, pass that subclass as the
 * Sub parameter, and only use that subclass.
 */
template <class T, class Sub, class Point, class SizeT, class MarginT>
struct BaseRect {
  T x, y, width, height;

  // Constructors
  BaseRect() : x(0), y(0), width(0), height(0) {}
  BaseRect(const Point& aOrigin, const SizeT &aSize) :
      x(aOrigin.x), y(aOrigin.y), width(aSize.width), height(aSize.height)
  {
  }
  BaseRect(T aX, T aY, T aWidth, T aHeight) :
      x(aX), y(aY), width(aWidth), height(aHeight)
  {
  }

  // Emptiness. An empty rect is one that has no area, i.e. its height or width
  // is <= 0
  bool IsEmpty() const { return height <= 0 || width <= 0; }
  void SetEmpty() { width = height = 0; }

  // Intersection. Returns TRUE if the receiver's area has non-empty
  // intersection with aRect's area, and FALSE otherwise.
  // Always returns false if aRect is empty or 'this' is empty.
  
  // Returns the rectangle containing the intersection of the points
  // (including edges) of *this and aRect. If there are no points in that
  // intersection, returns an empty rectangle with x/y set to the std::max of the x/y
  // of *this and aRect.
  Sub Intersect(const Sub& aRect) const
  {
    Sub result;
    result.x = std::max<T>(x, aRect.x);
    result.y = std::max<T>(y, aRect.y);
    result.width = std::min<T>(x - result.x + width, aRect.x - result.x + aRect.width);
    result.height = std::min<T>(y - result.y + height, aRect.y - result.y + aRect.height);
    if (result.width < 0 || result.height < 0) {
      result.SizeTo(0, 0);
    }
    return result;
  }
  // Sets *this to be the rectangle containing the intersection of the points
  // (including edges) of *this and aRect. If there are no points in that
  // intersection, sets *this to be an empty rectangle with x/y set to the std::max
  // of the x/y of *this and aRect.
  //
  // 'this' can be the same object as either aRect1 or aRect2
  

  // Returns the smallest rectangle that contains both the area of both
  // this and aRect2.
  // Thus, empty input rectangles are ignored.
  // If both rectangles are empty, returns this.
  Sub Union(const Sub& aRect) const
  {
    if (IsEmpty()) {
      return aRect;
    } else if (aRect.IsEmpty()) {
      return *static_cast<const Sub*>(this);
    } else {
      return UnionEdges(aRect);
    }
  }
  // Returns the smallest rectangle that contains both the points (including
  // edges) of both aRect1 and aRect2.
  // Thus, empty input rectangles are allowed to affect the result.
  Sub UnionEdges(const Sub& aRect) const
  {
    Sub result;
    result.x = std::min(x, aRect.x);
    result.y = std::min(y, aRect.y);
    result.width = std::max(XMost(), aRect.XMost()) - result.x;
    result.height = std::max(YMost(), aRect.YMost()) - result.y;
    return result;
  }
  // Computes the smallest rectangle that contains both the area of both
  // aRect1 and aRect2, and fills 'this' with the result.
  // Thus, empty input rectangles are ignored.
  // If both rectangles are empty, sets 'this' to aRect2.
  //
  // 'this' can be the same object as either aRect1 or aRect2
  

  // Computes the smallest rectangle that contains both the points (including
  // edges) of both aRect1 and aRect2.
  // Thus, empty input rectangles are allowed to affect the result.
  //
  // 'this' can be the same object as either aRect1 or aRect2
  

  // Expands the rect to include the point
  

  
  
  
  
  void MoveBy(T aDx, T aDy) { x += aDx; y += aDy; }
  void MoveBy(const Point& aPoint) { x += aPoint.x; y += aPoint.y; }
  void SizeTo(T aWidth, T aHeight) { width = aWidth; height = aHeight; }
  

  void Inflate(T aD) { Inflate(aD, aD); }
  void Inflate(T aDx, T aDy)
  {
    x -= aDx;
    y -= aDy;
    width += 2 * aDx;
    height += 2 * aDy;
  }
  
  

  

  
  
  
  

  // Return true if the rectangles contain the same set of points, including
  // points on the edges.
  // Use when we care about the exact x/y/width/height values being
  // equal (i.e. we care about differences in empty rectangles).
  bool IsEqualEdges(const Sub& aRect) const
  {
    return x == aRect.x && y == aRect.y &&
           width == aRect.width && height == aRect.height;
  }
  // Return true if the rectangles contain the same area of the plane.
  // Use when we do not care about differences in empty rectangles.
  bool IsEqualInterior(const Sub& aRect) const
  {
    return IsEqualEdges(aRect) || (IsEmpty() && aRect.IsEmpty());
  }

  friend Sub operator+(Sub aSub, const Point& aPoint)
  {
    aSub += aPoint;
    return aSub;
  }
  friend Sub operator-(Sub aSub, const Point& aPoint)
  {
    aSub -= aPoint;
    return aSub;
  }
  
  
  Sub& operator+=(const Point& aPoint)
  {
    MoveBy(aPoint);
    return *static_cast<Sub*>(this);
  }
  Sub& operator-=(const Point& aPoint)
  {
    MoveBy(-aPoint);
    return *static_cast<Sub*>(this);
  }
  
  
  // Find difference as a Margin
  

  // Helpers for accessing the vertices
  Point TopLeft() const { return Point(x, y); }
  Point TopRight() const { return Point(XMost(), y); }
  Point BottomLeft() const { return Point(x, YMost()); }
  Point BottomRight() const { return Point(XMost(), YMost()); }
  
  
  
  
  SizeT Size() const { return SizeT(width, height); }

  // Helper methods for computing the extents
  T X() const { return x; }
  T Y() const { return y; }
  T Width() const { return width; }
  T Height() const { return height; }
  T XMost() const { return x + width; }
  T YMost() const { return y + height; }

  // Moves one edge of the rect without moving the opposite edge.
  
  
  
  

  // Round the rectangle edges to integer coordinates, such that the rounded
  // rectangle has the same set of pixel centers as the original rectangle.
  // Edges at offset 0.5 round up.
  // Suitable for most places where integral device coordinates
  // are needed, but note that any translation should be applied first to
  // avoid pixel rounding errors.
  // Note that this is *not* rounding to nearest integer if the values are negative.
  // They are always rounding as floor(n + 0.5).
  // See https://bugzilla.mozilla.org/show_bug.cgi?id=410748#c14
  // If you need similar method which is using NS_round(), you should create
  // new |RoundAwayFromZero()| method.
  

  // Snap the rectangle edges to integer coordinates, such that the
  // original rectangle contains the resulting rectangle.
  

  // Snap the rectangle edges to integer coordinates, such that the
  // resulting rectangle contains the original rectangle.
  void RoundOut()
  {
    T x0 = static_cast<T>(floor(T(X())));
    T y0 = static_cast<T>(floor(T(Y())));
    T x1 = static_cast<T>(ceil(T(XMost())));
    T y1 = static_cast<T>(ceil(T(YMost())));

    x = x0;
    y = y0;

    width = x1 - x0;
    height = y1 - y0;
  }

  // Scale 'this' by aScale without doing any rounding.
  
  // Scale 'this' by aXScale and aYScale, without doing any rounding.
  void Scale(T aXScale, T aYScale)
  {
    T right = XMost() * aXScale;
    T bottom = YMost() * aYScale;
    x = x * aXScale;
    y = y * aYScale;
    width = right - x;
    height = bottom - y;
  }
  // Scale 'this' by aScale, converting coordinates to integers so that the result is
  // the smallest integer-coordinate rectangle containing the unrounded result.
  // Note: this can turn an empty rectangle into a non-empty rectangle
  
  // Scale 'this' by aXScale and aYScale, converting coordinates to integers so
  // that the result is the smallest integer-coordinate rectangle containing the
  // unrounded result.
  // Note: this can turn an empty rectangle into a non-empty rectangle
  /**
   * Clamp this rectangle to be inside aRect. The function returns a copy of
   * this rect after it is forced inside the bounds of aRect. It will attempt to
   * retain the size but will shrink the dimensions that don't fit.
   */
  

  

private:
  // Do not use the default operator== or operator!= !
  // Use IsEqualEdges or IsEqualInterior explicitly.
  
  
};

}
}

#endif /* MOZILLA_GFX_BASERECT_H_ */
# 567 "../../dist/include/mozilla/gfx/BaseRect.h"
# 10 "../../dist/include/mozilla/gfx/Rect.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "BaseMargin.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/BaseMargin.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_BASEMARGIN_H_
#define MOZILLA_GFX_BASEMARGIN_H_

#if 0 /* expanded by -frewrite-includes */
#include "Types.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/BaseMargin.h"

namespace mozilla {

/**
 * Sides represents a set of physical sides.
 */
struct Sides MOZ_FINAL {
  
  
  
  
  
  
  
  
  
  
  
  
  
  

private:
  uint8_t mBits;
};

namespace gfx {

/**
 * Do not use this class directly. Subclass it, pass that subclass as the
 * Sub parameter, and only use that subclass.
 */
template <class T, class Sub>
struct BaseMargin {
  typedef mozilla::Side SideT; // because we have a method named Side

  // Do not change the layout of these members; the Side() methods below
  // depend on this order.
  T top, right, bottom, left;

  // Constructors
  BaseMargin() : top(0), right(0), bottom(0), left(0) {}
  BaseMargin(T aTop, T aRight, T aBottom, T aLeft) :
      top(aTop), right(aRight), bottom(aBottom), left(aLeft) {}

  

  T LeftRight() const { return left + right; }
  T TopBottom() const { return top + bottom; }

  
  

  

  // Overloaded operators. Note that '=' isn't defined so we'll get the
  // compiler generated default assignment operator
  bool operator==(const Sub& aMargin) const {
    return top == aMargin.top && right == aMargin.right &&
           bottom == aMargin.bottom && left == aMargin.left;
  }
  
  Sub operator+(const Sub& aMargin) const {
    return Sub(top + aMargin.top, right + aMargin.right,
               bottom + aMargin.bottom, left + aMargin.left);
  }
  
  
};

}
}

#endif /* MOZILLA_GFX_BASEMARGIN_H_ */
# 145 "../../dist/include/mozilla/gfx/BaseMargin.h"
# 11 "../../dist/include/mozilla/gfx/Rect.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "Point.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/gfx/Rect.h"
#if 0 /* expanded by -frewrite-includes */
#include "Tools.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/Tools.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_TOOLS_H_
#define MOZILLA_GFX_TOOLS_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CheckedInt.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/CheckedInt.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Provides checked integers, detecting integer overflow and divide-by-0. */

#ifndef mozilla_CheckedInt_h
#define mozilla_CheckedInt_h

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/CheckedInt.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/CheckedInt.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/CheckedInt.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/IntegerTypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/IntegerTypeTraits.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Helpers to manipulate integer types that don't fit in TypeTraits.h */

#ifndef mozilla_IntegerTypeTraits_h
#define mozilla_IntegerTypeTraits_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/IntegerTypeTraits.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/IntegerTypeTraits.h"

namespace mozilla {

namespace detail {

/**
 * StdintTypeForSizeAndSignedness returns the stdint integer type
 * of given size (can be 1, 2, 4 or 8) and given signedness
 * (false means unsigned, true means signed).
 */
template<size_t Size, bool Signedness>
struct StdintTypeForSizeAndSignedness;

template<>
struct StdintTypeForSizeAndSignedness<1, true>
{
  typedef int8_t Type;
};

template<>
struct StdintTypeForSizeAndSignedness<1, false>
{
  typedef uint8_t Type;
};

template<>
struct StdintTypeForSizeAndSignedness<2, true>
{
  typedef int16_t Type;
};

template<>
struct StdintTypeForSizeAndSignedness<2, false>
{
  typedef uint16_t Type;
};

template<>
struct StdintTypeForSizeAndSignedness<4, true>
{
  typedef int32_t Type;
};

template<>
struct StdintTypeForSizeAndSignedness<4, false>
{
  typedef uint32_t Type;
};

template<>
struct StdintTypeForSizeAndSignedness<8, true>
{
  typedef int64_t Type;
};

template<>
struct StdintTypeForSizeAndSignedness<8, false>
{
  typedef uint64_t Type;
};

} // namespace detail

template<size_t Size>
struct UnsignedStdintTypeForSize
  : detail::StdintTypeForSizeAndSignedness<Size, false>
{};

template<size_t Size>
struct SignedStdintTypeForSize
  : detail::StdintTypeForSizeAndSignedness<Size, true>
{};

template<typename IntegerType>
struct PositionOfSignBit
{
  static_assert(IsIntegral<IntegerType>::value,
                "PositionOfSignBit is only for integral types");
  // 8 here should be CHAR_BIT from limits.h, but the world has moved on.
  static const size_t value = 8 * sizeof(IntegerType) - 1;
};

/**
 * MinValue returns the minimum value of the given integer type as a
 * compile-time constant, which std::numeric_limits<IntegerType>::min()
 * cannot do in c++98.
 */
template<typename IntegerType>
struct MinValue
{
private:
  static_assert(IsIntegral<IntegerType>::value,
                "MinValue is only for integral types");

  typedef typename MakeUnsigned<IntegerType>::Type UnsignedIntegerType;
  static const size_t PosOfSignBit = PositionOfSignBit<IntegerType>::value;

public:
  // Bitwise ops may return a larger type, that's why we cast explicitly.
  // In C++, left bit shifts on signed values is undefined by the standard
  // unless the shifted value is representable.
  // Notice that signed-to-unsigned conversions are always well-defined in
  // the standard as the value congruent to 2**n, as expected. By contrast,
  // unsigned-to-signed is only well-defined if the value is representable.
  static const IntegerType value =
      IsSigned<IntegerType>::value
      ? IntegerType(UnsignedIntegerType(1) << PosOfSignBit)
      : IntegerType(0);
};

/**
 * MaxValue returns the maximum value of the given integer type as a
 * compile-time constant, which std::numeric_limits<IntegerType>::max()
 * cannot do in c++98.
 */
template<typename IntegerType>
struct MaxValue
{
  static_assert(IsIntegral<IntegerType>::value,
                "MaxValue is only for integral types");

  // Tricksy, but covered by the CheckedInt unit test.
  // Relies on the type of MinValue<IntegerType>::value
  // being IntegerType.
  static const IntegerType value = ~MinValue<IntegerType>::value;
};

} // namespace mozilla

#endif // mozilla_IntegerTypeTraits_h
# 144 "../../dist/include/mozilla/IntegerTypeTraits.h"
# 16 "../../dist/include/mozilla/CheckedInt.h" 2

namespace mozilla {

template<typename T> class CheckedInt;

namespace detail {

/*
 * Step 1: manually record supported types
 *
 * What's nontrivial here is that there are different families of integer
 * types: basic integer types and stdint types. It is merrily undefined which
 * types from one family may be just typedefs for a type from another family.
 *
 * For example, on GCC 4.6, aside from the basic integer types, the only other
 * type that isn't just a typedef for some of them, is int8_t.
 */

struct UnsupportedType {};

template<typename IntegerType>
struct IsSupportedPass2
{
  static const bool value = false;
};

template<typename IntegerType>
struct IsSupported
{
  static const bool value = IsSupportedPass2<IntegerType>::value;
};

template<>
struct IsSupported<int8_t>
{ static const bool value = true; };

template<>
struct IsSupported<uint8_t>
{ static const bool value = true; };

template<>
struct IsSupported<int16_t>
{ static const bool value = true; };

template<>
struct IsSupported<uint64_t>
{ static const bool value = true; };


template<>
struct IsSupportedPass2<char>
{ static const bool value = true; };

template<>
struct IsSupportedPass2<signed char>
{ static const bool value = true; };

template<>
struct IsSupportedPass2<unsigned char>
{ static const bool value = true; };

template<>
struct IsSupportedPass2<short>
{ static const bool value = true; };

template<>
struct IsSupportedPass2<unsigned short>
{ static const bool value = true; };

template<>
struct IsSupportedPass2<int>
{ static const bool value = true; };

template<>
struct IsSupportedPass2<unsigned int>
{ static const bool value = true; };

/*
 * Step 2: Implement the actual validity checks.
 *
 * Ideas taken from IntegerLib, code different.
 */

template<typename IntegerType, size_t Size = sizeof(IntegerType)>
struct TwiceBiggerType
{
  typedef typename detail::StdintTypeForSizeAndSignedness<
                     sizeof(IntegerType) * 2,
                     IsSigned<IntegerType>::value
                   >::Type Type;
};

template<typename IntegerType>
struct TwiceBiggerType<IntegerType, 8>
{
  typedef UnsupportedType Type;
};

template<typename T>
inline bool
HasSignBit(T aX)
{
  // In C++, right bit shifts on negative values is undefined by the standard.
  // Notice that signed-to-unsigned conversions are always well-defined in the
  // standard, as the value congruent modulo 2**n as expected. By contrast,
  // unsigned-to-signed is only well-defined if the value is representable.
  return bool(typename MakeUnsigned<T>::Type(aX) >>
              PositionOfSignBit<T>::value);
}

// Bitwise ops may return a larger type, so it's good to use this inline
// helper guaranteeing that the result is really of type T.
template<typename T>
inline T
BinaryComplement(T aX)
{
  return ~aX;
}

template<typename T,
         typename U,
         bool IsTSigned = IsSigned<T>::value,
         bool IsUSigned = IsSigned<U>::value>
struct DoesRangeContainRange
{
};

template<typename T, typename U, bool Signedness>
struct DoesRangeContainRange<T, U, Signedness, Signedness>
{
  static const bool value = sizeof(T) >= sizeof(U);
};

template<typename T, typename U>
struct DoesRangeContainRange<T, U, true, false>
{
  static const bool value = sizeof(T) > sizeof(U);
};

template<typename T, typename U>
struct DoesRangeContainRange<T, U, false, true>
{
  static const bool value = false;
};

template<typename T,
         typename U,
         bool IsTSigned = IsSigned<T>::value,
         bool IsUSigned = IsSigned<U>::value,
         bool DoesTRangeContainURange = DoesRangeContainRange<T, U>::value>
struct IsInRangeImpl {};

template<typename T, typename U, bool IsTSigned, bool IsUSigned>
struct IsInRangeImpl<T, U, IsTSigned, IsUSigned, true>
{
  static bool run(U)
  {
    return true;
  }
};

template<typename T, typename U>
struct IsInRangeImpl<T, U, true, true, false>
{
  
};

template<typename T, typename U>
struct IsInRangeImpl<T, U, false, false, false>
{
  static bool run(U aX)
  {
    return aX <= MaxValue<T>::value;
  }
};

template<typename T, typename U>
struct IsInRangeImpl<T, U, true, false, false>
{
  static bool run(U aX)
  {
    return sizeof(T) > sizeof(U) || aX <= U(MaxValue<T>::value);
  }
};

template<typename T, typename U>
struct IsInRangeImpl<T, U, false, true, false>
{
  static bool run(U aX)
  {
    return sizeof(T) >= sizeof(U)
           ? aX >= 0
           : aX >= 0 && aX <= U(MaxValue<T>::value);
  }
};

template<typename T, typename U>
inline bool
IsInRange(U aX)
{
  return IsInRangeImpl<T, U>::run(aX);
}

template<typename T>
inline bool
IsAddValid(T aX, T aY)
{
  // Addition is valid if the sign of aX+aY is equal to either that of aX or
  // that of aY. Since the value of aX+aY is undefined if we have a signed
  // type, we compute it using the unsigned type of the same size.  Beware!
  // These bitwise operations can return a larger integer type, if T was a
  // small type like int8_t, so we explicitly cast to T.

  typename MakeUnsigned<T>::Type ux = aX;
  typename MakeUnsigned<T>::Type uy = aY;
  typename MakeUnsigned<T>::Type result = ux + uy;
  return IsSigned<T>::value
         ? HasSignBit(BinaryComplement(T((result ^ aX) & (result ^ aY))))
         : BinaryComplement(aX) >= aY;
}

template<typename T>
inline bool
IsSubValid(T aX, T aY)
{
  // Subtraction is valid if either aX and aY have same sign, or aX-aY and aX
  // have same sign. Since the value of aX-aY is undefined if we have a signed
  // type, we compute it using the unsigned type of the same size.
  typename MakeUnsigned<T>::Type ux = aX;
  typename MakeUnsigned<T>::Type uy = aY;
  typename MakeUnsigned<T>::Type result = ux - uy;

  return IsSigned<T>::value
         ? HasSignBit(BinaryComplement(T((result ^ aX) & (aX ^ aY))))
         : aX >= aY;
}

template<typename T,
         bool IsTSigned = IsSigned<T>::value,
         bool TwiceBiggerTypeIsSupported =
           IsSupported<typename TwiceBiggerType<T>::Type>::value>
struct IsMulValidImpl {};

template<typename T, bool IsTSigned>
struct IsMulValidImpl<T, IsTSigned, true>
{
  static bool run(T aX, T aY)
  {
    typedef typename TwiceBiggerType<T>::Type TwiceBiggerType;
    TwiceBiggerType product = TwiceBiggerType(aX) * TwiceBiggerType(aY);
    return IsInRange<T>(product);
  }
};

template<typename T>
struct IsMulValidImpl<T, true, false>
{
  
};

template<typename T>
struct IsMulValidImpl<T, false, false>
{
  
};

template<typename T>
inline bool
IsMulValid(T aX, T aY)
{
  return IsMulValidImpl<T>::run(aX, aY);
}

template<typename T>
inline bool
IsDivValid(T aX, T aY)
{
  // Keep in mind that in the signed case, min/-1 is invalid because
  // abs(min)>max.
  return aY != 0 &&
         !(IsSigned<T>::value && aX == MinValue<T>::value && aY == T(-1));
}

template<typename T, bool IsTSigned = IsSigned<T>::value>
struct IsModValidImpl;

template<typename T>
inline bool
IsModValid(T aX, T aY)
{
  return IsModValidImpl<T>::run(aX, aY);
}

/*
 * Mod is pretty simple.
 * For now, let's just use the ANSI C definition:
 * If aX or aY are negative, the results are implementation defined.
 *   Consider these invalid.
 * Undefined for aY=0.
 * The result will never exceed either aX or aY.
 *
 * Checking that aX>=0 is a warning when T is unsigned.
 */

template<typename T>
struct IsModValidImpl<T, false>
{
  
};

template<typename T>
struct IsModValidImpl<T, true>
{
  
};

template<typename T, bool IsSigned = IsSigned<T>::value>
struct NegateImpl;

template<typename T>
struct NegateImpl<T, false>
{
  
};

template<typename T>
struct NegateImpl<T, true>
{
  
};

} // namespace detail


/*
 * Step 3: Now define the CheckedInt class.
 */

/**
 * @class CheckedInt
 * @brief Integer wrapper class checking for integer overflow and other errors
 * @param T the integer type to wrap. Can be any type among the following:
 *            - any basic integer type such as |int|
 *            - any stdint type such as |int8_t|
 *
 * This class implements guarded integer arithmetic. Do a computation, check
 * that isValid() returns true, you then have a guarantee that no problem, such
     } else {
       return false;
     }
   }
   @endcode
 *
   @code
   typedef CheckedInt<int32_t> CheckedInt32;
   typedef CheckedInt<uint16_t> CheckedUint16;
   @endcode
 */
template<typename T>
class CheckedInt
{
protected:
  T mValue;
  bool mIsValid;

  template<typename U>
  CheckedInt(U aValue, bool aIsValid) : mValue(aValue), mIsValid(aIsValid)
  {
    static_assert(detail::IsSupported<T>::value &&
                  detail::IsSupported<U>::value,
                  "This type is not supported by CheckedInt");
  }

  friend struct detail::NegateImpl<T>;

public:
  /**
   * Constructs a checked integer with given @a value. The checked integer is
   * initialized as valid or invalid depending on whether the @a value
   * is in range.
   *
   * This constructor is not explicit. Instead, the type of its argument is a
   * separate template parameter, ensuring that no conversion is performed
   * before this constructor is actually called. As explained in the above
   * documentation for class CheckedInt, this constructor checks that its
   * argument is valid.
   */
  template<typename U>
  CheckedInt(U aValue) MOZ_NO_ARITHMETIC_EXPR_IN_ARGUMENT
    : mValue(T(aValue)),
      mIsValid(detail::IsInRange<T>(aValue))
  {
    static_assert(detail::IsSupported<T>::value &&
                  detail::IsSupported<U>::value,
                  "This type is not supported by CheckedInt");
  }

  template<typename U>
  friend class CheckedInt;

  

  /** Constructs a valid checked integer with initial value 0 */
  

  /** @returns the actual value */
  T value() const
  {
    MOZ_ASSERT(mIsValid, "Invalid checked integer (division by zero or integer overflow)");
    return mValue;
  }

  /**
   * @returns true if the checked integer is valid, i.e. is not the result
   * of an invalid operation or of an operation involving an invalid checked
   * integer
   */
  bool isValid() const
  {
    return mIsValid;
  }

  template<typename U>
  friend CheckedInt<U> operator +(const CheckedInt<U>& aLhs,
                                  const CheckedInt<U>& aRhs);
  template<typename U>
  CheckedInt& operator +=(U aRhs);
  CheckedInt& operator +=(const CheckedInt<T>& aRhs);

  template<typename U>
  friend CheckedInt<U> operator -(const CheckedInt<U>& aLhs,
                                  const CheckedInt<U>& aRhs);
  template<typename U>
  CheckedInt& operator -=(U aRhs);
  CheckedInt& operator -=(const CheckedInt<T>& aRhs);

  template<typename U>
  friend CheckedInt<U> operator *(const CheckedInt<U>& aLhs,
                                  const CheckedInt<U>& aRhs);
  template<typename U>
  CheckedInt& operator *=(U aRhs);
  CheckedInt& operator *=(const CheckedInt<T>& aRhs);

  template<typename U>
  friend CheckedInt<U> operator /(const CheckedInt<U>& aLhs,
                                  const CheckedInt<U>& aRhs);
  template<typename U>
  CheckedInt& operator /=(U aRhs);
  CheckedInt& operator /=(const CheckedInt<T>& aRhs);

  template<typename U>
  friend CheckedInt<U> operator %(const CheckedInt<U>& aLhs,
                                  const CheckedInt<U>& aRhs);
  template<typename U>
  CheckedInt& operator %=(U aRhs);
  CheckedInt& operator %=(const CheckedInt<T>& aRhs);

  CheckedInt operator -() const
  {
    return detail::NegateImpl<T>::negate(*this);
  }

  /**
   * @returns true if the left and right hand sides are valid
   * and have the same value.
   *
   * Note that these semantics are the reason why we don't offer
   * a operator!=. Indeed, we'd want to have a!=b be equivalent to !(a==b)
   * but that would mean that whenever a or b is invalid, a!=b
   * is always true, which would be very confusing.
   *
   * For similar reasons, operators <, >, <=, >= would be very tricky to
   * specify, so we just avoid offering them.
   *
   * Notice that these == semantics are made more reasonable by these facts:
   *  1. a==b implies equality at the raw data level
   *     (the converse is false, as a==b is never true among invalids)
  CheckedInt operator--(int)
  {
    CheckedInt tmp = *this;
    *this -= 1;
    return tmp;
  }

private:
  /**
   * The !=, <, <=, >, >= operators are disabled:
   * see the comment on operator==.
   */
  template<typename U> bool operator !=(U aOther) const = delete;
  template<typename U> bool operator < (U aOther) const = delete;
  template<typename U> bool operator <=(U aOther) const = delete;
  template<typename U> bool operator > (U aOther) const = delete;
  template<typename U> bool operator >=(U aOther) const = delete;
};

#define MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(NAME, OP)                        \
  template<typename T>                                                        \
  inline CheckedInt<T>                                                        \
  operator OP(const CheckedInt<T>& aLhs, const CheckedInt<T>& aRhs)           \
  {                                                                           \
    if (!detail::Is##NAME##Valid(aLhs.mValue, aRhs.mValue)) {                 \
      return CheckedInt<T>(0, false);                                         \
    }                                                                         \
    return CheckedInt<T>(aLhs.mValue OP aRhs.mValue,                          \
                         aLhs.mIsValid && aRhs.mIsValid);                     \
  }

MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Add, +)
MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Sub, -)
MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mul, *)
MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Div, /)
MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR(Mod, %)

#undef MOZ_CHECKEDINT_BASIC_BINARY_OPERATOR

// Implement castToCheckedInt<T>(x), making sure that
//  - it allows x to be either a CheckedInt<T> or any integer type
//    that can be casted to T
//  - if x is already a CheckedInt<T>, we just return a reference to it,
//    instead of copying it (optimization)

namespace detail {

template<typename T, typename U>
struct CastToCheckedIntImpl
{
  typedef CheckedInt<T> ReturnType;
  static CheckedInt<T> run(U aU) { return aU; }
};

template<typename T>
struct CastToCheckedIntImpl<T, CheckedInt<T> >
{
  typedef const CheckedInt<T>& ReturnType;
  static const CheckedInt<T>& run(const CheckedInt<T>& aU) { return aU; }
};

} // namespace detail

template<typename T, typename U>
inline typename detail::CastToCheckedIntImpl<T, U>::ReturnType
castToCheckedInt(U aU)
{
  static_assert(detail::IsSupported<T>::value &&
                detail::IsSupported<U>::value,
                "This type is not supported by CheckedInt");
  return detail::CastToCheckedIntImpl<T, U>::run(aU);
}

#define MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(OP, COMPOUND_OP)            \
  template<typename T>                                                          \
  template<typename U>                                                          \
  CheckedInt<T>& CheckedInt<T>::operator COMPOUND_OP(U aRhs)                    \
  {                                                                             \
    *this = *this OP castToCheckedInt<T>(aRhs);                                 \
    return *this;                                                               \
  }                                                                             \
  template<typename T>                                                          \
  CheckedInt<T>& CheckedInt<T>::operator COMPOUND_OP(const CheckedInt<T>& aRhs) \
  {                                                                             \
    *this = *this OP aRhs;                                                      \
    return *this;                                                               \
  }                                                                             \
  template<typename T, typename U>                                              \
  inline CheckedInt<T> operator OP(const CheckedInt<T>& aLhs, U aRhs)           \
  {                                                                             \
    return aLhs OP castToCheckedInt<T>(aRhs);                                   \
  }                                                                             \
  template<typename T, typename U>                                              \
  inline CheckedInt<T> operator OP(U aLhs, const CheckedInt<T>& aRhs)           \
  {                                                                             \
    return castToCheckedInt<T>(aLhs) OP aRhs;                                   \
  }

MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(+, +=)
MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(*, *=)
MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(-, -=)
MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(/, /=)
MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS(%, %=)

#undef MOZ_CHECKEDINT_CONVENIENCE_BINARY_OPERATORS

template<typename T, typename U>
inline bool
operator ==(const CheckedInt<T>& aLhs, U aRhs)
{
  return aLhs == castToCheckedInt<T>(aRhs);
}



// Convenience typedefs.
typedef CheckedInt<int8_t>   CheckedInt8;
typedef CheckedInt<uint8_t>  CheckedUint8;
typedef CheckedInt<int16_t>  CheckedInt16;
typedef CheckedInt<uint16_t> CheckedUint16;
typedef CheckedInt<int32_t>  CheckedInt32;
typedef CheckedInt<uint32_t> CheckedUint32;
typedef CheckedInt<int64_t>  CheckedInt64;
typedef CheckedInt<uint64_t> CheckedUint64;

} // namespace mozilla

#endif /* mozilla_CheckedInt_h */
# 792 "../../dist/include/mozilla/CheckedInt.h"
# 10 "../../dist/include/mozilla/gfx/Tools.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Move.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* C++11-style, but C++98-usable, "move references" implementation. */

#ifndef mozilla_Move_h
#define mozilla_Move_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/Move.h"

namespace mozilla {

/*
 * "Move" References
 *
 * into 'x', but copy 'yy' into 'y'.
 *
 * This header file defines Move and Forward in the mozilla namespace. It's up
 *      C(s.x, 0); // BAD: s.x is a reference to a bit-field, can't form those
 *      int tmp = s.x;
 *      C(tmp, 0); // OK: tmp not a bit-field
 */

/**
 * Identical to std::Move(); this is necessary until our stlport supports
 * std::move().
 */
template<typename T>
inline typename RemoveReference<T>::Type&&
Move(T&& aX)
{
  return static_cast<typename RemoveReference<T>::Type&&>(aX);
}

/**
 * These two overloads are identical to std::forward(); they are necessary until
 * our stlport supports std::forward().
 */
template<typename T>
inline T&&
Forward(typename RemoveReference<T>::Type& aX)
{
  return static_cast<T&&>(aX);
}



/** Swap |aX| and |aY| using move-construction if possible. */
template<typename T>
inline void
Swap(T& aX, T& aY)
{
  T tmp(Move(aX));
  aX = Move(aY);
  aY = Move(tmp);
}

} // namespace mozilla

#endif /* mozilla_Move_h */
# 239 "../../dist/include/mozilla/Move.h"
# 11 "../../dist/include/mozilla/gfx/Tools.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/gfx/Tools.h"

namespace mozilla {
namespace gfx {



template <class T>
struct ClassStorage
{
  char bytes[sizeof(T)];

  
  
};











template<typename T, int alignment = 16>
struct AlignedArray
{
  typedef T value_type;

  

  

  MOZ_ALWAYS_INLINE ~AlignedArray()
  {
    Dealloc();
  }

  void Dealloc()
  {
    // If we fail this assert we'll need to uncomment the loop below to make
    // sure dtors are properly invoked. If we do that, we should check that the
    // comment about compiler dead code elimination is in fact true for all the
    // compilers that we care about.
    static_assert(mozilla::IsPod<T>::value,
                  "Destructors must be invoked for this type");
#if 0
    for (size_t i = 0; i < mCount; ++i) {
      // Since we used the placement |operator new| function to construct the
      // elements of this array we need to invoke their destructors manually.
      // For types where the destructor does nothing the compiler's dead code
      // elimination step should optimize this loop away.
      mPtr[i].~T();
    }
#endif
# 136 "../../dist/include/mozilla/gfx/Tools.h"

    moz_free(mStorage);
    mStorage = nullptr;
    mPtr = nullptr;
  }

  MOZ_ALWAYS_INLINE void Realloc(size_t aCount, bool aZero = false)
  {
    moz_free(mStorage);
    CheckedInt32 storageByteCount =
      CheckedInt32(sizeof(T)) * aCount + (alignment - 1);
    if (!storageByteCount.isValid()) {
      mStorage = nullptr;
      mPtr = nullptr;
      mCount = 0;
      return;
    }
    // We don't create an array of T here, since we don't want ctors to be
    // invoked at the wrong places if we realign below.
    if (aZero) {
      // calloc can be more efficient than new[] for large chunks,
      // so we use calloc/malloc/free for everything.
      mStorage = static_cast<uint8_t *>(moz_calloc(1, storageByteCount.value()));
    } else {
      mStorage = static_cast<uint8_t *>(moz_malloc(storageByteCount.value()));
    }
    if (!mStorage) {
      mStorage = nullptr;
      mPtr = nullptr;
      mCount = 0;
      return;
    }
    if (uintptr_t(mStorage) % alignment) {
      // Our storage does not start at a <alignment>-byte boundary. Make sure mPtr does!
      mPtr = (T*)(uintptr_t(mStorage) + alignment - (uintptr_t(mStorage) % alignment));
    } else {
      mPtr = (T*)(mStorage);
    }
    // Now that mPtr is pointing to the aligned position we can use placement
    // |operator new| to invoke any ctors at the correct positions. For types
    // that have a no-op default constructor the compiler's dead code
    // elimination step should optimize this away.
    mPtr = new (mPtr) T[aCount];
    mCount = aCount;
  }

  

  MOZ_ALWAYS_INLINE operator T*()
  {
    return mPtr;
  }

  T *mPtr;

private:
  uint8_t *mStorage;
  size_t mCount;
};

/**
 * Returns aStride increased, if necessary, so that it divides exactly into
 * |alignment|.
 *
 * Note that currently |alignment| must be a power-of-2. If for some reason we
 * want to support NPOT alignment we can revert back to this functions old
 * implementation.
 */


}
}

#endif /* MOZILLA_GFX_TOOLS_H_ */
# 222 "../../dist/include/mozilla/gfx/Tools.h"
# 13 "../../dist/include/mozilla/gfx/Rect.h" 2

#if 0 /* expanded by -frewrite-includes */
#include <cmath>
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/gfx/Rect.h"

namespace mozilla {

template <typename> struct IsPixel;

namespace gfx {

template<class units>
struct IntMarginTyped:
    public BaseMargin<int32_t, IntMarginTyped<units> >,
    public units {
    static_assert(IsPixel<units>::value,
                  "'units' must be a coordinate system tag");

    typedef BaseMargin<int32_t, IntMarginTyped<units> > Super;

    
    
};
typedef IntMarginTyped<UnknownUnits> IntMargin;

template<class units>
struct MarginTyped:
    public BaseMargin<Float, MarginTyped<units> >,
    public units {
    static_assert(IsPixel<units>::value,
                  "'units' must be a coordinate system tag");

    typedef BaseMargin<Float, MarginTyped<units> > Super;

    
    MarginTyped(Float aTop, Float aRight, Float aBottom, Float aLeft) :
        Super(aTop, aRight, aBottom, aLeft) {}
    
};
typedef MarginTyped<UnknownUnits> Margin;



template<class units>
struct IntRectTyped :
    public BaseRect<int32_t, IntRectTyped<units>, IntPointTyped<units>, IntSizeTyped<units>, IntMarginTyped<units> >,
    public units {
    static_assert(IsPixel<units>::value,
                  "'units' must be a coordinate system tag");

    typedef BaseRect<int32_t, IntRectTyped<units>, IntPointTyped<units>, IntSizeTyped<units>, IntMarginTyped<units> > Super;

    IntRectTyped() : Super() {}
    
    IntRectTyped(int32_t _x, int32_t _y, int32_t _width, int32_t _height) :
        Super(_x, _y, _width, _height) {}

    // Rounding isn't meaningful on an integer rectangle.
    
    
    

    // XXX When all of the code is ported, the following functions to convert to and from
    // unknown types should be removed.

    

    

    
};
typedef IntRectTyped<UnknownUnits> IntRect;

template<class units>
struct RectTyped :
    public BaseRect<Float, RectTyped<units>, PointTyped<units>, SizeTyped<units>, MarginTyped<units> >,
    public units {
    static_assert(IsPixel<units>::value,
                  "'units' must be a coordinate system tag");

    typedef BaseRect<Float, RectTyped<units>, PointTyped<units>, SizeTyped<units>, MarginTyped<units> > Super;

    RectTyped() : Super() {}
    RectTyped(const PointTyped<units>& aPos, const SizeTyped<units>& aSize) :
        Super(aPos, aSize) {}
    RectTyped(Float _x, Float _y, Float _width, Float _height) :
        Super(_x, _y, _width, _height) {}
    explicit RectTyped(const IntRectTyped<units>& rect) :
        Super(float(rect.x), float(rect.y),
              float(rect.width), float(rect.height)) {}

    

    bool ToIntRect(IntRectTyped<units> *aOut) const
    {
      *aOut = IntRectTyped<units>(int32_t(this->X()), int32_t(this->Y()),
                                  int32_t(this->Width()), int32_t(this->Height()));
      return RectTyped<units>(Float(aOut->x), Float(aOut->y), 
                              Float(aOut->width), Float(aOut->height))
             .IsEqualEdges(*this);
    }

    // XXX When all of the code is ported, the following functions to convert to and from
    // unknown types should be removed.

    

    

    // This is here only to keep IPDL-generated code happy. DO NOT USE.
    
};
typedef RectTyped<UnknownUnits> Rect;

template<class units>
IntRectTyped<units> RoundedToInt(const RectTyped<units>& aRect)
{
  return IntRectTyped<units>(int32_t(floorf(aRect.x + 0.5f)),
                             int32_t(floorf(aRect.y + 0.5f)),
                             int32_t(floorf(aRect.width + 0.5f)),
                             int32_t(floorf(aRect.height + 0.5f)));
}





}
}

#endif /* MOZILLA_GFX_RECT_H_ */
# 194 "../../dist/include/mozilla/gfx/Rect.h"
# 12 "../../dist/include/mozilla/gfx/2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "Matrix.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/Matrix.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_MATRIX_H_
#define MOZILLA_GFX_MATRIX_H_

#if 0 /* expanded by -frewrite-includes */
#include "Types.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/Matrix.h"
#if 0 /* expanded by -frewrite-includes */
#include "Rect.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/gfx/Matrix.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/DebugOnly.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Provides DebugOnly, a type for variables used only in debug builds (i.e. by
 * assertions).
 */

#ifndef mozilla_DebugOnly_h
#define mozilla_DebugOnly_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/DebugOnly.h"

namespace mozilla {

/**
 * DebugOnly contains a value of type T, but only in debug builds.  In release
 * builds, it does not contain a value.  This helper is intended to be used with
 * MOZ_ASSERT()-style macros, allowing one to write:
 *
 *   DebugOnly<bool> check = func();
 *   MOZ_ASSERT(check);
 *
 * more concisely than declaring |check| conditional on #ifdef DEBUG, but also
 * without allocating storage space for |check| in release builds.
 *
 * DebugOnly instances can only be coerced to T in debug builds.  In release
 * builds they don't have a value, so type coercion is not well defined.
 *
 * Note that DebugOnly instances still take up one byte of space, plus padding,
 * when used as members of structs.
 */
template<typename T>
class DebugOnly
{
public:
#ifdef DEBUG
  T value;

  DebugOnly() { }
  MOZ_IMPLICIT DebugOnly(const T& aOther) : value(aOther) { }
  DebugOnly(const DebugOnly& aOther) : value(aOther.value) { }
  DebugOnly& operator=(const T& aRhs) {
    value = aRhs;
    return *this;
  }

  void operator++(int) { value++; }
  void operator--(int) { value--; }

  // Do not define operator+=() or operator-=() here.  These will coerce via
  // the implicit cast and built-in operators.  Defining explicit methods here
  // will create ambiguity the compiler can't deal with.

  T* operator&() { return &value; }

  operator T&() { return value; }
  operator const T&() const { return value; }

  T& operator->() { return value; }
  const T& operator->() const { return value; }

#else
# 67 "../../dist/include/mozilla/DebugOnly.h"
  
  MOZ_IMPLICIT DebugOnly(const T&) { }
  DebugOnly(const DebugOnly&) { }
  DebugOnly& operator=(const T&) { return *this; }
  
  
  
  
#endif
# 76 "../../dist/include/mozilla/DebugOnly.h"

  /*
   * DebugOnly must always have a destructor or else it will
   * generate "unused variable" warnings, exactly what it's intended
   * to avoid!
   */
  ~DebugOnly() {}
};

}

#endif /* mozilla_DebugOnly_h */
# 88 "../../dist/include/mozilla/DebugOnly.h"
# 16 "../../dist/include/mozilla/gfx/Matrix.h" 2

namespace mozilla {
namespace gfx {



class Matrix
{
public:
  Matrix()
    : _11(1.0f), _12(0)
    , _21(0), _22(1.0f)
    , _31(0), _32(0)
  {}
  Matrix(Float a11, Float a12, Float a21, Float a22, Float a31, Float a32)
    : _11(a11), _12(a12)
    , _21(a21), _22(a22)
    , _31(a31), _32(a32)
  {}
  Float _11, _12;
  Float _21, _22;
  Float _31, _32;

  MOZ_ALWAYS_INLINE Matrix Copy() const
  {
    return Matrix(*this);
  }

  ;

  Point operator *(const Point &aPoint) const
  {
    Point retPoint;

    retPoint.x = aPoint.x * _11 + aPoint.y * _21 + _31;
    retPoint.y = aPoint.x * _12 + aPoint.y * _22 + _32;

    return retPoint;
  }

  

  GFX2D_API Rect TransformBounds(const Rect& rect) const;

  

  

  /**
   * Apply a translation to this matrix.
   *
   * The "Pre" in this method's name means that the translation is applied
   * -before- this matrix's existing transformation. That is, any vector that
   * is multiplied by the resulting matrix will first be translated, then be
   * transformed by the original transform.
   *
   * Calling this method will result in this matrix having the same value as
   * the result of:
   *
   *   Matrix::Translation(x, y) * this
   *
   * (Note that in performance critical code multiplying by the result of a
   * Translation()/Scaling() call is not recommended since that results in a
   * full matrix multiply involving 12 floating-point multiplications. Calling
   * this method would be preferred since it only involves four floating-point
   * multiplications.)
   */
  Matrix &PreTranslate(Float aX, Float aY)
  {
    _31 += _11 * aX + _21 * aY;
    _32 += _12 * aX + _22 * aY;

    return *this;
  }

  Matrix &PreTranslate(const Point &aPoint)
  {
    return PreTranslate(aPoint.x, aPoint.y);
  }

  /**
   * Similar to PreTranslate, but the translation is applied -after- this
   * matrix's existing transformation instead of before it.
   *
   * This method is generally less used than PreTranslate since typically code
   * want to adjust an existing user space to device space matrix to create a
   * transform to device space from a -new- user space (translated from the
   * previous user space). In that case consumers will need to use the Pre*
   * variants of the matrix methods rather than using the Post* methods, since
   * the Post* methods add a transform to the device space end of the
   * transformation.
   */
  Matrix &PostTranslate(Float aX, Float aY)
  {
    _31 += aX;
    _32 += aY;
    return *this;
  }

  Matrix &PostTranslate(const Point &aPoint)
  {
    return PostTranslate(aPoint.x, aPoint.y);
  }

  
  
  /**
   * Similar to PreTranslate, but applies a scale instead of a translation.
   */
  
  
  GFX2D_API static Matrix Rotation(Float aAngle);

  /**
   * Similar to PreTranslate, but applies a rotation instead of a translation.
   */
  Matrix &PreRotate(Float aAngle)
  {
    return *this = Matrix::Rotation(aAngle) * *this;
  }

  bool Invert()
  {
    // Compute co-factors.
    Float A = _22;
    Float B = -_21;
    Float C = _21 * _32 - _22 * _31;
    Float D = -_12;
    Float E = _11;
    Float F = _31 * _12 - _11 * _32;

    Float det = Determinant();

    if (!det) {
      return false;
    }

    Float inv_det = 1 / det;

    _11 = inv_det * A;
    _12 = inv_det * D;
    _21 = inv_det * B;
    _22 = inv_det * E;
    _31 = inv_det * C;
    _32 = inv_det * F;

    return true;
  }

  

  Float Determinant() const
  {
    return _11 * _22 - _12 * _21;
  }

  Matrix operator*(const Matrix &aMatrix) const
  {
    Matrix resultMatrix;

    resultMatrix._11 = this->_11 * aMatrix._11 + this->_12 * aMatrix._21;
    resultMatrix._12 = this->_11 * aMatrix._12 + this->_12 * aMatrix._22;
    resultMatrix._21 = this->_21 * aMatrix._11 + this->_22 * aMatrix._21;
    resultMatrix._22 = this->_21 * aMatrix._12 + this->_22 * aMatrix._22;
    resultMatrix._31 = this->_31 * aMatrix._11 + this->_32 * aMatrix._21 + aMatrix._31;
    resultMatrix._32 = this->_31 * aMatrix._12 + this->_32 * aMatrix._22 + aMatrix._32;

    return resultMatrix;
  }

  

  /**
   * Multiplies in the opposite order to operator=*.
   */
  

  /* Returns true if the other matrix is fuzzy-equal to this matrix.
   * Note that this isn't a cheap comparison!
   */
  

  

  /* Returns true if the matrix is a rectilinear transformation (i.e.
   * grid-aligned rectangles are transformed to grid-aligned rectangles)
   */
  

  /**
   * Returns true if the matrix is anything other than a straight
  /**
   * Returns true if the matrix has any transform other
   * than a translation or scale; this is, if there is
   * no rotation.
   */
  
};

class Matrix4x4
{
public:
  

  

  
  ;
};

class Matrix5x4
{
public:
  Matrix5x4()
    : _11(1.0f), _12(0), _13(0), _14(0)
    , _21(0), _22(1.0f), _23(0), _24(0)
    , _31(0), _32(0), _33(1.0f), _34(0)
    , _41(0), _42(0), _43(0), _44(1.0f)
    , _51(0), _52(0), _53(0), _54(0)
  {}
  

  

  

  Matrix5x4 operator*(const Matrix5x4 &aMatrix) const
  {
    Matrix5x4 resultMatrix;

    resultMatrix._11 = this->_11 * aMatrix._11 + this->_12 * aMatrix._21 + this->_13 * aMatrix._31 + this->_14 * aMatrix._41;
    resultMatrix._12 = this->_11 * aMatrix._12 + this->_12 * aMatrix._22 + this->_13 * aMatrix._32 + this->_14 * aMatrix._42;
    resultMatrix._13 = this->_11 * aMatrix._13 + this->_12 * aMatrix._23 + this->_13 * aMatrix._33 + this->_14 * aMatrix._43;
    resultMatrix._14 = this->_11 * aMatrix._14 + this->_12 * aMatrix._24 + this->_13 * aMatrix._34 + this->_14 * aMatrix._44;
    resultMatrix._21 = this->_21 * aMatrix._11 + this->_22 * aMatrix._21 + this->_23 * aMatrix._31 + this->_24 * aMatrix._41;
    resultMatrix._22 = this->_21 * aMatrix._12 + this->_22 * aMatrix._22 + this->_23 * aMatrix._32 + this->_24 * aMatrix._42;
    resultMatrix._23 = this->_21 * aMatrix._13 + this->_22 * aMatrix._23 + this->_23 * aMatrix._33 + this->_24 * aMatrix._43;
    resultMatrix._24 = this->_21 * aMatrix._14 + this->_22 * aMatrix._24 + this->_23 * aMatrix._34 + this->_24 * aMatrix._44;
    resultMatrix._31 = this->_31 * aMatrix._11 + this->_32 * aMatrix._21 + this->_33 * aMatrix._31 + this->_34 * aMatrix._41;
    resultMatrix._32 = this->_31 * aMatrix._12 + this->_32 * aMatrix._22 + this->_33 * aMatrix._32 + this->_34 * aMatrix._42;
    resultMatrix._33 = this->_31 * aMatrix._13 + this->_32 * aMatrix._23 + this->_33 * aMatrix._33 + this->_34 * aMatrix._43;
    resultMatrix._34 = this->_31 * aMatrix._14 + this->_32 * aMatrix._24 + this->_33 * aMatrix._34 + this->_34 * aMatrix._44;
    resultMatrix._41 = this->_41 * aMatrix._11 + this->_42 * aMatrix._21 + this->_43 * aMatrix._31 + this->_44 * aMatrix._41;
    resultMatrix._42 = this->_41 * aMatrix._12 + this->_42 * aMatrix._22 + this->_43 * aMatrix._32 + this->_44 * aMatrix._42;
    resultMatrix._43 = this->_41 * aMatrix._13 + this->_42 * aMatrix._23 + this->_43 * aMatrix._33 + this->_44 * aMatrix._43;
    resultMatrix._44 = this->_41 * aMatrix._14 + this->_42 * aMatrix._24 + this->_43 * aMatrix._34 + this->_44 * aMatrix._44;
    resultMatrix._51 = this->_51 * aMatrix._11 + this->_52 * aMatrix._21 + this->_53 * aMatrix._31 + this->_54 * aMatrix._41 + aMatrix._51;
    resultMatrix._52 = this->_51 * aMatrix._12 + this->_52 * aMatrix._22 + this->_53 * aMatrix._32 + this->_54 * aMatrix._42 + aMatrix._52;
    resultMatrix._53 = this->_51 * aMatrix._13 + this->_52 * aMatrix._23 + this->_53 * aMatrix._33 + this->_54 * aMatrix._43 + aMatrix._53;
    resultMatrix._54 = this->_51 * aMatrix._14 + this->_52 * aMatrix._24 + this->_53 * aMatrix._34 + this->_54 * aMatrix._44 + aMatrix._54;

    return resultMatrix;
  }

  

  Float _11, _12, _13, _14;
  Float _21, _22, _23, _24;
  Float _31, _32, _33, _34;
  Float _41, _42, _43, _44;
  Float _51, _52, _53, _54;
};

}
}

#endif /* MOZILLA_GFX_MATRIX_H_ */
# 960 "../../dist/include/mozilla/gfx/Matrix.h"
# 13 "../../dist/include/mozilla/gfx/2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "UserData.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/UserData.h" 1
/* -*- Mode: c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_USERDATA_H_
#define MOZILLA_GFX_USERDATA_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/UserData.h"
#if 0 /* expanded by -frewrite-includes */
#include "Types.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/gfx/UserData.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/gfx/UserData.h"

namespace mozilla {
namespace gfx {

struct UserDataKey {
  int unused;
};

/* this class is basically a clone of the user data concept from cairo */
class UserData
{
  typedef void (*destroyFunc)(void *data);
public:
  

  /* Attaches untyped userData associated with key. destroy is called on destruction */
  void Add(UserDataKey *key, void *userData, destroyFunc destroy)
  {
    for (int i=0; i<count; i++) {
      if (key == entries[i].key) {
        if (entries[i].destroy) {
          entries[i].destroy(entries[i].userData);
        }
        entries[i].userData = userData;
        entries[i].destroy = destroy;
        return;
      }
    }

    // We could keep entries in a std::vector instead of managing it by hand
    // but that would propagate an stl dependency out which we'd rather not
    // do (see bug 666609). Plus, the entries array is expect to stay small
    // so doing a realloc everytime we add a new entry shouldn't be too costly
    entries = static_cast<Entry*>(realloc(entries, sizeof(Entry)*(count+1)));

    if (!entries) {
      MOZ_CRASH();
    }

    entries[count].key      = key;
    entries[count].userData = userData;
    entries[count].destroy  = destroy;

    count++;
  }

  /* Remove and return user data associated with key, without destroying it */
  void* Remove(UserDataKey *key)
  {
    for (int i=0; i<count; i++) {
      if (key == entries[i].key) {
        void *userData = entries[i].userData;
        // decrement before looping so entries[i+1] doesn't read past the end:
        --count;
        for (;i<count; i++) {
          entries[i] = entries[i+1];
        }
        return userData;
      }
    }
    return nullptr;
  }

  /* Retrives the userData for the associated key */
  void *Get(UserDataKey *key) const
  {
    for (int i=0; i<count; i++) {
      if (key == entries[i].key) {
        return entries[i].userData;
      }
    }
    return nullptr;
  }

  

  void Destroy()
  {
    for (int i=0; i<count; i++) {
      if (entries[i].destroy) {
        entries[i].destroy(entries[i].userData);
      }
    }
    free(entries);
    entries = nullptr;
    count = 0;
  }

  ~UserData()
  {
    Destroy();
  }

private:
  struct Entry {
    const UserDataKey *key;
    void *userData;
    destroyFunc destroy;
  };

  int count;
  Entry *entries;

};

}
}

#endif /* MOZILLA_GFX_USERDATA_H_ */
# 129 "../../dist/include/mozilla/gfx/UserData.h"
# 14 "../../dist/include/mozilla/gfx/2D.h" 2

// GenericRefCountedBase allows us to hold on to refcounted objects of any type
// (contrary to RefCounted<T> which requires knowing the type T) and, in particular,
// without having a dependency on that type. This is used for DrawTargetSkia
// to be able to hold on to a GLContext.
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/GenericRefCounted.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/GenericRefCounted.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// This header provides virtual, non-templated alternatives to MFBT's RefCounted<T>.
// It intentionally uses MFBT coding style with the intention of moving there
// should there be other use cases for it.

#ifndef MOZILLA_GENERICREFCOUNTED_H_
#define MOZILLA_GENERICREFCOUNTED_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/RefPtr.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Helpers for defining and using refcounted objects. */

#ifndef mozilla_RefPtr_h
#define mozilla_RefPtr_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/AlreadyAddRefed.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/AlreadyAddRefed.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Typed temporary pointers for reference-counted smart pointers. */

#ifndef AlreadyAddRefed_h
#define AlreadyAddRefed_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/AlreadyAddRefed.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/AlreadyAddRefed.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/AlreadyAddRefed.h"

namespace mozilla {

struct unused_t;

} // namespace mozilla

/**
 * already_AddRefed cooperates with reference counting smart pointers to enable
 * you to assign in a pointer _without_ |AddRef|ing it.  You might want to use
 * this as a return type from a function that returns an already |AddRef|ed
 * pointer.
 *
 * TODO Move already_AddRefed to namespace mozilla.  This has not yet been done
 * because of the sheer number of usages of already_AddRefed.
 */
template<class T>
struct already_AddRefed
{
  /*
   * We want to allow returning nullptr from functions returning
   * already_AddRefed<T>, for simplicity.  But we also don't want to allow
   * returning raw T*, instead preferring creation of already_AddRefed<T> from
   * a reference counting smart pointer.
   *
   * We address the latter requirement by making the (T*) constructor explicit.
   * But |return nullptr| won't consider an explicit constructor, so we need
   * another constructor to handle it.  Plain old (decltype(nullptr)) doesn't
   */
  

  // The return and argument types here are arbitrarily selected so no
  // corresponding member function exists.
  typedef void (already_AddRefed::* MatchNullptr)(double, float);
  MOZ_IMPLICIT already_AddRefed(MatchNullptr aRawPtr) : mRawPtr(nullptr) {}

  explicit already_AddRefed(T* aRawPtr) : mRawPtr(aRawPtr) {}

  // Disallowed. Use move semantics instead.
  already_AddRefed(const already_AddRefed<T>& aOther) = delete;

  already_AddRefed(already_AddRefed<T>&& aOther) : mRawPtr(aOther.take()) {}

  /**
   * This helper is useful in cases like
   *
   *  already_AddRefed<BaseClass>
   *  Foo()
   *  {
   *    nsRefPtr<SubClass> x = ...;
   *    return x.forget();
   *  }
   *
   * The autoconversion allows one to omit the idiom
   *
   *    nsRefPtr<BaseClass> y = x.forget();
   *    return y.forget();
   *
   * Note that nsRefPtr is the XPCOM reference counting smart pointer class.
   */
  MOZ_WARN_UNUSED_RESULT T* take()
  {
    T* rawPtr = mRawPtr;
    mRawPtr = nullptr;
    return rawPtr;
  }

  /**
   * This helper provides a static_cast replacement for already_AddRefed, so
   * if you have
   *
   *   already_AddRefed<Parent> F();
   *
   * you can write
   *
   *   already_AddRefed<Child>
   *   G()
   *   {
   *     return F().downcast<Child>();
   *   }
   */
  template<class U>
  already_AddRefed<U> downcast()
  {
    U* tmp = static_cast<U*>(mRawPtr);
    mRawPtr = nullptr;
    return already_AddRefed<U>(tmp);
  }

private:
  T* MOZ_OWNING_REF mRawPtr;
};

#endif // AlreadyAddRefed_h
# 141 "../../dist/include/mozilla/AlreadyAddRefed.h"
# 13 "../../dist/include/mozilla/RefPtr.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/RefPtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Atomics.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/RefPtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/RefPtr.h"
#if defined(MOZILLA_INTERNAL_API) && \
    (defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING))
#define MOZ_REFCOUNTED_LEAK_CHECKING
#endif
# 26 "../../dist/include/mozilla/RefPtr.h"

namespace mozilla {

template<typename T> class RefCounted;
template<typename T> class RefPtr;
template<typename T> class TemporaryRef;
template<typename T> class OutParamRef;
template<typename T> OutParamRef<T> byRef(RefPtr<T>&);

/**
 * RefCounted<T> is a sort of a "mixin" for a class T.  RefCounted
 * state distinguishes use-before-ref (refcount==0) from
 * use-after-destroy (refcount==0xffffdead).
 *
 * Note that when deriving from RefCounted or AtomicRefCounted, you
 * should add MOZ_DECLARE_REFCOUNTED_TYPENAME(ClassName) to the public
 * section of your class, where ClassName is the name of your class.
 */
namespace detail {
#ifdef DEBUG
const MozRefCountType DEAD = 0xffffdead;
#endif
# 64 "../../dist/include/mozilla/RefPtr.h"

// When building code that gets compiled into Gecko, try to use the
// trace-refcount leak logging facilities.
#ifdef MOZ_REFCOUNTED_LEAK_CHECKING
class RefCountLogger
{
public:
  static void logAddRef(const void* aPointer, MozRefCountType aRefCount,
                        const char* aTypeName, uint32_t aInstanceSize)
  {
    MOZ_ASSERT(aRefCount != DEAD);
    NS_LogAddRef(const_cast<void*>(aPointer), aRefCount, aTypeName,
                 aInstanceSize);
  }

  static void logRelease(const void* aPointer, MozRefCountType aRefCount,
                         const char* aTypeName)
  {
    MOZ_ASSERT(aRefCount != DEAD);
    NS_LogRelease(const_cast<void*>(aPointer), aRefCount, aTypeName);
  }
};
#endif
# 87 "../../dist/include/mozilla/RefPtr.h"

// This is used WeakPtr.h as well as this file.
enum RefCountAtomicity
{
  AtomicRefCount,
  NonAtomicRefCount
};

template<typename T, RefCountAtomicity Atomicity>
class RefCounted
{
  friend class RefPtr<T>;

protected:
  RefCounted() : mRefCnt(0) {}
  ~RefCounted() { MOZ_ASSERT(mRefCnt == detail::DEAD); }

public:
  // Compatibility with nsRefPtr.
  void AddRef() const
  {
    // Note: this method must be thread safe for AtomicRefCounted.
    MOZ_ASSERT(int32_t(mRefCnt) >= 0);
#ifndef MOZ_REFCOUNTED_LEAK_CHECKING
    ++mRefCnt;
#else
# 113 "../../dist/include/mozilla/RefPtr.h"
    const char* type = static_cast<const T*>(this)->typeName();
    uint32_t size = static_cast<const T*>(this)->typeSize();
    const void* ptr = static_cast<const T*>(this);
    MozRefCountType cnt = ++mRefCnt;
    detail::RefCountLogger::logAddRef(ptr, cnt, type, size);
#endif
# 119 "../../dist/include/mozilla/RefPtr.h"
  }

  void Release() const
  {
    // Note: this method must be thread safe for AtomicRefCounted.
    MOZ_ASSERT(int32_t(mRefCnt) > 0);
#ifndef MOZ_REFCOUNTED_LEAK_CHECKING
    MozRefCountType cnt = --mRefCnt;
#else
# 128 "../../dist/include/mozilla/RefPtr.h"
    const char* type = static_cast<const T*>(this)->typeName();
    const void* ptr = static_cast<const T*>(this);
    MozRefCountType cnt = --mRefCnt;
    // Note: it's not safe to touch |this| after decrementing the refcount,
    // except for below.
    detail::RefCountLogger::logRelease(ptr, cnt, type);
#endif
# 135 "../../dist/include/mozilla/RefPtr.h"
    if (0 == cnt) {
      // Because we have atomically decremented the refcount above, only
      // one thread can get a 0 count here, so as long as we can assume that
      // everything else in the system is accessing this object through
      // RefPtrs, it's safe to access |this| here.
#ifdef DEBUG
      mRefCnt = detail::DEAD;
#endif
# 143 "../../dist/include/mozilla/RefPtr.h"
      delete static_cast<const T*>(this);
    }
  }

  // Compatibility with wtf::RefPtr.
  void ref() { AddRef(); }
  
  
  

private:
  mutable typename Conditional<Atomicity == AtomicRefCount,
                               Atomic<MozRefCountType>,
                               MozRefCountType>::Type mRefCnt;
};

#ifdef MOZ_REFCOUNTED_LEAK_CHECKING
// Passing MOZ_OVERRIDE for the optional argument marks the typeName and
// typeSize functions defined by this macro as overrides.
#define MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(T, ...) \
  virtual const char* typeName() const __VA_ARGS__ { return #T; } \
  virtual size_t typeSize() const __VA_ARGS__ { return sizeof(*this); }
#else
# 170 "../../dist/include/mozilla/RefPtr.h"
#define MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(T, ...)
#endif
# 172 "../../dist/include/mozilla/RefPtr.h"

// Note that this macro is expanded unconditionally because it declares only
// two small inline functions which will hopefully get eliminated by the linker
// in non-leak-checking builds.
#define MOZ_DECLARE_REFCOUNTED_TYPENAME(T) \
  const char* typeName() const { return #T; } \
  size_t typeSize() const { return sizeof(*this); }

} // namespace detail

template<typename T>
class RefCounted : public detail::RefCounted<T, detail::NonAtomicRefCount>
{
public:
  ~RefCounted()
  {
    static_assert(IsBaseOf<RefCounted, T>::value,
                  "T must derive from RefCounted<T>");
  }
};

namespace external {

/**
 * AtomicRefCounted<T> is like RefCounted<T>, with an atomically updated
 * reference counter.
 *
 * NOTE: Please do not use this class, use NS_INLINE_DECL_THREADSAFE_REFCOUNTING
 * instead.
 */
template<typename T>
class AtomicRefCounted :
  public mozilla::detail::RefCounted<T, mozilla::detail::AtomicRefCount>
{
public:
  
};

} // namespace external

/**
 * RefPtr points to a refcounted thing that has AddRef and Release
 * methods to increase/decrease the refcount, respectively.  After a
 * RefPtr<T> is assigned a T*, the T* can be used through the RefPtr
 * as if it were a T*.
 *
 * A RefPtr can forget its underlying T*, which results in the T*
 * being wrapped in a temporary object until the T* is either
 * re-adopted from or released by the temporary.
 */
template<typename T>
class RefPtr
{
  // To allow them to use unref()
  friend class TemporaryRef<T>;
  friend class OutParamRef<T>;

  struct DontRef {};

public:
  RefPtr() : mPtr(0) {}
  RefPtr(const RefPtr& aOther) : mPtr(ref(aOther.mPtr)) {}
  MOZ_IMPLICIT RefPtr(const TemporaryRef<T>& aOther) : mPtr(aOther.take()) {}
  MOZ_IMPLICIT 
  MOZ_IMPLICIT RefPtr(T* aVal) : mPtr(ref(aVal)) {}

  

  ~RefPtr() { unref(mPtr); }

  RefPtr& operator=(const RefPtr& aOther)
  {
    assign(ref(aOther.mPtr));
    return *this;
  }
  RefPtr& operator=(const TemporaryRef<T>& aOther)
  {
    assign(aOther.take());
    return *this;
  }
  
  RefPtr& operator=(T* aVal)
  {
    assign(ref(aVal));
    return *this;
  }

  

  TemporaryRef<T> forget()
  {
    T* tmp = mPtr;
    mPtr = nullptr;
    return TemporaryRef<T>(tmp, DontRef());
  }

  T* get() const { return mPtr; }
  operator T*() const { return mPtr; }
  T* operator->() const MOZ_NO_ADDREF_RELEASE_ON_RETURN { return mPtr; }
  T& operator*() const { return *mPtr; }
  template<typename U>
  operator TemporaryRef<U>() { return TemporaryRef<U>(mPtr); }

private:
  void assign(T* aVal)
  {
    unref(mPtr);
    mPtr = aVal;
  }

  T* MOZ_OWNING_REF mPtr;

  static MOZ_ALWAYS_INLINE T* ref(T* aVal)
  {
    if (aVal) {
      aVal->AddRef();
    }
    return aVal;
  }

  static MOZ_ALWAYS_INLINE void unref(T* aVal)
  {
    if (aVal) {
      aVal->Release();
    }
  }
};

/**
 * TemporaryRef<T> represents an object that holds a temporary
 * reference to a T.  TemporaryRef objects can't be manually ref'd or
 * unref'd (being temporaries, not lvalues), so can only relinquish
 * references to other objects, or unref on destruction.
 */
template<typename T>
class TemporaryRef
{
  // To allow it to construct TemporaryRef from a bare T*
  friend class RefPtr<T>;

  typedef typename RefPtr<T>::DontRef DontRef;

public:
  MOZ_IMPLICIT TemporaryRef(T* aVal) : mPtr(RefPtr<T>::ref(aVal)) {}
  TemporaryRef(const TemporaryRef& aOther) : mPtr(aOther.take()) {}

  template<typename U>
  TemporaryRef(const TemporaryRef<U>& aOther) : mPtr(aOther.take()) {}

  ~TemporaryRef() { RefPtr<T>::unref(mPtr); }

  MOZ_WARN_UNUSED_RESULT T* take() const
  {
    T* tmp = mPtr;
    mPtr = nullptr;
    return tmp;
  }

private:
  TemporaryRef(T* aVal, const DontRef&) : mPtr(aVal) {}

  mutable T* MOZ_OWNING_REF mPtr;

  TemporaryRef() = delete;
  void operator=(const TemporaryRef&) = delete;
};

/**
 * OutParamRef is a wrapper that tracks a refcounted pointer passed as
 * an outparam argument to a function.  OutParamRef implements COM T**
 * outparam semantics: this requires the callee to AddRef() the T*
 * returned through the T** outparam on behalf of the caller.  This
 * means the caller (through OutParamRef) must Release() the old
 * object contained in the tracked RefPtr.  It's OK if the callee
 * returns the same T* passed to it through the T** outparam, as long
 * as the callee obeys the COM discipline.
 *
 * Prefer returning TemporaryRef<T> from functions over creating T**
 * outparams and passing OutParamRef<T> to T**.  Prefer RefPtr<T>*
 * outparams over T** outparams.
  explicit OutParamRef(RefPtr<T>& p) : mRefPtr(p), mTmp(p.get()) {}

  RefPtr<T>& mRefPtr;
  T* mTmp;

  OutParamRef() = delete;
  OutParamRef& operator=(const OutParamRef&) = delete;
};

/**
 * byRef cooperates with OutParamRef to implement COM outparam semantics.
 */
template<typename T>
OutParamRef<T>
byRef(RefPtr<T>& aPtr)
{
  return OutParamRef<T>(aPtr);
}

} // namespace mozilla

#endif /* mozilla_RefPtr_h */
# 404 "../../dist/include/mozilla/RefPtr.h"
# 14 "../../dist/include/mozilla/GenericRefCounted.h" 2

namespace mozilla {

/**
 * Common base class for GenericRefCounted and GenericAtomicRefCounted.
 *
 * Having this shared base class, common to both the atomic and non-atomic
 * cases, allows to have RefPtr's that don't care about whether the
 * objects they're managing have atomic refcounts or not.
 */
class GenericRefCountedBase
{
  protected:
    virtual ~GenericRefCountedBase() {};

  public:
    // AddRef() and Release() method names are for compatibility with nsRefPtr.
    virtual void AddRef() = 0;

    virtual void Release() = 0;

    // ref() and deref() method names are for compatibility with wtf::RefPtr.
    // No virtual keywords here: if a subclass wants to override the refcounting
    // mechanism, it is welcome to do so by overriding AddRef() and Release().
    void ref() { AddRef(); }
    void deref() { Release(); }

#ifdef MOZ_REFCOUNTED_LEAK_CHECKING
    virtual const char* typeName() const = 0;
    virtual size_t typeSize() const = 0;
#endif
# 45 "../../dist/include/mozilla/GenericRefCounted.h"
};

namespace detail {

template<RefCountAtomicity Atomicity>
class GenericRefCounted : public GenericRefCountedBase
{
  protected:
    GenericRefCounted() : refCnt(0) { }

    virtual ~GenericRefCounted() {
      MOZ_ASSERT(refCnt == detail::DEAD);
    }

  public:
    virtual void AddRef() MOZ_OVERRIDE {
      // Note: this method must be thread safe for GenericAtomicRefCounted.
      MOZ_ASSERT(int32_t(refCnt) >= 0);
#ifndef MOZ_REFCOUNTED_LEAK_CHECKING
      ++refCnt;
#else
# 66 "../../dist/include/mozilla/GenericRefCounted.h"
      const char* type = typeName();
      uint32_t size = typeSize();
      const void* ptr = this;
      MozRefCountType cnt = ++refCnt;
      detail::RefCountLogger::logAddRef(ptr, cnt, type, size);
#endif
# 72 "../../dist/include/mozilla/GenericRefCounted.h"
    }

    virtual void Release() MOZ_OVERRIDE {
      // Note: this method must be thread safe for GenericAtomicRefCounted.
      MOZ_ASSERT(int32_t(refCnt) > 0);
#ifndef MOZ_REFCOUNTED_LEAK_CHECKING
      MozRefCountType cnt = --refCnt;
#else
# 80 "../../dist/include/mozilla/GenericRefCounted.h"
      const char* type = typeName();
      const void* ptr = this;
      MozRefCountType cnt = --refCnt;
      // Note: it's not safe to touch |this| after decrementing the refcount,
      // except for below.
      detail::RefCountLogger::logRelease(ptr, cnt, type);
#endif
# 87 "../../dist/include/mozilla/GenericRefCounted.h"
      if (0 == cnt) {
        // Because we have atomically decremented the refcount above, only
        // one thread can get a 0 count here, so as long as we can assume that
        // everything else in the system is accessing this object through
        // RefPtrs, it's safe to access |this| here.
#ifdef DEBUG
        refCnt = detail::DEAD;
#endif
# 95 "../../dist/include/mozilla/GenericRefCounted.h"
        delete this;
      }
    }

    MozRefCountType refCount() const { return refCnt; }
    bool hasOneRef() const {
      MOZ_ASSERT(refCnt > 0);
      return refCnt == 1;
    }

  private:
    typename Conditional<Atomicity == AtomicRefCount, Atomic<MozRefCountType>, MozRefCountType>::Type refCnt;
};

} // namespace detail

/**
 * This reference-counting base class is virtual instead of
 * being templated, which is useful in cases where one needs
 * genericity at binary code level, but comes at the cost
 * of a moderate performance and size overhead, like anything virtual.
 */
class GenericRefCounted : public detail::GenericRefCounted<detail::NonAtomicRefCount>
{
};

/**
 * GenericAtomicRefCounted is like GenericRefCounted, with an atomically updated
 * reference counter.
 */
class GenericAtomicRefCounted : public detail::GenericRefCounted<detail::AtomicRefCount>
{
};

} // namespace mozilla

#endif
# 132 "../../dist/include/mozilla/GenericRefCounted.h"
# 20 "../../dist/include/mozilla/gfx/2D.h" 2

// This RefPtr class isn't ideal for usage in Azure, as it doesn't allow T**
struct IDWriteRenderingParams;

class GrContext;
struct GrGLInterface;

struct CGContext;
typedef struct CGContext *CGContextRef;

namespace mozilla {

namespace gfx {

class SourceSurface;
class DataSourceSurface;
class DrawTarget;
class DrawEventRecorder;
class FilterNode;
class LogForwarder;

struct NativeSurface {
  NativeSurfaceType mType;
  SurfaceFormat mFormat;
  gfx::IntSize mSize;
  void *mSurface;
};

struct NativeFont {
  NativeFontType mType;
  void *mFont;
};

/**
 * This structure is used to send draw options that are universal to all drawing
 * operations.
 */
struct DrawOptions {
  /// For constructor parameter description, see member data documentation.
  explicit DrawOptions(Float aAlpha = 1.0f,
                       CompositionOp aCompositionOp = CompositionOp::OP_OVER,
                       AntialiasMode aAntialiasMode = AntialiasMode::DEFAULT)
    : mAlpha(aAlpha)
    , mCompositionOp(aCompositionOp)
    , mAntialiasMode(aAntialiasMode)
  {}

  Float mAlpha;                 /**< Alpha value by which the mask generated by this
                                     operation is multiplied. */
  CompositionOp mCompositionOp; /**< The operator that indicates how the source and
                                     destination patterns are blended. */
  AntialiasMode mAntialiasMode; /**< The AntiAlias mode used for this drawing 
                                     operation. */
};

/**
 * This structure is used to send stroke options that are used in stroking
 * operations.
 */
struct StrokeOptions {
  /// For constructor parameter description, see member data documentation.
  explicit StrokeOptions(Float aLineWidth = 1.0f,
                         JoinStyle aLineJoin = JoinStyle::MITER_OR_BEVEL,
                         CapStyle aLineCap = CapStyle::BUTT,
                         Float aMiterLimit = 10.0f,
                         size_t aDashLength = 0,
                         const Float* aDashPattern = 0,
                         Float aDashOffset = 0.f)
    : mLineWidth(aLineWidth)
    , mMiterLimit(aMiterLimit)
    , mDashPattern(aDashLength > 0 ? aDashPattern : 0)
    , mDashLength(aDashLength)
    , mDashOffset(aDashOffset)
    , mLineJoin(aLineJoin)
    , mLineCap(aLineCap)
  {
    MOZ_ASSERT(aDashLength == 0 || aDashPattern);
  }

  Float mLineWidth;          //!< Width of the stroke in userspace.
  Float mMiterLimit;         //!< Miter limit in units of linewidth
  const Float* mDashPattern; /**< Series of on/off userspace lengths defining dash.
                                  Owned by the caller; must live at least as long as
                                  this StrokeOptions.
                                  mDashPattern != null <=> mDashLength > 0. */
  size_t mDashLength;        //!< Number of on/off lengths in mDashPattern.
  Float mDashOffset;         /**< Userspace offset within mDashPattern at which
                                  stroking begins. */
  JoinStyle mLineJoin;       //!< Join style used for joining lines.
  CapStyle mLineCap;         //!< Cap style used for capping lines.
};

/**
 * This structure supplies additional options for calls to DrawSurface.
 */
struct DrawSurfaceOptions {
  /// For constructor parameter description, see member data documentation.
  explicit DrawSurfaceOptions(Filter aFilter = Filter::LINEAR,
                              SamplingBounds aSamplingBounds = SamplingBounds::UNBOUNDED)
    : mFilter(aFilter)
    , mSamplingBounds(aSamplingBounds)
  { }

  Filter mFilter;                 /**< Filter used when resampling source surface
                                       region to the destination region. */
  SamplingBounds mSamplingBounds; /**< This indicates whether the implementation is
                                       allowed to sample pixels outside the source
                                       rectangle as specified in DrawSurface on
                                       the surface. */

};

/**
 * This class is used to store gradient stops, it can only be used with a
 * matching DrawTarget. Not adhering to this condition will make a draw call
 * fail.
 */
class GradientStops : public RefCounted<GradientStops>
{
public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GradientStops)
  virtual ~GradientStops() {}

  virtual BackendType GetBackendType() const = 0;
  virtual bool IsValid() const { return true; }

protected:
  GradientStops() {}
};

/**
 * This is the base class for 'patterns'. Patterns describe the pixels used as
 * the source for a masked composition operation that is done by the different
 * drawing commands. These objects are not backend specific, however for
 * example the gradient stops on a gradient pattern can be backend specific.
 */
class Pattern
{
public:
  virtual ~Pattern() {}

  virtual PatternType GetType() const = 0;

protected:
  Pattern() {}
};

class ColorPattern : public Pattern
{
public:
  // Explicit because consumers should generally use ToDeviceColor when
  // creating a ColorPattern.
  explicit ColorPattern(const Color &aColor)
    : mColor(aColor)
  {}

  virtual PatternType GetType() const MOZ_OVERRIDE
  {
    return PatternType::COLOR;
  }

  Color mColor;
};

/**
 * This class is used for Linear Gradient Patterns, the gradient stops are
 * stored in a separate object and are backend dependent. This class itself
 * may be used on the stack.
 */
class LinearGradientPattern : public Pattern
{
public:
  /// For constructor parameter description, see member data documentation.
  LinearGradientPattern(const Point &aBegin,
                        const Point &aEnd,
                        GradientStops *aStops,
                        const Matrix &aMatrix = Matrix())
    : mBegin(aBegin)
    , mEnd(aEnd)
    , mStops(aStops)
    , mMatrix(aMatrix)
  {
  }

  virtual PatternType GetType() const MOZ_OVERRIDE
  {
    return PatternType::LINEAR_GRADIENT;
  }

  Point mBegin;                 //!< Start of the linear gradient
  Point mEnd;                   /**< End of the linear gradient - NOTE: In the case
                                     of a zero length gradient it will act as the
                                     color of the last stop. */
  RefPtr<GradientStops> mStops; /**< GradientStops object for this gradient, this
                                     should match the backend type of the draw
                                     target this pattern will be used with. */
  Matrix mMatrix;               /**< A matrix that transforms the pattern into
                                     user space */
};

/**
 * This class is used for Radial Gradient Patterns, the gradient stops are
 * stored in a separate object and are backend dependent. This class itself
 * may be used on the stack.
 */
class RadialGradientPattern : public Pattern
{
public:
  /// For constructor parameter description, see member data documentation.
  RadialGradientPattern(const Point &aCenter1,
                        const Point &aCenter2,
                        Float aRadius1,
                        Float aRadius2,
                        GradientStops *aStops,
                        const Matrix &aMatrix = Matrix())
    : mCenter1(aCenter1)
    , mCenter2(aCenter2)
    , mRadius1(aRadius1)
    , mRadius2(aRadius2)
    , mStops(aStops)
    , mMatrix(aMatrix)
  {
  }

  virtual PatternType GetType() const MOZ_OVERRIDE
  {
    return PatternType::RADIAL_GRADIENT;
  }

  Point mCenter1; //!< Center of the inner (focal) circle.
  Point mCenter2; //!< Center of the outer circle.
  Float mRadius1; //!< Radius of the inner (focal) circle.
  Float mRadius2; //!< Radius of the outer circle.
  RefPtr<GradientStops> mStops; /**< GradientStops object for this gradient, this
                                     should match the backend type of the draw target
                                     this pattern will be used with. */
  Matrix mMatrix; //!< A matrix that transforms the pattern into user space
};

/**
 * This class is used for Surface Patterns, they wrap a surface and a
 * repetition mode for the surface. This may be used on the stack.
 */
class SurfacePattern : public Pattern
{
public:
  /// For constructor parameter description, see member data documentation.
  SurfacePattern(SourceSurface *aSourceSurface, ExtendMode aExtendMode,
                 const Matrix &aMatrix = Matrix(), Filter aFilter = Filter::GOOD,
                 const IntRect &aSamplingRect = IntRect())
    : mSurface(aSourceSurface)
    , mExtendMode(aExtendMode)
    , mFilter(aFilter)
    , mMatrix(aMatrix)
    , mSamplingRect(aSamplingRect)
  {}

  virtual PatternType GetType() const MOZ_OVERRIDE
  {
    return PatternType::SURFACE;
  }

  RefPtr<SourceSurface> mSurface; //!< Surface to use for drawing
  ExtendMode mExtendMode;         /**< This determines how the image is extended
                                       outside the bounds of the image */
  Filter mFilter;                 //!< Resampling filter for resampling the image.
  Matrix mMatrix;                 //!< Transforms the pattern into user space

  IntRect mSamplingRect;          /**< Rect that must not be sampled outside of,
                                       or an empty rect if none has been specified. */
};

class StoredPattern;
class DrawTargetCaptureImpl;

/**
 * This is the base class for source surfaces. These objects are surfaces
 * which may be used as a source in a SurfacePattern or a DrawSurface call.
 * They cannot be drawn to directly.
 */
class SourceSurface : public RefCounted<SourceSurface>
{
public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurface)
  virtual ~SourceSurface() {}

  ;
  virtual IntSize GetSize() const = 0;
  virtual SurfaceFormat GetFormat() const = 0;

  /** This returns false if some event has made this source surface invalid for
   * usage with current DrawTargets. For example in the case of Direct2D this
   * could return false if we have switched devices since this surface was
   * created.
   */
  virtual bool IsValid() const { return true; }

  /**
   * This function will get a DataSourceSurface for this surface, a
   * DataSourceSurface's data can be accessed directly.
   */
  virtual TemporaryRef<DataSourceSurface> GetDataSurface() = 0;

  /** Tries to get this SourceSurface's native surface.  This will fail if aType
   * is not the type of this SourceSurface's native surface.
   */
  virtual void *GetNativeSurface(NativeSurfaceType aType) {
    return nullptr;
  }

  
  

protected:
  friend class DrawTargetCaptureImpl;
  friend class StoredPattern;

  // This is for internal use, it ensures the SourceSurface's data remains
  // valid during the lifetime of the SourceSurface.
  // @todo XXX - We need something better here :(. But we may be able to get rid
  // of CreateWrappingDataSourceSurface in the future.
  virtual void GuaranteePersistance() {}

  UserData mUserData;
};

class DataSourceSurface : public SourceSurface
{
public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurface, MOZ_OVERRIDE)
  

#ifdef DEBUG
  virtual ~DataSourceSurface()
  {
    MOZ_ASSERT(!mIsMapped, "Someone forgot to call Unmap()");
  }
#endif
# 386 "../../dist/include/mozilla/gfx/2D.h"

  struct MappedSurface {
    uint8_t *mData;
    int32_t mStride;
  };

  enum MapType {
    READ,
    WRITE,
    READ_WRITE
  };

  
  /** @deprecated
   * Get the raw bitmap data of the surface.
   * Can return null if there was OOM allocating surface data.
   */
  virtual uint8_t *GetData() = 0;

  /** @deprecated
   * Stride of the surface, distance in bytes between the start of the image
   * data belonging to row y and row y+1. This may be negative.
   * Can return 0 if there was OOM allocating surface data.
   */
  virtual int32_t Stride() = 0;

  /**
   * The caller is responsible for ensuring aMappedSurface is not null.
   */
  

  

  /**
   * Returns a DataSourceSurface with the same data as this one, but
   * guaranteed to have surface->GetType() == SurfaceType::DATA.
   */
  virtual TemporaryRef<DataSourceSurface> GetDataSurface() MOZ_OVERRIDE;

protected:
  bool mIsMapped;
};

/** This is an abstract object that accepts path segments. */
class PathSink : public RefCounted<PathSink>
{
public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathSink)
  virtual ~PathSink() {}

  /** Move the current point in the path, any figure currently being drawn will
   * be considered closed during fill operations, however when stroking the
   * closing line segment will not be drawn.
   */
  virtual void MoveTo(const Point &aPoint) = 0;
  /** Add a linesegment to the current figure */
  virtual void LineTo(const Point &aPoint) = 0;
  /** Add a cubic bezier curve to the current figure */
  virtual void BezierTo(const Point &aCP1,
                        const Point &aCP2,
                        const Point &aCP3) = 0;
  /** Add a quadratic bezier curve to the current figure */
  virtual void QuadraticBezierTo(const Point &aCP1,
                                 const Point &aCP2) = 0;
  /** Close the current figure, this will essentially generate a line segment
   * from the current point to the starting point for the current figure
   */
  ;
  /** Add an arc to the current figure */
  ;
  /** Point the current subpath is at - or where the next subpath will start
   * if there is no active subpath.
   */
  ;
};

class PathBuilder;
class FlattenedPath;

/** The path class is used to create (sets of) figures of any shape that can be
 * filled or stroked to a DrawTarget
 */
class Path : public RefCounted<Path>
{
public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(Path)
  virtual ~Path();
  
  virtual BackendType GetBackendType() const = 0;

  /** This returns a PathBuilder object that contains a copy of the contents of
   * this path and is still writable.
   */
  virtual TemporaryRef<PathBuilder> CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const = 0;
  virtual TemporaryRef<PathBuilder> TransformedCopyToBuilder(const Matrix &aTransform,
                                                             FillRule aFillRule = FillRule::FILL_WINDING) const = 0;

  /** This function checks if a point lies within a path. It allows passing a
   * transform that will transform the path to the coordinate space in which
   * aPoint is given.
   */
  virtual bool ContainsPoint(const Point &aPoint, const Matrix &aTransform) const = 0;


  /** This function checks if a point lies within the stroke of a path using the
   * specified strokeoptions. It allows passing a transform that will transform
   * the path to the coordinate space in which aPoint is given.
   */
  ;

  /** This functions gets the bounds of this path. These bounds are not
   * guaranteed to be tight. A transform may be specified that gives the bounds
   * after application of the transform.
   */
  virtual Rect GetBounds(const Matrix &aTransform = Matrix()) const = 0;

  /** This function gets the bounds of the stroke of this path using the
   * specified strokeoptions. These bounds are not guaranteed to be tight.
   * A transform may be specified that gives the bounds after application of
   * the transform.
   */
  ;

  /** Take the contents of this path and stream it to another sink, this works
   * regardless of the backend that might be used for the destination sink.
   */
  virtual void StreamToSink(PathSink *aSink) const = 0;

  /** This gets the fillrule this path's builder was created with. This is not
   * mutable.
   */
  virtual FillRule GetFillRule() const = 0;

  ;

  ;

protected:
  ;
  ;

  RefPtr<FlattenedPath> mFlattenedPath;
};

/** The PathBuilder class allows path creation. Once finish is called on the
 * pathbuilder it may no longer be written to.
 */
class PathBuilder : public PathSink
{
public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(PathBuilder)
  /** Finish writing to the path and return a Path object that can be used for
   * drawing. Future use of the builder results in a crash!
   */
  virtual TemporaryRef<Path> Finish() = 0;

  ;
};

struct Glyph
{
  uint32_t mIndex;
  Point mPosition;
};

/** This class functions as a glyph buffer that can be drawn to a DrawTarget.
 * @todo XXX - This should probably contain the guts of gfxTextRun in the future as
 * roc suggested. But for now it's a simple container for a glyph vector.
 */
struct GlyphBuffer
{
  const Glyph *mGlyphs; //!< A pointer to a buffer of glyphs. Managed by the caller.
  uint32_t mNumGlyphs;  //!< Number of glyphs mGlyphs points to.
};

/** This class is an abstraction of a backend/platform specific font object
 * at a particular size. It is passed into text drawing calls to describe
 * the font used for the drawing call.
 */
class ScaledFont : public RefCounted<ScaledFont>
{
public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFont)
  virtual ~ScaledFont() {}

  typedef void (*FontFileDataOutput)(const uint8_t *aData, uint32_t aLength, uint32_t aIndex, Float aGlyphSize, void *aBaton);

  ;

  /** This allows getting a path that describes the outline of a set of glyphs.
   * A target is passed in so that the guarantee is made the returned path
   * can be used with any DrawTarget that has the same backend as the one
   * passed in.
   */
  virtual TemporaryRef<Path> GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget) = 0;

  /** This copies the path describing the glyphs into a PathBuilder. We use this
   * API rather than a generic API to append paths because it allows easier
   * implementation in some backends, and more efficient implementation in
   * others.
   */
  ;

  virtual bool GetFontFileData(FontFileDataOutput, void *) { return false; }

  
  

protected:
  

  UserData mUserData;
};

/** This class is designed to allow passing additional glyph rendering
 * parameters to the glyph drawing functions. This is an empty wrapper class
 * merely used to allow holding on to and passing around platform specific
 * parameters. This is because different platforms have unique rendering
 * parameters.
 */
class GlyphRenderingOptions : public RefCounted<GlyphRenderingOptions>
{
public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(GlyphRenderingOptions)
  virtual ~GlyphRenderingOptions() {}

  ;

protected:
  
};

class DrawTargetCapture;

/** This is the main class used for all the drawing. It is created through the
 * factory and accepts drawing commands. The results of drawing to a target
 * may be used either through a Snapshot or by flushing the target and directly
 * accessing the backing store a DrawTarget was created with.
 */
class DrawTarget : public RefCounted<DrawTarget>
{
public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawTarget)
  
  virtual ~DrawTarget() {}

  ;

  virtual BackendType GetBackendType() const = 0;
  /**
   * Returns a SourceSurface which is a snapshot of the current contents of the DrawTarget.
   * Multiple calls to Snapshot() without any drawing operations in between will
   * normally return the same SourceSurface object.
   */
  virtual TemporaryRef<SourceSurface> Snapshot() = 0;
  ;

  /**
   * If possible returns the bits to this DrawTarget for direct manipulation. While
   * the bits is locked any modifications to this DrawTarget is forbidden.
   * Release takes the original data pointer for safety.
   */
  
  

  /** Ensure that the DrawTarget backend has flushed all drawing operations to
   * this draw target. This must be called before using the backing surface of
   * this draw target outside of GFX 2D code.
   */
  virtual void Flush() = 0;

  /**
   * Realize a DrawTargetCapture onto the draw target.
   *
   * @param aSource Capture DrawTarget to draw
   * @param aTransform Transform to apply when replaying commands
   */
  ;

  /**
   * Draw a surface to the draw target. Possibly doing partial drawing or
   * applying scaling. No sampling happens outside the source.
   *
   * @param aSurface Source surface to draw
   * @param aDest Destination rectangle that this drawing operation should draw to
   * @param aSource Source rectangle in aSurface coordinates, this area of aSurface
   *                will be stretched to the size of aDest.
   * @param aOptions General draw options that are applied to the operation
   * @param aSurfOptions DrawSurface options that are applied
   */
  virtual void DrawSurface(SourceSurface *aSurface,
                           const Rect &aDest,
                           const Rect &aSource,
                           const DrawSurfaceOptions &aSurfOptions = DrawSurfaceOptions(),
                           const DrawOptions &aOptions = DrawOptions()) = 0;

  /**
   * Draw the output of a FilterNode to the DrawTarget.
   *
   * @param aNode FilterNode to draw
   * @param aSourceRect Source rectangle in FilterNode space to draw
   * @param aDestPoint Destination point on the DrawTarget to draw the
   *                   SourceRectangle of the filter output to
   */
  ;

  /**
   * Blend a surface to the draw target with a shadow. The shadow is drawn as a
   * gaussian blur using a specified sigma. The shadow is clipped to the size
   * of the input surface, so the input surface should contain a transparent
   * border the size of the approximate coverage of the blur (3 * aSigma).
   * NOTE: This function works in device space!
   *
   * @param aSurface Source surface to draw.
   * @param aDest Destination point that this drawing operation should draw to.
   * @param aColor Color of the drawn shadow
   * @param aOffset Offset of the shadow
   * @param aSigma Sigma used for the guassian filter kernel
   * @param aOperator Composition operator used
   */
  virtual void DrawSurfaceWithShadow(SourceSurface *aSurface,
                                     const Point &aDest,
                                     const Color &aColor,
                                     const Point &aOffset,
                                     Float aSigma,
                                     CompositionOp aOperator) = 0;

  /**
   * Clear a rectangle on the draw target to transparent black. This will
   * respect the clipping region and transform.
   *
   * @param aRect Rectangle to clear
   */
  virtual void ClearRect(const Rect &aRect) = 0;

  /**
   * This is essentially a 'memcpy' between two surfaces. It moves a pixel
   * aligned area from the source surface unscaled directly onto the
   * drawtarget. This ignores both transform and clip.
   *
   * @param aSurface Surface to copy from
   * @param aSourceRect Source rectangle to be copied
   * @param aDest Destination point to copy the surface to
   */
  virtual void CopySurface(SourceSurface *aSurface,
                           const IntRect &aSourceRect,
                           const IntPoint &aDestination) = 0;

  /** @see CopySurface
   * Same as CopySurface, except uses itself as the source.
   * 
   * Some backends may be able to optimize this better
   * than just taking a snapshot and using CopySurface.
   */
  

  /**
   * Fill a rectangle on the DrawTarget with a certain source pattern.
   *
   * @param aRect Rectangle that forms the mask of this filling operation
   * @param aPattern Pattern that forms the source of this filling operation
   * @param aOptions Options that are applied to this operation
   */
  virtual void FillRect(const Rect &aRect,
                        const Pattern &aPattern,
                        const DrawOptions &aOptions = DrawOptions()) = 0;

  /**
   * Stroke a rectangle on the DrawTarget with a certain source pattern.
   *
   * @param aRect Rectangle that forms the mask of this stroking operation
   * @param aPattern Pattern that forms the source of this stroking operation
   * @param aOptions Options that are applied to this operation
   */
  ;

  /**
   * Stroke a line on the DrawTarget with a certain source pattern.
   *
   * @param aStart Starting point of the line
   * @param aEnd End point of the line
   * @param aPattern Pattern that forms the source of this stroking operation
   * @param aOptions Options that are applied to this operation
   */
  ;

  /**
   * Stroke a path on the draw target with a certain source pattern.
   *
   * @param aPath Path that is to be stroked
   * @param aPattern Pattern that should be used for the stroke
   * @param aStrokeOptions Stroke options used for this operation
   * @param aOptions Draw options used for this operation
   */
  virtual void Stroke(const Path *aPath,
                      const Pattern &aPattern,
                      const StrokeOptions &aStrokeOptions = StrokeOptions(),
                      const DrawOptions &aOptions = DrawOptions()) = 0;
  
  /**
   * Fill a path on the draw target with a certain source pattern.
   *
   * @param aPath Path that is to be filled
   * @param aPattern Pattern that should be used for the fill
   * @param aOptions Draw options used for this operation
   */
  ;

  /**
   * Fill a series of clyphs on the draw target with a certain source pattern.
   */
  virtual void FillGlyphs(ScaledFont *aFont,
                          const GlyphBuffer &aBuffer,
                          const Pattern &aPattern,
                          const DrawOptions &aOptions = DrawOptions(),
                          const GlyphRenderingOptions *aRenderingOptions = nullptr) = 0;

  /**
   * This takes a source pattern and a mask, and composites the source pattern
   * onto the destination surface using the alpha channel of the mask pattern
   * as a mask for the operation.
   *
   * @param aSource Source pattern

  /**
   * Push a clip to the DrawTarget.
   *
   * @param aPath The path to clip to
   */
  virtual void PushClip(const Path *aPath) = 0;

  /**
   * Push an axis-aligned rectangular clip to the DrawTarget. This rectangle
   * is specified in user space.
   *
   * @param aRect The rect to clip to
   */
  virtual void PushClipRect(const Rect &aRect) = 0;

  /**
   * Create a SourceSurface optimized for use with this DrawTarget from an
   * arbitrary SourceSurface type supported by this backend. This may return
   * aSourceSurface or some other existing surface.
   */
  ;

  /**
   * Create a SourceSurface for a type of NativeSurface. This may fail if the
   * draw target does not know how to deal with the type of NativeSurface passed
   * in.
   */
  virtual TemporaryRef<SourceSurface>
    CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const = 0;

  /**
   * Create a DrawTarget whose snapshot is optimized for use with this DrawTarget.
   */
  virtual TemporaryRef<DrawTarget>
    CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const = 0;

  /**
   * Create a DrawTarget that captures the drawing commands and can be replayed
   * onto a compatible DrawTarget afterwards.
   *
   * @param aSize Size of the area this DT will capture. 
   */
  ;

  /**
   * Create a draw target optimized for drawing a shadow.
   *
   * Note that aSigma is the blur radius that must be used when we draw the
   * shadow. Also note that this doesn't affect the size of the allocated
   * surface, the caller is still responsible for including the shadow area in
   * its size.
   */
  virtual TemporaryRef<DrawTarget>
    CreateShadowDrawTarget(const IntSize &aSize, SurfaceFormat aFormat,
                           float aSigma) const
  {
    return CreateSimilarDrawTarget(aSize, aFormat);
  }

  /**
   * Create a path builder with the specified fillmode.
   *
   * We need the fill mode up front because of Direct2D.
   * ID2D1SimplifiedGeometrySink requires the fill mode
   * to be set before calling BeginFigure().
   */
  virtual TemporaryRef<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const = 0;

  /**
   * Create a GradientStops object that holds information about a set of
   * gradient stops, this object is required for linear or radial gradient
   * patterns to represent the color stops in the gradient.
   *
   * @param aStops An array of gradient stops
   * @param aNumStops Number of stops in the array aStops
   * @param aExtendNone This describes how to extend the stop color outside of the
   *                    gradient area.
   */
  ;

  /**
   * Create a FilterNode object that can be used to apply a filter to various
   * inputs.
   *
   * @param aType Type of filter node to be created.
   */
  ;

  Matrix GetTransform() const { return mTransform; }

  /**
   * Set a transform on the surface, this transform is applied at drawing time
   * to both the mask and source of the operation.
   *
   * Performance note: For some backends it is expensive to change the current
   * transform (because transforms affect a lot of the parts of the pipeline,
   * so new transform change can result in a pipeline flush).  To get around
   * this, DrawTarget implementations buffer transform changes and try to only
   * set the current transform on the backend when required.  That tracking has
   * its own performance impact though, and ideally callers would be smart
   * enough not to require it.  At a future date this method may stop this
   * doing transform buffering so, if you're a consumer, please try to be smart
   * about calling this method as little as possible.  For example, instead of
   * concatenating a translation onto the current transform then calling
   * FillRect, try to integrate the translation into FillRect's aRect
   * argument's x/y offset.
   */
  virtual void SetTransform(const Matrix &aTransform)
    { mTransform = aTransform; mTransformDirty = true; }

  

  

  /** Tries to get a native surface for a DrawTarget, this may fail if the
   * draw target cannot convert to this surface type.
   */
  virtual void *GetNativeSurface(NativeSurfaceType aType) { return nullptr; }

  
  
  

  
  
  

  /** Within this rectangle all pixels will be opaque by the time the result of
   * this DrawTarget is first used for drawing. Either by the underlying surface
   * being used as an input to external drawing, or Snapshot() being called.
   * This rectangle is specified in device space.
   */
  

  

  virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) {
    mPermitSubpixelAA = aPermitSubpixelAA;
  }

  

#ifdef USE_SKIA_GPU
  
#endif
# 1051 "../../dist/include/mozilla/gfx/2D.h"

protected:
  UserData mUserData;
  Matrix mTransform;
  IntRect mOpaqueRect;
  bool mTransformDirty : 1;
  bool mPermitSubpixelAA : 1;

  SurfaceFormat mFormat;
};

class DrawTargetCapture : public DrawTarget
{
};

class DrawEventRecorder : public RefCounted<DrawEventRecorder>
{
public:
  MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DrawEventRecorder)
  
};

struct Tile
{
  RefPtr<DrawTarget> mDrawTarget;
  IntPoint mTileOrigin;
};

struct TileSet
{
  Tile* mTiles;
  size_t mTileCount;
};

class GFX2D_API Factory
{
public:
  ;

  /** Make sure that the given dimensions don't overflow a 32-bit signed int
   * using 4 bytes per pixel; optionally, make sure that either dimension
   * doesn't exceed the given limit.
   */
  ;

  /** Make sure the given dimension satisfies the CheckSurfaceSize and is
   * within 8k limit.  The 8k value is chosen a bit randomly.
   */
  ;

  ;

  ;
  static LogForwarder* mLogForwarder;
public:

#ifdef USE_SKIA_GPU
  static TemporaryRef<DrawTarget>
    CreateDrawTargetSkiaWithGrContext(GrContext* aGrContext,
                                      const IntSize &aSize,
                                      SurfaceFormat aFormat);
#endif
# 1186 "../../dist/include/mozilla/gfx/2D.h"

  ;

#if defined(USE_SKIA) && defined(MOZ_ENABLE_FREETYPE)
  static TemporaryRef<GlyphRenderingOptions>
    CreateCairoGlyphRenderingOptions(FontHinting aHinting, bool aAutoHinting);
#endif
# 1193 "../../dist/include/mozilla/gfx/2D.h"
  ;

  /*
   * This creates a new tiled DrawTarget. When a tiled drawtarget is used the
   * drawing is distributed over number of tiles which may each hold an
   * individual offset. The tiles in the set must each have the same backend
   * and format.
   */
  ;

  ;

#ifdef XP_DARWIN
  ;
  ;
#endif
# 1211 "../../dist/include/mozilla/gfx/2D.h"

#ifdef WIN32
  static TemporaryRef<DrawTarget> CreateDrawTargetForD3D10Texture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat);
  static TemporaryRef<DrawTarget>
    CreateDualDrawTargetForD3D10Textures(ID3D10Texture2D *aTextureA,
  static uint64_t GetD2DVRAMUsageSourceSurface();
  static void D2DCleanup();

private:
  static ID2D1Device *mD2D1Device;
  static ID3D10Device1 *mD3D10Device;
  static ID3D11Device *mD3D11Device;
#endif
# 1240 "../../dist/include/mozilla/gfx/2D.h"

  static DrawEventRecorder *mRecorder;
};

}
}

class nsIInputStream; /* forward declaration */

/**
 * The signature of the writer function passed to ReadSegments. This
 * is the "consumer" of data that gets read from the stream's buffer.
 *
 * @param aInStream stream being read
 * @param aClosure opaque parameter passed to ReadSegments
 * @param aFromSegment pointer to memory owned by the input stream.  This is
 *                     where the writer function should start consuming data.
 * @param aToOffset amount of data already consumed by this writer during this
 *                  ReadSegments call.  This is also the sum of the aWriteCount
 *                  returns from this writer over the previous invocations of
 *                  the writer by this ReadSegments call.
 * @param aCount Number of bytes available to be read starting at aFromSegment
 * @param [out] aWriteCount number of bytes read by this writer function call
 *
 * Implementers should return the following:
 *
 * @return NS_OK and (*aWriteCount > 0) if consumed some data
 * @return <any-error> if not interested in consuming any data
 *
 * Errors are never passed to the caller of ReadSegments.
 *
 * NOTE: returning NS_OK and (*aWriteCount = 0) has undefined behavior.
 */
typedef NS_CALLBACK(nsWriteSegmentFun)(nsIInputStream *aInStream,
                                       void *aClosure,
                                       const char *aFromSegment,
                                       uint32_t aToOffset,
                                       uint32_t aCount,
                                       uint32_t *aWriteCount);

/* starting interface:    nsIInputStream */
#define NS_IINPUTSTREAM_IID_STR "53cdbc97-c2d7-4e30-b2c3-45b2ee79db18"

#define NS_IINPUTSTREAM_IID \
  {0x53cdbc97, 0xc2d7, 0x4e30, \
    { 0xb2, 0xc3, 0x45, 0xb2, 0xee, 0x79, 0xdb, 0x18 }}

class NS_NO_VTABLE nsIInputStream : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IINPUTSTREAM_IID)

  /* void close (); */
  NS_IMETHOD Close(void) = 0;

  /* unsigned long long available (); */
  NS_IMETHOD Available(uint64_t *_retval) = 0;

  /* [noscript] unsigned long read (in charPtr aBuf, in unsigned long aCount); */
  NS_IMETHOD Read(char *aBuf, uint32_t aCount, uint32_t *_retval) = 0;

  /* [noscript] unsigned long readSegments (in nsWriteSegmentFun aWriter, in voidPtr aClosure, in unsigned long aCount); */
  NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval) = 0;

  /* boolean isNonBlocking (); */
  NS_IMETHOD IsNonBlocking(bool *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIInputStream, NS_IINPUTSTREAM_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIINPUTSTREAM \
  NS_IMETHOD Close(void) MOZ_OVERRIDE; \
  NS_IMETHOD Available(uint64_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD Read(char *aBuf, uint32_t aCount, uint32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD IsNonBlocking(bool *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIINPUTSTREAM(_to) \
  NS_IMETHOD Close(void) MOZ_OVERRIDE { return _to Close(); } \
  NS_IMETHOD Available(uint64_t *_retval) MOZ_OVERRIDE { return _to Available(_retval); } \
  NS_IMETHOD Read(char *aBuf, uint32_t aCount, uint32_t *_retval) MOZ_OVERRIDE { return _to Read(aBuf, aCount, _retval); } \
  NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval) MOZ_OVERRIDE { return _to ReadSegments(aWriter, aClosure, aCount, _retval); } \
  NS_IMETHOD IsNonBlocking(bool *_retval) MOZ_OVERRIDE { return _to IsNonBlocking(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIINPUTSTREAM(_to) \
  NS_IMETHOD Close(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
  NS_IMETHOD Available(uint64_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Available(_retval); } \
  NS_IMETHOD Read(char *aBuf, uint32_t aCount, uint32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Read(aBuf, aCount, _retval); } \
  NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadSegments(aWriter, aClosure, aCount, _retval); } \
  NS_IMETHOD IsNonBlocking(bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsNonBlocking(_retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsInputStream : public nsIInputStream
{
public:
  NS_DECL_ISUPPORTS
  /* member initializers and constructor code */
/* boolean isNonBlocking (); */
NS_IMETHODIMP nsInputStream::IsNonBlocking(bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 169 "../../dist/include/nsIInputStream.h"


#endif /* __gen_nsIInputStream_h__ */
# 172 "../../dist/include/nsIInputStream.h"
# 12 "/Users/luser/build/mozilla-central/dom/canvas/nsICanvasRenderingContextInternal.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDocShell.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDocShell.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDocShell.idl
 */

#ifndef __gen_nsIDocShell_h__
#define __gen_nsIDocShell_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/domstubs.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/domstubs.idl
 */

#ifndef __gen_domstubs_h__
#define __gen_domstubs_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/domstubs.h"
#endif
# 12 "../../dist/include/domstubs.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/domstubs.h"
class nsWrapperCache;
typedef uint64_t  DOMTimeStamp;

typedef double  DOMHighResTimeStamp;

class nsIDOMAttr; /* forward declaration */

class nsIDOMCDATASection; /* forward declaration */

class nsIDOMCharacterData; /* forward declaration */

class nsIDOMComment; /* forward declaration */

class nsIDOMDOMImplementation; /* forward declaration */

class nsIDOMDocument; /* forward declaration */

class nsIDOMDocumentFragment; /* forward declaration */

class nsIDOMDocumentType; /* forward declaration */

class nsIDOMElement; /* forward declaration */

class nsIDOMNode; /* forward declaration */

class nsIDOMNodeList; /* forward declaration */

class nsIDOMProcessingInstruction; /* forward declaration */

class nsIDOMText; /* forward declaration */

class nsIDOMClientRect; /* forward declaration */

class nsIDOMClientRectList; /* forward declaration */

class DOMException; /* forward declaration */

class nsIDOMStyleSheetList; /* forward declaration */

class nsIDOMStyleSheet; /* forward declaration */

class nsIDOMMediaList; /* forward declaration */

class nsIDOMHTMLFormElement; /* forward declaration */

class nsIDOMHTMLCollection; /* forward declaration */

class nsIDOMHTMLHeadElement; /* forward declaration */

class nsIDOMCSSValue; /* forward declaration */

class nsIDOMCSSPrimitiveValue; /* forward declaration */

class nsIDOMCSSRule; /* forward declaration */

class nsIDOMCSSRuleList; /* forward declaration */

class nsIDOMMozCSSKeyframeRule; /* forward declaration */

class nsIDOMRange; /* forward declaration */

class nsIDOMCrypto; /* forward declaration */

class nsIDOMFontFace; /* forward declaration */

class nsIDOMFontFaceList; /* forward declaration */


#endif /* __gen_domstubs_h__ */
# 118 "../../dist/include/domstubs.h"
# 11 "../../dist/include/nsIDocShell.h" 2
#endif
# 12 "../../dist/include/nsIDocShell.h"

#ifndef __gen_nsIDocShellTreeItem_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDocShellTreeItem.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDocShellTreeItem.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDocShellTreeItem.idl
 */

#ifndef __gen_nsIDocShellTreeItem_h__
#define __gen_nsIDocShellTreeItem_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDocShellTreeItem.h"
#endif
# 12 "../../dist/include/nsIDocShellTreeItem.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDocShellTreeItem.h"
class nsIDocShellTreeOwner; /* forward declaration */

class nsIDocument; /* forward declaration */

class nsPIDOMWindow; /* forward declaration */


/* starting interface:    nsIDocShellTreeItem */
#define NS_IDOCSHELLTREEITEM_IID_STR "edb99640-8378-4106-8673-e701a086eb1c"

#define NS_IDOCSHELLTREEITEM_IID \
  {0xedb99640, 0x8378, 0x4106, \
    { 0x86, 0x73, 0xe7, 0x01, 0xa0, 0x86, 0xeb, 0x1c }}

class NS_NO_VTABLE nsIDocShellTreeItem : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCSHELLTREEITEM_IID)

  /* attribute AString name; */
  ;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocShellTreeItem, NS_IDOCSHELLTREEITEM_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOCSHELLTREEITEM \
  NS_IMETHOD GetName(nsAString & aName) MOZ_OVERRIDE; \
  NS_IMETHOD SetName(const nsAString & aName) MOZ_OVERRIDE; \
  NS_IMETHOD NameEquals(const char16_t * name, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetItemType(int32_t *aItemType) MOZ_OVERRIDE; \
  NS_IMETHOD SetItemType(int32_t aItemType) MOZ_OVERRIDE; \
  NS_IMETHOD GetChildCount(int32_t *aChildCount) MOZ_OVERRIDE { return _to GetChildCount(aChildCount); } \
  NS_IMETHOD AddChild(nsIDocShellTreeItem *child) MOZ_OVERRIDE { return _to AddChild(child); } \
  NS_IMETHOD RemoveChild(nsIDocShellTreeItem *child) MOZ_OVERRIDE { return _to RemoveChild(child); } \
  NS_IMETHOD GetChildAt(int32_t index, nsIDocShellTreeItem * *_retval) MOZ_OVERRIDE { return _to GetChildAt(index, _retval); } \
  NS_IMETHOD FindChildWithName(const char16_t * aName, bool aRecurse, bool aSameType, nsIDocShellTreeItem *aRequestor, nsIDocShellTreeItem *aOriginalRequestor, nsIDocShellTreeItem * *_retval) MOZ_OVERRIDE { return _to FindChildWithName(aName, aRecurse, aSameType, aRequestor, aOriginalRequestor, _retval); } \
  virtual nsIDocument * GetDocument(void) MOZ_OVERRIDE { return _to GetDocument(); } \
  NS_IMETHOD SetTreeOwner(nsIDocShellTreeOwner *treeOwner) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetTreeOwner(treeOwner); } \
  NS_IMETHOD GetChildCount(int32_t *aChildCount) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChildCount(aChildCount); } \
  NS_IMETHOD AddChild(nsIDocShellTreeItem *child) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddChild(child); } \
  NS_IMETHOD RemoveChild(nsIDocShellTreeItem *child) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveChild(child); } \
  NS_IMETHOD GetChildAt(int32_t index, nsIDocShellTreeItem * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChildAt(index, _retval); } \
  NS_IMETHOD FindChildWithName(const char16_t * aName, bool aRecurse, bool aSameType, nsIDocShellTreeItem *aRequestor, nsIDocShellTreeItem *aOriginalRequestor, nsIDocShellTreeItem * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->FindChildWithName(aName, aRecurse, aSameType, aRequestor, aOriginalRequestor, _retval); } \
  virtual nsIDocument * GetDocument(void) MOZ_OVERRIDE; \
  virtual nsPIDOMWindow * GetWindow(void) MOZ_OVERRIDE; 


#endif /* __gen_nsIDocShellTreeItem_h__ */
# 326 "../../dist/include/nsIDocShellTreeItem.h"
# 15 "../../dist/include/nsIDocShell.h" 2
#endif
# 16 "../../dist/include/nsIDocShell.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/Value.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* JS::Value implementation. */

#ifndef js_Value_h
#define js_Value_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/js/Value.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/FloatingPoint.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/js/Value.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Likely.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/js/Value.h"

#if 0 /* expanded by -frewrite-includes */
#include <limits> /* for std::numeric_limits */
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/js/Value.h"

#if 0 /* expanded by -frewrite-includes */
#include "js-config.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js-config.h" 1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sw=4 et tw=78:
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_config_h
#define js_config_h

/* Definitions set at build time that affect SpiderMonkey's public API.
   This header file is generated by the SpiderMonkey configure script,
   and installed along with jsapi.h.  */

/* Define to 1 if SpiderMonkey is in debug mode. */
#define JS_DEBUG 1

/* Define to 1 if SpiderMonkey should not use struct types in debug builds. */
#define JS_NUNBOX32 1

/* Define to 1 if SpiderMonkey is in PUNBOX64 mode. */
/* #undef JS_PUNBOX64 */

/* MOZILLA JSAPI version number components */
#define MOZJS_MAJOR_VERSION 39
#define MOZJS_MINOR_VERSION 0

#endif /* js_config_h */
# 60 "../../dist/include/js-config.h"
# 19 "../../dist/include/js/Value.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "jstypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/jstypes.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
** File:                jstypes.h
** Description: Definitions of NSPR's basic types
**
** Prototypes and macros used to make up for deficiencies in ANSI environments
** that we have found.
**
** Since we do not wrap <stdlib.h> and all the other standard headers, authors
** of portable code will not know in general that they need these definitions.
** Instead of requiring these authors to find the dependent uses in their code
** and take the following steps only in those C files, we take steps once here
** for all C files.
**/

#ifndef jstypes_h
#define jstypes_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/jstypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Casting.h"
 */
#define JS_OLD_GETTER_SETTER_METHODS    1

/* Support for ES6 Classes. */
#ifdef NIGHTLY_BUILD
#define JS_HAS_CLASSES 1
#endif
# 48 "../../dist/include/jsversion.h"

#endif /* jsversion_h */
# 50 "../../dist/include/jsversion.h"
# 36 "../../dist/include/jstypes.h" 2

/***********************************************************************
** MACROS:      JS_EXTERN_API
**              JS_EXPORT_API
** DESCRIPTION:
**      These are only for externally visible routines and globals.  For
**      internal routines, just use "extern" for type checking and that
**      will not export internal cross-file or forward-declared symbols.
**      Define a macro for declaring procedures return types. We use this to
**      deal with windoze specific type hackery for DLL definitions. Use
**      JS_EXTERN_API when the prototype for the method is declared. Use
**      JS_EXPORT_API for the implementation of the method.
**
** Example:
**   in dowhim.h
**     JS_EXTERN_API( void ) DoWhatIMean( void );
 * should not. STATIC_JS_API is used to build JS as a static library.
 */
#if defined(STATIC_JS_API)
#  define JS_PUBLIC_API(t)   t
#  define JS_PUBLIC_DATA(t)  t
#elif defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API)
# 74 "../../dist/include/jstypes.h"
#  define JS_PUBLIC_API(t)   MOZ_EXPORT t
#  define JS_PUBLIC_DATA(t)  MOZ_EXPORT t
#else
# 77 "../../dist/include/jstypes.h"
#  define JS_PUBLIC_API(t)   MOZ_IMPORT_API t
#  define JS_PUBLIC_DATA(t)  MOZ_IMPORT_DATA t
#endif
# 80 "../../dist/include/jstypes.h"

#if defined(STATIC_JS_API) || defined(EXPORT_JS_API) || defined(STATIC_EXPORTABLE_JS_API)
#  define JS_FRIEND_API(t)    MOZ_EXPORT t
#  define JS_FRIEND_DATA(t)   MOZ_EXPORT t
#else
# 85 "../../dist/include/jstypes.h"
#  define JS_FRIEND_API(t)   MOZ_IMPORT_API t
#  define JS_FRIEND_DATA(t)  MOZ_IMPORT_DATA t
#endif
# 88 "../../dist/include/jstypes.h"

#if defined(_MSC_VER) && defined(_M_IX86)
#define JS_FASTCALL __fastcall
#elif defined(__GNUC__) && defined(__i386__)
# 92 "../../dist/include/jstypes.h"
#define JS_FASTCALL __attribute__((fastcall))
#else
# 94 "../../dist/include/jstypes.h"
#define JS_FASTCALL
#define JS_NO_FASTCALL
#endif
# 97 "../../dist/include/jstypes.h"

/***********************************************************************
** MACROS:      JS_BEGIN_MACRO
**              JS_END_MACRO
** DESCRIPTION:
**      Macro body brackets so that macros with compound statement definitions
**      behave syntactically more like functions when called.
***********************************************************************/
#define JS_BEGIN_MACRO  do {

#if defined(_MSC_VER)
# define JS_END_MACRO                                                         \
    } __pragma(warning(push)) __pragma(warning(disable:4127))                 \
    while (0) __pragma(warning(pop))
#else
# 112 "../../dist/include/jstypes.h"
# define JS_END_MACRO   } while (0)
#endif
# 114 "../../dist/include/jstypes.h"

/***********************************************************************
** MACROS:      JS_BIT
**              JS_BITMASK
** DESCRIPTION:
** Bit masking macros.  XXX n must be <= 31 to be portable
***********************************************************************/
#define JS_BIT(n)       ((uint32_t)1 << (n))
#define JS_BITMASK(n)   (JS_BIT(n) - 1)

/***********************************************************************
** MACROS:      JS_HOWMANY
**              JS_ROUNDUP
** DESCRIPTION:
**      Commonly used macros for operations on compatible types.
***********************************************************************/
#define JS_HOWMANY(x,y) (((x)+(y)-1)/(y))
#define JS_ROUNDUP(x,y) (JS_HOWMANY(x,y)*(y))

#if 0 /* expanded by -frewrite-includes */
#include "jscpucfg.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/jscpucfg.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef jscpucfg_h
#define jscpucfg_h

#define JS_HAVE_LONG_LONG

#if defined(_WIN64)

# if defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)
#  define IS_LITTLE_ENDIAN 1
#  undef  IS_BIG_ENDIAN
# else  /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */
# 18 "../../dist/include/jscpucfg.h"
#  error "CPU type is unknown"
# endif /* !(defined(_M_X64) || defined(_M_AMD64) || defined(_AMD64_)) */
# 20 "../../dist/include/jscpucfg.h"

#elif defined(_WIN32)
# 22 "../../dist/include/jscpucfg.h"

# ifdef __WATCOMC__
#  define HAVE_VA_LIST_AS_ARRAY 1
# endif
# 26 "../../dist/include/jscpucfg.h"

# define IS_LITTLE_ENDIAN 1
# undef  IS_BIG_ENDIAN

#elif defined(__APPLE__) || defined(__powerpc__) || defined(__ppc__)
# 31 "../../dist/include/jscpucfg.h"
# if __LITTLE_ENDIAN__
#  define IS_LITTLE_ENDIAN 1
#  undef  IS_BIG_ENDIAN
# elif __BIG_ENDIAN__
# 35 "../../dist/include/jscpucfg.h"
#  undef  IS_LITTLE_ENDIAN
#  define IS_BIG_ENDIAN 1
# endif
# 38 "../../dist/include/jscpucfg.h"

#elif defined(JS_HAVE_ENDIAN_H)
# 40 "../../dist/include/jscpucfg.h"
#if 0 /* expanded by -frewrite-includes */
# include <endian.h>
#endif /* expanded by -frewrite-includes */
# 41 "../../dist/include/jscpucfg.h"

/*
 * Historically, OSes providing <endian.h> only defined
 * __BYTE_ORDER to either __LITTLE_ENDIAN or __BIG_ENDIAN.
 * The Austin group decided to standardise <endian.h> in
 * POSIX around 2011, expecting it to provide a BYTE_ORDER
 * #define set to either LITTLE_ENDIAN or BIG_ENDIAN. We
 * should try to cope with both possibilities here.
 */
# 92 "../../dist/include/jscpucfg.h"
#if 0 /* expanded by -frewrite-includes */
# include <sys/isa_defs.h>
#endif /* expanded by -frewrite-includes */
# 93 "../../dist/include/jscpucfg.h"

# if defined(_BIG_ENDIAN)
#  undef IS_LITTLE_ENDIAN
#  define IS_BIG_ENDIAN 1
# elif defined(_LITTLE_ENDIAN)
# 98 "../../dist/include/jscpucfg.h"
#  define IS_LITTLE_ENDIAN 1
#  undef IS_BIG_ENDIAN
# else /* !defined(_LITTLE_ENDIAN) */
# 101 "../../dist/include/jscpucfg.h"
#  error "sys/isa_defs.h does not define _BIG_ENDIAN or _LITTLE_ENDIAN. Cannot determine endianness."
# endif
# 103 "../../dist/include/jscpucfg.h"
# if !defined(JS_STACK_GROWTH_DIRECTION)
#  if defined(_STACK_GROWS_UPWARD)
#   define JS_STACK_GROWTH_DIRECTION (1)
#  elif defined(_STACK_GROWS_DOWNWARD)
# 107 "../../dist/include/jscpucfg.h"
#   define JS_STACK_GROWTH_DIRECTION (-1)
#  endif
# 109 "../../dist/include/jscpucfg.h"
# endif
# 110 "../../dist/include/jscpucfg.h"

#elif defined(__sparc) || defined(__sparc__) || \
      defined(_POWER) || defined(__hppa) || \
      defined(_MIPSEB) || defined(_BIG_ENDIAN)
# 114 "../../dist/include/jscpucfg.h"
/* IA64 running HP-UX will have _BIG_ENDIAN defined.
 * IA64 running Linux will have endian.h and be handled above.
 */
# undef IS_LITTLE_ENDIAN
#endif
# 131 "../../dist/include/jscpucfg.h"

#endif /* jscpucfg_h */
# 133 "../../dist/include/jscpucfg.h"
# 134 "../../dist/include/jstypes.h" 2

/*
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_HeapAPI_h
#define js_HeapAPI_h

#if 0 /* expanded by -frewrite-includes */
#include <limits.h>
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/js/HeapAPI.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/TracingAPI.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/TracingAPI.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_TracingAPI_h
#define js_TracingAPI_h

#if 0 /* expanded by -frewrite-includes */
#include "jsalloc.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/jsalloc.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * JS allocation policies.
 *
 * The allocators here are for system memory with lifetimes which are not
 * managed by the GC. See the comment at the top of vm/MallocProvider.h.
 */

#ifndef jsalloc_h
#define jsalloc_h

#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/TypeDecls.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// This file contains public type declarations that are used *frequently*.  If
// it doesn't occur at least 10 times in Gecko, it probably shouldn't be in
// here.
//
// It includes only:
// - forward declarations of structs and classes;
// - typedefs;
// - enums (maybe).
// It does *not* contain any struct or class definitions.

#ifndef js_TypeDecls_h
#define js_TypeDecls_h

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/js/TypeDecls.h"

#if 0 /* expanded by -frewrite-includes */
#include "js-config.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/js/TypeDecls.h"

struct JSContext;
class JSFunction;
class JSObject;
class JSScript;
class JSString;
class JSAddonId;

struct jsid;

namespace JS {

typedef unsigned char Latin1Char;

class Symbol;
class Value;
template <typename T> class Handle;
template <typename T> class MutableHandle;
template <typename T> class Rooted;
template <typename T> class PersistentRooted;

typedef Handle<JSFunction*> HandleFunction;
typedef Handle<jsid>        HandleId;
typedef Handle<JSObject*>   HandleObject;
typedef Handle<JSScript*>   HandleScript;
typedef Handle<JSString*>   HandleString;
typedef Handle<JS::Symbol*> HandleSymbol;
typedef Handle<Value>       HandleValue;

typedef MutableHandle<JSFunction*> MutableHandleFunction;
typedef MutableHandle<jsid>        MutableHandleId;
typedef MutableHandle<JSObject*>   MutableHandleObject;
typedef MutableHandle<JSScript*>   MutableHandleScript;
typedef MutableHandle<JSString*>   MutableHandleString;
typedef MutableHandle<JS::Symbol*> MutableHandleSymbol;
typedef MutableHandle<Value>       MutableHandleValue;

typedef Rooted<JSObject*>       RootedObject;
typedef Rooted<JSFunction*>     RootedFunction;
typedef Rooted<JSScript*>       RootedScript;
typedef Rooted<JSString*>       RootedString;
typedef Rooted<JS::Symbol*>     RootedSymbol;
typedef Rooted<jsid>            RootedId;
typedef Rooted<JS::Value>       RootedValue;

typedef PersistentRooted<JSFunction*> PersistentRootedFunction;
typedef PersistentRooted<jsid>        PersistentRootedId;
typedef PersistentRooted<JSObject*>   PersistentRootedObject;
typedef PersistentRooted<JSScript*>   PersistentRootedScript;
typedef PersistentRooted<JSString*>   PersistentRootedString;
typedef PersistentRooted<JS::Symbol*> PersistentRootedSymbol;
typedef PersistentRooted<Value>       PersistentRootedValue;

} // namespace JS

#endif /* js_TypeDecls_h */
# 80 "../../dist/include/js/TypeDecls.h"
# 18 "../../dist/include/jsalloc.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/Utility.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/Utility.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_Utility_h
#define js_Utility_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/js/Utility.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/js/Utility.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Compiler.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/js/Utility.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/js/Utility.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Scoped.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Scoped.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* DEPRECATED: Use UniquePtr.h instead. */

#ifndef mozilla_Scoped_h
#define mozilla_Scoped_h

/*
 * DEPRECATED: Use UniquePtr.h instead.
 *
 * Resource Acquisition Is Initialization is a programming idiom used
 * to write robust code that is able to deallocate resources properly,
 * even in presence of execution errors or exceptions that need to be
 * propagated.  The Scoped* classes defined in this header perform the
 * deallocation of the resource they hold once program execution
 * reaches the end of the scope for which they have been defined.
 *
 * This header provides the following RAII classes:
 *
 * - |ScopedFreePtr| - a container for a pointer, that automatically calls
 *   |free()| at the end of the scope;

/* Implementation of macros to ensure correct use of RAII Auto* objects. */

#ifndef mozilla_GuardObjects_h
#define mozilla_GuardObjects_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/GuardObjects.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Types.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/GuardObjects.h"

#ifdef __cplusplus

#ifdef DEBUG

namespace mozilla {
namespace detail {

/*
 * The following classes are designed to cause assertions to detect
 * inadvertent use of guard objects as temporaries. In other words,
 * when we have a guard object whose only purpose is its constructor and
 * destructor (and is never otherwise referenced), the intended use
 * might be:
 *
 *   AutoRestore savePainting(mIsPainting);
 *
 * but is is easy to accidentally write:
 *     constructor. It uses the parameter declared by
 *     MOZ_GUARD_OBJECT_NOTIFIER_PARAM.
 *
 * For more details, and examples of using these macros, see
 * https://developer.mozilla.org/en/Using_RAII_classes_in_Mozilla
 */
class GuardObjectNotifier
{
private:
  bool* mStatementDone;

public:
  GuardObjectNotifier() : mStatementDone(nullptr) { }

  ~GuardObjectNotifier() { *mStatementDone = true; }

  void setStatementDone(bool* aStatementIsDone)
  {
    mStatementDone = aStatementIsDone;
  }
};

class GuardObjectNotificationReceiver
{
private:
  bool mStatementDone;

public:
  GuardObjectNotificationReceiver() : mStatementDone(false) { }

  ~GuardObjectNotificationReceiver() {
    /*
     * Assert that the guard object was not used as a temporary.  (Note that
     * this assert might also fire if init is not called because the guard
     * object's implementation is not using the above macros correctly.)
     */
    MOZ_ASSERT(mStatementDone);
  }

  void init(const GuardObjectNotifier& aConstNotifier)
  {
    /*
     * aConstNotifier is passed as a const reference so that we can pass a
     * temporary, but we really intend it as non-const.
     */
    GuardObjectNotifier& notifier =
      const_cast<GuardObjectNotifier&>(aConstNotifier);
    notifier.setStatementDone(&mStatementDone);
  }
};

} /* namespace detail */
} /* namespace mozilla */

#endif /* DEBUG */
# 119 "../../dist/include/mozilla/GuardObjects.h"

#ifdef DEBUG
#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER \
     mozilla::detail::GuardObjectNotificationReceiver _mCheckNotUsedAsTemporary;
#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM \
     , const mozilla::detail::GuardObjectNotifier& _notifier = \
         mozilla::detail::GuardObjectNotifier()
#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM \
     const mozilla::detail::GuardObjectNotifier& _notifier = \
         mozilla::detail::GuardObjectNotifier()
#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL \
     , const mozilla::detail::GuardObjectNotifier& _notifier
#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL \
     const mozilla::detail::GuardObjectNotifier& _notifier
#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT \
     , _notifier
#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT \
       _notifier
#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT \
     do { _mCheckNotUsedAsTemporary.init(_notifier); } while (0)
#else
# 140 "../../dist/include/mozilla/GuardObjects.h"
#  define MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM
#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM
#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL
#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL
#  define MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT
#  define MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT
#  define MOZ_GUARD_OBJECT_NOTIFIER_INIT do { } while (0)
#endif
# 149 "../../dist/include/mozilla/GuardObjects.h"

#endif /* __cplusplus */
# 151 "../../dist/include/mozilla/GuardObjects.h"

#endif /* mozilla_GuardObjects_h */
# 153 "../../dist/include/mozilla/GuardObjects.h"
# 60 "../../dist/include/mozilla/Scoped.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 61 "../../dist/include/mozilla/Scoped.h"

namespace mozilla {

/*
 * Scoped is a helper to create RAII wrappers
 * Type argument |Traits| is expected to have the following structure:
 *
 *   struct Traits
 *   {
 *     // Define the type of the value stored in the wrapper
 *     typedef value_type type;
 *     // Returns the value corresponding to the uninitialized or freed state
 *     const static type empty();
 *     // Release resources corresponding to the wrapped value
 *     // This function is responsible for not releasing an |empty| value
 *     const static void release(type);
 *   }
 */
template<typename Traits>
class Scoped
{
public:
  typedef typename Traits::type Resource;

  

  

  /* Move constructor. */
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

/*
 * SCOPED_TEMPLATE defines a templated class derived from Scoped
 * This allows to implement templates such as ScopedFreePtr.
 *
 * @param name The name of the class to define.
 * @param Traits A struct implementing clean-up. See the implementations
 * for more details.
 */
#define SCOPED_TEMPLATE(name, Traits)                                         \
template<typename Type>                                                       \
struct name : public mozilla::Scoped<Traits<Type> >                           \
{                                                                             \
  typedef mozilla::Scoped<Traits<Type> > Super;                               \
  typedef typename Super::Resource Resource;                                  \
  name& operator=(Resource aRhs)                                              \
  {                                                                           \
    Super::operator=(aRhs);                                                   \
    return *this;                                                             \
  }                                                                           \
  name& operator=(name&& aRhs)                                                \
  {                                                                           \
    Super::operator=(Move(aRhs));                                             \
    return *this;                                                             \
  }                                                                           \
  explicit name(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM)                         \
    : Super(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT)                   \
  {}                                                                          \
  explicit name(Resource aRhs                                                 \
                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)                              \
    : Super(aRhs                                                              \
            MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)                        \
  {}                                                                          \
  explicit name(name&& aRhs                                                   \
                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)                              \
    : Super(Move(aRhs)                                                        \
            MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)                        \
  {}                                                                          \
private:                                                                      \
  explicit name(name&) = delete;                                              \
  name& operator=(name&) = delete;                                            \
};

/*
 * ScopedFreePtr is a RAII wrapper for pointers that need to be free()d.
 *
 *   struct S { ... };
 *   ScopedFreePtr<S> foo = malloc(sizeof(S));
 *   ScopedFreePtr<char> bar = strdup(str);
 */
template<typename T>
struct ScopedFreePtrTraits
{
  typedef T* type;
  static T* empty() { return nullptr; }
  static void release(T* aPtr) { free(aPtr); }
};
SCOPED_TEMPLATE(ScopedFreePtr, ScopedFreePtrTraits)

/*
 * ScopedDeletePtr is a RAII wrapper for pointers that need to be deleted.
 *
 * @param name The name of the class to define.
 * @param Type A struct implementing clean-up. See the implementations
 * for more details.
 * *param Deleter The function that is used to delete/destroy/free a
 *        non-null value of Type*.
 *
 * Example:
 *
 *   MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE(ScopedPRFileDesc, PRFileDesc, \
 *                                             PR_Close)
 *   ...
 *   {
 *       ScopedPRFileDesc file(PR_OpenFile(...));
 *       ...
 *   } // file is closed with PR_Close here
 */
} /* namespace mozilla */

#endif /* mozilla_Scoped_h */
# 297 "../../dist/include/mozilla/Scoped.h"
# 15 "../../dist/include/js/Utility.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TemplateLib.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/js/Utility.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/UniquePtr.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Smart pointer managing sole ownership of a resource. */

#ifndef mozilla_UniquePtr_h
#define mozilla_UniquePtr_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/UniquePtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/UniquePtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Compiler.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/UniquePtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/UniquePtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Pair.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Pair.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* A class holding a pair of objects that tries to conserve storage space. */

#ifndef mozilla_Pair_h
#define mozilla_Pair_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/Pair.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/Pair.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/Pair.h"

namespace mozilla {

namespace detail {

enum StorageType { AsBase, AsMember };

// Optimize storage using the Empty Base Optimization -- that empty base classes
// don't take up space -- to optimize size when one or the other class is
// stateless and can be used as a base class.
//
// The extra conditions on storage for B are necessary so that PairHelper won't
// ambiguously inherit from either A or B, such that one or the other base class
// would be inaccessible.
template<typename A, typename B,
         detail::StorageType =
           IsEmpty<A>::value ? detail::AsBase : detail::AsMember,
         detail::StorageType =
           IsEmpty<B>::value && !IsBaseOf<A, B>::value && !IsBaseOf<B, A>::value
           ? detail::AsBase
           : detail::AsMember>
struct PairHelper;

template<typename A, typename B>
struct PairHelper<A, B, AsMember, AsMember>
{
protected:
  

  
  
  
  

  

private:
  A mFirstA;
  B mSecondB;
};

template<typename A, typename B>
struct PairHelper<A, B, AsMember, AsBase> : private B
{
protected:
  template<typename AArg, typename BArg>
  PairHelper(AArg&& aA, BArg&& aB)
    : B(Forward<BArg>(aB)),
      mFirstA(Forward<AArg>(aA))
  {}

  A& first() { return mFirstA; }
  const A& first() const { return mFirstA; }
  B& second() { return *this; }
  

  

private:
  A mFirstA;
};

template<typename A, typename B>
struct PairHelper<A, B, AsBase, AsMember> : private A
{
protected:
  

  
  
  
  

  

private:
  B mSecondB;
};

template<typename A, typename B>
struct PairHelper<A, B, AsBase, AsBase> : private A, private B
{
protected:
  

  
  
  
  

  void swap(PairHelper& aOther)
  {
    Swap(static_cast<A&>(*this), static_cast<A&>(aOther));
    Swap(static_cast<B&>(*this), static_cast<B&>(aOther));
  }
};

} // namespace detail

/**
 * Pair is the logical concatenation of an instance of A with an instance B.
 * Space is conserved when possible.  Neither A nor B may be a final class.
 *
 * It's typically clearer to have individual A and B member fields.  Except if
 * you want the space-conserving qualities of Pair, you're probably better off
 * not using this!
 *
 * No guarantees are provided about the memory layout of A and B, the order of
 * initialization or destruction of A and B, and so on.  (This is approximately
 * required to optimize space usage.)  The first/second names are merely
 * conceptual!
 */
template<typename A, typename B>
struct Pair
  : private detail::PairHelper<A, B>
{
  typedef typename detail::PairHelper<A, B> Base;

public:
  template<typename AArg, typename BArg>
  Pair(AArg&& aA, BArg&& aB)
    : Base(Forward<AArg>(aA), Forward<BArg>(aB))
  {}

  /** The A instance. */
  using Base::first;
  /** The B instance. */
  using Base::second;

  /** Swap this pair with another pair. */
  void swap(Pair& aOther) { Base::swap(aOther); }

private:
  Pair(const Pair&) = delete;
};

template<typename A, class B>
void
Swap(Pair<A, B>& aX, Pair<A, B>& aY)
{
  aX.swap(aY);
}

} // namespace mozilla

#endif /* mozilla_Pair_h */
# 185 "../../dist/include/mozilla/Pair.h"
# 17 "../../dist/include/mozilla/UniquePtr.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/UniquePtr.h"

namespace mozilla {

template<typename T> class DefaultDelete;
template<typename T, class D = DefaultDelete<T>> class UniquePtr;

} // namespace mozilla

namespace mozilla {

/**
 * UniquePtr is a smart pointer that wholly owns a resource.  Ownership may be
 * transferred out of a UniquePtr through explicit action, but otherwise the
 * resource is destroyed when the UniquePtr is destroyed.
 *
 * UniquePtr is similar to C++98's std::auto_ptr, but it improves upon auto_ptr
 * in one crucial way: it's impossible to copy a UniquePtr.  Copying an auto_ptr
 * obviously *can't* copy ownership of its singly-owned resource.  So what
 * happens if you try to copy one?  Bizarrely, ownership is implicitly
 * *transferred*, preserving single ownership but breaking code that assumes a
 * A few miscellaneous notes:
 * (where simply returning a |UniquePtr| isn't possible), use a |UniquePtr&|
 * argument.  To unconditionally transfer ownership of a UniquePtr
 * into a method, use a |UniquePtr| argument.  To conditionally transfer
 * ownership of a resource into a method, should the method want it, use a
 * |UniquePtr&&| argument.
 */
template<typename T, class D>
class UniquePtr
{
public:
  typedef T* Pointer;
  typedef T ElementType;
  typedef D DeleterType;

private:
  Pair<Pointer, DeleterType> mTuple;

  Pointer& ptr() { return mTuple.first(); }
  const Pointer& ptr() const { return mTuple.first(); }

  DeleterType& del() { return mTuple.second(); }
  const DeleterType& del() const { return mTuple.second(); }

public:
  /**
   * Construct a UniquePtr containing |nullptr|.
   */
  MOZ_CONSTEXPR UniquePtr()
    : mTuple(static_cast<Pointer>(nullptr), DeleterType())
  {
    static_assert(!IsPointer<D>::value, "must provide a deleter instance");
    static_assert(!IsReference<D>::value, "must provide a deleter instance");
  }

  /**
   * Construct a UniquePtr containing |aPtr|.
   */
  explicit UniquePtr(Pointer aPtr)
    : mTuple(aPtr, DeleterType())
  {
    static_assert(!IsPointer<D>::value, "must provide a deleter instance");
    static_assert(!IsReference<D>::value, "must provide a deleter instance");
  }

  UniquePtr(Pointer aPtr,
            typename Conditional<IsReference<D>::value,
                                 D,
                                 const D&>::Type aD1)
    : mTuple(aPtr, aD1)
  {}

  // If you encounter an error with MSVC10 about RemoveReference below, along
  // the lines that "more than one partial specialization matches the template
  // argument list": don't use UniquePtr<T, reference to function>!  Ideally
  // you should make deletion use the same function every time, using a
  // deleter policy:
  //
  //   // BAD, won't compile with MSVC10, deleter doesn't need to be a
  //   // variable at all
  //   typedef void (&FreeSignature)(void*);
  //   UniquePtr<int, FreeSignature> ptr((int*) malloc(sizeof(int)), free);
  //
  //   // GOOD, compiles with MSVC10, deletion behavior statically known and
  //   // optimizable

  UniquePtr(UniquePtr&& aOther)
    : mTuple(aOther.release(), Forward<DeleterType>(aOther.getDeleter()))
  {}

  MOZ_IMPLICIT
  UniquePtr(decltype(nullptr))
    : mTuple(nullptr, DeleterType())
  {
    static_assert(!IsPointer<D>::value, "must provide a deleter instance");
    static_assert(!IsReference<D>::value, "must provide a deleter instance");
  }

  template<typename U, class E>
  UniquePtr(UniquePtr<U, E>&& aOther,
            typename EnableIf<IsConvertible<typename UniquePtr<U, E>::Pointer,
                                            Pointer>::value &&
                              !IsArray<U>::value &&
                              (IsReference<D>::value
                               ? IsSame<D, E>::value
                               : IsConvertible<E, D>::value),
                              int>::Type aDummy = 0)
    : mTuple(aOther.release(), Forward<E>(aOther.getDeleter()))
  {
  }

  ~UniquePtr() { reset(nullptr); }

  UniquePtr& operator=(UniquePtr&& aOther)
  {
    reset(aOther.release());
    getDeleter() = Forward<DeleterType>(aOther.getDeleter());
    return *this;
  }

  template<typename U, typename E>
  UniquePtr& operator=(UniquePtr<U, E>&& aOther)
  {
    static_assert(IsConvertible<typename UniquePtr<U, E>::Pointer,
                                Pointer>::value,
                  "incompatible UniquePtr pointees");
    static_assert(!IsArray<U>::value,
                  "can't assign from UniquePtr holding an array");

    reset(aOther.release());
    getDeleter() = Forward<E>(aOther.getDeleter());
    return *this;
  }

  UniquePtr& operator=(decltype(nullptr))
  {
    reset(nullptr);
    return *this;
  }

  T& operator*() const { return *get(); }
  Pointer operator->() const
  {
    MOZ_ASSERT(get(), "dereferencing a UniquePtr containing nullptr");
    return get();
  }

  explicit operator bool() const { return get() != nullptr; }

  Pointer get() const { return ptr(); }

  DeleterType& getDeleter() { return del(); }
  const DeleterType& getDeleter() const { return del(); }

  Pointer release()
  {
    Pointer p = ptr();
    ptr() = nullptr;
    return p;
  }

  void reset(Pointer aPtr = Pointer())
  {
    Pointer old = ptr();
    ptr() = aPtr;
    if (old != nullptr) {
      getDeleter()(old);
    }
  }

  void swap(UniquePtr& aOther)
  {
    mTuple.swap(aOther.mTuple);
  }

private:
  UniquePtr(const UniquePtr& aOther) = delete; // construct using Move()!
  void operator=(const UniquePtr& aOther) = delete; // assign using Move()!
};

// In case you didn't read the comment by the main definition (you should!): the
// UniquePtr<T[]> specialization exists to manage array pointers.  It deletes
// such pointers using delete[], it will reject construction and modification
// attempts using U* or U[].  Otherwise it works like the normal UniquePtr.
template<typename T, class D>
class UniquePtr<T[], D>
{
public:
  typedef T* Pointer;
  typedef T ElementType;
  typedef D DeleterType;

private:
  Pair<Pointer, DeleterType> mTuple;

public:
  /**
   * Construct a UniquePtr containing nullptr.
   */
  MOZ_CONSTEXPR UniquePtr()
    : mTuple(static_cast<Pointer>(nullptr), DeleterType())
  {
    static_assert(!IsPointer<D>::value, "must provide a deleter instance");
    static_assert(!IsReference<D>::value, "must provide a deleter instance");
  }

  /**
   * Construct a UniquePtr containing |aPtr|.
   */
  // comment by this constructor in the non-T[] specialization above.
  UniquePtr(Pointer aPtr,
            typename RemoveReference<D>::Type&& aD2)
    : mTuple(aPtr, Move(aD2))
  {
    static_assert(!IsReference<D>::value,
                  "rvalue deleter can't be stored by reference");
  }

private:
  // Forbidden for the same reasons as stated above.
  template<typename U, typename V>
  UniquePtr(U&& aU, V&& aV,
            typename EnableIf<IsPointer<U>::value &&
                              IsConvertible<U, Pointer>::value,
                              int>::Type aDummy = 0)
  = delete;

public:
  UniquePtr(UniquePtr&& aOther)
    : mTuple(aOther.release(), Forward<DeleterType>(aOther.getDeleter()))
  {}
public:
  void swap(UniquePtr& aOther) { mTuple.swap(aOther.mTuple); }

private:
  UniquePtr(const UniquePtr& aOther) = delete; // construct using Move()!
  void operator=(const UniquePtr& aOther) = delete; // assign using Move()!
};

/** A default deletion policy using plain old operator delete. */
template<typename T>
class DefaultDelete
{
public:
  MOZ_CONSTEXPR DefaultDelete() {}

  template<typename U>
  DefaultDelete(const DefaultDelete<U>& aOther,
                typename EnableIf<mozilla::IsConvertible<U*, T*>::value,
                                  int>::Type aDummy = 0)
  {}

  void operator()(T* aPtr) const
  {
    static_assert(sizeof(T) > 0, "T must be complete");
    delete aPtr;
  }
};

/** A default deletion policy using operator delete[]. */
template<typename T>
class DefaultDelete<T[]>
{
public:
  MOZ_CONSTEXPR DefaultDelete() {}

  void operator()(T* aPtr) const
  {
    static_assert(sizeof(T) > 0, "T must be complete");
    delete[] aPtr;
  }

private:
  template<typename U>
  void operator()(U* aPtr) const = delete;
};

template<typename T, class D>
void
Swap(UniquePtr<T, D>& aX, UniquePtr<T, D>& aY)
{
  aX.swap(aY);
}

template<typename T, class D, typename U, class E>
bool
operator==(const UniquePtr<T, D>& aX, const UniquePtr<U, E>& aY)
{
  return aX.get() == aY.get();
}

template<typename T, class D, typename U, class E>
bool
operator!=(const UniquePtr<T, D>& aX, const UniquePtr<U, E>& aY)
{
  return aX.get() != aY.get();
}

template<typename T, class D>
bool
operator==(const UniquePtr<T, D>& aX, decltype(nullptr))
{
  return !aX;
}

template<typename T, class D>
bool
operator==(decltype(nullptr), const UniquePtr<T, D>& aX)
{
  return !aX;
}

template<typename T, class D>
bool
operator!=(const UniquePtr<T, D>& aX, decltype(nullptr))
{
  return bool(aX);
}

template<typename T, class D>
bool
operator!=(decltype(nullptr), const UniquePtr<T, D>& aX)
{
  return bool(aX);
}

// No operator<, operator>, operator<=, operator>= for now because simplicity.

namespace detail {

template<typename T>
struct UniqueSelector
{
  typedef UniquePtr<T> SingleObject;
};

template<typename T>
struct UniqueSelector<T[]>
{
  typedef UniquePtr<T[]> UnknownBound;
};

template<typename T, decltype(sizeof(int)) N>
struct UniqueSelector<T[N]>
{
  typedef UniquePtr<T[N]> KnownBound;
};

} // namespace detail

/**
 * MakeUnique is a helper function for allocating new'd objects and arrays,
 * returning a UniquePtr containing the resulting pointer.  The semantics of
 * MakeUnique<Type>(...) are as follows.
 *
 *   If Type is an array T[n]:
 *     Disallowed, deleted, no overload for you!
 *   If Type is an array T[]:
 *     MakeUnique<T[]>(size_t) is the only valid overload.  The pointer returned
 *     is as if by |new T[n]()|, which value-initializes each element.  (If T
 *     isn't a class type, this will zero each element.  If T is a class type,
 *     then roughly speaking, each element will be constructed using its default
 *     constructor.  See C++11 [dcl.init]p7 for the full gory details.)
 *   If Type is non-array T:
 *   p.reset(new char);      // works, but fugly
 *   p = MakeUnique<char>(); // preferred
 *
 * (And third, although not relevant to Mozilla: MakeUnique is exception-safe.
 * An exception thrown after |new T| succeeds will leak that memory, unless the
 * pointer is assigned to an object that will manage its ownership.  UniquePtr
 * ably serves this function.)
 */

// We don't have variadic template support everywhere, so just hard-code arities
// 0-8 for now.  If you need more arguments, feel free to add the extra
// overloads (and deletions for the T = E[N] case).

template<typename T, typename... Args>
typename detail::UniqueSelector<T>::SingleObject
MakeUnique(Args&&... aArgs)
{
  return UniquePtr<T>(new T(Forward<Args>(aArgs)...));
}

template<typename T>
typename detail::UniqueSelector<T>::UnknownBound
MakeUnique(decltype(sizeof(int)) aN)
{
  typedef typename RemoveExtent<T>::Type ArrayType;
  return UniquePtr<T>(new ArrayType[aN]());
}

template<typename T, typename... Args>
typename detail::UniqueSelector<T>::KnownBound
MakeUnique(Args&&... aArgs) = delete;

} // namespace mozilla

#endif /* mozilla_UniquePtr_h */
# 664 "../../dist/include/mozilla/UniquePtr.h"
# 17 "../../dist/include/js/Utility.h" 2

#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
#define JS_STATIC_ASSERT(cond)           static_assert(cond, "JS_STATIC_ASSERT")
#define JS_STATIC_ASSERT_IF(cond, expr)  MOZ_STATIC_ASSERT_IF(cond, expr, "JS_STATIC_ASSERT_IF")

extern MOZ_NORETURN MOZ_COLD JS_PUBLIC_API(void)
JS_Assert(const char *s, const char *file, int ln);

/*
 * Custom allocator support for SpiderMonkey
 */
#if defined JS_USE_CUSTOM_ALLOCATOR
#if 0 /* expanded by -frewrite-includes */
# include "jscustomallocator.h"
#endif /* expanded by -frewrite-includes */
# 64 "../../dist/include/js/Utility.h"
#else
# 65 "../../dist/include/js/Utility.h"
# if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
/*
 * In order to test OOM conditions, when the testing function
 * oomAfterAllocations COUNT is passed, we fail continuously after the NUM'th
 * allocation from now.
 */
extern JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations; /* set in builtin/TestingFunctions.cpp */
extern JS_PUBLIC_DATA(uint32_t) OOM_counter; /* data race, who cares. */

#ifdef JS_OOM_BREAKPOINT
static MOZ_NEVER_INLINE void js_failedAllocBreakpoint() { asm(""); }
#define JS_OOM_CALL_BP_FUNC() js_failedAllocBreakpoint()
#else
# 78 "../../dist/include/js/Utility.h"
#define JS_OOM_CALL_BP_FUNC() do {} while(0)
#endif
# 80 "../../dist/include/js/Utility.h"

#  define JS_OOM_POSSIBLY_FAIL() \
    do \
    { \
        if (++OOM_counter > OOM_maxAllocations) { \
            JS_OOM_CALL_BP_FUNC();\
            return nullptr; \
        } \
    } while (0)
#  define JS_OOM_POSSIBLY_FAIL_BOOL() \
    do \
    { \
        if (++OOM_counter > OOM_maxAllocations) { \
            JS_OOM_CALL_BP_FUNC();\
            return false; \
        } \
    } while (0)

# else
# 99 "../../dist/include/js/Utility.h"
#  define JS_OOM_POSSIBLY_FAIL() do {} while(0)
#  define JS_OOM_POSSIBLY_FAIL_BOOL() do {} while(0)
# endif /* DEBUG || JS_OOM_BREAKPOINT */
# 102 "../../dist/include/js/Utility.h"

static inline void* js_malloc(size_t bytes)
{
    JS_OOM_POSSIBLY_FAIL();
    return malloc(bytes);
}

static inline void* js_calloc(size_t bytes)
{
    JS_OOM_POSSIBLY_FAIL();
    return calloc(bytes, 1);
}

static inline void* js_calloc(size_t nmemb, size_t size)
{
    JS_OOM_POSSIBLY_FAIL();
    return calloc(nmemb, size);
}



static inline void js_free(void* p)
{
    free(p);
}


#endif/* JS_USE_CUSTOM_ALLOCATOR */
# 138 "../../dist/include/js/Utility.h"

#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
# 140 "../../dist/include/js/Utility.h"

/*
 * Low-level memory management in SpiderMonkey:
 *
 *  ** Do not use the standard malloc/free/realloc: SpiderMonkey allows these
 *     to be redefined (via JS_USE_CUSTOM_ALLOCATOR) and Gecko even #define's
 *     FreeOp::{free_,delete_}
 *
 *   The advantage of these operations is that the memory is batched and freed
 *   on another thread.
 */

/*
 * Given a class which should provide a 'new' method, add
 * JS_DECLARE_NEW_METHODS (see js::MallocProvider for an example).
 *
 * Note: Do not add a ; at the end of a use of JS_DECLARE_NEW_METHODS,
 * or the build will break.
 */
#define JS_DECLARE_NEW_METHODS(NEWNAME, ALLOCATOR, QUALIFIERS)\
    template <class T, typename... Args> \
    QUALIFIERS T * \
    NEWNAME(Args&&... args) MOZ_HEAP_ALLOCATOR { \
        void *memory = ALLOCATOR(sizeof(T)); \
        return memory \
               ? new(memory) T(mozilla::Forward<Args>(args)...) \
               : nullptr; \
    }

/*
 * Given a class which should provide 'make' methods, add
 * JS_DECLARE_MAKE_METHODS (see js::MallocProvider for an example).  This
 * method is functionally the same as JS_DECLARE_NEW_METHODS: it just declares
 * methods that return mozilla::UniquePtr instances that will singly-manage
 * ownership of the created object.
 *
 * Note: Do not add a ; at the end of a use of JS_DECLARE_MAKE_METHODS,
 * or the build will break.
 */
#define JS_DECLARE_MAKE_METHODS(MAKENAME, NEWNAME, QUALIFIERS)\
    template <class T, typename... Args> \
    QUALIFIERS mozilla::UniquePtr<T, JS::DeletePolicy<T>> \
    MAKENAME(Args&&... args) MOZ_HEAP_ALLOCATOR { \
        T *ptr = NEWNAME<T>(mozilla::Forward<Args>(args)...); \
        return mozilla::UniquePtr<T, JS::DeletePolicy<T>>(ptr); \
    }

JS_DECLARE_NEW_METHODS(js_new, js_malloc, static MOZ_ALWAYS_INLINE)









template <class T>
static MOZ_ALWAYS_INLINE T *
js_pod_malloc(size_t numElems)
{
    if (MOZ_UNLIKELY(numElems & mozilla::tl::MulOverflowMask<sizeof(T)>::value))
        return nullptr;
    return (T *)js_malloc(numElems * sizeof(T));
}





namespace js {

template<typename T>
struct ScopedFreePtrTraits
{
    typedef T* type;
    
    
};
SCOPED_TEMPLATE(ScopedJSFreePtr, ScopedFreePtrTraits)

template <typename T>
struct ScopedDeletePtrTraits : public ScopedFreePtrTraits<T>
{
    
};
SCOPED_TEMPLATE(ScopedJSDeletePtr, ScopedDeletePtrTraits)

template <typename T>
struct ScopedReleasePtrTraits : public ScopedFreePtrTraits<T>
{
    
};
SCOPED_TEMPLATE(ScopedReleasePtr, ScopedReleasePtrTraits)

} /* namespace js */

namespace JS {

template<typename T>
struct DeletePolicy
{
    
};

struct FreePolicy
{
    
};

} // namespace JS

namespace js {

/* Integral types for all hash functions. */
typedef uint32_t HashNumber;
const unsigned HashNumberSizeBits = 32;

typedef mozilla::UniquePtr<char, JS::FreePolicy> UniqueChars;



namespace detail {

/*
 * Given a raw hash code, h, return a number that can be used to select a hash
 * bucket.
 *
 * This function aims to produce as uniform an output distribution as possible,
 * especially in the most significant (leftmost) bits, even though the input
 * distribution may be highly nonrandom, given the constraints that this must
 * be deterministic and quick to compute.
 *
 * Since the leftmost bits of the result are best, the hash bucket index is
 * computed by doing ScrambleHashCode(h) / (2^32/N) or the equivalent
 * right-shift, not ScrambleHashCode(h) % N or the equivalent bit-mask.
 *
 * FIXME: OrderedHashTable uses a bit-mask; see bug 775896.
 */


} /* namespace detail */

} /* namespace js */

namespace JS {

/*
 * Methods for poisoning GC heap pointer words and checking for poisoned words.
 * These are in this file for use in Value methods and so forth.
 *
 * If the moving GC hazard analysis is in use and detects a non-rooted stack
 * pointer to a GC thing, one byte of that pointer is poisoned to refer to an
 * invalid location. For both 32 bit and 64 bit systems, the fourth byte of the
 * pointer is overwritten, to reduce the likelihood of accidentally changing
 * a live integer value.
 */



template <typename T>
inline bool IsPoisonedPtr(T *v)
{
#if defined(JSGC_ROOT_ANALYSIS) && defined(JS_DEBUG)
    uint32_t mask = uintptr_t(v) & 0xff000000;
    return mask == uint32_t(JS_FREE_PATTERN << 24);
#else
# 413 "../../dist/include/js/Utility.h"
    return false;
#endif
# 415 "../../dist/include/js/Utility.h"
}

}

/* sixgill annotation defines */
#ifndef HAVE_STATIC_ANNOTATIONS
# define HAVE_STATIC_ANNOTATIONS
# ifdef XGILL_PLUGIN
#  define STATIC_PRECONDITION(COND)         __attribute__((precondition(#COND)))
#  define STATIC_PRECONDITION_ASSUME(COND)  __attribute__((precondition_assume(#COND)))
# endif /* XGILL_PLUGIN */
# 457 "../../dist/include/js/Utility.h"
# define STATIC_SKIP_INFERENCE STATIC_INVARIANT(skip_inference())
#endif /* HAVE_STATIC_ANNOTATIONS */
# 459 "../../dist/include/js/Utility.h"

#endif /* js_Utility_h */
# 461 "../../dist/include/js/Utility.h"
# 19 "../../dist/include/jsalloc.h" 2

namespace js {

struct ContextFriendFields;

/* Policy for using system memory functions and doing no error reporting. */
class SystemAllocPolicy
{
  public:
    
    
    
    
    
};

/*
 * Allocation policy that calls the system memory functions and reports errors
 * to the context. Since the JSContext given on construction is stored for
 * the lifetime of the container, this policy may only be used for containers
 * whose lifetime is a shorter than the given JSContext.
 *
 * FIXME bug 647103 - rewrite this in terms of temporary allocation functions,
 * not the system ones.
 */
class TempAllocPolicy
{
    ContextFriendFields *const cx_;

    /*
     * Non-inline helper to call JSRuntime::onOutOfMemory with minimal
     * code bloat.
     */
    JS_FRIEND_API(void *) onOutOfMemory(void *p, size_t nbytes);

  public:
    MOZ_IMPLICIT TempAllocPolicy(JSContext *cx) : cx_((ContextFriendFields *) cx) {} // :(
    MOZ_IMPLICIT TempAllocPolicy(ContextFriendFields *cx) : cx_(cx) {}

    template <typename T>
    T *pod_malloc(size_t numElems) {
        T *p = js_pod_malloc<T>(numElems);
        if (MOZ_UNLIKELY(!p))
            p = static_cast<T *>(onOutOfMemory(nullptr, numElems * sizeof(T)));
        return p;
    }

    

    

    void free_(void *p) {
        js_free(p);
    }

    JS_FRIEND_API(void) reportAllocOverflow() const;
};

} /* namespace js */

#endif /* jsalloc_h */
# 94 "../../dist/include/jsalloc.h"
# 11 "../../dist/include/js/TracingAPI.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/jspubtd.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef jspubtd_h
#define jspubtd_h

/*
 * JS public API typedefs.
 */

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/jspubtd.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/LinkedList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/LinkedList.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* A type-safe doubly-linked list class. */

/*
 * The classes LinkedList<T> and LinkedListElement<T> together form a
 * convenient, type-safe doubly-linked list implementation.
 *
 * The class T which will be inserted into the linked list must inherit from
 * LinkedListElement<T>.  A given object may be in only one linked list at a
 * time.
 *     }
 *
 *     void notifyObservers(char* aTopic)
 *     {
 *       for (Observer* o = list.getFirst(); o != nullptr; o = o->getNext()) {
 *         o->observe(aTopic);
 *       }
 *     }
 *   };
 *
 * Additionally, the class AutoCleanLinkedList<T> is a LinkedList<T> that will
 * remove and delete each element still within itself upon destruction. Note
 * that because each element is deleted, elements must have been allocated
 * using |new|.
 */

#ifndef mozilla_LinkedList_h
#define mozilla_LinkedList_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 68 "../../dist/include/mozilla/LinkedList.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 69 "../../dist/include/mozilla/LinkedList.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/MemoryReporting.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Memory reporting infrastructure. */

#ifndef mozilla_MemoryReporting_h
#define mozilla_MemoryReporting_h

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
# 85 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#define offsetof(t, d) __builtin_offsetof(t, d)

#endif /* __STDDEF_H */
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
__WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
#if defined(__need_wint_t)
/* Always define wint_t when modules are available. */
#if !defined(_WINT_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 13 "../../dist/include/mozilla/MemoryReporting.h" 2

#ifdef __cplusplus

namespace mozilla {

/*
 * This is for functions that are like malloc_usable_size.  Such functions are
 * used for measuring the size of data structures.
 */
typedef size_t (*MallocSizeOf)(const void* p);

} /* namespace mozilla */

#endif /* __cplusplus */
# 27 "../../dist/include/mozilla/MemoryReporting.h"

typedef size_t (*MozMallocSizeOf)(const void* p);

#endif /* mozilla_MemoryReporting_h */
# 31 "../../dist/include/mozilla/MemoryReporting.h"
# 70 "../../dist/include/mozilla/LinkedList.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 71 "../../dist/include/mozilla/LinkedList.h"

#ifdef __cplusplus

namespace mozilla {

template<typename T>
class LinkedList;

template<typename T>
class LinkedListElement
{
  /*
   */

private:
  LinkedListElement* mNext;
  LinkedListElement* mPrev;
  const bool mIsSentinel;

public:
  

  

  ~LinkedListElement()
  {
    if (!mIsSentinel && isInList()) {
      remove();
    }
  }

  /*
   * Get the next element in the list, or nullptr if this is the last element
   * in the list.
   */
  
  

  /*
   * Get the previous element in the list, or nullptr if this is the first
   * element in the list.
   */
  
  

  /*
   * Insert aElem after this element in the list.  |this| must be part of a
   * linked list when you call setNext(); otherwise, this method will assert.
   */
  void setNext(T* aElem)
  {
    MOZ_ASSERT(isInList());
    setNextUnsafe(aElem);
  }

  /*
   * Insert aElem before this element in the list.  |this| must be part of a
   * linked list when you call setPrevious(); otherwise, this method will
   * assert.
   */
  void setPrevious(T* aElem)
  {
    MOZ_ASSERT(isInList());
    setPreviousUnsafe(aElem);
  }

  /*
   * Remove this element from the list which contains it.  If this element is
   * not currently part of a linked list, this method asserts.
   */
  void remove()
  {
    MOZ_ASSERT(isInList());

    mPrev->mNext = mNext;
    mNext->mPrev = mPrev;
    mNext = this;
    mPrev = this;
  }

  /*
   * Identical to remove(), but also asserts in debug builds that this element
   * is in aList.
   */
  void removeFrom(const LinkedList<T>& aList)
  {
    aList.assertContains(asT());
    remove();
  }

  /*
   * Return true if |this| part is of a linked list, and false otherwise.
   */
  bool isInList() const
  {
    MOZ_ASSERT((mNext == this) == (mPrev == this));
    return mNext != this;
  }

private:
  friend class LinkedList<T>;

  enum NodeKind {
    NODE_KIND_NORMAL,
    NODE_KIND_SENTINEL
  };

  explicit LinkedListElement(NodeKind nodeKind)
    : mNext(this),
      mPrev(this),
      mIsSentinel(nodeKind == NODE_KIND_SENTINEL)
  { }

  /*
   * Return |this| cast to T* if we're a normal node, or return nullptr if
   * we're a sentinel node.
   */
  T* asT()
  {
    return mIsSentinel ? nullptr : static_cast<T*>(this);
  }
  const T* asT() const
  {
    return mIsSentinel ? nullptr : static_cast<const T*>(this);
  }

  /*
   * Insert aElem after this element, but don't check that this element is in
   * the list.  This is called by LinkedList::insertFront().
   */
  void setNextUnsafe(T* aElem)
  {
    LinkedListElement *listElem = static_cast<LinkedListElement*>(aElem);
    MOZ_ASSERT(!listElem->isInList());

    listElem->mNext = this->mNext;
    listElem->mPrev = this;
    this->mNext->mPrev = listElem;
  }

private:
  LinkedListElement& operator=(const LinkedListElement<T>& aOther) = delete;
  LinkedListElement(const LinkedListElement<T>& aOther) = delete;
};

template<typename T>
class LinkedList
{
private:
  LinkedListElement<T> sentinel;

public:
  LinkedList() : sentinel(LinkedListElement<T>::NODE_KIND_SENTINEL) { }

  LinkedList(LinkedList<T>&& aOther)
    : sentinel(mozilla::Move(aOther.sentinel))
  { }

  ~LinkedList() { MOZ_ASSERT(isEmpty()); }

  /*
   * Add aElem to the front of the list.
   */
  void insertFront(T* aElem)
  {
    /* Bypass setNext()'s this->isInList() assertion. */
    sentinel.setNextUnsafe(aElem);
  }

  /*
   * Add aElem to the back of the list.
   */
  void insertBack(T* aElem)
  {
    sentinel.setPreviousUnsafe(aElem);
  }

  /*
   * Get the first element of the list, or nullptr if the list is empty.
   */
  T* getFirst()             { return sentinel.getNext(); }
  const T* getFirst() const { return sentinel.getNext(); }

  /*
   * Get the last element of the list, or nullptr if the list is empty.
   */
  T* getLast()             { return sentinel.getPrevious(); }
  const T* getLast() const { return sentinel.getPrevious(); }

  /*
   * Get and remove the first element of the list.  If the list is empty,
   * return nullptr.
   */
  T* popFirst()
  {
    T* ret = sentinel.getNext();
    if (ret) {
      static_cast<LinkedListElement<T>*>(ret)->remove();
    }
    return ret;
  }

  bool isEmpty() const
  {
    return !sentinel.isInList();
  }

  /*
   * Remove all the elements from the list.
   *
   * This runs in time linear to the list's length, because we have to mark
   * each element as not in the list.
   */
  void clear()
  {
    while (popFirst()) {
      continue;
    }
  }

  /*
   * Measures the memory consumption of the list excluding |this|.  Note that
   * it only measures the list elements themselves.  If the list elements
   * contain pointers to other memory blocks, those blocks must be measured
   * separately during a subsequent iteration over the list.
   */
  size_t sizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
  {
    size_t n = 0;
    for (const T* t = getFirst(); t; t = t->getNext()) {
      n += aMallocSizeOf(t);
    }
    return n;
  }

  /*
   * Like sizeOfExcludingThis(), but measures |this| as well.
   */
  size_t sizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
  {
    return aMallocSizeOf(this) + sizeOfExcludingThis(aMallocSizeOf);
  }

  /*
   * In a debug build, make sure that the list is sane (no cycles, consistent
   * mNext/mPrev pointers, only one sentinel).  Has no effect in release builds.
   */
  void debugAssertIsSane() const
  {
#ifdef DEBUG
    const LinkedListElement<T>* slow;
    const LinkedListElement<T>* fast1;
    const LinkedListElement<T>* fast2;

    /*
     * Check for cycles in the forward singly-linked list using the
     * tortoise/hare algorithm.
     */
    for (slow = sentinel.mNext,
         fast1 = sentinel.mNext->mNext,
         fast2 = sentinel.mNext->mNext->mNext;
         slow != &sentinel && fast1 != &sentinel && fast2 != &sentinel;
         slow = slow->mNext, fast1 = fast2->mNext, fast2 = fast1->mNext) {
      MOZ_ASSERT(slow != fast1);
      MOZ_ASSERT(slow != fast2);
    }

    /* Check for cycles in the backward singly-linked list. */
    for (slow = sentinel.mPrev,
         fast1 = sentinel.mPrev->mPrev,
         fast2 = sentinel.mPrev->mPrev->mPrev;
         slow != &sentinel && fast1 != &sentinel && fast2 != &sentinel;
         slow = slow->mPrev, fast1 = fast2->mPrev, fast2 = fast1->mPrev) {
      MOZ_ASSERT(slow != fast1);
      MOZ_ASSERT(slow != fast2);
    }

    /*
     * Check that |sentinel| is the only node in the list with
     * mIsSentinel == true.
     */
    for (const LinkedListElement<T>* elem = sentinel.mNext;
         elem != &sentinel;
         elem = elem->mNext) {
      MOZ_ASSERT(!elem->mIsSentinel);
    }

    /* Check that the mNext/mPrev pointers match up. */
    const LinkedListElement<T>* prev = &sentinel;
    const LinkedListElement<T>* cur = sentinel.mNext;
    do {
        MOZ_ASSERT(cur->mPrev == prev);
        MOZ_ASSERT(prev->mNext == cur);

        prev = cur;
        cur = cur->mNext;
    } while (cur != &sentinel);
#endif /* ifdef DEBUG */
  }
};

} /* namespace mozilla */

#endif /* __cplusplus */
# 500 "../../dist/include/mozilla/LinkedList.h"

#endif /* mozilla_LinkedList_h */
# 502 "../../dist/include/mozilla/LinkedList.h"
# 16 "../../dist/include/jspubtd.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/PodOperations.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/PodOperations.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Operations for zeroing POD types, arrays, and so on.
 *
 * These operations are preferable to memset, memcmp, and the like because they
 * don't require remembering to multiply by sizeof(T), array lengths, and so on
 * everywhere.
 */

#ifndef mozilla_PodOperations_h
#define mozilla_PodOperations_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Array.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Array.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* A compile-time constant-length array with bounds-checking assertions. */

#ifndef mozilla_Array_h
#define mozilla_Array_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/Array.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/Array.h"

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#if !defined(_SIZE_T) || __has_feature(modules)
/* Always define size_t when modules are available. */
#if !__has_feature(modules)
#define _SIZE_T
#endif
# 42 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ size_t;
#endif
# 44 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is
 * enabled. */
#if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \
     !defined(_RSIZE_T)) || __has_feature(modules)
/* Always define rsize_t when modules are available. */
#if !__has_feature(modules)
#define _RSIZE_T
#endif
# 53 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ rsize_t;
#endif
# 55 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#ifndef __cplusplus
/* Always define wchar_t when modules are available. */
#if !defined(_WCHAR_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WCHAR_T
#if defined(_MSC_EXTENSIONS)
#define _WCHAR_T_DEFINED
#endif
# 64 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 65 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WCHAR_TYPE__ wchar_t;
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 68 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#undef NULL
#ifdef __cplusplus
#  if !defined(__MINGW32__) && !defined(_MSC_VER)
#    define NULL __null
#  else
# 74 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#    define NULL 0
#  endif
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 16 "../../dist/include/mozilla/Array.h" 2

namespace mozilla {

template<typename T, size_t Length>
class Array
{
  T mArr[Length];

public:
  T& operator[](size_t aIndex)
  {
    MOZ_ASSERT(aIndex < Length);
    return mArr[aIndex];
  }

  const T& operator[](size_t aIndex) const
  {
    MOZ_ASSERT(aIndex < Length);
    return mArr[aIndex];
  }
};

template<typename T>
class Array<T, 0>
{
public:
  T& operator[](size_t aIndex)
  {
    MOZ_CRASH("indexing into zero-length array");
  }

  const T& operator[](size_t aIndex) const
  {
    MOZ_CRASH("indexing into zero-length array");
  }
};

}  /* namespace mozilla */

#endif /* mozilla_Array_h */
#ifndef mozilla_ArrayUtils_h
#define mozilla_ArrayUtils_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/ArrayUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/ArrayUtils.h"

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
/* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
__WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
#if defined(__need_wint_t)
/* Always define wint_t when modules are available. */
#if !defined(_WINT_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 18 "../../dist/include/mozilla/ArrayUtils.h" 2

#ifdef __cplusplus

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Alignment.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Alignment.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Functionality related to memory alignment. */

#ifndef mozilla_Alignment_h
#define mozilla_Alignment_h

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#if !defined(_SIZE_T) || __has_feature(modules)
/* Always define size_t when modules are available. */
#if !__has_feature(modules)
#define _SIZE_T
#endif
# 42 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ size_t;
#endif
# 44 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is
 * enabled. */
#if !defined(_WINT_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 13 "../../dist/include/mozilla/Alignment.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/Alignment.h"

namespace mozilla {

/*
 * This class, and the corresponding macro MOZ_ALIGNOF, figures out how many
 * bytes of alignment a given type needs.
 */
template<typename T>
class AlignmentFinder
{
  struct Aligner
  {
    char mChar;
    T mT;
  };

public:
  static const size_t alignment = sizeof(Aligner) - sizeof(T);
};

#define MOZ_ALIGNOF(T) mozilla::AlignmentFinder<T>::alignment

/*
 * Declare the MOZ_ALIGNED_DECL macro for declaring aligned types.
 *
 * For instance,
 *
 *   MOZ_ALIGNED_DECL(char arr[2], 8);
 *
 * will declare a two-character array |arr| aligned to 8 bytes.
 */

#if defined(__GNUC__)
#  define MOZ_ALIGNED_DECL(_type, _align) \
     _type __attribute__((aligned(_align)))
#elif defined(_MSC_VER)
# 50 "../../dist/include/mozilla/Alignment.h"
#  define MOZ_ALIGNED_DECL(_type, _align) \
     __declspec(align(_align)) _type
#else
# 53 "../../dist/include/mozilla/Alignment.h"
#  warning "We don't know how to align variables on this compiler."
#  define MOZ_ALIGNED_DECL(_type, _align) _type
#endif
# 56 "../../dist/include/mozilla/Alignment.h"

/*
 * AlignedElem<N> is a structure whose alignment is guaranteed to be at least N
 * bytes.
 *
 * We support 1, 2, 4, 8, and 16-bit alignment.
 */
template<size_t Align>
struct AlignedElem;

/*
 * We have to specialize this template because GCC doesn't like
 * __attribute__((aligned(foo))) where foo is a template parameter.
 */

template<>
struct AlignedElem<1>
{
  MOZ_ALIGNED_DECL(uint8_t elem, 1);
};

template<>
struct AlignedElem<2>
{
  MOZ_ALIGNED_DECL(uint8_t elem, 2);
};

template<>
struct AlignedElem<4>
{
  MOZ_ALIGNED_DECL(uint8_t elem, 4);
};

template<>
struct AlignedElem<8>
{
  MOZ_ALIGNED_DECL(uint8_t elem, 8);
};

template<>
struct AlignedElem<16>
{
  MOZ_ALIGNED_DECL(uint8_t elem, 16);
};

/*
 * This utility pales in comparison to Boost's aligned_storage. The utility
 * simply assumes that uint64_t is enough alignment for anyone. This may need
 * to be extended one day...
 *
 * As an important side effect, pulling the storage into this template is
 * enough obfuscation to confuse gcc's strict-aliasing analysis into not giving
 * false negatives when we cast from the char buffer to whatever type we've
 * constructed using the bytes.
 */
template<size_t Nbytes>
struct AlignedStorage
{
  union U
  {
    char mBytes[Nbytes];
    uint64_t mDummy;
  } u;

  const void* addr() const { return u.mBytes; }
  void* addr() { return u.mBytes; }
};

template<typename T>
struct AlignedStorage2
{
  union U
  {
    char mBytes[sizeof(T)];
    uint64_t mDummy;
  } u;

  const T* addr() const { return reinterpret_cast<const T*>(u.mBytes); }
  T* addr() { return static_cast<T*>(static_cast<void*>(u.mBytes)); }
};

} /* namespace mozilla */

#endif /* mozilla_Alignment_h */
# 140 "../../dist/include/mozilla/Alignment.h"
# 22 "../../dist/include/mozilla/ArrayUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Array.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/mozilla/ArrayUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/mozilla/ArrayUtils.h"

namespace mozilla {

/*
 * Safely subtract two pointers when it is known that aEnd >= aBegin, yielding a
 * size_t result.
 *
 * Ordinary pointer subtraction yields a ptrdiff_t result, which, being signed,
 * has insufficient range to express the distance between pointers at opposite
 * ends of the address space. Furthermore, most compilers use ptrdiff_t to
 * represent the intermediate byte address distance, before dividing by
 * sizeof(T); if that intermediate result overflows, they'll produce results
 * with the wrong sign even when the correct scaled distance would fit in a
 * ptrdiff_t.
 */
template<class T>
MOZ_ALWAYS_INLINE size_t
PointerRangeSize(T* aBegin, T* aEnd)
{
  MOZ_ASSERT(aEnd >= aBegin);
  return (size_t(aEnd) - size_t(aBegin)) / sizeof(T);
}

/*
 * Compute the length of an array with constant length.  (Use of this method
 * with a non-array pointer will not compile.)
 *
 * Beware of the implicit trailing '\0' when using this with string constants.
 */
template<typename T, size_t N>
MOZ_CONSTEXPR size_t
ArrayLength(T (&aArr)[N])
{
  return N;
}

template<typename T, size_t N>
MOZ_CONSTEXPR size_t
ArrayLength(const Array<T, N>& aArr)
{
  return N;
}

/*
 * Compute the address one past the last element of a constant-length array.
 *
 * Beware of the implicit trailing '\0' when using this with string constants.
 */
template<typename T, size_t N>
MOZ_CONSTEXPR T*
ArrayEnd(T (&aArr)[N])
{
  return aArr + ArrayLength(aArr);
}

template<typename T, size_t N>
MOZ_CONSTEXPR T*
ArrayEnd(Array<T, N>& aArr)
{
  return &aArr[0] + ArrayLength(aArr);
}

template<typename T, size_t N>
MOZ_CONSTEXPR const T*
ArrayEnd(const Array<T, N>& aArr)
{
  return &aArr[0] + ArrayLength(aArr);
}

namespace detail {

template<typename AlignType, typename Pointee>
struct AlignedChecker
{
  static void
  test(Pointee* aPtr)
  {
    MOZ_ASSERT((uintptr_t(aPtr) % MOZ_ALIGNOF(AlignType)) == 0,
               "performing a range-check with a misaligned pointer");
  }
};

template<typename Pointee>
struct AlignedChecker<void, Pointee>
{
  static void
  test(Pointee* aPtr)
  {
  }
};

} // namespace detail

/**
                         bool>::Type
IsInRange(T* aPtr, U* aBegin, U* aEnd)
{
  MOZ_ASSERT(aBegin <= aEnd);
  detail::AlignedChecker<U, T>::test(aPtr);
  detail::AlignedChecker<U, U>::test(aBegin);
  detail::AlignedChecker<U, U>::test(aEnd);
  return aBegin <= static_cast<U*>(aPtr) && static_cast<U*>(aPtr) < aEnd;
}

/**
 * Convenience version of the above method when the valid range is specified as
 * uintptr_t values.  As above, |aPtr| must be aligned, and |aBegin| and |aEnd|
 * must be aligned with respect to |T|.
 */
template<typename T>
inline bool
IsInRange(T* aPtr, uintptr_t aBegin, uintptr_t aEnd)
{
  return IsInRange(aPtr,
                   reinterpret_cast<T*>(aBegin), reinterpret_cast<T*>(aEnd));
}

namespace detail {

/*
 * Helper for the MOZ_ARRAY_LENGTH() macro to make the length a typesafe
 * compile-time constant even on compilers lacking constexpr support.
 */
template <typename T, size_t N>
char (&ArrayLengthHelper(T (&array)[N]))[N];

} /* namespace detail */

} /* namespace mozilla */

#endif /* __cplusplus */
# 171 "../../dist/include/mozilla/ArrayUtils.h"

/*
 * MOZ_ARRAY_LENGTH() is an alternative to mozilla::ArrayLength() for C files
 * that can't use C++ template functions and for static_assert() calls that
 * can't call ArrayLength() when it is not a C++11 constexpr function.
 */
#ifdef __cplusplus
#  define MOZ_ARRAY_LENGTH(array)   sizeof(mozilla::detail::ArrayLengthHelper(array))
#else
# 180 "../../dist/include/mozilla/ArrayUtils.h"
#  define MOZ_ARRAY_LENGTH(array)   (sizeof(array)/sizeof((array)[0]))
#endif
# 182 "../../dist/include/mozilla/ArrayUtils.h"

#endif /* mozilla_ArrayUtils_h */
# 184 "../../dist/include/mozilla/ArrayUtils.h"
# 20 "../../dist/include/mozilla/PodOperations.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/PodOperations.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/mozilla/PodOperations.h"
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/mozilla/PodOperations.h"

namespace mozilla {

/** Set the contents of |aT| to 0. */
template<typename T>
static MOZ_ALWAYS_INLINE void
PodZero(T* aT)
{
  memset(aT, 0, sizeof(T));
}

/** Set the contents of |aNElem| elements starting at |aT| to 0. */
template<typename T>
static MOZ_ALWAYS_INLINE void
PodZero(T* aT, size_t aNElem)
{
  /*
   * This function is often called with 'aNElem' small; we use an inline loop
   * instead of calling 'memset' with a non-constant length.  The compiler
   * should inline the memset call with constant size, though.
   */
  for (T* end = aT + aNElem; aT < end; aT++) {
    memset(aT, 0, sizeof(T));
  }
}

/*
 * Arrays implicitly convert to pointers to their first element, which is
 * dangerous when combined with the above PodZero definitions.  Adding an
 * overload for arrays is ambiguous, so we need another identifier.  The
 * ambiguous overload is left to catch mistaken uses of PodZero; if you get a
 * compile error involving PodZero and array types, use PodArrayZero instead.
 */
template<typename T, size_t N>
static void PodZero(T (&aT)[N]) = delete;
template<typename T, size_t N>
static void PodZero(T (&aT)[N], size_t aNElem) = delete;

/** Set the contents of the array |aT| to zero. */
template <class T, size_t N>
static MOZ_ALWAYS_INLINE void
PodArrayZero(T (&aT)[N])
{
  memset(aT, 0, N * sizeof(T));
}

template <typename T, size_t N>
static MOZ_ALWAYS_INLINE void
PodArrayZero(Array<T, N>& aArr)
{
  memset(&aArr[0], 0, N * sizeof(T));
}

/**
 * Assign |*aSrc| to |*aDst|.  The locations must not be the same and must not
 * overlap.
 */
template<typename T>
static MOZ_ALWAYS_INLINE void
PodAssign(T* aDst, const T* aSrc)
{
  MOZ_ASSERT(aDst + 1 <= aSrc || aSrc + 1 <= aDst,
             "destination and source must not overlap");
  memcpy(reinterpret_cast<char*>(aDst), reinterpret_cast<const char*>(aSrc),
         sizeof(T));
}

/**
 * Copy |aNElem| T elements from |aSrc| to |aDst|.  The two memory ranges must
 * not overlap!
 */
template<typename T>
static MOZ_ALWAYS_INLINE void
PodCopy(T* aDst, const T* aSrc, size_t aNElem)
{
  MOZ_ASSERT(aDst + aNElem <= aSrc || aSrc + aNElem <= aDst,
             "destination and source must not overlap");
  if (aNElem < 128) {
    /*
     * Avoid using operator= in this loop, as it may have been
     * intentionally deleted by the POD type.
     */
    for (const T* srcend = aSrc + aNElem; aSrc < srcend; aSrc++, aDst++) {
      PodAssign(aDst, aSrc);
    }
  } else {
    memcpy(aDst, aSrc, aNElem * sizeof(T));
  }
}

template<typename T>
static MOZ_ALWAYS_INLINE void
PodCopy(volatile T* aDst, const volatile T* aSrc, size_t aNElem)
{
  MOZ_ASSERT(aDst + aNElem <= aSrc || aSrc + aNElem <= aDst,
             "destination and source must not overlap");

  /*
   * Volatile |aDst| requires extra work, because it's undefined behavior to
   * modify volatile objects using the mem* functions.  Just write out the
   * loops manually, using operator= rather than memcpy for the same reason,
   * and let the compiler optimize to the extent it can.
   */
  for (const volatile T* srcend = aSrc + aNElem;
       aSrc < srcend;
       aSrc++, aDst++) {
    *aDst = *aSrc;
  }
}

/*
 * Copy the contents of the array |aSrc| into the array |aDst|, both of size N.
 * The arrays must not overlap!
 */
template <class T, size_t N>
static MOZ_ALWAYS_INLINE void
PodArrayCopy(T (&aDst)[N], const T (&aSrc)[N])
{
  PodCopy(aDst, aSrc, N);
}

/**
 * Copy the memory for |aNElem| T elements from |aSrc| to |aDst|.  If the two
 * memory ranges overlap, then the effect is as if the |aNElem| elements are
 * first copied from |aSrc| to a temporary array, and then from the temporary
 * array to |aDst|.
 */
template<typename T>
static MOZ_ALWAYS_INLINE void
PodMove(T* aDst, const T* aSrc, size_t aNElem)
{
  MOZ_ASSERT(aNElem <= SIZE_MAX / sizeof(T),
             "trying to move an impossible number of elements");
  memmove(aDst, aSrc, aNElem * sizeof(T));
}

/**
 * Determine whether the |len| elements at |one| are memory-identical to the
 * |len| elements at |two|.
 */
template<typename T>
static MOZ_ALWAYS_INLINE bool
PodEqual(const T* one, const T* two, size_t len)
{
  if (len < 128) {
    const T* p1end = one + len;
    const T* p1 = one;
    const T* p2 = two;
    for (; p1 < p1end; p1++, p2++) {
      if (*p1 != *p2) {
        return false;
      }
    }
    return true;
  }

  return !memcmp(one, two, len * sizeof(T));
}

} // namespace mozilla

#endif /* mozilla_PodOperations_h */
# 186 "../../dist/include/mozilla/PodOperations.h"
# 17 "../../dist/include/jspubtd.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "jsprototypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/jsprototypes.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef jsprototypes_h
#define jsprototypes_h

/* A higher-order macro for enumerating all JSProtoKey values. */
/*
 * Consumers define macros as follows:
 * macro(name, code, init, clasp)
 *   name:    The canonical name of the class.
 *   code:    The enumerator code. There are part of the XDR API, and must not change.
 *   init:    Initialization function. These are |extern "C";|, and clients should use
 *            |extern "C" {}| as appropriate when using this macro.
 *   clasp:   The JSClass for this object, or "dummy" if it doesn't exist.
 *
 *
 * Consumers wishing to iterate over all the JSProtoKey values, can use
 * JS_FOR_EACH_PROTOTYPE. However, there are certain values that don't correspond
 * to real constructors, like Null or constructors that are disabled via
 * preprocessor directives. We still need to include these in the JSProtoKey list
 * in order to maintain binary XDR compatibility, but we need to provide a tool
 * to handle them differently. JS_FOR_PROTOTYPES fills this niche.
 *
 * Consumers pass two macros to JS_FOR_PROTOTYPES - |real| and |imaginary|. The
 * former is invoked for entries that have real client-exposed constructors, and
 * the latter is called for the rest. Consumers that don't care about this
 * distinction can simply pass the same macro to both, which is exactly what
 * JS_FOR_EACH_PROTOTYPE does.
 */

#define CLASP(name)                 (&name##Class)
#define OCLASP(name)                (&name##Object::class_)
#define TYPED_ARRAY_CLASP(type)     (&TypedArrayObject::classes[Scalar::type])
#define ERROR_CLASP(type)           (&ErrorObject::classes[type])
#define SHARED_TYPED_ARRAY_CLASP(type) (&SharedTypedArrayObject::classes[Scalar::type])

#ifdef EXPOSE_INTL_API
#define IF_INTL(real,imaginary) real
#else
# 44 "../../dist/include/jsprototypes.h"
#define IF_INTL(real,imaginary) imaginary
#endif
# 46 "../../dist/include/jsprototypes.h"

#ifdef ENABLE_BINARYDATA
#define IF_BDATA(real,imaginary) real
#else
# 50 "../../dist/include/jsprototypes.h"
#define IF_BDATA(real,imaginary) imaginary
#endif
# 52 "../../dist/include/jsprototypes.h"

#ifdef ENABLE_SHARED_ARRAY_BUFFER
#define IF_SAB(real,imaginary) real
#else
# 56 "../../dist/include/jsprototypes.h"
#define IF_SAB(real,imaginary) imaginary
#endif
# 58 "../../dist/include/jsprototypes.h"

#define JS_FOR_PROTOTYPES(real,imaginary) \
    imaginary(Null,              0,     InitNullClass,          dummy) \
    real(Object,                 1,     InitViaClassSpec,       OCLASP(Plain)) \
IF_SAB(real,imaginary)(SharedFloat64Array,      50,     InitViaClassSpec,       SHARED_TYPED_ARRAY_CLASP(Float64)) \
IF_SAB(real,imaginary)(SharedUint8ClampedArray, 51,     InitViaClassSpec,       SHARED_TYPED_ARRAY_CLASP(Uint8Clamped)) \
    real(TypedArray,            52,      InitViaClassSpec,      &js::TypedArrayObject::sharedTypedArrayPrototypeClass) \
IF_SAB(real,imaginary)(Atomics,                 53,     InitAtomicsClass, OCLASP(Atomics)) \
    real(SavedFrame,            54,      InitViaClassSpec,      &js::SavedFrame::class_) \


#define JS_FOR_EACH_PROTOTYPE(macro) JS_FOR_PROTOTYPES(macro,macro)

#endif /* jsprototypes_h */
# 120 "../../dist/include/jsprototypes.h"
# 19 "../../dist/include/jspubtd.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "jstypes.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/jspubtd.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/jspubtd.h"

#if (defined(JS_GC_ZEAL)) || defined(DEBUG)
# define JSGC_HASH_TABLE_CHECKS
#endif
# 26 "../../dist/include/jspubtd.h"

namespace JS {

class AutoIdVector;
class CallArgs;

template <typename T>
class Rooted;

class JS_FRIEND_API(CompileOptions);
class JS_FRIEND_API(ReadOnlyCompileOptions);
class JS_FRIEND_API(OwningCompileOptions);
class JS_PUBLIC_API(CompartmentOptions);

struct Zone;

} /* namespace JS */

namespace js {
struct ContextFriendFields;
} // namespace js

/*
 * Run-time version enumeration.  For compile-time version checking, please use
 * the JS_HAS_* macros in jsversion.h, or use MOZJS_MAJOR_VERSION,
 * MOZJS_MINOR_VERSION, MOZJS_PATCH_VERSION, and MOZJS_ALPHA definitions.
 */
enum JSVersion {
    JSVERSION_ECMA_3  = 148,
    JSVERSION_1_6     = 160,
    JSVERSION_1_7     = 170,
    JSVERSION_1_8     = 180,
    JSVERSION_ECMA_5  = 185,
    JSVERSION_DEFAULT = 0,
    JSVERSION_UNKNOWN = -1,
    JSVERSION_LATEST  = JSVERSION_ECMA_5
};

/* Result of typeof operator enumeration. */
enum JSType {
    JSTYPE_VOID,                /* undefined */
    JSTYPE_OBJECT,              /* object */
    JSTYPE_FUNCTION,            /* function */
    JSTYPE_STRING,              /* string */
    JSTYPE_NUMBER,              /* number */
    JSTYPE_BOOLEAN,             /* boolean */
    JSTYPE_NULL,                /* null */
    JSTYPE_SYMBOL,              /* symbol */
    JSTYPE_LIMIT
};

/* Dense index into cached prototypes and class atoms for standard objects. */
enum JSProtoKey {
#define PROTOKEY_AND_INITIALIZER(name,code,init,clasp) JSProto_##name = code,
    JS_FOR_EACH_PROTOTYPE(PROTOKEY_AND_INITIALIZER)
#undef PROTOKEY_AND_INITIALIZER
    JSProto_LIMIT
};

/* Struct forward declarations. */
struct JSClass;
struct JSCompartment;
struct JSCrossCompartmentCall;
class JSErrorReport;
struct JSExceptionState;
struct JSFunctionSpec;
struct JSIdArray;
struct JSLocaleCallbacks;
struct JSObjectMap;
struct JSPrincipals;
struct JSPropertyDescriptor;
struct JSPropertyName;
struct JSPropertySpec;
struct JSRuntime;
struct JSSecurityCallbacks;
struct JSStructuredCloneCallbacks;
struct JSStructuredCloneReader;
struct JSStructuredCloneWriter;
class JS_PUBLIC_API(JSTracer);

class JSFlatString;

typedef struct PRCallOnceType   JSCallOnceType;
typedef bool                    (*JSInitCallback)(void);

template<typename T> struct JSConstScalarSpec;
typedef JSConstScalarSpec<double> JSConstDoubleSpec;
typedef JSConstScalarSpec<int32_t> JSConstIntegerSpec;

/*
 * Generic trace operation that calls JS_CallTracer on each traceable thing
 * stored in data.
 */
typedef void
(* JSTraceDataOp)(JSTracer *trc, void *data);

namespace js {

void FinishGC(JSRuntime *rt);

namespace gc {
class StoreBuffer;
void MarkPersistentRootedChains(JSTracer *);
void FinishPersistentRootedChains(JSRuntime *);
}
}

namespace JS {

typedef void (*OffThreadCompileCallback)(void *token, void *callbackData);

namespace shadow {

struct Runtime
{
    /* Restrict zone access during Minor GC. */
    bool needsIncrementalBarrier_;

  private:
    js::gc::StoreBuffer *gcStoreBufferPtr_;

  public:
    Runtime()
      : needsIncrementalBarrier_(false)
      , gcStoreBufferPtr_(nullptr)
    {}

    bool needsIncrementalBarrier() const {
        return needsIncrementalBarrier_;
    }

    js::gc::StoreBuffer *gcStoreBufferPtr() { return gcStoreBufferPtr_; }

    static JS::shadow::Runtime *asShadowRuntime(JSRuntime *rt) {
        return reinterpret_cast<JS::shadow::Runtime*>(rt);
    }

  protected:
    void setGCStoreBufferPtr(js::gc::StoreBuffer *storeBuffer) {
        gcStoreBufferPtr_ = storeBuffer;
    }

    /* Allow inlining of PersistentRooted constructors and destructors. */
  private:
    template <typename Referent> friend class JS::PersistentRooted;
    friend void js::gc::MarkPersistentRootedChains(JSTracer *);
    friend void js::gc::FinishPersistentRootedChains(JSRuntime *rt);

    mozilla::LinkedList<PersistentRootedFunction> functionPersistentRooteds;
    mozilla::LinkedList<PersistentRootedId>       idPersistentRooteds;
    mozilla::LinkedList<PersistentRootedObject>   objectPersistentRooteds;
    mozilla::LinkedList<PersistentRootedScript>   scriptPersistentRooteds;
    mozilla::LinkedList<PersistentRootedString>   stringPersistentRooteds;
    mozilla::LinkedList<PersistentRootedValue>    valuePersistentRooteds;

    /* Specializations of this return references to the appropriate list. */
    template<typename Referent>
    inline mozilla::LinkedList<PersistentRooted<Referent> > &getPersistentRootedList();
};

template<>
inline mozilla::LinkedList<PersistentRootedFunction>
&Runtime::getPersistentRootedList<JSFunction *>() { return functionPersistentRooteds; }

template<>
inline mozilla::LinkedList<PersistentRootedId>
&Runtime::getPersistentRootedList<jsid>() { return idPersistentRooteds; }

template<>
inline mozilla::LinkedList<PersistentRootedObject>
&Runtime::getPersistentRootedList<JSObject *>() { return objectPersistentRooteds; }

template<>
inline mozilla::LinkedList<PersistentRootedScript>
&Runtime::getPersistentRootedList<JSScript *>() { return scriptPersistentRooteds; }

template<>
inline mozilla::LinkedList<PersistentRootedString>
&Runtime::getPersistentRootedList<JSString *>() { return stringPersistentRooteds; }

template<>
inline mozilla::LinkedList<PersistentRootedValue>
&Runtime::getPersistentRootedList<Value>() { return valuePersistentRooteds; }

} /* namespace shadow */

class JS_PUBLIC_API(AutoGCRooter)
{
  public:
    AutoGCRooter(JSContext *cx, ptrdiff_t tag);
    AutoGCRooter(js::ContextFriendFields *cx, ptrdiff_t tag);

    ~AutoGCRooter() {
        MOZ_ASSERT(this == *stackTop);
        *stackTop = down;
    }

    /* Implemented in gc/RootMarking.cpp. */
    inline void trace(JSTracer *trc);
    static void traceAll(JSTracer *trc);
    static void traceAllWrappers(JSTracer *trc);

    /* T must be a context type */
    template<typename T>
    static void traceAllInContext(T* cx, JSTracer *trc) {
        for (AutoGCRooter *gcr = cx->autoGCRooters; gcr; gcr = gcr->down)
            gcr->trace(trc);
    }

  protected:
    AutoGCRooter * const down;

    /*
     * Discriminates actual subclass of this being used.  If non-negative, the
     * subclass roots an array of values of the length stored in this field.
     * If negative, meaning is indicated by the corresponding value in the enum
     * below.  Any other negative value indicates some deeper problem such as
     * memory corruption.
     */
    ptrdiff_t tag_;

    enum {
        VALARRAY =     -2, /* js::AutoValueArray */
        PARSER =       -3, /* js::frontend::Parser */
        SHAPEVECTOR =  -4, /* js::AutoShapeVector */
        IDARRAY =      -6, /* js::AutoIdArray */
        DESCVECTOR =   -7, /* js::AutoPropDescVector */
        VALVECTOR =   -10, /* js::AutoValueVector */
        IDVECTOR =    -13, /* js::AutoIdVector */
        OBJVECTOR =   -14, /* js::AutoObjectVector */
        STRINGVECTOR =-15, /* js::AutoStringVector */
        SCRIPTVECTOR =-16, /* js::AutoScriptVector */
        NAMEVECTOR =  -17, /* js::AutoNameVector */
        HASHABLEVALUE=-18, /* js::HashableValue */
        IONMASM =     -19, /* js::jit::MacroAssembler */
        WRAPVECTOR =  -20, /* js::AutoWrapperVector */
        WRAPPER =     -21, /* js::AutoWrapperRooter */
        OBJOBJHASHMAP=-22, /* js::AutoObjectObjectHashMap */
        OBJU32HASHMAP=-23, /* js::AutoObjectUnsigned32HashMap */
        OBJHASHSET =  -24, /* js::AutoObjectHashSet */
        JSONPARSER =  -25, /* js::JSONParser */
        CUSTOM =      -26, /* js::CustomAutoRooter */
        FUNVECTOR =   -27  /* js::AutoFunctionVector */
    };

  private:
    AutoGCRooter ** const stackTop;

    /* No copy or assignment semantics. */
    AutoGCRooter(AutoGCRooter &ida) = delete;
    void operator=(AutoGCRooter &ida) = delete;
};

} /* namespace JS */

namespace js {

class ExclusiveContext;

enum ThingRootKind
{
    THING_ROOT_OBJECT,
    THING_ROOT_SHAPE,
    THING_ROOT_BASE_SHAPE,
    THING_ROOT_OBJECT_GROUP,
    THING_ROOT_STRING,
    THING_ROOT_SYMBOL,
    THING_ROOT_JIT_CODE,
    THING_ROOT_SCRIPT,
    THING_ROOT_LAZY_SCRIPT,
    THING_ROOT_ID,
    THING_ROOT_VALUE,
    THING_ROOT_TYPE,
    THING_ROOT_BINDINGS,
    THING_ROOT_PROPERTY_DESCRIPTOR,
    THING_ROOT_PROP_DESC,
    THING_ROOT_LIMIT
};

/*
 * This list enumerates the different types of conceptual stacks we have in
 * SpiderMonkey. In reality, they all share the C stack, but we allow different
 * stack limits depending on the type of code running.
 */
enum StackKind
{
    StackForSystemCode,      // C++, such as the GC, running on behalf of the VM.
    StackForTrustedScript,   // Script running with trusted principals.
    StackForUntrustedScript, // Script running with untrusted principals.
    StackKindCount
};

template <typename T>
struct RootKind;

/*
 * Specifically mark the ThingRootKind of externally visible types, so that
 * JSAPI users may use JSRooted... types without having the class definition
 * available.
 */
template<typename T, ThingRootKind Kind>
struct SpecificRootKind
{
    static ThingRootKind rootKind() { return Kind; }
};

template <> struct RootKind<JSObject *> : SpecificRootKind<JSObject *, THING_ROOT_OBJECT> {};
template <> struct RootKind<JSFlatString *> : SpecificRootKind<JSFlatString *, THING_ROOT_STRING> {};
template <> struct RootKind<JSFunction *> : SpecificRootKind<JSFunction *, THING_ROOT_OBJECT> {};
template <> struct RootKind<JSString *> : SpecificRootKind<JSString *, THING_ROOT_STRING> {};
template <> struct RootKind<JS::Symbol *> : SpecificRootKind<JS::Symbol *, THING_ROOT_SYMBOL> {};
template <> struct RootKind<JSScript *> : SpecificRootKind<JSScript *, THING_ROOT_SCRIPT> {};
template <> struct RootKind<jsid> : SpecificRootKind<jsid, THING_ROOT_ID> {};
template <> struct RootKind<JS::Value> : SpecificRootKind<JS::Value, THING_ROOT_VALUE> {};

struct ContextFriendFields
{
  protected:
    JSRuntime *const     runtime_;

    /* The current compartment. */
    JSCompartment       *compartment_;

    /* The current zone. */
    JS::Zone            *zone_;

  public:
    explicit ContextFriendFields(JSRuntime *rt)
      : runtime_(rt), compartment_(nullptr), zone_(nullptr), autoGCRooters(nullptr)
    {
        mozilla::PodArrayZero(thingGCRooters);
    }

    static const ContextFriendFields *get(const JSContext *cx) {
        return reinterpret_cast<const ContextFriendFields *>(cx);
    }

    static ContextFriendFields *get(JSContext *cx) {
        return reinterpret_cast<ContextFriendFields *>(cx);
    }

  private:
    /*
     * Stack allocated GC roots for stack GC heap pointers, which may be
     * overwritten if moved during a GC.
     */
    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];

  public:
    template <class T>
    inline JS::Rooted<T> *gcRooters() {
        js::ThingRootKind kind = RootKind<T>::rootKind();
        return reinterpret_cast<JS::Rooted<T> *>(thingGCRooters[kind]);
    }

    void checkNoGCRooters();

    /* Stack of thread-stack-allocated GC roots. */
    JS::AutoGCRooter   *autoGCRooters;

    friend JSRuntime *GetRuntime(const JSContext *cx);
    friend JSCompartment *GetContextCompartment(const JSContext *cx);
    friend JS::Zone *GetContextZone(const JSContext *cx);
    template <typename T> friend class JS::Rooted;
};

/*
 * Inlinable accessors for JSContext.
 *
 * - These must not be available on the more restricted superclasses of
 *   JSContext, so we can't simply define them on ContextFriendFields.
 *
 * - They're perfectly ordinary JSContext functionality, so ought to be
 *   usable without resorting to jsfriendapi.h, and when JSContext is an
 *   incomplete type.
 */
inline JSRuntime *
GetRuntime(const JSContext *cx)
{
    return ContextFriendFields::get(cx)->runtime_;
}

inline JSCompartment *
GetContextCompartment(const JSContext *cx)
{
    return ContextFriendFields::get(cx)->compartment_;
}

inline JS::Zone *
GetContextZone(const JSContext *cx)
{
    return ContextFriendFields::get(cx)->zone_;
}

class PerThreadData;

struct PerThreadDataFriendFields
{
  private:
    // Note: this type only exists to permit us to derive the offset of
    // the perThread data within the real JSRuntime* type in a portable
    // way.
    struct RuntimeDummy : JS::shadow::Runtime
    {
        struct PerThreadDummy {
            void *field1;
            uintptr_t field2;
#ifdef JS_DEBUG
            uint64_t field3;
#endif
# 436 "../../dist/include/jspubtd.h"
        } mainThread;
    };

  public:

    PerThreadDataFriendFields();

  private:
    /*
     * Stack allocated GC roots for stack GC heap pointers, which may be
     * overwritten if moved during a GC.
     */
    JS::Rooted<void*> *thingGCRooters[THING_ROOT_LIMIT];

  public:
    template <class T>
    inline JS::Rooted<T> *gcRooters() {
        js::ThingRootKind kind = RootKind<T>::rootKind();
        return reinterpret_cast<JS::Rooted<T> *>(thingGCRooters[kind]);
    }

    /* Limit pointer for checking native stack consumption. */
    uintptr_t nativeStackLimit[js::StackKindCount];

    static const size_t RuntimeMainThreadOffset = offsetof(RuntimeDummy, mainThread);

    static inline PerThreadDataFriendFields *get(js::PerThreadData *pt) {
        return reinterpret_cast<PerThreadDataFriendFields *>(pt);
    }

    static inline PerThreadDataFriendFields *getMainThread(JSRuntime *rt) {
        // mainThread must always appear directly after |JS::shadow::Runtime|.
        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|
        return reinterpret_cast<PerThreadDataFriendFields *>(
            reinterpret_cast<char*>(rt) + RuntimeMainThreadOffset);
    }

    static inline const PerThreadDataFriendFields *getMainThread(const JSRuntime *rt) {
        // mainThread must always appear directly after |JS::shadow::Runtime|.
        // Tested by a JS_STATIC_ASSERT in |jsfriendapi.cpp|
        return reinterpret_cast<const PerThreadDataFriendFields *>(
            reinterpret_cast<const char*>(rt) + RuntimeMainThreadOffset);
    }

    template <typename T> friend class JS::Rooted;
};

} /* namespace js */

#endif /* jspubtd_h */
# 486 "../../dist/include/jspubtd.h"
# 12 "../../dist/include/js/TracingAPI.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "js/HashTable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/HashTable.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_HashTable_h
#define js_HashTable_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Alignment.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/js/HashTable.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/js/HashTable.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/PodOperations.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/js/HashTable.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ReentrancyGuard.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ReentrancyGuard.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Small helper class for asserting uses of a class are non-reentrant. */

#ifndef mozilla_ReentrancyGuard_h
#define mozilla_ReentrancyGuard_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/ReentrancyGuard.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/ReentrancyGuard.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/GuardObjects.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/ReentrancyGuard.h"

namespace mozilla {

/* Useful for implementing containers that assert non-reentrancy */
class ReentrancyGuard
{
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
#ifdef DEBUG
  bool& mEntered;
#endif
# 25 "../../dist/include/mozilla/ReentrancyGuard.h"

public:
  template<class T>
#ifdef DEBUG
  ReentrancyGuard(T& aObj
                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
    : mEntered(aObj.mEntered)
#else
# 33 "../../dist/include/mozilla/ReentrancyGuard.h"
  ReentrancyGuard(T&
                  MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
#endif
# 36 "../../dist/include/mozilla/ReentrancyGuard.h"
  {
    MOZ_GUARD_OBJECT_NOTIFIER_INIT;
#ifdef DEBUG
    MOZ_ASSERT(!mEntered);
    mEntered = true;
#endif
# 42 "../../dist/include/mozilla/ReentrancyGuard.h"
  }
  ~ReentrancyGuard()
  {
#ifdef DEBUG
    mEntered = false;
#endif
# 48 "../../dist/include/mozilla/ReentrancyGuard.h"
  }

private:
  ReentrancyGuard(const ReentrancyGuard&) = delete;
  void operator=(const ReentrancyGuard&) = delete;
};

} // namespace mozilla

#endif /* mozilla_ReentrancyGuard_h */
# 58 "../../dist/include/mozilla/ReentrancyGuard.h"
# 18 "../../dist/include/js/HashTable.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TemplateLib.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/js/HashTable.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/js/HashTable.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/Utility.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/js/HashTable.h"

namespace js {

class TempAllocPolicy;
template <class> struct DefaultHasher;
template <class, class> class HashMapEntry;
namespace detail {
    template <class T> class HashTableEntry;
    template <class T, class HashPolicy, class AllocPolicy> class HashTable;
}

/*****************************************************************************/

// A JS-friendly, STL-like container providing a hash-based map from keys to
// values. In particular, HashMap calls constructors and destructors of all
// objects added so non-PODs may be used safely.
//
// Key/Value requirements:
//  - movable, destructible, assignable
// HashPolicy requirements:
//  - see Hash Policy section below
// AllocPolicy:
//  - see jsalloc.h
//
// Note:
// - HashMap is not reentrant: Key/Value/HashPolicy/AllocPolicy members
//   called by HashMap must not call back into the same HashMap object.
// - Due to the lack of exception handling, the user must call |init()|.
template <class Key,
          class Value,
          class HashPolicy = DefaultHasher<Key>,
          class AllocPolicy = TempAllocPolicy>
class HashMap
{
    typedef HashMapEntry<Key, Value> TableEntry;

    struct MapHashPolicy : HashPolicy
    {
        typedef Key KeyType;
        
        
    };

    typedef detail::HashTable<TableEntry, MapHashPolicy, AllocPolicy> Impl;
    Impl impl;

  public:
    typedef typename HashPolicy::Lookup Lookup;
    typedef TableEntry Entry;

    // HashMap construction is fallible (due to OOM); thus the user must call

    // HashMap is movable
    HashMap(HashMap &&rhs) : impl(mozilla::Move(rhs.impl)) {}
    void operator=(HashMap &&rhs) {
        MOZ_ASSERT(this != &rhs, "self-move assignment is prohibited");
        impl = mozilla::Move(rhs.impl);
    }

  private:
    // HashMap is not copyable or assignable
    HashMap(const HashMap &hm) = delete;
    HashMap &operator=(const HashMap &hm) = delete;

    friend class Impl::Enum;
};

// - Due to the lack of exception handling, the user must call |init()|.
template <class T,
          class HashPolicy = DefaultHasher<T>,
          class AllocPolicy = TempAllocPolicy>
class HashSet
{
    struct SetOps : HashPolicy
    {
        typedef T KeyType;
        
        
    };

    typedef detail::HashTable<const T, SetOps, AllocPolicy> Impl;
    Impl impl;

    // |add(p,t)|. After |add(p,t)|, |p| points to the new element. E.g.:
    //

  private:
    // HashSet is not copyable or assignable
    HashSet(const HashSet &hs) = delete;
    HashSet &operator=(const HashSet &hs) = delete;

    friend class Impl::Enum;
};

/*****************************************************************************/

// Hash Policy
//
// A hash policy P for a hash table with key-type Key must provide:
//   js::HashSet<Key, P>::AddPtr p = h.lookup(l);
//   if (!p) {
//     assert(P::match(k, l));  // must hold
//     h.add(p, k);
//   }

// Pointer hashing policy that strips the lowest zeroBits when calculating the
// hash to improve key distribution.
} // namespace mozilla

namespace js {

namespace detail {

template <class T, class HashPolicy, class AllocPolicy>
class HashTable;

template <class T>
class HashTableEntry
{
    template <class, class, class> friend class HashTable;
    typedef typename mozilla::RemoveConst<T>::Type NonConstT;

    HashNumber keyHash;
    mozilla::AlignedStorage2<NonConstT> mem;

    static const HashNumber sFreeKey = 0;
    static const HashNumber sRemovedKey = 1;
    static const HashNumber sCollisionBit = 1;

    
    
    
    bool isLive() const    { return isLiveHash(keyHash); }
    
    
    
    
    

    
};

template <class T, class HashPolicy, class AllocPolicy>
class HashTable : private AllocPolicy
{
    friend class mozilla::ReentrancyGuard;

    typedef typename mozilla::RemoveConst<T>::Type NonConstT;
    typedef typename HashPolicy::KeyType Key;
    typedef typename HashPolicy::Lookup Lookup;

  public:
    typedef HashTableEntry<T> Entry;

    // A nullable pointer to a hash table element. A Ptr |p| can be tested
    // either explicitly |if (p.found()) p->...| or using boolean conversion
    // |if (p) p->...|. Ptr objects must not be used after any mutating hash
    // table operations unless |generation()| is tested.
    class Ptr
    {

        
    };

    // A Ptr that can be used to add a key after a failed lookup.
    class AddPtr : public Ptr
    {
        friend class HashTable;
        HashNumber keyHash;
#ifdef JS_DEBUG
        uint64_t mutationCount;
#endif
# 839 "../../dist/include/js/HashTable.h"

        

      public:
        // Leaves AddPtr uninitialized.
        
    };

    // A collection of hash table entries. The collection is enumerated by
    // calling |front()| followed by |popFront()| as long as |!empty()|. As
    // with Ptr/AddPtr, Range objects must not be used after any mutating hash
    // table operation unless the |generation()| is tested.
    class Range
    {
      protected:
        friend class HashTable;

        

        Entry *cur, *end;
#ifdef JS_DEBUG
        const HashTable *table_;
        uint64_t mutationCount;
        uint32_t generation;
        bool validEntry;
#endif
# 883 "../../dist/include/js/HashTable.h"

      public:
        

        bool empty() const {
#ifdef JS_DEBUG
            MOZ_ASSERT(generation == table_->generation());
            MOZ_ASSERT(mutationCount == table_->mutationCount);
#endif
# 901 "../../dist/include/js/HashTable.h"
            return cur == end;
        }

        T &front() const {
            MOZ_ASSERT(!empty());
#ifdef JS_DEBUG
            MOZ_ASSERT(validEntry);
            MOZ_ASSERT(generation == table_->generation());
            MOZ_ASSERT(mutationCount == table_->mutationCount);
#endif
# 911 "../../dist/include/js/HashTable.h"
            return cur->get();
        }

        void popFront() {
            MOZ_ASSERT(!empty());
#ifdef JS_DEBUG
            MOZ_ASSERT(generation == table_->generation());
            MOZ_ASSERT(mutationCount == table_->mutationCount);
#endif
# 920 "../../dist/include/js/HashTable.h"
            while (++cur < end && !cur->isLive())
                continue;
#ifdef JS_DEBUG
            validEntry = true;
#endif
# 925 "../../dist/include/js/HashTable.h"
        }
    };

    // A Range whose lifetime delimits a mutating enumeration of a hash table.
    // Since rehashing when elements were removed during enumeration would be
    // bad, it is postponed until the Enum is destructed.  Since the Enum's
    // destructor touches the hash table, the user must ensure that the hash
    // table is still alive when the destructor runs.
    class Enum : public Range
    {
        friend class HashTable;

        HashTable &table_;
        bool rekeyed;
        bool removed;

        /* Not copyable. */
        Enum(const Enum &) = delete;
        void operator=(const Enum &) = delete;

      public:
        template<class Map> explicit
        Enum(Map &map) : Range(map.all()), table_(map.impl), rekeyed(false), removed(false) {}

        // Removes the |front()| element from the table, leaving |front()|
        // invalid until the next call to |popFront()|. For example:
        //
        //   HashSet<int> s;
        //   for (HashSet<int>::Enum e(s); !e.empty(); e.popFront())
        //     if (e.front() == 42)
        //       e.removeFront();
        void removeFront() {
            table_.remove(*this->cur);
            removed = true;
#ifdef JS_DEBUG
            this->validEntry = false;
            this->mutationCount = table_.mutationCount;
#endif
        }

        void rekeyFront(const Key &k) {
            rekeyFront(k, k);
        }

        // Potentially rehashes the table.
        ~Enum() {
            if (rekeyed) {
                table_.gen++;
                table_.checkOverRemoved();
            }

            if (removed)
                table_.compactIfUnderloaded();
        }
    };

    // HashTable is movable
    HashTable(HashTable &&rhs)
      : AllocPolicy(rhs)
    {
        mozilla::PodAssign(this, &rhs);
        rhs.table = nullptr;
    }
    void operator=(HashTable &&rhs) {
        MOZ_ASSERT(this != &rhs, "self-move assignment is prohibited");
        if (table)
            destroyTable(*this, table, capacity());
        mozilla::PodAssign(this, &rhs);
        rhs.table = nullptr;
    }

  private:
    // HashTable is not copyable or assignable
    HashTable(const HashTable &) = delete;
    void operator=(const HashTable &) = delete;

  private:
    static const size_t CAP_BITS = 30;

  public:
    Entry       *table;                 // entry storage
    uint32_t    gen:24;                 // entry storage generation number
    uint32_t    hashShift:8;            // multiplicative hash shift
    uint32_t    entryCount;             // number of entries in table
    uint32_t    removedCount;           // removed entry sentinels in table

#ifdef JS_DEBUG
    uint64_t     mutationCount;
    mutable bool mEntered;
    // Note that some updates to these stats are not thread-safe. See the
    // comment on the three-argument overloading of HashTable::lookup().
    mutable struct Stats
    {
        uint32_t        searches;       // total number of table searches
        uint32_t        steps;          // hash chain links traversed
        uint32_t        hits;           // searches that found key
        uint32_t        misses;         // searches that didn't find key
        uint32_t        addOverRemoved; // adds that recycled a removed entry
        uint32_t        removes;        // calls to remove
        uint32_t        removeFrees;    // calls to remove that freed the entry
        uint32_t        grows;          // table expansions
        uint32_t        shrinks;        // table contractions
        uint32_t        compresses;     // table compressions
        uint32_t        rehashes;       // tombstone decontaminations
    } stats;
#   define METER(x) x
#else
# 1046 "../../dist/include/js/HashTable.h"
#   define METER(x)
#endif
# 1048 "../../dist/include/js/HashTable.h"

    // The default initial capacity is 32 (enough to hold 16 elements), but it
    // can be as low as 4.
    static const unsigned sMinCapacityLog2 = 2;
    static const unsigned sMinCapacity  = 1 << sMinCapacityLog2;
    static const unsigned sMaxInit      = JS_BIT(CAP_BITS - 1);
    static const unsigned sMaxCapacity  = JS_BIT(CAP_BITS);
    static const unsigned sHashBits     = mozilla::tl::BitSize<HashNumber>::value;

    // Hash-table alpha is conceptually a fraction, but to avoid floating-point
    // math we implement it as a ratio of integers.
    static const uint8_t sAlphaDenominator = 4;
    static const uint8_t sMinAlphaNumerator = 1; // min alpha: 1/4
    static const uint8_t sMaxAlphaNumerator = 3; // max alpha: 3/4

    static const HashNumber sFreeKey = Entry::sFreeKey;
    static const HashNumber sRemovedKey = Entry::sRemovedKey;
    static const HashNumber sCollisionBit = Entry::sCollisionBit;

    void setTableSizeLog2(unsigned sizeLog2)
    {
        hashShift = sHashBits - sizeLog2;
    }

    static bool isLiveHash(HashNumber hash)
    {
        return Entry::isLiveHash(hash);
    }

    static HashNumber prepareHash(const Lookup& l)
    {
        HashNumber keyHash = ScrambleHashCode(HashPolicy::hash(l));

        // Avoid reserved hash codes.
        if (!isLiveHash(keyHash))
            keyHash -= (sRemovedKey + 1);
        return keyHash & ~sCollisionBit;
    }

    static Entry *createTable(AllocPolicy &alloc, uint32_t capacity)
    {
        static_assert(sFreeKey == 0,
                      "newly-calloc'd tables have to be considered empty");
        return alloc.template pod_calloc<Entry>(capacity);
    }

    static void destroyTable(AllocPolicy &alloc, Entry *oldTable, uint32_t capacity)
    {
        for (Entry *e = oldTable, *end = e + capacity; e < end; ++e)
            e->destroyIfLive();
        alloc.free_(oldTable);
    }

  public:
    explicit HashTable(AllocPolicy ap)
      : AllocPolicy(ap)
      , table(nullptr)
      , gen(0)
      , hashShift(sHashBits)
      , entryCount(0)
      , removedCount(0)
#ifdef JS_DEBUG
      , mutationCount(0)
      , mEntered(false)
#endif
# 1113 "../../dist/include/js/HashTable.h"
    {}

    MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)
    {
        MOZ_ASSERT(!initialized());
        // integral division: <http://stackoverflow.com/a/2745086>.)
        uint32_t newCapacity =
            (length * sAlphaDenominator + sMaxAlphaNumerator - 1) / sMaxAlphaNumerator;
        if (newCapacity < sMinCapacity)
            newCapacity = sMinCapacity;

        // FIXME: use JS_CEILING_LOG2 when PGO stops crashing (bug 543034).
        uint32_t roundUp = sMinCapacity, roundUpLog2 = sMinCapacityLog2;
        while (roundUp < newCapacity) {
            roundUp <<= 1;
            ++roundUpLog2;
        }

        newCapacity = roundUp;
        MOZ_ASSERT(newCapacity >= length);
        MOZ_ASSERT(newCapacity <= sMaxCapacity);

        table = createTable(*this, newCapacity);
        if (!table)
            return false;

        setTableSizeLog2(roundUpLog2);
        METER(memset(&stats, 0, sizeof(stats)));
        return true;
    }

    bool initialized() const
    {
        return !!table;
    }

    ~HashTable()
    {
        if (table)
            destroyTable(*this, table, capacity());
    }

  private:
    HashNumber hash1(HashNumber hash0) const
    {
        return hash0 >> hashShift;
    }

    struct DoubleHash
    {
        HashNumber h2;
        HashNumber sizeMask;
    };

    DoubleHash hash2(HashNumber curKeyHash) const
    {
        unsigned sizeLog2 = sHashBits - hashShift;
        DoubleHash dh = {
            ((curKeyHash << sizeLog2) >> hashShift) | 1,
            (HashNumber(1) << sizeLog2) - 1
        };
        return dh;
    }

    static HashNumber applyDoubleHash(HashNumber h1, const DoubleHash &dh)
    {
        return (h1 - dh.h2) & dh.sizeMask;
    }

    bool overloaded()
    {
        static_assert(sMaxCapacity <= UINT32_MAX / sMaxAlphaNumerator,
                      "multiplication below could overflow");
        return entryCount + removedCount >=
               capacity() * sMaxAlphaNumerator / sAlphaDenominator;
    }

    // Would the table be underloaded if it had the given capacity and entryCount?
    static bool wouldBeUnderloaded(uint32_t capacity, uint32_t entryCount)
    {
        static_assert(sMaxCapacity <= UINT32_MAX / sMinAlphaNumerator,
                      "multiplication below could overflow");
        return capacity > sMinCapacity &&
               entryCount <= capacity * sMinAlphaNumerator / sAlphaDenominator;
    }

    bool underloaded()
    {
        return wouldBeUnderloaded(capacity(), entryCount);
    }

    static bool match(Entry &e, const Lookup &l)
    {
        return HashPolicy::match(HashPolicy::getKey(e.get()), l);
    }

    // Warning: in order for readonlyThreadsafeLookup() to be safe this
    // function must not modify the table in any way when |collisionBit| is 0.
    // (The use of the METER() macro to increment stats violates this
    // restriction but we will live with that for now because it's enabled so
    // rarely.)
    Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const
    {
        MOZ_ASSERT(isLiveHash(keyHash));
        MOZ_ASSERT(!(keyHash & sCollisionBit));
        MOZ_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);
        MOZ_ASSERT(table);
        METER(stats.searches++);

        // Compute the primary hash address.
        HashNumber h1 = hash1(keyHash);
        Entry *entry = &table[h1];

        // Miss: return space for a new entry.
        if (entry->isFree()) {
            METER(stats.misses++);
            return *entry;

            if (entry->matchHash(keyHash) && match(*entry, l)) {
                METER(stats.hits++);
                return *entry;
            }
        }
    }

    // This is a copy of lookup hardcoded to the assumptions:
    //   1. the lookup is a lookupForAdd
    //   2. the key, whose |keyHash| has been passed is not in the table,
    //   3. no entries have been removed from the table.
    // This specialized search avoids the need for recovering lookup values
    // from entries, which allows more flexible Lookup/Key types.
    Entry &findFreeEntry(HashNumber keyHash)
    {
        MOZ_ASSERT(!(keyHash & sCollisionBit));
        MOZ_ASSERT(table);
        METER(stats.searches++);

        // We assume 'keyHash' has already been distributed.

        // Compute the primary hash address.
        HashNumber h1 = hash1(keyHash);
        Entry *entry = &table[h1];

        // Miss: return space for a new entry.
        if (!entry->isLive()) {
            METER(stats.misses++);
            return *entry;
        }

    }

    enum RebuildStatus { NotOverloaded, Rehashed, RehashFailed };

    RebuildStatus changeTableSize(int deltaLog2)
    {
        // Look, but don't touch, until we succeed in getting new entry store.
        Entry *oldTable = table;
        uint32_t oldCap = capacity();
        uint32_t newLog2 = sHashBits - hashShift + deltaLog2;
        uint32_t newCapacity = JS_BIT(newLog2);
        if (MOZ_UNLIKELY(newCapacity > sMaxCapacity)) {
            this->reportAllocOverflow();
            return RehashFailed;
        }

        Entry *newTable = createTable(*this, newCapacity);
        if (!newTable)
            return RehashFailed;

        // We can't fail from here on, so update table parameters.
        setTableSizeLog2(newLog2);
        removedCount = 0;
        gen++;
        table = newTable;

        // Copy only live entries, leaving removed ones behind.
        for (Entry *src = oldTable, *end = src + oldCap; src < end; ++src) {
            if (src->isLive()) {
                HashNumber hn = src->getKeyHash();
                findFreeEntry(hn).setLive(
                    hn, mozilla::Move(const_cast<typename Entry::NonConstT&>(src->get())));
                src->destroy();
            }
        }

        // All entries have been destroyed, no need to destroyTable.
        this->free_(oldTable);
        return Rehashed;
    }

    RebuildStatus checkOverloaded()
    {
        if (!overloaded())
            return NotOverloaded;

        // Compress if a quarter or more of all entries are removed.
        int deltaLog2;
        if (removedCount >= (capacity() >> 2)) {
            METER(stats.compresses++);
            deltaLog2 = 0;
        } else {
            METER(stats.grows++);
            deltaLog2 = 1;
        }

        return changeTableSize(deltaLog2);
    }

    // Infallibly rehash the table if we are overloaded with removals.
    void checkOverRemoved()
    {
        if (overloaded()) {
            if (checkOverloaded() == RehashFailed)
                rehashTableInPlace();
        }
    }

    void remove(Entry &e)
    {
        MOZ_ASSERT(table);
        METER(stats.removes++);

        if (e.hasCollision()) {
            e.removeLive();
            removedCount++;
        } else {
            METER(stats.removeFrees++);
            e.clearLive();
        }
        entryCount--;
#ifdef JS_DEBUG
        mutationCount++;
#endif
# 1409 "../../dist/include/js/HashTable.h"
    }

    void checkUnderloaded()
    {
        if (underloaded()) {
            METER(stats.shrinks++);
            (void) changeTableSize(-1);
        }
    }

    // Resize the table down to the largest capacity which doesn't underload the
    // This is identical to changeTableSize(currentSize), but without requiring
    // a second table.  We do this by recycling the collision bits to tell us if
    // the element is already inserted or still waiting to be inserted.  Since
    // already-inserted elements win any conflicts, we get the same table as we
    // would have gotten through random insertion order.
    void rehashTableInPlace()
    {
        METER(stats.rehashes++);
        removedCount = 0;
        for (size_t i = 0; i < capacity(); ++i)
            table[i].unsetCollision();

        for (size_t i = 0; i < capacity();) {
            Entry *src = &table[i];

            if (!src->isLive() || src->hasCollision()) {
                ++i;
                continue;
            }

            HashNumber keyHash = src->getKeyHash();
            HashNumber h1 = hash1(keyHash);
            DoubleHash dh = hash2(keyHash);
            Entry *tgt = &table[h1];
            while (true) {
                if (!tgt->hasCollision()) {
                    src->swap(tgt);
                    tgt->setCollision();
                    break;
                }

                h1 = applyDoubleHash(h1, dh);
                tgt = &table[h1];
            }
        }

        // TODO: this algorithm leaves collision bits on *all* elements, even if
        // they are on no collision path. We have the option of setting the
        // collision bits correctly on a subsequent pass or skipping the rehash
        // unless we are totally filled with tombstones: benchmark to find out
        // which approach is best.
    }

  public:
    

    

    

    

    

    uint32_t capacity() const
    {
        MOZ_ASSERT(table);
        return JS_BIT(sHashBits - hashShift);
    }

    uint32_t generation() const
    {
        MOZ_ASSERT(table);
        return gen;
    }

    size_t sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
    {
        return mallocSizeOf(table);
    }

    

    

    

    

    

    // Note: |l| may be a reference to a piece of |u|, so this function
    // must take care not to use |l| after moving |u|.
    

    // Note: |l| may be a reference to a piece of |u|, so this function
    // must take care not to use |l| after moving |u|.
    

    // Note: |l| may be a reference to a piece of |u|, so this function
    // must take care not to use |l| after moving |u|.
    

    

    void rekeyWithoutRehash(Ptr p, const Lookup &l, const Key &k)
    {
        MOZ_ASSERT(table);
        mozilla::ReentrancyGuard g(*this);
        MOZ_ASSERT(p.found());
        typename HashTableEntry<T>::NonConstT t(mozilla::Move(*p));
        HashPolicy::setKey(t, const_cast<Key &>(k));
        remove(*p.entry_);
        putNewInfallible(l, mozilla::Move(t));
    }

    

    

#undef METER
};

}  // namespace detail
}  // namespace js

#endif  /* js_HashTable_h */
# 1702 "../../dist/include/js/HashTable.h"
# 14 "../../dist/include/js/TracingAPI.h" 2

class JS_PUBLIC_API(JSTracer);

namespace JS {
template <typename T> class Heap;
template <typename T> class TenuredHeap;
}

// When tracing a thing, the GC needs to know about the layout of the object it
// is looking at. There are a fixed number of different layouts that the GC
// knows about. The "trace kind" is a static map which tells which layout a GC
// thing has.
//
// Although this map is public, the details are completely hidden. Not all of
// the matching C++ types are exposed, and those that are, are opaque.
//
// See Value::gcKind() and JSTraceCallback in Tracer.h for more details.
enum JSGCTraceKind
{
    // These trace kinds have a publicly exposed, although opaque, C++ type.
    // Note: The order here is determined by our Value packing. Other users
    //       should sort alphabetically, for consistency.
    JSTRACE_OBJECT = 0x00,
    JSTRACE_STRING = 0x01,
    JSTRACE_SYMBOL = 0x02,
    JSTRACE_SCRIPT = 0x03,

    // Shape details are exposed through JS_TraceShapeCycleCollectorChildren.
    JSTRACE_SHAPE = 0x04,

    // The kind associated with a nullptr.
    JSTRACE_NULL = 0x06,

    // A kind that indicates the real kind should be looked up in the arena.
    JSTRACE_OUTOFLINE = 0x07,

    // The following kinds do not have an exposed C++ idiom.
    JSTRACE_BASE_SHAPE = 0x0F,
    JSTRACE_JITCODE = 0x1F,
    JSTRACE_LAZY_SCRIPT = 0x2F,
    JSTRACE_OBJECT_GROUP = 0x3F,

    JSTRACE_LAST = JSTRACE_OBJECT_GROUP
};

namespace JS {
// Returns a static string equivalent of |kind|.
JS_FRIEND_API(const char *)
GCTraceKindToAscii(JSGCTraceKind kind);
}

// Tracer callback, called for each traceable thing directly referenced by a
// particular object or runtime structure. It is the callback responsibility
// to ensure the traversal of the full object graph via calling eventually
// JS_TraceChildren on the passed thing. In this case the callback must be
// prepared to deal with cycles in the traversal graph.
//
// kind argument is one of JSTRACE_OBJECT, JSTRACE_STRING or a tag denoting
// internal implementation-specific traversal kind. In the latter case the only
// operations on thing that the callback can do is to call JS_TraceChildren or
// JS_GetTraceThingInfo.
//
// If eagerlyTraceWeakMaps is true, when we trace a WeakMap visit all
// of its mappings. This should be used in cases where the tracer
// wants to use the existing liveness of entries.
typedef void
(* JSTraceCallback)(JSTracer *trc, void **thingp, JSGCTraceKind kind);

// Callback that JSTraceOp implementation can provide to return a string
// describing the reference traced with JS_CallTracer.
typedef void
(* JSTraceNamePrinter)(JSTracer *trc, char *buf, size_t bufsize);

enum WeakMapTraceKind {
    DoNotTraceWeakMaps = 0,
    TraceWeakMapValues = 1,
    TraceWeakMapKeysValues = 2
};

class JS_PUBLIC_API(JSTracer)
{
  public:
    JSTracer(JSRuntime *rt, JSTraceCallback traceCallback,
             WeakMapTraceKind weakTraceKind = TraceWeakMapValues);

    // Set debugging information about a reference to a traceable thing to prepare
    // for the following call to JS_CallTracer.
    //
    // When printer is null, arg must be const char * or char * C string naming
#ifdef JS_GC_ZEAL
    void                *realLocation_;
#endif
# 187 "../../dist/include/js/TracingAPI.h"
};

// The JS_Call*Tracer family of functions traces the given GC thing reference.
// This performs the tracing action configured on the given JSTracer:
// typically calling the JSTracer::callback or marking the thing as live.
//
// The argument to JS_Call*Tracer is an in-out param: when the function
// returns, the garbage collector might have moved the GC thing. In this case,
// the reference passed to JS_Call*Tracer will be updated to the object's new
// location. Callers of this method are responsible for updating any state
// that is dependent on the object's address. For example, if the object's
// address is used as a key in a hashtable, then the object must be removed
// you know for sure that a heap post barrier is not required.  Use with extreme
// caution!
extern JS_PUBLIC_API(void)
JS_CallUnbarrieredValueTracer(JSTracer *trc, JS::Value *valuep, const char *name);

;

extern JS_PUBLIC_API(void)
JS_CallUnbarrieredObjectTracer(JSTracer *trc, JSObject **objp, const char *name);

;

;



;

#endif /* js_TracingAPI_h */
# 273 "../../dist/include/js/TracingAPI.h"
# 13 "../../dist/include/js/HeapAPI.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/Utility.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/js/HeapAPI.h"

/* These values are private to the JS engine. */
namespace js {

// Whether the current thread is permitted access to any part of the specified
// runtime or zone.
JS_FRIEND_API(bool)
CurrentThreadCanAccessRuntime(JSRuntime *rt);

JS_FRIEND_API(bool)
CurrentThreadCanAccessZone(JS::Zone *zone);

namespace gc {

struct Cell;

const size_t ArenaShift = 12;
const size_t ArenaSize = size_t(1) << ArenaShift;
const size_t ArenaMask = ArenaSize - 1;

#ifdef JS_GC_SMALL_CHUNK_SIZE
const size_t ChunkShift = 18;
#else
# 37 "../../dist/include/js/HeapAPI.h"
const size_t ChunkShift = 20;
#endif
# 39 "../../dist/include/js/HeapAPI.h"
const size_t ChunkSize = size_t(1) << ChunkShift;
const size_t ChunkMask = ChunkSize - 1;

const size_t CellShift = 3;
const size_t CellSize = size_t(1) << CellShift;
const size_t CellMask = CellSize - 1;

/* These are magic constants derived from actual offsets in gc/Heap.h. */
#ifdef JS_GC_SMALL_CHUNK_SIZE
const size_t ChunkMarkBitmapOffset = 258104;
const size_t ChunkMarkBitmapBits = 31744;
#else
# 51 "../../dist/include/js/HeapAPI.h"
const size_t ChunkMarkBitmapOffset = 1032352;
const size_t ChunkMarkBitmapBits = 129024;
#endif
# 54 "../../dist/include/js/HeapAPI.h"
const size_t ChunkRuntimeOffset = ChunkSize - sizeof(void*);
const size_t ChunkLocationOffset = ChunkSize - 2 * sizeof(void*) - sizeof(uint64_t);
const size_t ArenaZoneOffset = 0;

/*
 * Live objects are marked black. How many other additional colors are available
 * depends on the size of the GCThing. Objects marked gray are eligible for
 * cycle collection.
 */
static const uint32_t BLACK = 0;
static const uint32_t GRAY = 1;

/*
 * The "location" field in the Chunk trailer is a bit vector indicting various
 * roles of the chunk.
 *
 * The value 0 for the "location" field is invalid, at least one bit must be
 * set.
 *
 * Some bits preclude others, for example, any "nursery" bit precludes any
 * "tenured" or "middle generation" bit.
 */
const uintptr_t ChunkLocationBitNursery = 1;       // Standard GGC nursery
const uintptr_t ChunkLocationBitTenuredHeap = 2;   // Standard GGC tenured generation

const uintptr_t ChunkLocationAnyNursery = ChunkLocationBitNursery;

#ifdef JS_DEBUG
/* When downcasting, ensure we are actually the right type. */
extern JS_FRIEND_API(void)
AssertGCThingHasType(js::gc::Cell *cell, JSGCTraceKind kind);
#else
# 86 "../../dist/include/js/HeapAPI.h"
inline void
AssertGCThingHasType(js::gc::Cell *cell, JSGCTraceKind kind) {}
#endif
# 89 "../../dist/include/js/HeapAPI.h"

MOZ_ALWAYS_INLINE bool IsInsideNursery(const js::gc::Cell *cell);

} /* namespace gc */
} /* namespace js */

namespace JS {
struct Zone;

/* Default size for the generational nursery in bytes. */
const uint32_t DefaultNurseryBytes = 16 * js::gc::ChunkSize;

/* Default maximum heap size in bytes to pass to JS_NewRuntime(). */
const uint32_t DefaultHeapMaxBytes = 32 * 1024 * 1024;

namespace shadow {

struct Zone
{
  protected:
    JSRuntime *const runtime_;
    JSTracer *const barrierTracer_;     // A pointer to the JSRuntime's |gcMarker|.

  public:
    bool needsIncrementalBarrier_;

    

    bool needsIncrementalBarrier() const {
        return needsIncrementalBarrier_;
    }

    

    JSRuntime *runtimeFromMainThread() const {
        MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
        return runtime_;
    }

    // Note: Unrestricted access to the zone's runtime from an arbitrary
    // thread can easily lead to races. Use this method very carefully.
    

    static JS::shadow::Zone *asShadowZone(JS::Zone *zone) {
        return reinterpret_cast<JS::shadow::Zone*>(zone);
    }
};

} /* namespace shadow */

// A GC pointer, tagged with the trace kind.
//
// In general, a GC pointer should be stored with an exact type. This class
// is for use when that is not possible because a single pointer must point
// to several kinds of GC thing.
class JS_FRIEND_API(GCCellPtr)
{
  public:
    // Construction from a void* and trace kind.
    GCCellPtr(void *gcthing, JSGCTraceKind traceKind) : ptr(checkedCast(gcthing, traceKind)) {}

    // Construction from an explicit type.
    explicit GCCellPtr(JSObject *obj) : ptr(checkedCast(obj, JSTRACE_OBJECT)) { }
    
    explicit GCCellPtr(JSString *str) : ptr(checkedCast(str, JSTRACE_STRING)) { }
    
    
    ;

    // Not all compilers have nullptr_t yet, so use this instead of GCCellPtr(nullptr).
    

    JSGCTraceKind kind() const {
        JSGCTraceKind traceKind = JSGCTraceKind(ptr & JSTRACE_OUTOFLINE);
        if (traceKind != JSTRACE_OUTOFLINE)
            return traceKind;
        return outOfLineKind();
    }

    // Allow GCCellPtr to be used in a boolean context.
    explicit operator bool() const {
        MOZ_ASSERT(bool(asCell()) == (kind() != JSTRACE_NULL));
        return asCell();
    }

    // Simplify checks to the kind.
    
    
    
    
    

    // Conversions to more specific types must match the kind. Access to
    // further refined types is not allowed directly from a GCCellPtr.
    
    
    
    
    js::gc::Cell *asCell() const {
        return reinterpret_cast<js::gc::Cell *>(ptr & ~JSTRACE_OUTOFLINE);
    }

    // The CC's trace logger needs an identity that is XPIDL serializable.
    
    // Inline mark bitmap access requires direct pointer arithmetic.
    uintptr_t unsafeAsUIntPtr() const {
        MOZ_ASSERT(asCell());
        MOZ_ASSERT(!js::gc::IsInsideNursery(asCell()));
        return reinterpret_cast<uintptr_t>(asCell());
    }

  private:
    uintptr_t checkedCast(void *p, JSGCTraceKind traceKind) {
        js::gc::Cell *cell = static_cast<js::gc::Cell *>(p);
        MOZ_ASSERT((uintptr_t(p) & JSTRACE_OUTOFLINE) == 0);
        AssertGCThingHasType(cell, traceKind);
        // Note: the JSTRACE_OUTOFLINE bits are set on all out-of-line kinds
        // so that we can mask instead of branching.
        MOZ_ASSERT_IF(traceKind >= JSTRACE_OUTOFLINE,
                      (traceKind & JSTRACE_OUTOFLINE) == JSTRACE_OUTOFLINE);
        return uintptr_t(p) | (traceKind & JSTRACE_OUTOFLINE);
    }

    JSGCTraceKind outOfLineKind() const;

    uintptr_t ptr;
};

inline bool
operator==(const GCCellPtr &ptr1, const GCCellPtr &ptr2)
{
    return ptr1.asCell() == ptr2.asCell();
}



} /* namespace JS */

namespace js {
namespace gc {
namespace detail {

static MOZ_ALWAYS_INLINE uintptr_t *
GetGCThingMarkBitmap(const uintptr_t addr)
{
    MOZ_ASSERT(addr);
    const uintptr_t bmap_addr = (addr & ~ChunkMask) | ChunkMarkBitmapOffset;
    return reinterpret_cast<uintptr_t *>(bmap_addr);
}

static MOZ_ALWAYS_INLINE JS::shadow::Runtime *
GetGCThingRuntime(const uintptr_t addr)
{
    MOZ_ASSERT(addr);
    const uintptr_t rt_addr = (addr & ~ChunkMask) | ChunkRuntimeOffset;
    return *reinterpret_cast<JS::shadow::Runtime **>(rt_addr);
}

static MOZ_ALWAYS_INLINE void
GetGCThingMarkWordAndMask(const uintptr_t addr, uint32_t color,
                          uintptr_t **wordp, uintptr_t *maskp)
{
    MOZ_ASSERT(addr);
    const size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;
    MOZ_ASSERT(bit < js::gc::ChunkMarkBitmapBits);
    uintptr_t *bitmap = GetGCThingMarkBitmap(addr);
    const uintptr_t nbits = sizeof(*bitmap) * CHAR_BIT;
    *maskp = uintptr_t(1) << (bit % nbits);
    *wordp = &bitmap[bit / nbits];
}

static MOZ_ALWAYS_INLINE JS::Zone *
GetGCThingZone(const uintptr_t addr)
{
    MOZ_ASSERT(addr);
    const uintptr_t zone_addr = (addr & ~ArenaMask) | ArenaZoneOffset;
    return *reinterpret_cast<JS::Zone **>(zone_addr);

}

static MOZ_ALWAYS_INLINE bool
CellIsMarkedGray(const Cell *cell)
{
    MOZ_ASSERT(cell);
    MOZ_ASSERT(!js::gc::IsInsideNursery(cell));
    uintptr_t *word, mask;
    js::gc::detail::GetGCThingMarkWordAndMask(uintptr_t(cell), js::gc::GRAY, &word, &mask);
    return *word & mask;
}

} /* namespace detail */

MOZ_ALWAYS_INLINE bool
IsInsideNursery(const js::gc::Cell *cell)
{
    if (!cell)
        return false;
    uintptr_t addr = uintptr_t(cell);
    addr &= ~js::gc::ChunkMask;
    addr |= js::gc::ChunkLocationOffset;
    uint32_t location = *reinterpret_cast<uint32_t *>(addr);
    MOZ_ASSERT(location != 0);
    return location & ChunkLocationAnyNursery;
}

} /* namespace gc */
} /* namespace js */

namespace JS {

static MOZ_ALWAYS_INLINE Zone *
GetTenuredGCThingZone(void *thing)
{
    MOZ_ASSERT(!js::gc::IsInsideNursery((js::gc::Cell *)thing));
    return js::gc::detail::GetGCThingZone(uintptr_t(thing));
}

;



static MOZ_ALWAYS_INLINE bool
ObjectIsMarkedGray(JSObject *obj)
{
    /*
     * GC things residing in the nursery cannot be gray: they have no mark bits.
     * All live objects in the nursery are moved to tenured at the beginning of
     * each GC slice, so the gray marker never sees nursery things.
     */
    if (js::gc::IsInsideNursery(reinterpret_cast<js::gc::Cell *>(obj)))
        return false;
    return js::gc::detail::CellIsMarkedGray(reinterpret_cast<js::gc::Cell *>(obj));
}



static MOZ_ALWAYS_INLINE bool
GCThingIsMarkedGray(GCCellPtr thing)
{
    if (js::gc::IsInsideNursery(thing.asCell()))
        return false;
    return js::gc::detail::CellIsMarkedGray(thing.asCell());
}

} /* namespace JS */

namespace js {
namespace gc {

static MOZ_ALWAYS_INLINE bool
IsIncrementalBarrierNeededOnTenuredGCThing(JS::shadow::Runtime *rt, const JS::GCCellPtr thing)
{
    MOZ_ASSERT(thing);
    MOZ_ASSERT(!js::gc::IsInsideNursery(thing.asCell()));
    if (!rt->needsIncrementalBarrier())
        return false;
    JS::Zone *zone = JS::GetTenuredGCThingZone(thing.asCell());
    return JS::shadow::Zone::asShadowZone(zone)->needsIncrementalBarrier();
}

} /* namespace gc */
} /* namespace js */

#endif /* js_HeapAPI_h */
# 390 "../../dist/include/js/HeapAPI.h"
# 11 "../../dist/include/js/GCAPI.h" 2

namespace js {
namespace gc {
class GCRuntime;
}
}

typedef enum JSGCMode {
    /* Perform only global GCs. */
    JSGC_MODE_GLOBAL = 0,

    /* Perform per-compartment GCs until too much garbage has accumulated. */
    /* Minimize GC triggers and release empty GC chunks right away. */
    GC_SHRINK = 1
} JSGCInvocationKind;

namespace JS {

#define GCREASONS(D)                            \
    /* Reasons internal to the JS engine */     \
    D(API)                                      \
 */
;

/*
 * Returns true while an incremental GC is ongoing, both when actively
 * collecting and between slices.
 */
extern JS_PUBLIC_API(void)
IncrementalReferenceBarrier(GCCellPtr thing);

;

extern JS_PUBLIC_API(void)
IncrementalObjectBarrier(JSObject *obj);

/*
 * Returns true if the most recent GC ran incrementally.
 */
;

/*
 * Generational GC:
 *

/*
 * The GC does not immediately return the unused memory freed by a collection
 * back to the system incase it is needed soon afterwards. This call forces the
 * GC to return this memory immediately.
 */
extern JS_PUBLIC_API(void)
ShrinkGCBuffers(JSRuntime *rt);

/*
 * Assert if a GC occurs while this class is live. This class does not disable
 * the static rooting hazard analysis.
 */
class JS_PUBLIC_API(AutoAssertOnGC)
{
#ifdef DEBUG
    static void VerifyIsSafeToGC(JSRuntime *rt) {}
#endif
# 412 "../../dist/include/js/GCAPI.h"
};

/*
 * Assert if an allocation of a GC thing occurs while this class is live. This
 * class does not disable the static rooting hazard analysis.
 */
class JS_PUBLIC_API(AutoAssertNoAlloc)
{
#ifdef JS_DEBUG
    js::gc::GCRuntime *gc;

  public:
    AutoAssertNoAlloc() : gc(nullptr) {}
    explicit AutoAssertNoAlloc(JSRuntime *rt);
    ;
    ~AutoAssertNoAlloc();
#else
# 429 "../../dist/include/js/GCAPI.h"
  public:
    AutoAssertNoAlloc() {}
    explicit AutoAssertNoAlloc(JSRuntime *rt) {}
    void disallowAlloc(JSRuntime *rt) {}
#endif
# 434 "../../dist/include/js/GCAPI.h"
};

/*
 * Disable the static rooting hazard analysis in the live region and assert if
 * any allocation that could potentially trigger a GC occurs while this guard
 * object is live. This is most useful to help the exact rooting hazard analysis
 * in complex regions, since it cannot understand dataflow.
 *
 * Note: GC behavior is unpredictable even when deterministic and is generally
 *       non-deterministic in practice. The fact that this guard has not
 *       asserted is not a guarantee that a GC cannot happen in the guarded
 *       region. As a rule, anyone performing a GC unsafe action should
 *       understand the GC properties of all code in that region and ensure
 *       that the hazard analysis is correct for that code, rather than relying
 *       on this class.
 */
class JS_PUBLIC_API(AutoSuppressGCAnalysis) : public AutoAssertNoAlloc
{
  public:
    
    
};

/*
 * Assert that code is only ever called from a GC callback, disable the static
 * rooting hazard analysis and assert if any allocation that could potentially
 * trigger a GC occurs while this guard object is live.
 *
 * This is useful to make the static analysis ignore code that runs in GC
 * callbacks.
 */
class JS_PUBLIC_API(AutoAssertGCCallback) : public AutoSuppressGCAnalysis
{
  public:
    explicit AutoAssertGCCallback(JSObject *obj);
};

/*
 * Place AutoCheckCannotGC in scopes that you believe can never GC. These
 * annotations will be verified both dynamically via AutoAssertOnGC, and
 * statically with the rooting hazard analysis (implemented by making the
 * analysis consider AutoCheckCannotGC to be a GC pointer, and therefore
 * complain if it is live across a GC call.) It is useful when dealing with
 * internal pointers to GC things where the GC thing itself may not be present
 * for the static analysis: e.g. acquiring inline chars from a JSString* on the
 * heap.
 */
class JS_PUBLIC_API(AutoCheckCannotGC) : public AutoAssertOnGC
{
  public:
    AutoCheckCannotGC() : AutoAssertOnGC() {}
    
};

/*
 * Unsets the gray bit for anything reachable from |thing|. |kind| should not be
 * JSTRACE_SHAPE. |thing| should be non-null.
 */
extern JS_FRIEND_API(bool)
UnmarkGrayGCThingRecursively(GCCellPtr thing);

} /* namespace JS */

namespace js {
namespace gc {

static MOZ_ALWAYS_INLINE void
ExposeGCThingToActiveJS(JS::GCCellPtr thing)
{
    MOZ_ASSERT(thing.kind() != JSTRACE_SHAPE);

    /*
     * GC things residing in the nursery cannot be gray: they have no mark bits.
     * All live objects in the nursery are moved to tenured at the beginning of
     * each GC slice, so the gray marker never sees nursery things.
     */
    if (IsInsideNursery(thing.asCell()))
        return;
    JS::shadow::Runtime *rt = detail::GetGCThingRuntime(thing.unsafeAsUIntPtr());
    if (IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing))
        JS::IncrementalReferenceBarrier(thing);
    else if (JS::GCThingIsMarkedGray(thing))
        JS::UnmarkGrayGCThingRecursively(thing);
}

static MOZ_ALWAYS_INLINE void
MarkGCThingAsLive(JSRuntime *aRt, JS::GCCellPtr thing)
{
    JS::shadow::Runtime *rt = JS::shadow::Runtime::asShadowRuntime(aRt);
    /*
     * Any object in the nursery will not be freed during any GC running at that time.
     */
    if (IsInsideNursery(thing.asCell()))
        return;
    if (IsIncrementalBarrierNeededOnTenuredGCThing(rt, thing))
        JS::IncrementalReferenceBarrier(thing);
}

} /* namespace gc */
} /* namespace js */

namespace JS {

/*
 * This should be called when an object that is marked gray is exposed to the JS
 * engine (by handing it to running JS code or writing it into live JS
 * data). During incremental GC, since the gray bits haven't been computed yet,
 * we conservatively mark the object black.
 */
static MOZ_ALWAYS_INLINE void
ExposeObjectToActiveJS(JSObject *obj)
{
    js::gc::ExposeGCThingToActiveJS(GCCellPtr(obj));
}



/*
 * If a GC is currently marking, mark the string black.
 */
static MOZ_ALWAYS_INLINE void
MarkStringAsLive(Zone *zone, JSString *string)
{
    JSRuntime *rt = JS::shadow::Zone::asShadowZone(zone)->runtimeFromMainThread();
    js::gc::MarkGCThingAsLive(rt, GCCellPtr(string));
}

/*
 * Internal to Firefox.
 *
 * Note: this is not related to the PokeGC in nsJSEnvironment.
 */
;

/*
 * Internal to Firefox.
 */
;

} /* namespace JS */

#endif /* js_GCAPI_h */
# 582 "../../dist/include/js/GCAPI.h"
# 22 "../../dist/include/js/Value.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/RootingAPI.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_RootingAPI_h
#define js_RootingAPI_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/js/RootingAPI.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/js/RootingAPI.h"
# 17 "../../dist/include/js/RootingAPI.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/GCAPI.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/js/RootingAPI.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/HeapAPI.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/js/RootingAPI.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/js/RootingAPI.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Utility.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/js/RootingAPI.h"

/*
 * Moving GC Stack Rooting
 *
 * A moving GC may change the physical location of GC allocated things, even
 * when they are rooted, updating all pointers to the thing to refer to its new
 * location. The GC must therefore know about all live pointers to a thing,
 * not just one of them, in order to behave correctly.
 *
 * The |Rooted| and |Handle| classes below are used to root stack locations
 * whose value may be held live across a call that can trigger GC. For a
 *  Rooted<T> ----> Handle<T>
 *     |               ^
 *     |               |
 *     |               |
 *     +---> MutableHandle<T>
 *     (via &)
 *
 * All of these types have an implicit conversion to raw pointers.
 */

namespace js {

template <typename T>
struct GCMethods {};

template <typename T>
class RootedBase {};

template <typename T>
class HandleBase {};

template <typename T>
class MutableHandleBase {};

template <typename T>
class HeapBase {};

template <typename T>
class PersistentRootedBase {};

/*
 * js::NullPtr acts like a nullptr pointer in contexts that require a Handle.
 *
 * Handle provides an implicit constructor for js::NullPtr so that, given:
 *   foo(Handle<JSObject*> h);
 * callers can simply write:
 *   foo(js::NullPtr());
 * which avoids creating a Rooted<JSObject*> just to pass nullptr.
 *
 * This is the SpiderMonkey internal variant. js::NullPtr should be used in
 * preference to JS::NullPtr to avoid the GOT access required for JS_PUBLIC_API
 * symbols.
 */
struct NullPtr
{
    static void * const constNullValue;
};

namespace gc {
struct Cell;
template<typename T>
struct PersistentRootedMarker;
} /* namespace gc */

#define DECLARE_POINTER_COMPARISON_OPS(T)                                                \
    bool operator==(const T &other) const { return get() == other; }                              \
    bool operator!=(const T &other) const { return get() != other; }

// Important: Return a reference so passing a Rooted<T>, etc. to
// something that takes a |const T&| is not a GC hazard.
#define DECLARE_POINTER_CONSTREF_OPS(T)                                                  \
    operator const T &() const { return get(); }                                                  \
    const T &operator->() const { return get(); }

// Assignment operators on a base class are hidden by the implicitly defined
// operator= on the derived class. Thus, define the operator= directly on the
// class as we would need to manually pass it through anyway.
#define DECLARE_POINTER_ASSIGN_OPS(Wrapper, T)                                                    \
    Wrapper<T> &operator=(const T &p) {                                                           \
        set(p);                                                                                   \
        return *this;                                                                             \
    }                                                                                             \
    Wrapper<T> &operator=(const Wrapper<T> &other) {                                              \
        set(other.get());                                                                         \
        return *this;                                                                             \
    }                                                                                             \

#define DELETE_ASSIGNMENT_OPS(Wrapper, T)                                                 \
    template <typename S> Wrapper<T> &operator=(S) = delete;                                      \
    Wrapper<T> &operator=(const Wrapper<T> &) = delete;

#define DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr)                                                  \
    const T *address() const { return &(ptr); }                                                   \
    const T &get() const { return (ptr); }                                                        \

#define DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS(ptr)                                          \
    T *address() { return &(ptr); }                                                               \
    T &get() { return (ptr); }                                                                    \

} /* namespace js */

namespace JS {

template <typename T> class Rooted;
template <typename T> class PersistentRooted;

/* This is exposing internal state of the GC for inlining purposes. */
JS_FRIEND_API(bool) isGCEnabled();

/*
 * JS::NullPtr acts like a nullptr pointer in contexts that require a Handle.
 *
 * Handle provides an implicit constructor for JS::NullPtr so that, given:
 *   foo(Handle<JSObject*> h);
 * callers can simply write:
 *   foo(JS::NullPtr());
 * which avoids creating a Rooted<JSObject*> just to pass nullptr.
 */
struct JS_PUBLIC_API(NullPtr)
{
    static void * const constNullValue;
};

JS_FRIEND_API(void) HeapCellPostBarrier(js::gc::Cell **cellp);
JS_FRIEND_API(void) HeapCellRelocate(js::gc::Cell **cellp);

#ifdef JS_DEBUG
/*
 * For generational GC, assert that an object is in the tenured generation as
 * opposed to being in the nursery.
 */
extern JS_FRIEND_API(void)
AssertGCThingMustBeTenured(JSObject* obj);
#else
# 218 "../../dist/include/js/RootingAPI.h"
inline void
AssertGCThingMustBeTenured(JSObject *obj) {}
#endif
# 221 "../../dist/include/js/RootingAPI.h"

/*
 * Type T must be one of: JS::Value, jsid, JSObject*, JSString*, JSScript*
 */
template <typename T>
class Heap : public js::HeapBase<T>
{
  public:
    Heap() {
        static_assert(sizeof(T) == sizeof(Heap<T>),
                      "Heap<T> must be binary compatible with T.");
        init(js::GCMethods<T>::initial());
    }
    explicit Heap(T p) { init(p); }

    /*
     * For Heap, move semantics are equivalent to copy semantics. In C++, a
     * copy constructor taking const-ref is the way to get a single function
     * that will be used for both lvalue and rvalue copies, so we can simply
     * omit the rvalue variant.
     */
    

    ~Heap() {
        if (js::GCMethods<T>::needsPostBarrier(ptr))
            relocate();
    }

    DECLARE_POINTER_CONSTREF_OPS(T);
    DECLARE_POINTER_ASSIGN_OPS(Heap, T);
    DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr);

    

    /*
     * Set the pointer to a value which will cause a crash if it is
     * dereferenced.
     */
    void setToCrashOnTouch() {
        ptr = reinterpret_cast<T>(crashOnTouchPointer);
    }

    

  private:
    void init(T newPtr) {
        MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
        ptr = newPtr;
        if (js::GCMethods<T>::needsPostBarrier(ptr))
            post();
    }

    void set(T newPtr) {
        MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
        if (js::GCMethods<T>::needsPostBarrier(newPtr)) {
            ptr = newPtr;
            post();
        } else if (js::GCMethods<T>::needsPostBarrier(ptr)) {
            relocate();  /* Called before overwriting ptr. */
            ptr = newPtr;
        } else {
            ptr = newPtr;
        }
    }

    void post() {
        MOZ_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));
        js::GCMethods<T>::postBarrier(&ptr);
    }

    void relocate() {
        js::GCMethods<T>::relocate(&ptr);
    }

    enum {
        crashOnTouchPointer = 1
    };

    T ptr;
};

/*
 * to normally be long lived directly into the tenured generation; for example,
 * global objects. Additionally, SpiderMonkey does not visit individual objects
 * when deleting non-tenured objects, so object with finalizers are also always
 * tenured; for instance, this includes most DOM objects.
 *
 * The considerations to keep in mind when using a TenuredHeap<T> vs a normal
 * Heap<T> are:
 *
 *  - It is invalid for a TenuredHeap<T> to refer to a non-tenured thing.
 *  - It is however valid for a Heap<T> to refer to a tenured thing.
 *  - It is not possible to store flag bits in a Heap<T>.
 */
template <typename T>
class TenuredHeap : public js::HeapBase<T>
{
  public:
    TenuredHeap() : bits(0) {
        static_assert(sizeof(T) == sizeof(TenuredHeap<T>),
                      "TenuredHeap<T> must be binary compatible with T.");
    }
    
    

    bool operator==(const TenuredHeap<T> &other) { return bits == other.bits; }
    

    void setPtr(T newPtr) {
        MOZ_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);
        MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
        if (newPtr)
            AssertGCThingMustBeTenured(newPtr);
        bits = (bits & flagsMask) | reinterpret_cast<uintptr_t>(newPtr);
    }

    

    void unsetFlags(uintptr_t flagsToUnset) {
        MOZ_ASSERT((flagsToUnset & ~flagsMask) == 0);
        bits &= ~flagsToUnset;
    }

    bool hasFlag(uintptr_t flag) const {
        MOZ_ASSERT((flag & ~flagsMask) == 0);
        return (bits & flag) != 0;
    }

    T getPtr() const { return reinterpret_cast<T>(bits & ~flagsMask); }
    uintptr_t getFlags() const { return bits & flagsMask; }

    operator T() const { return getPtr(); }
    T operator->() const { return getPtr(); }

    TenuredHeap<T> &operator=(T p) {
        setPtr(p);
        return *this;
    }

    TenuredHeap<T> &operator=(const TenuredHeap<T>& other) {
        bits = other.bits;
        return *this;
    }

  private:
    enum {
        maskBits = 3,
        flagsMask = (1 << maskBits) - 1,
    };

    uintptr_t bits;
};

/*
 * Reference to a T that has been rooted elsewhere. This is most useful
 * as a parameter type, which guarantees that the T lvalue is properly
 * rooted. See "Move GC Stack Rooting" above.
 *
 * If you want to add additional methods to Handle for a specific
 * specialization, define a HandleBase<T> specialization containing them.
 */
template <typename T>
class MOZ_NONHEAP_CLASS Handle : public js::HandleBase<T>
{
    friend class JS::MutableHandle<T>;

  public:
    /* Creates a handle from a handle of a type convertible to T. */
    template <typename S>
    Handle(Handle<S> handle,
           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0)
    {
        static_assert(sizeof(Handle<T>) == sizeof(T *),
                      "Handle must be binary compatible with T*.");
        ptr = reinterpret_cast<const T *>(handle.address());
    }

    /* Create a handle for a nullptr pointer. */
    static MOZ_CONSTEXPR Handle fromMarkedLocation(const T *p) {
        return Handle(p, DeliberatelyChoosingThisOverload,
                      ImUsingThisOnlyInFromFromMarkedLocation);
    }

    /*
     * Construct a handle from an explicitly rooted location. This is the
     * normal way to create a handle, and normally happens implicitly.
     */
    template <typename S>
    inline
    Handle(const Rooted<S> &root,
           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);

    template <typename S>
    inline
    Handle(const PersistentRooted<S> &root,
           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);

    /* Construct a read only handle from a mutable handle. */
    template <typename S>
    inline
    Handle(MutableHandle<S> &root,
           typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy = 0);

    DECLARE_POINTER_COMPARISON_OPS(T);
    DECLARE_POINTER_CONSTREF_OPS(T);
    DECLARE_NONPOINTER_ACCESSOR_METHODS(*ptr);

  private:
    Handle() {}
    DELETE_ASSIGNMENT_OPS(Handle, T);

    enum Disambiguator { DeliberatelyChoosingThisOverload = 42 };
    enum CallerIdentity { ImUsingThisOnlyInFromFromMarkedLocation = 17 };
    MOZ_CONSTEXPR Handle(const T *p, Disambiguator, CallerIdentity) : ptr(p) {}

    const T *ptr;
};

/*
 * Similar to a handle, but the underlying storage can be changed. This is
 * useful for outparams.
 *
 * If you want to add additional methods to MutableHandle for a specific
 * specialization, define a MutableHandleBase<T> specialization containing
 * them.
 */
template <typename T>
class MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T>
{
  public:
    inline MOZ_IMPLICIT MutableHandle(Rooted<T> *root);
    inline MOZ_IMPLICIT MutableHandle(PersistentRooted<T> *root);

  private:
    // Disallow nullptr for overloading purposes.
    MutableHandle(decltype(nullptr)) = delete;

  public:
    void set(T v) {
        MOZ_ASSERT(!js::GCMethods<T>::poisoned(v));
        *ptr = v;
    }

    /*
     * This may be called only if the location of the T is guaranteed
     * to be marked (for some reason other than being a Rooted),
     * e.g., if it is guaranteed to be reachable from an implicit root.
     *
     * Create a MutableHandle from a raw location of a T.
     */
    static MutableHandle fromMarkedLocation(T *p) {
        MutableHandle h;
        h.ptr = p;
        return h;
    }

    DECLARE_POINTER_CONSTREF_OPS(T);
    DECLARE_NONPOINTER_ACCESSOR_METHODS(*ptr);
    DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS(*ptr);

  private:
    MutableHandle() {}
    DELETE_ASSIGNMENT_OPS(MutableHandle, T);

    T *ptr;
};

} /* namespace JS */

namespace js {

/*
 * InternalHandle is a handle to an internal pointer into a gcthing. Use
 * InternalHandle when you have a pointer to a direct field of a gcthing, or
 * when you need a parameter type for something that *may* be a pointer to a
 * direct field of a gcthing.
 */
template <typename T>
class InternalHandle {};

template <typename T>
class InternalHandle<T*>
{
    void * const *holder;
    size_t offset;

  public:
    /*
     * Create an InternalHandle using a Handle to the gcthing containing the
     * field in question, and a pointer to the field.
     */
    template<typename H>
    InternalHandle(const JS::Handle<H> &handle, T *field)
      : holder((void**)handle.address()), offset(uintptr_t(field) - uintptr_t(handle.get()))
    {}

    /*
     * Create an InternalHandle to a field within a Rooted<>.
     */
    template<typename R>
    void operator=(InternalHandle<T*> other) = delete;
};

/*
 * By default, things should use the inheritance hierarchy to find their
 * ThingRootKind. Some pointer types are explicitly set in jspubtd.h so that
 * Rooted<T> may be used without the class definition being available.
 */
template <typename T>
struct RootKind
{
    static ThingRootKind rootKind() { return T::rootKind(); }
};

template <typename T>
struct RootKind<T *>
{
    static ThingRootKind rootKind() { return T::rootKind(); }
};

template <typename T>
struct GCMethods<T *>
{
    static T *initial() { return nullptr; }
    static bool poisoned(T *v) { return JS::IsPoisonedPtr(v); }
    static bool needsPostBarrier(T *v) { return false; }
    static void postBarrier(T **vp) {}
    static void relocate(T **vp) {}
};

template <>
struct GCMethods<JSObject *>
{
    static JSObject *initial() { return nullptr; }
    static bool poisoned(JSObject *v) { return JS::IsPoisonedPtr(v); }
    static gc::Cell *asGCThingOrNull(JSObject *v) {
        if (!v)
            return nullptr;
        MOZ_ASSERT(uintptr_t(v) > 32);
        return reinterpret_cast<gc::Cell *>(v);
    }
    static bool needsPostBarrier(JSObject *v) {
        return v != nullptr && gc::IsInsideNursery(reinterpret_cast<gc::Cell *>(v));
    }
    static void postBarrier(JSObject **vp) {
        JS::HeapCellPostBarrier(reinterpret_cast<js::gc::Cell **>(vp));
    }
    static void relocate(JSObject **vp) {
        JS::HeapCellRelocate(reinterpret_cast<js::gc::Cell **>(vp));
    }
};

template <>
struct GCMethods<JSFunction *>
{
    
    
    
    
    
};

} /* namespace js */

namespace JS {

/*
 * Local variable of type T whose value is always rooted. This is typically
 * used for local variables, or for non-rooted values being passed to a
 * function that requires a handle, e.g. Foo(Root<T>(cx, x)).
 *
 * If you want to add additional methods to Rooted for a specific
 * specialization, define a RootedBase<T> specialization containing them.
 */
template <typename T>
class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
{
    /* Note: CX is a subclass of either ContextFriendFields or PerThreadDataFriendFields. */
    template <typename CX>
    void init(CX *cx) {
        js::ThingRootKind kind = js::RootKind<T>::rootKind();
        this->stack = &cx->thingGCRooters[kind];
        this->prev = *stack;
        *stack = reinterpret_cast<Rooted<void*>*>(this);

        MOZ_ASSERT(!js::GCMethods<T>::poisoned(ptr));
    }

  public:
    explicit Rooted(JSContext *cx
                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
      : ptr(js::GCMethods<T>::initial())
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
        init(js::ContextFriendFields::get(cx));
    }

    Rooted(JSContext *cx, T initial
           MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
      : ptr(initial)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
        init(js::ContextFriendFields::get(cx));
    }

    explicit Rooted(js::ContextFriendFields *cx
                    MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
      : ptr(js::GCMethods<T>::initial())
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
        init(cx);
    }

    

    

    

    ~Rooted() {
        MOZ_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));
        *stack = prev;
    }

    Rooted<T> *previous() { return reinterpret_cast<Rooted<T>*>(prev); }

    /*
     * This method is public for Rooted so that Codegen.py can use a Rooted
     * interchangeably with a MutableHandleValue.
     */
    void set(T value) {
        MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
        ptr = value;
    }

    DECLARE_POINTER_COMPARISON_OPS(T);
    DECLARE_POINTER_CONSTREF_OPS(T);
    DECLARE_POINTER_ASSIGN_OPS(Rooted, T);
    DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr);
    DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS(ptr);

  private:
    /*
     * These need to be templated on void* to avoid aliasing issues between, for
     * example, Rooted<JSObject> and Rooted<JSFunction>, which use the same
     * stack head pointer for different classes.
     */
    Rooted<void *> **stack, *prev;

    /*
     * |ptr| must be the last field in Rooted because the analysis treats all
     * Rooted as Rooted<void*> during the analysis. See bug 829372.
     */
    T ptr;

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER

    Rooted(const Rooted &) = delete;
};

} /* namespace JS */

namespace js {

/*
 * Augment the generic Rooted<T> interface when T = JSObject* with
};

/* Interface substitute for Rooted<T> which does not root the variable's memory. */
template <typename T>
class FakeRooted : public RootedBase<T>
{
  public:
    template <typename CX>
    FakeRooted(CX *cx
               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
      : ptr(GCMethods<T>::initial())
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    template <typename CX>
    FakeRooted(CX *cx, T initial
               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
      : ptr(initial)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    DECLARE_POINTER_COMPARISON_OPS(T);
    DECLARE_POINTER_CONSTREF_OPS(T);
    DECLARE_POINTER_ASSIGN_OPS(FakeRooted, T);
    DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr);
    DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS(ptr);

  private:
    T ptr;

    void set(const T &value) {
        MOZ_ASSERT(!GCMethods<T>::poisoned(value));
        ptr = value;
    }

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER

    FakeRooted(const FakeRooted &) = delete;
};

/* Interface substitute for MutableHandle<T> which is not required to point to rooted memory. */
template <typename T>
class FakeMutableHandle : public js::MutableHandleBase<T>
{
  public:
    MOZ_IMPLICIT FakeMutableHandle(T *t) {
        ptr = t;
    }

    MOZ_IMPLICIT FakeMutableHandle(FakeRooted<T> *root) {
        ptr = root->address();
    }

    

    DECLARE_POINTER_CONSTREF_OPS(T);
    DECLARE_NONPOINTER_ACCESSOR_METHODS(*ptr);
    DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS(*ptr);

  private:
    
    DELETE_ASSIGNMENT_OPS(FakeMutableHandle, T);

    T *ptr;
};

/*
 * Types for a variable that either should or shouldn't be rooted, depending on
 * the template parameter allowGC. Used for implementing functions that can
 * operate on either rooted or unrooted data.
 *
 * The toHandle() and toMutableHandle() functions are for calling functions
 * which require handle types and are only called in the CanGC case. These
 * allow the calling code to type check.
 */
enum AllowGC {
    NoGC = 0,
    CanGC = 1
};
template <typename T, AllowGC allowGC>
class MaybeRooted
{
};

template <typename T> class MaybeRooted<T, CanGC>
{
  public:
    typedef JS::Handle<T> HandleType;
    typedef JS::Rooted<T> RootType;
    typedef JS::MutableHandle<T> MutableHandleType;

    

    
};

} /* namespace js */

namespace JS {

template <typename T> template <typename S>
inline
Handle<T>::Handle(const Rooted<S> &root,
                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)
{
    ptr = reinterpret_cast<const T *>(root.address());
}

template <typename T> template <typename S>
inline
Handle<T>::Handle(const PersistentRooted<S> &root,
                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)
{
    ptr = reinterpret_cast<const T *>(root.address());
}

template <typename T> template <typename S>
inline
Handle<T>::Handle(MutableHandle<S> &root,
                  typename mozilla::EnableIf<mozilla::IsConvertible<S, T>::value, int>::Type dummy)
{
    ptr = reinterpret_cast<const T *>(root.address());
}

template <typename T>
inline
MutableHandle<T>::MutableHandle(Rooted<T> *root)
{
    static_assert(sizeof(MutableHandle<T>) == sizeof(T *),
                  "MutableHandle must be binary compatible with T*.");
    ptr = root->address();
}

template <typename T>
inline
MutableHandle<T>::MutableHandle(PersistentRooted<T> *root)
{
    static_assert(sizeof(MutableHandle<T>) == sizeof(T *),
                  "MutableHandle must be binary compatible with T*.");
    ptr = root->address();
}

/*
 * A copyable, assignable global GC root type with arbitrary lifetime, an
 * infallible constructor, and automatic unrooting on destruction.
 *
 * These roots can be used in heap-allocated data structures, so they are not
 * associated with any particular JSContext or stack. They are registered with
 * the JSRuntime itself, without locking, so they require a full JSContext to be
 * initialized, not one of its more restricted superclasses.  Initialization may
 * take place on construction, or in two phases if the no-argument constructor
 * is called followed by init().
 *
 * Note that you must not use an PersistentRooted in an object owned by a JS
 * object:
 *
 * Whenever one object whose lifetime is decided by the GC refers to another
 * such object, that edge must be traced only if the owning JS object is traced.
 * marked when the object itself is marked.
 */
template<typename T>
class PersistentRooted : public js::PersistentRootedBase<T>,
                         private mozilla::LinkedListElement<PersistentRooted<T>>
{
    typedef mozilla::LinkedListElement<PersistentRooted<T>> ListBase;

    friend class mozilla::LinkedList<PersistentRooted>;
    friend class mozilla::LinkedListElement<PersistentRooted>;

    friend struct js::gc::PersistentRootedMarker<T>;

    friend void js::gc::FinishPersistentRootedChains(JSRuntime *rt);

    void registerWithRuntime(JSRuntime *rt) {
        MOZ_ASSERT(!initialized());
        JS::shadow::Runtime *srt = JS::shadow::Runtime::asShadowRuntime(rt);
        srt->getPersistentRootedList<T>().insertBack(this);
    }

  public:
    

    

    

    

    

    

    bool initialized() {
        return ListBase::isInList();
    }

    

    

    

    

    

    DECLARE_POINTER_COMPARISON_OPS(T);
    DECLARE_POINTER_CONSTREF_OPS(T);
    DECLARE_POINTER_ASSIGN_OPS(PersistentRooted, T);
    DECLARE_NONPOINTER_ACCESSOR_METHODS(ptr);
    DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS(ptr);

  private:
    void set(T value) {
        MOZ_ASSERT(initialized());
        MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
        ptr = value;
    }

    T ptr;
};

class JS_PUBLIC_API(ObjectPtr)
{
    Heap<JSObject *> value;

  public:
    

    

    /* Always call finalize before the destructor. */
    

    

    

    
};

} /* namespace JS */

namespace js {
namespace gc {



} /* namespace gc */
} /* namespace js */

#undef DELETE_ASSIGNMENT_OPS
#undef DECLARE_NONPOINTER_MUTABLE_ACCESSOR_METHODS
#undef DECLARE_NONPOINTER_ACCESSOR_METHODS

#endif  /* js_RootingAPI_h */
# 1235 "../../dist/include/js/RootingAPI.h"
# 23 "../../dist/include/js/Value.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/Utility.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/js/Value.h"

namespace JS { class Value; }

/* JS::Value can store a full int32_t. */
#define JSVAL_INT_BITS          32
#define JSVAL_INT_MIN           ((int32_t)0x80000000)
#define JSVAL_INT_MAX           ((int32_t)0x7fffffff)

/*
 * Try to get jsvals 64-bit aligned. We could almost assert that all values are
 * aligned, but MSVC and GCC occasionally break alignment.
 */
#if defined(__GNUC__) || defined(__xlc__) || defined(__xlC__)
# define JSVAL_ALIGNMENT        __attribute__((aligned (8)))
#elif defined(_MSC_VER)
# 39 "../../dist/include/js/Value.h"
  /*
   * Structs can be aligned with MSVC, but not if they are used as parameters,
   * so we just don't try to align.
   */
# define JSVAL_ALIGNMENT
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# 45 "../../dist/include/js/Value.h"
# define JSVAL_ALIGNMENT
#elif defined(__HP_cc) || defined(__HP_aCC)
# 47 "../../dist/include/js/Value.h"
# define JSVAL_ALIGNMENT
#endif
# 49 "../../dist/include/js/Value.h"

#if defined(JS_PUNBOX64)
# define JSVAL_TAG_SHIFT 47
#endif
# 53 "../../dist/include/js/Value.h"

/*
 * We try to use enums so that printing a jsval_layout in the debugger shows
 * nice symbolic type tags, however we can only do this when we can force the
 * underlying type of the enum to be the desired size.
 */
#if !defined(__SUNPRO_CC) && !defined(__xlC__)

#if defined(_MSC_VER)
# define JS_ENUM_HEADER(id, type)              enum id : type
# define JS_ENUM_FOOTER(id)
#else
# 65 "../../dist/include/js/Value.h"
# define JS_ENUM_HEADER(id, type)              enum id
# define JS_ENUM_FOOTER(id)                    __attribute__((packed))
#endif
# 68 "../../dist/include/js/Value.h"

/* Remember to propagate changes to the C defines below. */
JS_ENUM_HEADER(JSValueType, uint8_t)
{
    JSVAL_TYPE_DOUBLE              = 0x00,
    JSVAL_TYPE_INT32               = 0x01,
    JSVAL_TYPE_UNDEFINED           = 0x02,
    JSVAL_TYPE_BOOLEAN             = 0x03,
    JSVAL_TYPE_MAGIC               = 0x04,
    JSVAL_TYPE_STRING              = 0x05,
    JSVAL_TYPE_SYMBOL              = 0x06,
    JSVAL_TYPE_NULL                = 0x07,
    JSVAL_TYPE_OBJECT              = 0x08,

    /* These never appear in a jsval; they are only provided as an out-of-band value. */
    JSVAL_TYPE_UNKNOWN             = 0x20,
    JSVAL_TYPE_MISSING             = 0x21
} JS_ENUM_FOOTER(JSValueType);

static_assert(sizeof(JSValueType) == 1,
              "compiler typed enum support is apparently buggy");

#if defined(JS_NUNBOX32)

/* Remember to propagate changes to the C defines below. */
JS_ENUM_HEADER(JSValueTag, uint32_t)
{
    JSVAL_TAG_CLEAR                = 0xFFFFFF80,
    JSVAL_TAG_INT32                = JSVAL_TAG_CLEAR | JSVAL_TYPE_INT32,
    JSVAL_TAG_UNDEFINED            = JSVAL_TAG_CLEAR | JSVAL_TYPE_UNDEFINED,
    JSVAL_TAG_STRING               = JSVAL_TAG_CLEAR | JSVAL_TYPE_STRING,
    JSVAL_TAG_SYMBOL               = JSVAL_TAG_CLEAR | JSVAL_TYPE_SYMBOL,
    JSVAL_TAG_BOOLEAN              = JSVAL_TAG_CLEAR | JSVAL_TYPE_BOOLEAN,
    JSVAL_TAG_MAGIC                = JSVAL_TAG_CLEAR | JSVAL_TYPE_MAGIC,
    JSVAL_TAG_NULL                 = JSVAL_TAG_CLEAR | JSVAL_TYPE_NULL,
    JSVAL_TAG_OBJECT               = JSVAL_TAG_CLEAR | JSVAL_TYPE_OBJECT
} JS_ENUM_FOOTER(JSValueTag);

static_assert(sizeof(JSValueTag) == sizeof(uint32_t),
              "compiler typed enum support is apparently buggy");

#elif defined(JS_PUNBOX64)
# 110 "../../dist/include/js/Value.h"
#define JSVAL_SHIFTED_TAG_UNDEFINED  (((uint64_t)JSVAL_TAG_UNDEFINED)  << JSVAL_TAG_SHIFT)
#define JSVAL_SHIFTED_TAG_STRING     (((uint64_t)JSVAL_TAG_STRING)     << JSVAL_TAG_SHIFT)
#define JSVAL_SHIFTED_TAG_SYMBOL     (((uint64_t)JSVAL_TAG_SYMBOL)     << JSVAL_TAG_SHIFT)
#define JSVAL_SHIFTED_TAG_BOOLEAN    (((uint64_t)JSVAL_TAG_BOOLEAN)    << JSVAL_TAG_SHIFT)
#define JSVAL_SHIFTED_TAG_MAGIC      (((uint64_t)JSVAL_TAG_MAGIC)      << JSVAL_TAG_SHIFT)
#define JSVAL_SHIFTED_TAG_NULL       (((uint64_t)JSVAL_TAG_NULL)       << JSVAL_TAG_SHIFT)
#define JSVAL_SHIFTED_TAG_OBJECT     (((uint64_t)JSVAL_TAG_OBJECT)     << JSVAL_TAG_SHIFT)

#endif  /* JS_PUNBOX64 */
# 208 "../../dist/include/js/Value.h"
#define JSVAL_TAG_MASK               0xFFFF800000000000LL
#define JSVAL_TYPE_TO_TAG(type)      ((JSValueTag)(JSVAL_TAG_MAX_DOUBLE | (type)))
#define JSVAL_TYPE_TO_SHIFTED_TAG(type) (((uint64_t)JSVAL_TYPE_TO_TAG(type)) << JSVAL_TAG_SHIFT)

#define JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET         JSVAL_TAG_NULL
#define JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET           JSVAL_TAG_OBJECT
#define JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET              JSVAL_TAG_INT32
#define JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET             JSVAL_TAG_STRING

#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_OBJ_OR_NULL_SET  JSVAL_SHIFTED_TAG_NULL
#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_PRIMITIVE_SET    JSVAL_SHIFTED_TAG_OBJECT
#define JSVAL_UPPER_EXCL_SHIFTED_TAG_OF_NUMBER_SET       JSVAL_SHIFTED_TAG_UNDEFINED
#define JSVAL_LOWER_INCL_SHIFTED_TAG_OF_GCTHING_SET      JSVAL_SHIFTED_TAG_STRING

#endif /* JS_PUNBOX64 */
# 237 "../../dist/include/js/Value.h"

typedef enum JSWhyMagic
{
    JS_ELEMENTS_HOLE,            /* a hole in a native object's elements */
    JS_NO_ITER_VALUE,            /* there is not a pending iterator value */
    JS_GENERATOR_CLOSING,        /* exception value thrown when closing a generator */
    JS_NO_CONSTANT,              /* compiler sentinel value */
    JS_THIS_POISON,              /* used in debug builds to catch tracing errors */
    JS_ARG_POISON,               /* used in debug builds to catch tracing errors */
    JS_SERIALIZE_NO_NODE,        /* an empty subnode in the AST serializer */
    JS_LAZY_ARGUMENTS,           /* lazy arguments value on the stack */
    JS_OPTIMIZED_ARGUMENTS,      /* optimized-away 'arguments' value */
    JS_IS_CONSTRUCTING,          /* magic value passed to natives to indicate construction */
    JS_OVERWRITTEN_CALLEE,       /* arguments.callee has been overwritten */
    JS_BLOCK_NEEDS_CLONE,        /* value of static block object slot */
    JS_HASH_KEY_EMPTY,           /* see class js::HashableValue */
    JS_ION_ERROR,                /* error while running Ion code */
    JS_ION_BAILOUT,              /* missing recover instruction result */
    JS_OPTIMIZED_OUT,            /* optimized out slot */
    JS_UNINITIALIZED_LEXICAL,    /* uninitialized lexical bindings that produce ReferenceError
                                  * on touch. */
    JS_GENERIC_MAGIC,            /* for local use */
    JS_WHY_MAGIC_COUNT
} JSWhyMagic;

#if defined(IS_LITTLE_ENDIAN)
# if defined(JS_NUNBOX32)
typedef union jsval_layout
{
    uint64_t asBits;
    struct {
        union {
            int32_t        i32;
            uint32_t       u32;
            uint32_t       boo;     // Don't use |bool| -- it must be four bytes.
            JSString       *str;
            JS::Symbol     *sym;
            JSObject       *obj;
            js::gc::Cell   *cell;
            void           *ptr;
            JSWhyMagic     why;
            size_t         word;
            uintptr_t      uintptr;
        } payload;
        JSValueTag tag;
    } s;
    double asDouble;
    void *asPtr;
} JSVAL_ALIGNMENT jsval_layout;
# elif defined(JS_PUNBOX64)
# 287 "../../dist/include/js/Value.h"
            int32_t        i32;
            uint32_t       u32;
            JSWhyMagic     why;
        } payload;
    } s;
    double asDouble;
    void *asPtr;
    size_t asWord;
    uintptr_t asUIntPtr;
} JSVAL_ALIGNMENT jsval_layout;
# endif /* JS_PUNBOX64 */
# 356 "../../dist/include/js/Value.h"
#endif  /* defined(IS_LITTLE_ENDIAN) */
# 357 "../../dist/include/js/Value.h"

JS_STATIC_ASSERT(sizeof(jsval_layout) == 8);

/*
 * For codesize purposes on some platforms, it's important that the
 * compiler know that JS::Values constructed from constant values can be
 * folded to constant bit patterns at compile time, rather than
 * constructed at runtime.  Doing this requires a fair amount of C++11
 * features, which are not supported on all of our compilers.  Set up
 * some defines and helper macros in an attempt to confine the ugliness
 * here, rather than scattering it all about the file.  The important
 * features are:
 *
 * - constexpr;
 * - defaulted functions;
 * - C99-style designated initializers.
 */
#if defined(__clang__)
#  if __has_feature(cxx_constexpr) && __has_feature(cxx_defaulted_functions)
#    define JS_VALUE_IS_CONSTEXPR
#  endif
# 378 "../../dist/include/js/Value.h"
#elif defined(__GNUC__)
# 379 "../../dist/include/js/Value.h"
/*
 * We need 4.5 for defaulted functions, 4.6 for constexpr, 4.7 because 4.6
 * doesn't understand |(X) { .field = ... }| syntax, and 4.7.3 because
 * versions prior to that have bugs in the C++ front-end that cause crashes.
 */
#  if MOZ_GCC_VERSION_AT_LEAST(4, 7, 3)
#    define JS_VALUE_IS_CONSTEXPR
#  endif
# 387 "../../dist/include/js/Value.h"
#endif
# 388 "../../dist/include/js/Value.h"

#if defined(JS_VALUE_IS_CONSTEXPR)
#  define JS_RETURN_LAYOUT_FROM_BITS(BITS) \
    return (jsval_layout) { .asBits = (BITS) }
#  define JS_VALUE_CONSTEXPR MOZ_CONSTEXPR
#  define JS_VALUE_CONSTEXPR_VAR MOZ_CONSTEXPR_VAR
#else
# 395 "../../dist/include/js/Value.h"
#  define JS_RETURN_LAYOUT_FROM_BITS(BITS) \
    jsval_layout l;                        \
    l.asBits = (BITS);                     \
    return l;
#  define JS_VALUE_CONSTEXPR
#  define JS_VALUE_CONSTEXPR_VAR const
#endif
# 402 "../../dist/include/js/Value.h"

#if defined(JS_NUNBOX32)

/*
 * N.B. GCC, in some but not all cases, chooses to emit signed comparison of
 * JSValueTag even though its underlying type has been forced to be uint32_t.
 * Thus, all comparisons should explicitly cast operands to uint32_t.
 */

static inline JS_VALUE_CONSTEXPR jsval_layout
BUILD_JSVAL(JSValueTag tag, uint32_t payload)
{
    JS_RETURN_LAYOUT_FROM_BITS((((uint64_t)(uint32_t)tag) << 32) | payload);
}

static inline bool
JSVAL_IS_DOUBLE_IMPL(jsval_layout l)
{
    return (uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_CLEAR;
}

static inline jsval_layout
DOUBLE_TO_JSVAL_IMPL(double d)
{
    jsval_layout l;
    l.asDouble = d;
    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));
    return l;
}

static inline bool
JSVAL_IS_INT32_IMPL(jsval_layout l)
{
    return l.s.tag == JSVAL_TAG_INT32;
}

static inline int32_t
JSVAL_TO_INT32_IMPL(jsval_layout l)
{
    return l.s.payload.i32;
}

static inline JS_VALUE_CONSTEXPR jsval_layout
INT32_TO_JSVAL_IMPL(int32_t i)
{
#if defined(JS_VALUE_IS_CONSTEXPR)
    return BUILD_JSVAL(JSVAL_TAG_INT32, i);
#else
# 450 "../../dist/include/js/Value.h"
    jsval_layout l;
    l.s.tag = JSVAL_TAG_INT32;
    l.s.payload.i32 = i;
    return l;
#endif
# 455 "../../dist/include/js/Value.h"
}

static inline bool
JSVAL_IS_NUMBER_IMPL(jsval_layout l)
{
    JSValueTag tag = l.s.tag;
    MOZ_ASSERT(tag != JSVAL_TAG_CLEAR);
    return (uint32_t)tag <= (uint32_t)JSVAL_UPPER_INCL_TAG_OF_NUMBER_SET;
}

static inline bool
JSVAL_IS_UNDEFINED_IMPL(jsval_layout l)
{
    return l.s.tag == JSVAL_TAG_UNDEFINED;
}

static inline bool
JSVAL_IS_STRING_IMPL(jsval_layout l)
{
    return l.s.tag == JSVAL_TAG_STRING;
}

static inline jsval_layout
STRING_TO_JSVAL_IMPL(JSString *str)
{
    jsval_layout l;
    MOZ_ASSERT(uintptr_t(str) > 0x1000);
    l.s.tag = JSVAL_TAG_STRING;
    l.s.payload.str = str;
    return l;
}

static inline JSString *
JSVAL_TO_STRING_IMPL(jsval_layout l)
{
    return l.s.payload.str;
}

static inline bool
JSVAL_IS_SYMBOL_IMPL(jsval_layout l)
{
    return l.s.tag == JSVAL_TAG_SYMBOL;
}

static inline jsval_layout
SYMBOL_TO_JSVAL_IMPL(JS::Symbol *sym)
{
    jsval_layout l;
    MOZ_ASSERT(uintptr_t(sym) > 0x1000);
    l.s.tag = JSVAL_TAG_SYMBOL;
    l.s.payload.sym = sym;
    return l;
}



static inline bool
JSVAL_IS_BOOLEAN_IMPL(jsval_layout l)
{
    return l.s.tag == JSVAL_TAG_BOOLEAN;
}

static inline bool
JSVAL_TO_BOOLEAN_IMPL(jsval_layout l)
{
    return l.s.payload.boo;
}

static inline jsval_layout
BOOLEAN_TO_JSVAL_IMPL(bool b)
{
    jsval_layout l;
    l.s.tag = JSVAL_TAG_BOOLEAN;
    l.s.payload.boo = b;
    return l;
}

static inline bool
JSVAL_IS_MAGIC_IMPL(jsval_layout l)
{
    return l.s.tag == JSVAL_TAG_MAGIC;
}

static inline bool
JSVAL_IS_OBJECT_IMPL(jsval_layout l)
{
    return l.s.tag == JSVAL_TAG_OBJECT;
}

static inline bool
JSVAL_IS_PRIMITIVE_IMPL(jsval_layout l)
{
    return (uint32_t)l.s.tag < (uint32_t)JSVAL_UPPER_EXCL_TAG_OF_PRIMITIVE_SET;
}

static inline bool
JSVAL_IS_OBJECT_OR_NULL_IMPL(jsval_layout l)
{
    MOZ_ASSERT((uint32_t)l.s.tag <= (uint32_t)JSVAL_TAG_OBJECT);
    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_OBJ_OR_NULL_SET;
}

static inline JSObject *
JSVAL_TO_OBJECT_IMPL(jsval_layout l)
{
    return l.s.payload.obj;
}

static inline jsval_layout
OBJECT_TO_JSVAL_IMPL(JSObject *obj)
{
    jsval_layout l;
    MOZ_ASSERT(uintptr_t(obj) > 0x1000 || uintptr_t(obj) == 0x42);
    l.s.tag = JSVAL_TAG_OBJECT;
    l.s.payload.obj = obj;
    return l;
}

static inline bool
JSVAL_IS_NULL_IMPL(jsval_layout l)
{
    return l.s.tag == JSVAL_TAG_NULL;
}

static inline jsval_layout
PRIVATE_PTR_TO_JSVAL_IMPL(void *ptr)
{
    jsval_layout l;
    MOZ_ASSERT(((uint32_t)ptr & 1) == 0);
    l.s.tag = (JSValueTag)0;
    l.s.payload.ptr = ptr;
    MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(l));
    return l;
}

static inline void *
JSVAL_TO_PRIVATE_PTR_IMPL(jsval_layout l)
{
    return l.s.payload.ptr;
}

static inline bool
JSVAL_IS_GCTHING_IMPL(jsval_layout l)
{
    /* gcc sometimes generates signed < without explicit casts. */
    return (uint32_t)l.s.tag >= (uint32_t)JSVAL_LOWER_INCL_TAG_OF_GCTHING_SET;
}

static inline js::gc::Cell *
JSVAL_TO_GCTHING_IMPL(jsval_layout l)
{
    return l.s.payload.cell;
}

static inline uint32_t
JSVAL_TRACE_KIND_IMPL(jsval_layout l)
{
    static_assert((JSVAL_TAG_STRING & 0x03) == JSTRACE_STRING,
                  "Value type tags must correspond with JSGCTraceKinds.");
    static_assert((JSVAL_TAG_SYMBOL & 0x03) == JSTRACE_SYMBOL,
                  "Value type tags must correspond with JSGCTraceKinds.");
    static_assert((JSVAL_TAG_OBJECT & 0x03) == JSTRACE_OBJECT,
                  "Value type tags must correspond with JSGCTraceKinds.");
    return l.s.tag & 0x03;
}

static inline bool
JSVAL_IS_SPECIFIC_INT32_IMPL(jsval_layout l, int32_t i32)
{
    return l.s.tag == JSVAL_TAG_INT32 && l.s.payload.i32 == i32;
}

static inline bool
JSVAL_IS_SPECIFIC_BOOLEAN_IMPL(jsval_layout l, bool b)
{
    return (l.s.tag == JSVAL_TAG_BOOLEAN) && (l.s.payload.boo == uint32_t(b));
}

static inline jsval_layout
MAGIC_TO_JSVAL_IMPL(JSWhyMagic why)
{
    jsval_layout l;
    l.s.tag = JSVAL_TAG_MAGIC;
    l.s.payload.why = why;
    return l;
}

static inline jsval_layout
MAGIC_UINT32_TO_JSVAL_IMPL(uint32_t payload)
{
    jsval_layout l;
    l.s.tag = JSVAL_TAG_MAGIC;
    l.s.payload.u32 = payload;
    return l;
}





#elif defined(JS_PUNBOX64)
# 671 "../../dist/include/js/Value.h"

static inline JS_VALUE_CONSTEXPR jsval_layout
BUILD_JSVAL(JSValueTag tag, uint64_t payload)
{
    JS_RETURN_LAYOUT_FROM_BITS((((uint64_t)(uint32_t)tag) << JSVAL_TAG_SHIFT) | payload);
}

static inline bool
JSVAL_IS_DOUBLE_IMPL(jsval_layout l)
{
    return l.asBits <= JSVAL_SHIFTED_TAG_MAX_DOUBLE;

#endif  /* JS_PUNBOX64 */
# 929 "../../dist/include/js/Value.h"

static inline bool
JSVAL_IS_TRACEABLE_IMPL(jsval_layout l)
{
    return JSVAL_IS_GCTHING_IMPL(l) && !JSVAL_IS_NULL_IMPL(l);
}

;
static inline JS_VALUE_CONSTEXPR JS::Value IMPL_TO_JSVAL(jsval_layout l);

namespace JS {

static inline JS_VALUE_CONSTEXPR JS::Value UndefinedValue();

/**
 * Returns a generic quiet NaN value, with all payload bits set to zero.
 *
 * Among other properties, this NaN's bit pattern conforms to JS::Value's
 * bit pattern restrictions.
 */
static MOZ_ALWAYS_INLINE double
GenericNaN()
{
  return mozilla::SpecificNaN<double>(0, 0x8000000000000ULL);
}

/* MSVC with PGO miscompiles this function. */
#if defined(_MSC_VER)
# pragma optimize("g", off)
#endif
# 959 "../../dist/include/js/Value.h"
static inline double
CanonicalizeNaN(double d)
{
    if (MOZ_UNLIKELY(mozilla::IsNaN(d)))
        return GenericNaN();
    return d;
}
#if defined(_MSC_VER)
# pragma optimize("", on)
#endif
# 969 "../../dist/include/js/Value.h"

/*
 * JS::Value is the interface for a single JavaScript Engine value.  A few
 *   compatibility; they may be removed at some point.  These operations mostly
 *   provide similar functionality.  But there are a few key differences.  One
 *   is that JS::Value gives null a separate type.
 *   Also, to help prevent mistakenly boxing a nullable JSObject* as an object,
 *   Value::setObject takes a JSObject&. (Conversely, Value::toObject returns a
 *   JSObject&.)  A convenience member Value::setObjectOrNull is provided.
 *
 * - JSVAL_VOID is the same as the singleton value of the Undefined type.
 *
 * - Note that JS::Value is 8 bytes on 32 and 64-bit architectures. Thus, on
 *   32-bit user code should avoid copying jsval/JS::Value as much as possible,
 *   preferring to pass by const Value &.
 */
class Value
{
  public:
    /*
     * N.B. the default constructor leaves Value unitialized. Adding a default
     * constructor prevents Value from being stored in a union.
     */
#if defined(JS_VALUE_IS_CONSTEXPR)
    Value() = default;
    Value(const Value& v) = default;
#endif
# 1012 "../../dist/include/js/Value.h"

    /*** Mutators ***/

    void setNull() {
        data.asBits = BUILD_JSVAL(JSVAL_TAG_NULL, 0).asBits;
    }

    void setUndefined() {
        data.asBits = BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0).asBits;
    }

    void setInt32(int32_t i) {
        data = INT32_TO_JSVAL_IMPL(i);
    }

    

    void setDouble(double d) {
        data = DOUBLE_TO_JSVAL_IMPL(d);
    }

    

    

    void setString(JSString *str) {
        MOZ_ASSERT(!IsPoisonedPtr(str));
        data = STRING_TO_JSVAL_IMPL(str);
    }

    void setSymbol(JS::Symbol *sym) {
        MOZ_ASSERT(!IsPoisonedPtr(sym));
        data = SYMBOL_TO_JSVAL_IMPL(sym);
    }

    void setObject(JSObject &obj) {
        MOZ_ASSERT(!IsPoisonedPtr(&obj));
        data = OBJECT_TO_JSVAL_IMPL(&obj);
    }

    void setBoolean(bool b) {
        data = BOOLEAN_TO_JSVAL_IMPL(b);
    }

    

    

    

    bool setNumber(double d) {
        int32_t i;
        if (mozilla::NumberIsInt32(d, &i)) {
            setInt32(i);
            return true;
        }

        setDouble(d);
        return false;
    }

    

    void swap(Value &rhs) {
        uint64_t tmp = rhs.data.asBits;
        rhs.data.asBits = data.asBits;
        data.asBits = tmp;
    }

    /*** Value type queries ***/

    bool isUndefined() const {
        return JSVAL_IS_UNDEFINED_IMPL(data);
    }

    bool isNull() const {
        return JSVAL_IS_NULL_IMPL(data);
    }

    bool isNullOrUndefined() const {
        return isNull() || isUndefined();
    }

    bool isInt32() const {
        return JSVAL_IS_INT32_IMPL(data);
    }

    bool isInt32(int32_t i32) const {
        return JSVAL_IS_SPECIFIC_INT32_IMPL(data, i32);
    }

    bool isDouble() const {
        return JSVAL_IS_DOUBLE_IMPL(data);
    }

    bool isNumber() const {
        return JSVAL_IS_NUMBER_IMPL(data);
    }

    bool isString() const {
        return JSVAL_IS_STRING_IMPL(data);
    }

    bool isSymbol() const {
        return JSVAL_IS_SYMBOL_IMPL(data);
    }

    bool isObject() const {
        return JSVAL_IS_OBJECT_IMPL(data);
    }

    bool isPrimitive() const {
        return JSVAL_IS_PRIMITIVE_IMPL(data);
    }

    bool isObjectOrNull() const {
        return JSVAL_IS_OBJECT_OR_NULL_IMPL(data);
    }

    bool isGCThing() const {
        return JSVAL_IS_GCTHING_IMPL(data);
    }

    bool isBoolean() const {
        return JSVAL_IS_BOOLEAN_IMPL(data);
    }

    bool isTrue() const {
        return JSVAL_IS_SPECIFIC_BOOLEAN_IMPL(data, true);
    }

    bool isFalse() const {
        return JSVAL_IS_SPECIFIC_BOOLEAN_IMPL(data, false);
    }

    bool isMagic() const {
        return JSVAL_IS_MAGIC_IMPL(data);
    }

    bool isMagic(JSWhyMagic why) const {
        MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why);
        return JSVAL_IS_MAGIC_IMPL(data);
    }

    bool isMarkable() const {
        return JSVAL_IS_TRACEABLE_IMPL(data);
    }

    JSGCTraceKind gcKind() const {
        MOZ_ASSERT(isMarkable());
        return JSGCTraceKind(JSVAL_TRACE_KIND_IMPL(data));
    }

    JSWhyMagic whyMagic() const {
        MOZ_ASSERT(isMagic());
        return data.s.payload.why;
    }

    

    /*** Comparison ***/

    

    

    ;

    /*** Extract the value's typed payload ***/

    int32_t toInt32() const {
        MOZ_ASSERT(isInt32());
        return JSVAL_TO_INT32_IMPL(data);
    }

    double toDouble() const {
        MOZ_ASSERT(isDouble());
        return data.asDouble;
    }

    double toNumber() const {
        MOZ_ASSERT(isNumber());
        return isDouble() ? toDouble() : double(toInt32());
    }

    JSString *toString() const {
        MOZ_ASSERT(isString());
        return JSVAL_TO_STRING_IMPL(data);
    }

    

    JSObject &toObject() const {
        MOZ_ASSERT(isObject());
        return *JSVAL_TO_OBJECT_IMPL(data);
    }

    JSObject *toObjectOrNull() const {
        MOZ_ASSERT(isObjectOrNull());
        return JSVAL_TO_OBJECT_IMPL(data);
    }

    js::gc::Cell *toGCThing() const {
        MOZ_ASSERT(isGCThing());
        return JSVAL_TO_GCTHING_IMPL(data);
    }

    

    bool toBoolean() const {
        MOZ_ASSERT(isBoolean());
        return JSVAL_TO_BOOLEAN_IMPL(data);
    }

    

    

    

    /*
     * Private API
     *
     * Private setters/getters allow the caller to read/write arbitrary types
     * that fit in the 64-bit payload. It is the caller's responsibility, after
     * storing to a value with setPrivateX to read only using getPrivateX.
     * Privates values are given a type which ensures they are not marked.
     */

    void setPrivate(void *ptr) {
        data = PRIVATE_PTR_TO_JSVAL_IMPL(ptr);
    }

    void *toPrivate() const {
        MOZ_ASSERT(JSVAL_IS_DOUBLE_IMPL(data));
        return JSVAL_TO_PRIVATE_PTR_IMPL(data);
    }

    void setPrivateUint32(uint32_t ui) {
        MOZ_ASSERT(uint32_t(int32_t(ui)) == ui);
        setInt32(int32_t(ui));
    }

    

    /*
     * An unmarked value is just a void* cast as a Value. Thus, the Value is
     * not safe for GC and must not be marked. This API avoids raw casts
     * and the ensuing strict-aliasing warnings.
     */

    

    

    

    

#if !defined(_MSC_VER) && !defined(__sparc)
  // Value must be POD so that MSVC will pass it by value and not in memory
  // (bug 689101); the same is true for SPARC as well (bug 737344).  More
  // precisely, we don't want Value return values compiled as out params.
  private:
#endif
# 1339 "../../dist/include/js/Value.h"

    jsval_layout data;

  private:
#if defined(JS_VALUE_IS_CONSTEXPR)
    MOZ_IMPLICIT JS_VALUE_CONSTEXPR Value(jsval_layout layout) : data(layout) {}
#endif
# 1346 "../../dist/include/js/Value.h"

    

    ;
    friend Value JS_VALUE_CONSTEXPR (::IMPL_TO_JSVAL)(jsval_layout l);
    friend Value JS_VALUE_CONSTEXPR (JS::UndefinedValue)();
};





/************************************************************************/

static inline Value
NullValue()
{
    Value v;
    v.setNull();
    return v;
}

static inline JS_VALUE_CONSTEXPR Value
UndefinedValue()
{
#if defined(JS_VALUE_IS_CONSTEXPR)
    return Value(BUILD_JSVAL(JSVAL_TAG_UNDEFINED, 0));
#else
# 1392 "../../dist/include/js/Value.h"
    JS::Value v;
    v.setUndefined();
    return v;
#endif
# 1396 "../../dist/include/js/Value.h"
}

static inline Value
Int32Value(int32_t i32)
{
    Value v;
    v.setInt32(i32);
    return v;
}

static inline Value
DoubleValue(double dbl)
{
    Value v;
    v.setDouble(dbl);
    return v;
}





static inline Value
StringValue(JSString *str)
{
    Value v;
    v.setString(str);
    return v;
}

static inline Value
SymbolValue(JS::Symbol *sym)
{
    Value v;
    v.setSymbol(sym);
    return v;
}







static inline Value
ObjectValue(JSObject &obj)
{
    Value v;
    v.setObject(obj);
    return v;
}







namespace detail {

template <bool Signed>
class MakeNumberValue
{
  public:
    
};

template <>
class MakeNumberValue<false>
{
  public:
    
};

} // namespace detail





static inline Value
PrivateValue(void *ptr)
{
    Value v;
    v.setPrivate(ptr);
    return v;
}





} // namespace JS

/************************************************************************/

namespace JS {
JS_PUBLIC_API(void) HeapValuePostBarrier(Value *valuep);
JS_PUBLIC_API(void) HeapValueRelocate(Value *valuep);
}

namespace js {

template <> struct GCMethods<const JS::Value>
{
    
    
};

template <> struct GCMethods<JS::Value>
{
    static JS::Value initial() { return JS::UndefinedValue(); }
    static bool poisoned(const JS::Value &v) {
        return v.isMarkable() && JS::IsPoisonedPtr(v.toGCThing());
    }
    
    static bool needsPostBarrier(const JS::Value &v) {
        return v.isObject() && gc::IsInsideNursery(reinterpret_cast<gc::Cell*>(&v.toObject()));
    }
    static void postBarrier(JS::Value *v) { JS::HeapValuePostBarrier(v); }
    static void relocate(JS::Value *v) { JS::HeapValueRelocate(v); }
};

template <class Outer> class MutableValueOperations;

/*
 * A class designed for CRTP use in implementing the non-mutating parts of the
 * Value interface in Value-like classes.  Outer must be a class inheriting
 * ValueOperations<Outer> with a visible extract() method returning the
 * const Value* abstracted by Outer.
 */
template <class Outer>
class ValueOperations
{
    friend class MutableValueOperations<Outer>;

    const JS::Value * value() const { return static_cast<const Outer*>(this)->extract(); }

  public:
    bool isUndefined() const { return value()->isUndefined(); }
    bool isNull() const { return value()->isNull(); }
    bool isBoolean() const { return value()->isBoolean(); }
    
    
    bool isNumber() const { return value()->isNumber(); }
    bool isInt32() const { return value()->isInt32(); }
    bool isDouble() const { return value()->isDouble(); }
    bool isString() const { return value()->isString(); }
    bool isSymbol() const { return value()->isSymbol(); }
    bool isObject() const { return value()->isObject(); }
    
    
    
    
    

    bool isNullOrUndefined() const { return value()->isNullOrUndefined(); }
    bool isObjectOrNull() const { return value()->isObjectOrNull(); }

    bool toBoolean() const { return value()->toBoolean(); }
    double toNumber() const { return value()->toNumber(); }
    int32_t toInt32() const { return value()->toInt32(); }
    double toDouble() const { return value()->toDouble(); }
    JSString *toString() const { return value()->toString(); }
    JS::Symbol *toSymbol() const { return value()->toSymbol(); }
    JSObject &toObject() const { return value()->toObject(); }
    JSObject *toObjectOrNull() const { return value()->toObjectOrNull(); }
    gc::Cell *toGCThing() const { return value()->toGCThing(); }
    

    
    

    
    
};

/*
 * A class designed for CRTP use in implementing all the mutating parts of the
 * Value interface in Value-like classes.  Outer must be a class inheriting
 * MutableValueOperations<Outer> with visible extractMutable() and extract()
 * methods returning the const Value* and Value* abstracted by Outer.
 */
template <class Outer>
class MutableValueOperations : public ValueOperations<Outer>
{
    JS::Value * value() { return static_cast<Outer*>(this)->extractMutable(); }

  public:
    void setNull() { value()->setNull(); }
    
    void setInt32(int32_t i) { value()->setInt32(i); }
    void setDouble(double d) { value()->setDouble(d); }
    
    void setBoolean(bool b) { value()->setBoolean(b); }
    
    
    bool setNumber(double d) { return value()->setNumber(d); }
    void setString(JSString *str) { this->value()->setString(str); }
    
    void setObject(JSObject &obj) { this->value()->setObject(obj); }
    
};

/*
 * Augment the generic Heap<T> interface when T = Value with
 * type-querying, value-extracting, and mutating operations.
 */
template <>
class HeapBase<JS::Value> : public ValueOperations<JS::Heap<JS::Value> >
{
    
    
    
    
    

    

    

    
};

/*
 * Augment the generic Handle<T> interface when T = Value with type-querying
 * and value-extracting operations.
 */
template <>
class HandleBase<JS::Value> : public ValueOperations<JS::Handle<JS::Value> >
{
    friend class ValueOperations<JS::Handle<JS::Value> >;
    const JS::Value * extract() const {
        return static_cast<const JS::Handle<JS::Value>*>(this)->address();
    }
};

/*
 * Augment the generic MutableHandle<T> interface when T = Value with
 * type-querying, value-extracting, and mutating operations.
 */
template <>
class MutableHandleBase<JS::Value> : public MutableValueOperations<JS::MutableHandle<JS::Value> >
{
    friend class ValueOperations<JS::MutableHandle<JS::Value> >;
    const JS::Value * extract() const {
        return static_cast<const JS::MutableHandle<JS::Value>*>(this)->address();
    }

    friend class MutableValueOperations<JS::MutableHandle<JS::Value> >;
    JS::Value * extractMutable() {
        return static_cast<JS::MutableHandle<JS::Value>*>(this)->address();
    }
};

/*
 * Augment the generic Rooted<T> interface when T = Value with type-querying,
 * value-extracting, and mutating operations.
 */
template <>
class PersistentRootedBase<JS::Value> : public MutableValueOperations<JS::PersistentRooted<JS::Value>>
{
    friend class ValueOperations<JS::PersistentRooted<JS::Value>>;
    

    friend class MutableValueOperations<JS::PersistentRooted<JS::Value>>;
    
};

} // namespace js



inline JS_VALUE_CONSTEXPR JS::Value
IMPL_TO_JSVAL(jsval_layout l)
{
#if defined(JS_VALUE_IS_CONSTEXPR)
    return JS::Value(l);
#else
# 1885 "../../dist/include/js/Value.h"
    JS::Value v;
    v.data = l;
    return v;
#endif
# 1889 "../../dist/include/js/Value.h"
}

namespace JS {



#ifdef JS_DEBUG
namespace detail {

struct ValueAlignmentTester { char c; JS::Value v; };
static_assert(sizeof(ValueAlignmentTester) == 16,
              "JS::Value must be 16-byte-aligned");

struct LayoutAlignmentTester { char c; jsval_layout l; };
static_assert(sizeof(LayoutAlignmentTester) == 16,
              "jsval_layout must be 16-byte-aligned");

} // namespace detail
#endif /* JS_DEBUG */
# 1912 "../../dist/include/js/Value.h"

} // namespace JS

/*
 * JS::Value and jsval are the same type; jsval is the old name, kept around
 * for backwards compatibility along with all the JSVAL_* operations below.
 * jsval_layout is an implementation detail and should not be used externally.
 */
typedef JS::Value jsval;

static_assert(sizeof(jsval_layout) == sizeof(JS::Value),
              "jsval_layout and JS::Value must have identical layouts");

/************************************************************************/

static inline JS_VALUE_CONSTEXPR jsval
INT_TO_JSVAL(int32_t i)
{
    return IMPL_TO_JSVAL(INT32_TO_JSVAL_IMPL(i));
}

static inline JS_VALUE_CONSTEXPR jsval
DOUBLE_TO_JSVAL(double d)
{
    /*
     * This is a manually inlined version of:
     *    d = JS_CANONICALIZE_NAN(d);
     *    return IMPL_TO_JSVAL(DOUBLE_TO_JSVAL_IMPL(d));
     * because GCC from XCode 3.1.4 miscompiles the above code.
     */
#if defined(JS_VALUE_IS_CONSTEXPR)
    return IMPL_TO_JSVAL(MOZ_UNLIKELY(mozilla::IsNaN(d))
                         ? (jsval_layout) { .asBits = 0x7FF8000000000000LL }
                         : (jsval_layout) { .asDouble = d });
#else
# 1947 "../../dist/include/js/Value.h"
    jsval_layout l;
    if (MOZ_UNLIKELY(d != d))
        l.asBits = 0x7FF8000000000000LL;
    else
        l.asDouble = d;
    return IMPL_TO_JSVAL(l);
#endif
# 1954 "../../dist/include/js/Value.h"
}





extern JS_PUBLIC_DATA(const jsval) JSVAL_TRUE;
extern JS_PUBLIC_DATA(const jsval) JSVAL_VOID;

namespace JS {

extern JS_PUBLIC_DATA(const HandleValue) NullHandleValue;
extern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;
extern JS_PUBLIC_DATA(const HandleValue) TrueHandleValue;
extern JS_PUBLIC_DATA(const HandleValue) FalseHandleValue;

}

#undef JS_VALUE_IS_CONSTEXPR
#undef JS_RETURN_LAYOUT_FROM_BITS

#endif /* js_Value_h */
# 26 "../../dist/include/nsIDocShell.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/nsIDocShell.h"
class nsPresContext;
class nsIPresShell;
namespace mozilla {
namespace dom {
class URLSearchParams;
}
}
class nsIURI; /* forward declaration */

class nsIChannel; /* forward declaration */

class nsIContentViewer; /* forward declaration */

class nsIURIContentListener; /* forward declaration */

class nsIDOMEventTarget; /* forward declaration */

class nsIDocShellLoadInfo; /* forward declaration */

class nsIEditor; /* forward declaration */

class nsIWebNavigation; /* forward declaration */

class nsISimpleEnumerator; /* forward declaration */

class nsIInputStream; /* forward declaration */

class nsIRequest; /* forward declaration */

class nsISHEntry; /* forward declaration */

class nsILayoutHistoryState; /* forward declaration */

class nsISecureBrowserUI; /* forward declaration */

class nsIScriptGlobalObject; /* forward declaration */

class nsIDOMStorage; /* forward declaration */

class nsIPrincipal; /* forward declaration */

class nsIWebBrowserPrint; /* forward declaration */

#define NS_IDOCSHELL_IID \
  {0xf84b1ae4, 0x2f78, 0x4bad, \
    { 0xb3, 0x6a, 0x6a, 0x85, 0x16, 0xee, 0x6e, 0x40 }}

class NS_NO_VTABLE nsIDocShell : public nsIDocShellTreeItem {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCSHELL_IID)

  /* [noscript] void loadURI (in nsIURI uri, in nsIDocShellLoadInfo loadInfo, in unsigned long aLoadFlags, in boolean firstParty); */
  NS_IMETHOD LoadURI(nsIURI *uri, nsIDocShellLoadInfo *loadInfo, uint32_t aLoadFlags, bool firstParty) = 0;

  /* [noscript] void loadStream (in nsIInputStream aStream, in nsIURI aURI, in ACString aContentType, in ACString aContentCharset, in nsIDocShellLoadInfo aLoadInfo); */
  NS_IMETHOD LoadStream(nsIInputStream *aStream, nsIURI *aURI, const nsACString & aContentType, const nsACString & aContentCharset, nsIDocShellLoadInfo *aLoadInfo) = 0;

  enum {
    INTERNAL_LOAD_FLAGS_NONE = 0,
    INTERNAL_LOAD_FLAGS_INHERIT_OWNER = 1,
    INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER = 2,
    INTERNAL_LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 4,
    INTERNAL_LOAD_FLAGS_FIRST_LOAD = 8,
    INTERNAL_LOAD_FLAGS_BYPASS_CLASSIFIER = 16,
    INTERNAL_LOAD_FLAGS_FORCE_ALLOW_COOKIES = 32,
    INTERNAL_LOAD_FLAGS_IS_SRCDOC = 64,
    INTERNAL_LOAD_FLAGS_NO_OPENER = 256
  };

  /* [noscript] void internalLoad (in nsIURI aURI, in nsIURI aReferrer, in unsigned long aReferrerPolicy, in nsISupports aOwner, in uint32_t aFlags, in wstring aWindowTarget, in string aTypeHint, in AString aFileName, in nsIInputStream aPostDataStream, in nsIInputStream aHeadersStream, in unsigned long aLoadFlags, in nsISHEntry aSHEntry, in boolean firstParty, in AString aSrcdoc, in nsIDocShell aSourceDocShell, in nsIURI aBaseURI, out nsIDocShell aDocShell, out nsIRequest aRequest); */
  NS_IMETHOD InternalLoad(nsIURI *aURI, nsIURI *aReferrer, uint32_t aReferrerPolicy, nsISupports *aOwner, uint32_t aFlags, const char16_t * aWindowTarget, const char * aTypeHint, const nsAString & aFileName, nsIInputStream *aPostDataStream, nsIInputStream *aHeadersStream, uint32_t aLoadFlags, nsISHEntry *aSHEntry, bool firstParty, const nsAString & aSrcdoc, nsIDocShell *aSourceDocShell, nsIURI *aBaseURI, nsIDocShell * *aDocShell, nsIRequest * *aRequest) = 0;

  /* [implicit_jscontext] void addState (in jsval aData, in DOMString aTitle, in DOMString aURL, in boolean aReplace); */
  NS_IMETHOD AddState(JS::HandleValue aData, const nsAString & aTitle, const nsAString & aURL, bool aReplace, JSContext* cx) = 0;
  /* [noscript,notxpcom] nsIPresShell GetPresShell (); */
  NS_IMETHOD_(nsIPresShell *) GetPresShell(void) = 0;

  /* [noscript] readonly attribute nsIPresShell eldestPresShell; */
  NS_IMETHOD GetEldestPresShell(nsIPresShell **aEldestPresShell) = 0;

  /* readonly attribute nsIContentViewer contentViewer; */
  NS_IMETHOD GetContentViewer(nsIContentViewer * *aContentViewer) = 0;
  

  /* attribute DOMString paymentRequestId; */
  NS_IMETHOD GetPaymentRequestId(nsAString & aPaymentRequestId) = 0;
  NS_IMETHOD SetPaymentRequestId(const nsAString & aPaymentRequestId) = 0;

  /* attribute boolean windowDraggingAllowed; */
  NS_IMETHOD GetWindowDraggingAllowed(bool *aWindowDraggingAllowed) = 0;
  NS_IMETHOD SetWindowDraggingAllowed(bool aWindowDraggingAllowed) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocShell, NS_IDOCSHELL_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOCSHELL \
  NS_IMETHOD LoadURI(nsIURI *uri, nsIDocShellLoadInfo *loadInfo, uint32_t aLoadFlags, bool firstParty) MOZ_OVERRIDE; \
  NS_IMETHOD LoadStream(nsIInputStream *aStream, nsIURI *aURI, const nsACString & aContentType, const nsACString & aContentCharset, nsIDocShellLoadInfo *aLoadInfo) MOZ_OVERRIDE; \
  NS_IMETHOD InternalLoad(nsIURI *aURI, nsIURI *aReferrer, uint32_t aReferrerPolicy, nsISupports *aOwner, uint32_t aFlags, const char16_t * aWindowTarget, const char * aTypeHint, const nsAString & aFileName, nsIInputStream *aPostDataStream, nsIInputStream *aHeadersStream, uint32_t aLoadFlags, nsISHEntry *aSHEntry, bool firstParty, const nsAString & aSrcdoc, nsIDocShell *aSourceDocShell, nsIURI *aBaseURI, nsIDocShell * *aDocShell, nsIRequest * *aRequest) MOZ_OVERRIDE; \
  NS_IMETHOD AddState(JS::HandleValue aData, const nsAString & aTitle, const nsAString & aURL, bool aReplace, JSContext* cx) MOZ_OVERRIDE; \
  NS_IMETHOD CreateLoadInfo(nsIDocShellLoadInfo * *loadInfo) MOZ_OVERRIDE; \
  NS_IMETHOD PrepareForNewContentModel(void) MOZ_OVERRIDE; \
  NS_IMETHOD SetCurrentURI(nsIURI *aURI) MOZ_OVERRIDE; \
  NS_IMETHOD FirePageHideNotification(bool isUnload) MOZ_OVERRIDE; \
  NS_IMETHOD_(mozilla::dom::URLSearchParams *) GetURLSearchParams(void) MOZ_OVERRIDE; \
  virtual void NotifyJSRunToCompletionStart(void) MOZ_OVERRIDE; \
  virtual void NotifyJSRunToCompletionStop(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetHasLoadedNonBlankURI(bool *aHasLoadedNonBlankURI) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHasLoadedNonBlankURI(aHasLoadedNonBlankURI); } \
  NS_IMETHOD GetPaymentRequestId(nsAString & aPaymentRequestId) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPaymentRequestId(aPaymentRequestId); } \
  NS_IMETHOD SetPaymentRequestId(const nsAString & aPaymentRequestId) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPaymentRequestId(aPaymentRequestId); } \
  NS_IMETHOD GetWindowDraggingAllowed(bool *aWindowDraggingAllowed) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWindowDraggingAllowed(aWindowDraggingAllowed); } \
  NS_IMETHOD SetWindowDraggingAllowed(bool aWindowDraggingAllowed) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetWindowDraggingAllowed(aWindowDraggingAllowed); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDocShell : public nsIDocShell
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOCSHELL

  nsDocShell();

private:
NS_IMETHODIMP nsDocShell::SetWindowDraggingAllowed(bool aWindowDraggingAllowed)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 2222 "../../dist/include/nsIDocShell.h"


#endif /* __gen_nsIDocShell_h__ */
# 2225 "../../dist/include/nsIDocShell.h"
# 13 "/Users/luser/build/mozilla-central/dom/canvas/nsICanvasRenderingContextInternal.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsRefreshDriver.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsRefreshDriver.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Code to notify things that animate before a refresh, at an appropriate
 * refresh rate.  (Perhaps temporary, until replaced by compositor.)
 */

#ifndef nsRefreshDriver_h_
#define nsRefreshDriver_h_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TimeStamp.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/TimeStamp.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_TimeStamp_h
#define mozilla_TimeStamp_h

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/TimeStamp.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/TimeStamp.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/TimeStamp.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/FloatingPoint.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/TimeStamp.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/TimeStamp.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/TimeStamp.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/TimeStamp.h"

namespace IPC {
template<typename T> struct ParamTraits;
}

#ifdef XP_WIN
// defines TimeStampValue as a complex value keeping both
// GetTickCount and QueryPerformanceCounter values
#if 0 /* expanded by -frewrite-includes */
#include "TimeStamp_windows.h"
#endif /* expanded by -frewrite-includes */
# 26 "../../dist/include/mozilla/TimeStamp.h"
#endif
# 27 "../../dist/include/mozilla/TimeStamp.h"

namespace mozilla {

#ifndef XP_WIN
typedef uint64_t TimeStampValue;
#endif
# 33 "../../dist/include/mozilla/TimeStamp.h"

class TimeStamp;

/**
 * Platform-specific implementation details of BaseTimeDuration.
 */
class BaseTimeDurationPlatformUtils
{
public:
  static double ToSeconds(int64_t aTicks);
  ;
  ;
  ;
};

/**
 * Instances of this class represent the length of an interval of time.
 * Negative durations are allowed, meaning the end is before the start.
 *
 * Internally the duration is stored as a int64_t in units of
 * PR_TicksPerSecond() when building with NSPR interval timers, or a
 * system-dependent unit when building with system clocks.  The
 * system-dependent unit must be constant, otherwise the semantics of
 * this class would be broken.
 *
 * The ValueCalculator template parameter determines how arithmetic
 * operations are performed on the integer count of ticks (mValue).
 */
template <typename ValueCalculator>
class BaseTimeDuration
{
public:
  // The default duration is 0.
  MOZ_CONSTEXPR BaseTimeDuration() : mValue(0) {}
  // Allow construction using '0' as the initial value, for readability,
  // but no other numbers (so we don't have any implicit unit conversions).
  struct _SomethingVeryRandomHere;
  MOZ_IMPLICIT 
  // Default copy-constructor and assignment are OK

  // Converting copy-constructor and assignment operator
  

  

  double ToSeconds() const
  {
    if (mValue == INT64_MAX) {
      return PositiveInfinity<double>();
    }
    if (mValue == INT64_MIN) {
      return NegativeInfinity<double>();
    }
    return BaseTimeDurationPlatformUtils::ToSeconds(mValue);
  }
  // Return a duration value that includes digits of time we think to
  // be significant.  This method should be used when displaying a
  // time to humans.
  
  
  

  // -- scale duration by a float
  // but let's do that on demand.
  // Comparing durations for equality will only lead to bugs on
  // platforms with high-resolution timers.

private:
  friend class TimeStamp;
  friend struct IPC::ParamTraits<mozilla::BaseTimeDuration<ValueCalculator>>;
  template <typename>
  friend class BaseTimeDuration;

  static BaseTimeDuration FromTicks(int64_t aTicks)
  {
    BaseTimeDuration t;
    t.mValue = aTicks;
    return t;
  }

  

  // Duration, result is implementation-specific difference of two TimeStamps
  int64_t mValue;
};

/**
 * Perform arithmetic operations on the value of a BaseTimeDuration without
 * doing strict checks on the range of values.
 */
class TimeDurationValueCalculator
{
public:
  static int64_t Add(int64_t aA, int64_t aB) { return aA + aB; }
  

  

  
  
  
};



/**
 * Specialization of BaseTimeDuration that uses TimeDurationValueCalculator for
 * arithmetic on the mValue member.
 *
 * Use this class for time durations that are *not* expected to hold values of
 * Forever (or the negative equivalent) or when such time duration are *not*
 * expected to be used in arithmetic operations.
 */
typedef BaseTimeDuration<TimeDurationValueCalculator> TimeDuration;

/**
 * Instances of this class represent moments in time, or a special
 * "null" moment. We do not use the non-monotonic system clock or
 * local time, since they can be reset, causing apparent backward
 * travel in time, which can confuse algorithms. Instead we measure
 * elapsed time according to the system.  This time can never go
 * backwards (i.e. it never wraps around, at least not in less than
 * five million years of system elapsed time). It might not advance
 * while the system is sleeping. If TimeStamp::SetNow() is not called
 * at all for hours or days, we might not notice the passage of some
 * is initialized to the clock's epoch and provides a
 * time_since_epoch() method that functions similiarly. i.e.
 * t.IsNull() is equivalent to t.time_since_epoch() == decltype(t)::duration::zero();
 */
class TimeStamp
{
public:
  /**
   * Initialize to the "null" moment
   */
  MOZ_CONSTEXPR TimeStamp() : mValue(0) {}
  // Default copy-constructor and assignment are OK

  /**
   * The system timestamps are the same as the TimeStamp
   * retrieved by mozilla::TimeStamp. Since we need this for
   * vsync timestamps, we enable the creation of mozilla::TimeStamps
   * on platforms that support vsync aligned refresh drivers / compositors
   * Verified true as of Jan 31, 2015: B2G and OS X
   * False on Windows 7
   * UNTESTED ON OTHER PLATFORMS
   */
#if defined(MOZ_WIDGET_GONK) || defined(XP_DARWIN)
  
#endif
# 407 "../../dist/include/mozilla/TimeStamp.h"

  /**
   * Return true if this is the "null" moment
   */
  bool IsNull() const { return mValue == 0; }

  /**
   * Return a timestamp reflecting the current elapsed system time. This
   * is monotonically increasing (i.e., does not decrease) over the
   * lifetime of this process' XPCOM session.
   *
   * Now() is trying to ensure the best possible precision on each platform,
   * at least one millisecond.
   *
   * NowLoRes() has been introduced to workaround performance problems of
   * QueryPerformanceCounter on the Windows platform.  NowLoRes() is giving
   * lower precision, usually 15.6 ms, but with very good performance benefit.
   * Use it for measurements of longer times, like >200ms timeouts.
   */
  static TimeStamp Now() { return Now(true); }
  static TimeStamp NowLoRes() { return Now(false); }

  /**
   * Return a timestamp representing the time when the current process was
   * created which will be comparable with other timestamps taken with this
   * class. If the actual process creation time is detected to be inconsistent
   * the @a aIsInconsistent parameter will be set to true, the returned
   * timestamp however will still be valid though inaccurate.
   *
   * @param aIsInconsistent Set to true if an inconsistency was detected in the
   * process creation time
   * @returns A timestamp representing the time when the process was created,
   * this timestamp is always valid even when errors are reported
   */
  ;

  /**
   * Records a process restart. After this call ProcessCreation() will return
   * the time when the browser was restarted instead of the actual time when
   * the process was created.
   */
  ;

  /**
   * Compute the difference between two timestamps. Both must be non-null.
   */
  TimeDuration operator-(const TimeStamp& aOther) const
  {
    MOZ_ASSERT(!IsNull(), "Cannot compute with a null value");
    MOZ_ASSERT(!aOther.IsNull(), "Cannot compute with aOther null value");
    static_assert(-INT64_MAX > INT64_MIN, "int64_t sanity check");
    int64_t ticks = int64_t(mValue - aOther.mValue);
    // Check for overflow.
    if (mValue > aOther.mValue) {
      if (ticks < 0) {
        ticks = INT64_MAX;
      }
    } else {
      if (ticks > 0) {
        ticks = INT64_MIN;
      }
    }
    return TimeDuration::FromTicks(ticks);
  }

  
  
  
  

  ;

  MOZ_IMPLICIT 

  static TimeStamp Now(bool aHighResolution);

  /**
   * Computes the uptime of the current process in microseconds. The result
   * is platform-dependent and needs to be checked against existing timestamps
   * for consistency.
   *
   * @returns The number of microseconds since the calling process was started
   *          or 0 if an error was encountered while computing the uptime
   */
  ;

  /**
   * When built with PRIntervalTime, a value of 0 means this instance
   * is "null". Otherwise, the low 32 bits represent a PRIntervalTime,
   * and the high 32 bits represent a counter of the number of
   * rollovers of PRIntervalTime that we've seen. This counter starts
   * at 1 to avoid a real time colliding with the "null" value.
   *
   * PR_INTERVAL_MAX is set at 100,000 ticks per second. So the minimum
   * time to wrap around is about 2^64/100000 seconds, i.e. about
   * 5,849,424 years.
   *
   * When using a system clock, a value is system dependent.
   */
  TimeStampValue mValue;
};

}

#endif /* mozilla_TimeStamp_h */
# 574 "../../dist/include/mozilla/TimeStamp.h"
# 16 "../../dist/include/nsRefreshDriver.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozFlushType.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozFlushType.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozFlushType_h___
#define mozFlushType_h___

/**
 * This is the enum used by nsIDocument::FlushPendingNotifications to
 * decide what to flush.
 *
 * Please note that if you change these values, you should sync it with the
 * flushTypeNames array inside PresShell::FlushPendingNotifications.
 */
enum mozFlushType {
  Flush_None             = 0, /* Actually don't flush anything */
  Flush_Content          = 1, /* flush the content model construction */
  Flush_ContentAndNotify = 2, /* As above, plus flush the frame model
                                 construction and other nsIMutationObserver
                                 notifications. */
  Flush_Style            = 3, /* As above, plus flush style reresolution */
  Flush_Frames           = Flush_Style,
  Flush_InterruptibleLayout = 4, /* As above, plus flush reflow,
                                    but allow it to be interrupted (so
                                    an incomplete layout may result) */
  Flush_Layout           = 5, /* As above, but layout must run to
                                 completion */
  Flush_Display          = 6  /* As above, plus flush painting */
};

namespace mozilla {

struct ChangesToFlush {
  

  mozFlushType mFlushType;
  bool mFlushAnimations;
};

}
#endif /* mozFlushType_h___ */
# 45 "../../dist/include/mozFlushType.h"
# 17 "../../dist/include/nsRefreshDriver.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTObserverArray.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTObserverArray.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsTObserverArray_h___
#define nsTObserverArray_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsTObserverArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTArray.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsTArray_h__
#define nsTArray_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsTArrayForwardDeclare.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTArrayForwardDeclare.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsTArrayForwardDeclare_h__
#define nsTArrayForwardDeclare_h__

//
// This simple header file contains forward declarations for the TArray family
// of classes.
//
// Including this header is preferable to writing
//
//   template<class E> class nsTArray;
//
// yourself, since this header gives us flexibility to e.g. change the default
// template parameters.
//

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#if !defined(_SIZE_T) || __has_feature(modules)
/* Always define size_t when modules are available. */
#if !__has_feature(modules)
#define _SIZE_T
#endif
# 42 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ size_t;
#endif
# 44 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is
 * enabled. */
#if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \
     !defined(_RSIZE_T)) || __has_feature(modules)
/* Always define rsize_t when modules are available. */
#if !__has_feature(modules)
#define _RSIZE_T
#endif
# 53 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ rsize_t;
#endif
# 55 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#ifndef __cplusplus
/* Always define wchar_t when modules are available. */
#if !defined(_WCHAR_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WCHAR_T
#if defined(_MSC_EXTENSIONS)
#define _WCHAR_T_DEFINED
#endif
# 64 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 65 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WCHAR_TYPE__ wchar_t;
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 68 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#undef NULL
#ifdef __cplusplus
#  if !defined(__MINGW32__) && !defined(_MSC_VER)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 23 "../../dist/include/nsTArrayForwardDeclare.h" 2

template<class E>
class nsTArray;

template<class E>
class FallibleTArray;

template<class E, size_t N>
class nsAutoTArray;

template<class E, size_t N>
class AutoFallibleTArray;

#define InfallibleTArray nsTArray
#define AutoInfallibleTArray nsAutoTArray

#endif
# 40 "../../dist/include/nsTArrayForwardDeclare.h"
# 11 "../../dist/include/nsTArray.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Alignment.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsTArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsTArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/BinarySearch.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/BinarySearch.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_BinarySearch_h
#define mozilla_BinarySearch_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/BinarySearch.h"

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#if !defined(_SIZE_T) || __has_feature(modules)
/* Always define size_t when modules are available. */
#if !__has_feature(modules)
#define _SIZE_T
#endif
# 42 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ size_t;
#endif
# 44 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is
 * enabled. */
#if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \
     !defined(_RSIZE_T)) || __has_feature(modules)
/* Always define rsize_t when modules are available. */
#if !__has_feature(modules)
#define _RSIZE_T
#endif
# 53 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ rsize_t;
#endif
# 55 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#ifndef __cplusplus
/* Always define wchar_t when modules are available. */
#if !defined(_WCHAR_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WCHAR_T
#if defined(_MSC_EXTENSIONS)
#define _WCHAR_T_DEFINED
#endif
# 64 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 65 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WCHAR_TYPE__ wchar_t;
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 68 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#undef NULL
#ifdef __cplusplus
#  if !defined(__MINGW32__) && !defined(_MSC_VER)
#    define NULL __null
#  else
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 13 "../../dist/include/mozilla/BinarySearch.h" 2

namespace mozilla {

/*
 * The BinarySearch() algorithm searches the given container |aContainer| over
 * the sorted index range [aBegin, aEnd) for an index |i| where
 * |aContainer[i] == aTarget|.
 * If such an index |i| is found, BinarySearch returns |true| and the index is
 * returned via the outparam |aMatchOrInsertionPoint|. If no index is found,
       const int mTarget;
 *   };
 *
 *   Vector<int> sortedInts = ...
 *
 *   size_t match;
 *   if (BinarySearchIf(sortedInts, 0, sortedInts.length(), Comparator(13), &match)) {
 *     printf("found 13 at %lu\n", match);
 *   }
 *
 */

template<typename Container, typename Comparator>
bool
BinarySearchIf(const Container& aContainer, size_t aBegin, size_t aEnd,
               const Comparator& aCompare, size_t* aMatchOrInsertionPoint)
{
  MOZ_ASSERT(aBegin <= aEnd);

  size_t low = aBegin;
  size_t high = aEnd;
  while (high != low) {
    size_t middle = low + (high - low) / 2;

    // Allow any intermediate type so long as it provides a suitable ordering
    // relation.
    const int result = aCompare(aContainer[middle]);

    if (result == 0) {
      *aMatchOrInsertionPoint = middle;
      return true;
    }

    if (result < 0) {
      high = middle;
    } else {
      low = middle + 1;
    }
  }

  *aMatchOrInsertionPoint = low;
  return false;
}

namespace detail {

template<class T>
class BinarySearchDefaultComparator
{
public:
  

  

private:
  const T& mTarget;
};

} // namespace detail



} // namespace mozilla

#endif // mozilla_BinarySearch_h
# 140 "../../dist/include/mozilla/BinarySearch.h"
# 14 "../../dist/include/nsTArray.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MathAlgorithms.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsTArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsTArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsTArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ReverseIterator.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ReverseIterator.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* An iterator that acts like another iterator, but iterating in
 * the negative direction. (Note that not all iterators can iterate
 * in the negative direction.) */

#ifndef mozilla_ReverseIterator_h
#define mozilla_ReverseIterator_h

#ifndef mozilla_IteratorTraits_h
#define mozilla_IteratorTraits_h

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 13 "../../dist/include/mozilla/IteratorTraits.h" 2

namespace mozilla {

template<typename Iterator>
struct IteratorTraits
{
  typedef typename Iterator::ValueType ValueType;
  typedef typename Iterator::DifferenceType DifferenceType;
};

template<typename T>
struct IteratorTraits<T*>
{
  typedef T ValueType;
  typedef ptrdiff_t DifferenceType;
};

template<typename T>
struct IteratorTraits<const T*>
{
  typedef const T ValueType;
  typedef ptrdiff_t DifferenceType;
};

} // namespace mozilla

#endif // mozilla_IteratorTraits_h
# 40 "../../dist/include/mozilla/IteratorTraits.h"
# 16 "../../dist/include/mozilla/ReverseIterator.h" 2

namespace mozilla {

template<typename IteratorT>
class ReverseIterator
{
public:
  typedef typename IteratorTraits<IteratorT>::ValueType ValueType;
  typedef typename IteratorTraits<IteratorT>::DifferenceType DifferenceType;

  

  

  ValueType& operator*() const
  {
    IteratorT tmp = mCurrent;
    return *--tmp;
  }

  /* Increments and decrements operators */

  
  
  
  

  ReverseIterator operator+(DifferenceType aN) const
  {
    return ReverseIterator(mCurrent - aN);
  }
  ReverseIterator operator-(DifferenceType aN) const
  {
    return ReverseIterator(mCurrent + aN);
  }
  
  

  /* Comparison operators */

  ;
  ;
  ;
  ;
  ;
  ;

private:
  IteratorT mCurrent;
};





template<typename Iterator1, typename Iterator2>
bool
operator<(const ReverseIterator<Iterator1>& aIter1,
          const ReverseIterator<Iterator2>& aIter2)
{
  return aIter1.mCurrent > aIter2.mCurrent;
}

template<typename Iterator1, typename Iterator2>
bool
operator<=(const ReverseIterator<Iterator1>& aIter1,
           const ReverseIterator<Iterator2>& aIter2)
{
  return aIter1.mCurrent >= aIter2.mCurrent;
}





namespace detail {

template<typename IteratorT>
class IteratorRange
{
public:
  typedef IteratorT iterator;
  typedef IteratorT const_iterator;
  typedef ReverseIterator<IteratorT> reverse_iterator;
  typedef ReverseIterator<IteratorT> const_reverse_iterator;

  

  

  
  
  
  
  
  
  
  

private:
  IteratorT mIterBegin;
  IteratorT mIterEnd;
};

} // namespace detail





} // namespace mozilla

#endif // mozilla_ReverseIterator_h
# 191 "../../dist/include/mozilla/ReverseIterator.h"
# 18 "../../dist/include/nsTArray.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsTArray.h"

#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsTArray.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionNoteChild.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCycleCollectionNoteChild.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

// This header will be included by headers that define refpointer and array classes
// in order to specialize CC helpers such as ImplCycleCollectionTraverse for them.

#ifndef nsCycleCollectionNoteChild_h__
#define nsCycleCollectionNoteChild_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionTraversalCallback.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCycleCollectionTraversalCallback.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsCycleCollectionTraversalCallback_h__
#define nsCycleCollectionTraversalCallback_h__

#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsCycleCollectionTraversalCallback.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsCycleCollectionTraversalCallback.h"

class nsCycleCollectionParticipant;

class NS_NO_VTABLE nsCycleCollectionTraversalCallback
{
public:
  // You must call DescribeRefCountedNode() with an accurate
  // refcount, otherwise cycle collection will fail, and probably crash.
  // If the callback cares about objname, it should put
  // WANT_DEBUG_INFO in mFlags.
  NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt aRefcount,
                                           const char* aObjName) = 0;
  // Note, aCompartmentAddress is 0 if it is unknown.
  NS_IMETHOD_(void) DescribeGCedNode(bool aIsMarked,
                                     const char* aObjName,
                                     uint64_t aCompartmentAddress = 0) = 0;

  NS_IMETHOD_(void) NoteXPCOMChild(nsISupports* aChild) = 0;
  NS_IMETHOD_(void) NoteJSObject(JSObject* aChild) = 0;
  NS_IMETHOD_(void) NoteJSScript(JSScript* aChild) = 0;
  NS_IMETHOD_(void) NoteNativeChild(void* aChild,
                                    nsCycleCollectionParticipant* aHelper) = 0;

  // Give a name to the edge associated with the next call to
  // NoteXPCOMChild, NoteJSObject, NoteJSScript, or NoteNativeChild.
  // Callbacks who care about this should set WANT_DEBUG_INFO in the
  // flags.
  NS_IMETHOD_(void) NoteNextEdgeName(const char* aName) = 0;

  enum
  {
    // Values for flags:

    // Caller should call NoteNextEdgeName and pass useful objName
    // to DescribeRefCountedNode and DescribeGCedNode.
    WANT_DEBUG_INFO = (1 << 0),

    // Caller should not skip objects that we know will be
    // uncollectable.
    WANT_ALL_TRACES = (1 << 1)
  };
  
  bool WantDebugInfo() const { return (mFlags & WANT_DEBUG_INFO) != 0; }
  
protected:
  nsCycleCollectionTraversalCallback() : mFlags(0) {}

  uint32_t mFlags;
};

#endif // nsCycleCollectionTraversalCallback_h__
# 63 "../../dist/include/nsCycleCollectionTraversalCallback.h"
# 14 "../../dist/include/nsCycleCollectionNoteChild.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Likely.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsCycleCollectionNoteChild.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsCycleCollectionNoteChild.h"

enum
{
  CycleCollectionEdgeNameArrayFlag = 1
};

// Just a helper for appending "[i]". Didn't want to pull in string headers here.
void
CycleCollectionNoteEdgeNameImpl(nsCycleCollectionTraversalCallback& aCallback,
                                const char* aName,
                                uint32_t aFlags = 0);

// Should be inlined so that in the no-debug-info case this is just a simple if().
MOZ_ALWAYS_INLINE void
CycleCollectionNoteEdgeName(nsCycleCollectionTraversalCallback& aCallback,
                            const char* aName,
                            uint32_t aFlags = 0)
{
  if (MOZ_UNLIKELY(aCallback.WantDebugInfo())) {
    CycleCollectionNoteEdgeNameImpl(aCallback, aName, aFlags);
  }
}

#define NS_CYCLE_COLLECTION_INNERCLASS                                         \
        cycleCollection

#define NS_CYCLE_COLLECTION_INNERNAME                                          \
        _cycleCollectorGlobal

#define NS_CYCLE_COLLECTION_PARTICIPANT(_class)                                \
        _class::NS_CYCLE_COLLECTION_INNERCLASS::GetParticipant()

template<typename T>
nsISupports*
ToSupports(T* aPtr, typename T::NS_CYCLE_COLLECTION_INNERCLASS* aDummy = 0)
{
  return T::NS_CYCLE_COLLECTION_INNERCLASS::Upcast(aPtr);
}

// The default implementation of this class template is empty, because it
// should never be used: see the partial specializations below.
template<typename T,
         bool IsXPCOM = mozilla::IsBaseOf<nsISupports, T>::value>
struct CycleCollectionNoteChildImpl
{
};

template<typename T>
struct CycleCollectionNoteChildImpl<T, true>
{
  static void Run(nsCycleCollectionTraversalCallback& aCallback, T* aChild)
  {
    aCallback.NoteXPCOMChild(ToSupports(aChild));
  }
};

template<typename T>
struct CycleCollectionNoteChildImpl<T, false>
{
  static void Run(nsCycleCollectionTraversalCallback& aCallback, T* aChild)
  {
    aCallback.NoteNativeChild(aChild, NS_CYCLE_COLLECTION_PARTICIPANT(T));
  }
};

// We declare CycleCollectionNoteChild in 3-argument and 4-argument variants,
// rather than using default arguments, so that forward declarations work
// regardless of header inclusion order.
template<typename T>
inline void
CycleCollectionNoteChild(nsCycleCollectionTraversalCallback& aCallback,
                         T* aChild, const char* aName, uint32_t aFlags)
{
  CycleCollectionNoteEdgeName(aCallback, aName, aFlags);
  CycleCollectionNoteChildImpl<T>::Run(aCallback, aChild);
}

template<typename T>
inline void
CycleCollectionNoteChild(nsCycleCollectionTraversalCallback& aCallback,
                         T* aChild, const char* aName)
{
  CycleCollectionNoteChild(aCallback, aChild, aName, 0);
}

#endif // nsCycleCollectionNoteChild_h__
# 102 "../../dist/include/nsCycleCollectionNoteChild.h"
# 23 "../../dist/include/nsTArray.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAlgorithm.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsAlgorithm.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsAlgorithm_h___
#define nsAlgorithm_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsCharTraits.h"  // for |nsCharSourceTraits|, |nsCharSinkTraits|
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCharTraits.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsCharTraits_h___
#define nsCharTraits_h___

#if 0 /* expanded by -frewrite-includes */
#include <ctype.h> // for |EOF|, |WEOF|
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsCharTraits.h"
#if 0 /* expanded by -frewrite-includes */
#include <string.h> // for |memcpy|, et al
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsCharTraits.h"

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h" // for |char16_t|
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsCharTraits.h"
template <class CharT>
struct nsCharTraits
{
};

template <>
struct nsCharTraits<char16_t>
{
  typedef char16_t char_type;
  typedef uint16_t  unsigned_char_type;
  typedef char      incompatible_char_type;

  static char_type* const sEmptyBuffer;

  static void
  assign(char_type& aLhs, char_type aRhs)
  {
    aLhs = aRhs;
  }


  // integer representation of characters:
  typedef int int_type;

  static char_type
  to_char_type(int_type aChar)
  {
    return char_type(aChar);
  }

  static int_type
  to_int_type(char_type aChar)
  {
    return int_type(static_cast<unsigned_char_type>(aChar));
  }

  static bool
  eq_int_type(int_type aLhs, int_type aRhs)
  {
    return aLhs == aRhs;
  }


  // |char_type| comparisons:

  static bool
  eq(char_type aLhs, char_type aRhs)
  {
    return aLhs == aRhs;
  }

  static bool
  lt(char_type aLhs, char_type aRhs)
  {
    return aLhs < aRhs;
  }


  // operations on s[n] arrays:

  static char_type*
  move(char_type* aStr1, const char_type* aStr2, size_t aN)
  {
    return static_cast<char_type*>(memmove(aStr1, aStr2,
                                           aN * sizeof(char_type)));
  }

  static char_type*
  copy(char_type* aStr1, const char_type* aStr2, size_t aN)
  {
    return static_cast<char_type*>(memcpy(aStr1, aStr2,
                                          aN * sizeof(char_type)));
  }

  static char_type*
  copyASCII(char_type* aStr1, const char* aStr2, size_t aN)
  {
    for (char_type* s = aStr1; aN--; ++s, ++aStr2) {
      NS_ASSERTION(!(*aStr2 & ~0x7F), "Unexpected non-ASCII character");
      *s = static_cast<char_type>(*aStr2);
    }
    return aStr1;
  }

  static char_type*
  assign(char_type* aStr, size_t aN, char_type aChar)
  {
    return 0;
  }

  // this version assumes that s2 is null-terminated and s1 has length n.
  // if s1 is shorter than s2 then we return -1; if s1 is longer than s2,
  // we return 1.
  static int
  compareASCIINullTerminated(const char_type* aStr1, size_t aN,
                             const char* aStr2)
  {
    for (; aN--; ++aStr1, ++aStr2) {
      if (!*aStr2) {
        return 1;
      }
      NS_ASSERTION(!(*aStr2 & ~0x7F), "Unexpected non-ASCII character");
      if (!eq_int_type(to_int_type(*aStr1),
                       to_int_type(static_cast<char_type>(*aStr2)))) {
        return to_int_type(*aStr1) -
               to_int_type(static_cast<char_type>(*aStr2));
      }
    }

    if (*aStr2) {
      return -1;
    }

    return 0;
  }

  /**
   * Convert c to its lower-case form, but only if c is in the ASCII
   * range. Otherwise leave it alone.
   */
  static char_type
  ASCIIToLower(char_type aChar)
  {
    if (aChar >= 'A' && aChar <= 'Z') {
      return char_type(aChar + ('a' - 'A'));
    }

    return aChar;
    return 0;
  }

  // this version assumes that s2 is null-terminated and s1 has length n.
  // if s1 is shorter than s2 then we return -1; if s1 is longer than s2,
  // we return 1.
  static int
  compareLowerCaseToASCIINullTerminated(const char_type* aStr1,
                                        size_t aN, const char* aStr2)
  {
    for (; aN--; ++aStr1, ++aStr2) {
      if (!*aStr2) {
        return 1;
      }
      NS_ASSERTION(!(*aStr2 & ~0x7F), "Unexpected non-ASCII character");
      NS_ASSERTION(!(*aStr2 >= 'A' && *aStr2 <= 'Z'),
                   "Unexpected uppercase character");
      char_type lower_s1 = ASCIIToLower(*aStr1);
      if (lower_s1 != static_cast<char_type>(*aStr2)) {
        return to_int_type(lower_s1) -
               to_int_type(static_cast<char_type>(*aStr2));
      }
    }

    if (*aStr2) {
      return -1;
    }

    return 0;
  }

  static size_t
  length(const char_type* aStr)
  {
    size_t result = 0;
    while (!eq(*aStr++, char_type(0))) {
      ++result;
    }
    return result;
  }

  static const char_type*
  find(const char_type* aStr, size_t aN, char_type aChar)
  {
    while (aN--) {
      if (eq(*aStr, aChar)) {
        return aStr;
      }
      ++aStr;
    }

    return 0;
  }
};

template <>
struct nsCharTraits<char>
{
  typedef char           char_type;
  typedef unsigned char  unsigned_char_type;
  typedef char16_t      incompatible_char_type;

  static char_type* const sEmptyBuffer;

  static void
  assign(char_type& aLhs, char_type aRhs)
  {
    aLhs = aRhs;
  }


  // integer representation of characters:

  typedef int int_type;

  static char_type
  to_char_type(int_type aChar)
  {
    return char_type(aChar);
  }

  static int_type
  to_int_type(char_type aChar)
  {
    return int_type(static_cast<unsigned_char_type>(aChar));
  }

  static bool
  eq_int_type(int_type aLhs, int_type aRhs)
  {
    return aLhs == aRhs;
  }


  // |char_type| comparisons:

  static bool eq(char_type aLhs, char_type aRhs)
  {
    return aLhs == aRhs;
  }

  static bool
  lt(char_type aLhs, char_type aRhs)
  {
    return aLhs < aRhs;
  }


  // operations on s[n] arrays:

  static char_type*
  move(char_type* aStr1, const char_type* aStr2, size_t aN)
  {
    return static_cast<char_type*>(memmove(aStr1, aStr2,
                                           aN * sizeof(char_type)));
  }

  static char_type*
  copy(char_type* aStr1, const char_type* aStr2, size_t aN)
  {
    return static_cast<char_type*>(memcpy(aStr1, aStr2,
                                          aN * sizeof(char_type)));
  }

  static char_type*
  copyASCII(char_type* aStr1, const char* aStr2, size_t aN)
  {
    return copy(aStr1, aStr2, aN);
  }

  static char_type*
  assign(char_type* aStr, size_t aN, char_type aChar)
  {
    return static_cast<char_type*>(memset(aStr, to_int_type(aChar), aN));
  }

  static int
  compare(const char_type* aStr1, const char_type* aStr2, size_t aN)
  {
    return memcmp(aStr1, aStr2, aN);
  }

  static int
  compareASCII(const char_type* aStr1, const char* aStr2, size_t aN)
  {
    // can't use strcmp here because we don't want to stop when aStr1
    // contains a null
    for (; aN--; ++aStr1, ++aStr2) {
      if (!*aStr2) {
        return 1;
      }
      NS_ASSERTION(!(*aStr2 & ~0x7F), "Unexpected non-ASCII character");
      if (*aStr1 != *aStr2) {
        return to_int_type(*aStr1) - to_int_type(*aStr2);
      }
    }

    if (*aStr2) {
      return -1;
    }

    return 0;
  }

  /**
   * Convert c to its lower-case form, but only if c is ASCII.
   */
  static char_type
  ASCIIToLower(char_type aChar)
  {
    if (aChar >= 'A' && aChar <= 'Z') {
      return char_type(aChar + ('a' - 'A'));
    }

    return aChar;
  }
  // this version assumes that s2 is null-terminated and s1 has length n.
  // if s1 is shorter than s2 then we return -1; if s1 is longer than s2,
  // we return 1.
  static int
  compareLowerCaseToASCIINullTerminated(const char_type* aStr1, size_t aN,
                                        const char* aStr2)
  {
    for (; aN--; ++aStr1, ++aStr2) {
      if (!*aStr2) {
        return 1;
      }
      NS_ASSERTION(!(*aStr2 & ~0x7F), "Unexpected non-ASCII character");
      NS_ASSERTION(!(*aStr2 >= 'A' && *aStr2 <= 'Z'),
                   "Unexpected uppercase character");
      char_type lower_s1 = ASCIIToLower(*aStr1);
      if (lower_s1 != *aStr2) {
        return to_int_type(lower_s1) - to_int_type(*aStr2);
      }
    }

    if (*aStr2) {
      return -1;
    }

    return 0;
  }

  static size_t
  length(const char_type* aStr)
  {
    return strlen(aStr);
  }

  static const char_type*
  find(const char_type* aStr, size_t aN, char_type aChar)
  {
    return reinterpret_cast<const char_type*>(memchr(aStr, to_int_type(aChar),
                                                     aN));
  }
};

template <class InputIterator>
struct nsCharSourceTraits
{
  typedef typename InputIterator::difference_type difference_type;

  static uint32_t
  readable_distance(const InputIterator& aFirst, const InputIterator& aLast)
  {
    // assumes single fragment
    return uint32_t(aLast.get() - aFirst.get());
  }

  static const typename InputIterator::value_type*
  read(const InputIterator& aIter)
  {
    return aIter.get();
  }

  static void
  advance(InputIterator& aStr, difference_type aN)
  {
    aStr.advance(aN);
  }
};

template <class CharT>
struct nsCharSourceTraits<CharT*>
{
  typedef ptrdiff_t difference_type;

  static uint32_t
  readable_distance(CharT* aStr)
  {
    return uint32_t(nsCharTraits<CharT>::length(aStr));
    // return numeric_limits<uint32_t>::max();
  }

  static uint32_t
  readable_distance(CharT* aFirst, CharT* aLast)
  {
    return uint32_t(aLast - aFirst);
  }

  

  
};

template <class OutputIterator>
struct nsCharSinkTraits
{
  
};

template <class CharT>
struct nsCharSinkTraits<CharT*>
{
  
};

#endif // !defined(nsCharTraits_h___)
# 588 "../../dist/include/nsCharTraits.h"
# 11 "../../dist/include/nsAlgorithm.h" 2



// We use these instead of std::min/max because we can't include the algorithm
// header in all of XPCOM because the stl wrappers will error out when included
// in parts of XPCOM. These functions should never be used outside of XPCOM.
template <class T>
inline const T&
XPCOM_MIN(const T& aA, const T& aB)
{
  return aB < aA ? aB : aA;
}

// Must return b when a == b in case a is -0
template <class T>
inline const T&
XPCOM_MAX(const T& aA, const T& aB)
{
  return aA > aB ? aA : aB;
}

namespace mozilla {



}





#endif // !defined(nsAlgorithm_h___)
# 76 "../../dist/include/nsAlgorithm.h"
# 24 "../../dist/include/nsTArray.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/nsTArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsQuickSort.h"
 *     returning an integer:
 *      + less than zero if the first element should be before the second
 *      + 0 if the order of the elements does not matter
 *      + greater than zero if the second element should be before the first
 *  5. extra data to pass to comparison function
 */
void NS_QuickSort(void*, unsigned int, unsigned int,
                  int (*)(const void*, const void*, void*),
                  void*);

#ifdef __cplusplus
}
#endif
# 40 "../../dist/include/nsQuickSort.h"

#endif /* nsQuickSort_h___ */
# 42 "../../dist/include/nsQuickSort.h"
# 26 "../../dist/include/nsTArray.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/nsTArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/nsTArray.h"
#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
# 29 "../../dist/include/nsTArray.h"

namespace JS {
template<class T>
class Heap;
} /* namespace JS */

class nsRegion;
class nsIntRegion;
namespace mozilla {
namespace layers {
struct TileClient;
}
}
//
// nsTArray is a resizable array class, like std::vector.
//
// Unlike std::vector, which follows C++'s construction/destruction rules,
// nsTArray assumes that your "T" can be memmoved()'ed safely.
struct nsTArrayFallibleResult
{
  // Note: allows implicit conversions from and to bool
  MOZ_IMPLICIT nsTArrayFallibleResult(bool aResult) : mResult(aResult) {}

  operator bool() { return mResult; }

private:
  bool mResult;
};

struct nsTArrayInfallibleResult
{
};

//
// nsTArray*Allocators must all use the same |free()|, to allow swap()'ing
// between fallible and infallible variants.
//

struct nsTArrayFallibleAllocatorBase
{
  typedef bool ResultType;
  typedef nsTArrayFallibleResult ResultTypeProxy;

  static ResultType Result(ResultTypeProxy aResult) { return aResult; }
  static bool Successful(ResultTypeProxy aResult) { return aResult; }
  static ResultTypeProxy SuccessResult() { return true; }
  static ResultTypeProxy FailureResult() { return false; }
  static ResultType ConvertBoolToResultType(bool aValue) { return aValue; }
};

struct nsTArrayInfallibleAllocatorBase
{
  typedef void ResultType;
  typedef nsTArrayInfallibleResult ResultTypeProxy;

  static ResultType Result(ResultTypeProxy aResult) {}
  static bool Successful(ResultTypeProxy) { return true; }
  static ResultTypeProxy SuccessResult() { return ResultTypeProxy(); }

  static ResultTypeProxy FailureResult()
  {
    NS_RUNTIMEABORT("Infallible nsTArray should never fail");
    return ResultTypeProxy();
  }

  static ResultType ConvertBoolToResultType(bool aValue)
  {
    if (!aValue) {
      NS_RUNTIMEABORT("infallible nsTArray should never convert false to ResultType");
    }
  }
};

#if defined(MOZALLOC_HAVE_XMALLOC)
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/mozalloc_abort.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/mozalloc_abort.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: sw=4 ts=4 et :
 */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_mozalloc_abort_h
MOZALLOC_EXPORT
#if !defined(__arm__)
  MOZ_NORETURN
#endif
# 37 "../../dist/include/mozilla/mozalloc_abort.h"
  void mozalloc_abort(const char* const msg);


#endif  /* ifndef mozilla_mozalloc_abort_h */
# 41 "../../dist/include/mozilla/mozalloc_abort.h"
# 167 "../../dist/include/nsTArray.h" 2

  {
    return moz_xrealloc(aPtr, aSize);
  }

  static void Free(void* aPtr) { moz_free(aPtr); }
  static void SizeTooBig(size_t aSize) { NS_ABORT_OOM(aSize); }
};

#else
# 193 "../../dist/include/nsTArray.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 194 "../../dist/include/nsTArray.h"

struct nsTArrayFallibleAllocator : nsTArrayFallibleAllocatorBase
{
  static void* Malloc(size_t aSize) { return malloc(aSize); }
  static void* Realloc(void* aPtr, size_t aSize) { return realloc(aPtr, aSize); }

  static void Free(void* aPtr) { free(aPtr); }
  static void SizeTooBig(size_t) {}
};

struct nsTArrayInfallibleAllocator : nsTArrayInfallibleAllocatorBase
{
  static void* Malloc(size_t aSize)
  {
    void* ptr = malloc(aSize);
    if (MOZ_UNLIKELY(!ptr)) {
      NS_ABORT_OOM(aSize);
    }
    return ptr;
  }

  static void* Realloc(void* aPtr, size_t aSize)
  {
    void* newptr = realloc(aPtr, aSize);
    if (MOZ_UNLIKELY(!newptr && aSize)) {
      NS_ABORT_OOM(aSize);
    }
    return newptr;
  }

  static void Free(void* aPtr) { free(aPtr); }
  static void SizeTooBig(size_t aSize) { NS_ABORT_OOM(aSize); }
};

#endif
# 229 "../../dist/include/nsTArray.h"

// nsTArray_base stores elements into the space allocated beyond
// sizeof(*this).  This is done to minimize the size of the nsTArray
// object when it is empty.
struct nsTArrayHeader
{
  static nsTArrayHeader sEmptyHdr;

  uint32_t mLength;
  uint32_t mCapacity : 31;
  uint32_t mIsAutoArray : 1;
};

// This class provides a SafeElementAt method to nsTArray<T*> which does
// not take a second default value parameter.
template<class E, class Derived>
struct nsTArray_SafeElementAtHelper
{
  typedef E*       elem_type;
  typedef size_t   index_type;

  // No implementation is provided for these two methods, and that is on
  // purpose, since we don't support these functions on non-pointer type
  // instantiations.
  elem_type& SafeElementAt(index_type aIndex);
  const elem_type& SafeElementAt(index_type aIndex) const;
};

template<class E, class Derived>
struct nsTArray_SafeElementAtHelper<E*, Derived>
{
  typedef E*       elem_type;
  typedef size_t   index_type;

  elem_type SafeElementAt(index_type aIndex)
  {
    return static_cast<Derived*>(this)->SafeElementAt(aIndex, nullptr);
  }

  const elem_type SafeElementAt(index_type aIndex) const
  {
    return static_cast<const Derived*>(this)->SafeElementAt(aIndex, nullptr);
  }
};

// E is the base type that the smart pointer is templated over; the
// smart pointer can act as E*.
template<class E, class Derived>
struct nsTArray_SafeElementAtSmartPtrHelper
{
  typedef E*       elem_type;
  typedef size_t   index_type;

  elem_type SafeElementAt(index_type aIndex)
  {
    return static_cast<Derived*>(this)->SafeElementAt(aIndex, nullptr);
  }

  const elem_type SafeElementAt(index_type aIndex) const
  {
    return static_cast<const Derived*>(this)->SafeElementAt(aIndex, nullptr);
  }
};

//
// This class serves as a base class for nsTArray.  It shouldn't be used
// directly.  It holds common implementation code that does not depend on the
// element type of the nsTArray.
//
template<class Alloc, class Copy>
class nsTArray_base
{
  // Allow swapping elements with |nsTArray_base|s created using a
  // different allocator.  This is kosher because all allocators use
  // the same free().
  template<class Allocator, class Copier>
  friend class nsTArray_base;

protected:
  typedef nsTArrayHeader Header;

public:
  typedef size_t size_type;
  typedef size_t index_type;

  // @return The number of elements in the array.
  size_type Length() const { return mHdr->mLength; }

  // @return True if the array is empty or false otherwise.
  bool IsEmpty() const { return Length() == 0; }

  // @return The number of elements that can fit in the array without forcing
  // the array to be re-allocated.  The length of an array is always less
  // than or equal to its capacity.
  size_type Capacity() const {  return mHdr->mCapacity; }

#ifdef DEBUG
  void* DebugGetHeader() const { return mHdr; }
#endif
# 344 "../../dist/include/nsTArray.h"

protected:
  nsTArray_base();

  ~nsTArray_base();

  // Resize the storage if necessary to achieve the requested capacity.
  // @param aCapacity The requested number of array elements.
  // @param aElemSize The size of an array element.
  // @return False if insufficient memory is available; true otherwise.
  typename Alloc::ResultTypeProxy EnsureCapacity(size_type aCapacity,
                                                 size_type aElemSize);

  // Resize the storage to the minimum required amount.
  // @param aElemSize  The size of an array element.
  // @param aElemAlign The alignment in bytes of an array element.
  void ShrinkCapacity(size_type aElemSize, size_t aElemAlign);

  // This method may be called to resize a "gap" in the array by shifting
  // elements around.  It updates mLength appropriately.  If the resulting
  // array has zero elements, then the array's memory is free'd.
  // @param aStart     The starting index of the gap.
  // @param aOldLen    The current length of the gap.
  // @param aNewLen    The desired length of the gap.
  // @param aElemSize  The size of an array element.
  // @param aElemAlign The alignment in bytes of an array element.
  void ShiftData(index_type aStart, size_type aOldLen, size_type aNewLen,
                 size_type aElemSize, size_t aElemAlign);

  // This method increments the length member of the array's header.
  // Note that mHdr may actually be sEmptyHdr in the case where a
  // zero-length array is inserted into our array. But then aNum should
  // always be 0.
  void IncrementLength(size_t aNum)
  {
    if (mHdr == EmptyHdr()) {
      if (MOZ_UNLIKELY(aNum != 0)) {
        // Writing a non-zero length to the empty header would be extremely bad.
        MOZ_CRASH();
      }
    } else {
      mHdr->mLength += aNum;
    }
  }

  // This method inserts blank slots into the array.
  // @param aIndex the place to insert the new elements. This must be no
  //               greater than the current length of the array.
  // @param aCount the number of slots to insert
  // @param aElementSize the size of an array element.
  // @param aElemAlign the alignment in bytes of an array element.
  bool InsertSlotsAt(index_type aIndex, size_type aCount,
                     size_type aElementSize, size_t aElemAlign);

protected:
  template<class Allocator>
  typename Alloc::ResultTypeProxy
  SwapArrayElements(nsTArray_base<Allocator, Copy>& aOther,
                    size_type aElemSize,
                    size_t aElemAlign);

  // This is an RAII class used in SwapArrayElements.
  class IsAutoArrayRestorer
  {
  public:
    IsAutoArrayRestorer(nsTArray_base<Alloc, Copy>& aArray, size_t aElemAlign);
    ~IsAutoArrayRestorer();

  private:
    nsTArray_base<Alloc, Copy>& mArray;
    size_t mElemAlign;
    bool mIsAuto;
  };

  // Helper function for SwapArrayElements. Ensures that if the array
  // is an nsAutoTArray that it doesn't use the built-in buffer.
  bool EnsureNotUsingAutoArrayBuffer(size_type aElemSize);

  // Returns true if this nsTArray is an nsAutoTArray with a built-in buffer.
  bool IsAutoArray() const { return mHdr->mIsAutoArray; }

  // Returns a Header for the built-in buffer of this nsAutoTArray.
  Header* GetAutoArrayBuffer(size_t aElemAlign)
  {
    MOZ_ASSERT(IsAutoArray(), "Should be an auto array to call this");
    return GetAutoArrayBufferUnsafe(aElemAlign);
  }
  const Header* GetAutoArrayBuffer(size_t aElemAlign) const
  {
    MOZ_ASSERT(IsAutoArray(), "Should be an auto array to call this");
    return GetAutoArrayBufferUnsafe(aElemAlign);
  }

  // Returns a Header for the built-in buffer of this nsAutoTArray, but doesn't
  // assert that we are an nsAutoTArray.
  Header* GetAutoArrayBufferUnsafe(size_t aElemAlign)
  {
    return const_cast<Header*>(static_cast<const nsTArray_base<Alloc, Copy>*>(
      this)->GetAutoArrayBufferUnsafe(aElemAlign));
  }
  const Header* GetAutoArrayBufferUnsafe(size_t aElemAlign) const;

  // Returns true if this is an nsAutoTArray and it currently uses the
  // built-in buffer to store its elements.
  bool UsesAutoArrayBuffer() const;

  // The array's elements (prefixed with a Header).  This pointer is never
  // null.  If the array is empty, then this will point to sEmptyHdr.
  Header* mHdr;

  Header* Hdr() const { return mHdr; }
  Header** PtrToHdr() { return &mHdr; }
  static Header* EmptyHdr() { return &Header::sEmptyHdr; }
};

//
// This class defines convenience functions for element specific operations.
// Specialize this template if necessary.
//
template<class E>
class nsTArrayElementTraits
{
public:
  // Invoke the default constructor in place.
  static inline void Construct(E* aE)
  {
    // Do NOT call "E()"! That triggers C++ "default initialization"
    // which zeroes out POD ("plain old data") types such as regular
    // ints.  We don't want that because it can be a performance issue
    // and people don't expect it; nsTArray should work like a regular
    // C/C++ array in this respect.
    new (static_cast<void*>(aE)) E;
  }
  // Invoke the copy-constructor in place.
  template<class A>
  static inline void Construct(E* aE, A&& aArg)
  {
    typedef typename mozilla::RemoveCV<E>::Type E_NoCV;
    typedef typename mozilla::RemoveCV<A>::Type A_NoCV;
    static_assert(!mozilla::IsSame<E_NoCV*, A_NoCV>::value,
                  "For safety, we disallow constructing nsTArray<E> elements "
                  "from E* pointers. See bug 960591.");
    new (static_cast<void*>(aE)) E(mozilla::Forward<A>(aArg));
  }
  // Invoke the destructor in place.
  static inline void Destruct(E* aE) { aE->~E(); }
};

// The default comparator used by nsTArray
template<class A, class B>
class nsDefaultComparator
{
public:
  bool Equals(const A& aA, const B& aB) const { return aA == aB; }
  bool LessThan(const A& aA, const B& aB) const { return aA < aB; }
};

template<class E> class InfallibleTArray;
template<class E> class FallibleTArray;

template<bool IsPod, bool IsSameType>
struct AssignRangeAlgorithm
{
  template<class Item, class ElemType, class IndexType, class SizeType>
  static void implementation(ElemType* aElements, IndexType aStart,
                             SizeType aCount, const Item* aValues)
  {
    ElemType* iter = aElements + aStart;
    ElemType* end = iter + aCount;
    for (; iter != end; ++iter, ++aValues) {
      nsTArrayElementTraits<ElemType>::Construct(iter, *aValues);
    }
  }
};

template<>
struct AssignRangeAlgorithm<true, true>
{
  template<class Item, class ElemType, class IndexType, class SizeType>
  static void implementation(ElemType* aElements, IndexType aStart,
                             SizeType aCount, const Item* aValues)
  {
    memcpy(aElements + aStart, aValues, aCount * sizeof(ElemType));
  }
};

//
// Normally elements are copied with memcpy and memmove, but for some element
// types that is problematic.  The nsTArray_CopyChooser template class can be
// specialized to ensure that copying calls constructors and destructors
// instead, as is done below for JS::Heap<E> elements.
//

//
// A class that defines how to copy elements using memcpy/memmove.
//
struct nsTArray_CopyWithMemutils
{
  const static bool allowRealloc = true;

  static void CopyElements(void* aDest, const void* aSrc, size_t aCount,
                           size_t aElemSize)
  {
    memcpy(aDest, aSrc, aCount * aElemSize);
  }

  static void CopyHeaderAndElements(void* aDest, const void* aSrc,
                                    size_t aCount, size_t aElemSize)
  {
    memcpy(aDest, aSrc, sizeof(nsTArrayHeader) + aCount * aElemSize);
  }

  static void MoveElements(void* aDest, const void* aSrc, size_t aCount,
                           size_t aElemSize)
  {
    memmove(aDest, aSrc, aCount * aElemSize);
  }
};

//
// A template class that defines how to copy elements calling their constructors
// and destructors appropriately.
//
template<class ElemType>
struct nsTArray_CopyWithConstructors
{
  typedef nsTArrayElementTraits<ElemType> traits;

  const static bool allowRealloc = false;

  static void CopyElements(void* aDest, void* aSrc, size_t aCount,
                           size_t aElemSize)
  {
    ElemType* destElem = static_cast<ElemType*>(aDest);
    ElemType* srcElem = static_cast<ElemType*>(aSrc);
    ElemType* destElemEnd = destElem + aCount;
#ifdef DEBUG
    ElemType* srcElemEnd = srcElem + aCount;
    MOZ_ASSERT(srcElemEnd <= destElem || srcElemEnd > destElemEnd);
#endif
# 584 "../../dist/include/nsTArray.h"
    while (destElem != destElemEnd) {
      traits::Construct(destElem, *srcElem);
      traits::Destruct(srcElem);
      ++destElem;
      ++srcElem;
    }
  }

  static void CopyHeaderAndElements(void* aDest, void* aSrc, size_t aCount,
                                    size_t aElemSize)
  {
    nsTArrayHeader* destHeader = static_cast<nsTArrayHeader*>(aDest);
    nsTArrayHeader* srcHeader = static_cast<nsTArrayHeader*>(aSrc);
    *destHeader = *srcHeader;
    CopyElements(static_cast<uint8_t*>(aDest) + sizeof(nsTArrayHeader),
                 static_cast<uint8_t*>(aSrc) + sizeof(nsTArrayHeader),
                 aCount, aElemSize);
  }

  static void MoveElements(void* aDest, void* aSrc, size_t aCount,
                           size_t aElemSize)
  {
    ElemType* destElem = static_cast<ElemType*>(aDest);
    ElemType* srcElem = static_cast<ElemType*>(aSrc);
    ElemType* destElemEnd = destElem + aCount;
    ElemType* srcElemEnd = srcElem + aCount;
    if (destElem == srcElem) {
      return;  // In practice, we don't do this.
    } else if (srcElemEnd > destElem && srcElemEnd < destElemEnd) {
      while (destElemEnd != destElem) {
        --destElemEnd;
        --srcElemEnd;
        traits::Construct(destElemEnd, *srcElemEnd);
        traits::Destruct(srcElem);
      }
    } else {
      CopyElements(aDest, aSrc, aCount, aElemSize);
    }
  }
};

//
// The default behaviour is to use memcpy/memmove for everything.
//
template<class E>
struct nsTArray_CopyChooser
{
  typedef nsTArray_CopyWithMemutils Type;
};

//
// Some classes require constructors/destructors to be called, so they are
// specialized here.
//
template<class E>
struct nsTArray_CopyChooser<JS::Heap<E>>
{
  typedef nsTArray_CopyWithConstructors<JS::Heap<E>> Type;
};

template<>
struct nsTArray_CopyChooser<nsRegion>
{
  typedef nsTArray_CopyWithConstructors<nsRegion> Type;
};

template<>
struct nsTArray_CopyChooser<nsIntRegion>
{
  typedef nsTArray_CopyWithConstructors<nsIntRegion> Type;
};

template<>
struct nsTArray_CopyChooser<mozilla::layers::TileClient>
{
  typedef nsTArray_CopyWithConstructors<mozilla::layers::TileClient> Type;
};


//
// Base class for nsTArray_Impl that is templated on element type and derived
// nsTArray_Impl class, to allow extra conversions to be added for specific
// types.
//
template<class E, class Derived>
struct nsTArray_TypedBase : public nsTArray_SafeElementAtHelper<E, Derived>
{
};

//
// Specialization of nsTArray_TypedBase for arrays containing JS::Heap<E>
// elements.
//
// These conversions are safe because JS::Heap<E> and E share the same
// representation, and since the result of the conversions are const references
// we won't miss any barriers.
//
// The static_cast is necessary to obtain the correct address for the derived
// class since we are a base class used in multiple inheritance.
//
template<class E, class Derived>
struct nsTArray_TypedBase<JS::Heap<E>, Derived>
  : public nsTArray_SafeElementAtHelper<JS::Heap<E>, Derived>
{
  operator const nsTArray<E>&()
  {
    static_assert(sizeof(E) == sizeof(JS::Heap<E>),
                  "JS::Heap<E> must be binary compatible with E.");
    Derived* self = static_cast<Derived*>(this);
    return *reinterpret_cast<nsTArray<E> *>(self);
  }

  operator const FallibleTArray<E>&()
  {
    Derived* self = static_cast<Derived*>(this);
    return *reinterpret_cast<FallibleTArray<E> *>(self);
  }
};

namespace detail {

template<class Item, class Comparator>
struct ItemComparatorEq
{
  const Item& mItem;
  const Comparator& mComp;
  ItemComparatorEq(const Item& aItem, const Comparator& aComp)
    : mItem(aItem)
    , mComp(aComp)
  {}
  template<class T>
  int operator()(const T& aElement) const {
    if (mComp.Equals(aElement, mItem)) {
      return 0;
    }

    return mComp.LessThan(aElement, mItem) ? 1 : -1;
  }
};

template<class Item, class Comparator>
struct ItemComparatorFirstElementGT
{
  const Item& mItem;
  const Comparator& mComp;
  ItemComparatorFirstElementGT(const Item& aItem, const Comparator& aComp)
    : mItem(aItem)
    , mComp(aComp)
  {}
  template<class T>
  int operator()(const T& aElement) const {
    if (mComp.LessThan(aElement, mItem) ||
        mComp.Equals(aElement, mItem)) {
      return 1;
    } else {
      return -1;
    }
  }
};

} // namespace detail

//
// nsTArray_Impl contains most of the guts supporting nsTArray, FallibleTArray,
// nsAutoTArray, and AutoFallibleTArray.
//
// The only situation in which you might need to use nsTArray_Impl in your code
// is if you're writing code which mutates a TArray which may or may not be
// infallible.
//
// Code which merely reads from a TArray which may or may not be infallible can
// simply cast the TArray to |const nsTArray&|; both fallible and infallible
// TArrays can be cast to |const nsTArray&|.
//
template<class E, class Alloc>
class nsTArray_Impl
  : public nsTArray_base<Alloc, typename nsTArray_CopyChooser<E>::Type>
  , public nsTArray_TypedBase<E, nsTArray_Impl<E, Alloc>>
{
public:
  typedef typename nsTArray_CopyChooser<E>::Type     copy_type;
  typedef nsTArray_base<Alloc, copy_type>            base_type;
  typedef typename base_type::size_type              size_type;
  typedef typename base_type::index_type             index_type;
  typedef E                                          elem_type;
  typedef nsTArray_Impl<E, Alloc>                    self_type;
  typedef nsTArrayElementTraits<E>                   elem_traits;
  typedef nsTArray_SafeElementAtHelper<E, self_type> safeelementat_helper_type;
  typedef elem_type*                                 iterator;
  typedef const elem_type*                           const_iterator;
  typedef mozilla::ReverseIterator<elem_type*>       reverse_iterator;
  typedef mozilla::ReverseIterator<const elem_type*> const_reverse_iterator;

  using safeelementat_helper_type::SafeElementAt;
  using base_type::EmptyHdr;

  // A special value that is used to indicate an invalid or unknown index
  // into the array.
  static const index_type NoIndex = index_type(-1);

  using base_type::Length;

  //
  // Finalization method
  //

  ~nsTArray_Impl() { Clear(); }

  //
  // Initialization methods
  //

  nsTArray_Impl() {}

  // Initialize this array and pre-allocate some number of elements.
  explicit nsTArray_Impl(size_type aCapacity) { SetCapacity(aCapacity); }
  operator const FallibleTArray<E>&() const
  {
    return *reinterpret_cast<const FallibleTArray<E>*>(this);
  }

  // The array's assignment operator performs a 'deep' copy of the given
  // array.  It is optimized to reuse existing storage if possible.
  // @param aOther The array object to copy.
  self_type& operator=(const self_type& aOther)
  {
    ReplaceElementsAt(0, Length(), aOther.Elements(), aOther.Length());
    return *this;
  }

  // The array's move assignment operator steals the underlying data from
  // the other array.
  // @param other  The array object to move from.
  

  // Return true if this array has the same length and the same
  // elements as |aOther|.
  template<typename Allocator>
  bool operator==(const nsTArray_Impl<E, Allocator>& aOther) const
  {
    size_type len = Length();
    if (len != aOther.Length()) {
      return false;
    }

    // XXX std::equal would be as fast or faster here
    for (index_type i = 0; i < len; ++i) {
      if (!(operator[](i) == aOther[i])) {
        return false;
      }
    }

    return true;
  }

  // Return true if this array does not have the same length and the same
  // elements as |aOther|.
  bool operator!=(const self_type& aOther) const { return !operator==(aOther); }

  

  

  // @return The amount of memory used by this nsTArray_Impl, excluding
  // sizeof(*this).
  size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
  {
    if (this->UsesAutoArrayBuffer() || Hdr() == EmptyHdr()) {
      return 0;
    }
    return aMallocSizeOf(this->Hdr());
  }

  // @return The amount of memory used by this nsTArray_Impl, including
  // sizeof(*this).
  

  //
  // Accessor methods
  //

  // This method provides direct access to the array elements.
  // @return A pointer to the first element of the array.  If the array is
  // empty, then this pointer must not be dereferenced.
  elem_type* Elements() { return reinterpret_cast<elem_type*>(Hdr() + 1); }

  // This method provides direct, readonly access to the array elements.
  // @return A pointer to the first element of the array.  If the array is
  // empty, then this pointer must not be dereferenced.
  const elem_type* Elements() const
  {
    return reinterpret_cast<const elem_type*>(Hdr() + 1);
  }

  // This method provides direct access to an element of the array. The given
  // index must be within the array bounds.
  // @param aIndex The index of an element in the array.
  // @return A reference to the i'th element of the array.
  elem_type& ElementAt(index_type aIndex)
  {
    MOZ_ASSERT(aIndex < Length(), "invalid array index");
    return Elements()[aIndex];
  }

  // This method provides direct, readonly access to an element of the array
  // The given index must be within the array bounds.
  // @param aIndex The index of an element in the array.
  // @return A const reference to the i'th element of the array.
  const elem_type& ElementAt(index_type aIndex) const
  {
    MOZ_ASSERT(aIndex < Length(), "invalid array index");
    return Elements()[aIndex];
  }

  // This method provides direct access to an element of the array in a bounds
  // safe manner. If the requested index is out of bounds the provided default
  // value is returned.
  // @param aIndex The index of an element in the array.
  // @param aDef   The value to return if the index is out of bounds.
  

  // This method provides direct access to an element of the array in a bounds
  // safe manner. If the requested index is out of bounds the provided default
  // value is returned.
  // @param aIndex The index of an element in the array.
  // @param aDef   The value to return if the index is out of bounds.
  const elem_type& SafeElementAt(index_type aIndex, const elem_type& aDef) const
  {
    return aIndex < Length() ? Elements()[aIndex] : aDef;
  }

  // Shorthand for ElementAt(aIndex)
  elem_type& operator[](index_type aIndex) { return ElementAt(aIndex); }

  // Shorthand for ElementAt(aIndex)
  const elem_type& operator[](index_type aIndex) const { return ElementAt(aIndex); }

  // Shorthand for ElementAt(length - 1)
  

  // @param aItem  The item to search for.
  // @param aComp  The Comparator used to determine element equality.
  // @return       true if the element was found.
  

  // This method searches for the first element in this array that is equal
  // to the given element.  This method assumes that 'operator==' is defined
  // for elem_type.
  // @param aItem  The item to search for.
  // @return       true if the element was found.
  

  // This method searches for the offset of the first element in this
  // array that is equal to the given element.
  // @param aItem  The item to search for.
  // @param aStart The index to start from.
  // @param aComp  The Comparator used to determine element equality.
  // @return       The index of the found element or NoIndex if not found.
  template<class Item, class Comparator>
  index_type IndexOf(const Item& aItem, index_type aStart,
                     const Comparator& aComp) const
  {
    const elem_type* iter = Elements() + aStart;
    const elem_type* iend = Elements() + Length();
    for (; iter != iend; ++iter) {
      if (aComp.Equals(*iter, aItem)) {
        return index_type(iter - Elements());
      }
    }
    return NoIndex;
  }
  // This method searches for the offset for the element in this array
  // that is equal to the given element. The array is assumed to be sorted.
  // If there is more than one equivalent element, there is no guarantee
  // on which one will be returned.
  // @param aItem  The item to search for.
  // @param aComp  The Comparator used.
  // @return       The index of the found element or NoIndex if not found.
  template<class Item, class Comparator>
  index_type BinaryIndexOf(const Item& aItem, const Comparator& aComp) const
  {
    using mozilla::BinarySearchIf;
    typedef ::detail::ItemComparatorEq<Item, Comparator> Cmp;

    size_t index;
    bool found = BinarySearchIf(*this, 0, Length(), Cmp(aItem, aComp), &index);
    return found ? index : NoIndex;
  }

  // This method searches for the offset for the element in this array
  // that is equal to the given element. The array is assumed to be sorted.
  // This method assumes that 'operator==' and 'operator<' are defined.
  // @param aItem  The item to search for.
  // @return       The index of the found element or NoIndex if not found.
  

  //
  // Mutation methods
  //
  // This method call the destructor on each element of the array, empties it,
  // but does not shrink the array's capacity.
  // See also SetLengthAndRetainStorage.
  // Make sure to call Compact() if needed to avoid keeping a huge array
  // around.
  void ClearAndRetainStorage()
  {
    if (base_type::mHdr == EmptyHdr()) {
      return;
    }

    DestructRange(0, Length());
    base_type::mHdr->mLength = 0;
  }

  // This method modifies the length of the array, but unlike SetLength
  // it doesn't deallocate/reallocate the current internal storage.
  // The new length MUST be shorter than or equal to the current capacity.
  // If the new length is larger than the existing length of the array,
  // then new elements will be constructed using elem_type's default
  // constructor.  If shorter, elements will be destructed and removed.
  // See also ClearAndRetainStorage.
  // @param aNewLen  The desired length of this array.
  

  // This method replaces a range of elements in this array.
  // @param aStart    The starting index of the elements to replace.
  // @param aCount    The number of elements to replace.  This may be zero to
  //                  insert elements without removing any existing elements.
  // @param aArray    The values to copy into this array.  Must be non-null,
  //                  and these elements must not already exist in the array
  //                  being modified.
  // @param aArrayLen The number of values to copy into this array.
  // @return          A pointer to the new elements in the array, or null if
  //                  the operation failed due to insufficient memory.
  template<class Item>
  elem_type* ReplaceElementsAt(index_type aStart, size_type aCount,
                               const Item* aArray, size_type aArrayLen)
  {
    // Adjust memory allocation up-front to catch errors.
    if (!Alloc::Successful(this->EnsureCapacity(Length() + aArrayLen - aCount,
                                                sizeof(elem_type)))) {
      return nullptr;
    }
    DestructRange(aStart, aCount);
    this->ShiftData(aStart, aCount, aArrayLen,
                    sizeof(elem_type), MOZ_ALIGNOF(elem_type));
    AssignRange(aStart, aArrayLen, aArray);
    return Elements() + aStart;
  }

  // A variation on the ReplaceElementsAt method defined above.
  

  // A variation on the ReplaceElementsAt method defined above.
  template<class Item>
  elem_type* ReplaceElementsAt(index_type aStart, size_type aCount,
                               const Item& aItem)
  {
    return ReplaceElementsAt(aStart, aCount, &aItem, 1);
  }

  // A variation on the ReplaceElementsAt method defined above.
  

  // A variation on the ReplaceElementsAt method defined above.
  

  // A variation on the ReplaceElementsAt method defined above.
  

  // Insert a new element without copy-constructing. This is useful to avoid
  // temporaries.
  // @return A pointer to the newly inserted element, or null on OOM.
  elem_type* InsertElementAt(index_type aIndex)
  {
    if (!Alloc::Successful(this->EnsureCapacity(Length() + 1,
                                                sizeof(elem_type)))) {
      return nullptr;
    }
    this->ShiftData(aIndex, 0, 1, sizeof(elem_type), MOZ_ALIGNOF(elem_type));
    elem_type* elem = Elements() + aIndex;
    elem_traits::Construct(elem);
    return elem;
  }

  // Insert a new element, move constructing if possible.
  template<class Item>
  elem_type* InsertElementAt(index_type aIndex, Item&& aItem)
  {
    if (!Alloc::Successful(this->EnsureCapacity(Length() + 1,
                                                sizeof(elem_type)))) {
      return nullptr;
    }
    this->ShiftData(aIndex, 0, 1, sizeof(elem_type), MOZ_ALIGNOF(elem_type));
    elem_type* elem = Elements() + aIndex;
    elem_traits::Construct(elem, mozilla::Forward<Item>(aItem));
    return elem;
  }

  // This method searches for the smallest index of an element that is strictly
  // greater than |aItem|. If |aItem| is inserted at this index, the array will
  // remain sorted and |aItem| would come after all elements that are equal to
  // it. If |aItem| is greater than or equal to all elements in the array, the
  // array length is returned.
  //
  // insertion.
  

  // A variation on the InsertElementSorted method defined above.
  

  // This method appends elements to the end of this array.
  // @param aArray    The elements to append to this array.
  // @param aArrayLen The number of elements to append to this array.
  // @return          A pointer to the new elements in the array, or null if
  //                  the operation failed due to insufficient memory.
  template<class Item>
  elem_type* AppendElements(const Item* aArray, size_type aArrayLen)
  {
    if (!Alloc::Successful(this->EnsureCapacity(Length() + aArrayLen,
                                                sizeof(elem_type)))) {
      return nullptr;
    }
    index_type len = Length();
    AssignRange(len, aArrayLen, aArray);
    this->IncrementLength(aArrayLen);
    return Elements() + len;
  }

  // A variation on the AppendElements method defined above.
  template<class Item, class Allocator>
  elem_type* AppendElements(const nsTArray_Impl<Item, Allocator>& aArray)
  {
    return AppendElements(aArray.Elements(), aArray.Length());
  }

  // Append a new element, move constructing if possible.
  template<class Item>
  elem_type* AppendElement(Item&& aItem)
  {
    if (!Alloc::Successful(this->EnsureCapacity(Length() + 1,
                                                sizeof(elem_type)))) {
      return nullptr;
    }
    elem_type* elem = Elements() + Length();
    elem_traits::Construct(elem, mozilla::Forward<Item>(aItem));
    this->IncrementLength(1);
    return elem;
  }

  // Append new elements without copy-constructing. This is useful to avoid
  // temporaries.
  // @return A pointer to the newly appended elements, or null on OOM.
  elem_type* AppendElements(size_type aCount)
  {
    if (!Alloc::Successful(this->EnsureCapacity(Length() + aCount,
                                                sizeof(elem_type)))) {
      return nullptr;
    }
    elem_type* elems = Elements() + Length();
    size_type i;
    for (i = 0; i < aCount; ++i) {
      elem_traits::Construct(elems + i);
    }
    this->IncrementLength(aCount);
    return elems;
  }

  // Append a new element without copy-constructing. This is useful to avoid
  // temporaries.
  // @return A pointer to the newly appended element, or null on OOM.
  elem_type* AppendElement() { return AppendElements(1); }

  // Move all elements from another array to the end of this array without
  // calling copy constructors or destructors.
  // @return A pointer to the newly appended elements, or null on OOM.
  template<class Item, class Allocator>
  elem_type* MoveElementsFrom(nsTArray_Impl<Item, Allocator>& aArray)
  {
    MOZ_ASSERT(&aArray != this, "argument must be different aArray");
    index_type len = Length();
    index_type otherLen = aArray.Length();
    if (!Alloc::Successful(this->EnsureCapacity(len + otherLen,
                                                sizeof(elem_type)))) {
      return nullptr;
    }
    copy_type::CopyElements(Elements() + len, aArray.Elements(), otherLen,
                            sizeof(elem_type));
    this->IncrementLength(otherLen);
    aArray.ShiftData(0, otherLen, 0, sizeof(elem_type), MOZ_ALIGNOF(elem_type));
    return Elements() + len;
  }
  

  // This method removes a range of elements from this array.
  // @param aStart The starting index of the elements to remove.
  // @param aCount The number of elements to remove.
  void RemoveElementsAt(index_type aStart, size_type aCount)
  {
    MOZ_ASSERT(aCount == 0 || aStart < Length(), "Invalid aStart index");
    MOZ_ASSERT(aStart + aCount <= Length(), "Invalid length");
    // Check that the previous assert didn't overflow
    MOZ_ASSERT(aStart <= aStart + aCount, "Start index plus length overflows");
    DestructRange(aStart, aCount);
    this->ShiftData(aStart, aCount, 0,
                    sizeof(elem_type), MOZ_ALIGNOF(elem_type));
  }

  // A variation on the RemoveElementsAt method defined above.
  void RemoveElementAt(index_type aIndex) { RemoveElementsAt(aIndex, 1); }

  // A variation on the RemoveElementsAt method defined above.
  void Clear() { RemoveElementsAt(0, Length()); }

  // This helper function combines IndexOf with RemoveElementAt to "search
  // and destroy" the first element that is equal to the given element.
  // @param aItem The item to search for.
  // @param aComp The Comparator used to determine element equality.
  // @return true if the element was found
  template<class Item, class Comparator>
  bool RemoveElement(const Item& aItem, const Comparator& aComp)
  {
    index_type i = IndexOf(aItem, 0, aComp);
    if (i == NoIndex) {
      return false;
    }

    RemoveElementAt(i);
    return true;
  }

  // A variation on the RemoveElement method defined above that assumes
  // that 'operator==' is defined for elem_type.
  template<class Item>
  bool RemoveElement(const Item& aItem)
  {
    return RemoveElement(aItem, nsDefaultComparator<elem_type, Item>());
  }

  // This helper function combines IndexOfFirstElementGt with
  // RemoveElementAt to "search and destroy" the last element that
  // is equal to the given element.
  // @param aItem The item to search for.
  // @param aComp The Comparator used to determine element equality.
  // @return true if the element was found
  

  // A variation on the RemoveElementSorted method defined above.
  

  // This method causes the elements contained in this array and the given
  // array to be swapped.
  template<class Allocator>
  typename Alloc::ResultType SwapElements(nsTArray_Impl<E, Allocator>& aOther)
  {
    return Alloc::Result(this->SwapArrayElements(aOther, sizeof(elem_type),
                                                 MOZ_ALIGNOF(elem_type)));
  }

  //
  // Allocation
  //

  // This method may increase the capacity of this array object by the
  // specified amount.  This method may be called in advance of several
  // AppendElement operations to minimize heap re-allocations.  This method
  // will not reduce the number of elements in this array.
  // @param aCapacity The desired capacity of this array.
  // @return True if the operation succeeded; false if we ran out of memory
  typename Alloc::ResultType SetCapacity(size_type aCapacity)
  {
    return Alloc::Result(this->EnsureCapacity(aCapacity, sizeof(elem_type)));
  }

  // This method modifies the length of the array.  If the new length is
  // larger than the existing length of the array, then new elements will be
  // constructed using elem_type's default constructor.  Otherwise, this call
  // removes elements from the array (see also RemoveElementsAt).
  // @param aNewLen The desired length of this array.
  // @return True if the operation succeeded; false otherwise.
  // See also TruncateLength if the new length is guaranteed to be smaller than
  // the old.
  typename Alloc::ResultType SetLength(size_type aNewLen)
  {
    size_type oldLen = Length();
    if (aNewLen > oldLen) {
      return Alloc::ConvertBoolToResultType(
        InsertElementsAt(oldLen, aNewLen - oldLen) != nullptr);
    }

    TruncateLength(aNewLen);
    return Alloc::ConvertBoolToResultType(true);
  }

  // This method modifies the length of the array, but may only be
  // called when the new length is shorter than the old.  It can
  // therefore be called when elem_type has no default constructor,
  // @return True if the operation succeeded; false otherwise.
  typename Alloc::ResultType EnsureLengthAtLeast(size_type aMinLen)
  {
    size_type oldLen = Length();
    if (aMinLen > oldLen) {
      return Alloc::ConvertBoolToResultType(!!InsertElementsAt(oldLen,
                                                               aMinLen - oldLen));
    }
    return Alloc::ConvertBoolToResultType(true);
  }

  // This method inserts elements into the array, constructing
  // them using elem_type's default constructor.
  // @param aIndex the place to insert the new elements. This must be no
  //               greater than the current length of the array.
  // @param aCount the number of elements to insert
  elem_type* InsertElementsAt(index_type aIndex, size_type aCount)
  {
    if (!base_type::InsertSlotsAt(aIndex, aCount, sizeof(elem_type),
                                  MOZ_ALIGNOF(elem_type))) {
      return nullptr;
    }

    // Initialize the extra array elements
    elem_type* iter = Elements() + aIndex;
    elem_type* iend = iter + aCount;
    for (; iter != iend; ++iter) {
      elem_traits::Construct(iter);
    }

    return Elements() + aIndex;
  }
  // A variation on the PushHeap method defined above.
  

  // Delete the root of the heap and restore the heap
  // @param aComp The Comparator used to restore the heap
  

  // A variation on the PopHeap method defined above.
  

protected:
  using base_type::Hdr;
  using base_type::ShrinkCapacity;

  // This method invokes elem_type's destructor on a range of elements.
  // @param aStart The index of the first element to destroy.
  // @param aCount The number of elements to destroy.
  void DestructRange(index_type aStart, size_type aCount)
  {
    elem_type* iter = Elements() + aStart;
    elem_type *iend = iter + aCount;
    for (; iter != iend; ++iter) {
      elem_traits::Destruct(iter);
    }
  }

  // This method invokes elem_type's copy-constructor on a range of elements.
  // @param aStart  The index of the first element to construct.
  // @param aCount  The number of elements to construct.
  // @param aValues The array of elements to copy.
  template<class Item>
  void AssignRange(index_type aStart, size_type aCount, const Item* aValues)
  {
    AssignRangeAlgorithm<mozilla::IsPod<Item>::value,
                         mozilla::IsSame<Item, elem_type>::value>
                         ::implementation(Elements(), aStart, aCount, aValues);
  }

  // This method sifts an item down to its proper place in a binary heap
  // @param aIndex The index of the node to start sifting down from
  // @param aComp  The Comparator used to sift down
  
};



template<typename E, typename Alloc>
inline void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
                            nsTArray_Impl<E, Alloc>& aField,
                            const char* aName,
                            uint32_t aFlags = 0)
{
  aFlags |= CycleCollectionEdgeNameArrayFlag;
  size_t length = aField.Length();
  for (size_t i = 0; i < length; ++i) {
    ImplCycleCollectionTraverse(aCallback, aField[i], aName, aFlags);
  }
}

//
// nsTArray is an infallible vector class.  See the comment at the top of this
// file for more details.
//
template<class E>
class nsTArray : public nsTArray_Impl<E, nsTArrayInfallibleAllocator>
{
public:
  typedef nsTArray_Impl<E, nsTArrayInfallibleAllocator> base_type;
  typedef nsTArray<E>                                   self_type;
  typedef typename base_type::size_type                 size_type;

  nsTArray() {}
  explicit nsTArray(size_type aCapacity) : base_type(aCapacity) {}
  explicit nsTArray(const nsTArray& aOther) : base_type(aOther) {}
  

  
  

  self_type& operator=(const self_type& aOther)
  {
    base_type::operator=(aOther);
    return *this;
  }
  
  
  
};

//
// FallibleTArray is a fallible vector class.
//
template<class E>
class FallibleTArray : public nsTArray_Impl<E, nsTArrayFallibleAllocator>
{
  
};

//
// nsAutoArrayBase is a base class for AutoFallibleTArray and nsAutoTArray.
// You shouldn't use this class directly.
//
template<class TArrayBase, size_t N>
class nsAutoArrayBase : public TArrayBase
{
  static_assert(N != 0, "nsAutoArrayBase<TArrayBase, 0> should be specialized");
public:
  typedef nsAutoArrayBase<TArrayBase, N> self_type;
  typedef TArrayBase base_type;
  typedef typename base_type::Header Header;
  typedef typename base_type::elem_type elem_type;
private:
  // nsTArray_base casts itself as an nsAutoArrayBase in order to get a pointer
  // to mAutoBuf.
  template<class Allocator, class Copier>
  friend class nsTArray_base;

  void Init()
  {
    static_assert(MOZ_ALIGNOF(elem_type) <= 8,
                  "can't handle alignments greater than 8, "
                  "see nsTArray_base::UsesAutoArrayBuffer()");
    // Temporary work around for VS2012 RC compiler crash
    Header** phdr = base_type::PtrToHdr();
    *phdr = reinterpret_cast<Header*>(&mAutoBuf);
    (*phdr)->mLength = 0;
    (*phdr)->mCapacity = N;
    (*phdr)->mIsAutoArray = 1;

    MOZ_ASSERT(base_type::GetAutoArrayBuffer(MOZ_ALIGNOF(elem_type)) ==
               reinterpret_cast<Header*>(&mAutoBuf),
               "GetAutoArrayBuffer needs to be fixed");
  }

  // Declare mAutoBuf aligned to the maximum of the header's alignment and
  // elem_type's alignment.  We need to use a union rather than
  // MOZ_ALIGNED_DECL because GCC is picky about what goes into
  // __attribute__((aligned(foo))).
  union
  {
    char mAutoBuf[sizeof(nsTArrayHeader) + N * sizeof(elem_type)];
    // Do the max operation inline to ensure that it is a compile-time constant.
    mozilla::AlignedElem<(MOZ_ALIGNOF(Header) > MOZ_ALIGNOF(elem_type)) ?
                         MOZ_ALIGNOF(Header) : MOZ_ALIGNOF(elem_type)> mAlign;
  };
};

//
// Specialization of nsAutoArrayBase<TArrayBase, N> for the case where N == 0.
// nsAutoArrayBase<TArrayBase, 0> behaves exactly like TArrayBase, but without
// this specialization, it stores a useless inline header.
//
// We do have many nsAutoArrayBase<TArrayBase, 0> objects in memory: about
// 2,000 per tab as of May 2014. These are typically not explicitly
// nsAutoArrayBase<TArrayBase, 0> but rather nsAutoArrayBase<TArrayBase, N>
// for some value N depending on template parameters, in generic code.
//
// For that reason, we optimize this case with the below partial specialization,
// which ensures that nsAutoArrayBase<TArrayBase, 0> is just like TArrayBase,
// without any inline header overhead.
//
template<class TArrayBase>
class nsAutoArrayBase<TArrayBase, 0> : public TArrayBase
{
};

//
// nsAutoTArray<E, N> is an infallible vector class with N elements of inline
// storage.  If you try to store more than N elements inside an
// nsAutoTArray<E, N>, we'll call malloc() and store them all on the heap.
//
// Note that you can cast an nsAutoTArray<E, N> to
// |const AutoFallibleTArray<E, N>&|.
//
template<class E, size_t N>
class nsAutoTArray : public nsAutoArrayBase<nsTArray<E>, N>
{
  typedef nsAutoTArray<E, N> self_type;
  typedef nsAutoArrayBase<nsTArray<E>, N> Base;

public:
  nsAutoTArray() {}

  
  

  

  
};

//
// AutoFallibleTArray<E, N> is a fallible vector class with N elements of
// inline storage.
//
template<class E, size_t N>
class AutoFallibleTArray : public nsAutoArrayBase<FallibleTArray<E>, N>
{
  typedef AutoFallibleTArray<E, N> self_type;
  typedef nsAutoArrayBase<FallibleTArray<E>, N> Base;

public:
  AutoFallibleTArray() {}

  
  

  

  
};

// Assert that nsAutoTArray doesn't have any extra padding inside.
//
// It's important that the data stored in this auto array takes up a multiple of
// 8 bytes; e.g. nsAutoTArray<uint32_t, 1> wouldn't work.  Since nsAutoTArray
// contains a pointer, its size must be a multiple of alignof(void*).  (This is
// because any type may be placed into an array, and there's no padding between
// elements of an array.)  The compiler pads the end of the structure to
// enforce this rule.
//
// If we used nsAutoTArray<uint32_t, 1> below, this assertion would fail on a
// 64-bit system, where the compiler inserts 4 bytes of padding at the end of
// the auto array to make its size a multiple of alignof(void*) == 8 bytes.

static_assert(sizeof(nsAutoTArray<uint32_t, 2>) ==
              sizeof(void*) + sizeof(nsTArrayHeader) + sizeof(uint32_t) * 2,
              "nsAutoTArray shouldn't contain any extra padding, "
              "see the comment");

// Definitions of nsTArray_Impl methods
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray-inl.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTArray-inl.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsTArray_h__
#  error "Don't include this file directly"
#endif
# 10 "../../dist/include/nsTArray-inl.h"

template<class Alloc, class Copy>
nsTArray_base<Alloc, Copy>::nsTArray_base()
  : mHdr(EmptyHdr())
{
  MOZ_COUNT_CTOR(nsTArray_base);
}

template<class Alloc, class Copy>
nsTArray_base<Alloc, Copy>::~nsTArray_base()
{
  if (mHdr != EmptyHdr() && !UsesAutoArrayBuffer()) {
    Alloc::Free(mHdr);
  }
  MOZ_COUNT_DTOR(nsTArray_base);
}

template<class Alloc, class Copy>
const nsTArrayHeader*
nsTArray_base<Alloc, Copy>::GetAutoArrayBufferUnsafe(size_t aElemAlign) const
{
  // Assuming |this| points to an nsAutoArray, we want to get a pointer to
  // mAutoBuf.  So just cast |this| to nsAutoArray* and read &mAutoBuf!

  const void* autoBuf =
    &reinterpret_cast<const nsAutoArrayBase<nsTArray<uint32_t>, 1>*>(this)->mAutoBuf;

  // If we're on a 32-bit system and aElemAlign is 8, we need to adjust our
  // pointer to take into account the extra alignment in the auto array.

  static_assert(sizeof(void*) != 4 ||
                (MOZ_ALIGNOF(mozilla::AlignedElem<8>) == 8 &&
                 sizeof(nsAutoTArray<mozilla::AlignedElem<8>, 1>) ==
                   sizeof(void*) + sizeof(nsTArrayHeader) +
                   4 + sizeof(mozilla::AlignedElem<8>)),
                "auto array padding wasn't what we expected");

  // We don't support alignments greater than 8 bytes.
  MOZ_ASSERT(aElemAlign <= 4 || aElemAlign == 8,
             "unsupported alignment.");
  if (sizeof(void*) == 4 && aElemAlign == 8) {
    autoBuf = reinterpret_cast<const char*>(autoBuf) + 4;
  }

  return reinterpret_cast<const Header*>(autoBuf);
}

template<class Alloc, class Copy>
bool
nsTArray_base<Alloc, Copy>::UsesAutoArrayBuffer() const
{
  if (!mHdr->mIsAutoArray) {
    return false;
  }

  // This is nuts.  If we were sane, we'd pass aElemAlign as a parameter to
  // this function.  Unfortunately this function is called in nsTArray_base's
  // destructor, at which point we don't know elem_type's alignment.
  //
  // Since nsAutoTArray always contains an nsTArrayHeader,
  // GetAutoArrayBuffer(8) will always point inside the auto array object,
  // even if it doesn't point at the beginning of the header.
  //
  // Note that this means that we can't store elements with alignment 16 in an
  // nsTArray, because GetAutoArrayBuffer(16) could lie outside the memory
  // owned by this nsAutoTArray.  We statically assert that elem_type's
  // alignment is 8 bytes or less in nsAutoArrayBase.

  static_assert(sizeof(nsTArrayHeader) > 4,
                "see comment above");

#ifdef DEBUG
  ptrdiff_t diff = reinterpret_cast<const char*>(GetAutoArrayBuffer(8)) -
                   reinterpret_cast<const char*>(GetAutoArrayBuffer(4));
  MOZ_ASSERT(diff >= 0 && diff <= 4,
             "GetAutoArrayBuffer doesn't do what we expect.");
#endif
# 103 "../../dist/include/nsTArray-inl.h"

  return mHdr == GetAutoArrayBuffer(4) || mHdr == GetAutoArrayBuffer(8);
}

// defined in nsTArray.cpp
bool IsTwiceTheRequiredBytesRepresentableAsUint32(size_t aCapacity,
                                                  size_t aElemSize);

template<class Alloc, class Copy>
typename Alloc::ResultTypeProxy
nsTArray_base<Alloc, Copy>::EnsureCapacity(size_type aCapacity,
                                           size_type aElemSize)
{
  // This should be the most common case so test this first
  if (aCapacity <= mHdr->mCapacity) {
    return Alloc::SuccessResult();
  }

  // If the requested memory allocation exceeds size_type(-1)/2, then
  // our doubling algorithm may not be able to allocate it.
  // Additionally, if it exceeds uint32_t(-1) then we couldn't fit in the
  // Header::mCapacity member. Just bail out in cases like that.  We don't want
  // to be allocating 2 GB+ arrays anyway.
  if (!IsTwiceTheRequiredBytesRepresentableAsUint32(aCapacity, aElemSize)) {
    Alloc::SizeTooBig((size_t)aCapacity * aElemSize);
    return Alloc::FailureResult();
  }

  size_t reqSize = sizeof(Header) + aCapacity * aElemSize;

  if (mHdr == EmptyHdr()) {
    // Malloc() new data
    Header* header = static_cast<Header*>(Alloc::Malloc(reqSize));
    if (!header) {
      return Alloc::FailureResult();
    }
    header->mLength = 0;
    header->mCapacity = aCapacity;
    header->mIsAutoArray = 0;
    mHdr = header;

    return Alloc::SuccessResult();
  }

  // We increase our capacity so that the allocated buffer grows exponentially,
  // which gives us amortized O(1) appending. Below the threshold, we use
  // powers-of-two. Above the threshold, we grow by at least 1.125, rounding up
  // to the nearest MiB.
  const size_t slowGrowthThreshold = 8 * 1024 * 1024;

  size_t bytesToAlloc;
  if (reqSize >= slowGrowthThreshold) {
    size_t currSize = sizeof(Header) + Capacity() * aElemSize;
    size_t minNewSize = currSize + (currSize >> 3); // multiply by 1.125
    bytesToAlloc = reqSize > minNewSize ? reqSize : minNewSize;

    // Round up to the next multiple of MiB.
    const size_t MiB = 1 << 20;
    bytesToAlloc = MiB * ((bytesToAlloc + MiB - 1) / MiB);
  } else {
    // Round up to the next power of two.
    bytesToAlloc = mozilla::RoundUpPow2(reqSize);
  }

  Header* header;
  if (UsesAutoArrayBuffer() || !Copy::allowRealloc) {
    // Malloc() and copy
    header = static_cast<Header*>(Alloc::Malloc(bytesToAlloc));
    if (!header) {
      return Alloc::FailureResult();
    }

    Copy::CopyHeaderAndElements(header, mHdr, Length(), aElemSize);

    if (!UsesAutoArrayBuffer()) {
      Alloc::Free(mHdr);
    }
  } else {
    // Realloc() existing data
    header = static_cast<Header*>(Alloc::Realloc(mHdr, bytesToAlloc));
    if (!header) {
      return Alloc::FailureResult();
    }
  }

  // How many elements can we fit in bytesToAlloc?
  size_t newCapacity = (bytesToAlloc - sizeof(Header)) / aElemSize;
  MOZ_ASSERT(newCapacity >= aCapacity, "Didn't enlarge the array enough!");
  header->mCapacity = newCapacity;

  mHdr = header;

  return Alloc::SuccessResult();
}

template<class Alloc, class Copy>
void
nsTArray_base<Alloc, Copy>::ShrinkCapacity(size_type aElemSize,
                                           size_t aElemAlign)
{
  if (mHdr == EmptyHdr() || UsesAutoArrayBuffer()) {
    return;
  }

  if (mHdr->mLength >= mHdr->mCapacity) { // should never be greater than...
    return;
  }

  size_type length = Length();

  if (IsAutoArray() && GetAutoArrayBuffer(aElemAlign)->mCapacity >= length) {
    Header* header = GetAutoArrayBuffer(aElemAlign);

    // Copy data, but don't copy the header to avoid overwriting mCapacity
    header->mLength = length;
    Copy::CopyElements(header + 1, mHdr + 1, length, aElemSize);

    Alloc::Free(mHdr);
    mHdr = header;
    return;
  }

  if (length == 0) {
    MOZ_ASSERT(!IsAutoArray(), "autoarray should have fit 0 elements");
    Alloc::Free(mHdr);
    mHdr = EmptyHdr();
    return;
  }

  size_type size = sizeof(Header) + length * aElemSize;
  void* ptr = Alloc::Realloc(mHdr, size);
  if (!ptr) {
    return;
  }
  mHdr = static_cast<Header*>(ptr);
  mHdr->mCapacity = length;
}

template<class Alloc, class Copy>
void
nsTArray_base<Alloc, Copy>::ShiftData(index_type aStart,
                                      size_type aOldLen, size_type aNewLen,
                                      size_type aElemSize, size_t aElemAlign)
{
  if (aOldLen == aNewLen) {
    return;
  }

  // Determine how many elements need to be shifted
  size_type num = mHdr->mLength - (aStart + aOldLen);

  // Compute the resulting length of the array
  mHdr->mLength += aNewLen - aOldLen;
  if (mHdr->mLength == 0) {
    ShrinkCapacity(aElemSize, aElemAlign);
  } else {
    // Maybe nothing needs to be shifted
    if (num == 0) {
      return;
    }
    // Perform shift (change units to bytes first)
    aStart *= aElemSize;
    aNewLen *= aElemSize;
    aOldLen *= aElemSize;
    char* base = reinterpret_cast<char*>(mHdr + 1) + aStart;
    Copy::MoveElements(base + aNewLen, base + aOldLen, num, aElemSize);
  }
}

template<class Alloc, class Copy>
bool
nsTArray_base<Alloc, Copy>::InsertSlotsAt(index_type aIndex, size_type aCount,
                                          size_type aElemSize,
                                          size_t aElemAlign)
{
  MOZ_ASSERT(aIndex <= Length(), "Bogus insertion index");
  size_type newLen = Length() + aCount;

  EnsureCapacity(newLen, aElemSize);

  // Check for out of memory conditions
  if (Capacity() < newLen) {
    return false;
  }

  // Move the existing elements as needed.  Note that this will
  // change our mLength, so no need to call IncrementLength.
  ShiftData(aIndex, 0, aCount, aElemSize, aElemAlign);

  return true;
}

// nsTArray_base::IsAutoArrayRestorer is an RAII class which takes
// |nsTArray_base &array| in its constructor.  When it's destructed, it ensures
// that
//
//   * array.mIsAutoArray has the same value as it did when we started, and
//   * if array has an auto buffer and mHdr would otherwise point to sEmptyHdr,
//     array.mHdr points to array's auto buffer.

template<class Alloc, class Copy>
nsTArray_base<Alloc, Copy>::IsAutoArrayRestorer::IsAutoArrayRestorer(
      nsTArray_base<Alloc, Copy>& aArray,
      size_t aElemAlign)
  : mArray(aArray)
  , mElemAlign(aElemAlign)
  , mIsAuto(aArray.IsAutoArray())
{
}

template<class Alloc, class Copy>
nsTArray_base<Alloc, Copy>::IsAutoArrayRestorer::~IsAutoArrayRestorer()
{
  // Careful: We don't want to set mIsAutoArray = 1 on sEmptyHdr.
  if (mIsAuto && mArray.mHdr == mArray.EmptyHdr()) {
    // Call GetAutoArrayBufferUnsafe() because GetAutoArrayBuffer() asserts
    // that mHdr->mIsAutoArray is true, which surely isn't the case here.
    mArray.mHdr = mArray.GetAutoArrayBufferUnsafe(mElemAlign);
    mArray.mHdr->mLength = 0;
  } else if (mArray.mHdr != mArray.EmptyHdr()) {
    mArray.mHdr->mIsAutoArray = mIsAuto;
  }
}

template<class Alloc, class Copy>
template<class Allocator>
typename Alloc::ResultTypeProxy
nsTArray_base<Alloc, Copy>::SwapArrayElements(nsTArray_base<Allocator,
                                                            Copy>& aOther,
                                              size_type aElemSize,
                                              size_t aElemAlign)
{

  // EnsureNotUsingAutoArrayBuffer will set mHdr = sEmptyHdr even if we have an
  // auto buffer.  We need to point mHdr back to our auto buffer before we
  // return, otherwise we'll forget that we have an auto buffer at all!

  return Alloc::SuccessResult();
}

template<class Alloc, class Copy>
bool
nsTArray_base<Alloc, Copy>::EnsureNotUsingAutoArrayBuffer(size_type aElemSize)
{
  if (UsesAutoArrayBuffer()) {

    // If you call this on a 0-length array, we'll set that array's mHdr to
    // sEmptyHdr, in flagrant violation of the nsAutoTArray invariants.  It's
    // up to you to set it back!  (If you don't, the nsAutoTArray will forget
    // that it has an auto buffer.)
    if (Length() == 0) {
      mHdr = EmptyHdr();
      return true;
    }

    size_type size = sizeof(Header) + Length() * aElemSize;

    Header* header = static_cast<Header*>(Alloc::Malloc(size));
    if (!header) {
      return false;
    }

    Copy::CopyHeaderAndElements(header, mHdr, Length(), aElemSize);
    header->mCapacity = Length();
    mHdr = header;
  }

  return true;
}
# 2102 "../../dist/include/nsTArray.h" 2

#endif  // nsTArray_h__
# 2104 "../../dist/include/nsTArray.h"
# 12 "../../dist/include/nsTObserverArray.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionNoteChild.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/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
 */

class nsTObserverArray_base
{
public:
  typedef size_t index_type;
  typedef size_t size_type;
  typedef ptrdiff_t diff_type;

protected:
  class Iterator_base
  {
  protected:
    friend class nsTObserverArray_base;

    

    // The current position of the iterator. Its exact meaning differs
    // depending on iterator. See nsTObserverArray<T>::ForwardIterator.
    index_type mPosition;

    // The next iterator currently iterating the same array
    Iterator_base* mNext;
  };

  nsTObserverArray_base() : mIterators(nullptr) {}

  ~nsTObserverArray_base()
  {
    NS_ASSERTION(mIterators == nullptr, "iterators outlasting array");
  }

  /**
   * Adjusts iterators after an element has been inserted or removed
   * from the array.
   * @param aModPos     Position where elements were added or removed.
   * @param aAdjustment -1 if an element was removed, 1 if an element was
   *                    added.
   */
  void AdjustIterators(index_type aModPos, diff_type aAdjustment);

  /**
   * Clears iterators when the array is destroyed.
   */
  ;

  mutable Iterator_base* mIterators;
};

template<class T, size_t N>
class nsAutoTObserverArray : protected nsTObserverArray_base
{
public:
  typedef T           elem_type;
  typedef nsTArray<T> array_type;

  nsAutoTObserverArray() {}

  //
  // Accessor methods
  //
  

  // Compact the array to minimize the memory it uses
  

  // Returns the number of bytes on the heap taken up by this object, not
  // including sizeof(*this).
  

  //
  // Iterators
  //

  // Base class for iterators. Do not use this directly.
  class Iterator : public Iterator_base
  {
  protected:
    friend class nsAutoTObserverArray;
    typedef nsAutoTObserverArray<T, N> array_type;

    

    

    // The array we're iterating
    array_type& mArray;
  };

  // Iterates the array forward from beginning to end. mPosition points
  // to the element that will be returned on next call to GetNext.
  // Elements:
  // - prepended to the array during iteration *will not* be traversed
  // - appended during iteration *will* be traversed
  // - removed during iteration *will not* be traversed.
  // @see EndLimitedIterator
  class ForwardIterator : protected Iterator
  {
  public:
    typedef nsAutoTObserverArray<T, N> array_type;
    typedef Iterator                   base_type;

    

    

    

    // Returns true if there are more elements to iterate.
    // This must precede a call to GetNext(). If false is
    // returned, GetNext() must not be called.
    

    // Returns the next element and steps one step. This must
    // be preceded by a call to HasMore().
    // @return The next observer.
    
  };

  // EndLimitedIterator works like ForwardIterator, but will not iterate new
  // observers appended to the array after the iterator was created.
  class EndLimitedIterator : protected ForwardIterator
  {
  public:
    typedef nsAutoTObserverArray<T, N> array_type;
  };

protected:
  nsAutoTArray<T, N> mArray;
};

template<class T>
class nsTObserverArray : public nsAutoTObserverArray<T, 0>
{
public:
  typedef nsAutoTObserverArray<T, 0>       base_type;
  typedef nsTObserverArray_base::size_type size_type;

  //
  // Initialization methods
  //

  nsTObserverArray() {}

  // Initialize this array and pre-allocate some number of elements.
  
};





// XXXbz I wish I didn't have to pass in the observer type, but I
// don't see a way to get it out of array_.
// Note that this macro only works if the array holds pointers to XPCOM objects.
#define NS_OBSERVER_ARRAY_NOTIFY_XPCOM_OBSERVERS(array_, obstype_, func_, params_) \
  PR_BEGIN_MACRO                                                             \
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef pldhash_h___
#define pldhash_h___
/*
 * Double hashing, a la Knuth 6.
 */
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h" // for MOZ_ALWAYS_INLINE
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/pldhash.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/fallible.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/pldhash.h"
#endif
# 21 "../../dist/include/pldhash.h"

#if defined(__GNUC__) && defined(__i386__)
#define PL_DHASH_FASTCALL __attribute__ ((regparm (3),stdcall))
#elif defined(XP_WIN)
# 25 "../../dist/include/pldhash.h"
#define PL_DHASH_FASTCALL __fastcall
#else
# 27 "../../dist/include/pldhash.h"
#define PL_DHASH_FASTCALL
#endif
# 29 "../../dist/include/pldhash.h"

/*
 * Table capacity limit; do not exceed.  The max capacity used to be 1<<23 but
 * that occasionally that wasn't enough.  Making it much bigger than 1<<26
 * probably isn't worthwhile -- tables that big are kind of ridiculous.  Also,
 * the growth operation will (deliberately) fail if |capacity * mEntrySize|
 * overflows a uint32_t, and mEntrySize is always at least 8 bytes.
 */
#define PL_DHASH_MAX_CAPACITY           ((uint32_t)1 << 26)

#define PL_DHASH_MIN_CAPACITY           8

/*
 * Making this half of the max capacity ensures it'll fit. Nobody should need
 * an initial length anywhere nearly this large, anyway.
 */
#define PL_DHASH_MAX_INITIAL_LENGTH     (PL_DHASH_MAX_CAPACITY / 2)

/* This gives a default initial capacity of 8. */
#define PL_DHASH_DEFAULT_INITIAL_LENGTH 4

/*
 * Multiplicative hash uses an unsigned 32 bit integer and the golden ratio,
 * expressed as a fixed-point 32-bit fraction.
 */
#define PL_DHASH_BITS           32
#define PL_DHASH_GOLDEN_RATIO   0x9E3779B9U

typedef uint32_t PLDHashNumber;

class PLDHashTable;
struct PLDHashTableOps;

/*
 * Table entry header structure.
 *
 * In order to allow in-line allocation of key and value, we do not declare
 * either here.  Instead, the API uses const void *key as a formal parameter.
 * The key need not be stored in the entry; it may be part of the value, but
 * need not be stored at all.
 *
 * Callback types are defined below and grouped into the PLDHashTableOps
 * structure, for single static initialization per hash table sub-type.
 *
 * Each hash table sub-type should make its entry type a subclass of
 * PLDHashEntryHdr. The mKeyHash member contains the result of multiplying the
 * hash code returned from the hashKey callback (see below) by
 * PL_DHASH_GOLDEN_RATIO, then constraining the result to avoid the magic 0 and
 * 1 values. The stored mKeyHash value is table size invariant, and it is
 * maintained automatically -- users need never access it.
 */
struct PLDHashEntryHdr
{
private:
  friend class PLDHashTable;

  PLDHashNumber mKeyHash;
};

/*
 * These are the codes returned by PLDHashEnumerator functions, which control
 * PL_DHashTableEnumerate's behavior.
 */
enum PLDHashOperator
{
  PL_DHASH_NEXT = 0,          /* enumerator says continue */
  PL_DHASH_STOP = 1,          /* enumerator says stop */
  PL_DHASH_REMOVE = 2         /* enumerator says remove */
};

/*
 * Enumerate entries in table using etor:
 *
 *   count = PL_DHashTableEnumerate(table, etor, arg);
 * you want to remove entries, but for some reason you do not want mEntryStore
 * to be shrunk or compressed, you can call PL_DHashTableRawRemove safely on
 * the entry being enumerated, rather than returning PL_DHASH_REMOVE.
 */
typedef PLDHashOperator (*PLDHashEnumerator)(PLDHashTable* aTable,
                                             PLDHashEntryHdr* aHdr,
                                             uint32_t aNumber, void* aArg);

typedef size_t (*PLDHashSizeOfEntryExcludingThisFun)(
  PLDHashEntryHdr* aHdr, mozilla::MallocSizeOf aMallocSizeOf, void* aArg);

/*
 * A PLDHashTable is currently 8 words (without the PL_DHASHMETER overhead)
 * on most architectures, and may be allocated on the stack or within another
 * structure or class (see below for the Init and Finish functions to use).
 *
 * No entry storage is allocated until the first element is added. This means
 * that empty hash tables are cheap, which is good because they are common.
 *
 * There used to be a long, math-heavy comment here about the merits of
 * double hashing vs. chaining; it was removed in bug 1058335. In short, double
 * hashing is more space-efficient unless the element size gets large (in which
 * case you should keep using double hashing but switch to using pointer
 * elements). Also, with double hashing, you can't safely hold an entry pointer
 * and use it after an ADD or REMOVE operation, unless you sample
 * aTable->mGeneration before adding or removing, and compare the sample after,
 * dereferencing the entry pointer only if aTable->mGeneration has not changed.
 */
class PLDHashTable
{
private:
  const PLDHashTableOps* mOps;        /* Virtual operations; see below. */
  int16_t             mHashShift;     /* multiplicative hash shift */
  /*
   * |mRecursionLevel| is only used in debug builds, but is present in opt
   * builds to avoid binary compatibility problems when mixing DEBUG and
   * non-DEBUG components.  (Actually, even if it were removed,
   * sizeof(PLDHashTable) wouldn't change, due to struct padding.) Make it
   * protected to suppress -Wunused-private-field warnings in opt builds.
   */
protected:
  mutable uint16_t    mRecursionLevel;/* used to detect unsafe re-entry */
private:
  uint32_t            mEntrySize;     /* number of bytes in an entry */
  uint32_t            mEntryCount;    /* number of entries in table */
  uint32_t            mRemovedCount;  /* removed entry sentinels in table */
  uint32_t            mGeneration;    /* entry storage generation number */
  char*               mEntryStore;    /* entry storage; allocated lazily */
#ifdef PL_DHASHMETER
  struct PLDHashStats
  {
    uint32_t        mSearches;      /* total number of table searches */
    uint32_t        mSteps;         /* hash chain links traversed */
#endif
# 204 "../../dist/include/pldhash.h"

public:
  // The most important thing here is that we zero |mOps| because it's used to
  // determine if Init() has been called. (The use of MOZ_CONSTEXPR means all
  // the other members must be initialized too.)
  MOZ_CONSTEXPR 

  bool IsInitialized() const { return !!mOps; }

  // These should be used rarely.
  
  

  /*
   * Size in entries (gross, not net of free and removed sentinels) for table.
   * This can be zero if no elements have been added yet, in which case the
   * entry storage will not have yet been allocated.
   */
  

  
  uint32_t EntryCount() const { return mEntryCount; }
  uint32_t Generation() const { return mGeneration; }

  ;

  ;

  ;
  ;
};

/*
 * Compute the hash code for a given key to be looked up, added, or removed
 * from aTable.  A hash code may have any PLDHashNumber value.
 */
typedef PLDHashNumber (*PLDHashHashKey)(PLDHashTable* aTable,
                                        const void* aKey);

/*
 * Compare the key identifying aEntry in aTable with the provided key parameter.
 * Return true if keys match, false otherwise.
 */
typedef bool (*PLDHashMatchEntry)(PLDHashTable* aTable,
                                  const PLDHashEntryHdr* aEntry,
                                  const void* aKey);

/*
 * Copy the data starting at aFrom to the new entry storage at aTo. Do not add
 * reference counts for any strong references in the entry, however, as this
 * is a "move" operation: the old entry storage at from will be freed without
 * any reference-decrementing callback shortly.
 */
typedef void (*PLDHashMoveEntry)(PLDHashTable* aTable,
                                 const PLDHashEntryHdr* aFrom,
                                 PLDHashEntryHdr* aTo);

/*
 * Clear the entry and drop any strong references it holds.  This callback is
 * invoked by PL_DHashTableRemove(), but only if the given key is found in the
 * table.
 */
typedef void (*PLDHashClearEntry)(PLDHashTable* aTable,
                                  PLDHashEntryHdr* aEntry);

/*
 * Initialize a new entry, apart from mKeyHash.  This function is called when
 * PL_DHashTableAdd finds no existing entry for the given key, and must add a
 * new one.  At that point, aEntry->mKeyHash is not set yet, to avoid claiming
 * the last free entry in a severely overloaded table.
 */
typedef void (*PLDHashInitEntry)(PLDHashEntryHdr* aEntry, const void* aKey);

/*
 * Finally, the "vtable" structure for PLDHashTable.  The first four hooks
 * must be provided by implementations; they're called unconditionally by the
 * generic pldhash.c code.  Hooks after these may be null.
 *
 */
struct PLDHashTableOps
{
  /* Mandatory hooks.  All implementations must provide these. */
  PLDHashHashKey      hashKey;
  PLDHashMatchEntry   matchEntry;
  PLDHashMoveEntry    moveEntry;
  PLDHashClearEntry   clearEntry;

  /* Optional hooks start here.  If null, these are not called. */
  PLDHashInitEntry    initEntry;
};

/*
 * Default implementations for the above mOps.
 */

;

/* A minimal entry is a subclass of PLDHashEntryHdr and has void key pointer. */
struct PLDHashEntryStub : public PLDHashEntryHdr
{
  const void* key;
};

;

;

;

void
PL_DHashMoveEntryStub(PLDHashTable* aTable,
                      const PLDHashEntryHdr* aFrom,
                      PLDHashEntryHdr* aTo);

;

;

/*
 * If you use PLDHashEntryStub or a subclass of it as your entry struct, and
 * if your entries move via memcpy and clear via memset(0), you can use these
 * stub operations.
 */
;

/*
 * However, because entry storage is allocated lazily, this initial capacity
 * won't be relevant until the first element is added; prior to that the
 * capacity will be zero.
 *
 * This function will crash if |aEntrySize| and/or |aLength| are too large.
 */
void PL_DHashTableInit(
  PLDHashTable* aTable, const PLDHashTableOps* aOps,
  uint32_t aEntrySize, uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH);

/*
 * Initialize aTable. This is the same as PL_DHashTableInit, except that it
 * returns a boolean indicating success, rather than crashing on failure.
 */
MOZ_WARN_UNUSED_RESULT bool PL_DHashTableInit(
  PLDHashTable* aTable, const PLDHashTableOps* aOps,
  uint32_t aEntrySize, const mozilla::fallible_t&,
  uint32_t aLength = PL_DHASH_DEFAULT_INITIAL_LENGTH);

/*
 * Free |aTable|'s entry storage (via aTable->mOps->freeTable). Use this
 * function to destroy a PLDHashTable that is allocated on the stack or in
 * static memory and was created via PL_DHashTableInit().
 */
void PL_DHashTableFinish(PLDHashTable* aTable);

/*
 * To search for a key in |table|, call:
 *
 *  entry = PL_DHashTableSearch(table, key);
 *
 * If |entry| is non-null, |key| was found.  If |entry| is null, key was not
 * found.
 */
PLDHashEntryHdr* PL_DHASH_FASTCALL
PL_DHashTableSearch(PLDHashTable* aTable, const void* aKey);

/*
 * To add an entry identified by key to table, call:
 *
 *  entry = PL_DHashTableAdd(table, key, mozilla::fallible);
 *
 * If entry is null upon return, then the table is severely overloaded and
 * memory can't be allocated for entry storage.
 *
 * Otherwise, aEntry->mKeyHash has been set so that
 * PLDHashTable::EntryIsFree(entry) is false, and it is up to the caller to
 * initialize the key and value parts of the entry sub-type, if they have not
size_t PL_DHashTableSizeOfExcludingThis(
  const PLDHashTable* aTable,
  PLDHashSizeOfEntryExcludingThisFun aSizeOfEntryExcludingThis,
  mozilla::MallocSizeOf aMallocSizeOf, void* aArg = nullptr);

/**
 * Like PL_DHashTableSizeOfExcludingThis, but includes sizeof(*this).
 */
size_t PL_DHashTableSizeOfIncludingThis(
  const PLDHashTable* aTable,
  PLDHashSizeOfEntryExcludingThisFun aSizeOfEntryExcludingThis,
  mozilla::MallocSizeOf aMallocSizeOf, void* aArg = nullptr);

#ifdef DEBUG
/**
 * Mark a table as immutable for the remainder of its lifetime.  This
 * changes the implementation from ASSERTing one set of invariants to
 * ASSERTing a different set.
 *
 * When a table is NOT marked as immutable, the table implementation
 * asserts that the table is not mutated from its own callbacks.  It
 * assumes the caller protects the table from being accessed on multiple
 * threads simultaneously.
 *
 * When the table is marked as immutable, the re-entry assertions will
 * no longer trigger erroneously due to multi-threaded access.  Instead,
 * mutations will cause assertions.
 */
void PL_DHashMarkTableImmutable(PLDHashTable* aTable);
#endif
# 580 "../../dist/include/pldhash.h"

#ifdef PL_DHASHMETER
void PL_DHashTableDumpMeter(PLDHashTable* aTable,
                            PLDHashEnumerator aDump, FILE* aFp);
#endif
# 585 "../../dist/include/pldhash.h"

#endif /* pldhash_h___ */
# 587 "../../dist/include/pldhash.h"
# 12 "../../dist/include/nsTHashtable.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsTHashtable.h"
#if 0 /* expanded by -frewrite-includes */

#if defined(MOZ_VALGRIND)
# 36 "../../dist/include/mozilla/MemoryChecking.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 38 "../../dist/include/mozilla/MemoryChecking.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Types.h"
#endif /* expanded by -frewrite-includes */
# 39 "../../dist/include/mozilla/MemoryChecking.h"

#ifdef _MSC_VER
// In clang-cl based ASAN, we link against the memory poisoning functions
// statically.
#define MOZ_ASAN_VISIBILITY
#else
# 45 "../../dist/include/mozilla/MemoryChecking.h"
#define MOZ_ASAN_VISIBILITY MOZ_EXPORT
#endif
# 47 "../../dist/include/mozilla/MemoryChecking.h"

extern "C" {
/* These definitions are usually provided through the
 * sanitizer/asan_interface.h header installed by ASan.
 */
void MOZ_ASAN_VISIBILITY
__asan_poison_memory_region(void const volatile *addr, size_t size);
void MOZ_ASAN_VISIBILITY
__asan_unpoison_memory_region(void const volatile *addr, size_t size);

#define MOZ_MAKE_MEM_NOACCESS(addr, size) \
  __asan_poison_memory_region((addr), (size))
#endif // defined(MOZ_ASAN)
# 127 "../../dist/include/mozilla/MemoryChecking.h"


#endif /* mozilla_MemoryChecking_h */
# 130 "../../dist/include/mozilla/MemoryChecking.h"
# 15 "../../dist/include/nsTHashtable.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsTHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsTHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/fallible.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsTHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/PodOperations.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsTHashtable.h"

#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsTHashtable.h"

// helper function for nsTHashtable::Clear()
PLDHashOperator PL_DHashStubEnumRemove(PLDHashTable* aTable,
                                       PLDHashEntryHdr* aEntry,
                                       uint32_t aOrdinal,
                                       void* aUserArg);


/**
 * 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
 *   }</pre>
 *
 * @see nsInterfaceHashtable
 * @see nsDataHashtable
 * @see nsClassHashtable
 * @author "Benjamin Smedberg <bsmedberg@covad.net>"
 */

template<class EntryType>
class nsTHashtable
{
  typedef mozilla::fallible_t fallible_t;

public:
  // Separate constructors instead of default aInitLength parameter since
  // otherwise the default no-arg constructor isn't found.
  nsTHashtable() { Init(PL_DHASH_DEFAULT_INITIAL_LENGTH); }
  explicit nsTHashtable(uint32_t aInitLength) { Init(aInitLength); }

  /**
   * destructor, cleans up and deallocates
   */
  ~nsTHashtable();

  nsTHashtable(nsTHashtable<EntryType>&& aOther);

  /**
   * Return the generation number for the table. This increments whenever
   * the table data items are moved.
   */
  uint32_t GetGeneration() const { return mTable.Generation(); }

  /**
   * KeyType is typedef'ed for ease of use.
   */
  typedef typename EntryType::KeyType KeyType;

  /**
   * KeyTypePointer is typedef'ed for ease of use.
   */
  typedef typename EntryType::KeyTypePointer KeyTypePointer;

  /**
   * Return the number of entries in the table.
   * @return    number of entries
   */
  uint32_t Count() const { return mTable.EntryCount(); }

  /**
   * Get the entry associated with a key.
   * @param     aKey the key to retrieve
   * @return    pointer to the entry class, if the key exists; nullptr if the
   *            key doesn't exist
   */
  EntryType* GetEntry(KeyType aKey) const
  {
    NS_ASSERTION(mTable.IsInitialized(),
                 "nsTHashtable was not initialized properly.");

    return static_cast<EntryType*>(
      PL_DHashTableSearch(const_cast<PLDHashTable*>(&mTable),
                          EntryType::KeyToPointer(aKey)));
  }

  /**
   * Return true if an entry for the given key exists, false otherwise.
   * @param     aKey the key to retrieve
   * @return    true if the key exists, false if the key doesn't exist
   */
  bool Contains(KeyType aKey) const { return !!GetEntry(aKey); }

  /**
   * Get the entry associated with a key, or create a new entry,
   * @param     aKey the key to retrieve
   * @return    pointer to the entry class retreived; nullptr only if memory
                can't be allocated
   */
  EntryType* PutEntry(KeyType aKey)
  {
    NS_ASSERTION(mTable.IsInitialized(),
                 "nsTHashtable was not initialized properly.");

    return static_cast<EntryType*>  // infallible add
      (PL_DHashTableAdd(&mTable, EntryType::KeyToPointer(aKey)));
  }

  EntryType* PutEntry(KeyType aKey, const fallible_t&) NS_WARN_UNUSED_RESULT
  {
    NS_ASSERTION(mTable.IsInitialized(),
                 "nsTHashtable was not initialized properly.");

    return static_cast<EntryType*>
      (PL_DHashTableAdd(&mTable, EntryType::KeyToPointer(aKey),
                        mozilla::fallible));
  }

  /**
   * Remove the entry associated with a key.
   * @param     aKey of the entry to remove
   */
  void RemoveEntry(KeyType aKey)
  {
    NS_ASSERTION(mTable.IsInitialized(),
                 "nsTHashtable was not initialized properly.");

    PL_DHashTableRemove(&mTable,
                        EntryType::KeyToPointer(aKey));
  }

  /**
   * Remove the entry associated with a key, but don't resize the hashtable.
   * This is a low-level method, and is not recommended unless you know what
   *            @link PLDHashOperator::PL_DHASH_NEXT PL_DHASH_NEXT @endlink ,
   *            @link PLDHashOperator::PL_DHASH_STOP PL_DHASH_STOP @endlink ,
   *            @link PLDHashOperator::PL_DHASH_REMOVE PL_DHASH_REMOVE @endlink
   */
  typedef PLDHashOperator (*Enumerator)(EntryType* aEntry, void* userArg);

  /**
   * Enumerate all the entries of the function.
   * @param     enumFunc the <code>Enumerator</code> function to call
   * @param     userArg a pointer to pass to the
   *            <code>Enumerator</code> function
   * @return    the number of entries actually enumerated
   */
  uint32_t EnumerateEntries(Enumerator aEnumFunc, void* aUserArg)
  {
    NS_ASSERTION(mTable.IsInitialized(),
                 "nsTHashtable was not initialized properly.");

    s_EnumArgs args = { aEnumFunc, aUserArg };
    return PL_DHashTableEnumerate(&mTable, s_EnumStub, &args);
  }

  /**
   * remove all entries, return hashtable to "pristine" state ;)
   */
  void Clear()
  {
    NS_ASSERTION(mTable.IsInitialized(),
                 "nsTHashtable was not initialized properly.");

    PL_DHashTableEnumerate(&mTable, PL_DHashStubEnumRemove, nullptr);
  }

  /**
   * client must provide a <code>SizeOfEntryExcludingThisFun</code> function for
   *   SizeOfExcludingThis.
   * @param     aEntry the entry being enumerated
   * @param     mallocSizeOf the function used to measure heap-allocated blocks
   * @param     arg passed unchanged from <code>SizeOf{In,Ex}cludingThis</code>
   * @return    summed size of the things pointed to by the entries
   */
  typedef size_t (*SizeOfEntryExcludingThisFun)(EntryType* aEntry,
                                                mozilla::MallocSizeOf aMallocSizeOf,
                                                void* aArg);

  /**
   * Measure the size of the table's entry storage, and if
   * |aSizeOfEntryExcludingThis| is non-nullptr, measure the size of things
  }

  /**
   * Swap the elements in this hashtable with the elements in aOther.
   */
  void SwapElements(nsTHashtable<EntryType>& aOther)
  {
    MOZ_ASSERT_IF(this->mTable.Ops() && aOther.mTable.Ops(),
                  this->mTable.Ops() == aOther.mTable.Ops());
    mozilla::Swap(this->mTable, aOther.mTable);
  }

#ifdef DEBUG
  /**
   * Mark the table as constant after initialization.
   *
   * This will prevent assertions when a read-only hash is accessed on multiple
   * threads without synchronization.
   */
  void MarkImmutable()
  {
    NS_ASSERTION(mTable.IsInitialized(),
                 "nsTHashtable was not initialized properly.");

    PL_DHashMarkTableImmutable(&mTable);
  }
#endif
# 324 "../../dist/include/nsTHashtable.h"

protected:
  PLDHashTable mTable;

  static const void* s_GetKey(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);

  static PLDHashNumber s_HashKey(PLDHashTable* aTable, const void* aKey);

  static bool s_MatchEntry(PLDHashTable* aTable, const PLDHashEntryHdr* aEntry,
                           const void* aKey);

  static void s_CopyEntry(PLDHashTable* aTable, const PLDHashEntryHdr* aFrom,
                          PLDHashEntryHdr* aTo);

  static void s_ClearEntry(PLDHashTable* aTable, PLDHashEntryHdr* aEntry);

  static void s_InitEntry(PLDHashEntryHdr* aEntry, const void* aKey);

  /**
   * passed internally during enumeration.  Allocated on the stack.
   *
   * @param userFunc the Enumerator function passed to
   *   EnumerateEntries by the client
   * @param userArg the userArg passed unaltered
   */
  struct s_EnumArgs
  {
    Enumerator userFunc;
    void* userArg;
  };

  static PLDHashOperator s_EnumStub(PLDHashTable* aTable,
                                    PLDHashEntryHdr* aEntry,
                                    uint32_t aNumber, void* aArg);

  /**
   * passed internally during sizeOf counting.  Allocated on the stack.
   *
   * @param userFunc the SizeOfEntryExcludingThisFun passed to
   *                 SizeOf{In,Ex}cludingThis by the client
   * @param userArg the userArg passed unaltered
   */
  struct s_SizeOfArgs
  {
    SizeOfEntryExcludingThisFun userFunc;
    void* userArg;
  };

  static size_t s_SizeOfStub(PLDHashEntryHdr* aEntry,
                             mozilla::MallocSizeOf aMallocSizeOf, void* aArg);

private:
  // copy constructor, not implemented
  nsTHashtable(nsTHashtable<EntryType>& aToCopy) = delete;

  /**
   * Initialize the table.
   * @param aInitLength the initial number of buckets in the hashtable
   */
  void Init(uint32_t aInitLength);

  /**
   * An implementation of SizeOfEntryExcludingThisFun that calls SizeOfExcludingThis()
   * on each entry.
   */
  static size_t BasicSizeOfEntryExcludingThisFun(EntryType* aEntry,
                                                 mozilla::MallocSizeOf aMallocSizeOf,
                                                 void*);

  // assignment operator, not implemented
  nsTHashtable<EntryType>& operator=(nsTHashtable<EntryType>& aToEqual) = delete;
};

//
// template definitions
//

template<class EntryType>
nsTHashtable<EntryType>::nsTHashtable(nsTHashtable<EntryType>&& aOther)
  : mTable(mozilla::Move(aOther.mTable))
{
  // aOther shouldn't touch mTable after this, because we've stolen the table's
  // pointers but not overwitten them.
  MOZ_MAKE_MEM_UNDEFINED(&aOther.mTable, sizeof(aOther.mTable));

  // Indicate that aOther is not initialized.  This will make its destructor a
  // nop, which is what we want.
  aOther.mTable.SetOps(nullptr);
}

template<class EntryType>
nsTHashtable<EntryType>::~nsTHashtable()
{
  if (mTable.IsInitialized()) {
    PL_DHashTableFinish(&mTable);
  }
}

template<class EntryType>
void
nsTHashtable<EntryType>::Init(uint32_t aInitLength)
{
  static const PLDHashTableOps sOps =
  {
    s_HashKey,
    s_MatchEntry,
    EntryType::ALLOW_MEMMOVE ? ::PL_DHashMoveEntryStub : s_CopyEntry,
    s_ClearEntry,
    s_InitEntry
  };

  PL_DHashTableInit(&mTable, &sOps, sizeof(EntryType), aInitLength);
}

// static
template<class EntryType>
size_t
nsTHashtable<EntryType>::BasicSizeOfEntryExcludingThisFun(EntryType* aEntry,
                                                          mozilla::MallocSizeOf aMallocSizeOf,
                                                          void*)
{
  return aEntry->SizeOfExcludingThis(aMallocSizeOf);
}

// static definitions

template<class EntryType>
PLDHashNumber
nsTHashtable<EntryType>::s_HashKey(PLDHashTable* aTable, const void* aKey)
{
  return EntryType::HashKey(reinterpret_cast<const KeyTypePointer>(aKey));
}

template<class EntryType>
bool
nsTHashtable<EntryType>::s_MatchEntry(PLDHashTable* aTable,
                                      const PLDHashEntryHdr* aEntry,
                                      const void* aKey)
{
  return ((const EntryType*)aEntry)->KeyEquals(
    reinterpret_cast<const KeyTypePointer>(aKey));
}

template<class EntryType>
void
nsTHashtable<EntryType>::s_CopyEntry(PLDHashTable* aTable,
                                     const PLDHashEntryHdr* aFrom,
                                     PLDHashEntryHdr* aTo)
{
  EntryType* fromEntry =
    const_cast<EntryType*>(reinterpret_cast<const EntryType*>(aFrom));

  new (aTo) EntryType(mozilla::Move(*fromEntry));

  fromEntry->~EntryType();
}

template<class EntryType>
void
nsTHashtable<EntryType>::s_ClearEntry(PLDHashTable* aTable,
                                      PLDHashEntryHdr* aEntry)
{
  static_cast<EntryType*>(aEntry)->~EntryType();
}

template<class EntryType>
void
nsTHashtable<EntryType>::s_InitEntry(PLDHashEntryHdr* aEntry,
                                     const void* aKey)
{
  new (aEntry) EntryType(reinterpret_cast<KeyTypePointer>(aKey));
}

template<class EntryType>
PLDHashOperator
nsTHashtable<EntryType>::s_EnumStub(PLDHashTable* aTable,
                                    PLDHashEntryHdr* aEntry,
                                    uint32_t aNumber,
                                    void* aArg)
{
  // dereferences the function-pointer to the user's enumeration function
  return (*reinterpret_cast<s_EnumArgs*>(aArg)->userFunc)(
    static_cast<EntryType*>(aEntry),
    reinterpret_cast<s_EnumArgs*>(aArg)->userArg);
}

template<class EntryType>
size_t
nsTHashtable<EntryType>::s_SizeOfStub(PLDHashEntryHdr* aEntry,
                                      mozilla::MallocSizeOf aMallocSizeOf,
                                      void* aArg)
{
  // dereferences the function-pointer to the user's enumeration function
  return (*reinterpret_cast<s_SizeOfArgs*>(aArg)->userFunc)(
    static_cast<EntryType*>(aEntry),
    aMallocSizeOf,
    reinterpret_cast<s_SizeOfArgs*>(aArg)->userArg);
}

class nsCycleCollectionTraversalCallback;

struct MOZ_STACK_CLASS nsTHashtableCCTraversalData
{
  nsTHashtableCCTraversalData(nsCycleCollectionTraversalCallback& aCallback,
                              const char* aName,
                              uint32_t aFlags)
    : mCallback(aCallback)
    , mName(aName)
    , mFlags(aFlags)
  {
  }

  nsCycleCollectionTraversalCallback& mCallback;
  const char* mName;
  uint32_t mFlags;
};

template<class EntryType>
PLDHashOperator
ImplCycleCollectionTraverse_EnumFunc(EntryType* aEntry, void* aUserData)
{
  auto userData = static_cast<nsTHashtableCCTraversalData*>(aUserData);

  ImplCycleCollectionTraverse(userData->mCallback,
                              *aEntry,
                              userData->mName,
                              userData->mFlags);
  return PL_DHASH_NEXT;
}

template<class EntryType>
inline void
ImplCycleCollectionUnlink(nsTHashtable<EntryType>& aField)
{
  aField.Clear();
}

template<class EntryType>
inline void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
                            nsTHashtable<EntryType>& aField,
                            const char* aName,
                            uint32_t aFlags = 0)
{
  nsTHashtableCCTraversalData userData(aCallback, aName, aFlags);

  aField.EnumerateEntries(ImplCycleCollectionTraverse_EnumFunc<EntryType>,
                          &userData);
}

#endif // nsTHashtable_h__
# 575 "../../dist/include/nsTHashtable.h"
# 20 "../../dist/include/nsRefreshDriver.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsClassHashtable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsClassHashtable.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsClassHashtable_h__
#define nsClassHashtable_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsClassHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsBaseHashtable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsBaseHashtable.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsBaseHashtable_h__
#define nsBaseHashtable_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsBaseHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsBaseHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTHashtable.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsBaseHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "prlock.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlock.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
** File:		prlock.h
** Description:	API to basic locking functions of NSPR.
**
**
** NSPR provides basic locking mechanisms for thread synchronization.  Locks 
** are lightweight resource contention controls that prevent multiple threads 
** from accessing something (code/data) simultaneously.
**/

#ifndef prlock_h___
#define prlock_h___

#if 0 /* expanded by -frewrite-includes */
#include "prtypes.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlock.h"

PR_BEGIN_EXTERN_C

/**********************************************************************/
/************************* TYPES AND CONSTANTS ************************/
/**********************************************************************/

/*
 * PRLock --
 *
 *     NSPR represents the lock as an opaque entity to the client of the
 *	   API.  All routines operate on a pointer to this opaque entity.
 */

typedef struct PRLock PRLock;

/**********************************************************************/
/****************************** FUNCTIONS *****************************/
/**********************************************************************/

/***********************************************************************
** FUNCTION:    PR_NewLock
** DESCRIPTION:
**  Returns a pointer to a newly created opaque lock object.
** INPUTS:      void
** OUTPUTS:     void
** RETURN:      PRLock*
**   If the lock can not be created because of resource constraints, NULL
**   is returned.
**  
***********************************************************************/
NSPR_API(PRLock*) PR_NewLock(void);

/***********************************************************************
** FUNCTION:    PR_DestroyLock
** DESCRIPTION:
**  Destroys a given opaque lock object.
** INPUTS:      PRLock *lock
**              Lock to be freed.
** OUTPUTS:     void
** RETURN:      None
***********************************************************************/
NSPR_API(void) PR_DestroyLock(PRLock *lock);

/***********************************************************************
** FUNCTION:    PR_Lock
** DESCRIPTION:
**  Lock a lock.
** INPUTS:      PRLock *lock
**              Lock to locked.
** OUTPUTS:     void
/***********************************************************************
** MACRO:    PR_ASSERT_CURRENT_THREAD_OWNS_LOCK
** DESCRIPTION:
**  If the current thread owns |lock|, this assertion is guaranteed to
**  succeed.  Otherwise, the behavior of this function is undefined.
** INPUTS:      PRLock *lock
**              Lock to assert ownership of.
** OUTPUTS:     void
** RETURN:      None
***********************************************************************/
#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
#define PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(/* PrLock* */ lock) \
    PR_AssertCurrentThreadOwnsLock(lock)
#else
# 101 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlock.h"
#define PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(/* PrLock* */ lock)
#endif
# 103 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlock.h"

/* Don't call this function directly. */
NSPR_API(void) PR_AssertCurrentThreadOwnsLock(PRLock *lock);

PR_END_EXTERN_C

#endif /* prlock_h___ */
# 110 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlock.h"
# 14 "../../dist/include/nsBaseHashtable.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsBaseHashtable.h"

template<class KeyClass, class DataType, class UserDataType>
class nsBaseHashtable; // forward declaration

/**
 * the private nsTHashtable::EntryType class used by nsBaseHashtable
 * @see nsTHashtable for the specification of this class
 * @see nsBaseHashtable for template parameters
 */
template<class KeyClass, class DataType>
class nsBaseHashtableET : public KeyClass
{
public:
  DataType mData;
  friend class nsTHashtable<nsBaseHashtableET<KeyClass, DataType>>;

private:
  typedef typename KeyClass::KeyType KeyType;
  typedef typename KeyClass::KeyTypePointer KeyTypePointer;

  explicit nsBaseHashtableET(KeyTypePointer aKey);
  nsBaseHashtableET(nsBaseHashtableET<KeyClass, DataType>&& aToMove);
  ~nsBaseHashtableET();
};

/**
 * templated hashtable for simple data types
 * This class manages simple data types that do not need construction or
 * destruction.
 *
 * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h
 *   for a complete specification.
 * @param DataType the datatype stored in the hashtable,
 *   for example, uint32_t or nsCOMPtr.  If UserDataType is not the same,
 *   DataType must implicitly cast to UserDataType
 * @param UserDataType the user sees, for example uint32_t or nsISupports*
 */
template<class KeyClass, class DataType, class UserDataType>
class nsBaseHashtable
  : protected nsTHashtable<nsBaseHashtableET<KeyClass, DataType>>
{
  typedef mozilla::fallible_t fallible_t;

public:
  typedef typename KeyClass::KeyType KeyType;
  typedef nsBaseHashtableET<KeyClass, DataType> EntryType;

  using nsTHashtable<EntryType>::Contains;

  nsBaseHashtable() {}
  explicit nsBaseHashtable(uint32_t aInitLength)
    : nsTHashtable<EntryType>(aInitLength)
  {
  }

  /**
   * Return the number of entries in the table.
   * @return    number of entries
   */
  uint32_t Count() const { return nsTHashtable<EntryType>::Count(); }

  /**
   * retrieve the value for a key.
   * @param aKey the key to retreive
   * @param aData data associated with this key will be placed at this
      return 0;
    }

    return ent->mData;
  }

  /**
   * put a new value for the associated key
   * @param aKey the key to put
   * @param aData the new data
   * @return always true, unless memory allocation failed
   */
  void Put(KeyType aKey, const UserDataType& aData)
  {
    if (!Put(aKey, aData, mozilla::fallible)) {
      NS_ABORT_OOM(this->mTable.EntrySize() * this->mTable.EntryCount());
    }
  }

  NS_WARN_UNUSED_RESULT bool Put(KeyType aKey, const UserDataType& aData,
                                 const fallible_t&)
  {
    EntryType* ent = this->PutEntry(aKey);
    if (!ent) {
      return false;
    }

    ent->mData = aData;

    return true;
  }

  /**
   * remove the data for the associated key
   * @param aKey the key to remove from the hashtable
   */
  void Remove(KeyType aKey) { this->RemoveEntry(aKey); }

  /**
   * function type provided by the application for enumeration.
   * @param aKey the key being enumerated
   * @param aData data being enumerated
   * @param aUserArg passed unchanged from Enumerate
   * @return either
   *   @link PLDHashOperator::PL_DHASH_NEXT PL_DHASH_NEXT @endlink or
   *   @link PLDHashOperator::PL_DHASH_STOP PL_DHASH_STOP @endlink
   */
  typedef PLDHashOperator (*EnumReadFunction)(KeyType aKey,
                                              UserDataType aData,
                                              void* aUserArg);

  /**
   * enumerate entries in the hashtable, without allowing changes
   * @param aEnumFunc enumeration callback
   * @param aUserArg passed unchanged to the EnumReadFunction
   */
  uint32_t EnumerateRead(EnumReadFunction aEnumFunc, void* aUserArg) const
  {
    NS_ASSERTION(this->mTable.IsInitialized(),
                 "nsBaseHashtable was not initialized properly.");

    s_EnumReadArgs enumData = { aEnumFunc, aUserArg };
    return PL_DHashTableEnumerate(const_cast<PLDHashTable*>(&this->mTable),
                                  s_EnumReadStub,
                                  &enumData);
  }

  /**
   * function type provided by the application for enumeration.
   * @param aKey the key being enumerated
   * @param aData Reference to data being enumerated, may be altered. e.g. for
   *        nsInterfaceHashtable this is an nsCOMPtr reference...
   * @parm aUserArg passed unchanged from Enumerate
   * @return bitflag combination of
   *   @link PLDHashOperator::PL_DHASH_REMOVE @endlink,
   *   @link PLDHashOperator::PL_DHASH_NEXT PL_DHASH_NEXT @endlink, or
   *   @link PLDHashOperator::PL_DHASH_STOP PL_DHASH_STOP @endlink
   */
  typedef PLDHashOperator (*EnumFunction)(KeyType aKey,
                                          DataType& aData,
                                          void* aUserArg);

  /**
   * enumerate entries in the hashtable, allowing changes. This
   * functions write-locks the hashtable.
   * @param aEnumFunc enumeration callback
   * @param aUserArg passed unchanged to the EnumFunction
   */
  uint32_t Enumerate(EnumFunction aEnumFunc, void* aUserArg)
  {
    NS_ASSERTION(this->mTable.IsInitialized(),
                 "nsBaseHashtable was not initialized properly.");

    s_EnumArgs enumData = { aEnumFunc, aUserArg };
    return PL_DHashTableEnumerate(&this->mTable,
                                  s_EnumStub,
                                  &enumData);
  }

  /**
   * reset the hashtable, removing all entries
   */
  void Clear() { nsTHashtable<EntryType>::Clear(); }

  /**
   * client must provide a SizeOfEntryExcludingThisFun function for
   *   SizeOfExcludingThis.
   * @param     aKey the key being enumerated
   * @param     aData Reference to data being enumerated.
   * @param     aMallocSizeOf the function used to measure heap-allocated blocks
   * @param     aUserArg passed unchanged from SizeOf{In,Ex}cludingThis
   * @return    summed size of the things pointed to by the entries
   */
  typedef size_t
    (*SizeOfEntryExcludingThisFun)(KeyType aKey,
                                   const DataType& aData,
                                   mozilla::MallocSizeOf aMallocSizeOf,
                                   void* aUserArg);

  /**
   * Measure the size of the table's entry storage and the table itself.
   * If |aSizeOfEntryExcludingThis| is non-nullptr, measure the size of things
   * pointed to by entries.
   *
   * @param    aSizeOfEntryExcludingThis
   *           the <code>SizeOfEntryExcludingThisFun</code> function to call
   * @param    aMallocSizeOf the function used to meeasure heap-allocated blocks
   * @param    aUserArg a point to pass to the
   */
  struct s_EnumReadArgs
  {
    EnumReadFunction func;
    void* userArg;
  };

  static PLDHashOperator s_EnumReadStub(PLDHashTable* aTable,
                                        PLDHashEntryHdr* aHdr,
                                        uint32_t aNumber,
                                        void* aArg);

  struct s_EnumArgs
  {
    EnumFunction func;
    void* userArg;
  };

  static PLDHashOperator s_EnumStub(PLDHashTable* aTable,
                                    PLDHashEntryHdr* aHdr,
                                    uint32_t aNumber,
                                    void* aArg);

  struct s_SizeOfArgs
  {
    SizeOfEntryExcludingThisFun func;
    void* userArg;
  };

  static size_t s_SizeOfStub(PLDHashEntryHdr* aEntry,
                             mozilla::MallocSizeOf aMallocSizeOf,
                             void* aArg);
  const char* mName;
  uint32_t mFlags;

};

template<typename K, typename T>
PLDHashOperator
ImplCycleCollectionTraverse_EnumFunc(K aKey,
                                     T aData,
                                     void* aUserData)
{
}


//
// nsBaseHashtable definitions
//

template<class KeyClass, class DataType, class UserDataType>
PLDHashOperator
nsBaseHashtable<KeyClass, DataType, UserDataType>::s_EnumReadStub(
    PLDHashTable* aTable, PLDHashEntryHdr* aHdr, uint32_t aNumber, void* aArg)
{
  EntryType* ent = static_cast<EntryType*>(aHdr);
  s_EnumReadArgs* eargs = (s_EnumReadArgs*)aArg;

  PLDHashOperator res = (eargs->func)(ent->GetKey(), ent->mData, eargs->userArg);

  NS_ASSERTION(!(res & PL_DHASH_REMOVE),
               "PL_DHASH_REMOVE return during const enumeration; ignoring.");

  if (res & PL_DHASH_STOP) {
    return PL_DHASH_STOP;
  }

  return PL_DHASH_NEXT;
}

template<class KeyClass, class DataType, class UserDataType>
PLDHashOperator
nsBaseHashtable<KeyClass, DataType, UserDataType>::s_EnumStub(
    PLDHashTable* aTable, PLDHashEntryHdr* aHdr, uint32_t aNumber, void* aArg)
{
  EntryType* ent = static_cast<EntryType*>(aHdr);
  s_EnumArgs* eargs = (s_EnumArgs*)aArg;

  return (eargs->func)(ent->GetKey(), ent->mData, eargs->userArg);
}

template<class KeyClass, class DataType, class UserDataType>
size_t
nsBaseHashtable<KeyClass, DataType, UserDataType>::s_SizeOfStub(
    PLDHashEntryHdr* aHdr, mozilla::MallocSizeOf aMallocSizeOf, void* aArg)
{
  EntryType* ent = static_cast<EntryType*>(aHdr);
  s_SizeOfArgs* eargs = static_cast<s_SizeOfArgs*>(aArg);

  return (eargs->func)(ent->GetKey(), ent->mData, aMallocSizeOf, eargs->userArg);
}

#endif // nsBaseHashtable_h__
# 426 "../../dist/include/nsBaseHashtable.h"
# 12 "../../dist/include/nsClassHashtable.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsHashKeys.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsTHashKeys_h__
#define nsTHashKeys_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsID.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsHashKeys.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsHashKeys.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIHashable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIHashable.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIHashable.idl
 */

#ifndef __gen_nsIHashable_h__
#define __gen_nsIHashable_h__



#define NS_IHASHABLE_IID \
  {0x17e595fa, 0xb57a, 0x4933, \
    { 0xbd, 0x0f, 0xb1, 0x81, 0x2e, 0x8a, 0xb1, 0x88 }}

class NS_NO_VTABLE nsIHashable : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHASHABLE_IID)

  /* boolean equals (in nsIHashable aOther); */
  NS_IMETHOD Equals(nsIHashable *aOther, bool *_retval) = 0;

  /* readonly attribute unsigned long hashCode; */
  NS_IMETHOD GetHashCode(uint32_t *aHashCode) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIHashable, NS_IHASHABLE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIHASHABLE \
  NS_IMETHOD Equals(nsIHashable *aOther, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetHashCode(uint32_t *aHashCode) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIHASHABLE(_to) \
  NS_IMETHOD Equals(nsIHashable *aOther, bool *_retval) MOZ_OVERRIDE { return _to Equals(aOther, _retval); } \
  NS_IMETHOD GetHashCode(uint32_t *aHashCode) MOZ_OVERRIDE { return _to GetHashCode(aHashCode); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIHASHABLE(_to) \
  NS_IMETHOD Equals(nsIHashable *aOther, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Equals(aOther, _retval); } \
  NS_IMETHOD GetHashCode(uint32_t *aHashCode) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHashCode(aHashCode); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsHashable : public nsIHashable
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIHASHABLE

  nsHashable();

private:
#endif
# 101 "../../dist/include/nsIHashable.h"


#endif /* __gen_nsIHashable_h__ */
# 104 "../../dist/include/nsIHashable.h"
# 13 "../../dist/include/nsHashKeys.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsAutoPtr.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsAutoPtr_h
#define nsAutoPtr_h

#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCOMPtr.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsCOMPtr_h___
#define nsCOMPtr_h___

/*
 * Having problems?
 *
 * See the User Manual at:
 *   http://www.mozilla.org/projects/xpcom/nsCOMPtr.html
 *
 *
 * nsCOMPtr
 *   better than a raw pointer
 * for owning objects
 *                      -- scc
 */

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/AlreadyAddRefed.h"
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/nsCOMPtr.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h" // for |NS_ASSERTION|
#endif /* expanded by -frewrite-includes */
# 30 "../../dist/include/nsCOMPtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsUtils.h" // for |nsresult|, |NS_ADDREF|, |NS_GET_TEMPLATE_IID| et al
#endif /* expanded by -frewrite-includes */
# 31 "../../dist/include/nsCOMPtr.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionNoteChild.h"
#endif /* expanded by -frewrite-includes */
# 33 "../../dist/include/nsCOMPtr.h"


/*
 * WARNING: This file defines several macros for internal use only. These
 * macros begin with the prefix |NSCAP_|. Do not use these macros in your own
 * code. They are for internal use only for cross-platform compatibility, and
 * are subject to change without notice.
 */


#ifdef _MSC_VER
  // Under VC++, we win by inlining StartAssignment.
  #define NSCAP_FEATURE_INLINE_STARTASSIGNMENT

  // Also under VC++, at the highest warning level, we are overwhelmed with
  // warnings about (unused) inline functions being removed. This is to be
  // rules. Mark it with the may_alias attribute so that gcc 3.3 and higher
  // don't reorder instructions based on aliasing assumptions for
  // this variable.  Fortunately, gcc versions < 3.3 do not do any
  // optimizations that break nsCOMPtr.

  #define NS_MAY_ALIAS_PTR(t)    t*  __attribute__((__may_alias__))
#else
# 70 "../../dist/include/nsCOMPtr.h"
  #define NS_MAY_ALIAS_PTR(t)    t*
#endif
# 72 "../../dist/include/nsCOMPtr.h"

#if defined(NSCAP_DISABLE_DEBUG_PTR_TYPES)
  #define NSCAP_FEATURE_USE_BASE
#endif
# 76 "../../dist/include/nsCOMPtr.h"

/*
 * The following three macros (NSCAP_ADDREF, NSCAP_RELEASE, and
 * NSCAP_LOG_ASSIGNMENT) allow external clients the ability to add logging or
 * other interesting debug facilities. In fact, if you want |nsCOMPtr| to
 * participate in the standard logging facility, you provide
 * (e.g., in "nsISupportsImpl.h") suitable definitions
 *
 *   #define NSCAP_ADDREF(this, ptr)         NS_ADDREF(ptr)
 *   #define NSCAP_RELEASE(this, ptr)        NS_RELEASE(ptr)
 */

#ifndef NSCAP_ADDREF
  #define NSCAP_ADDREF(this, ptr)     (ptr)->AddRef()
#endif
# 91 "../../dist/include/nsCOMPtr.h"

#ifndef NSCAP_RELEASE
  #define NSCAP_RELEASE(this, ptr)    (ptr)->Release()
#endif
# 95 "../../dist/include/nsCOMPtr.h"

// Clients can define |NSCAP_LOG_ASSIGNMENT| to perform logging.
#ifdef NSCAP_LOG_ASSIGNMENT
  // Remember that |NSCAP_LOG_ASSIGNMENT| was defined by some client so that we
  // know to instantiate |~nsGetterAddRefs| in turn to note the external
  // assignment into the |nsCOMPtr|.
  #define NSCAP_LOG_EXTERNAL_ASSIGNMENT
#else
# 103 "../../dist/include/nsCOMPtr.h"
    // ...otherwise, just strip it out of the code
  #define NSCAP_LOG_ASSIGNMENT(this, ptr)
#endif
# 106 "../../dist/include/nsCOMPtr.h"

#ifndef NSCAP_LOG_RELEASE
  #define NSCAP_LOG_RELEASE(this, ptr)
#endif
# 110 "../../dist/include/nsCOMPtr.h"

namespace mozilla {

struct unused_t;

} // namespace mozilla

template<class T>
inline already_AddRefed<T>
dont_AddRef(T* aRawPtr)
{
  return already_AddRefed<T>(aRawPtr);
}

template<class T>
inline already_AddRefed<T>&&
dont_AddRef(already_AddRefed<T>&& aAlreadyAddRefedPtr)
{
  return mozilla::Move(aAlreadyAddRefedPtr);
}


/*
 * An nsCOMPtr_helper transforms commonly called getters into typesafe forms
 * that are more convenient to call, and more efficient to use with |nsCOMPtr|s.
 * Good candidates for helpers are |QueryInterface()|, |CreateInstance()|, etc.
 *
 * Here are the rules for a helper:
 *   - it implements |operator()| to produce an interface pointer
 *   - (except for its name) |operator()| is a valid [XP]COM `getter'
 *   - the interface pointer that it returns is already |AddRef()|ed (as from
 *     any good getter)
 *   - it matches the type requested with the supplied |nsIID| argument
 *   - its constructor provides an optional |nsresult*| that |operator()| can
 *     fill in with an error when it is executed
 *
 * See |class nsGetInterface| for an example.
 */
class MOZ_STACK_CLASS nsCOMPtr_helper
{
public:
  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const = 0;
};

/*
 * nsQueryInterface could have been implemented as an nsCOMPtr_helper to avoid
 * adding specialized machinery in nsCOMPtr, but do_QueryInterface is called
 * often enough that the codesize savings are big enough to warrant the
 * specialcasing.
 */
class MOZ_STACK_CLASS nsQueryInterface MOZ_FINAL
{
public:
  explicit
  nsQueryInterface(nsISupports* aRawPtr) : mRawPtr(aRawPtr) {}

  nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const;

private:
  nsISupports* MOZ_OWNING_REF mRawPtr;
};

class nsQueryInterfaceWithError
{
public:
  nsQueryInterfaceWithError(nsISupports* aRawPtr, nsresult* aError)
    : mRawPtr(aRawPtr)
    , mErrorPtr(aError)
  {
  }

  nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const;

private:
  nsISupports* MOZ_OWNING_REF mRawPtr;
  nsresult* mErrorPtr;
};

inline nsQueryInterface
do_QueryInterface(nsISupports* aRawPtr)
{
  return nsQueryInterface(aRawPtr);
}

inline nsQueryInterfaceWithError
do_QueryInterface(nsISupports* aRawPtr, nsresult* aError)
{
  return nsQueryInterfaceWithError(aRawPtr, aError);
}

template<class T>
inline void
do_QueryInterface(already_AddRefed<T>&)
{
  // This signature exists solely to _stop_ you from doing the bad thing.
  // Saying |do_QueryInterface()| on a pointer that is not otherwise owned by
  // someone else is an automatic leak. See bug 8221.
}

template<class T>
inline void
do_QueryInterface(already_AddRefed<T>&, nsresult*)
{
  // This signature exists solely to _stop_ you from doing the bad thing.
  // Saying |do_QueryInterface()| on a pointer that is not otherwise owned by
  // someone else is an automatic leak. See bug 8221.
}


////////////////////////////////////////////////////////////////////////////
// Using servicemanager with COMPtrs
class nsGetServiceByCID
{
public:
  explicit nsGetServiceByCID(const nsCID& aCID) : mCID(aCID) {}

  nsresult NS_FASTCALL operator()(const nsIID&, void**) const;

private:
  const nsCID& mCID;
};

class nsGetServiceByCIDWithError
{
public:
  nsGetServiceByCIDWithError(const nsCID& aCID, nsresult* aErrorPtr)
    : mCID(aCID)
    , mErrorPtr(aErrorPtr)
  {
  }

  nsresult NS_FASTCALL operator()(const nsIID&, void**) const;

private:
  const nsCID& mCID;
  nsresult* mErrorPtr;
};

class nsGetServiceByContractID
{
public:
  explicit nsGetServiceByContractID(const char* aContractID)
    : mContractID(aContractID)
  {
  }

  nsresult NS_FASTCALL operator()(const nsIID&, void**) const;

private:
  const char* mContractID;
};

class nsGetServiceByContractIDWithError
{
public:
  nsGetServiceByContractIDWithError(const char* aContractID, nsresult* aErrorPtr)
    : mContractID(aContractID)
    , mErrorPtr(aErrorPtr)
  {
  }

  nsresult NS_FASTCALL operator()(const nsIID&, void**) const;

private:
  const char* mContractID;
  nsresult* mErrorPtr;
};

/**
 * Factors implementation for all template versions of nsCOMPtr.
 *
 * Here's the way people normally do things like this:
 *
 *   template<class T> class Foo { ... };
 *   template<> class Foo<void*> { ... };
 *   template<class T> class Foo<T*> : private Foo<void*> { ... };
 */
class nsCOMPtr_base
{
public:
  explicit nsCOMPtr_base(nsISupports* aRawPtr = 0) : mRawPtr(aRawPtr) {}

  NS_CONSTRUCTOR_FASTCALL ~nsCOMPtr_base()
  {
    NSCAP_LOG_RELEASE(this, mRawPtr);
    if (mRawPtr) {
      NSCAP_RELEASE(this, mRawPtr);
    }
  }

  void NS_FASTCALL
  assign_with_AddRef(nsISupports*);
  void NS_FASTCALL
  assign_from_qi(const nsQueryInterface, const nsIID&);
  void NS_FASTCALL
  assign_from_qi_with_error(const nsQueryInterfaceWithError&, const nsIID&);
  void NS_FASTCALL
  assign_from_gs_cid(const nsGetServiceByCID, const nsIID&);
  void NS_FASTCALL
  assign_from_gs_cid_with_error(const nsGetServiceByCIDWithError&, const nsIID&);
  void NS_FASTCALL
  assign_from_gs_contractid(const nsGetServiceByContractID, const nsIID&);
  void NS_FASTCALL
  assign_from_gs_contractid_with_error(const nsGetServiceByContractIDWithError&,
                                       const nsIID&);
  void NS_FASTCALL
  assign_from_helper(const nsCOMPtr_helper&, const nsIID&);
  void** NS_FASTCALL
  begin_assignment();

protected:
  NS_MAY_ALIAS_PTR(nsISupports) MOZ_OWNING_REF mRawPtr;

  void assign_assuming_AddRef(nsISupports* aNewPtr)
  {
    // |AddRef()|ing the new value (before entering this function) before
    // |Release()|ing the old lets us safely ignore the self-assignment case.
    // We must, however, be careful only to |Release()| _after_ doing the
    // assignment, in case the |Release()| leads to our _own_ destruction,
    // which would, in turn, cause an incorrect second |Release()| of our old
    // pointer. Thank <waterson@netscape.com> for discovering this.
    nsISupports* oldPtr = mRawPtr;
    mRawPtr = aNewPtr;
    NSCAP_LOG_ASSIGNMENT(this, aNewPtr);
    NSCAP_LOG_RELEASE(this, oldPtr);
    if (oldPtr) {
      NSCAP_RELEASE(this, oldPtr);
    }
  }
};

// template<class T> class nsGetterAddRefs;

template<class T>
class nsCOMPtr MOZ_FINAL
#ifdef NSCAP_FEATURE_USE_BASE
  : private nsCOMPtr_base
#endif
# 348 "../../dist/include/nsCOMPtr.h"
{

#ifdef NSCAP_FEATURE_USE_BASE
  #define NSCAP_CTOR_BASE(x) nsCOMPtr_base(x)
#else
# 353 "../../dist/include/nsCOMPtr.h"
  #define NSCAP_CTOR_BASE(x) mRawPtr(x)

private:
  void assign_with_AddRef(nsISupports*);
  void assign_from_qi(const nsQueryInterface, const nsIID&);
  void assign_from_qi_with_error(const nsQueryInterfaceWithError&, const nsIID&);
  void assign_from_gs_cid(const nsGetServiceByCID, const nsIID&);
  void assign_from_gs_cid_with_error(const nsGetServiceByCIDWithError&,
                                     const nsIID&);
  void assign_from_gs_contractid(const nsGetServiceByContractID, const nsIID&);
  void assign_from_gs_contractid_with_error(
    const nsGetServiceByContractIDWithError&, const nsIID&);
  void assign_from_helper(const nsCOMPtr_helper&, const nsIID&);
  void** begin_assignment();

  void assign_assuming_AddRef(T* aNewPtr)
  {
    T* oldPtr = mRawPtr;
    mRawPtr = aNewPtr;
    NSCAP_LOG_ASSIGNMENT(this, aNewPtr);
    NSCAP_LOG_RELEASE(this, oldPtr);
    if (oldPtr) {
      NSCAP_RELEASE(this, oldPtr);
    }
  }

private:
  T* MOZ_OWNING_REF mRawPtr;
#endif
# 382 "../../dist/include/nsCOMPtr.h"

public:
  typedef T element_type;

#ifndef NSCAP_FEATURE_USE_BASE
  ~nsCOMPtr()
  {
    NSCAP_LOG_RELEASE(this, mRawPtr);
    if (mRawPtr) {
      NSCAP_RELEASE(this, mRawPtr);
    }
  }
#endif
# 395 "../../dist/include/nsCOMPtr.h"

#ifdef NSCAP_FEATURE_TEST_DONTQUERY_CASES
  void Assert_NoQueryNeeded()
  {
    if (mRawPtr) {
      nsCOMPtr<T> query_result(do_QueryInterface(mRawPtr));
      NS_ASSERTION(query_result.get() == mRawPtr, "QueryInterface needed");
    }
  }

  #define NSCAP_ASSERT_NO_QUERY_NEEDED() Assert_NoQueryNeeded();
#else
# 407 "../../dist/include/nsCOMPtr.h"
  #define NSCAP_ASSERT_NO_QUERY_NEEDED()
#endif
# 409 "../../dist/include/nsCOMPtr.h"


  // Constructors

  nsCOMPtr()
    : NSCAP_CTOR_BASE(0)
  {
    NSCAP_LOG_ASSIGNMENT(this, 0);
  }

  nsCOMPtr(const nsCOMPtr<T>& aSmartPtr)
    : NSCAP_CTOR_BASE(aSmartPtr.mRawPtr)
  {
    if (mRawPtr) {
      NSCAP_ADDREF(this, mRawPtr);
    }
    NSCAP_LOG_ASSIGNMENT(this, aSmartPtr.mRawPtr);
  }

  MOZ_IMPLICIT nsCOMPtr(T* aRawPtr)
    : NSCAP_CTOR_BASE(aRawPtr)
  {
    if (mRawPtr) {
      NSCAP_ADDREF(this, mRawPtr);
    }
    NSCAP_LOG_ASSIGNMENT(this, aRawPtr);
    NSCAP_ASSERT_NO_QUERY_NEEDED();
  }

  MOZ_IMPLICIT nsCOMPtr(already_AddRefed<T>& aSmartPtr)
    : NSCAP_CTOR_BASE(aSmartPtr.take())
  {
    NSCAP_LOG_ASSIGNMENT(this, mRawPtr);
    NSCAP_ASSERT_NO_QUERY_NEEDED();
  }

  // Construct from |otherComPtr.forget()|.
  MOZ_IMPLICIT nsCOMPtr(already_AddRefed<T>&& aSmartPtr)
    : NSCAP_CTOR_BASE(aSmartPtr.take())
  {
    NSCAP_LOG_ASSIGNMENT(this, mRawPtr);
    NSCAP_ASSERT_NO_QUERY_NEEDED();
  }

  // Construct from |already_AddRefed|.
  template<typename U>
  MOZ_IMPLICIT nsCOMPtr(already_AddRefed<U>& aSmartPtr)
    : NSCAP_CTOR_BASE(static_cast<T*>(aSmartPtr.take()))
  {
    // But make sure that U actually inherits from T.
    static_assert(mozilla::IsBaseOf<T, U>::value,
                  "U is not a subclass of T");
    NSCAP_LOG_ASSIGNMENT(this, static_cast<T*>(mRawPtr));
    NSCAP_ASSERT_NO_QUERY_NEEDED();
  }

  // Construct from |otherComPtr.forget()|.
  template<typename U>
  MOZ_IMPLICIT nsCOMPtr(already_AddRefed<U>&& aSmartPtr)
    : NSCAP_CTOR_BASE(static_cast<T*>(aSmartPtr.take()))
  {
    // But make sure that U actually inherits from T.
    static_assert(mozilla::IsBaseOf<T, U>::value,
                  "U is not a subclass of T");
    NSCAP_LOG_ASSIGNMENT(this, static_cast<T*>(mRawPtr));
    NSCAP_ASSERT_NO_QUERY_NEEDED();
  }

  // Construct from |do_QueryInterface(expr)|.
  MOZ_IMPLICIT nsCOMPtr(const nsQueryInterface aQI)
    : NSCAP_CTOR_BASE(0)
  {
    NSCAP_LOG_ASSIGNMENT(this, 0);
    assign_from_qi(aQI, NS_GET_TEMPLATE_IID(T));
  }

  // Construct from |do_QueryInterface(expr, &rv)|.
  MOZ_IMPLICIT nsCOMPtr(const nsQueryInterfaceWithError& aQI)
    : NSCAP_CTOR_BASE(0)
  {
    NSCAP_LOG_ASSIGNMENT(this, 0);
    assign_from_qi_with_error(aQI, NS_GET_TEMPLATE_IID(T));
  }

  // Construct from |do_GetService(cid_expr)|.
  MOZ_IMPLICIT nsCOMPtr(const nsGetServiceByCID aGS)
    : NSCAP_CTOR_BASE(0)
  {
    NSCAP_LOG_ASSIGNMENT(this, 0);
    assign_from_gs_cid(aGS, NS_GET_TEMPLATE_IID(T));
  }

  // Construct from |do_GetService(cid_expr, &rv)|.
  MOZ_IMPLICIT nsCOMPtr(const nsGetServiceByCIDWithError& aGS)
    : NSCAP_CTOR_BASE(0)
  {
    NSCAP_LOG_ASSIGNMENT(this, 0);
    assign_from_gs_cid_with_error(aGS, NS_GET_TEMPLATE_IID(T));
  }

  // Construct from |do_GetService(contractid_expr)|.
  MOZ_IMPLICIT nsCOMPtr(const nsGetServiceByContractID aGS)
    : NSCAP_CTOR_BASE(0)
  {
    NSCAP_LOG_ASSIGNMENT(this, 0);
    assign_from_gs_contractid(aGS, NS_GET_TEMPLATE_IID(T));
  }

  // Construct from |do_GetService(contractid_expr, &rv)|.
  MOZ_IMPLICIT nsCOMPtr(const nsGetServiceByContractIDWithError& aGS)
    : NSCAP_CTOR_BASE(0)
  {
    NSCAP_LOG_ASSIGNMENT(this, 0);
    assign_from_gs_contractid_with_error(aGS, NS_GET_TEMPLATE_IID(T));
  }

  // And finally, anything else we might need to construct from can exploit the
  // nsCOMPtr_helper facility.
  MOZ_IMPLICIT nsCOMPtr(const nsCOMPtr_helper& aHelper)
    : NSCAP_CTOR_BASE(0)
  {
  }

  // Assign from |otherComPtr.forget()|.
  template<typename U>
  nsCOMPtr<T>& operator=(already_AddRefed<U>&& aRhs)
  {
    // Make sure that U actually inherits from T
    static_assert(mozilla::IsBaseOf<T, U>::value,
                  "U is not a subclass of T");
    assign_assuming_AddRef(static_cast<T*>(aRhs.take()));
    NSCAP_ASSERT_NO_QUERY_NEEDED();
    return *this;
  }

  // Assign from |do_QueryInterface(expr)|.
  nsCOMPtr<T>& operator=(const nsQueryInterface aRhs)
  {
    assign_from_qi(aRhs, NS_GET_TEMPLATE_IID(T));
    return *this;
  }

  // Assign from |do_QueryInterface(expr, &rv)|.
  nsCOMPtr<T>& operator=(const nsQueryInterfaceWithError& aRhs)
  {
    assign_from_qi_with_error(aRhs, NS_GET_TEMPLATE_IID(T));
    return *this;
  }

  // Assign from |do_GetService(cid_expr)|.
  nsCOMPtr<T>& operator=(const nsGetServiceByCID aRhs)
  {
    return *this;
  }

  // Exchange ownership with |aRhs|; can save a pair of refcount operations.
  void swap(nsCOMPtr<T>& aRhs)
  {
#ifdef NSCAP_FEATURE_USE_BASE
    nsISupports* temp = aRhs.mRawPtr;
#else
# 632 "../../dist/include/nsCOMPtr.h"
    T* temp = aRhs.mRawPtr;
#endif
# 634 "../../dist/include/nsCOMPtr.h"
    NSCAP_LOG_ASSIGNMENT(&aRhs, mRawPtr);
    NSCAP_LOG_ASSIGNMENT(this, temp);
    NSCAP_LOG_RELEASE(this, mRawPtr);
    NSCAP_LOG_RELEASE(&aRhs, temp);
    aRhs.mRawPtr = mRawPtr;
    mRawPtr = temp;
    // |aRhs| maintains the same invariants, so we don't need to |NSCAP_ASSERT_NO_QUERY_NEEDED|
  }

  // Exchange ownership with |aRhs|; can save a pair of refcount operations.
  void swap(T*& aRhs)
  {
#ifdef NSCAP_FEATURE_USE_BASE
    nsISupports* temp = aRhs;
#else
# 649 "../../dist/include/nsCOMPtr.h"
    T* temp = aRhs;
#endif
# 651 "../../dist/include/nsCOMPtr.h"
    NSCAP_LOG_ASSIGNMENT(this, temp);
    NSCAP_LOG_RELEASE(this, mRawPtr);
    aRhs = reinterpret_cast<T*>(mRawPtr);
    mRawPtr = temp;
    NSCAP_ASSERT_NO_QUERY_NEEDED();
  }


  // Other pointer operators

  // Return the value of mRawPtr and null out mRawPtr. Useful for
  // already_AddRefed return values.
  already_AddRefed<T> forget()
  {
    T* temp = 0;
    swap(temp);
    return already_AddRefed<T>(temp);
  }

  // Set the target of aRhs to the value of mRawPtr and null out mRawPtr.
  // Useful to avoid unnecessary AddRef/Release pairs with "out" parameters
  // where aRhs bay be a T** or an I** where I is a base class of T.
  template<typename I>
  void forget(I** aRhs)
  {
    NS_ASSERTION(aRhs, "Null pointer passed to forget!");
    NSCAP_LOG_RELEASE(this, mRawPtr);
    *aRhs = get();
    mRawPtr = 0;
  }

  // Prefer the implicit conversion provided automatically by
  // |operator T*() const|. Use |get()| to resolve ambiguity or to get a
  // castable pointer.
  T* get() const { return reinterpret_cast<T*>(mRawPtr); }

  // Makes an nsCOMPtr act like its underlying raw pointer type whenever it is
  // used in a context where a raw pointer is expected. It is this operator
  // that makes an nsCOMPtr substitutable for a raw pointer.
  //
  // Prefer the implicit use of this operator to calling |get()|, except where
  // necessary to resolve ambiguity.
  operator T*() const { return get(); }

  T* operator->() const MOZ_NO_ADDREF_RELEASE_ON_RETURN
  {
    MOZ_ASSERT(mRawPtr != 0,
               "You can't dereference a NULL nsCOMPtr with operator->().");
    return get();
  }

  // These are not intended to be used by clients. See |address_of| below.
  nsCOMPtr<T>* get_address() { return this; }
  

public:
  

  T** StartAssignment()
  {
#ifndef NSCAP_FEATURE_INLINE_STARTASSIGNMENT
    return reinterpret_cast<T**>(begin_assignment());
#else
# 719 "../../dist/include/nsCOMPtr.h"
    assign_assuming_AddRef(0);
    return reinterpret_cast<T**>(&mRawPtr);
#endif
# 722 "../../dist/include/nsCOMPtr.h"
  }
};


/*
 * Specializing nsCOMPtr for nsISupports allows us to use nsCOMPtr<nsISupports>
 * the same way people use nsISupports* and void*, i.e., as a `catch-all'
 * pointing to any valid [XP]COM interface. Otherwise, an nsCOMPtr<nsISupports>
 * would only be able to point to the single [XP]COM-correct nsISupports
 * instance within an object; extra querying ensues. Clients need to be able to
 * pass around arbitrary interface pointers, without hassles, through
 * intermediary code that doesn't know the exact type.
 */
template<>
class nsCOMPtr<nsISupports>
  : private nsCOMPtr_base
{
public:
  typedef nsISupports element_type;

  // Constructors

  nsCOMPtr()
    : nsCOMPtr_base(0)
  {
    NSCAP_LOG_ASSIGNMENT(this, 0);
  }

  nsCOMPtr(const nsCOMPtr<nsISupports>& aSmartPtr)
    : nsCOMPtr_base(aSmartPtr.mRawPtr)
  {
    if (mRawPtr) {
      NSCAP_ADDREF(this, mRawPtr);
    }
    NSCAP_LOG_ASSIGNMENT(this, aSmartPtr.mRawPtr);
  }

  MOZ_IMPLICIT nsCOMPtr(nsISupports* aRawPtr)
    : nsCOMPtr_base(aRawPtr)
  {
    if (mRawPtr) {
      NSCAP_ADDREF(this, mRawPtr);
    }
    NSCAP_LOG_ASSIGNMENT(this, aRawPtr);
  }

  // Construct from |already_AddRefed|.
  MOZ_IMPLICIT 

  // Construct from |otherComPtr.forget()|.
  MOZ_IMPLICIT 

  // Construct from |do_QueryInterface(expr)|.
  MOZ_IMPLICIT nsCOMPtr(const nsQueryInterface aQI)
    : nsCOMPtr_base(0)
  {
    NSCAP_LOG_ASSIGNMENT(this, 0);
    assign_from_qi(aQI, NS_GET_IID(nsISupports));
  }

  // the |nsCOMPtr_helper| facility
  MOZ_IMPLICIT 


  // Assignment operators

  

  nsCOMPtr<nsISupports>& operator=(nsISupports* aRhs)
  {
    return *this;
  }

  // Assign from |do_GetService(contractid_expr)|.
  nsCOMPtr<nsISupports>& operator=(const nsGetServiceByContractID aRhs)
  {
    return *this;
  }

  // Exchange ownership with |aRhs|; can save a pair of refcount operations.
  void swap(nsCOMPtr<nsISupports>& aRhs)
  {
    nsISupports* temp = aRhs.mRawPtr;
    NSCAP_LOG_ASSIGNMENT(&aRhs, mRawPtr);
    NSCAP_LOG_ASSIGNMENT(this, temp);
    NSCAP_LOG_RELEASE(this, mRawPtr);
    NSCAP_LOG_RELEASE(&aRhs, temp);
    aRhs.mRawPtr = mRawPtr;
    mRawPtr = temp;
  }

  // Exchange ownership with |aRhs|; can save a pair of refcount operations.
  void swap(nsISupports*& aRhs)
  {
    nsISupports* temp = aRhs;
    NSCAP_LOG_ASSIGNMENT(this, temp);
    NSCAP_LOG_RELEASE(this, mRawPtr);
    aRhs = mRawPtr;
    mRawPtr = temp;
  }

  // Return the value of mRawPtr and null out mRawPtr. Useful for
  // already_AddRefed return values.
  already_AddRefed<nsISupports> forget()
  {
    nsISupports* temp = 0;
    swap(temp);
    return already_AddRefed<nsISupports>(temp);
  }

  // Set the target of aRhs to the value of mRawPtr and null out mRawPtr.
  // Useful to avoid unnecessary AddRef/Release pairs with "out"
  // parameters.
  void forget(nsISupports** aRhs)
  {
    NS_ASSERTION(aRhs, "Null pointer passed to forget!");
    *aRhs = 0;
    swap(*aRhs);
  }

  // Other pointer operators

  // Prefer the implicit conversion provided automatically by
  // |operator nsISupports*() const|. Use |get()| to resolve ambiguity or to
  // get a castable pointer.
  nsISupports* get() const { return reinterpret_cast<nsISupports*>(mRawPtr); }

  // Makes an nsCOMPtr act like its underlying raw pointer type whenever it is
  // used in a context where a raw pointer is expected. It is this operator
  // that makes an nsCOMPtr substitutable for a raw pointer.
  //
  // Prefer the implicit use of this operator to calling |get()|, except where
  // necessary to resolve ambiguity/
  operator nsISupports* () const { return get(); }

  nsISupports* operator->() const MOZ_NO_ADDREF_RELEASE_ON_RETURN
  {
    MOZ_ASSERT(mRawPtr != 0,
               "You can't dereference a NULL nsCOMPtr with operator->().");
    return get();
  }

  // These are not intended to be used by clients. See |address_of| below.
  nsCOMPtr<nsISupports>* get_address() { return this; }
  const nsCOMPtr<nsISupports>* get_address() const { return this; }

public:

  nsISupports& operator*() const
  {
    MOZ_ASSERT(mRawPtr != 0,
               "You can't dereference a NULL nsCOMPtr with operator*().");
    return *get();
  }

  nsISupports** StartAssignment()
  {
#ifndef NSCAP_FEATURE_INLINE_STARTASSIGNMENT
    return reinterpret_cast<nsISupports**>(begin_assignment());
#else
# 999 "../../dist/include/nsCOMPtr.h"
    assign_assuming_AddRef(0);
    return reinterpret_cast<nsISupports**>(&mRawPtr);
#endif
# 1002 "../../dist/include/nsCOMPtr.h"
  }
};

template<typename T>
inline void
ImplCycleCollectionUnlink(nsCOMPtr<T>& aField)
{
  aField = nullptr;
}

template<typename T>
inline void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
                            nsCOMPtr<T>& aField,
                            const char* aName,
                            uint32_t aFlags = 0)
{
  CycleCollectionNoteChild(aCallback, aField.get(), aName, aFlags);
}

#ifndef NSCAP_FEATURE_USE_BASE
template<class T>
void
nsCOMPtr<T>::assign_with_AddRef(nsISupports* aRawPtr)
{
  if (aRawPtr) {
    NSCAP_ADDREF(this, aRawPtr);
  }
  assign_assuming_AddRef(reinterpret_cast<T*>(aRawPtr));
}

template<class T>
void
nsCOMPtr<T>::assign_from_qi(const nsQueryInterface aQI, const nsIID& aIID)
{
  void* newRawPtr;
  if (NS_FAILED(aQI(aIID, &newRawPtr))) {
    newRawPtr = 0;
  }
  assign_assuming_AddRef(static_cast<T*>(newRawPtr));
}

template<class T>
void
nsCOMPtr<T>::assign_from_qi_with_error(const nsQueryInterfaceWithError& aQI,
                                       const nsIID& aIID)
{
  void* newRawPtr;
  if (NS_FAILED(aQI(aIID, &newRawPtr))) {
    newRawPtr = 0;
  }
  assign_assuming_AddRef(static_cast<T*>(newRawPtr));
}

template<class T>
void
nsCOMPtr<T>::assign_from_gs_cid(const nsGetServiceByCID aGS, const nsIID& aIID)
{
  void* newRawPtr;
  if (NS_FAILED(aGS(aIID, &newRawPtr))) {
    newRawPtr = 0;
  }
  assign_assuming_AddRef(static_cast<T*>(newRawPtr));
}

template<class T>
void
nsCOMPtr<T>::assign_from_gs_cid_with_error(const nsGetServiceByCIDWithError& aGS,
                                           const nsIID& aIID)
{
  void* newRawPtr;
}

template<class T>
void
nsCOMPtr<T>::assign_from_gs_contractid_with_error(
    const nsGetServiceByContractIDWithError& aGS, const nsIID& aIID)
{
  void* newRawPtr;
  if (NS_FAILED(aGS(aIID, &newRawPtr))) {
    newRawPtr = 0;
  }
  assign_assuming_AddRef(static_cast<T*>(newRawPtr));
}

template<class T>
void
nsCOMPtr<T>::assign_from_helper(const nsCOMPtr_helper& helper, const nsIID& aIID)
{
  void* newRawPtr;
  if (NS_FAILED(helper(aIID, &newRawPtr))) {
    newRawPtr = 0;
  }
  assign_assuming_AddRef(static_cast<T*>(newRawPtr));
}

template<class T>
void**
nsCOMPtr<T>::begin_assignment()
{
  assign_assuming_AddRef(0);
  union
  {
    T** mT;
    void** mVoid;
  } result;
  result.mT = &mRawPtr;
  return result.mVoid;
}
#endif
# 1128 "../../dist/include/nsCOMPtr.h"

template<class T>
inline nsCOMPtr<T>*
address_of(nsCOMPtr<T>& aPtr)
{
  return aPtr.get_address();
}

template<class T>
inline const nsCOMPtr<T>*
address_of(const nsCOMPtr<T>& aPtr)
{
  return aPtr.get_address();
}

/**
 * This class is designed to be used for anonymous temporary objects in the
 * argument list of calls that return COM interface pointers, e.g.,
 *
 *   nsCOMPtr<IFoo> fooP;
 *   ...->QueryInterface(iid, getter_AddRefs(fooP))
 *
 * DO NOT USE THIS TYPE DIRECTLY IN YOUR CODE. Use |getter_AddRefs()| instead.
 *
 * When initialized with a |nsCOMPtr|, as in the example above, it returns
 * a |void**|, a |T**|, or an |nsISupports**| as needed, that the outer call
 * (|QueryInterface| in this case) can fill in.
 *
 * This type should be a nested class inside |nsCOMPtr<T>|.
 */
template<class T>
class nsGetterAddRefs
{
public:
  explicit nsGetterAddRefs(nsCOMPtr<T>& aSmartPtr)
    : mTargetSmartPtr(aSmartPtr)
  {
  }

#if defined(NSCAP_FEATURE_TEST_DONTQUERY_CASES) || defined(NSCAP_LOG_EXTERNAL_ASSIGNMENT)
  ~nsGetterAddRefs()
  {
#ifdef NSCAP_LOG_EXTERNAL_ASSIGNMENT
    NSCAP_LOG_ASSIGNMENT(reinterpret_cast<void*>(address_of(mTargetSmartPtr)),
                         mTargetSmartPtr.get());
#endif
# 1174 "../../dist/include/nsCOMPtr.h"

#ifdef NSCAP_FEATURE_TEST_DONTQUERY_CASES
    mTargetSmartPtr.Assert_NoQueryNeeded();
#endif
# 1178 "../../dist/include/nsCOMPtr.h"
  }
#endif
# 1180 "../../dist/include/nsCOMPtr.h"

  operator void**()
  {
    return reinterpret_cast<void**>(mTargetSmartPtr.StartAssignment());
  }

  operator T**() { return mTargetSmartPtr.StartAssignment(); }
  T*& operator*() { return *(mTargetSmartPtr.StartAssignment()); }

private:
  nsCOMPtr<T>& mTargetSmartPtr;
};


template<>
class nsGetterAddRefs<nsISupports>
{

private:
  nsCOMPtr<nsISupports>& mTargetSmartPtr;
};

template<class T>
inline nsGetterAddRefs<T>
getter_AddRefs(nsCOMPtr<T>& aSmartPtr)
{
  return nsGetterAddRefs<T>(aSmartPtr);
}






template <class T>
class nsRefPtr
{
private:
  void
  assign_with_AddRef(T* aRawPtr)
  {
    if (aRawPtr) {
      aRawPtr->AddRef();
    }
    assign_assuming_AddRef(aRawPtr);
  }

  void**
  begin_assignment()
  {
    assign_assuming_AddRef(0);
    return reinterpret_cast<void**>(&mRawPtr);
  }

  void
  assign_assuming_AddRef(T* aNewPtr)
  {
    T* oldPtr = mRawPtr;
    mRawPtr = aNewPtr;
    if (oldPtr) {
      oldPtr->Release();
    }
  }

private:
  T* MOZ_OWNING_REF mRawPtr;

public:
  typedef T element_type;

  ~nsRefPtr()
  {
    if (mRawPtr) {
      mRawPtr->Release();
    }
  }

  // Constructors

  nsRefPtr()
    : mRawPtr(0)
    // default constructor
  {
  }

  nsRefPtr(const nsRefPtr<T>& aSmartPtr)
    : mRawPtr(aSmartPtr.mRawPtr)
    // copy-constructor
  {
    if (mRawPtr) {
      mRawPtr->AddRef();
    }
  }

  nsRefPtr(nsRefPtr<T>&& aRefPtr)
    : mRawPtr(aRefPtr.mRawPtr)
  {
    aRefPtr.mRawPtr = nullptr;
  }

  // construct from a raw pointer (of the right type)

  MOZ_IMPLICIT nsRefPtr(T* aRawPtr)
    : mRawPtr(aRawPtr)
  {
    if (mRawPtr) {
      mRawPtr->AddRef();
    }
  }

  template <typename I>
  nsRefPtr(already_AddRefed<I>& aSmartPtr)
    : mRawPtr(aSmartPtr.take())
    // construct from |already_AddRefed|
  {
  }

  template <typename I>
  nsRefPtr(already_AddRefed<I>&& aSmartPtr)
    : mRawPtr(aSmartPtr.take())
    // construct from |otherRefPtr.forget()|
  {
  }

  template <typename I>
  nsRefPtr(nsRefPtr<I>&& aSmartPtr)
    : mRawPtr(aSmartPtr.forget().take())
    // construct from |Move(nsRefPtr<SomeSubclassOfT>)|.
  {
  }

  MOZ_IMPLICIT nsRefPtr(const nsCOMPtr_helper& aHelper);

  // Assignment operators

  nsRefPtr<T>&
  operator=(const nsRefPtr<T>& aRhs)
  // copy assignment operator
  {
    assign_with_AddRef(aRhs.mRawPtr);
    return *this;
  }

  nsRefPtr<T>&
  operator=(T* aRhs)
  // assign from a raw pointer (of the right type)
  {
    assign_with_AddRef(aRhs);
    return *this;
  }

  template <typename I>
  nsRefPtr<T>&
  operator=(already_AddRefed<I>& aRhs)
  // assign from |already_AddRefed|
  {
    assign_assuming_AddRef(aRhs.take());
    return *this;
  }

  template <typename I>
  nsRefPtr<T>&
  operator=(already_AddRefed<I> && aRhs)
  // assign from |otherRefPtr.forget()|
  {
    assign_assuming_AddRef(aRhs.take());
    return *this;
  }

  nsRefPtr<T>& operator=(const nsCOMPtr_helper& aHelper);

  nsRefPtr<T>&
  operator=(nsRefPtr<T> && aRefPtr)
  {
    assign_assuming_AddRef(aRefPtr.mRawPtr);
    aRefPtr.mRawPtr = nullptr;
    return *this;
  }

  // Other pointer operators

  

  void
  swap(T*& aRhs)
  // ...exchange ownership with |aRhs|; can save a pair of refcount operations
  {
    T* temp = aRhs;
    aRhs = mRawPtr;
    mRawPtr = temp;
  }

  already_AddRefed<T>
  forget()
  // return the value of mRawPtr and null out mRawPtr. Useful for
  // already_AddRefed return values.
  {
    T* temp = 0;
    swap(temp);
    return already_AddRefed<T>(temp);
  }

  

  T*
  get() const
  /*
    Prefer the implicit conversion provided automatically by |operator T*() const|.
    Use |get()| to resolve ambiguity or to get a castable pointer.
  */
  {
    return const_cast<T*>(mRawPtr);
  }

  operator T*() const
  /*
    ...makes an |nsRefPtr| act like its underlying raw pointer type whenever it
    is used in a context where a raw pointer is expected.  It is this operator
    that makes an |nsRefPtr| substitutable for a raw pointer.

    Prefer the implicit use of this operator to calling |get()|, except where
    necessary to resolve ambiguity.
  */
  {
    return get();
  }

  T*
  operator->() const MOZ_NO_ADDREF_RELEASE_ON_RETURN
  {
    NS_PRECONDITION(mRawPtr != 0,
                    "You can't dereference a NULL nsRefPtr with operator->().");
    return get();
  }

  // This operator is needed for gcc <= 4.0.* and for Sun Studio; it
  // causes internal compiler errors for some MSVC versions.  (It's not
  // clear to me whether it should be needed.)
#ifndef _MSC_VER
  
#endif
# 253 "../../dist/include/nsRefPtr.h"

  

  

public:
  T&
  operator*() const
  {
    NS_PRECONDITION(mRawPtr != 0,
                    "You can't dereference a NULL nsRefPtr with operator*().");
    return *get();
  }

  T**
  StartAssignment()
  {
    assign_assuming_AddRef(0);
    return reinterpret_cast<T**>(&mRawPtr);
  }
};

template <class T>
nsRefPtr<T>::nsRefPtr(const nsCOMPtr_helper& aHelper)
{
  void* newRawPtr;
  if (NS_FAILED(aHelper(NS_GET_TEMPLATE_IID(T), &newRawPtr))) {
    newRawPtr = 0;
  }
  mRawPtr = static_cast<T*>(newRawPtr);
}

template <class T>
nsRefPtr<T>&
nsRefPtr<T>::operator=(const nsCOMPtr_helper& aHelper)
{
  void* newRawPtr;
  if (NS_FAILED(aHelper(NS_GET_TEMPLATE_IID(T), &newRawPtr))) {
    newRawPtr = 0;
  }
  assign_assuming_AddRef(static_cast<T*>(newRawPtr));
  return *this;
}

class nsCycleCollectionTraversalCallback;
template <typename T>
void
CycleCollectionNoteChild(nsCycleCollectionTraversalCallback& aCallback,
                         T* aChild, const char* aName, uint32_t aFlags);

template <typename T>
inline void
ImplCycleCollectionUnlink(nsRefPtr<T>& aField)
{
  aField = nullptr;
}

template <typename T>
inline void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
                            nsRefPtr<T>& aField,
                            const char* aName,
                            uint32_t aFlags = 0)
{
  CycleCollectionNoteChild(aCallback, aField.get(), aName, aFlags);
}





template <class T>
class nsRefPtrGetterAddRefs
/*
  ...

  This class is designed to be used for anonymous temporary objects in the
  argument list of calls that return COM interface pointers, e.g.,

    nsRefPtr<IFoo> fooP;
    ...->GetAddRefedPointer(getter_AddRefs(fooP))

  DO NOT USE THIS TYPE DIRECTLY IN YOUR CODE.  Use |getter_AddRefs()| instead.

  When initialized with a |nsRefPtr|, as in the example above, it returns
  a |void**|, a |T**|, or an |nsISupports**| as needed, that the
  outer call (|GetAddRefedPointer| in this case) can fill in.

  This type should be a nested class inside |nsRefPtr<T>|.
*/
{
public:
  explicit
  nsRefPtrGetterAddRefs(nsRefPtr<T>& aSmartPtr)
    : mTargetSmartPtr(aSmartPtr)
  {
    // nothing else to do
  }

  

  operator T**()
  {
    return mTargetSmartPtr.StartAssignment();
  }

  T*&
  operator*()
  {
    return *(mTargetSmartPtr.StartAssignment());
  }

private:
  nsRefPtr<T>& mTargetSmartPtr;
};

template <class T>
inline nsRefPtrGetterAddRefs<T>
getter_AddRefs(nsRefPtr<T>& aSmartPtr)
/*
  Used around a |nsRefPtr| when
  ...makes the class |nsRefPtrGetterAddRefs<T>| invisible.
*/
{
  return nsRefPtrGetterAddRefs<T>(aSmartPtr);
}


// Comparing two |nsRefPtr|s

template <class T, class U>
inline bool
operator==(const nsRefPtr<T>& aLhs, const nsRefPtr<U>& aRhs)
{
  return static_cast<const T*>(aLhs.get()) == static_cast<const U*>(aRhs.get());
}


template <class T, class U>
inline bool
operator!=(const nsRefPtr<T>& aLhs, const nsRefPtr<U>& aRhs)
{
  return static_cast<const T*>(aLhs.get()) != static_cast<const U*>(aRhs.get());
}


// Comparing an |nsRefPtr| to a raw pointer









template <class T, class U>
inline bool
operator==(const nsRefPtr<T>& aLhs, U* aRhs)
{
  return static_cast<const T*>(aLhs.get()) == const_cast<const U*>(aRhs);
}

template <class T, class U>
inline bool
operator==(U* aLhs, const nsRefPtr<T>& aRhs)
{
  return const_cast<const U*>(aLhs) == static_cast<const T*>(aRhs.get());
}

template <class T, class U>
inline bool
operator!=(const nsRefPtr<T>& aLhs, U* aRhs)
{
  return static_cast<const T*>(aLhs.get()) != const_cast<const U*>(aRhs);
}










/*****************************************************************************/

#endif // !defined(nsRefPtr_h)
# 531 "../../dist/include/nsRefPtr.h"
# 12 "../../dist/include/nsAutoPtr.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionNoteChild.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsAutoPtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsAutoPtr.h"

/*****************************************************************************/

// template <class T> class nsAutoPtrGetterTransfers;

template <class T>
class nsAutoPtr
{
private:
  void**
  begin_assignment()
  {
    assign(0);
    return reinterpret_cast<void**>(&mRawPtr);
  }

  void
  assign(T* aNewPtr)
  {
    T* oldPtr = mRawPtr;

    if (aNewPtr && aNewPtr == oldPtr) {
      NS_RUNTIMEABORT("Logic flaw in the caller");
    }

    mRawPtr = aNewPtr;
    delete oldPtr;
  }

  // |class Ptr| helps us prevent implicit "copy construction"
  // through |operator T*() const| from a |const nsAutoPtr<T>|
  // because two implicit conversions in a row aren't allowed.
  // It still allows assignment from T* through implicit conversion
  // from |T*| to |nsAutoPtr<T>::Ptr|
  class Ptr
  {
  public:
    MOZ_IMPLICIT Ptr(T* aPtr)
      : mPtr(aPtr)
    {
    }

    operator T*() const
    {
      return mPtr;
    }

  private:
    T* MOZ_NON_OWNING_REF mPtr;
  };

private:
  T* MOZ_OWNING_REF mRawPtr;

public:
  typedef T element_type;

  ~nsAutoPtr()
  {
    delete mRawPtr;
  }

  // Constructors

  nsAutoPtr()
    : mRawPtr(0)
    // default constructor
  {
  }

  MOZ_IMPLICIT nsAutoPtr(Ptr aRawPtr)
  {
  }

  // Assignment operators

  nsAutoPtr<T>&
  operator=(T* aRhs)
  // assign from a raw pointer (of the right type)
  {
    assign(aRhs);
    return *this;
  }

  

  

  // Other pointer operators

  T*
  get() const
  /*
    Prefer the implicit conversion provided automatically by
    |operator T*() const|.  Use |get()| _only_ to resolve
    ambiguity.
  */
  {
    return mRawPtr;
  }

  operator T*() const
  /*
    ...makes an |nsAutoPtr| act like its underlying raw pointer
    type  whenever it is used in a context where a raw pointer
    is expected.  It is this operator that makes an |nsAutoPtr|
    substitutable for a raw pointer.

    Prefer the implicit use of this operator to calling |get()|,
    except where necessary to resolve ambiguity.
  */
  {
    return get();
  }

  T*
  forget()
  {
    T* temp = mRawPtr;
    mRawPtr = 0;
    return temp;
  }

  T*
  operator->() const
  {
    NS_PRECONDITION(mRawPtr != 0,
                    "You can't dereference a NULL nsAutoPtr with operator->().");
    return get();
  }

  // This operator is needed for gcc <= 4.0.* and for Sun Studio; it
  // causes internal compiler errors for some MSVC versions.  (It's not
  // clear to me whether it should be needed.)
#ifndef _MSC_VER
  
#endif
# 184 "../../dist/include/nsAutoPtr.h"

  

  

public:
  T&
  operator*() const
  {
    NS_PRECONDITION(mRawPtr != 0,
                    "You can't dereference a NULL nsAutoPtr with operator*().");
    return *get();
  }

  T**
  StartAssignment()
  {
#ifndef NSCAP_FEATURE_INLINE_STARTASSIGNMENT
    return reinterpret_cast<T**>(begin_assignment());
#else
# 216 "../../dist/include/nsAutoPtr.h"
    assign(0);
    return reinterpret_cast<T**>(&mRawPtr);
#endif
# 219 "../../dist/include/nsAutoPtr.h"
  }
};





template <class T>
class nsAutoPtrGetterTransfers
/*
  ...

  This class is designed to be used for anonymous temporary objects in the
  argument list of calls that return COM interface pointers, e.g.,

    nsAutoPtr<IFoo> fooP;
    ...->GetTransferedPointer(getter_Transfers(fooP))

  DO NOT USE THIS TYPE DIRECTLY IN YOUR CODE.  Use |getter_Transfers()| instead.

  When initialized with a |nsAutoPtr|, as in the example above, it returns
  a |void**|, a |T**|, or an |nsISupports**| as needed, that the
  outer call (|GetTransferedPointer| in this case) can fill in.

  This type should be a nested class inside |nsAutoPtr<T>|.
*/
{
public:
  explicit
  nsAutoPtrGetterTransfers(nsAutoPtr<T>& aSmartPtr)
    : mTargetSmartPtr(aSmartPtr)
  {
    // nothing else to do
  }

  

  operator T**()
  {
    return mTargetSmartPtr.StartAssignment();
  }

  

private:
  nsAutoPtr<T>& mTargetSmartPtr;
};

template <class T>
inline nsAutoPtrGetterTransfers<T>
getter_Transfers(nsAutoPtr<T>& aSmartPtr)
/*
  Used around a |nsAutoPtr| when
  ...makes the class |nsAutoPtrGetterTransfers<T>| invisible.
*/
{
  return nsAutoPtrGetterTransfers<T>(aSmartPtr);
}



// Comparing two |nsAutoPtr|s







// Comparing an |nsAutoPtr| to a raw pointer







// template <class T> class nsAutoArrayPtrGetterTransfers;

template <class T>
class nsAutoArrayPtr
{
private:
  void**
  begin_assignment()
  {
    assign(0);
    return reinterpret_cast<void**>(&mRawPtr);
  }

  void
  assign(T* aNewPtr)
  {
    T* oldPtr = mRawPtr;
    mRawPtr = aNewPtr;
    delete [] oldPtr;
  }

private:
  T* MOZ_OWNING_REF mRawPtr;

public:
  typedef T element_type;

  ~nsAutoArrayPtr()
  {
    delete [] mRawPtr;
  }

  // Constructors

  nsAutoArrayPtr()
    : mRawPtr(0)
    // default constructor
  {
  }

  MOZ_IMPLICIT 

  


  // Assignment operators

  

  

  // Other pointer operators

  T*
  get() const
  /*
    Prefer the implicit conversion provided automatically by
    |operator T*() const|.  Use |get()| _only_ to resolve
    ambiguity.
  */
  {
    return mRawPtr;
  }

  operator T*() const
  /*
    ...makes an |nsAutoArrayPtr| act like its underlying raw pointer
    type  whenever it is used in a context where a raw pointer
    is expected.  It is this operator that makes an |nsAutoArrayPtr|
    substitutable for a raw pointer.

    Prefer the implicit use of this operator to calling |get()|,
    except where necessary to resolve ambiguity.
  */
  {
    return get();
  }

  

  

  

  

public:
  

  T**
  StartAssignment()
  {
#ifndef NSCAP_FEATURE_INLINE_STARTASSIGNMENT
    return reinterpret_cast<T**>(begin_assignment());
#else
# 556 "../../dist/include/nsAutoPtr.h"
    assign(0);
    return reinterpret_cast<T**>(&mRawPtr);
#endif
# 559 "../../dist/include/nsAutoPtr.h"
  }

  

  
};





template <class T>
class nsAutoArrayPtrGetterTransfers
/*
  ...

  This class is designed to be used for anonymous temporary objects in the
  argument list of calls that return COM interface pointers, e.g.,

    nsAutoArrayPtr<IFoo> fooP;
    ...->GetTransferedPointer(getter_Transfers(fooP))

  DO NOT USE THIS TYPE DIRECTLY IN YOUR CODE.  Use |getter_Transfers()| instead.

  When initialized with a |nsAutoArrayPtr|, as in the example above, it returns
  a |void**|, a |T**|, or an |nsISupports**| as needed, that the
  outer call (|GetTransferedPointer| in this case) can fill in.

  This type should be a nested class inside |nsAutoArrayPtr<T>|.
*/
{
public:
  explicit
  nsAutoArrayPtrGetterTransfers(nsAutoArrayPtr<T>& aSmartPtr)
    : mTargetSmartPtr(aSmartPtr)
  {
    // nothing else to do
  }

  

  operator T**()
  {
    return mTargetSmartPtr.StartAssignment();
  }

  

private:
  nsAutoArrayPtr<T>& mTargetSmartPtr;
};

template <class T>
inline nsAutoArrayPtrGetterTransfers<T>
getter_Transfers(nsAutoArrayPtr<T>& aSmartPtr)
/*
  Used around a |nsAutoArrayPtr| when
  ...makes the class |nsAutoArrayPtrGetterTransfers<T>| invisible.
*/
{
  return nsAutoArrayPtrGetterTransfers<T>(aSmartPtr);
}



// Comparing two |nsAutoArrayPtr|s




template<class T>
class MOZ_STACK_CLASS nsQueryObjectWithError : public nsCOMPtr_helper
{
public:
  

  
private:
  T* MOZ_NON_OWNING_REF mRawPtr;
  nsresult* mErrorPtr;
};









template<class T>
inline nsQueryObjectWithError<T>
do_QueryObject(nsCOMPtr<T>& aRawPtr, nsresult* aErrorPtr)
{
  return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
}

template<class T>
inline nsQueryObjectWithError<T>
do_QueryObject(nsRefPtr<T>& aRawPtr, nsresult* aErrorPtr)
{
  return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
}

/*****************************************************************************/

#endif // !defined(nsAutoPtr_h)
# 853 "../../dist/include/nsAutoPtr.h"
# 14 "../../dist/include/nsHashKeys.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsHashKeys.h"
#if 0 /* expanded by -frewrite-includes */
#include "pldhash.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsHashKeys.h"
#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsHashKeys.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStringGlue.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

/**
 * @file nsStringGlue.h
 * This header exists solely to #include the proper internal/frozen string
 * headers, depending on whether MOZILLA_INTERNAL_API is defined.
 */

#ifndef nsStringGlue_h__
#define nsStringGlue_h__

#ifdef MOZILLA_INTERNAL_API
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsString_h___
#define nsString_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsString.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsSubstring.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsSubstring.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsSubstring_h___
#define nsSubstring_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsAString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsAString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#ifndef nsAString_h___
#define nsAString_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsStringFwd.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStringFwd.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* nsStringFwd.h --- forward declarations for string classes */

#ifndef nsStringFwd_h___
#define nsStringFwd_h___

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsStringFwd.h"

#ifndef MOZILLA_INTERNAL_API
#error Internal string headers are not available from external-linkage code.
#endif
# 17 "../../dist/include/nsStringFwd.h"

/**
 * double-byte (char16_t) string types
 */

class nsAString;
class nsSubstringTuple;
class nsString;
class nsAutoString;
class nsDependentString;
class nsDependentSubstring;
class nsPromiseFlatString;
class nsStringComparator;
class nsDefaultStringComparator;
class nsXPIDLString;


/**
 * single-byte (char) string types
 */

class nsACString;
class nsCSubstringTuple;
class nsCString;
class nsAutoCString;
class nsDependentCString;
class nsDependentCSubstring;
class nsPromiseFlatCString;
class nsCStringComparator;
class nsDefaultCStringComparator;
class nsXPIDLCString;


/**
 * typedefs for backwards compatibility
 */

typedef nsAString             nsSubstring;
typedef nsACString            nsCSubstring;

typedef nsString              nsAFlatString;
typedef nsSubstring           nsASingleFragmentString;

typedef nsCString             nsAFlatCString;
typedef nsCSubstring          nsASingleFragmentCString;



template <class CharT>
class nsReadingIterator
{
public:
  typedef nsReadingIterator<CharT>    self_type;
  typedef ptrdiff_t                   difference_type;
  typedef CharT                       value_type;
  typedef const CharT*                pointer;
  typedef const CharT&                reference;

private:
  friend class nsAString;
  friend class nsACString;

  // unfortunately, the API for nsReadingIterator requires that the
  // iterator know its start and end positions.  this was needed when
  // we supported multi-fragment strings, but now it is really just
  // extra baggage.  we should remove mStart and mEnd at some point.

  const CharT* mStart;
  const CharT* mEnd;
  const CharT* mPosition;

public:
  nsReadingIterator()
  {
  }
  // nsReadingIterator( const nsReadingIterator<CharT>& );                    // auto-generated copy-constructor OK
  // nsReadingIterator<CharT>& operator=( const nsReadingIterator<CharT>& );  // auto-generated copy-assignment operator OK

  inline void normalize_forward()
  {
  }
  inline void normalize_backward()
  {
  }

  pointer start() const
  {
    return mStart;
  }

  pointer end() const
  {
    return mEnd;
  }

  pointer get() const
  {
    return mPosition;
  }

  CharT operator*() const
  {
    return *get();
  }

#if 0
  // An iterator really deserves this, but some compilers (notably IBM VisualAge for OS/2)
  //  don't like this when |CharT| is a type without members.
  pointer operator->() const
  {
    return get();
  }
#endif
# 83 "../../dist/include/nsStringIterator.h"

  self_type& operator++()
  {
    ++mPosition;
    return *this;
  }

  self_type operator++(int)
  {
    self_type result(*this);
    ++mPosition;
    return result;
  }

  self_type& operator--()
  {
    --mPosition;
    return *this;
  }

  self_type operator--(int)
  {
    self_type result(*this);
    --mPosition;
    return result;
  }

  difference_type size_forward() const
  {
    return mEnd - mPosition;
  }

  difference_type size_backward() const
  {
    return mPosition - mStart;
  }

  self_type& advance(difference_type aN)
  {
    if (aN > 0) {
      difference_type step = XPCOM_MIN(aN, size_forward());

      NS_ASSERTION(step > 0,
                   "can't advance a reading iterator beyond the end of a string");

      mPosition += step;
    } else if (aN < 0) {
      difference_type step = XPCOM_MAX(aN, -size_backward());

      NS_ASSERTION(step < 0,
                   "can't advance (backward) a reading iterator beyond the end of a string");

      mPosition += step;
    }
    return *this;
  }
};

/**
 * @see nsTAString
 */

template <class CharT>
class nsWritingIterator
{
public:
  typedef nsWritingIterator<CharT>   self_type;
  typedef ptrdiff_t                  difference_type;
  typedef CharT                      value_type;
  typedef CharT*                     pointer;
  typedef CharT&                     reference;

private:
  friend class nsAString;
  friend class nsACString;

  // unfortunately, the API for nsWritingIterator requires that the
  // iterator know its start and end positions.  this was needed when
  // we supported multi-fragment strings, but now it is really just
  // extra baggage.  we should remove mStart and mEnd at some point.

  CharT* mStart;
  CharT* mEnd;
  CharT* mPosition;

public:
  nsWritingIterator()
  {
  }
  // nsWritingIterator( const nsWritingIterator<CharT>& );                    // auto-generated copy-constructor OK
  // nsWritingIterator<CharT>& operator=( const nsWritingIterator<CharT>& );  // auto-generated copy-assignment operator OK

  inline void normalize_forward()
  {
  }
  inline void normalize_backward()
  {
  }

  pointer start() const
  {
    return mStart;
  }

  pointer end() const
  {
    return mEnd;
  }

  pointer get() const
  {
    return mPosition;
  }

  reference operator*() const
  {
    return *get();
  }

#if 0
  // An iterator really deserves this, but some compilers (notably IBM VisualAge for OS/2)
  //  don't like this when |CharT| is a type without members.
  pointer
  operator->() const
  {
    return get();
  }
#endif
# 211 "../../dist/include/nsStringIterator.h"

  self_type& operator++()
  {
  }
};

template <class CharT>
inline bool
operator==(const nsReadingIterator<CharT>& aLhs,
           const nsReadingIterator<CharT>& aRhs)
{
  return aLhs.get() == aRhs.get();
}

template <class CharT>
inline bool
operator!=(const nsReadingIterator<CharT>& aLhs,
           const nsReadingIterator<CharT>& aRhs)
{
  return aLhs.get() != aRhs.get();
}


//
// |nsWritingIterator|s
//

template <class CharT>
inline bool
operator==(const nsWritingIterator<CharT>& aLhs,
           const nsWritingIterator<CharT>& aRhs)
{
  return aLhs.get() == aRhs.get();
}

template <class CharT>
inline bool
operator!=(const nsWritingIterator<CharT>& aLhs,
           const nsWritingIterator<CharT>& aRhs)
{
  return aLhs.get() != aRhs.get();
}

#endif /* !defined(nsStringIterator_h___) */
# 316 "../../dist/include/nsStringIterator.h"
# 13 "../../dist/include/nsAString.h" 2

#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsAString.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h>
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsAString.h"

#define kNotFound -1

// declare nsAString
#if 0 /* expanded by -frewrite-includes */
#include "string-template-def-unichar.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-def-unichar.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#define CharT                               char16_t
#define CharT_is_PRUnichar                  1
#define nsTAString_IncompatibleCharT        nsACString
#define nsTString_CharT                     nsString
#define nsTFixedString_CharT                nsFixedString
#define nsTAutoString_CharT                 nsAutoString
#define nsTSubstring_CharT                  nsAString
#define nsTSubstringTuple_CharT             nsSubstringTuple
#define nsTStringComparator_CharT           nsStringComparator
#define nsTDefaultStringComparator_CharT    nsDefaultStringComparator
#define nsTDependentString_CharT            nsDependentString
#define nsTDependentSubstring_CharT         nsDependentSubstring
#define nsTLiteralString_CharT              nsLiteralString
#define nsTXPIDLString_CharT                nsXPIDLString
#define nsTGetterCopies_CharT               nsGetterCopies
#define nsTAdoptingString_CharT             nsAdoptingString
#define nsTPromiseFlatString_CharT          nsPromiseFlatString
#define TPromiseFlatString_CharT            PromiseFlatString
# 21 "../../dist/include/nsAString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTSubstring.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTSubstring.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Casting.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/nsTSubstring.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsTSubstring.h"

#ifndef MOZILLA_INTERNAL_API
#error Cannot use internal string classes without MOZILLA_INTERNAL_API defined. Use the frozen header nsStringAPI.h instead.
#endif
# 14 "../../dist/include/nsTSubstring.h"

/**
 * The base for string comparators
 */
class nsTStringComparator_CharT
{
public:
  typedef CharT char_type;

  nsTStringComparator_CharT()
  {
  }

  virtual int operator()(const char_type*, const char_type*,
                         uint32_t, uint32_t) const = 0;
};


/**
 * The default string comparator (case-sensitive comparision)
 */
class nsTDefaultStringComparator_CharT
  : public nsTStringComparator_CharT
{
public:
  typedef CharT char_type;

  nsTDefaultStringComparator_CharT()
  {
  }

  virtual int operator()(const char_type*, const char_type*,
                         uint32_t, uint32_t) const MOZ_OVERRIDE;
};

/**
 * nsTSubstring is the most abstract class in the string hierarchy. It
 * represents a single contiguous array of characters, which may or may not
 * be null-terminated. This type is not instantiated directly.  A sub-class
 * is instantiated instead.  For example, see nsTString.
 *
 * NAMES:
 *   nsAString for wide characters
 *   nsACString for narrow characters
 *
 * Many of the accessors on nsTSubstring are inlined as an optimization.
 */
class nsTSubstring_CharT
{
public:
  typedef mozilla::fallible_t                 fallible_t;

  typedef CharT                               char_type;

  typedef nsCharTraits<char_type>             char_traits;
  typedef char_traits::incompatible_char_type incompatible_char_type;

  typedef nsTSubstring_CharT                  self_type;
  typedef self_type                           abstract_string_type;
  typedef self_type                           base_string_type;

  typedef self_type                           substring_type;
  typedef nsTSubstringTuple_CharT             substring_tuple_type;
  typedef nsTString_CharT                     string_type;

  typedef nsReadingIterator<char_type>        const_iterator;
  typedef nsWritingIterator<char_type>        iterator;

  typedef nsTStringComparator_CharT           comparator_type;

  typedef char_type*                          char_iterator;
  typedef const char_type*                    const_char_iterator;

  typedef uint32_t                            size_type;
  typedef uint32_t                            index_type;

public:

  // this acts like a virtual destructor
  ~nsTSubstring_CharT()
  {
    Finalize();
  }

  /**
   * reading iterators
   */

  const_char_iterator BeginReading() const
  {
    return mData;
  }
  const_char_iterator EndReading() const
  {
    return mData + mLength;
  }

  /**
   * deprecated reading iterators
   */

  const_iterator& BeginReading(const_iterator& aIter) const
  {
    aIter.mStart = mData;
    aIter.mEnd = mData + mLength;
    aIter.mPosition = aIter.mStart;
    return aIter;
  }

  const_iterator& EndReading(const_iterator& aIter) const
  {
    aIter.mStart = mData;
    aIter.mEnd = mData + mLength;
    aIter.mPosition = aIter.mEnd;
    return aIter;
  }

  const_char_iterator& BeginReading(const_char_iterator& aIter) const
  {
    return aIter = mData;
  }

  const_char_iterator& EndReading(const_char_iterator& aIter) const
  {
    return aIter = mData + mLength;
  }


  /**
   * writing iterators
   */

  char_iterator BeginWriting()
  {
    if (!EnsureMutable()) {
      AllocFailed(mLength);
    }

    return mData;
  }

  char_iterator BeginWriting(const fallible_t&)
  {
    return EnsureMutable() ? mData : char_iterator(0);
  }

  char_iterator EndWriting()
  {
    if (!EnsureMutable()) {
      AllocFailed(mLength);
    }

    return mData + mLength;
  }

  char_iterator EndWriting(const fallible_t&)
  {
    return EnsureMutable() ? (mData + mLength) : char_iterator(0);
  }

  char_iterator& BeginWriting(char_iterator& aIter)
  {
    return aIter = BeginWriting();
  }

  char_iterator& BeginWriting(char_iterator& aIter, const fallible_t& aFallible)
  {
    return aIter = BeginWriting(aFallible);
  }

  char_iterator& EndWriting(char_iterator& aIter)
  {
    return aIter = EndWriting();
  }

  char_iterator& EndWriting(char_iterator& aIter, const fallible_t& aFallible)
  {
    return aIter = EndWriting(aFallible);
  }

  /**
   * deprecated writing iterators
   */

  iterator& BeginWriting(iterator& aIter)
  {
    char_type* data = BeginWriting();
    aIter.mStart = data;
    aIter.mEnd = data + mLength;
    aIter.mPosition = aIter.mStart;
    return aIter;
  }

  iterator& EndWriting(iterator& aIter)
  {
    char_type* data = BeginWriting();
    aIter.mStart = data;
    aIter.mEnd = data + mLength;
    aIter.mPosition = aIter.mEnd;
    return aIter;
  }

  /**
   * accessors
   */

  // returns pointer to string data (not necessarily null-terminated)
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  char16ptr_t Data() const
#else
# 224 "../../dist/include/nsTSubstring.h"
  const char_type* Data() const
#endif
# 226 "../../dist/include/nsTSubstring.h"
  {
    return mData;
  }

  size_type Length() const
  {
    return mLength;
  }

  uint32_t Flags() const
  {
    return mFlags;
  }

  bool IsEmpty() const
  {
    return mLength == 0;
  }

  bool IsLiteral() const
  {
    return (mFlags & F_LITERAL) != 0;
  }

  bool IsVoid() const
  {
    return (mFlags & F_VOIDED) != 0;
  }

  bool IsTerminated() const
  {
    return (mFlags & F_TERMINATED) != 0;
  }

  char_type CharAt(index_type aIndex) const
  {
    NS_ASSERTION(aIndex < mLength, "index exceeds allowable range");
    NS_ASSERTION(mLength > 0, "|Last()| called on an empty string");
    return mData[mLength - 1];
  }

  size_type NS_FASTCALL CountChar(char_type) const;
  int32_t NS_FASTCALL FindChar(char_type, index_type aOffset = 0) const;


  /**
   * equality
   */

  bool NS_FASTCALL Equals(const self_type&) const;
  bool NS_FASTCALL Equals(const self_type&, const comparator_type&) const;

  bool NS_FASTCALL Equals(const char_type* aData) const;
  bool NS_FASTCALL Equals(const char_type* aData,
                          const comparator_type& aComp) const;

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  bool NS_FASTCALL Equals(char16ptr_t aData) const
  {
    return Equals(static_cast<const char16_t*>(aData));
  }
  bool NS_FASTCALL Equals(char16ptr_t aData, const comparator_type& aComp) const
  {
    return Equals(static_cast<const char16_t*>(aData), aComp);
  }
#endif
# 308 "../../dist/include/nsTSubstring.h"

  /**
   * An efficient comparison with ASCII that can be used even
   * for wide strings. Call this version when you know the
   * length of 'data'.
   */
  bool NS_FASTCALL EqualsASCII(const char* aData, size_type aLen) const;
  /**
   * An efficient comparison with ASCII that can be used even
   * for wide strings. Call this version when 'data' is
   * null-terminated.
   */
  bool NS_FASTCALL EqualsASCII(const char* aData) const;

  // EqualsLiteral must ONLY be applied to an actual literal string, or
  // a char array *constant* declared without an explicit size.
  // Do not attempt to use it with a regular char* pointer, or with a
  // non-constant char array variable. Use EqualsASCII for them.
  // The template trick to acquire the array length at compile time without
  // using a macro is due to Corey Kosak, with much thanks.
  template<int N>
  inline bool EqualsLiteral(const char (&aStr)[N]) const
  {
    return EqualsASCII(aStr, N - 1);
  }

  // The LowerCaseEquals methods compare the ASCII-lowercase version of
  // this string (lowercasing only ASCII uppercase characters) to some
  // ASCII/Literal string. The ASCII string is *not* lowercased for
  // you. If you compare to an ASCII or literal string that contains an
  // uppercase character, it is guaranteed to return false. We will
  // throw assertions too.
  bool NS_FASTCALL LowerCaseEqualsASCII(const char* aData,
                                        size_type aLen) const;
  bool NS_FASTCALL LowerCaseEqualsASCII(const char* aData) const;

  // LowerCaseEqualsLiteral must ONLY be applied to an actual
  // literal string, or a char array *constant* declared without an
  // explicit size.  Do not attempt to use it with a regular char*
  // pointer, or with a non-constant char array variable. Use
  // LowerCaseEqualsASCII for them.
  template<int N>
  inline bool LowerCaseEqualsLiteral(const char (&aStr)[N]) const
  {
    return LowerCaseEqualsASCII(aStr, N - 1);
  }

  /**
   * assignment
   */

  void NS_FASTCALL Assign(char_type aChar);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(char_type aChar,
                                                const fallible_t&);

  void NS_FASTCALL Assign(const char_type* aData);
  void NS_FASTCALL Assign(const char_type* aData, size_type aLength);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const char_type* aData,
                                                size_type aLength,
                                                const fallible_t&);

  void NS_FASTCALL Assign(const self_type&);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const self_type&,
                                                const fallible_t&);

  void NS_FASTCALL Assign(const substring_tuple_type&);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const substring_tuple_type&,
                                                const fallible_t&);

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  void Assign(char16ptr_t aData)
  {
    Assign(static_cast<const char16_t*>(aData));
  }

  NS_WARN_UNUSED_RESULT bool Assign(char16ptr_t aData,
                                    const fallible_t& aFallible)
  {
    return Assign(static_cast<const char16_t*>(aData), aFallible);
  }

  void Assign(char16ptr_t aData, size_type aLength)
  {
    Assign(static_cast<const char16_t*>(aData), aLength);
  }

  NS_WARN_UNUSED_RESULT bool Assign(char16ptr_t aData, size_type aLength,
                                    const fallible_t& aFallible)
  {
    return Assign(static_cast<const char16_t*>(aData), aLength,
                  aFallible);
  }
#endif
# 401 "../../dist/include/nsTSubstring.h"

  void NS_FASTCALL AssignASCII(const char* aData, size_type aLength);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL AssignASCII(const char* aData,
                                                     size_type aLength,
                                                     const fallible_t&);

  void NS_FASTCALL AssignASCII(const char* aData)
  {
    AssignASCII(aData, mozilla::AssertedCast<size_type, size_t>(strlen(aData)));
  }
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL AssignASCII(const char* aData,
                                                     const fallible_t& aFallible)
  {
    return AssignASCII(aData,
                       mozilla::AssertedCast<size_type, size_t>(strlen(aData)),
                       aFallible);
  }

  // AssignLiteral must ONLY be applied to an actual literal string, or
  // a char array *constant* declared without an explicit size.
# 437 "../../dist/include/nsTSubstring.h"

  self_type& operator=(char_type aChar)
  {
    Assign(aChar);
    return *this;
  }
  self_type& operator=(const char_type* aData)
  {
    Assign(aData);
    return *this;
  }
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  self_type& operator=(char16ptr_t aData)
  {
    Assign(aData);
    return *this;
  }
#endif
# 455 "../../dist/include/nsTSubstring.h"
  self_type& operator=(const self_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_tuple_type& aTuple)
  {
    Assign(aTuple);
    return *this;
  }

  void NS_FASTCALL Adopt(char_type* aData, size_type aLength = size_type(-1));


  /**
   * buffer manipulation
   */

  void NS_FASTCALL Replace(index_type aCutStart, size_type aCutLength,
                           char_type aChar);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Replace(index_type aCutStart,
                                                 size_type aCutLength,
                                                 char_type aChar,
                                                 const fallible_t&);
  void NS_FASTCALL Replace(index_type aCutStart, size_type aCutLength,
                           const char_type* aData,
                           size_type aLength = size_type(-1));
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Replace(index_type aCutStart,
                                                 size_type aCutLength,
                                                 const char_type* aData,
                                                 size_type aLength,
                                                 const fallible_t&);
  void Replace(index_type aCutStart, size_type aCutLength,
               const self_type& aStr)
  {
    Replace(aCutStart, aCutLength, aStr.Data(), aStr.Length());
  }
  NS_WARN_UNUSED_RESULT bool Replace(index_type aCutStart,
                                     size_type aCutLength,
                                     const self_type& aStr,
                                     const fallible_t& aFallible)
  {
    return Replace(aCutStart, aCutLength, aStr.Data(), aStr.Length(),
                   aFallible);
  }
  void NS_FASTCALL Replace(index_type aCutStart, size_type aCutLength,
                           const substring_tuple_type& aTuple);

  void NS_FASTCALL ReplaceASCII(index_type aCutStart, size_type aCutLength,
                                const char* aData,
                                size_type aLength = size_type(-1));

  // ReplaceLiteral must ONLY be applied to an actual literal string.
  // Do not attempt to use it with a regular char* pointer, or with a char
  // array variable. Use Replace or ReplaceASCII for those.
  template<int N>
  void ReplaceLiteral(index_type aCutStart, size_type aCutLength,
                      const char_type (&aStr)[N])
  {
    ReplaceLiteral(aCutStart, aCutLength, aStr, N - 1);
  }

  void Append(char_type aChar)
  {
    Replace(mLength, 0, aChar);
  }
  NS_WARN_UNUSED_RESULT bool Append(char_type aChar,
                                    const fallible_t& aFallible)
  {
    return Replace(mLength, 0, aChar, aFallible);
  }
  void Append(const char_type* aData, size_type aLength = size_type(-1))
  {
    Replace(mLength, 0, aData, aLength);
  }
  NS_WARN_UNUSED_RESULT bool Append(const char_type* aData, size_type aLength,
                                    const fallible_t& aFallible)
  {
    return Replace(mLength, 0, aData, aLength, aFallible);
  }

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  void Append(char16ptr_t aData, size_type aLength = size_type(-1))
  {
    Append(static_cast<const char16_t*>(aData), aLength);
  }
#endif
# 542 "../../dist/include/nsTSubstring.h"

  void Append(const self_type& aStr)
  {
    Replace(mLength, 0, aStr);
  }
  void Append(const substring_tuple_type& aTuple)
  {
    Replace(mLength, 0, aTuple);
  }

  void AppendASCII(const char* aData, size_type aLength = size_type(-1))
  {
    ReplaceASCII(mLength, 0, aData, aLength);
  }

  /**
   * Append a formatted string to the current string. Uses the format
   * codes documented in prprf.h
   */
  void AppendPrintf(const char* aFormat, ...);
  void AppendPrintf(const char* aFormat, va_list aAp);
  void AppendInt(int32_t aInteger)
  {
    AppendPrintf("%d", aInteger);
  }
  void AppendInt(int32_t aInteger, int aRadix)
  {
    const char* fmt = aRadix == 10 ? "%d" : aRadix == 8 ? "%o" : "%x";
    AppendPrintf(fmt, aInteger);
  }
  void AppendInt(uint32_t aInteger)
  {
    AppendPrintf("%u", aInteger);
  }
  void AppendInt(uint32_t aInteger, int aRadix)
  {
    const char* fmt = aRadix == 10 ? "%u" : aRadix == 8 ? "%o" : "%x";
    AppendPrintf(fmt, aInteger);
  }
  void AppendInt(int64_t aInteger)
  {
    AppendPrintf("%lld", aInteger);
  }
  void AppendInt(int64_t aInteger, int aRadix)
  {
    const char* fmt = aRadix == 10 ? "%lld" : aRadix == 8 ? "%llo" : "%llx";
    AppendPrintf(fmt, aInteger);
  }
  void AppendInt(uint64_t aInteger)
  {
    AppendPrintf("%llu", aInteger);
  }
  template<int N>
  void AppendLiteral(const char_type (&aStr)[N])
  {
    ReplaceLiteral(mLength, 0, aStr, N - 1);
  }
#ifdef CharT_is_PRUnichar
  template<int N>
  void AppendLiteral(const char (&aStr)[N])
  {
    AppendASCII(aStr, N - 1);
  }
#endif
# 622 "../../dist/include/nsTSubstring.h"

  self_type& operator+=(char_type aChar)
  {
    Append(aChar);
    return *this;
  }
  self_type& operator+=(const char_type* aData)
  {
    Append(aData);
    return *this;
  }
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  self_type& operator+=(char16ptr_t aData)
  {
    Append(aData);
    return *this;
  }
#endif
# 640 "../../dist/include/nsTSubstring.h"
  self_type& operator+=(const self_type& aStr)
  {
    Append(aStr);
    return *this;
  }
  self_type& operator+=(const substring_tuple_type& aTuple)
  {
    Append(aTuple);
    return *this;
  }

  void Insert(char_type aChar, index_type aPos)
  {
    Replace(aPos, 0, aChar);
  }
  void Insert(const char_type* aData, index_type aPos,
              size_type aLength = size_type(-1))
  {
    Replace(aPos, 0, aData, aLength);
  }
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  void Insert(char16ptr_t aData, index_type aPos,
              size_type aLength = size_type(-1))
  {
    Insert(static_cast<const char16_t*>(aData), aPos, aLength);
  }
#endif
# 667 "../../dist/include/nsTSubstring.h"
  void Insert(const self_type& aStr, index_type aPos)
  {
    Replace(aPos, 0, aStr);
  }
  void Insert(const substring_tuple_type& aTuple, index_type aPos)
  {
    Replace(aPos, 0, aTuple);
  }

  // InsertLiteral must ONLY be applied to an actual literal string.
  // Do not attempt to use it with a regular char* pointer, or with a char
  // array variable. Use Insert for those.
  template<int N>
  void InsertLiteral(const char_type (&aStr)[N], index_type aPos)
  {
    ReplaceLiteral(aPos, 0, aStr, N - 1);
  }

  void Cut(index_type aCutStart, size_type aCutLength)
  {
    Replace(aCutStart, aCutLength, char_traits::sEmptyBuffer, 0);
  }


  /**
   * buffer sizing
   */

  /**
   * Attempts to set the capacity to the given size in number of
   * characters, without affecting the length of the string.
   * There is no need to include room for the null terminator: it is
   * the job of the string class.
   * Also ensures that the buffer is mutable.
   */
  void NS_FASTCALL SetCapacity(size_type aNewCapacity);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL SetCapacity(size_type aNewCapacity,
                                                     const fallible_t&);

  void NS_FASTCALL SetLength(size_type aNewLength);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL SetLength(size_type aNewLength,
                                                   const fallible_t&);

  void Truncate(size_type aNewLength = 0)
  {
    NS_ASSERTION(aNewLength <= mLength, "Truncate cannot make string longer");
    SetLength(aNewLength);
  }


  /**
   * buffer access
   * string will be truncated.  @see nsTSubstring::IsVoid
   */

  void NS_FASTCALL SetIsVoid(bool);

  /**
   *  This method is used to remove all occurrences of aChar from this
   * string.
   *
   *  @param  aChar -- char to be stripped
   *  @param  aOffset -- where in this string to start stripping chars
   */

  void StripChar(char_type aChar, int32_t aOffset = 0);

  /**
  {
    Assign(aTuple);
  }

  /**
   * allows for direct initialization of a nsTSubstring object.
   *
   * NOTE: this constructor is declared public _only_ for convenience
   * inside the string implementation.
   */
  // XXXbz or can I just include nscore.h and use NS_BUILD_REFCNT_LOGGING?
#if defined(DEBUG) || defined(FORCE_BUILD_REFCNT_LOGGING)
#define XPCOM_STRING_CONSTRUCTOR_OUT_OF_LINE
  nsTSubstring_CharT(char_type* aData, size_type aLength, uint32_t aFlags);
#else
# 845 "../../dist/include/nsTSubstring.h"
#undef XPCOM_STRING_CONSTRUCTOR_OUT_OF_LINE
  nsTSubstring_CharT(char_type* aData, size_type aLength, uint32_t aFlags)
    : mData(aData)
    , mLength(aLength)
    , mFlags(aFlags)
  {
  }
#endif /* DEBUG || FORCE_BUILD_REFCNT_LOGGING */
# 853 "../../dist/include/nsTSubstring.h"

  size_t SizeOfExcludingThisMustBeUnshared(mozilla::MallocSizeOf aMallocSizeOf)
  const;
  size_t SizeOfIncludingThisMustBeUnshared(mozilla::MallocSizeOf aMallocSizeOf)
  const;

  size_t SizeOfExcludingThisIfUnshared(mozilla::MallocSizeOf aMallocSizeOf)
  const;
  size_t SizeOfIncludingThisIfUnshared(mozilla::MallocSizeOf aMallocSizeOf)
  const;

  /**
   * WARNING: Only use these functions if you really know what you are
   * doing, because they can easily lead to double-counting strings.  If
   * you do use them, please explain clearly in a comment why it's safe
   * and won't lead to double-counting.
   */
  size_t SizeOfExcludingThisEvenIfShared(mozilla::MallocSizeOf aMallocSizeOf)
  const;
  size_t SizeOfIncludingThisEvenIfShared(mozilla::MallocSizeOf aMallocSizeOf)
  const;

  template<class T>
  void NS_ABORT_OOM(T)
  {
    struct never {}; // a compiler-friendly way to do static_assert(false)
    static_assert(mozilla::IsSame<T, never>::value,
      "In string classes, use AllocFailed to account for sizeof(char_type). "
      "Use the global ::NS_ABORT_OOM if you really have a count of bytes.");
  }

  MOZ_ALWAYS_INLINE void AllocFailed(size_t aLength)
  {
    ::NS_ABORT_OOM(aLength * sizeof(char_type));
  }

protected:

  friend class nsTObsoleteAStringThunk_CharT;
  friend class nsTSubstringTuple_CharT;

  // XXX GCC 3.4 needs this :-(
  friend class nsTPromiseFlatString_CharT;

  char_type*  mData;
  size_type   mLength;
  uint32_t    mFlags;

  // default initialization
  nsTSubstring_CharT()
    : mData(char_traits::sEmptyBuffer)
    ,  mLength(0)
    ,  mFlags(F_TERMINATED)
  {
  }

  // version of constructor that leaves mData and mLength uninitialized
  explicit
  nsTSubstring_CharT(uint32_t aFlags)
    : mFlags(aFlags)
  {
  }

  // copy-constructor, constructs as dependent on given object
  // (NOTE: this is for internal use only)
  nsTSubstring_CharT(const self_type& aStr)
    : mData(aStr.mData)
    ,  mLength(aStr.mLength)
    ,  mFlags(aStr.mFlags & (F_TERMINATED | F_VOIDED))
  {
  }

  /**
   * this function releases mData and does not change the value of
   * any of its member variables.  in other words, this function acts
   * like a destructor.
   */
  void NS_FASTCALL Finalize();

  /**
   * this function prepares mData to be mutated.
   *
   * @param aCapacity    specifies the required capacity of mData
   * @param aOldData     returns null or the old value of mData
   * @param aOldFlags    returns 0 or the old value of mFlags
   *
   * if mData is already mutable and of sufficient capacity, then this
  /**
   * this helper function can be called prior to directly manipulating
   * the contents of mData.  see, for example, BeginWriting.
   */
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL EnsureMutable(
    size_type aNewLen = size_type(-1));

  /**
   * returns true if this string overlaps with the given string fragment.
   */
  bool IsDependentOn(const char_type* aStart, const char_type* aEnd) const
  {
    /**
     * if it _isn't_ the case that one fragment starts after the other ends,
     * or ends before the other starts, then, they conflict:
     *
     *   !(f2.begin >= f1.aEnd || f2.aEnd <= f1.begin)
     *
     * Simplified, that gives us:
     */
    return (aStart < (mData + mLength) && aEnd > mData);
  }

  /**
   * this helper function stores the specified dataFlags in mFlags
   */
  void SetDataFlags(uint32_t aDataFlags)
  {
    NS_ASSERTION((aDataFlags & 0xFFFF0000) == 0, "bad flags");
    mFlags = aDataFlags | (mFlags & 0xFFFF0000);
  }

  void NS_FASTCALL ReplaceLiteral(index_type aCutStart, size_type aCutLength,
                                  const char_type* aData, size_type aLength);

  static int AppendFunc(void* aArg, const char* aStr, uint32_t aLen);

public:

  // NOTE: this method is declared public _only_ for convenience for
  // callers who don't have access to the original nsLiteralString_CharT.
  void NS_FASTCALL AssignLiteral(const char_type* aData, size_type aLength);

  // mFlags is a bitwise combination of the following flags.  the meaning
  // and interpretation of these flags is an implementation detail.
  //
  // NOTE: these flags are declared public _only_ for convenience inside
  // the string implementation.

  enum
  {
    F_NONE         = 0,       // no flags

    // data flags are in the lower 16-bits
    F_TERMINATED   = 1 << 0,  // IsTerminated returns true
    F_VOIDED       = 1 << 1,  // IsVoid returns true
    F_SHARED       = 1 << 2,  // mData points to a heap-allocated, shared buffer
    F_OWNED        = 1 << 3,  // mData points to a heap-allocated, raw buffer
    F_FIXED        = 1 << 4,  // mData points to a fixed-size writable, dependent buffer
    F_LITERAL      = 1 << 5,  // mData points to a string literal; F_TERMINATED will also be set

    // class flags are in the upper 16-bits
    F_CLASS_FIXED  = 1 << 16   // indicates that |this| is of type nsTFixedString
  };
  //   mutually exclusive with F_SHARED, F_OWNED, and F_FIXED.
  //
};

int NS_FASTCALL
Compare(const nsTSubstring_CharT::base_string_type& aLhs,
        const nsTSubstring_CharT::base_string_type& aRhs,
        const nsTStringComparator_CharT& = nsTDefaultStringComparator_CharT());


inline bool
operator!=(const nsTSubstring_CharT::base_string_type& aLhs,
           const nsTSubstring_CharT::base_string_type& aRhs)
{
  return !aLhs.Equals(aRhs);
}

inline bool
operator<(const nsTSubstring_CharT::base_string_type& aLhs,
          const nsTSubstring_CharT::base_string_type& aRhs)
{
  return Compare(aLhs, aRhs) < 0;
}

inline bool
operator<=(const nsTSubstring_CharT::base_string_type& aLhs,
           const nsTSubstring_CharT::base_string_type& aRhs)
{
  return Compare(aLhs, aRhs) <= 0;
}

inline bool
operator==(const nsTSubstring_CharT::base_string_type& aLhs,
           const nsTSubstring_CharT::base_string_type& aRhs)
{
  return aLhs.Equals(aRhs);
}

inline bool
operator==(const nsTSubstring_CharT::base_string_type& aLhs,
           const nsTSubstring_CharT::char_type* aRhs)
{
  return aLhs.Equals(aRhs);
}


inline bool
operator>=(const nsTSubstring_CharT::base_string_type& aLhs,
           const nsTSubstring_CharT::base_string_type& aRhs)
{
  return Compare(aLhs, aRhs) >= 0;
}

inline bool
operator>(const nsTSubstring_CharT::base_string_type& aLhs,
          const nsTSubstring_CharT::base_string_type& aRhs)
{
  return Compare(aLhs, aRhs) > 0;
}
# 22 "../../dist/include/nsAString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "string-template-undef.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-undef.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#undef CharT
#undef CharT_is_PRUnichar
#undef CharT_is_char
#undef nsTAString_IncompatibleCharT
#undef nsTString_CharT
#undef nsTFixedString_CharT
#undef nsTAutoString_CharT
#undef nsTSubstring_CharT
#undef nsTSubstringTuple_CharT
# 1 "../../dist/include/string-template-def-char.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#define CharT                               char
#define CharT_is_char                       1
#define nsTAString_IncompatibleCharT        nsAString
#define nsTString_CharT                     nsCString
#define nsTFixedString_CharT                nsFixedCString
#define nsTAutoString_CharT                 nsAutoCString
#define nsTSubstring_CharT                  nsACString
#define nsTSubstringTuple_CharT             nsCSubstringTuple
#define nsTStringComparator_CharT           nsCStringComparator
#define nsTDefaultStringComparator_CharT    nsDefaultCStringComparator
#define nsTDependentString_CharT            nsDependentCString
#define nsTDependentSubstring_CharT         nsDependentCSubstring
#define nsTLiteralString_CharT              nsLiteralCString
#define nsTXPIDLString_CharT                nsXPIDLCString
#define nsTGetterCopies_CharT               nsCGetterCopies
#define nsTAdoptingString_CharT             nsAdoptingCString
#define nsTPromiseFlatString_CharT          nsPromiseFlatCString
#define TPromiseFlatString_CharT            PromiseFlatCString
# 26 "../../dist/include/nsAString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTSubstring.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTSubstring.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Casting.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/nsTSubstring.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsTSubstring.h"

#ifndef MOZILLA_INTERNAL_API
#error Cannot use internal string classes without MOZILLA_INTERNAL_API defined. Use the frozen header nsStringAPI.h instead.
#endif
# 14 "../../dist/include/nsTSubstring.h"

/**
 * The base for string comparators
 */
class nsTStringComparator_CharT
{
public:
  typedef CharT char_type;

  nsTStringComparator_CharT()
  {
  }

  virtual int operator()(const char_type*, const char_type*,
                         uint32_t, uint32_t) const = 0;
};


/**
 * The default string comparator (case-sensitive comparision)
 */
class nsTDefaultStringComparator_CharT
  : public nsTStringComparator_CharT
{
public:
  typedef CharT char_type;

  nsTDefaultStringComparator_CharT()
  {
  }

  virtual int operator()(const char_type*, const char_type*,
                         uint32_t, uint32_t) const MOZ_OVERRIDE;
};

/**
 * nsTSubstring is the most abstract class in the string hierarchy. It
 * represents a single contiguous array of characters, which may or may not
 * be null-terminated. This type is not instantiated directly.  A sub-class
 * is instantiated instead.  For example, see nsTString.
 *
 * NAMES:
 *   nsAString for wide characters
 *   nsACString for narrow characters
 *
 * Many of the accessors on nsTSubstring are inlined as an optimization.
 */
class nsTSubstring_CharT
{
public:
  typedef mozilla::fallible_t                 fallible_t;

  typedef CharT                               char_type;

  typedef nsCharTraits<char_type>             char_traits;
  typedef char_traits::incompatible_char_type incompatible_char_type;

  typedef nsTSubstring_CharT                  self_type;
  typedef self_type                           abstract_string_type;
  typedef self_type                           base_string_type;

  typedef self_type                           substring_type;
  typedef nsTSubstringTuple_CharT             substring_tuple_type;
  typedef nsTString_CharT                     string_type;

  typedef nsReadingIterator<char_type>        const_iterator;
  typedef nsWritingIterator<char_type>        iterator;

  typedef nsTStringComparator_CharT           comparator_type;

  typedef char_type*                          char_iterator;
  typedef const char_type*                    const_char_iterator;

  typedef uint32_t                            size_type;
  typedef uint32_t                            index_type;

public:

  // this acts like a virtual destructor
  ~nsTSubstring_CharT()
  {
    Finalize();
  }

  /**
   * reading iterators
   */

  const_char_iterator BeginReading() const
  {
    return mData;
  }
  const_char_iterator EndReading() const
  {
    return mData + mLength;
  }

  /**
   * deprecated reading iterators
   */

  const_iterator& BeginReading(const_iterator& aIter) const
  {
    aIter.mStart = mData;
    aIter.mEnd = mData + mLength;
    aIter.mPosition = aIter.mStart;
    return aIter;
  }

  const_iterator& EndReading(const_iterator& aIter) const
  {
    aIter.mStart = mData;
    aIter.mEnd = mData + mLength;
    aIter.mPosition = aIter.mEnd;
    return aIter;
  }

  const_char_iterator& BeginReading(const_char_iterator& aIter) const
  {
    return aIter = mData;
  }

  const_char_iterator& EndReading(const_char_iterator& aIter) const
  {
    return aIter = mData + mLength;
  }


  /**
   * writing iterators
   */

  char_iterator BeginWriting()
  {
    if (!EnsureMutable()) {
      AllocFailed(mLength);
    }

    return mData;
  }

  char_iterator BeginWriting(const fallible_t&)
  {
    return EnsureMutable() ? mData : char_iterator(0);
  }

  char_iterator EndWriting()
  {
    if (!EnsureMutable()) {
      AllocFailed(mLength);
    }

    return mData + mLength;
  }

  char_iterator EndWriting(const fallible_t&)
  {
  }

  char_iterator& EndWriting(char_iterator& aIter, const fallible_t& aFallible)
  {
    return aIter = EndWriting(aFallible);
  }

  /**
   * deprecated writing iterators
   */

  iterator& BeginWriting(iterator& aIter)
  {
    char_type* data = BeginWriting();
    aIter.mStart = data;
    aIter.mEnd = data + mLength;
    aIter.mPosition = aIter.mStart;
    return aIter;
  }

  iterator& EndWriting(iterator& aIter)
  {
    char_type* data = BeginWriting();
    aIter.mStart = data;
    aIter.mEnd = data + mLength;
    aIter.mPosition = aIter.mEnd;
    return aIter;
  }

  /**
   * accessors
   */

  // returns pointer to string data (not necessarily null-terminated)
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  char16ptr_t Data() const
#else
# 224 "../../dist/include/nsTSubstring.h"
  const char_type* Data() const
#endif
# 226 "../../dist/include/nsTSubstring.h"
  {
    return mData;
  }

  size_type Length() const
  {
    return mLength;
  }

  uint32_t Flags() const
  {
    return mFlags;
  }

  bool IsEmpty() const
  {
    return mLength == 0;
  }

  bool IsLiteral() const
  {
    return (mFlags & F_LITERAL) != 0;
  }

  bool IsVoid() const
  {
    return (mFlags & F_VOIDED) != 0;
  }

  bool IsTerminated() const
  {
    return (mFlags & F_TERMINATED) != 0;
  }

  char_type CharAt(index_type aIndex) const
  {
    NS_ASSERTION(aIndex < mLength, "index exceeds allowable range");
    return mData[aIndex];
  }

  char_type operator[](index_type aIndex) const
  {
    return CharAt(aIndex);
  }

  char_type First() const
  {
    NS_ASSERTION(mLength > 0, "|First()| called on an empty string");
    return mData[0];
  }

  inline   char_type Last() const
  {
    NS_ASSERTION(mLength > 0, "|Last()| called on an empty string");
    return mData[mLength - 1];
  }

  size_type NS_FASTCALL CountChar(char_type) const;
  int32_t NS_FASTCALL FindChar(char_type, index_type aOffset = 0) const;


  /**
   * equality
   */

  bool NS_FASTCALL Equals(const self_type&) const;
  bool NS_FASTCALL Equals(const self_type&, const comparator_type&) const;

  bool NS_FASTCALL Equals(const char_type* aData) const;
  bool NS_FASTCALL Equals(const char_type* aData,
                          const comparator_type& aComp) const;
  void NS_FASTCALL Assign(char_type aChar);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(char_type aChar,
                                                const fallible_t&);

  void NS_FASTCALL Assign(const char_type* aData);
  void NS_FASTCALL Assign(const char_type* aData, size_type aLength);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const char_type* aData,
                                                size_type aLength,
                                                const fallible_t&);

  void NS_FASTCALL Assign(const self_type&);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const self_type&,
                                                const fallible_t&);

  void NS_FASTCALL Assign(const substring_tuple_type&);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Assign(const substring_tuple_type&,
                                                const fallible_t&);

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  void Assign(char16ptr_t aData)
  {
    Assign(static_cast<const char16_t*>(aData));
  }

  NS_WARN_UNUSED_RESULT bool Assign(char16ptr_t aData,
                                    const fallible_t& aFallible)
  {
    return Assign(static_cast<const char16_t*>(aData), aFallible);
  }

  void Assign(char16ptr_t aData, size_type aLength)
  {
    Assign(static_cast<const char16_t*>(aData), aLength);
  }

  NS_WARN_UNUSED_RESULT bool Assign(char16ptr_t aData, size_type aLength,
                                    const fallible_t& aFallible)
  {
    return Assign(static_cast<const char16_t*>(aData), aLength,
                  aFallible);
  }
#endif
# 401 "../../dist/include/nsTSubstring.h"

  void NS_FASTCALL AssignASCII(const char* aData, size_type aLength);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL AssignASCII(const char* aData,
                                                     size_type aLength,
                                                     const fallible_t&);

  self_type& operator=(char_type aChar)
  {
    Assign(aChar);
    return *this;
  }
  self_type& operator=(const char_type* aData)
  {
    Assign(aData);
    return *this;
  }
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  self_type& operator=(char16ptr_t aData)
  {
    Assign(aData);
    return *this;
  }
#endif
# 455 "../../dist/include/nsTSubstring.h"
  self_type& operator=(const self_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_tuple_type& aTuple)
  {
    Assign(aTuple);
    return *this;
  }

  void NS_FASTCALL Adopt(char_type* aData, size_type aLength = size_type(-1));


  /**
   * buffer manipulation
   */

  void NS_FASTCALL Replace(index_type aCutStart, size_type aCutLength,
                           char_type aChar);
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Replace(index_type aCutStart,
                                                 size_type aCutLength,
                                                 char_type aChar,
                                                 const fallible_t&);
  void NS_FASTCALL Replace(index_type aCutStart, size_type aCutLength,
                           const char_type* aData,
                           size_type aLength = size_type(-1));
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL Replace(index_type aCutStart,
                                                 size_type aCutLength,
                                                 const char_type* aData,
                                                 size_type aLength,
                                                 const fallible_t&);
  void Replace(index_type aCutStart, size_type aCutLength,
               const self_type& aStr)
  {
    Replace(aCutStart, aCutLength, aStr.Data(), aStr.Length());
  }
  NS_WARN_UNUSED_RESULT bool Replace(index_type aCutStart,
                                     size_type aCutLength,
                                     const self_type& aStr,
                                     const fallible_t& aFallible)
  {
    return Replace(aCutStart, aCutLength, aStr.Data(), aStr.Length(),
                   aFallible);
  }
  void NS_FASTCALL Replace(index_type aCutStart, size_type aCutLength,
                           const substring_tuple_type& aTuple);

  void NS_FASTCALL ReplaceASCII(index_type aCutStart, size_type aCutLength,
                                const char* aData,
                                size_type aLength = size_type(-1));

  // ReplaceLiteral must ONLY be applied to an actual literal string.
  // Do not attempt to use it with a regular char* pointer, or with a char
  // array variable. Use Replace or ReplaceASCII for those.
  template<int N>
  void ReplaceLiteral(index_type aCutStart, size_type aCutLength,
                      const char_type (&aStr)[N])
  {
    ReplaceLiteral(aCutStart, aCutLength, aStr, N - 1);
  }

  void Append(char_type aChar)
  {
    Replace(mLength, 0, aChar);
  }
  NS_WARN_UNUSED_RESULT bool Append(char_type aChar,
                                    const fallible_t& aFallible)
  {
    return Replace(mLength, 0, aChar, aFallible);
  }
  void Append(const char_type* aData, size_type aLength = size_type(-1))
  {
    Replace(mLength, 0, aData, aLength);
  }
  NS_WARN_UNUSED_RESULT bool Append(const char_type* aData, size_type aLength,
                                    const fallible_t& aFallible)
  {
    return Replace(mLength, 0, aData, aLength, aFallible);
  }

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  void Append(char16ptr_t aData, size_type aLength = size_type(-1))
  {
    Append(static_cast<const char16_t*>(aData), aLength);
  }
#endif
# 542 "../../dist/include/nsTSubstring.h"

  void Append(const self_type& aStr)
  {
    Replace(mLength, 0, aStr);
  }
  void Append(const substring_tuple_type& aTuple)
  {
    Replace(mLength, 0, aTuple);
  }

  void AppendASCII(const char* aData, size_type aLength = size_type(-1))
  {
    ReplaceASCII(mLength, 0, aData, aLength);
  }

  /**
   * Append a formatted string to the current string. Uses the format
   * codes documented in prprf.h
   */
  void AppendPrintf(const char* aFormat, ...);
  void AppendPrintf(const char* aFormat, va_list aAp);
  void AppendInt(int32_t aInteger)
  {
    AppendPrintf("%d", aInteger);
  }
  void AppendInt(int32_t aInteger, int aRadix)
  {
    const char* fmt = aRadix == 10 ? "%d" : aRadix == 8 ? "%o" : "%x";
    AppendPrintf(fmt, aInteger);
  }
  void AppendInt(uint32_t aInteger)
  {
    AppendPrintf("%u", aInteger);
  }
  void AppendInt(uint32_t aInteger, int aRadix)
  {
    const char* fmt = aRadix == 10 ? "%u" : aRadix == 8 ? "%o" : "%x";
    AppendPrintf(fmt, aInteger);
  }
  void AppendInt(int64_t aInteger)
  {
    AppendPrintf("%lld", aInteger);
  }
  void AppendInt(int64_t aInteger, int aRadix)
  {
    const char* fmt = aRadix == 10 ? "%lld" : aRadix == 8 ? "%llo" : "%llx";
    AppendPrintf(fmt, aInteger);
  }
  void AppendInt(uint64_t aInteger)
  {
    AppendPrintf("%llu", aInteger);
  }
  void AppendInt(uint64_t aInteger, int aRadix)
  {
    const char* fmt = aRadix == 10 ? "%llu" : aRadix == 8 ? "%llo" : "%llx";
    AppendPrintf(fmt, aInteger);
  }

  /**
   * Append the given float to this string
   */
  void NS_FASTCALL AppendFloat(float aFloat);
  void NS_FASTCALL AppendFloat(double aFloat);
public:

  // AppendLiteral must ONLY be applied to an actual literal string.
  // Do not attempt to use it with a regular char* pointer, or with a char
  // array variable. Use Append or AppendASCII for those.
  template<int N>
  void AppendLiteral(const char_type (&aStr)[N])
  {
    ReplaceLiteral(mLength, 0, aStr, N - 1);
  }
#ifdef CharT_is_PRUnichar
  template<int N>
  void AppendLiteral(const char (&aStr)[N])
  {
    AppendASCII(aStr, N - 1);
  }
#endif
# 622 "../../dist/include/nsTSubstring.h"

  self_type& operator+=(char_type aChar)
  {
    Append(aChar);
    return *this;
  }
  self_type& operator+=(const char_type* aData)
  {
    Append(aData);
    return *this;
  }
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  self_type& operator+=(char16ptr_t aData)
  {
    Append(aData);
    return *this;
  }
#endif
# 640 "../../dist/include/nsTSubstring.h"
  self_type& operator+=(const self_type& aStr)
  {
    Append(aStr);
    return *this;
  }
  self_type& operator+=(const substring_tuple_type& aTuple)
  {
    Append(aTuple);
    return *this;
  }

  void Insert(char_type aChar, index_type aPos)
  {
    Replace(aPos, 0, aChar);
  }
  void Insert(const char_type* aData, index_type aPos,
              size_type aLength = size_type(-1))
  {
    Replace(aPos, 0, aData, aLength);
  }
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  void Insert(char16ptr_t aData, index_type aPos,
              size_type aLength = size_type(-1))
  nsTSubstring_CharT(char_type* aData, size_type aLength, uint32_t aFlags);
#else
# 845 "../../dist/include/nsTSubstring.h"
#undef XPCOM_STRING_CONSTRUCTOR_OUT_OF_LINE
  nsTSubstring_CharT(char_type* aData, size_type aLength, uint32_t aFlags)
    : mData(aData)
    , mLength(aLength)
    , mFlags(aFlags)
  {
  }
#endif /* DEBUG || FORCE_BUILD_REFCNT_LOGGING */
# 853 "../../dist/include/nsTSubstring.h"

  size_t SizeOfExcludingThisMustBeUnshared(mozilla::MallocSizeOf aMallocSizeOf)
  const;
  size_t SizeOfIncludingThisMustBeUnshared(mozilla::MallocSizeOf aMallocSizeOf)
  const;

  size_t SizeOfExcludingThisIfUnshared(mozilla::MallocSizeOf aMallocSizeOf)
  const;
  size_t SizeOfIncludingThisIfUnshared(mozilla::MallocSizeOf aMallocSizeOf)
  const;

  /**
   * WARNING: Only use these functions if you really know what you are
   * doing, because they can easily lead to double-counting strings.  If
   * you do use them, please explain clearly in a comment why it's safe
   * and won't lead to double-counting.
   */
  size_t SizeOfExcludingThisEvenIfShared(mozilla::MallocSizeOf aMallocSizeOf)
  const;
  size_t SizeOfIncludingThisEvenIfShared(mozilla::MallocSizeOf aMallocSizeOf)
  const;

  template<class T>
  void NS_ABORT_OOM(T)
  {
    struct never {}; // a compiler-friendly way to do static_assert(false)
    static_assert(mozilla::IsSame<T, never>::value,
      "In string classes, use AllocFailed to account for sizeof(char_type). "
      "Use the global ::NS_ABORT_OOM if you really have a count of bytes.");
  }

  MOZ_ALWAYS_INLINE void AllocFailed(size_t aLength)
  {
    ::NS_ABORT_OOM(aLength * sizeof(char_type));
  }

protected:

  friend class nsTObsoleteAStringThunk_CharT;
  friend class nsTSubstringTuple_CharT;

  // XXX GCC 3.4 needs this :-(
  friend class nsTPromiseFlatString_CharT;

  char_type*  mData;
  size_type   mLength;
  uint32_t    mFlags;

  // default initialization
  nsTSubstring_CharT()
    : mData(char_traits::sEmptyBuffer)
    ,  mLength(0)
    ,  mFlags(F_TERMINATED)
  {
  }

  // version of constructor that leaves mData and mLength uninitialized
  explicit
  nsTSubstring_CharT(uint32_t aFlags)
    : mFlags(aFlags)
  {
  }

  // copy-constructor, constructs as dependent on given object
  // (NOTE: this is for internal use only)
  nsTSubstring_CharT(const self_type& aStr)
    : mData(aStr.mData)
    ,  mLength(aStr.mLength)
    ,  mFlags(aStr.mFlags & (F_TERMINATED | F_VOIDED))
  {
  }

  /**
   * this function releases mData and does not change the value of
   * any of its member variables.  in other words, this function acts
   * like a destructor.
   */
  void NS_FASTCALL Finalize();

  /**
   * this function prepares mData to be mutated.
   *
   * @param aCapacity    specifies the required capacity of mData
   * @param aOldData     returns null or the old value of mData
   * @param aOldFlags    returns 0 or the old value of mFlags
   *
   * if mData is already mutable and of sufficient capacity, then this
   * function will return immediately.  otherwise, it will either resize
   * mData or allocate a new shared buffer.  if it needs to allocate a
   * new buffer, then it will return the old buffer and the corresponding
   * flags.  this allows the caller to decide when to free the old data.
   *
   * this function returns false if is unable to allocate sufficient
   * memory.
  /**
   * returns the number of writable storage units starting at mData.
   * the value does not include space for the null-terminator character.
   *
   * NOTE: this function returns 0 if mData is immutable (or the buffer
   *       is 0-sized).
   */
  size_type NS_FASTCALL Capacity() const;

  /**
   * this helper function can be called prior to directly manipulating
   * the contents of mData.  see, for example, BeginWriting.
   */
  NS_WARN_UNUSED_RESULT bool NS_FASTCALL EnsureMutable(
    size_type aNewLen = size_type(-1));

  /**
   * this helper function stores the specified dataFlags in mFlags
   */
  void SetDataFlags(uint32_t aDataFlags)
  {
    NS_ASSERTION((aDataFlags & 0xFFFF0000) == 0, "bad flags");
    mFlags = aDataFlags | (mFlags & 0xFFFF0000);
  }

  void NS_FASTCALL ReplaceLiteral(index_type aCutStart, size_type aCutLength,
                                  const char_type* aData, size_type aLength);

  static int AppendFunc(void* aArg, const char* aStr, uint32_t aLen);

public:

  // NOTE: this method is declared public _only_ for convenience for
  // callers who don't have access to the original nsLiteralString_CharT.
  void NS_FASTCALL AssignLiteral(const char_type* aData, size_type aLength);

  // mFlags is a bitwise combination of the following flags.  the meaning
  // and interpretation of these flags is an implementation detail.
  //
  // NOTE: these flags are declared public _only_ for convenience inside
  // the string implementation.

  enum
  {
    F_NONE         = 0,       // no flags

    // data flags are in the lower 16-bits
    F_TERMINATED   = 1 << 0,  // IsTerminated returns true
    F_VOIDED       = 1 << 1,  // IsVoid returns true
    F_SHARED       = 1 << 2,  // mData points to a heap-allocated, shared buffer
    F_OWNED        = 1 << 3,  // mData points to a heap-allocated, raw buffer
    F_FIXED        = 1 << 4,  // mData points to a fixed-size writable, dependent buffer
    F_LITERAL      = 1 << 5,  // mData points to a string literal; F_TERMINATED will also be set

    // class flags are in the upper 16-bits
    F_CLASS_FIXED  = 1 << 16   // indicates that |this| is of type nsTFixedString
  };

  //
  // Some terminology:
  //
  //   "dependent buffer"    A dependent buffer is one that the string class
  //                         does not own.  The string class relies on some
  //                         external code to ensure the lifetime of the
  //   indicate the allocation type of mData.  If none of these flags
  //   are set, then the string buffer is dependent.
  //
  //   F_SHARED, F_OWNED, or F_FIXED imply F_TERMINATED.  This is because
  //   the string classes always allocate null-terminated buffers, and
  //   non-terminated substrings are always dependent.
  //
  //   F_VOIDED implies F_TERMINATED, and moreover it implies that mData
  //   points to char_traits::sEmptyBuffer.  Therefore, F_VOIDED is
  //   mutually exclusive with F_SHARED, F_OWNED, and F_FIXED.
  //
};

int NS_FASTCALL
Compare(const nsTSubstring_CharT::base_string_type& aLhs,
        const nsTSubstring_CharT::base_string_type& aRhs,
        const nsTStringComparator_CharT& = nsTDefaultStringComparator_CharT());


inline bool
operator!=(const nsTSubstring_CharT::base_string_type& aLhs,
           const nsTSubstring_CharT::base_string_type& aRhs)
{
  return !aLhs.Equals(aRhs);
}

inline bool
operator<(const nsTSubstring_CharT::base_string_type& aLhs,
          const nsTSubstring_CharT::base_string_type& aRhs)
{
  return Compare(aLhs, aRhs) < 0;
}

inline bool
operator<=(const nsTSubstring_CharT::base_string_type& aLhs,
           const nsTSubstring_CharT::base_string_type& aRhs)
{
  return Compare(aLhs, aRhs) <= 0;
}

inline bool
operator==(const nsTSubstring_CharT::base_string_type& aLhs,
           const nsTSubstring_CharT::base_string_type& aRhs)
{
  return aLhs.Equals(aRhs);
}

inline bool
operator==(const nsTSubstring_CharT::base_string_type& aLhs,
           const nsTSubstring_CharT::char_type* aRhs)
{
  return aLhs.Equals(aRhs);
}


inline bool
operator>=(const nsTSubstring_CharT::base_string_type& aLhs,
           const nsTSubstring_CharT::base_string_type& aRhs)
{
  return Compare(aLhs, aRhs) >= 0;
}

inline bool
operator>(const nsTSubstring_CharT::base_string_type& aLhs,
          const nsTSubstring_CharT::base_string_type& aRhs)
{
  return Compare(aLhs, aRhs) > 0;
}
# 27 "../../dist/include/nsAString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "string-template-undef.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-undef.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#undef nsTAdoptingString_CharT
#undef nsTPromiseFlatString_CharT
#undef TPromiseFlatString_CharT
# 28 "../../dist/include/nsAString.h" 2


/**
 * ASCII case-insensitive comparator.  (for Unicode case-insensitive
 * comparision, see nsUnicharUtils.h)
 */
class nsCaseInsensitiveCStringComparator
  : public nsCStringComparator
{
public:
  nsCaseInsensitiveCStringComparator()
  {
  }
  typedef char char_type;

  virtual int operator()(const char_type*, const char_type*,
                         uint32_t, uint32_t) const MOZ_OVERRIDE;
};

class nsCaseInsensitiveCStringArrayComparator
{
public:
  template<class A, class B>
  bool Equals(const A& aStrA, const B& aStrB) const
  {
    return aStrA.Equals(aStrB, nsCaseInsensitiveCStringComparator());
  }
};

// included here for backwards compatibility
#ifndef nsSubstringTuple_h___
#if 0 /* expanded by -frewrite-includes */
#include "nsSubstringTuple.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsSubstringTuple.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsSubstringTuple_h___
#define nsSubstringTuple_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsSubstring.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsSubstring.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsSubstring_h___
#define nsSubstring_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsAString.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsSubstring.h"

#endif // !defined(nsSubstring_h___)
# 13 "../../dist/include/nsSubstring.h"
# 11 "../../dist/include/nsSubstringTuple.h" 2

// declare nsSubstringTuple
#if 0 /* expanded by -frewrite-includes */
#include "string-template-def-unichar.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-def-unichar.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#undef nsTPromiseFlatString_CharT
#undef TPromiseFlatString_CharT
# 21 "../../dist/include/nsSubstringTuple.h" 2

#endif // !defined(nsSubstringTuple_h___)
# 23 "../../dist/include/nsSubstringTuple.h"
# 60 "../../dist/include/nsAString.h" 2
#endif
# 61 "../../dist/include/nsAString.h"

#endif // !defined(nsAString_h___)
# 63 "../../dist/include/nsAString.h"
# 11 "../../dist/include/nsSubstring.h" 2

#endif // !defined(nsSubstring_h___)
# 13 "../../dist/include/nsSubstring.h"
# 13 "../../dist/include/nsString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsDependentSubstring.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsDependentSubstring.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsDependentSubstring_h___
#define nsDependentSubstring_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsSubstring.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsDependentSubstring.h"

// declare nsDependentSubstring
#if 0 /* expanded by -frewrite-includes */
#include "string-template-def-unichar.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-def-unichar.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#define CharT                               char16_t
#define CharT_is_PRUnichar                  1
#define nsTAString_IncompatibleCharT        nsACString
#define nsTString_CharT                     nsString
#define nsTFixedString_CharT                nsFixedString
#define nsTAutoString_CharT                 nsAutoString
#define nsTSubstring_CharT                  nsAString
#define nsTSubstringTuple_CharT             nsSubstringTuple
#define nsTStringComparator_CharT           nsStringComparator
#define nsTDefaultStringComparator_CharT    nsDefaultStringComparator
#define nsTDependentString_CharT            nsDependentString
#define nsTDependentSubstring_CharT         nsDependentSubstring
#define nsTLiteralString_CharT              nsLiteralString
#define nsTXPIDLString_CharT                nsXPIDLString
#define nsTGetterCopies_CharT               nsGetterCopies
#define nsTAdoptingString_CharT             nsAdoptingString
#define nsTPromiseFlatString_CharT          nsPromiseFlatString
#define TPromiseFlatString_CharT            PromiseFlatString
# 14 "../../dist/include/nsDependentSubstring.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTDependentSubstring.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTDependentSubstring.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

/**
 * nsTDependentSubstring_CharT
 *
 * A string class which wraps an external array of string characters. It
 * is the client code's responsibility to ensure that the external buffer
 * remains valid for a long as the string is alive.
 *
 * NAMES:
 *   nsDependentSubstring for wide characters
 *   nsDependentCSubstring for narrow characters
 */
class nsTDependentSubstring_CharT : public nsTSubstring_CharT
{
public:

  typedef nsTDependentSubstring_CharT self_type;

public:

  void Rebind(const substring_type&, uint32_t aStartPos,
              uint32_t aLength = size_type(-1));

  void Rebind(const char_type* aData, size_type aLength);

  void Rebind(const char_type* aStart, const char_type* aEnd)
  {
    Rebind(aStart, size_type(aEnd - aStart));
  }

  nsTDependentSubstring_CharT(const substring_type& aStr, uint32_t aStartPos,
                              uint32_t aLength = size_type(-1))
    : substring_type()
  {
    Rebind(aStr, aStartPos, aLength);
  }

  nsTDependentSubstring_CharT(const char_type* aData, size_type aLength)
    : substring_type(const_cast<char_type*>(aData), aLength, F_NONE)
  {
  }

  nsTDependentSubstring_CharT(const char_type* aStart, const char_type* aEnd)
    : substring_type(const_cast<char_type*>(aStart), uint32_t(aEnd - aStart),
                     F_NONE)
  {
  }

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  nsTDependentSubstring_CharT(char16ptr_t aData, size_type aLength)
    : nsTDependentSubstring_CharT(static_cast<const char16_t*>(aData), aLength)
  {
  }

  nsTDependentSubstring_CharT(char16ptr_t aStart, char16ptr_t aEnd)
    : nsTDependentSubstring_CharT(static_cast<const char16_t*>(aStart),
                                  static_cast<const char16_t*>(aEnd))
  {
  }
#endif
# 67 "../../dist/include/nsTDependentSubstring.h"

  nsTDependentSubstring_CharT(const const_iterator& aStart,
                              const const_iterator& aEnd)
    : substring_type(const_cast<char_type*>(aStart.get()),
                     uint32_t(aEnd.get() - aStart.get()), F_NONE)
  {
  }

  // Create a nsTDependentSubstring to be bound later
  nsTDependentSubstring_CharT()
    : substring_type()
  {
  }

  // auto-generated copy-constructor OK (XXX really?? what about base class copy-ctor?)

private:
  // NOT USED
  void operator=(const self_type&);  // we're immutable, you can't assign into a substring
};

inline const nsTDependentSubstring_CharT
Substring(const nsTSubstring_CharT& aStr, uint32_t aStartPos,
          uint32_t aLength = uint32_t(-1))
{
  return nsTDependentSubstring_CharT(aStr, aStartPos, aLength);
}

inline const nsTDependentSubstring_CharT
Substring(const nsReadingIterator<CharT>& aStart,
          const nsReadingIterator<CharT>& aEnd)
{
  return nsTDependentSubstring_CharT(aStart.get(), aEnd.get());
}

inline const nsTDependentSubstring_CharT
Substring(const CharT* aData, uint32_t aLength)
{
  return nsTDependentSubstring_CharT(aData, aLength);
}

inline const nsTDependentSubstring_CharT
Substring(const CharT* aStart, const CharT* aEnd)
{
  return nsTDependentSubstring_CharT(aStart, aEnd);
}

inline const nsTDependentSubstring_CharT
StringHead(const nsTSubstring_CharT& aStr, uint32_t aCount)
{
  return nsTDependentSubstring_CharT(aStr, 0, aCount);
}

inline const nsTDependentSubstring_CharT
StringTail(const nsTSubstring_CharT& aStr, uint32_t aCount)
{
  return nsTDependentSubstring_CharT(aStr, aStr.Length() - aCount, aCount);
}
# 15 "../../dist/include/nsDependentSubstring.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "string-template-undef.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-undef.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#undef CharT
#define CharT                               char
#define CharT_is_char                       1
#define nsTAString_IncompatibleCharT        nsAString
#define nsTString_CharT                     nsCString
#define nsTFixedString_CharT                nsFixedCString
#define nsTAutoString_CharT                 nsAutoCString
#define nsTSubstring_CharT                  nsACString
#define nsTSubstringTuple_CharT             nsCSubstringTuple
#define nsTStringComparator_CharT           nsCStringComparator
#define nsTDefaultStringComparator_CharT    nsDefaultCStringComparator
#define nsTDependentString_CharT            nsDependentCString
#define nsTDependentSubstring_CharT         nsDependentCSubstring
#define nsTLiteralString_CharT              nsLiteralCString
#define nsTXPIDLString_CharT                nsXPIDLCString
#define nsTGetterCopies_CharT               nsCGetterCopies
#define nsTAdoptingString_CharT             nsAdoptingCString
#define nsTPromiseFlatString_CharT          nsPromiseFlatCString
#define TPromiseFlatString_CharT            PromiseFlatCString
# 19 "../../dist/include/nsDependentSubstring.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTDependentSubstring.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTDependentSubstring.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

/**
 * nsTDependentSubstring_CharT
 *
 * A string class which wraps an external array of string characters. It
 * is the client code's responsibility to ensure that the external buffer
 * remains valid for a long as the string is alive.
 *
 * NAMES:
 *   nsDependentSubstring for wide characters
 *   nsDependentCSubstring for narrow characters
 */
class nsTDependentSubstring_CharT : public nsTSubstring_CharT
{
public:

  typedef nsTDependentSubstring_CharT self_type;

public:

  void Rebind(const substring_type&, uint32_t aStartPos,
              uint32_t aLength = size_type(-1));

  void Rebind(const char_type* aData, size_type aLength);

  void Rebind(const char_type* aStart, const char_type* aEnd)
  {
    Rebind(aStart, size_type(aEnd - aStart));
  }

  nsTDependentSubstring_CharT(const substring_type& aStr, uint32_t aStartPos,
                              uint32_t aLength = size_type(-1))
    : substring_type()
  {
    Rebind(aStr, aStartPos, aLength);
  }

  nsTDependentSubstring_CharT(const char_type* aData, size_type aLength)
    : substring_type(const_cast<char_type*>(aData), aLength, F_NONE)
  {
  }

  nsTDependentSubstring_CharT(const char_type* aStart, const char_type* aEnd)
    : substring_type(const_cast<char_type*>(aStart), uint32_t(aEnd - aStart),
                     F_NONE)
  {
  }

  void operator=(const self_type&);  // we're immutable, you can't assign into a substring
};

inline const nsTDependentSubstring_CharT
Substring(const nsTSubstring_CharT& aStr, uint32_t aStartPos,
          uint32_t aLength = uint32_t(-1))
{
  return nsTDependentSubstring_CharT(aStr, aStartPos, aLength);
}

inline const nsTDependentSubstring_CharT
Substring(const nsReadingIterator<CharT>& aStart,
          const nsReadingIterator<CharT>& aEnd)
{
  return nsTDependentSubstring_CharT(aStart.get(), aEnd.get());
}

inline const nsTDependentSubstring_CharT
Substring(const CharT* aData, uint32_t aLength)
{
  return nsTDependentSubstring_CharT(aData, aLength);
}

inline const nsTDependentSubstring_CharT
Substring(const CharT* aStart, const CharT* aEnd)
{
  return nsTDependentSubstring_CharT(aStart, aEnd);
}

inline const nsTDependentSubstring_CharT
StringHead(const nsTSubstring_CharT& aStr, uint32_t aCount)
{
  return nsTDependentSubstring_CharT(aStr, 0, aCount);
}

#undef nsTGetterCopies_CharT
#undef nsTAdoptingString_CharT
#undef nsTPromiseFlatString_CharT
#undef TPromiseFlatString_CharT
# 21 "../../dist/include/nsDependentSubstring.h" 2

#endif /* !defined(nsDependentSubstring_h___) */
# 23 "../../dist/include/nsDependentSubstring.h"
# 14 "../../dist/include/nsString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsReadableUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsReadableUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#ifndef nsReadableUtils_h___
#define nsReadableUtils_h___

/**
 * I guess all the routines in this file are all mis-named.
 * According to our conventions, they should be |NS_xxx|.
 */
void ToUpperCase(const nsACString& aSource, nsACString& aDest);

void ToLowerCase(const nsACString& aSource, nsACString& aDest);

/**
 * Finds the leftmost occurrence of |aPattern|, if any in the range |aSearchStart|..|aSearchEnd|.
 *
 * Returns |true| if a match was found, and adjusts |aSearchStart| and |aSearchEnd| to
 * point to the match.  If no match was found, returns |false| and makes |aSearchStart == aSearchEnd|.
 *
 * Currently, this is equivalent to the O(m*n) implementation previously on |ns[C]String|.
 * If we need something faster, then we can implement that later.
 */

bool FindInReadable(const nsAString& aPattern, nsAString::const_iterator&,
                    nsAString::const_iterator&,
                    const nsStringComparator& = nsDefaultStringComparator());
bool FindInReadable(const nsACString& aPattern, nsACString::const_iterator&,
                    nsACString::const_iterator&,
                    const nsCStringComparator& = nsDefaultCStringComparator());

/* sometimes we don't care about where the string was, just that we
 * found it or not */
inline bool
FindInReadable(const nsAString& aPattern, const nsAString& aSource,
               const nsStringComparator& aCompare = nsDefaultStringComparator())
{
  nsAString::const_iterator start, end;
  aSource.BeginReading(start);
  aSource.EndReading(end);
  return FindInReadable(aPattern, start, end, aCompare);
}

inline bool
FindInReadable(const nsACString& aPattern, const nsACString& aSource,
               const nsCStringComparator& aCompare = nsDefaultCStringComparator())
{
  nsACString::const_iterator start, end;
  aSource.BeginReading(start);
  aSource.EndReading(end);
  return FindInReadable(aPattern, start, end, aCompare);
}


bool CaseInsensitiveFindInReadable(const nsACString& aPattern,
                                   nsACString::const_iterator&,
                                   nsACString::const_iterator&);

/**
 * Finds the rightmost occurrence of |aPattern|
 * Returns |true| if a match was found, and adjusts |aSearchStart| and |aSearchEnd| to
 * point to the match.  If no match was found, returns |false| and makes |aSearchStart == aSearchEnd|.
 *
bool FindCharInReadable(char16_t aChar, nsAString::const_iterator& aSearchStart,
                        const nsAString::const_iterator& aSearchEnd);
bool FindCharInReadable(char aChar, nsACString::const_iterator& aSearchStart,
                        const nsACString::const_iterator& aSearchEnd);

/**
* Finds the number of occurences of |aChar| in the string |aStr|
*/
uint32_t CountCharInReadable(const nsAString& aStr,
                             char16_t aChar);
uint32_t CountCharInReadable(const nsACString& aStr,
                             char aChar);

bool StringBeginsWith(const nsAString& aSource, const nsAString& aSubstring,
                      const nsStringComparator& aComparator =
                        nsDefaultStringComparator());
bool StringBeginsWith(const nsACString& aSource, const nsACString& aSubstring,
                      const nsCStringComparator& aComparator =
                        nsDefaultCStringComparator());
bool StringEndsWith(const nsAString& aSource, const nsAString& aSubstring,
                    const nsStringComparator& aComparator =
                      nsDefaultStringComparator());
bool StringEndsWith(const nsACString& aSource, const nsACString& aSubstring,
                    const nsCStringComparator& aComparator =
                      nsDefaultCStringComparator());

const nsAFlatString& EmptyString();
const nsAFlatCString& EmptyCString();

const nsAFlatString& NullString();
const nsAFlatCString& NullCString();

/**
* Compare a UTF-8 string to an UTF-16 string.
*
* Returns 0 if the strings are equal, -1 if aUTF8String is less
* than aUTF16Count, and 1 in the reverse case.  In case of fatal
* error (eg the strings are not valid UTF8 and UTF16 respectively),
* this method will return INT32_MIN.
*/
int32_t CompareUTF8toUTF16(const nsASingleFragmentCString& aUTF8String,
                           const nsASingleFragmentString& aUTF16String);

void AppendUCS4ToUTF16(const uint32_t aSource, nsAString& aDest);

template<class T>
inline bool
EnsureStringLength(T& aStr, uint32_t aLen)
{
  aStr.SetLength(aLen);
  return (aStr.Length() == aLen);
}

#endif // !defined(nsReadableUtils_h___)
# 434 "../../dist/include/nsReadableUtils.h"
# 15 "../../dist/include/nsString.h" 2

#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsString.h"

// enable support for the obsolete string API if not explicitly disabled
#ifndef MOZ_STRING_WITH_OBSOLETE_API
#define MOZ_STRING_WITH_OBSOLETE_API 1
#endif
# 22 "../../dist/include/nsString.h"

#if MOZ_STRING_WITH_OBSOLETE_API
// radix values for ToInteger/AppendInt
#define kRadix10        (10)
#define kRadix16        (16)
#define kAutoDetect     (100)
#define kRadixUnknown   (kAutoDetect+1)
#define IGNORE_CASE     (true)
#endif
# 31 "../../dist/include/nsString.h"


// declare nsString, et. al.
#if 0 /* expanded by -frewrite-includes */
#include "string-template-def-unichar.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-def-unichar.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#define CharT                               char16_t
#define CharT_is_PRUnichar                  1
#define nsTAString_IncompatibleCharT        nsACString
#define nsTString_CharT                     nsString
#define nsTFixedString_CharT                nsFixedString
#define nsTAutoString_CharT                 nsAutoString
#define nsTSubstring_CharT                  nsAString
#define nsTSubstringTuple_CharT             nsSubstringTuple
#define nsTStringComparator_CharT           nsStringComparator
#define nsTDefaultStringComparator_CharT    nsDefaultStringComparator
#define nsTDependentString_CharT            nsDependentString
#define nsTDependentSubstring_CharT         nsDependentSubstring
#define nsTLiteralString_CharT              nsLiteralString
#define nsTXPIDLString_CharT                nsXPIDLString
#define nsTGetterCopies_CharT               nsGetterCopies
#define nsTAdoptingString_CharT             nsAdoptingString
#define nsTPromiseFlatString_CharT          nsPromiseFlatString
#define TPromiseFlatString_CharT            PromiseFlatString
# 35 "../../dist/include/nsString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

/**
 * This is the canonical null-terminated string class.  All subclasses
 * promise null-terminated storage.  Instances of this class allocate
 * strings on the heap.
 *
 * NAMES:
 *   nsString for wide characters
 *   nsCString for narrow characters
 *
 * This class is also known as nsAFlat[C]String, where "flat" is used
 * to denote a null-terminated string.
 */
class nsTString_CharT : public nsTSubstring_CharT
{
public:

  typedef nsTString_CharT self_type;

public:

  /**
   * constructors
   */

  nsTString_CharT()
    : substring_type()
  {
  }

  explicit
  nsTString_CharT(const char_type* aData, size_type aLength = size_type(-1))
    : substring_type()
  {
    Assign(aData, aLength);
  }

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  explicit
  nsTString_CharT(char16ptr_t aStr, size_type aLength = size_type(-1))
    : substring_type()
  {
    Assign(static_cast<const char16_t*>(aStr), aLength);
  }
#endif
# 52 "../../dist/include/nsTString.h"

  nsTString_CharT(const self_type& aStr)
    : substring_type()
  {
    Assign(aStr);
  }

  MOZ_IMPLICIT nsTString_CharT(const substring_tuple_type& aTuple)
    : substring_type()
  {
    Assign(aTuple);
  }

  explicit
  nsTString_CharT(const substring_type& aReadable)
    : substring_type()
  {
    Assign(aReadable);
  }


  // |operator=| does not inherit, so we must define our own
  self_type& operator=(char_type aChar)
  {
    Assign(aChar);
    return *this;
  }
  self_type& operator=(const char_type* aData)
  {
    Assign(aData);
    return *this;
  }
  self_type& operator=(const self_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  self_type& operator=(const char16ptr_t aStr)
  {
    Assign(static_cast<const char16_t*>(aStr));
    return *this;
  }
#endif
# 96 "../../dist/include/nsTString.h"
  self_type& operator=(const substring_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_tuple_type& aTuple)
  {
    Assign(aTuple);
    return *this;
  }

  /**
   * returns the null-terminated string
   *
   * NOTE: unlike nsTSubstring::CharAt, this function allows you to index
   *       the null terminator character.
   */

  char_type CharAt(index_type aIndex) const
  {
    NS_ASSERTION(aIndex <= mLength, "index exceeds allowable range");
    return mData[aIndex];
  }

  char_type operator[](index_type aIndex) const
  {
    return CharAt(aIndex);
  }


#if MOZ_STRING_WITH_OBSOLETE_API


  /**
   *  Search for the given substring within this string.
   *
   *  @param   aString is substring to be sought in this
   *  @param   aIgnoreCase selects case sensitivity
   *  @param   aOffset tells us where in this string to start searching
   *  @param   aCount tells us how far from the offset we are to search. Use
   *           -1 to search the whole string.
   *  @return  offset in string, or kNotFound
   */

  int32_t Find(const nsCString& aString, bool aIgnoreCase = false,
               int32_t aOffset = 0, int32_t aCount = -1) const;
  int32_t Find(const char* aString, bool aIgnoreCase = false,
               int32_t aOffset = 0, int32_t aCount = -1) const;

#ifdef CharT_is_PRUnichar
  int32_t Find(const nsAFlatString& aString, int32_t aOffset = 0,
               int32_t aCount = -1) const;
  int32_t Find(const char16_t* aString, int32_t aOffset = 0,
               int32_t aCount = -1) const;
#ifdef MOZ_USE_CHAR16_WRAPPER
  int32_t Find(char16ptr_t aString, int32_t aOffset = 0,
               int32_t aCount = -1) const
  {
    return Find(static_cast<const char16_t*>(aString), aOffset, aCount);
  }
#endif
# 171 "../../dist/include/nsTString.h"
#endif
# 172 "../../dist/include/nsTString.h"


  /**
   * This methods scans the string backwards, looking for the given string
  /**
   * This method searches this string for the last character found in
   * the given string.
   *
   * @param aString contains set of chars to be found
   * @param aOffset tells us where in this string to start searching
   *        (counting from left)
   * @return offset in string, or kNotFound
   */


  /**
   *  swaps occurence of 1 string for another
   */

  void ReplaceChar(char_type aOldChar, char_type aNewChar);
  void ReplaceChar(const char* aSet, char_type aNewChar);
#ifdef CharT_is_PRUnichar
  void ReplaceChar(const char16_t* aSet, char16_t aNewChar);
#endif
# 389 "../../dist/include/nsTString.h"
  /**
   *
   *  @param   aEliminateLeading controls stripping of leading ws
   *  @param   aEliminateTrailing controls stripping of trailing ws
   */
  void CompressWhitespace(bool aEliminateLeading = true,
                          bool aEliminateTrailing = true);


  /**
   * assign/append/insert with _LOSSY_ conversion
   */

  void AssignWithConversion(const nsTAString_IncompatibleCharT& aString);
  void AssignWithConversion(const incompatible_char_type* aData,
                            int32_t aLength = -1);

#endif // !MOZ_STRING_WITH_OBSOLETE_API
# 438 "../../dist/include/nsTString.h"

  /**
   * Allow this string to be bound to a character buffer
   * until the string is rebound or mutated; the caller
   * must ensure that the buffer outlives the string.
   */
  void Rebind(const char_type* aData, size_type aLength);

  /**
   * verify restrictions for dependent strings
   */
  void AssertValidDependentString()
  {
    NS_ASSERTION(mData, "nsTDependentString must wrap a non-NULL buffer");
    NS_ASSERTION(mLength != size_type(-1), "nsTDependentString has bogus length");
    NS_ASSERTION(mData[mLength] == 0,
                 "nsTDependentString must wrap only null-terminated strings. "
                 "You are probably looking for nsTDependentSubstring.");
  }


protected:

  explicit
  nsTString_CharT(uint32_t aFlags)
    : substring_type(aFlags)
  {
  }

  // allow subclasses to initialize fields directly
  nsTString_CharT(char_type* aData, size_type aLength, uint32_t aFlags)
    : substring_type(aData, aLength, aFlags)
  {
  }

  struct Segment {
    uint32_t mBegin, mLength;
    Segment(uint32_t aBegin, uint32_t aLength)
      : mBegin(aBegin)
      , mLength(aLength)
    {}
  };
};


class nsTFixedString_CharT : public nsTString_CharT
{
public:

  typedef nsTFixedString_CharT self_type;
  typedef nsTFixedString_CharT fixed_string_type;

public:

  /**
   * @param aData
   *        fixed-size buffer to be used by the string (the contents of
   *        this buffer may be modified by the string)
   * @param aStorageSize
   *        the size of the fixed buffer
   * @param aLength (optional)
   *        the length of the string already contained in the buffer
   */

  nsTFixedString_CharT(char_type* aData, size_type aStorageSize)
    : string_type(aData, uint32_t(char_traits::length(aData)),
                  F_TERMINATED | F_FIXED | F_CLASS_FIXED)
    , mFixedCapacity(aStorageSize - 1)
    , mFixedBuf(aData)
  {
  }

  nsTFixedString_CharT(char_type* aData, size_type aStorageSize,
                       size_type aLength)
    : string_type(aData, aLength, F_TERMINATED | F_FIXED | F_CLASS_FIXED)
    , mFixedCapacity(aStorageSize - 1)
    , mFixedBuf(aData)
  {
    // null-terminate
    mFixedBuf[aLength] = char_type(0);
  }

  // |operator=| does not inherit, so we must define our own
  self_type& operator=(char_type aChar)
  {
    Assign(aChar);
    return *this;
  }
  self_type& operator=(const char_type* aData)
  {
    Assign(aData);
    return *this;
  }
  self_type& operator=(const substring_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_tuple_type& aTuple)
  {
    Assign(aTuple);
    return *this;
  }

protected:

  friend class nsTSubstring_CharT;

  size_type  mFixedCapacity;
  char_type* mFixedBuf;
};


/**
 * nsTAutoString_CharT
 *
 * Subclass of nsTString_CharT that adds support for stack-based string
 * allocation.  It is normally not a good idea to use this class on the
 * heap, because it will allocate space which may be wasted if the string
 * it contains is significantly smaller or any larger than 64 characters.
 *
 * NAMES:
 *   nsAutoString for wide characters
 *   nsAutoCString for narrow characters
 */
class nsTAutoString_CharT : public nsTFixedString_CharT
{
public:

  typedef nsTAutoString_CharT self_type;

public:

  /**
   * constructors
   */

  nsTAutoString_CharT()
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
  }

  explicit
  nsTAutoString_CharT(char_type aChar)
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
    Assign(aChar);
  }

  explicit
  nsTAutoString_CharT(const char_type* aData, size_type aLength = size_type(-1))
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
    Assign(aData, aLength);
  }

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  explicit
  nsTAutoString_CharT(char16ptr_t aData, size_type aLength = size_type(-1))
    : nsTAutoString_CharT(static_cast<const char16_t*>(aData), aLength)
  {
  }
#endif
# 601 "../../dist/include/nsTString.h"

  nsTAutoString_CharT(const self_type& aStr)
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
    Assign(aStr);
  }

  explicit
  nsTAutoString_CharT(const substring_type& aStr)
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
    Assign(aStr);
  }

  MOZ_IMPLICIT nsTAutoString_CharT(const substring_tuple_type& aTuple)
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
    Assign(aTuple);
  }

  // |operator=| does not inherit, so we must define our own
  self_type& operator=(char_type aChar)
  {
    Assign(aChar);
    return *this;
  }
  self_type& operator=(const char_type* aData)
  {
    Assign(aData);
    return *this;
  }
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  self_type& operator=(char16ptr_t aStr)
  {
    Assign(aStr);
    return *this;
  }
#endif
# 639 "../../dist/include/nsTString.h"
  self_type& operator=(const self_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_tuple_type& aTuple)
  {
    Assign(aTuple);
    return *this;
  }

  enum
  {
    kDefaultStorageSize = 64
  };

private:

  char_type mStorage[kDefaultStorageSize];
};


/**
 * nsTXPIDLString extends nsTString such that:
 *
 *   (1) mData can be null
 *   (2) objects of this type can be automatically cast to |const CharT*|
 *   (3) getter_Copies method is supported to adopt data allocated with
 *       NS_Alloc, such as "out string" parameters in XPIDL.
 *
 * NAMES:
 *   nsXPIDLString for wide characters
 *   nsXPIDLCString for narrow characters
 */
class nsTXPIDLString_CharT : public nsTString_CharT
{
public:

  typedef nsTXPIDLString_CharT self_type;

public:

  nsTXPIDLString_CharT()
    : string_type(char_traits::sEmptyBuffer, 0, F_TERMINATED | F_VOIDED)
  {
  }

  // copy-constructor required to avoid default
  nsTXPIDLString_CharT(const self_type& aStr)
    : string_type(char_traits::sEmptyBuffer, 0, F_TERMINATED | F_VOIDED)
  {
    Assign(aStr);
  }

  // return nullptr if we are voided
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  char16ptr_t get() const
#else
# 733 "../../dist/include/nsTString.h"
  const char_type* get() const
#endif
# 735 "../../dist/include/nsTString.h"
  {
    return (mFlags & F_VOIDED) ? nullptr : mData;
  }

  // this case operator is the reason why this class cannot just be a
  // typedef for nsTString
  operator const char_type*() const
  {
    return get();
  }

  // need this to diambiguous operator[int]
  char_type operator[](int32_t aIndex) const
  {
    return CharAt(index_type(aIndex));
  }

  // |operator=| does not inherit, so we must define our own
  self_type& operator=(char_type aChar)
  {
    Assign(aChar);
    return *this;
  }
  self_type& operator=(const char_type* aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const self_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_tuple_type& aTuple)
  {
    Assign(aTuple);
    return *this;
  }
};


/**
 * getter_Copies support for use with raw string out params:
 *
 *    NS_IMETHOD GetBlah(char**);
 *
 */
class nsTAdoptingString_CharT : public nsTXPIDLString_CharT
{
public:

  typedef nsTAdoptingString_CharT self_type;

public:

  explicit nsTAdoptingString_CharT()
  {
  }
  explicit nsTAdoptingString_CharT(char_type* aStr,
                                   size_type aLength = size_type(-1))
  {
    Adopt(aStr, aLength);
  }
  self_type& operator=(const substring_tuple_type& aTuple)
  {
    Assign(aTuple);
    return *this;
  }

  // Adopt(), if possible, when assigning to a self_type&. Note
  // that this violates the constness of aStr, aStr is always
  // truncated when this operator is called.
  self_type& operator=(const self_type& aStr);

private:
  self_type& operator=(const char_type* aData) = delete;
  self_type& operator=(char_type* aData) = delete;
};
#undef TPromiseFlatString_CharT
# 37 "../../dist/include/nsString.h" 2

// declare nsCString, et. al.
#if 0 /* expanded by -frewrite-includes */
#include "string-template-def-char.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-def-char.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#define CharT                               char
#define CharT_is_char                       1
#define nsTAString_IncompatibleCharT        nsAString
#define nsTString_CharT                     nsCString
#define nsTFixedString_CharT                nsFixedCString
#define nsTAutoString_CharT                 nsAutoCString
#define nsTSubstring_CharT                  nsACString
#define nsTSubstringTuple_CharT             nsCSubstringTuple
#define nsTStringComparator_CharT           nsCStringComparator
#define nsTDefaultStringComparator_CharT    nsDefaultCStringComparator
#define nsTDependentString_CharT            nsDependentCString
#define nsTDependentSubstring_CharT         nsDependentCSubstring
#define nsTLiteralString_CharT              nsLiteralCString
#define nsTXPIDLString_CharT                nsXPIDLCString
#define nsTGetterCopies_CharT               nsCGetterCopies
#define nsTAdoptingString_CharT             nsAdoptingCString
#define nsTPromiseFlatString_CharT          nsPromiseFlatCString
#define TPromiseFlatString_CharT            PromiseFlatCString
# 40 "../../dist/include/nsString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

/**
 * This is the canonical null-terminated string class.  All subclasses
 * promise null-terminated storage.  Instances of this class allocate
 * strings on the heap.
 *
 * NAMES:
 *   nsString for wide characters
 *   nsCString for narrow characters
 *
 * This class is also known as nsAFlat[C]String, where "flat" is used
 * to denote a null-terminated string.
 */
class nsTString_CharT : public nsTSubstring_CharT
{
public:

  typedef nsTString_CharT self_type;

public:

  /**
   * constructors
   */

  nsTString_CharT()
    : substring_type()
  {
  }

  explicit
  nsTString_CharT(const char_type* aData, size_type aLength = size_type(-1))
    : substring_type()
  {
    Assign(aData, aLength);
  }

  MOZ_IMPLICIT nsTString_CharT(const substring_tuple_type& aTuple)
    : substring_type()
  {
    Assign(aTuple);
  }

  explicit
  nsTString_CharT(const substring_type& aReadable)
    : substring_type()
  {
    Assign(aReadable);
  }


  // |operator=| does not inherit, so we must define our own
  self_type& operator=(char_type aChar)
  {
    Assign(aChar);
    return *this;
  }
  self_type& operator=(const char_type* aData)
  {
    Assign(aData);
    return *this;
  }
  self_type& operator=(const self_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  self_type& operator=(const char16ptr_t aStr)
  {
    Assign(static_cast<const char16_t*>(aStr));
    return *this;
  }
#endif
# 96 "../../dist/include/nsTString.h"
  self_type& operator=(const substring_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_tuple_type& aTuple)
  {
    Assign(aTuple);
    return *this;
  }

  /**
   * returns the null-terminated string
   */

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  char16ptr_t get() const
#else
# 114 "../../dist/include/nsTString.h"
  const char_type* get() const
#endif
# 116 "../../dist/include/nsTString.h"
  {
    return mData;
  }


  /**
   * returns character at specified index.
   *
   * NOTE: unlike nsTSubstring::CharAt, this function allows you to index
   *       the null terminator character.
   */

  char_type CharAt(index_type aIndex) const
  {
    NS_ASSERTION(aIndex <= mLength, "index exceeds allowable range");
    return mData[aIndex];
  }

  char_type operator[](index_type aIndex) const
  {
    return CharAt(aIndex);
  }


#if MOZ_STRING_WITH_OBSOLETE_API


  /**
   *  Search for the given substring within this string.
   *  @return  this
   */
  void Trim(const char* aSet, bool aEliminateLeading = true,
            bool aEliminateTrailing = true, bool aIgnoreQuotes = false);

  /**
   *  This method strips whitespace from string.
   *  You can control whether whitespace is yanked from start and end of
   *  string as well.
   *
   *  @param   aEliminateLeading controls stripping of leading ws
   *  @param   aEliminateTrailing controls stripping of trailing ws
   */
  void CompressWhitespace(bool aEliminateLeading = true,
                          bool aEliminateTrailing = true);


  /**
   * assign/append/insert with _LOSSY_ conversion
   */

  void AssignWithConversion(const nsTAString_IncompatibleCharT& aString);
  void AssignWithConversion(const incompatible_char_type* aData,
                            int32_t aLength = -1);

#endif // !MOZ_STRING_WITH_OBSOLETE_API
# 438 "../../dist/include/nsTString.h"

  /**
   * Allow this string to be bound to a character buffer
   * until the string is rebound or mutated; the caller
   * must ensure that the buffer outlives the string.
   */
  void Rebind(const char_type* aData, size_type aLength);

  /**
   * verify restrictions for dependent strings
   */
  void AssertValidDependentString()
  {
    NS_ASSERTION(mData, "nsTDependentString must wrap a non-NULL buffer");
    NS_ASSERTION(mLength != size_type(-1), "nsTDependentString has bogus length");
    NS_ASSERTION(mData[mLength] == 0,
                 "nsTDependentString must wrap only null-terminated strings. "
                 "You are probably looking for nsTDependentSubstring.");
  }


protected:

  explicit
  nsTString_CharT(uint32_t aFlags)
    : substring_type(aFlags)
  {
  }

  // allow subclasses to initialize fields directly
  nsTString_CharT(char_type* aData, size_type aLength, uint32_t aFlags)
    : substring_type(aData, aLength, aFlags)
  {
  }

  struct Segment {
    uint32_t mBegin, mLength;
    Segment(uint32_t aBegin, uint32_t aLength)
      : mBegin(aBegin)
      , mLength(aLength)
    {}
  };
};


class nsTFixedString_CharT : public nsTString_CharT
{
public:

  typedef nsTFixedString_CharT self_type;
  typedef nsTFixedString_CharT fixed_string_type;

public:

  /**
   * @param aData
   *        fixed-size buffer to be used by the string (the contents of
   *        this buffer may be modified by the string)
   * @param aStorageSize
   *        the size of the fixed buffer
   * @param aLength (optional)
   *        the length of the string already contained in the buffer
   */

  nsTFixedString_CharT(char_type* aData, size_type aStorageSize)
    : string_type(aData, uint32_t(char_traits::length(aData)),
                  F_TERMINATED | F_FIXED | F_CLASS_FIXED)
    , mFixedCapacity(aStorageSize - 1)
    , mFixedBuf(aData)
  {
  }

  nsTFixedString_CharT(char_type* aData, size_type aStorageSize,
                       size_type aLength)
    : string_type(aData, aLength, F_TERMINATED | F_FIXED | F_CLASS_FIXED)
    , mFixedCapacity(aStorageSize - 1)
    , mFixedBuf(aData)
  {
    // null-terminate
    mFixedBuf[aLength] = char_type(0);
  }

  // |operator=| does not inherit, so we must define our own
  self_type& operator=(char_type aChar)
  {
    Assign(aChar);
    return *this;
  }
  self_type& operator=(const char_type* aData)
  {
    Assign(aData);
    return *this;
  }
  self_type& operator=(const substring_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_tuple_type& aTuple)
  {
    Assign(aTuple);
    return *this;
  }

protected:

  friend class nsTSubstring_CharT;

  size_type  mFixedCapacity;
  char_type* mFixedBuf;
};


/**
 * nsTAutoString_CharT
 *
 * Subclass of nsTString_CharT that adds support for stack-based string
 * allocation.  It is normally not a good idea to use this class on the
 * heap, because it will allocate space which may be wasted if the string
 * it contains is significantly smaller or any larger than 64 characters.
 *
 * NAMES:
 *   nsAutoString for wide characters
 *   nsAutoCString for narrow characters
 */
class nsTAutoString_CharT : public nsTFixedString_CharT
{
public:

  typedef nsTAutoString_CharT self_type;

public:

  /**
   * constructors
   */

  nsTAutoString_CharT()
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
  }

  explicit
  nsTAutoString_CharT(char_type aChar)
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
    Assign(aChar);
  }

  explicit
  nsTAutoString_CharT(const char_type* aData, size_type aLength = size_type(-1))
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
    Assign(aData, aLength);
  }
  explicit
  nsTAutoString_CharT(const substring_type& aStr)
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
    Assign(aStr);
  }

  MOZ_IMPLICIT nsTAutoString_CharT(const substring_tuple_type& aTuple)
    : fixed_string_type(mStorage, kDefaultStorageSize, 0)
  {
    Assign(aTuple);
  }

  // |operator=| does not inherit, so we must define our own
  self_type& operator=(char_type aChar)
  {
    Assign(aChar);
    return *this;
  }
  self_type& operator=(const char_type* aData)
  {
    Assign(aData);
    return *this;
  }
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  self_type& operator=(char16ptr_t aStr)
  {
    Assign(aStr);
    return *this;
  }
#endif
# 639 "../../dist/include/nsTString.h"
  enum
  {
    kDefaultStorageSize = 64
  };

private:

  char_type mStorage[kDefaultStorageSize];
};


//
// nsAutoString stores pointers into itself which are invalidated when an
// nsTArray is resized, so nsTArray must not be instantiated with nsAutoString
// elements!
//
template<class E> class nsTArrayElementTraits;
template<>
class nsTArrayElementTraits<nsTAutoString_CharT>
{
public:
  template<class A> struct Dont_Instantiate_nsTArray_of;
  template<class A> struct Instead_Use_nsTArray_of;

  static Dont_Instantiate_nsTArray_of<nsTAutoString_CharT>*
  Construct(Instead_Use_nsTArray_of<nsTString_CharT>* aE)
  {
    return 0;
  }
  template<class A>
  static Dont_Instantiate_nsTArray_of<nsTAutoString_CharT>*
  Construct(Instead_Use_nsTArray_of<nsTString_CharT>* aE, const A& aArg)
  {
    return 0;
  }
  static Dont_Instantiate_nsTArray_of<nsTAutoString_CharT>*
  Destruct(Instead_Use_nsTArray_of<nsTString_CharT>* aE)
  {
    return 0;
  }
};

/**
 * nsTXPIDLString extends nsTString such that:
 *
 *   (1) mData can be null
 *   (2) objects of this type can be automatically cast to |const CharT*|
 *   (3) getter_Copies method is supported to adopt data allocated with
 *       NS_Alloc, such as "out string" parameters in XPIDL.
 *
 * NAMES:
 *   nsXPIDLString for wide characters
 *   nsXPIDLCString for narrow characters
 */
class nsTXPIDLString_CharT : public nsTString_CharT
{
public:

  typedef nsTXPIDLString_CharT self_type;

public:

  nsTXPIDLString_CharT()
    : string_type(char_traits::sEmptyBuffer, 0, F_TERMINATED | F_VOIDED)
  {
  }

  // copy-constructor required to avoid default
  nsTXPIDLString_CharT(const self_type& aStr)
    : string_type(char_traits::sEmptyBuffer, 0, F_TERMINATED | F_VOIDED)
  {
    Assign(aStr);
  }

  // return nullptr if we are voided
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  char16ptr_t get() const
#else
# 733 "../../dist/include/nsTString.h"
  const char_type* get() const
#endif
# 735 "../../dist/include/nsTString.h"
  {
    return (mFlags & F_VOIDED) ? nullptr : mData;
  }

  // this case operator is the reason why this class cannot just be a
  // typedef for nsTString
  operator const char_type*() const
  {
    return get();
  }

  // need this to diambiguous operator[int]
  char_type operator[](int32_t aIndex) const
  {
    return CharAt(index_type(aIndex));
  }

  // |operator=| does not inherit, so we must define our own
  self_type& operator=(char_type aChar)
  {
    Assign(aChar);
    return *this;
  }
  self_type& operator=(const char_type* aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const self_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_type& aStr)
  {
    Assign(aStr);
    return *this;
  }
  self_type& operator=(const substring_tuple_type& aTuple)
  {
    Assign(aTuple);
    return *this;
  }
};


/**
 * getter_Copies support for use with raw string out params:
 *
 *    NS_IMETHOD GetBlah(char**);
 *
 *    void some_function()
 *    {
 *      nsXPIDLCString blah;
 *      GetBlah(getter_Copies(blah));
 *      // ...
 *    }
 */
class MOZ_STACK_CLASS nsTGetterCopies_CharT
{
public:
  typedef CharT char_type;

  explicit nsTGetterCopies_CharT(nsTSubstring_CharT& aStr)
    : mString(aStr)
    , mData(nullptr)
  {
  }

  ~nsTGetterCopies_CharT()
  {
    mString.Adopt(mData); // OK if mData is null
  }

  operator char_type**()
  {
    return &mData;
  }

private:
  nsTSubstring_CharT& mString;
  char_type* mData;
};

inline nsTGetterCopies_CharT
getter_Copies(nsTSubstring_CharT& aString)
{
  return nsTGetterCopies_CharT(aString);
}


/**
 * nsTAdoptingString extends nsTXPIDLString such that:
 *
 * (1) Adopt given string on construction or assignment, i.e. take
 * the value of what's given, and make what's given forget its
 * value. Note that this class violates constness in a few
 * places. Be careful!
 */
class nsTAdoptingString_CharT : public nsTXPIDLString_CharT
{
public:

  typedef nsTAdoptingString_CharT self_type;

public:
  // Adopt(), if possible, when assigning to a self_type&. Note
  // that this violates the constness of aStr, aStr is always
  // truncated when this operator is called.
  self_type& operator=(const self_type& aStr);

private:
  self_type& operator=(const char_type* aData) = delete;
  self_type& operator=(char_type* aData) = delete;
};

# 41 "../../dist/include/nsString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "string-template-undef.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-undef.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsDependentString_h___
#define nsDependentString_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsString_h___
#define nsString_h___
#ifdef MOZ_USE_CHAR16_WRAPPER
  explicit NS_LossyConvertUTF16toASCII(char16ptr_t aString)
    : NS_LossyConvertUTF16toASCII(static_cast<const char16_t*>(aString))
  {
  }
#else
# 193 "../../dist/include/nsString.h"

inline char16_t*
#endif /* expanded by -frewrite-includes */
# 212 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 213 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include "plhash.h"
#endif /* expanded by -frewrite-includes */
# 214 "../../dist/include/nsString.h"

#endif // !defined(nsString_h___)
# 216 "../../dist/include/nsString.h"
# 11 "../../dist/include/nsDependentString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsDependentString.h"

// declare nsDependentString
#if 0 /* expanded by -frewrite-includes */
#include "string-template-def-unichar.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-def-unichar.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#define CharT                               char16_t
#define CharT_is_PRUnichar                  1
#define nsTAString_IncompatibleCharT        nsACString
#define nsTString_CharT                     nsString
#define nsTFixedString_CharT                nsFixedString
#define nsTAutoString_CharT                 nsAutoString
#define nsTSubstring_CharT                  nsAString
#define nsTSubstringTuple_CharT             nsSubstringTuple
#define nsTStringComparator_CharT           nsStringComparator
#define nsTDefaultStringComparator_CharT    nsDefaultStringComparator
#define nsTDependentString_CharT            nsDependentString
#define nsTDependentSubstring_CharT         nsDependentSubstring
#define nsTLiteralString_CharT              nsLiteralString
#define nsTXPIDLString_CharT                nsXPIDLString
#define nsTGetterCopies_CharT               nsGetterCopies
#define nsTAdoptingString_CharT             nsAdoptingString
#define nsTPromiseFlatString_CharT          nsPromiseFlatString
#define TPromiseFlatString_CharT            PromiseFlatString
# 15 "../../dist/include/nsDependentString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTDependentString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTDependentString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/**
 * nsTDependentString_CharT
 *
 * Stores a null-terminated, immutable sequence of characters.
 *
 * Subclass of nsTString that restricts string value to an immutable
 * character sequence.  This class does not own its data, so the creator
 * of objects of this type must take care to ensure that a
 * nsTDependentString continues to reference valid memory for the
 * duration of its use.
 */
class nsTDependentString_CharT : public nsTString_CharT
{
public:

  typedef nsTDependentString_CharT self_type;

public:

  /**
   * constructors
   */

  nsTDependentString_CharT(const char_type* aStart, const char_type* aEnd)
    : string_type(const_cast<char_type*>(aStart),
                  uint32_t(aEnd - aStart), F_TERMINATED)
  {
    AssertValidDependentString();
  }

  nsTDependentString_CharT(const char_type* aData, uint32_t aLength)
    : string_type(const_cast<char_type*>(aData), aLength, F_TERMINATED)
  {
    AssertValidDependentString();
  }

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  nsTDependentString_CharT(char16ptr_t aData, uint32_t aLength)
    : nsTDependentString_CharT(static_cast<const char16_t*>(aData), aLength)
  {
  }
#endif
# 50 "../../dist/include/nsTDependentString.h"

  explicit
  nsTDependentString_CharT(const char_type* aData)
    : string_type(const_cast<char_type*>(aData),
                  uint32_t(char_traits::length(aData)), F_TERMINATED)
  {
    AssertValidDependentString();
  }

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  explicit
  nsTDependentString_CharT(char16ptr_t aData)
    : nsTDependentString_CharT(static_cast<const char16_t*>(aData))
  {
  }
#endif
# 66 "../../dist/include/nsTDependentString.h"

  nsTDependentString_CharT(const string_type& aStr, uint32_t aStartPos)
    : string_type()
  {
    Rebind(aStr, aStartPos);
  }

  // Create a nsTDependentSubstring to be bound later
  nsTDependentString_CharT()
    : string_type()
  {
  }

  // XXX are you sure??
  // auto-generated copy-constructor OK
  // auto-generated copy-assignment operator OK
  // auto-generated destructor OK


  /**
   * allow this class to be bound to a different string...
   */

  using nsTString_CharT::Rebind;
  void Rebind(const char_type* aData)
  {
    Rebind(aData, uint32_t(char_traits::length(aData)));
  }

  void Rebind(const char_type* aStart, const char_type* aEnd)
  {
    Rebind(aStart, uint32_t(aEnd - aStart));
  }

  void Rebind(const string_type&, uint32_t aStartPos);

private:

  // NOT USED
  nsTDependentString_CharT(const substring_tuple_type&) = delete;
};
# 16 "../../dist/include/nsDependentString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "string-template-undef.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-undef.h" 1
# 1 "../../dist/include/string-template-def-char.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#define CharT                               char
#define CharT_is_char                       1
#define nsTAString_IncompatibleCharT        nsAString
#define nsTString_CharT                     nsCString
#define nsTFixedString_CharT                nsFixedCString
#define nsTAutoString_CharT                 nsAutoCString
#define nsTSubstring_CharT                  nsACString
#define nsTSubstringTuple_CharT             nsCSubstringTuple
#define nsTStringComparator_CharT           nsCStringComparator
#define nsTDefaultStringComparator_CharT    nsDefaultCStringComparator
#define nsTDependentString_CharT            nsDependentCString
#define nsTDependentSubstring_CharT         nsDependentCSubstring
#define nsTLiteralString_CharT              nsLiteralCString
#define nsTXPIDLString_CharT                nsXPIDLCString
#define nsTGetterCopies_CharT               nsCGetterCopies
#define nsTAdoptingString_CharT             nsAdoptingCString
#define nsTPromiseFlatString_CharT          nsPromiseFlatCString
#define TPromiseFlatString_CharT            PromiseFlatCString
# 20 "../../dist/include/nsDependentString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTDependentString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTDependentString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/**
 * nsTDependentString_CharT
 *
 * Stores a null-terminated, immutable sequence of characters.
 *
 * Subclass of nsTString that restricts string value to an immutable
 * character sequence.  This class does not own its data, so the creator
 * of objects of this type must take care to ensure that a
 * nsTDependentString continues to reference valid memory for the
 * duration of its use.
 */
class nsTDependentString_CharT : public nsTString_CharT
{
public:

  typedef nsTDependentString_CharT self_type;

public:

  /**
   * constructors
   */

  nsTDependentString_CharT(const char_type* aStart, const char_type* aEnd)
    : string_type(const_cast<char_type*>(aStart),
                  uint32_t(aEnd - aStart), F_TERMINATED)
  {
    AssertValidDependentString();
  }

  nsTDependentString_CharT(const char_type* aData, uint32_t aLength)
    : string_type(const_cast<char_type*>(aData), aLength, F_TERMINATED)
  {
    AssertValidDependentString();
  }

#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
  nsTDependentString_CharT(char16ptr_t aData, uint32_t aLength)
    : nsTDependentString_CharT(static_cast<const char16_t*>(aData), aLength)
  {
  }
#endif
  // XXX are you sure??
  // auto-generated copy-constructor OK
  // auto-generated copy-assignment operator OK
  // auto-generated destructor OK


  /**
   * allow this class to be bound to a different string...
   */

  using nsTString_CharT::Rebind;
  void Rebind(const char_type* aData)
  {
    Rebind(aData, uint32_t(char_traits::length(aData)));
  }

  void Rebind(const char_type* aStart, const char_type* aEnd)
  {
    Rebind(aStart, uint32_t(aEnd - aStart));
  }

  void Rebind(const string_type&, uint32_t aStartPos);

private:

  // NOT USED
  nsTDependentString_CharT(const substring_tuple_type&) = delete;
};
# 21 "../../dist/include/nsDependentString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "string-template-undef.h"
#endif /* expanded by -frewrite-includes */
#undef nsTSubstringTuple_CharT
#undef nsTStringComparator_CharT
#undef nsTDefaultStringComparator_CharT
#undef nsTDependentString_CharT
#undef nsTDependentSubstring_CharT
#undef nsTLiteralString_CharT
#undef nsTXPIDLString_CharT
#undef nsTGetterCopies_CharT
#undef nsTAdoptingString_CharT
#undef nsTPromiseFlatString_CharT
#undef TPromiseFlatString_CharT
# 22 "../../dist/include/nsDependentString.h" 2

#endif /* !defined(nsDependentString_h___) */
# 24 "../../dist/include/nsDependentString.h"
# 206 "../../dist/include/nsString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsLiteralString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsLiteralString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsLiteralString_h___
#define nsLiteralString_h___

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsLiteralString.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsString_h___
#define nsString_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsString.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsSubstring.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDependentSubstring.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsReadableUtils.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsString.h"

#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsString.h"

// enable support for the obsolete string API if not explicitly disabled
#ifndef MOZ_STRING_WITH_OBSOLETE_API
#define MOZ_STRING_WITH_OBSOLETE_API 1
#endif
# 22 "../../dist/include/nsString.h"

#if MOZ_STRING_WITH_OBSOLETE_API
// radix values for ToInteger/AppendInt
#define kRadix10        (10)
#define kRadix16        (16)
#define kAutoDetect     (100)
#include "string-template-undef.h"
#endif /* expanded by -frewrite-includes */
# 37 "../../dist/include/nsString.h"
private:
  // NOT TO BE IMPLEMENTED
  NS_ConvertUTF16toUTF8(char) = delete;
};


class NS_ConvertUTF8toUTF16 : public nsAutoString
{
public:
  explicit NS_ConvertUTF8toUTF16(const char* aCString)
  {
    AppendUTF8toUTF16(aCString, *this);
  }

#ifdef MOZ_USE_CHAR16_WRAPPER

inline char16_t*
wwc(wchar_t* aStr)
{
  return reinterpret_cast<char16_t*>(aStr);
}

inline wchar_t*
wwc(char16_t* aStr)
{
  return reinterpret_cast<wchar_t*>(aStr);
}

#else
#endif /* expanded by -frewrite-includes */
# 206 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsLiteralString.h"
#endif /* expanded by -frewrite-includes */
# 207 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsPromiseFlatString.h"
#endif /* expanded by -frewrite-includes */
# 208 "../../dist/include/nsString.h"

// need to include these for backwards compatibility
#if 0 /* expanded by -frewrite-includes */
#include "nsMemory.h"
#endif /* expanded by -frewrite-includes */
# 211 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 212 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 213 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include "plhash.h"
#endif /* expanded by -frewrite-includes */
# 214 "../../dist/include/nsString.h"

#endif // !defined(nsString_h___)
# 216 "../../dist/include/nsString.h"
# 12 "../../dist/include/nsLiteralString.h" 2

// declare nsLiteralString
#if 0 /* expanded by -frewrite-includes */
#include "string-template-def-unichar.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-def-unichar.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#define CharT                               char16_t
#define CharT_is_PRUnichar                  1
#define nsTAString_IncompatibleCharT        nsACString
#define nsTString_CharT                     nsString
#define nsTFixedString_CharT                nsFixedString
#define nsTAutoString_CharT                 nsAutoString
#define nsTSubstring_CharT                  nsAString
#define nsTSubstringTuple_CharT             nsSubstringTuple
#define nsTStringComparator_CharT           nsStringComparator
#define nsTDefaultStringComparator_CharT    nsDefaultStringComparator
#define nsTDependentString_CharT            nsDependentString
#define nsTDependentSubstring_CharT         nsDependentSubstring
#define nsTLiteralString_CharT              nsLiteralString
#define nsTXPIDLString_CharT                nsXPIDLString
#define nsTGetterCopies_CharT               nsGetterCopies
#define nsTAdoptingString_CharT             nsAdoptingString
#define nsTPromiseFlatString_CharT          nsPromiseFlatString
#define TPromiseFlatString_CharT            PromiseFlatString
# 15 "../../dist/include/nsLiteralString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTLiteralString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTLiteralString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/**
 * nsTLiteralString_CharT
 *
 * Stores a null-terminated, immutable sequence of characters.
 *
 * Subclass of nsTString that restricts string value to a literal
 * character sequence.  This class does not own its data. The data is
 * assumed to be permanent. In practice this is true because this code
 * is only usable by and for libxul.
 */
class nsTLiteralString_CharT : public nsTString_CharT
{
public:

  typedef nsTLiteralString_CharT self_type;

public:

  /**
   * constructor
   */

  template<size_type N>
  nsTLiteralString_CharT(const char_type (&aStr)[N])
    : string_type(const_cast<char_type*>(aStr), N - 1, F_TERMINATED | F_LITERAL)
  {
  }

private:

  // NOT TO BE IMPLEMENTED
  template<size_type N>
  nsTLiteralString_CharT(char_type (&aStr)[N]) = delete;
};
# 16 "../../dist/include/nsLiteralString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "string-template-undef.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-undef.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#undef CharT
#undef CharT_is_PRUnichar
#undef CharT_is_char
#undef nsTAString_IncompatibleCharT
#undef nsTString_CharT
#undef nsTFixedString_CharT
#undef nsTAutoString_CharT
#undef nsTSubstring_CharT
#undef nsTSubstringTuple_CharT
#undef nsTStringComparator_CharT
#undef nsTDefaultStringComparator_CharT
#undef nsTDependentString_CharT
#undef nsTDependentSubstring_CharT
#undef nsTLiteralString_CharT
#undef nsTXPIDLString_CharT
#undef nsTGetterCopies_CharT
#undef nsTAdoptingString_CharT
#undef nsTPromiseFlatString_CharT
#undef TPromiseFlatString_CharT
# 17 "../../dist/include/nsLiteralString.h" 2

// declare nsLiteralCString
#if 0 /* expanded by -frewrite-includes */
#include "string-template-def-char.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-def-char.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsString.h"

#define CharT                               char
#define CharT_is_char                       1
#define nsTAString_IncompatibleCharT        nsAString
#define nsTString_CharT                     nsCString
#define nsTFixedString_CharT                nsFixedCString
#define nsTAutoString_CharT                 nsAutoCString
#define nsTSubstring_CharT                  nsACString
#define nsTSubstringTuple_CharT             nsCSubstringTuple
#define nsTStringComparator_CharT           nsCStringComparator
#define nsTDefaultStringComparator_CharT    nsDefaultCStringComparator
#define nsTDependentString_CharT            nsDependentCString
#define nsTDependentSubstring_CharT         nsDependentCSubstring
#define nsTLiteralString_CharT              nsLiteralCString
#define nsTXPIDLString_CharT                nsXPIDLCString
#define nsTGetterCopies_CharT               nsCGetterCopies
#define nsTAdoptingString_CharT             nsAdoptingCString
#define nsTPromiseFlatString_CharT          nsPromiseFlatCString
#define TPromiseFlatString_CharT            PromiseFlatCString
# 20 "../../dist/include/nsLiteralString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTLiteralString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTLiteralString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/**
 * nsTLiteralString_CharT
 *
 * Stores a null-terminated, immutable sequence of characters.
 *
 * Subclass of nsTString that restricts string value to a literal
 * character sequence.  This class does not own its data. The data is
 * assumed to be permanent. In practice this is true because this code
 * is only usable by and for libxul.
 */
class nsTLiteralString_CharT : public nsTString_CharT
{
public:

  typedef nsTLiteralString_CharT self_type;

public:

  /**
   * constructor
   */

  template<size_type N>
  nsTLiteralString_CharT(const char_type (&aStr)[N])
    : string_type(const_cast<char_type*>(aStr), N - 1, F_TERMINATED | F_LITERAL)
  {
  }

private:

  // NOT TO BE IMPLEMENTED
  template<size_type N>
  nsTLiteralString_CharT(char_type (&aStr)[N]) = delete;
};
# 21 "../../dist/include/nsLiteralString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "string-template-undef.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/string-template-undef.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
#define NS_MULTILINE_LITERAL_STRING(s)            static_cast<const nsLiteralString&>(nsLiteralString(s))
#define NS_MULTILINE_LITERAL_STRING_INIT(n,s)     n(s)
#define NS_NAMED_MULTILINE_LITERAL_STRING(n,s)    const nsLiteralString n(s)

#define NS_LITERAL_STRING(s)                      static_cast<const nsLiteralString&>(nsLiteralString(MOZ_UTF16(s)))
#define NS_LITERAL_STRING_INIT(n,s)               n(MOZ_UTF16(s))
#define NS_NAMED_LITERAL_STRING(n,s)              const nsLiteralString n(MOZ_UTF16(s))

#define NS_LITERAL_CSTRING(s)                     static_cast<const nsLiteralCString&>(nsLiteralCString(s))
#define NS_LITERAL_CSTRING_INIT(n,s)              n(s)
#define NS_NAMED_LITERAL_CSTRING(n,s)             const nsLiteralCString n(s)

#endif /* !defined(nsLiteralString_h___) */
# 38 "../../dist/include/nsLiteralString.h"
# 207 "../../dist/include/nsString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsPromiseFlatString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsPromiseFlatString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsPromiseFlatString_h___
#define nsPromiseFlatString_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsString_h___
#define nsString_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsString.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsSubstring.h"
#endif /* expanded by -frewrite-includes */
# 211 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 212 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 213 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include "plhash.h"
#endif /* expanded by -frewrite-includes */
# 214 "../../dist/include/nsString.h"

#endif // !defined(nsString_h___)
#define TPromiseFlatString_CharT            PromiseFlatString
# 14 "../../dist/include/nsPromiseFlatString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTPromiseFlatString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTPromiseFlatString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


/**
 * Macro to free arrays of non-refcounted objects allocated by the
 * shared allocator (nsMemory) such as strings and wstrings.  A
namespace mozilla {
template<class T>
struct AlignmentTestStruct
{
  char c;
  T t;
};
}

#define NS_ALIGNMENT_OF(t_) \
  (sizeof(mozilla::AlignmentTestStruct<t_>) - sizeof(t_))

/**
 * An enumeration type used to represent a method of assignment.
 */
enum nsAssignmentType
{
  NS_ASSIGNMENT_COPY,   // copy by value
  NS_ASSIGNMENT_DEPEND, // copy by reference
  NS_ASSIGNMENT_ADOPT   // copy by reference (take ownership of resource)
};

#endif // nsMemory_h__
# 153 "../../dist/include/nsMemory.h"

# 211 "../../dist/include/nsString.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 212 "../../dist/include/nsString.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
PR_EXTERN(void *)
PL_HashTableLookup(PLHashTable *ht, const void *key);

PR_EXTERN(void *)
PL_HashTableLookupConst(PLHashTable *ht, const void *key);

PR_EXTERN(PRIntn)
PL_HashTableEnumerateEntries(PLHashTable *ht, PLHashEnumerator f, void *arg);

PR_END_EXTERN_C

#endif /* plhash_h___ */
# 127 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plhash.h"
# 214 "../../dist/include/nsString.h" 2

#endif // !defined(nsString_h___)
# 216 "../../dist/include/nsString.h"
# 19 "../../dist/include/nsStringGlue.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsReadableUtils.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsStringGlue.h"
#else
# 21 "../../dist/include/nsStringGlue.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringAPI.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsStringGlue.h"
#endif
# 23 "../../dist/include/nsStringGlue.h"

#endif // nsStringGlue_h__
# 25 "../../dist/include/nsStringGlue.h"
# 19 "../../dist/include/nsHashKeys.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCRTGlue.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCRTGlue.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsCRTGlue_h__
#define nsCRTGlue_h__

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/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)
 */
;

/**
 * Tokenize a string. This function is similar to the strtok function in the
#define CRLF "\015\012"     /* A CR LF equivalent string */

// We use the most restrictive filesystem as our default set of illegal filename
// characters. This is currently Windows.
#define OS_FILE_ILLEGAL_CHARACTERS "/:*?\"<>|"
// We also provide a list of all known file path separators for all filesystems.
// This can be used in replacement of FILE_PATH_SEPARATOR when you need to
// identify or replace all known path separators.
#define KNOWN_PATH_SEPARATORS "\\/"

#if defined(XP_MACOSX)
  #define FILE_PATH_SEPARATOR        "/"
#elif defined(XP_WIN)
# 122 "../../dist/include/nsCRTGlue.h"
  #define FILE_PATH_SEPARATOR        "\\"
#elif defined(XP_UNIX)
# 124 "../../dist/include/nsCRTGlue.h"
  #define FILE_PATH_SEPARATOR        "/"
#else
# 126 "../../dist/include/nsCRTGlue.h"
  #error need_to_define_your_file_path_separator_and_maybe_illegal_characters
#endif
# 128 "../../dist/include/nsCRTGlue.h"

// Not all these control characters are illegal in all OSs, but we don't really
// want them appearing in filenames
#define CONTROL_CHARACTERS     "\001\002\003\004\005\006\007" \
                           "\010\011\012\013\014\015\016\017" \
                           "\020\021\022\023\024\025\026\027" \
                           "\030\031\032\033\034\035\036\037"

#define FILE_ILLEGAL_CHARACTERS CONTROL_CHARACTERS OS_FILE_ILLEGAL_CHARACTERS
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsUnicharUtils.h"

/* (0x3131u <= (u) && (u) <= 0x318eu) => Hangul Compatibility Jamo */
/* (0xac00u <= (u) && (u) <= 0xd7a3u) => Hangul Syllables          */
#define IS_CJ_CHAR(u) \
  ((0x2e80u <= (u) && (u) <= 0x312fu) || \
   (0x3190u <= (u) && (u) <= 0xabffu) || \
   (0xf900u <= (u) && (u) <= 0xfaffu) || \
   (0xff00u <= (u) && (u) <= 0xffefu) )

void ToLowerCase(nsAString&);
void ToUpperCase(nsAString&);

void ToLowerCase(const nsAString& aSource, nsAString& aDest);
void ToUpperCase(const nsAString& aSource, nsAString& aDest);

uint32_t ToLowerCase(uint32_t);
uint32_t ToUpperCase(uint32_t);
uint32_t ToTitleCase(uint32_t);

void ToLowerCase(const char16_t*, char16_t*, uint32_t);
void ToUpperCase(const char16_t*, char16_t*, uint32_t);





#ifdef MOZILLA_INTERNAL_API

class nsCaseInsensitiveStringComparator : public nsStringComparator
{
public:
  virtual int32_t operator() (const char16_t*,
                              const char16_t*,
                              uint32_t,
                              uint32_t) const MOZ_OVERRIDE;
};

class nsCaseInsensitiveUTF8StringComparator : public nsCStringComparator
{
public:
  virtual int32_t operator() (const char*,
                              const char*,
                              uint32_t,
                              uint32_t) const MOZ_OVERRIDE;
};

class nsCaseInsensitiveStringArrayComparator
{
public:
  template<class A, class B>
  bool Equals(const A& a, const B& b) const {
    return a.Equals(b, nsCaseInsensitiveStringComparator());
  }
};

class nsASCIICaseInsensitiveStringComparator : public nsStringComparator
{
public:
  nsASCIICaseInsensitiveStringComparator() {}
  virtual int operator() (const char16_t*,
                          const char16_t*,
                          uint32_t,
                          uint32_t) const MOZ_OVERRIDE;
};

inline bool
CaseInsensitiveFindInReadable(const nsAString& aPattern,
                              nsAString::const_iterator& aSearchStart,
                              nsAString::const_iterator& aSearchEnd)
{
  return FindInReadable(aPattern, aSearchStart, aSearchEnd,
                        nsCaseInsensitiveStringComparator());
}

inline bool
CaseInsensitiveFindInReadable(const nsAString& aPattern,
                              const nsAString& aHay)
{
  nsAString::const_iterator searchBegin, searchEnd;
  return FindInReadable(aPattern, aHay.BeginReading(searchBegin),
                        aHay.EndReading(searchEnd),
                        nsCaseInsensitiveStringComparator());
}

#endif // MOZILLA_INTERNAL_API
# 99 "../../dist/include/nsUnicharUtils.h"

;

;

/**
 * aRightNext are guaranteed to be initialized.
 */
;

namespace mozilla {

/**
 * Hash a UTF8 string as though it were a UTF16 string.
 *
 * The value returned is the same as if we converted the string to UTF16 and
 * then ran HashString() on the result.
 *
 * The given |length| is in bytes.
 */
;

} // namespace mozilla

#endif  /* nsUnicharUtils_h__ */
# 148 "../../dist/include/nsUnicharUtils.h"
# 21 "../../dist/include/nsHashKeys.h" 2

#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsHashKeys.h"
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/nsHashKeys.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/HashFunctions.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/HashFunctions.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Utilities for hashing. */

/*
 * This file exports functions for hashing data down to a 32-bit value,
 * including:
 *
 * in nsHashKeys.h.
 */

#ifndef mozilla_HashFunctions_h
#define mozilla_HashFunctions_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 51 "../../dist/include/mozilla/HashFunctions.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 52 "../../dist/include/mozilla/HashFunctions.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Char16.h"
#endif /* expanded by -frewrite-includes */
# 53 "../../dist/include/mozilla/HashFunctions.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Types.h"
#endif /* expanded by -frewrite-includes */
# 54 "../../dist/include/mozilla/HashFunctions.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 56 "../../dist/include/mozilla/HashFunctions.h"

#ifdef __cplusplus
namespace mozilla {

/**
 * The golden ratio as a 32-bit fixed-point value.
 */
static const uint32_t kGoldenRatioU32 = 0x9E3779B9U;

inline uint32_t
RotateBitsLeft32(uint32_t aValue, uint8_t aBits)
{
  MOZ_ASSERT(aBits < 32);
  return (aValue << aBits) | (aValue >> (32 - aBits));
}

namespace detail {

inline uint32_t
AddU32ToHash(uint32_t aHash, uint32_t aValue)
{
  /*
   * It's also nice if |m| has large-ish order mod 2^32 -- that is, if the
   * smallest k such that m^k == 1 (mod 2^32) is large -- so we can safely
   * multiply our hash value by |m| a few times without negating the
   * multiplicative effect.  Our golden ratio constant has order 2^29, which is
   * more than enough for our purposes.)
   */
  return kGoldenRatioU32 * (RotateBitsLeft32(aHash, 5) ^ aValue);
}

/**
 * AddUintptrToHash takes sizeof(uintptr_t) as a template parameter.
 */
template<size_t PtrSize>
inline uint32_t
AddUintptrToHash(uint32_t aHash, uintptr_t aValue);

template<>
inline uint32_t
AddUintptrToHash<4>(uint32_t aHash, uintptr_t aValue)
{
  return AddU32ToHash(aHash, static_cast<uint32_t>(aValue));
}

template<>
inline uint32_t
AddUintptrToHash<8>(uint32_t aHash, uintptr_t aValue)
{
  /*
   * The static cast to uint64_t below is necessary because this function
   * sometimes gets compiled on 32-bit platforms (yes, even though it's a
   * template and we never call this particular override in a 32-bit build).  If
   * we do aValue >> 32 on a 32-bit machine, we're shifting a 32-bit uintptr_t
   * right 32 bits, and the compiler throws an error.
   */
  uint32_t v1 = static_cast<uint32_t>(aValue);
  uint32_t v2 = static_cast<uint32_t>(static_cast<uint64_t>(aValue) >> 32);
  return AddU32ToHash(AddU32ToHash(aHash, v1), v2);
}

} /* namespace detail */

/**
 * AddToHash takes a hash and some values and returns a new hash based on the
 * inputs.
 *
 * Currently, we support hashing uint32_t's, values which we can implicitly
 * convert to uint32_t, data pointers, and function pointers.
 */
template<typename A>
MOZ_WARN_UNUSED_RESULT inline uint32_t
AddToHash(uint32_t aHash, A aA)
{
  /*
   * Try to convert |A| to uint32_t implicitly.  If this works, great.  If not,
   * we'll error out.
   */
  return detail::AddU32ToHash(aHash, aA);
}

template<typename A>
MOZ_WARN_UNUSED_RESULT inline uint32_t
AddToHash(uint32_t aHash, A* aA)
{
  /*
   * You might think this function should just take a void*.  But then we'd only
   * catch data pointers and couldn't handle function pointers.
   */

  static_assert(sizeof(aA) == sizeof(uintptr_t), "Strange pointer!");

  return detail::AddUintptrToHash<sizeof(uintptr_t)>(aHash, uintptr_t(aA));
}

template<>
MOZ_WARN_UNUSED_RESULT inline uint32_t
AddToHash(uint32_t aHash, uintptr_t aA)
{
  return detail::AddUintptrToHash<sizeof(uintptr_t)>(aHash, aA);
}

template<typename A, typename... Args>
MOZ_WARN_UNUSED_RESULT uint32_t
AddToHash(uint32_t aHash, A aArg, Args... aArgs)
{
  return AddToHash(AddToHash(aHash, aArg), aArgs...);
}

/**
 * The HashGeneric class of functions let you hash one or more values.
 *
 * If you want to hash together two values x and y, calling HashGeneric(x, y) is
 * much better than calling AddToHash(x, y), because AddToHash(x, y) assumes
 * that x has already been hashed.
 */
template<typename... Args>
MOZ_WARN_UNUSED_RESULT inline uint32_t
HashGeneric(Args... aArgs)
{
  return AddToHash(0, aArgs...);
}

namespace detail {

template<typename T>
uint32_t
HashUntilZero(const T* aStr)
{
  uint32_t hash = 0;
  for (T c; (c = *aStr); aStr++) {
    hash = AddToHash(hash, c);
  }
  return hash;
}

template<typename T>
uint32_t
HashKnownLength(const T* aStr, size_t aLength)
{
  uint32_t hash = 0;
  for (size_t i = 0; i < aLength; i++) {
    hash = AddToHash(hash, aStr[i]);
  }
  return hash;
}

} /* namespace detail */

/**
 * The HashString overloads below do just what you'd expect.
 *
 * If you have the string's length, you might as well call the overload which
 * includes the length.  It may be marginally faster.
 */
MOZ_WARN_UNUSED_RESULT inline uint32_t
HashString(const char* aStr)
{
  return detail::HashUntilZero(reinterpret_cast<const unsigned char*>(aStr));
}

MOZ_WARN_UNUSED_RESULT inline uint32_t
HashString(const char* aStr, size_t aLength)
{
  return detail::HashKnownLength(reinterpret_cast<const unsigned char*>(aStr), aLength);
}

MOZ_WARN_UNUSED_RESULT
inline uint32_t
HashString(const unsigned char* aStr, size_t aLength)
{
  return detail::HashKnownLength(aStr, aLength);
}

MOZ_WARN_UNUSED_RESULT inline uint32_t
HashString(const uint16_t* aStr)
{
  return detail::HashUntilZero(aStr);
}

MOZ_WARN_UNUSED_RESULT inline uint32_t
HashString(const uint16_t* aStr, size_t aLength)
{
  return detail::HashKnownLength(aStr, aLength);
}

#ifdef MOZ_CHAR16_IS_NOT_WCHAR
MOZ_WARN_UNUSED_RESULT inline uint32_t
HashString(const char16_t* aStr)
{
  return detail::HashUntilZero(aStr);
}

MOZ_WARN_UNUSED_RESULT inline uint32_t
HashString(const char16_t* aStr, size_t aLength)
{
  return detail::HashKnownLength(aStr, aLength);
}
#endif
# 287 "../../dist/include/mozilla/HashFunctions.h"

/*
 * On Windows, wchar_t (char16_t) is not the same as uint16_t, even though it's
 * the same width!
 */
#ifdef WIN32
MOZ_WARN_UNUSED_RESULT inline uint32_t
HashString(const wchar_t* aStr)
{
  return detail::HashUntilZero(aStr);
}

MOZ_WARN_UNUSED_RESULT inline uint32_t
HashString(const wchar_t* aStr, size_t aLength)
{
  return detail::HashKnownLength(aStr, aLength);
}
#endif
# 305 "../../dist/include/mozilla/HashFunctions.h"

/**
 * Hash some number of bytes.
 *
 * This hash walks word-by-word, rather than byte-by-byte, so you won't get the
 * same result out of HashBytes as you would out of HashString.
 */
MOZ_WARN_UNUSED_RESULT extern MFBT_API uint32_t
HashBytes(const void* bytes, size_t aLength);

} /* namespace mozilla */
#endif /* __cplusplus */
# 317 "../../dist/include/mozilla/HashFunctions.h"

#endif /* mozilla_HashFunctions_h */
# 319 "../../dist/include/mozilla/HashFunctions.h"
# 26 "../../dist/include/nsHashKeys.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/nsHashKeys.h"

namespace mozilla {

// These are defined analogously to the HashString overloads in mfbt.

inline uint32_t
HashString(const nsAString& aStr)
{
  return HashString(aStr.BeginReading(), aStr.Length());
}

inline uint32_t
HashString(const nsACString& aStr)
{
  return HashString(aStr.BeginReading(), aStr.Length());
}

} // namespace mozilla

/** @file nsHashKeys.h
 * standard HashKey classes for nsBaseHashtable and relatives. Each of these
 * classes follows the nsTHashtable::EntryType specification
 * nsHashableHashKey
 * nsGenericHashKey
 */

/**
 * hashkey wrapper using nsAString KeyType
 *
 * @see nsTHashtable::EntryType for specification
 */
class nsStringHashKey : public PLDHashEntryHdr
{
public:
  typedef const nsAString& KeyType;
  typedef const nsAString* KeyTypePointer;

  explicit nsStringHashKey(KeyTypePointer aStr) : mStr(*aStr) {}
  
  

  KeyType GetKey() const { return mStr; }
  bool KeyEquals(const KeyTypePointer aKey) const
  {
    return mStr.Equals(*aKey);
  }

  static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
  static PLDHashNumber HashKey(const KeyTypePointer aKey)
  {
    return mozilla::HashString(*aKey);
  }

#ifdef MOZILLA_INTERNAL_API
  // To avoid double-counting, only measure the string if it is unshared.
  size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
  {
    return GetKey().SizeOfExcludingThisMustBeUnshared(aMallocSizeOf);
  }
#endif
# 103 "../../dist/include/nsHashKeys.h"

  enum { ALLOW_MEMMOVE = true };

private:
  const nsString mStr;
};

#ifdef MOZILLA_INTERNAL_API

/**
 * hashkey wrapper using nsAString KeyType
 *
 * This is internal-API only because nsCaseInsensitiveStringComparator is
 * internal-only.
 *
 * @see nsTHashtable::EntryType for specification
 */
class nsStringCaseInsensitiveHashKey : public PLDHashEntryHdr
{
public:
  typedef const nsAString& KeyType;
  typedef const nsAString* KeyTypePointer;

  explicit nsStringCaseInsensitiveHashKey(KeyTypePointer aStr)
    : mStr(*aStr)
  {
    // take it easy just deal HashKey
  }
  nsStringCaseInsensitiveHashKey(const nsStringCaseInsensitiveHashKey& aToCopy)
    : mStr(aToCopy.mStr)
  {
  }
  ~nsStringCaseInsensitiveHashKey() {}

  KeyType GetKey() const { return mStr; }
  bool KeyEquals(const KeyTypePointer aKey) const
  {
    return mStr.Equals(*aKey, nsCaseInsensitiveStringComparator());
  }

  static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
  static PLDHashNumber HashKey(const KeyTypePointer aKey)
  {
    nsAutoString tmKey(*aKey);
    ToLowerCase(tmKey);
    return mozilla::HashString(tmKey);
  }
  enum { ALLOW_MEMMOVE = true };

  // To avoid double-counting, only measure the string if it is unshared.
  size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
  {
    return GetKey().SizeOfExcludingThisMustBeUnshared(aMallocSizeOf);
  }

private:
  const nsString mStr;
};

#endif
# 163 "../../dist/include/nsHashKeys.h"

/**
 * hashkey wrapper using nsACString KeyType
 *
 * @see nsTHashtable::EntryType for specification
 */
class nsCStringHashKey : public PLDHashEntryHdr
{
public:
  typedef const nsACString& KeyType;
  typedef const nsACString* KeyTypePointer;

  explicit nsCStringHashKey(const nsACString* aStr) : mStr(*aStr) {}
  nsCStringHashKey(const nsCStringHashKey& aToCopy) : mStr(aToCopy.mStr) {}
  ~nsCStringHashKey() {}

  KeyType GetKey() const { return mStr; }
  bool KeyEquals(KeyTypePointer aKey) const { return mStr.Equals(*aKey); }

  static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
  static PLDHashNumber HashKey(KeyTypePointer aKey)
  {
    return mozilla::HashString(*aKey);
  }

#ifdef MOZILLA_INTERNAL_API
  // To avoid double-counting, only measure the string if it is unshared.
  size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
  {
    return GetKey().SizeOfExcludingThisMustBeUnshared(aMallocSizeOf);
  }
#endif
# 195 "../../dist/include/nsHashKeys.h"

  enum { ALLOW_MEMMOVE = true };

private:
  const nsCString mStr;
};

/**
 * hashkey wrapper using uint32_t KeyType
 *
 * @see nsTHashtable::EntryType for specification
 */
class nsUint32HashKey : public PLDHashEntryHdr
{
public:
  typedef const uint32_t& KeyType;
  typedef const uint32_t* KeyTypePointer;

  explicit nsUint32HashKey(KeyTypePointer aKey) : mValue(*aKey) {}
  
  

  
  

  
  
  enum { ALLOW_MEMMOVE = true };

private:
  const uint32_t mValue;
};

/**
 * hashkey wrapper using uint64_t KeyType
 *
 * @see nsTHashtable::EntryType for specification
 */
class nsUint64HashKey : public PLDHashEntryHdr
{
public:
  typedef const uint64_t& KeyType;
  typedef const uint64_t* KeyTypePointer;

  
  
  ~nsUint64HashKey() {}

  KeyType GetKey() const { return mValue; }
  

  
  
  enum { ALLOW_MEMMOVE = true };

private:
  const uint64_t mValue;
};

/**
 * hashkey wrapper using float KeyType
 *
 * @see nsTHashtable::EntryType for specification
 */
class nsFloatHashKey : public PLDHashEntryHdr
{
public:
  typedef const float& KeyType;
  typedef const float* KeyTypePointer;

  
  
  

  
  

  
  
  enum { ALLOW_MEMMOVE = true };

private:
  const float mValue;
};

/**
 * hashkey wrapper using nsISupports* KeyType
 *
 * @see nsTHashtable::EntryType for specification
 */
class nsISupportsHashKey : public PLDHashEntryHdr
{
public:
  typedef nsISupports* KeyType;
  typedef const nsISupports* KeyTypePointer;

  
  
  

  
  

  
  static PLDHashNumber HashKey(KeyTypePointer aKey)
  {
    return NS_PTR_TO_UINT32(aKey) >> 2;
  }
  enum { ALLOW_MEMMOVE = true };

private:
  nsCOMPtr<nsISupports> mSupports;
};

/**
 * hashkey wrapper using refcounted * KeyType
 *
 * @see nsTHashtable::EntryType for specification
 */
template<class T>
class nsRefPtrHashKey : public PLDHashEntryHdr
{
public:
  typedef T* KeyType;
  typedef const T* KeyTypePointer;

  
  
  

  
  

  
  
  enum { ALLOW_MEMMOVE = true };

private:
  nsRefPtr<T> mKey;
};



/**
 * hashkey wrapper using T* KeyType
 *
 * @see nsTHashtable::EntryType for specification
 */
template<class T>
class nsPtrHashKey : public PLDHashEntryHdr
{
public:
  typedef T* KeyType;
  typedef const T* KeyTypePointer;

  
  nsPtrHashKey(const nsPtrHashKey<T>& aToCopy) : mKey(aToCopy.mKey) {}
  ~nsPtrHashKey() {}

  
  bool KeyEquals(KeyTypePointer aKey) const { return aKey == mKey; }

  static KeyTypePointer KeyToPointer(KeyType aKey) { return aKey; }
  static PLDHashNumber HashKey(KeyTypePointer aKey)
  {
    return NS_PTR_TO_UINT32(aKey) >> 2;
  }
  enum { ALLOW_MEMMOVE = true };

protected:
  T* MOZ_NON_OWNING_REF mKey;
};

/**
 * hashkey wrapper using T* KeyType that sets key to nullptr upon
 * destruction. Relevant only in cases where a memory pointer-scanner
 * like valgrind might get confused about stale references.
 *
 * @see nsTHashtable::EntryType for specification
 */

template<class T>
class nsClearingPtrHashKey : public nsPtrHashKey<T>
{
public:
  
  
  
};

typedef nsPtrHashKey<const void> nsVoidPtrHashKey;
typedef nsClearingPtrHashKey<const void> nsClearingVoidPtrHashKey;

/**
 * hashkey wrapper using a function pointer KeyType
 *
 * @see nsTHashtable::EntryType for specification
 */
template<class T>
class nsFuncPtrHashKey : public PLDHashEntryHdr
{
public:
  typedef T& KeyType;
  typedef const T* KeyTypePointer;

  
  
  

  
  

  nsCOMPtr<nsIHashable> mKey;
};

/**
 * Hashtable key class to use with objects for which Hash() and operator==()
 * are defined.
 */
template<typename T>
class nsGenericHashKey : public PLDHashEntryHdr
{
public:
  typedef const T& KeyType;
  typedef const T* KeyTypePointer;

  
  

  
  

  
  
  enum { ALLOW_MEMMOVE = true };

private:
  T mKey;
};

#endif // nsTHashKeys_h__
# 680 "../../dist/include/nsHashKeys.h"
# 13 "../../dist/include/nsClassHashtable.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/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
 */
template<class KeyClass, class T>
class nsClassHashtable
  : public nsBaseHashtable<KeyClass, nsAutoPtr<T>, T*>
{
public:
  typedef typename KeyClass::KeyType KeyType;
  typedef T* UserDataType;
  typedef nsBaseHashtable<KeyClass, nsAutoPtr<T>, T*> base_type;

  
  

  /**
   * Looks up aKey in the hash table. If it doesn't exist a new object of
   * KeyClass will be created (using its default constructor) and then
   * returned.
   */
  ;

  /**
   * @copydoc nsBaseHashtable::Get
   * @param aData if the key doesn't exist, pData will be set to nullptr.
   */
  bool Get(KeyType aKey, UserDataType* aData) const;

  /**
   * @copydoc nsBaseHashtable::Get
   * @returns nullptr if the key is not present.
   */
  ;

  /**
   * Remove the entry for the given key from the hashtable and return it in
   * aOut.  If the key is not in the hashtable, aOut's pointer is set to
   * nullptr.
   *
   * Normally, an entry is deleted when it's removed from an nsClassHashtable,
   * but this function transfers ownership of the entry back to the caller
   * through aOut -- the entry will be deleted when aOut goes out of scope.
   *
   * @param aKey the key to get and remove from the hashtable
   */
  ;
};

//
// nsClassHashtable definitions
//



template<class KeyClass, class T>
bool
nsClassHashtable<KeyClass, T>::Get(KeyType aKey, T** aRetVal) const
{
  typename base_type::EntryType* ent = this->GetEntry(aKey);

  if (ent) {
    if (aRetVal) {
      *aRetVal = ent->mData;
    }

    return true;
  }

  if (aRetVal) {
    *aRetVal = nullptr;
  }

  return false;
}





#endif // nsClassHashtable_h__
# 137 "../../dist/include/nsClassHashtable.h"
# 21 "../../dist/include/nsRefreshDriver.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsRefreshDriver.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsRefreshDriver.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Maybe.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Maybe.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* A class for optional values and in-place lazy construction. */

#ifndef mozilla_Maybe_h
#define mozilla_Maybe_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Alignment.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/Maybe.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/Maybe.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/Maybe.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/Maybe.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/Maybe.h"

#if 0 /* expanded by -frewrite-includes */
#include <new>  // for placement new
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/Maybe.h"

namespace mozilla {

struct Nothing { };

/*
 * Maybe is a container class which contains either zero or one elements. It
 * serves two roles. It can represent values which are *semantically* optional,
 * augmenting a type with an explicit 'Nothing' value. In this role, it provides
 * methods that make it easy to work with values that may be missing, along with
 * equality and comparison operators so that Maybe values can be stored in
 * containers. Maybe values can be constructed conveniently in expressions using
 * N.B. GCC has missed optimizations with Maybe in the past and may generate
 * extra branches/loads/stores. Use with caution on hot paths; it's not known
 * whether or not this is still a problem.
 */
template<class T>
class Maybe
{
  bool mIsSome;
  AlignedStorage2<T> mStorage;

public:
  typedef T ValueType;

  Maybe() : mIsSome(false) { }
  ~Maybe() { reset(); }

  MOZ_IMPLICIT Maybe(Nothing) : mIsSome(false) { }

  Maybe(const Maybe& aOther)
    : mIsSome(false)
  {
    if (aOther.mIsSome) {
      emplace(*aOther);
    }
  }

  Maybe(Maybe&& aOther)
    : mIsSome(false)
  {
    if (aOther.mIsSome) {
      emplace(Move(*aOther));
      aOther.reset();
    }
  }

  Maybe& operator=(const Maybe& aOther)
  {
    if (&aOther != this) {
      if (aOther.mIsSome) {
        if (mIsSome) {
          // XXX(seth): The correct code for this branch, below, can't be used
          // due to a bug in Visual Studio 2010. See bug 1052940.
          /*
          ref() = aOther.ref();
          */
          reset();
          emplace(*aOther);
        } else {
          emplace(*aOther);
        }
      } else {
        reset();
      }
    }
    return *this;
  }

  

  /* Methods that check whether this Maybe contains a value */
  explicit operator bool() const { return isSome(); }
  bool isSome() const { return mIsSome; }
  bool isNothing() const { return !mIsSome; }

  /*
   * Returns the contents of this Maybe<T> by value. If |isNothing()|, returns
   * the value returned from the function or functor provided.
   */
  

  /* Returns the contents of this Maybe<T> by pointer. Unsafe unless |isSome()|. */
  

  const T* ptr() const
  {
    MOZ_ASSERT(mIsSome);
    return &ref();
  }

  /*
   * Returns the contents of this Maybe<T> by pointer. If |isNothing()|,
   * returns the default value provided.
   */
  

  

  /*
   * Returns the contents of this Maybe<T> by pointer. If |isNothing()|,
   * returns the value returned from the function or functor provided.
   */
  

  

  

  const T* operator->() const
  {
    MOZ_ASSERT(mIsSome);
    return ptr();
  }

  /* Returns the contents of this Maybe<T> by ref. Unsafe unless |isSome()|. */
  T& ref()
  {
    MOZ_ASSERT(mIsSome);
    return *mStorage.addr();
  }

  const T& ref() const
  {
    MOZ_ASSERT(mIsSome);
    return *mStorage.addr();
  }

  /*
   * Returns the contents of this Maybe<T> by ref. If |isNothing()|, returns
   * the default value provided.
   */
  

  

  /*
   * Returns the contents of this Maybe<T> by ref. If |isNothing()|, returns the
   * value returned from the function or functor provided.
   */
  

  

  T& operator*()
  {
    MOZ_ASSERT(mIsSome);
    return ref();
  }

  const T& operator*() const
  {
    MOZ_ASSERT(mIsSome);
    return ref();
  }

  /* If |isSome()|, runs the provided function or functor on the contents of
   * this Maybe. */
  

  

  /*
   * If |isSome()|, runs the provided function and returns the result wrapped
   * in a Maybe. If |isNothing()|, returns an empty Maybe value.
   */
  

  template<typename R, typename... FArgs, typename... Args>
  Maybe<R> map(R (*aFunc)(const T&, FArgs...), Args&&... aArgs) const
  {
    if (isSome()) {
      Maybe<R> val;
      val.emplace(aFunc(ref(), Forward<Args>(aArgs)...));
      return val;
    }
    return Maybe<R>();
  }

  /* If |isSome()|, empties this Maybe and destroys its contents. */
  void reset()
  {
    if (isSome()) {
      ref().~T();
      mIsSome = false;
    }
  }

  /*
   * Constructs a T value in-place in this empty Maybe<T>'s storage. The
   * arguments to |emplace()| are the parameters to T's constructor.
   */
  template<typename... Args>
  void emplace(Args&&... aArgs)
  {
    MOZ_ASSERT(!mIsSome);
    ::new (mStorage.addr()) T(Forward<Args>(aArgs)...);
    mIsSome = true;
  }
};

/*
 * Some() creates a Maybe<T> value containing the provided T value. If T has a
 * move constructor, it's used to make this as efficient as possible.
 *
 * Some() selects the type of Maybe it returns by removing any const, volatile,
 * or reference qualifiers from the type of the value you pass to it. This gives
 * it more intuitive behavior when used in expressions, but it also means that
 * if you need to construct a Maybe value that holds a const, volatile, or
 * reference value, you need to use emplace() instead.
 */
template<typename T>
Maybe<typename RemoveCV<typename RemoveReference<T>::Type>::Type>
Some(T&& aValue)
{
  typedef typename RemoveCV<typename RemoveReference<T>::Type>::Type U;
  Maybe<U> value;
  value.emplace(Forward<T>(aValue));
  return value;
}



/*
 * Two Maybe<T> values are equal if
 * - both are Nothing, or
 * - both are Some, and the values they contain are equal.
 */
template<typename T> bool
operator==(const Maybe<T>& aLHS, const Maybe<T>& aRHS)
{
  if (aLHS.isNothing() != aRHS.isNothing()) {
    return false;
  }
  return aLHS.isNothing() || *aLHS == *aRHS;
}



/*
 * We support comparison to Nothing to allow reasonable expressions like:
 *   if (maybeValue == Nothing()) { ... }
 */








/*
 * Maybe<T> values are ordered in the same way T values are ordered, except that
 * Nothing comes before anything else.
 */








} // namespace mozilla

#endif /* mozilla_Maybe_h */
# 506 "../../dist/include/mozilla/Maybe.h"
# 24 "../../dist/include/nsRefreshDriver.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GeckoProfiler.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/GeckoProfiler.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* *************** SPS Sampler Information ****************
 *
 * SPS is an always on profiler that takes fast and low overheads samples
 * of the program execution using only userspace functionity for portability.
 * The goal of this module is to provide performance data in a generic
 * cross platform way without requiring custom tools or kernel support.
 *
 * 't' - Elapse time since recording started.
 *
 */

#ifndef SAMPLER_H
#define SAMPLER_H

#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 53 "../../dist/include/GeckoProfiler.h"

namespace mozilla {
class TimeStamp;
}

enum TracingMetadata {
  TRACING_DEFAULT,
  TRACING_INTERVAL_START,
  TRACING_INTERVAL_END,
  TRACING_EVENT,
  TRACING_EVENT_BACKTRACE
};

#ifndef MOZ_ENABLE_PROFILER_SPS

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 69 "../../dist/include/GeckoProfiler.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h>
#endif /* expanded by -frewrite-includes */
# 70 "../../dist/include/GeckoProfiler.h"

// Insert a RAII in this scope to active a pseudo label. Any samples collected
// in this scope will contain this annotation. For dynamic strings use
// PROFILER_LABEL_PRINTF. Arguments must be string literals.
#define PROFILER_LABEL(name_space, info, category) do {} while (0)

// Similar to PROFILER_LABEL, PROFILER_LABEL_FUNC will push/pop the enclosing
// functon name as the pseudostack label.
#define PROFILER_LABEL_FUNC(category) do {} while (0)

// Format a dynamic string as a pseudo label. These labels will a considerable
// storage size in the circular buffer compared to regular labels. This function
// can be used to annotate custom information such as URL for the resource being
// decoded or the size of the paint.
#define PROFILER_LABEL_PRINTF(name_space, info, category, format, ...) do {} while (0)

// Insert a marker in the profile timeline. This is useful to delimit something
// important happening such as the first paint. Unlike profiler_label that are
// only recorded if a sample is collected while it is active, marker will always
// be collected.
#define PROFILER_MARKER(info) do {} while (0)
#define PROFILER_MARKER_PAYLOAD(info, payload) do { nsAutoPtr<ProfilerMarkerPayload> payloadDeletor(payload); } while (0)

// Main thread specilization to avoid TLS lookup for performance critical use.
#define PROFILER_MAIN_THREAD_LABEL(name_space, info, category) do {} while (0)
#define PROFILER_MAIN_THREAD_LABEL_PRINTF(name_space, info, category, format, ...) do {} while (0)


class ProfilerBacktrace;



// Initilize the profiler TLS, signal handlers on linux. If MOZ_PROFILER_STARTUP
// is set the profiler will be started. This call must happen before any other
// sampler calls. Particularly sampler_label/sampler_marker.
static inline void profiler_init(void* stackTop) {};

// Clean up the profiler module, stopping it if required. This function may
// also save a shutdown profile if requested. No profiler calls should happen
// after this point and all pseudo labels should have been popped.
static inline void profiler_shutdown() {};

// Start the profiler with the selected options. The samples will be
// recorded in a circular buffer.
//   "aProfileEntries" is an abstract size indication of how big
//       the profile's circular buffer should be. Multiply by 4





// These functions tell the profiler that a thread went to sleep so that we can avoid
// sampling it while it's sleeping. Calling profiler_sleep_start() twice without
// profiler_sleep_end() is an error.
static inline void profiler_sleep_start() {}
static inline void profiler_sleep_end() {}

// Call by the JSRuntime's operation callback. This is used to enable
// profiling on auxilerary threads.










#else
# 208 "../../dist/include/GeckoProfiler.h"

#if 0 /* expanded by -frewrite-includes */
#include "GeckoProfilerImpl.h"
#endif /* expanded by -frewrite-includes */
# 210 "../../dist/include/GeckoProfiler.h"

#endif
# 212 "../../dist/include/GeckoProfiler.h"

class GeckoProfilerInitRAII {
public:
  explicit GeckoProfilerInitRAII(void* stackTop) {
    profiler_init(stackTop);
  }
  ~GeckoProfilerInitRAII() {
    profiler_shutdown();
  }
};

class GeckoProfilerSleepRAII {
public:
  GeckoProfilerSleepRAII() {
    profiler_sleep_start();
  }
  ~GeckoProfilerSleepRAII() {
    profiler_sleep_end();
  }
};

#endif // ifndef SAMPLER_H
# 234 "../../dist/include/GeckoProfiler.h"
# 25 "../../dist/include/nsRefreshDriver.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/layers/TransactionIdAllocator.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/layers/TransactionIdAllocator.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_TRANSACTION_ID_ALLOCATOR_H
#define GFX_TRANSACTION_ID_ALLOCATOR_H

#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/layers/TransactionIdAllocator.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TimeStamp.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/layers/TransactionIdAllocator.h"

namespace mozilla {
namespace layers {

class TransactionIdAllocator {
protected:
  virtual ~TransactionIdAllocator() {}

public:
  NS_INLINE_DECL_REFCOUNTING(TransactionIdAllocator)

  /**
   * Allocate a unique id number for the current refresh tick, can
   * only be called while IsInRefresh().
   *
   * If too many id's are allocated without being returned then
   * the refresh driver will suspend until they catch up.
   */
  virtual uint64_t GetTransactionId() = 0;

  /**
   * Notify that all work (including asynchronous composites)
   * for a given transaction id has been completed.
   *
   * If the refresh driver has been suspended because
   * of having too many outstanding id's, then this may
   * resume it.
   */
  virtual void NotifyTransactionCompleted(uint64_t aTransactionId) = 0;

  /**
   * Revoke a transaction id that isn't needed to track
   * completion of asynchronous work. This is similar
   * to NotifyTransactionCompleted except avoids
   * return ordering issues.
   */
  virtual void RevokeTransactionId(uint64_t aTransactionId) = 0;

  /**
   * Get the start time of the current refresh tick.
   */
  virtual mozilla::TimeStamp GetTransactionStart() = 0;
};

}
}


#endif /* GFX_TRANSACTION_ID_ALLOCATOR_H */
# 60 "../../dist/include/mozilla/layers/TransactionIdAllocator.h"
# 26 "../../dist/include/nsRefreshDriver.h" 2

class nsPresContext;
class nsIPresShell;
class nsIDocument;
class imgIRequest;
class nsIRunnable;

namespace mozilla {
class RefreshDriverTimer;
namespace layout {
class VsyncChild;
}
}

/**
 * An abstract base class to be implemented by callers wanting to be
 * notified at refresh times.  When nothing needs to be painted, callers
 * may not be notified.
 */
class nsARefreshObserver {
public:
  // AddRef and Release signatures that match nsISupports.  Implementors
  // must implement reference counting, and those that do implement
  // nsISupports will already have methods with the correct signature.
  //
  // The refresh driver does NOT hold references to refresh observers
  // except while it is notifying them.
  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0;
  NS_IMETHOD_(MozExternalRefCountType) Release(void) = 0;

  virtual void WillRefresh(mozilla::TimeStamp aTime) = 0;
};

/**
 * An abstract base class to be implemented by callers wanting to be notified
 * that a refresh has occurred. Callers must ensure an observer is removed
 * before it is destroyed.
 */
class nsAPostRefreshObserver {
public:
  virtual void DidRefresh() = 0;
};

class nsRefreshDriver MOZ_FINAL : public mozilla::layers::TransactionIdAllocator,
                                  public nsARefreshObserver {
public:
  explicit nsRefreshDriver(nsPresContext *aPresContext);
  ~nsRefreshDriver();

  static void InitializeStatics();
  static void Shutdown();

  /**
   * Methods for testing, exposed via nsIDOMWindowUtils.  See
   * nsIDOMWindowUtils.advanceTimeAndRefresh for description.
   */
  ;
  ;
  ;
  

  /**
   * Return the time of the most recent refresh.  This is intended to be
   * used by callers who want to start an animation now and want to know
   * Add an observer that will be called after each refresh. The caller
   * must remove the observer before it is deleted. This does not trigger
   * refresh driver ticks.
   */
  void AddPostRefreshObserver(nsAPostRefreshObserver *aObserver);
  void RemovePostRefreshObserver(nsAPostRefreshObserver *aObserver);

  /**
   * Add/Remove imgIRequest versions of observers.
   *
   * These are used for hooking into the refresh driver for
   * controlling animated images.
   *
   */
  ;

  

  // mozilla::layers::TransactionIdAllocator
  virtual uint64_t GetTransactionId() MOZ_OVERRIDE;
  void NotifyTransactionCompleted(uint64_t aTransactionId) MOZ_OVERRIDE;
  void RevokeTransactionId(uint64_t aTransactionId) MOZ_OVERRIDE;
  mozilla::TimeStamp GetTransactionStart() MOZ_OVERRIDE;

  ;

  // nsARefreshObserver
  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) MOZ_OVERRIDE { return TransactionIdAllocator::AddRef(); }
  NS_IMETHOD_(MozExternalRefCountType) Release(void) MOZ_OVERRIDE { return TransactionIdAllocator::Release(); }
  virtual void WillRefresh(mozilla::TimeStamp aTime) MOZ_OVERRIDE;
private:
  typedef nsTObserverArray<nsARefreshObserver*> ObserverArray;
  typedef nsTHashtable<nsISupportsHashKey> RequestTable;
  struct ImageStartData {
    

    mozilla::Maybe<mozilla::TimeStamp> mStartTime;
    RequestTable mEntries;
  };
  typedef nsClassHashtable<nsUint32HashKey, ImageStartData> ImageStartTable;

  ;

  enum EnsureTimerStartedFlags {
    eNone = 0,
    eAdjustingTimer = 1 << 0,
    eAllowTimeToGoBackwards = 1 << 1
  };
  // turn on or turn off high precision based on various factors
  void ConfigureHighPrecision();
  void SetHighPrecisionTimersEnabled(bool aEnable);
};

#endif /* !defined(nsRefreshDriver_h_) */
# 410 "../../dist/include/nsRefreshDriver.h"
# 14 "/Users/luser/build/mozilla-central/dom/canvas/nsICanvasRenderingContextInternal.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLCanvasElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/HTMLCanvasElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#if !defined(mozilla_dom_HTMLCanvasElement_h)
#define mozilla_dom_HTMLCanvasElement_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/HTMLCanvasElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMHTMLCanvasElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMHTMLCanvasElement.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMHTMLCanvasElement.idl
 */

#ifndef __gen_nsIDOMHTMLCanvasElement_h__
#define __gen_nsIDOMHTMLCanvasElement_h__


#ifndef __gen_nsIDOMHTMLElement_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMHTMLElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMHTMLElement.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMHTMLElement.idl
 */

#ifndef __gen_nsIDOMHTMLElement_h__
#define __gen_nsIDOMHTMLElement_h__


#ifndef __gen_nsIDOMElement_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMElement.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMElement.idl
 */

#ifndef __gen_nsIDOMElement_h__
#define __gen_nsIDOMElement_h__


#ifndef __gen_nsIDOMNode_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMNode.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMNode.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMNode.idl
 */

#ifndef __gen_nsIDOMNode_h__
#define __gen_nsIDOMNode_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMNode.h"
#endif
# 12 "../../dist/include/nsIDOMNode.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMNode.h"
class nsIVariant; /* forward declaration */


/* starting interface:    nsIDOMNode */
#define NS_IDOMNODE_IID_STR "cc35b412-009b-46a3-9be0-76448f12548d"

#define NS_IDOMNODE_IID \
  {0xcc35b412, 0x009b, 0x46a3, \
    { 0x9b, 0xe0, 0x76, 0x44, 0x8f, 0x12, 0x54, 0x8d }}

class NS_NO_VTABLE nsIDOMNode : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMNODE_IID)

  enum {
    ELEMENT_NODE = 1U,
    ATTRIBUTE_NODE = 2U,
    TEXT_NODE = 3U,
    CDATA_SECTION_NODE = 4U,
    ENTITY_REFERENCE_NODE = 5U,
    ENTITY_NODE = 6U,
    PROCESSING_INSTRUCTION_NODE = 7U,
    COMMENT_NODE = 8U,
    DOCUMENT_NODE = 9U,
    DOCUMENT_TYPE_NODE = 10U,
    DOCUMENT_FRAGMENT_NODE = 11U,
    NOTATION_NODE = 12U
  };

  /* readonly attribute DOMString nodeName; */
  NS_IMETHOD GetNodeName(nsAString & aNodeName) = 0;

  /* attribute DOMString nodeValue; */
  NS_IMETHOD GetNodeValue(nsAString & aNodeValue) = 0;
  NS_IMETHOD SetNodeValue(const nsAString & aNodeValue) = 0;

  /* readonly attribute unsigned short nodeType; */
  NS_IMETHOD GetNodeType(uint16_t *aNodeType) = 0;

  /* readonly attribute nsIDOMNode parentNode; */
  NS_IMETHOD GetParentNode(nsIDOMNode * *aParentNode) = 0;

  /* readonly attribute nsIDOMElement parentElement; */
  NS_IMETHOD GetParentElement(nsIDOMElement * *aParentElement) = 0;

  /* readonly attribute nsIDOMNodeList childNodes; */
  NS_IMETHOD GetChildNodes(nsIDOMNodeList * *aChildNodes) = 0;

  /* readonly attribute nsIDOMNode firstChild; */
  NS_IMETHOD GetFirstChild(nsIDOMNode * *aFirstChild) = 0;

  /* readonly attribute nsIDOMNode lastChild; */
  NS_IMETHOD GetLastChild(nsIDOMNode * *aLastChild) = 0;

  /* readonly attribute nsIDOMNode previousSibling; */
  NS_IMETHOD GetPreviousSibling(nsIDOMNode * *aPreviousSibling) = 0;

  /* readonly attribute nsIDOMNode nextSibling; */
  NS_IMETHOD GetNextSibling(nsIDOMNode * *aNextSibling) = 0;

  /* readonly attribute nsIDOMDocument ownerDocument; */
  NS_IMETHOD GetOwnerDocument(nsIDOMDocument * *aOwnerDocument) = 0;

  /* nsIDOMNode insertBefore (in nsIDOMNode newChild, in nsIDOMNode refChild) raises (DOMException); */
  NS_IMETHOD InsertBefore(nsIDOMNode *newChild, nsIDOMNode *refChild, nsIDOMNode * *_retval) = 0;

  /* nsIDOMNode replaceChild (in nsIDOMNode newChild, in nsIDOMNode oldChild) raises (DOMException); */
  NS_IMETHOD ReplaceChild(nsIDOMNode *newChild, nsIDOMNode *oldChild, nsIDOMNode * *_retval) = 0;

  /* nsIDOMNode removeChild (in nsIDOMNode oldChild) raises (DOMException); */
  NS_IMETHOD RemoveChild(nsIDOMNode *oldChild, nsIDOMNode * *_retval) = 0;

  /* nsIDOMNode appendChild (in nsIDOMNode newChild) raises (DOMException); */
  NS_IMETHOD AppendChild(nsIDOMNode *newChild, nsIDOMNode * *_retval) = 0;

  /* boolean hasChildNodes (); */
  NS_IMETHOD HasChildNodes(bool *_retval) = 0;

  /* [optional_argc] nsIDOMNode cloneNode ([optional] in boolean deep); */
  NS_IMETHOD CloneNode(bool deep, uint8_t _argc, nsIDOMNode * *_retval) = 0;

  /* void normalize (); */
  NS_IMETHOD Normalize(void) = 0;

  /* readonly attribute DOMString namespaceURI; */
  NS_IMETHOD GetNamespaceURI(nsAString & aNamespaceURI) = 0;

  /* readonly attribute DOMString prefix; */
  NS_IMETHOD GetPrefix(nsAString & aPrefix) = 0;

  /* readonly attribute DOMString localName; */
  NS_IMETHOD GetLocalName(nsAString & aLocalName) = 0;

  /* [noscript] bool unusedPlaceholder (); */
  NS_IMETHOD UnusedPlaceholder(bool *_retval) = 0;

  /* [binaryname(DOMBaseURI)] readonly attribute DOMString baseURI; */
  NS_IMETHOD GetDOMBaseURI(nsAString & aBaseURI) = 0;

  enum {
    DOCUMENT_POSITION_DISCONNECTED = 1U,
    DOCUMENT_POSITION_PRECEDING = 2U,
    DOCUMENT_POSITION_FOLLOWING = 4U,
    DOCUMENT_POSITION_CONTAINS = 8U,
    DOCUMENT_POSITION_CONTAINED_BY = 16U,
    DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32U
  };

  /* unsigned short compareDocumentPosition (in nsIDOMNode other) raises (DOMException); */
  NS_IMETHOD CompareDocumentPosition(nsIDOMNode *other, uint16_t *_retval) = 0;

  /* attribute DOMString textContent; */
  NS_IMETHOD GetTextContent(nsAString & aTextContent) = 0;
  NS_IMETHOD SetTextContent(const nsAString & aTextContent) = 0;

  /* DOMString lookupPrefix (in DOMString namespaceURI); */
  NS_IMETHOD LookupPrefix(const nsAString & namespaceURI, nsAString & _retval) = 0;

  /* boolean isDefaultNamespace (in DOMString namespaceURI); */
  NS_IMETHOD IsDefaultNamespace(const nsAString & namespaceURI, bool *_retval) = 0;

  /* DOMString lookupNamespaceURI (in DOMString prefix); */
  NS_IMETHOD LookupNamespaceURI(const nsAString & prefix, nsAString & _retval) = 0;

  /* boolean isEqualNode (in nsIDOMNode arg); */
  NS_IMETHOD IsEqualNode(nsIDOMNode *arg, bool *_retval) = 0;

  /* nsIVariant setUserData (in DOMString key, in nsIVariant data); */
  NS_IMETHOD SetUserData(const nsAString & key, nsIVariant *data, nsIVariant * *_retval) = 0;

  /* nsIVariant getUserData (in DOMString key); */
  NS_IMETHOD GetUserData(const nsAString & key, nsIVariant * *_retval) = 0;

  /* boolean contains (in nsIDOMNode aOther); */
  NS_IMETHOD Contains(nsIDOMNode *aOther, bool *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMNode, NS_IDOMNODE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMNODE \
  NS_IMETHOD GetNodeName(nsAString & aNodeName) MOZ_OVERRIDE; \
  NS_IMETHOD GetNodeValue(nsAString & aNodeValue) MOZ_OVERRIDE; \
  NS_IMETHOD SetNodeValue(const nsAString & aNodeValue) MOZ_OVERRIDE; \
  NS_IMETHOD GetNodeType(uint16_t *aNodeType) MOZ_OVERRIDE; \
  NS_IMETHOD GetParentNode(nsIDOMNode * *aParentNode) MOZ_OVERRIDE; \
  NS_IMETHOD GetParentElement(nsIDOMElement * *aParentElement) MOZ_OVERRIDE; \
  NS_IMETHOD GetChildNodes(nsIDOMNodeList * *aChildNodes) MOZ_OVERRIDE; \
  NS_IMETHOD GetFirstChild(nsIDOMNode * *aFirstChild) MOZ_OVERRIDE; \
  NS_IMETHOD GetLastChild(nsIDOMNode * *aLastChild) MOZ_OVERRIDE; \
  NS_IMETHOD IsDefaultNamespace(const nsAString & namespaceURI, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsDefaultNamespace(namespaceURI, _retval); } \
  NS_IMETHOD LookupNamespaceURI(const nsAString & prefix, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->LookupNamespaceURI(prefix, _retval); } \
  NS_IMETHOD IsEqualNode(nsIDOMNode *arg, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsEqualNode(arg, _retval); } \
  NS_IMETHOD SetUserData(const nsAString & key, nsIVariant *data, nsIVariant * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetUserData(key, data, _retval); } \
  NS_IMETHOD GetUserData(const nsAString & key, nsIVariant * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUserData(key, _retval); } \
  NS_IMETHOD Contains(nsIDOMNode *aOther, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Contains(aOther, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMNode : public nsIDOMNode
/* boolean hasChildNodes (); */
NS_IMETHODIMP nsDOMNode::HasChildNodes(bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] bool unusedPlaceholder (); */
NS_IMETHODIMP nsDOMNode::UnusedPlaceholder(bool *_retval)

/* boolean contains (in nsIDOMNode aOther); */
NS_IMETHODIMP nsDOMNode::Contains(nsIDOMNode *aOther, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 503 "../../dist/include/nsIDOMNode.h"


#endif /* __gen_nsIDOMNode_h__ */
# 506 "../../dist/include/nsIDOMNode.h"
# 11 "../../dist/include/nsIDOMElement.h" 2
#endif
# 12 "../../dist/include/nsIDOMElement.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMElement.h"
class nsIDOMMozNamedAttrMap; /* forward declaration */

// Undo the windows.h damage
#undef GetMessage
#undef CreateEvent
#undef GetClassName
#undef GetBinaryType
#undef RemoveDirectory

/* starting interface:    nsIDOMElement */
#define NS_IDOMELEMENT_IID_STR "6289999b-1008-4269-b42a-413ec5a9d3f4"

#define NS_IDOMELEMENT_IID \
  {0x6289999b, 0x1008, 0x4269, \
    { 0xb4, 0x2a, 0x41, 0x3e, 0xc5, 0xa9, 0xd3, 0xf4 }}

class NS_NO_VTABLE nsIDOMElement : public nsIDOMNode {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMELEMENT_IID)

  /* readonly attribute DOMString tagName; */
  NS_IMETHOD GetTagName(nsAString & aTagName) = 0;

  /* attribute DOMString id; */
  NS_IMETHOD GetId(nsAString & aId) = 0;
  NS_IMETHOD SetId(const nsAString & aId) = 0;

  /* attribute DOMString className; */
  NS_IMETHOD GetClassName(nsAString & aClassName) = 0;
  NS_IMETHOD SetClassName(const nsAString & aClassName) = 0;

  /* readonly attribute nsISupports classList; */
  NS_IMETHOD GetClassList(nsISupports * *aClassList) = 0;

  /* readonly attribute nsIDOMMozNamedAttrMap attributes; */
  NS_IMETHOD GetAttributes(nsIDOMMozNamedAttrMap * *aAttributes) = 0;

  /* DOMString getAttribute (in DOMString name); */
  NS_IMETHOD GetAttribute(const nsAString & name, nsAString & _retval) = 0;

  /* DOMString getAttributeNS (in DOMString namespaceURI, in DOMString localName); */
  NS_IMETHOD GetAttributeNS(const nsAString & namespaceURI, const nsAString & localName, nsAString & _retval) = 0;

  /* void setAttribute (in DOMString name, in DOMString value); */
  NS_IMETHOD SetAttribute(const nsAString & name, const nsAString & value) = 0;

  /* void setAttributeNS (in DOMString namespaceURI, in DOMString qualifiedName, in DOMString value); */
  NS_IMETHOD SetAttributeNS(const nsAString & namespaceURI, const nsAString & qualifiedName, const nsAString & value) = 0;

  /* void removeAttribute (in DOMString name); */
  NS_IMETHOD RemoveAttribute(const nsAString & name) = 0;

  /* void removeAttributeNS (in DOMString namespaceURI, in DOMString localName); */
  NS_IMETHOD RemoveAttributeNS(const nsAString & namespaceURI, const nsAString & localName) = 0;

  /* boolean hasAttribute (in DOMString name); */
  NS_IMETHOD HasAttribute(const nsAString & name, bool *_retval) = 0;

  /* boolean hasAttributeNS (in DOMString namespaceURI, in DOMString localName); */
  NS_IMETHOD HasAttributeNS(const nsAString & namespaceURI, const nsAString & localName, bool *_retval) = 0;

  /* boolean hasAttributes (); */
  NS_IMETHOD HasAttributes(bool *_retval) = 0;

  /* nsIDOMAttr getAttributeNode (in DOMString name); */
  NS_IMETHOD GetAttributeNode(const nsAString & name, nsIDOMAttr * *_retval) = 0;

  /* nsIDOMAttr setAttributeNode (in nsIDOMAttr newAttr); */
  NS_IMETHOD SetAttributeNode(nsIDOMAttr *newAttr, nsIDOMAttr * *_retval) = 0;

  /* nsIDOMAttr removeAttributeNode (in nsIDOMAttr oldAttr); */
  NS_IMETHOD RemoveAttributeNode(nsIDOMAttr *oldAttr, nsIDOMAttr * *_retval) = 0;

  /* nsIDOMAttr getAttributeNodeNS (in DOMString namespaceURI, in DOMString localName); */
  NS_IMETHOD GetAttributeNodeNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMAttr * *_retval) = 0;

  /* nsIDOMAttr setAttributeNodeNS (in nsIDOMAttr newAttr) raises (DOMException); */
  NS_IMETHOD SetAttributeNodeNS(nsIDOMAttr *newAttr, nsIDOMAttr * *_retval) = 0;

  /* nsIDOMHTMLCollection getElementsByTagName (in DOMString name); */
  NS_IMETHOD GetElementsByTagName(const nsAString & name, nsIDOMHTMLCollection * *_retval) = 0;

  /* nsIDOMHTMLCollection getElementsByTagNameNS (in DOMString namespaceURI, in DOMString localName); */
  NS_IMETHOD GetElementsByTagNameNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMHTMLCollection * *_retval) = 0;

  /* nsIDOMHTMLCollection getElementsByClassName (in DOMString classes); */
  NS_IMETHOD GetElementsByClassName(const nsAString & classes, nsIDOMHTMLCollection * *_retval) = 0;

  /* [binaryname(ChildElements)] readonly attribute nsIDOMNodeList children; */
  NS_IMETHOD GetChildElements(nsIDOMNodeList * *aChildren) = 0;

  /* readonly attribute nsIDOMElement firstElementChild; */
  NS_IMETHOD GetFirstElementChild(nsIDOMElement * *aFirstElementChild) = 0;

  /* readonly attribute nsIDOMElement lastElementChild; */
  NS_IMETHOD GetLastElementChild(nsIDOMElement * *aLastElementChild) = 0;

  /* readonly attribute nsIDOMElement previousElementSibling; */
  NS_IMETHOD GetPreviousElementSibling(nsIDOMElement * *aPreviousElementSibling) = 0;

  /* readonly attribute nsIDOMElement nextElementSibling; */
  NS_IMETHOD GetNextElementSibling(nsIDOMElement * *aNextElementSibling) = 0;

  /* readonly attribute unsigned long childElementCount; */
  NS_IMETHOD GetChildElementCount(uint32_t *aChildElementCount) = 0;

  /* [binaryname(MozRemove)] void remove (); */
  NS_IMETHOD MozRemove(void) = 0;

  /* nsIDOMClientRectList getClientRects (); */
  NS_IMETHOD GetClientRects(nsIDOMClientRectList * *_retval) = 0;

  /* nsIDOMClientRect getBoundingClientRect (); */
  NS_IMETHOD GetBoundingClientRect(nsIDOMClientRect * *_retval) = 0;

  /* attribute long scrollTop; */
  NS_IMETHOD GetScrollTop(int32_t *aScrollTop) = 0;
  NS_IMETHOD GetClientLeft(int32_t *aClientLeft) = 0;

  /* readonly attribute long clientWidth; */
  NS_IMETHOD GetClientWidth(int32_t *aClientWidth) = 0;

  /* readonly attribute long clientHeight; */
  NS_IMETHOD GetClientHeight(int32_t *aClientHeight) = 0;

  /* readonly attribute long scrollLeftMax; */
  NS_IMETHOD GetScrollLeftMax(int32_t *aScrollLeftMax) = 0;

  /* readonly attribute long scrollTopMax; */
  NS_IMETHOD GetScrollTopMax(int32_t *aScrollTopMax) = 0;

  /* boolean mozMatchesSelector ([Null (Stringify)] in DOMString selector); */
  NS_IMETHOD MozMatchesSelector(const nsAString & selector, bool *_retval) = 0;

  /* void setCapture ([optional] in boolean retargetToElement); */
  NS_IMETHOD SetCapture(bool retargetToElement) = 0;

  /* void releaseCapture (); */
  NS_IMETHOD ReleaseCapture(void) = 0;

  /* void mozRequestFullScreen (); */
  NS_IMETHOD MozRequestFullScreen(void) = 0;

  /* void mozRequestPointerLock (); */
  NS_IMETHOD MozRequestPointerLock(void) = 0;

  /* nsIDOMElement querySelector ([Null (Stringify)] in DOMString selectors); */
  NS_IMETHOD QuerySelector(const nsAString & selectors, nsIDOMElement * *_retval) = 0;

  /* nsIDOMNodeList querySelectorAll ([Null (Stringify)] in DOMString selectors); */
  NS_IMETHOD QuerySelectorAll(const nsAString & selectors, nsIDOMNodeList * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMElement, NS_IDOMELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMELEMENT \
  NS_IMETHOD GetTagName(nsAString & aTagName) MOZ_OVERRIDE; \
  NS_IMETHOD GetId(nsAString & aId) MOZ_OVERRIDE; \
  NS_IMETHOD SetId(const nsAString & aId) MOZ_OVERRIDE; \
  NS_IMETHOD GetClassName(nsAString & aClassName) MOZ_OVERRIDE; \
  NS_IMETHOD SetClassName(const nsAString & aClassName) MOZ_OVERRIDE; \
  NS_IMETHOD GetClassList(nsISupports * *aClassList) MOZ_OVERRIDE; \
  NS_IMETHOD GetAttributes(nsIDOMMozNamedAttrMap * *aAttributes) MOZ_OVERRIDE; \

/* starting interface:    nsIDataType */
#define NS_IDATATYPE_IID_STR "4d12e540-83d7-11d5-90ed-0010a4e73d9a"

#define NS_IDATATYPE_IID \
  {0x4d12e540, 0x83d7, 0x11d5, \
    { 0x90, 0xed, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a }}

class NS_NO_VTABLE nsIDataType : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDATATYPE_IID)

  enum {
    VTYPE_INT8 = 0U,
    VTYPE_INT16 = 1U,
    VTYPE_INTERFACE = 18U,
    VTYPE_INTERFACE_IS = 19U,
    VTYPE_ARRAY = 20U,
    VTYPE_STRING_SIZE_IS = 21U,
    VTYPE_WSTRING_SIZE_IS = 22U,
    VTYPE_UTF8STRING = 23U,
    VTYPE_CSTRING = 24U,
    VTYPE_ASTRING = 25U,
    VTYPE_EMPTY_ARRAY = 254U,
    VTYPE_EMPTY = 255U
  };

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDataType, NS_IDATATYPE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDATATYPE \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDATATYPE(_to) \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDATATYPE(_to) \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDataType : public nsIDataType
{
public:
{
  /* member initializers and constructor code */
}

nsDataType::~nsDataType()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 110 "../../dist/include/nsIVariant.h"


/* starting interface:    nsIVariant */
#define NS_IVARIANT_IID_STR "81e4c2de-acac-4ad6-901a-b5fb1b851a0d"

#define NS_IVARIANT_IID \
  {0x81e4c2de, 0xacac, 0x4ad6, \
    { 0x90, 0x1a, 0xb5, 0xfb, 0x1b, 0x85, 0x1a, 0x0d }}

class NS_NO_VTABLE nsIVariant : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IVARIANT_IID)

  /* [noscript] readonly attribute uint16_t dataType; */
  NS_IMETHOD GetDataType(uint16_t *aDataType) = 0;

  /* [noscript] uint8_t getAsInt8 (); */
  NS_IMETHOD GetAsInt8(uint8_t *_retval) = 0;

  /* [noscript] int16_t getAsInt16 (); */

  /* [noscript] void getAsInterface (out nsIIDPtr iid, [iid_is (iid), retval] out nsQIResult iface); */
  NS_IMETHOD GetAsInterface(nsIID **iid, void **iface) = 0;

  /* [notxpcom] nsresult getAsArray (out uint16_t type, out nsIID iid, out uint32_t count, out voidPtr ptr); */
  NS_IMETHOD_(nsresult) GetAsArray(uint16_t *type, nsIID *iid, uint32_t *count, void **ptr) = 0;

  /* [noscript] void getAsStringWithSize (out uint32_t size, [size_is (size), retval] out string str); */
  NS_IMETHOD GetAsStringWithSize(uint32_t *size, char * *str) = 0;

  /* [noscript] void getAsWStringWithSize (out uint32_t size, [size_is (size), retval] out wstring str); */
  NS_IMETHOD GetAsWStringWithSize(uint32_t *size, char16_t * *str) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIVariant, NS_IVARIANT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIVARIANT \
  NS_IMETHOD GetDataType(uint16_t *aDataType) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsInt8(uint8_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsInt16(int16_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsInt32(int32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsInt64(int64_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsUint8(uint8_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsUint16(uint16_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsUint32(uint32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsUint64(uint64_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsFloat(float *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsDouble(double *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsBool(bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsChar(char *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsWChar(char16_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD_(nsresult) GetAsID(nsID *retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsAString(nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsDOMString(nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsString(char * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAsString(_retval); } \
  NS_IMETHOD GetAsWString(char16_t * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAsWString(_retval); } \
  NS_IMETHOD GetAsISupports(nsISupports * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAsISupports(_retval); } \
  NS_IMETHOD GetAsJSVal(JS::MutableHandleValue _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAsJSVal(_retval); } \
  NS_IMETHOD GetAsInterface(nsIID **iid, void **iface) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAsInterface(iid, iface); } \
  NS_IMETHOD_(nsresult) GetAsArray(uint16_t *type, nsIID *iid, uint32_t *count, void **ptr) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsStringWithSize(uint32_t *size, char * *str) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAsStringWithSize(size, str); } \
  NS_IMETHOD GetAsWStringWithSize(uint32_t *size, char16_t * *str) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAsWStringWithSize(size, str); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* [noscript] void getAsWStringWithSize (out uint32_t size, [size_is (size), retval] out wstring str); */
NS_IMETHODIMP nsVariant::GetAsWStringWithSize(uint32_t *size, char16_t * *str)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 495 "../../dist/include/nsIVariant.h"


/* starting interface:    nsIWritableVariant */
#define NS_IWRITABLEVARIANT_IID_STR "5586a590-8c82-11d5-90f3-0010a4e73d9a"

#define NS_IWRITABLEVARIANT_IID \
  {0x5586a590, 0x8c82, 0x11d5, \
    { 0x90, 0xf3, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a }}

class NS_NO_VTABLE nsIWritableVariant : public nsIVariant {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWRITABLEVARIANT_IID)

  /* attribute boolean writable; */
  NS_IMETHOD GetWritable(bool *aWritable) = 0;
  NS_IMETHOD SetWritable(bool aWritable) = 0;

  /* void setAsInt8 (in uint8_t aValue); */
  NS_IMETHOD SetAsInt8(uint8_t aValue) = 0;

  /* void setAsInt16 (in int16_t aValue); */

  /* void setAsUint64 (in uint64_t aValue); */
  /* void setFromVariant (in nsIVariant aValue); */
  NS_IMETHOD SetFromVariant(nsIVariant *aValue) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIWritableVariant, NS_IWRITABLEVARIANT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIWRITABLEVARIANT \
  NS_IMETHOD GetWritable(bool *aWritable) MOZ_OVERRIDE; \
  NS_IMETHOD SetWritable(bool aWritable) MOZ_OVERRIDE; \
  NS_IMETHOD SetAsInt8(uint8_t aValue) MOZ_OVERRIDE; \
  NS_IMETHOD SetAsInt16(int16_t aValue) MOZ_OVERRIDE; \
  NS_IMETHOD SetAsInt32(int32_t aValue) MOZ_OVERRIDE; \
  NS_IMETHOD SetFromVariant(nsIVariant *aValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFromVariant(aValue); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsWritableVariant : public nsIWritableVariant
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIWRITABLEVARIANT

  nsWritableVariant();

private:
  ~nsWritableVariant();
}

/* attribute boolean writable; */
NS_IMETHODIMP nsWritableVariant::GetWritable(bool *aWritable)
/* End of implementation class template. */
#endif
# 924 "../../dist/include/nsIVariant.h"

// The contractID for the generic implementation built in to xpcom.
#define NS_VARIANT_CONTRACTID "@mozilla.org/variant;1"

#endif /* __gen_nsIVariant_h__ */
# 929 "../../dist/include/nsIVariant.h"
# 15 "../../dist/include/nsIDOMHTMLElement.h" 2
#endif
# 16 "../../dist/include/nsIDOMHTMLElement.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 21 "../../dist/include/nsIDOMHTMLElement.h"
class nsIDOMHTMLMenuElement; /* forward declaration */


/* starting interface:    nsIDOMHTMLElement */
#define NS_IDOMHTMLELEMENT_IID_STR "b0c42392-d0e7-4f6a-beb5-a698ce648945"

#define NS_IDOMHTMLELEMENT_IID \
  {0xb0c42392, 0xd0e7, 0x4f6a, \
    { 0xbe, 0xb5, 0xa6, 0x98, 0xce, 0x64, 0x89, 0x45 }}

class NS_NO_VTABLE nsIDOMHTMLElement : public nsIDOMElement {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMHTMLELEMENT_IID)

  /* attribute DOMString title; */
  NS_IMETHOD GetTitle(nsAString & aTitle) = 0;
  NS_IMETHOD SetTitle(const nsAString & aTitle) = 0;

  /* attribute DOMString lang; */
  NS_IMETHOD GetLang(nsAString & aLang) = 0;
  NS_IMETHOD SetLang(const nsAString & aLang) = 0;

  /* attribute DOMString dir; */
  NS_IMETHOD GetDir(nsAString & aDir) = 0;
  NS_IMETHOD SetDir(const nsAString & aDir) = 0;

  /* readonly attribute nsISupports dataset; */
  NS_IMETHOD GetDataset(nsISupports * *aDataset) = 0;

  /* attribute boolean itemScope; */
  NS_IMETHOD GetItemScope(bool *aItemScope) = 0;
  NS_IMETHOD SetItemScope(bool aItemScope) = 0;

  /* attribute nsIVariant itemType; */
  NS_IMETHOD GetItemType(nsIVariant * *aItemType) = 0;
  NS_IMETHOD SetItemType(nsIVariant *aItemType) = 0;

  /* attribute DOMString itemId; */
  NS_IMETHOD GetItemId(nsAString & aItemId) = 0;
  NS_IMETHOD SetItemId(const nsAString & aItemId) = 0;

  NS_IMETHOD GetHidden(bool *aHidden) = 0;
  NS_IMETHOD SetHidden(bool aHidden) = 0;

  /* [binaryname(DOMClick)] void click (); */
  NS_IMETHOD DOMClick(void) = 0;

  /* attribute long tabIndex; */
  NS_IMETHOD GetTabIndex(int32_t *aTabIndex) = 0;
  NS_IMETHOD SetTabIndex(int32_t aTabIndex) = 0;

  /* void focus (); */
  NS_IMETHOD Focus(void) = 0;

  /* [binaryname(DOMBlur)] void blur (); */
  NS_IMETHOD DOMBlur(void) = 0;

  /* readonly attribute long offsetWidth; */
  NS_IMETHOD GetOffsetWidth(int32_t *aOffsetWidth) = 0;

  /* readonly attribute long offsetHeight; */
  NS_IMETHOD GetOffsetHeight(int32_t *aOffsetHeight) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMHTMLElement, NS_IDOMHTMLELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMHTMLELEMENT \
  NS_IMETHOD GetTitle(nsAString & aTitle) MOZ_OVERRIDE; \
  NS_IMETHOD SetTitle(const nsAString & aTitle) MOZ_OVERRIDE; \
  NS_IMETHOD GetLang(nsAString & aLang) MOZ_OVERRIDE; \
  NS_IMETHOD SetLang(const nsAString & aLang) MOZ_OVERRIDE; \
  NS_IMETHOD GetHidden(bool *aHidden) MOZ_OVERRIDE; \
  NS_IMETHOD SetHidden(bool aHidden) MOZ_OVERRIDE; \
  NS_IMETHOD DOMClick(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetTabIndex(int32_t *aTabIndex) MOZ_OVERRIDE; \
  NS_IMETHOD SetTabIndex(int32_t aTabIndex) MOZ_OVERRIDE; \
  NS_IMETHOD Focus(void) MOZ_OVERRIDE; \
  NS_IMETHOD DOMBlur(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetAccessKey(nsAString & aAccessKey) MOZ_OVERRIDE; \
  NS_IMETHOD SetAccessKey(const nsAString & aAccessKey) MOZ_OVERRIDE; \
  NS_IMETHOD GetAccessKeyLabel(nsAString & aAccessKeyLabel) MOZ_OVERRIDE; \
  NS_IMETHOD GetDraggable(bool *aDraggable) MOZ_OVERRIDE; \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
#endif
# 603 "../../dist/include/nsIDOMHTMLElement.h"


#endif /* __gen_nsIDOMHTMLElement_h__ */
# 606 "../../dist/include/nsIDOMHTMLElement.h"
# 11 "../../dist/include/nsIDOMHTMLCanvasElement.h" 2
#endif
# 12 "../../dist/include/nsIDOMHTMLCanvasElement.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsIDOMHTMLCanvasElement.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 19 "../../dist/include/nsIDOMHTMLCanvasElement.h"
class nsIDOMBlob; /* forward declaration */

class nsIDOMFile; /* forward declaration */

class nsIVariant; /* forward declaration */

class nsIInputStreamCallback; /* forward declaration */


/* starting interface:    nsIDOMHTMLCanvasElement */
#define NS_IDOMHTMLCANVASELEMENT_IID_STR "8978d1c5-2981-4678-a1c3-b0b7bae04fbc"

#define NS_IDOMHTMLCANVASELEMENT_IID \
  {0x8978d1c5, 0x2981, 0x4678, \
    { 0xa1, 0xc3, 0xb0, 0xb7, 0xba, 0xe0, 0x4f, 0xbc }}

class NS_NO_VTABLE nsIDOMHTMLCanvasElement : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMHTMLCANVASELEMENT_IID)

  /* attribute unsigned long width; */
  NS_IMETHOD GetWidth(uint32_t *aWidth) = 0;
  NS_IMETHOD SetWidth(uint32_t aWidth) = 0;

  /* attribute unsigned long height; */
  NS_IMETHOD GetHeight(uint32_t *aHeight) = 0;
  NS_IMETHOD SetHeight(uint32_t aHeight) = 0;

  /* attribute boolean mozOpaque; */
  NS_IMETHOD GetMozOpaque(bool *aMozOpaque) = 0;
  NS_IMETHOD SetMozOpaque(bool aMozOpaque) = 0;

  /* [implicit_jscontext] DOMString toDataURL ([optional] in DOMString type, [optional] in jsval params); */
  NS_IMETHOD ToDataURL(const nsAString & type, JS::HandleValue params, JSContext* cx, nsAString & _retval) = 0;

  /* nsIDOMFile mozGetAsFile (in DOMString name, [optional] in DOMString type); */
  NS_IMETHOD MozGetAsFile(const nsAString & name, const nsAString & type, nsIDOMFile * *_retval) = 0;

  /* nsISupports MozGetIPCContext (in DOMString contextId); */
  NS_IMETHOD MozGetIPCContext(const nsAString & contextId, nsISupports * *_retval) = 0;

  /* void mozFetchAsStream (in nsIInputStreamCallback callback, [optional] in DOMString type); */
  NS_IMETHOD MozFetchAsStream(nsIInputStreamCallback *callback, const nsAString & type) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMHTMLCanvasElement, NS_IDOMHTMLCANVASELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMHTMLCANVASELEMENT \
  NS_IMETHOD GetWidth(uint32_t *aWidth) MOZ_OVERRIDE; \
  NS_IMETHOD SetWidth(uint32_t aWidth) MOZ_OVERRIDE; \
  NS_IMETHOD GetHeight(uint32_t *aHeight) MOZ_OVERRIDE; \
  NS_IMETHOD SetHeight(uint32_t aHeight) MOZ_OVERRIDE; \
  NS_IMETHOD GetMozOpaque(bool *aMozOpaque) MOZ_OVERRIDE; \
  NS_IMETHOD SetMozOpaque(bool aMozOpaque) MOZ_OVERRIDE; \
  NS_IMETHOD ToDataURL(const nsAString & type, JS::HandleValue params, JSContext* cx, nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD MozGetAsFile(const nsAString & name, const nsAString & type, nsIDOMFile * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD MozGetIPCContext(const nsAString & contextId, nsISupports * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD MozFetchAsStream(nsIInputStreamCallback *callback, const nsAString & type) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMHTMLCANVASELEMENT(_to) \
  NS_IMETHOD GetWidth(uint32_t *aWidth) MOZ_OVERRIDE { return _to GetWidth(aWidth); } \
  NS_IMETHOD SetWidth(uint32_t aWidth) MOZ_OVERRIDE { return _to SetWidth(aWidth); } \
  NS_IMETHOD GetHeight(uint32_t *aHeight) MOZ_OVERRIDE { return _to GetHeight(aHeight); } \
  NS_IMETHOD SetHeight(uint32_t aHeight) MOZ_OVERRIDE { return _to SetHeight(aHeight); } \
  NS_IMETHOD GetMozOpaque(bool *aMozOpaque) MOZ_OVERRIDE { return _to GetMozOpaque(aMozOpaque); } \
  NS_IMETHOD SetMozOpaque(bool aMozOpaque) MOZ_OVERRIDE { return _to SetMozOpaque(aMozOpaque); } \
  NS_IMETHOD ToDataURL(const nsAString & type, JS::HandleValue params, JSContext* cx, nsAString & _retval) MOZ_OVERRIDE { return _to ToDataURL(type, params, cx, _retval); } \
  NS_IMETHOD MozGetAsFile(const nsAString & name, const nsAString & type, nsIDOMFile * *_retval) MOZ_OVERRIDE { return _to MozGetAsFile(name, type, _retval); } \
  NS_IMETHOD MozGetIPCContext(const nsAString & contextId, nsISupports * *_retval) MOZ_OVERRIDE { return _to MozGetIPCContext(contextId, _retval); } \
  NS_IMETHOD MozFetchAsStream(nsIInputStreamCallback *callback, const nsAString & type) MOZ_OVERRIDE { return _to MozFetchAsStream(callback, type); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMHTMLCANVASELEMENT(_to) \
  NS_IMETHOD GetWidth(uint32_t *aWidth) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWidth(aWidth); } \
  NS_IMETHOD SetWidth(uint32_t aWidth) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetWidth(aWidth); } \
  NS_IMETHOD GetHeight(uint32_t *aHeight) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeight(aHeight); } \
  NS_IMETHOD SetHeight(uint32_t aHeight) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetHeight(aHeight); } \
  NS_IMETHOD GetMozOpaque(bool *aMozOpaque) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMozOpaque(aMozOpaque); } \
  NS_IMETHOD SetMozOpaque(bool aMozOpaque) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMozOpaque(aMozOpaque); } \
  NS_IMETHOD ToDataURL(const nsAString & type, JS::HandleValue params, JSContext* cx, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ToDataURL(type, params, cx, _retval); } \
  NS_IMETHOD MozGetAsFile(const nsAString & name, const nsAString & type, nsIDOMFile * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->MozGetAsFile(name, type, _retval); } \
  NS_IMETHOD MozGetIPCContext(const nsAString & contextId, nsISupports * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->MozGetIPCContext(contextId, _retval); } \
  NS_IMETHOD MozFetchAsStream(nsIInputStreamCallback *callback, const nsAString & type) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->MozFetchAsStream(callback, type); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
NS_IMPL_ISUPPORTS(nsDOMHTMLCanvasElement, nsIDOMHTMLCanvasElement)

nsDOMHTMLCanvasElement::nsDOMHTMLCanvasElement()
}

/* End of implementation class template. */
#endif
# 195 "../../dist/include/nsIDOMHTMLCanvasElement.h"


#endif /* __gen_nsIDOMHTMLCanvasElement_h__ */
# 198 "../../dist/include/nsIDOMHTMLCanvasElement.h"
# 11 "../../dist/include/mozilla/dom/HTMLCanvasElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsGenericHTMLElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsGenericHTMLElement_h___
#define nsGenericHTMLElement_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsMappedAttributeElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsMappedAttributeElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * nsMappedAttributeElement is the base for elements supporting style mapped
 * attributes via nsMappedAttributes (HTML and MathML).
 */

#ifndef NS_MAPPEDATTRIBUTEELEMENT_H_
#define NS_MAPPEDATTRIBUTEELEMENT_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/base/nsMappedAttributeElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStyledElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsStyledElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * nsStyledElement is the base for elements supporting styling via the
 * id/class/style attributes; it is a common base for their support in HTML,
 * SVG and MathML.
 */

#ifndef __NS_STYLEDELEMENT_H_
#define __NS_STYLEDELEMENT_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/base/nsStyledElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/dom/base/nsStyledElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Element.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/Element.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 et :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Base class for all element classes; this provides an implementation
 * of DOM Core's nsIDOMElement, implements nsIContent, provides
 * utility methods for subclasses, and so forth.
 */

#ifndef mozilla_dom_Element_h__
#define mozilla_dom_Element_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/FragmentOrElement.h" // for base class
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/FragmentOrElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Base class for all element classes as well as nsDocumentFragment.  This
 * provides an implementation of nsIDOMNode, implements nsIContent, provides
 * utility methods for subclasses, and so forth.
 */

#ifndef FragmentOrElement_h___
#define FragmentOrElement_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/FragmentOrElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/FragmentOrElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAttrAndChildArray.h"          // member
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsAttrAndChildArray.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Storage of the children and attributes of a DOM node; storage for
 * the two is unified to minimize footprint.
 */

#ifndef nsAttrAndChildArray_h___
#define nsAttrAndChildArray_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/base/nsAttrAndChildArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/base/nsAttrAndChildArray.h"

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/dom/base/nsAttrAndChildArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAttrName.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsAttrName.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Class that represents the name (nodeinfo or atom) of an attribute;
 * using nodeinfos all the time is too slow, so we use atoms when we
 * can.
 */

#ifndef nsAttrName_h___
#define nsAttrName_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/NodeInfo.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/NodeInfo.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Class that represents a prefix/namespace/localName triple; a single
 * nodeinfo is shared by all elements in a document that have that
 * prefix, namespace, and localName.
 *
 * nsNodeInfoManagers are internal objects that manage a list of
 * NodeInfos, every document object should hold a strong reference to
 * a nsNodeInfoManager and every NodeInfo also holds a strong reference
 * to their owning manager. When a NodeInfo is no longer used it will
 * automatically remove itself from its owner manager, and when all
 * NodeInfos have been removed from a nsNodeInfoManager and all external
 * references are released the nsNodeInfoManager deletes itself.
 */

#ifndef mozilla_dom_NodeInfo_h___
#define mozilla_dom_NodeInfo_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/mozilla/dom/NodeInfo.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCycleCollectionParticipant.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsCycleCollectionParticipant_h__
#define nsCycleCollectionParticipant_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MacroArgs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsCycleCollectionParticipant.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MacroForEach.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsCycleCollectionParticipant.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionNoteChild.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsCycleCollectionParticipant.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsCycleCollectionParticipant.h"

#define NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID                                 \
{                                                                              \
    0x9674489b,                                                                \
    0x1f6f,                                                                    \
    0x4550,                                                                    \
    { 0xa7, 0x30, 0xcc, 0xae, 0xdd, 0x10, 0x4c, 0xf9 }                         \
}

/**
 * Special IID to get at the base nsISupports for a class. Usually this is the
 * canonical nsISupports pointer, but in the case of tearoffs for example it is
 * the base nsISupports pointer of the tearoff. This allow the cycle collector
 * to have separate nsCycleCollectionParticipant's for tearoffs or aggregated
 * classes.
 */
#define NS_CYCLECOLLECTIONISUPPORTS_IID                                        \
{                                                                              \
    0xc61eac14,                                                                \
    0x5f7a,                                                                    \
    0x4481,                                                                    \
    { 0x96, 0x5e, 0x7e, 0xaa, 0x6e, 0xff, 0xa8, 0x5f }                         \
}

/**
 * Just holds the IID so NS_GET_IID works.
 */
class nsCycleCollectionISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_CYCLECOLLECTIONISUPPORTS_IID)
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsCycleCollectionISupports,
                              NS_CYCLECOLLECTIONISUPPORTS_IID)

namespace JS {
template<class T> class Heap;
} /* namespace JS */

/*
 * A struct defining pure virtual methods which are called when tracing cycle
 * collection paticipants.  The appropriate method is called depending on the
 * type of JS GC thing.
 */
struct TraceCallbacks
{
  virtual void Trace(JS::Heap<JS::Value>* aPtr, const char* aName,
                     void* aClosure) const = 0;
  virtual void Trace(JS::Heap<jsid>* aPtr, const char* aName,
                     void* aClosure) const = 0;
  virtual void Trace(JS::Heap<JSObject*>* aPtr, const char* aName,
                     void* aClosure) const = 0;
  virtual void Trace(JS::TenuredHeap<JSObject*>* aPtr, const char* aName,
                     void* aClosure) const = 0;
  virtual void Trace(JS::Heap<JSString*>* aPtr, const char* aName,
                     void* aClosure) const = 0;
  virtual void Trace(JS::Heap<JSScript*>* aPtr, const char* aName,
                     void* aClosure) const = 0;
  virtual void Trace(JS::Heap<JSFunction*>* aPtr, const char* aName,
                     void* aClosure) const = 0;
};

/*
 * An implementation of TraceCallbacks that calls a single function for all JS
 * GC thing types encountered.
 */
struct TraceCallbackFunc : public TraceCallbacks
{
  typedef void (*Func)(JS::GCCellPtr aPtr, const char* aName, void* aClosure);

  explicit TraceCallbackFunc(Func aCb) : mCallback(aCb) {}

  virtual void Trace(JS::Heap<JS::Value>* aPtr, const char* aName,
                     void* aClosure) const MOZ_OVERRIDE;
  virtual void Trace(JS::Heap<jsid>* aPtr, const char* aName,
                     void* aClosure) const MOZ_OVERRIDE;
  virtual void Trace(JS::Heap<JSObject*>* aPtr, const char* aName,
                     void* aClosure) const MOZ_OVERRIDE;
  virtual void Trace(JS::TenuredHeap<JSObject*>* aPtr, const char* aName,
                     void* aClosure) const MOZ_OVERRIDE;
  virtual void Trace(JS::Heap<JSString*>* aPtr, const char* aName,
                     void* aClosure) const MOZ_OVERRIDE;
  virtual void Trace(JS::Heap<JSScript*>* aPtr, const char* aName,
                     void* aClosure) const MOZ_OVERRIDE;
  virtual void Trace(JS::Heap<JSFunction*>* aPtr, const char* aName,
                     void* aClosure) const MOZ_OVERRIDE;

private:
  Func mCallback;
};

/**
 * Participant implementation classes
 */
class NS_NO_VTABLE nsCycleCollectionParticipant
{
public:
  MOZ_CONSTEXPR nsCycleCollectionParticipant() : mMightSkip(false) {}
  MOZ_CONSTEXPR explicit nsCycleCollectionParticipant(bool aSkip) : mMightSkip(aSkip) {}

  NS_IMETHOD Traverse(void* aPtr, nsCycleCollectionTraversalCallback& aCb) = 0;

  NS_IMETHOD_(void) Root(void* aPtr) = 0;
  NS_IMETHOD_(void) Unlink(void* aPtr) = 0;
  NS_IMETHOD_(void) Unroot(void* aPtr) = 0;

  NS_IMETHOD_(void) Trace(void* aPtr, const TraceCallbacks& aCb,
                          void* aClosure) {}

  // If CanSkip returns true, p is removed from the purple buffer during
  // a call to nsCycleCollector_forgetSkippable().
  // Note, calling CanSkip may remove objects from the purple buffer!
  // If aRemovingAllowed is true, p can be removed from the purple buffer.
  bool CanSkip(void* aPtr, bool aRemovingAllowed)
  {
    return mMightSkip ? CanSkipReal(aPtr, aRemovingAllowed) : false;
  }

  // If CanSkipInCC returns true, p is skipped when selecting roots for the
  // cycle collector graph.
  // Note, calling CanSkipInCC may remove other objects from the purple buffer!
  bool CanSkipInCC(void* aPtr)
  {
    return mMightSkip ? CanSkipInCCReal(aPtr) : false;
  }

  // If CanSkipThis returns true, p is not added to the graph.
  // This method is called during cycle collection, so don't
  // change the state of any objects!
  bool CanSkipThis(void* aPtr)
  {
    return mMightSkip ? CanSkipThisReal(aPtr) : false;
  }

  NS_IMETHOD_(void) DeleteCycleCollectable(void* aPtr) = 0;

protected:
  NS_IMETHOD_(bool) CanSkipReal(void* aPtr, bool aRemovingAllowed)
  {
    NS_ASSERTION(false, "Forgot to implement CanSkipReal?");
    return false;
  }
  NS_IMETHOD_(bool) CanSkipInCCReal(void* aPtr)
  {
    NS_ASSERTION(false, "Forgot to implement CanSkipInCCReal?");
    return false;
  }
  NS_IMETHOD_(bool) CanSkipThisReal(void* aPtr)
  {
    NS_ASSERTION(false, "Forgot to implement CanSkipThisReal?");
    return false;
  }

private:
  const bool mMightSkip;
};

class NS_NO_VTABLE nsScriptObjectTracer : public nsCycleCollectionParticipant
{
public:
  MOZ_CONSTEXPR nsScriptObjectTracer()
    : nsCycleCollectionParticipant(false)
  {
  }
  MOZ_CONSTEXPR explicit nsScriptObjectTracer(bool aSkip)
    : nsCycleCollectionParticipant(aSkip)
  {
  }

  NS_IMETHOD_(void) Trace(void* aPtr, const TraceCallbacks& aCb,
                          void* aClosure) MOZ_OVERRIDE = 0;

  static void NoteJSChild(JS::GCCellPtr aGCThing, const char* aName,
                          void* aClosure);
};

class NS_NO_VTABLE nsXPCOMCycleCollectionParticipant : public nsScriptObjectTracer
{
public:
  MOZ_CONSTEXPR nsXPCOMCycleCollectionParticipant()
    : nsScriptObjectTracer(false)
  {
  }
  MOZ_CONSTEXPR explicit nsXPCOMCycleCollectionParticipant(bool aSkip)
    : nsScriptObjectTracer(aSkip)
  {
  }

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID)

  NS_IMETHOD_(void) Root(void* aPtr) MOZ_OVERRIDE;
  NS_IMETHOD_(void) Unroot(void* aPtr) MOZ_OVERRIDE;

  NS_IMETHOD_(void) Trace(void* aPtr, const TraceCallbacks& aCb,
                          void* aClosure) MOZ_OVERRIDE;

  static bool CheckForRightISupports(nsISupports* aSupports);
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsXPCOMCycleCollectionParticipant,
                              NS_XPCOMCYCLECOLLECTIONPARTICIPANT_IID)

///////////////////////////////////////////////////////////////////////////////
// Helpers for implementing a QI to nsXPCOMCycleCollectionParticipant
///////////////////////////////////////////////////////////////////////////////

#define NS_CYCLE_COLLECTION_CLASSNAME(_class)                                  \
        _class::NS_CYCLE_COLLECTION_INNERCLASS

#define NS_IMPL_QUERY_CYCLE_COLLECTION(_class)                                 \
  if ( aIID.Equals(NS_GET_IID(nsXPCOMCycleCollectionParticipant)) ) {          \
    *aInstancePtr = NS_CYCLE_COLLECTION_PARTICIPANT(_class);                   \
    return NS_OK;                                                              \
  } else

#define NS_IMPL_QUERY_CYCLE_COLLECTION_ISUPPORTS(_class)                       \
  if ( aIID.Equals(NS_GET_IID(nsCycleCollectionISupports)) ) {                 \
    *aInstancePtr = NS_CYCLE_COLLECTION_CLASSNAME(_class)::Upcast(this);       \
    return NS_OK;                                                              \
  } else

#define NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION(_class)                        \
  NS_IMPL_QUERY_CYCLE_COLLECTION(_class)

#define NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_ISUPPORTS(_class)              \
  NS_IMPL_QUERY_CYCLE_COLLECTION_ISUPPORTS(_class)

#define NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(_class)                      \
  NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION(_class)                              \
  NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION_ISUPPORTS(_class)

#define NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(_class)                        \
  NS_INTERFACE_MAP_BEGIN(_class)                                               \
    NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(_class)

#define NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(_class)              \
  NS_INTERFACE_MAP_BEGIN(_class)                                               \
    NS_INTERFACE_MAP_ENTRY_CYCLE_COLLECTION(_class)

#define NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(_class)  \
  if (rv == NS_OK) return rv; \
  nsISupports* foundInterface; \
  NS_INTERFACE_MAP_ENTRIES_CYCLE_COLLECTION(_class)

#define NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(_class)            \
  NS_IMETHODIMP _class::QueryInterface(REFNSIID aIID, void** aInstancePtr)    \
  {                                                                           \
    NS_PRECONDITION(aInstancePtr, "null out param");                          \
                                                                              \
    if ( aIID.Equals(NS_GET_IID(nsXPCOMCycleCollectionParticipant)) ) {       \
      *aInstancePtr = NS_CYCLE_COLLECTION_PARTICIPANT(_class);                \
      return NS_OK;                                                           \
    }                                                                         \
    nsresult rv;

#define NS_CYCLE_COLLECTION_UPCAST(obj, clazz)                                 \
  NS_CYCLE_COLLECTION_CLASSNAME(clazz)::Upcast(obj)

#ifdef DEBUG
#define NS_CHECK_FOR_RIGHT_PARTICIPANT(_ptr) _ptr->CheckForRightParticipant()
#else
# 276 "../../dist/include/nsCycleCollectionParticipant.h"
#define NS_CHECK_FOR_RIGHT_PARTICIPANT(_ptr)
#endif
# 278 "../../dist/include/nsCycleCollectionParticipant.h"

// The default implementation of this class template is empty, because it
// should never be used: see the partial specializations below.
template<typename T,
         bool IsXPCOM = mozilla::IsBaseOf<nsISupports, T>::value>
struct DowncastCCParticipantImpl
{
};

// Specialization for XPCOM CC participants
template<typename T>
struct DowncastCCParticipantImpl<T, true>
{
  static T* Run(void* aPtr)
  {
    nsISupports* s = static_cast<nsISupports*>(aPtr);
    MOZ_ASSERT(NS_CYCLE_COLLECTION_CLASSNAME(T)::CheckForRightISupports(s),
               "not the nsISupports pointer we expect");
    T* rval =  NS_CYCLE_COLLECTION_CLASSNAME(T)::Downcast(s);
    NS_CHECK_FOR_RIGHT_PARTICIPANT(rval);
    return rval;
  }
};

// Specialization for native CC participants
template<typename T>
struct DowncastCCParticipantImpl<T, false>
{
  static T* Run(void* aPtr) { return static_cast<T*>(aPtr); }
};

template<typename T>
T*
DowncastCCParticipant(void* aPtr)
{
  return DowncastCCParticipantImpl<T>::Run(aPtr);
}

///////////////////////////////////////////////////////////////////////////////
// Helpers for implementing CanSkip methods
///////////////////////////////////////////////////////////////////////////////

#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(_class)                        \
  NS_IMETHODIMP_(bool)                                                         \
  NS_CYCLE_COLLECTION_CLASSNAME(_class)::CanSkipReal(void *p,                  \
                                                     bool aRemovingAllowed)    \
  {                                                                            \
    _class *tmp = DowncastCCParticipant<_class >(p);

#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END                                  \
    (void)tmp;                                                                 \
    return false;                                                              \
  }

#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(_class)                  \
  NS_IMETHODIMP_(bool)                                                         \
  NS_CYCLE_COLLECTION_CLASSNAME(_class)::CanSkipInCCReal(void *p)              \
  {                                                                            \
    _class *tmp = DowncastCCParticipant<_class >(p);

#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END                            \
    (void)tmp;                                                                 \
    return false;                                                              \
  }

#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(_class)                   \
  NS_IMETHODIMP_(bool)                                                         \
  NS_CYCLE_COLLECTION_CLASSNAME(_class)::CanSkipThisReal(void *p)              \
  {                                                                            \
    _class *tmp = DowncastCCParticipant<_class >(p);

#define NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END                             \
    (void)tmp;                                                                 \
    return false;                                                              \
  }

///////////////////////////////////////////////////////////////////////////////
// Helpers for implementing nsCycleCollectionParticipant::Unlink
//
// You need to use NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED if you want
// the base class Unlink version to be called before your own implementation.
// You can use NS_IMPL_CYCLE_COLLECTION_UNLINK_END_INHERITED if you want the
// base class Unlink to get called after your own implementation.  You should
// never use them together.
///////////////////////////////////////////////////////////////////////////////

#define NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)                          \
  NS_IMETHODIMP_(void)                                                         \
  NS_CYCLE_COLLECTION_CLASSNAME(_class)::Unlink(void *p)                       \
  {                                                                            \
    _class *tmp = DowncastCCParticipant<_class >(p);

#define NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(_class, _base_class)   \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)                                \
    nsISupports *s = static_cast<nsISupports*>(p);                             \
    NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::Unlink(s);

#define NS_IMPL_CYCLE_COLLECTION_UNLINK_HELPER(_field)                        \
  ImplCycleCollectionUnlink(tmp->_field);

#define NS_IMPL_CYCLE_COLLECTION_UNLINK(...)                                   \
  MOZ_STATIC_ASSERT_VALID_ARG_COUNT(__VA_ARGS__);                              \
  MOZ_FOR_EACH(NS_IMPL_CYCLE_COLLECTION_UNLINK_HELPER, (), (__VA_ARGS__))

#define NS_IMPL_CYCLE_COLLECTION_UNLINK_END                                    \
    (void)tmp;                                                                 \
  }

#define NS_IMPL_CYCLE_COLLECTION_UNLINK_END_INHERITED(_base_class)             \
    nsISupports *s = static_cast<nsISupports*>(p);                             \
    NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::Unlink(s);                     \
    (void)tmp;                                                                 \
  }

#define NS_IMPL_CYCLE_COLLECTION_UNLINK_0(_class)                              \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)                                \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_END


///////////////////////////////////////////////////////////////////////////////
// Helpers for implementing nsCycleCollectionParticipant::Traverse
///////////////////////////////////////////////////////////////////////////////

#define NS_IMPL_CYCLE_COLLECTION_DESCRIBE(_class, _refcnt)                     \
    cb.DescribeRefCountedNode(_refcnt, #_class);

#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(_class)               \
  NS_IMETHODIMP                                                                \
  NS_CYCLE_COLLECTION_CLASSNAME(_class)::Traverse                              \
                         (void *p, nsCycleCollectionTraversalCallback &cb)     \
  {                                                                            \
    _class *tmp = DowncastCCParticipant<_class >(p);

#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class)                        \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(_class)                     \
  NS_IMPL_CYCLE_COLLECTION_DESCRIBE(_class, tmp->mRefCnt.get())

// Base class' CC participant should return NS_SUCCESS_INTERRUPTED_TRAVERSE
// from Traverse if it wants derived classes to not traverse anything from
// their CC participant.

#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(_class, _base_class) \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(_class)                     \
    nsISupports *s = static_cast<nsISupports*>(p);                             \
    if (NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::Traverse(s, cb)            \
        == NS_SUCCESS_INTERRUPTED_TRAVERSE) {                                  \
      return NS_SUCCESS_INTERRUPTED_TRAVERSE;                                  \
    }

#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_HELPER(_field)                       \
  ImplCycleCollectionTraverse(cb, tmp->_field, #_field, 0);

#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE(...)                                 \
  MOZ_STATIC_ASSERT_VALID_ARG_COUNT(__VA_ARGS__);                              \
  MOZ_FOR_EACH(NS_IMPL_CYCLE_COLLECTION_TRAVERSE_HELPER, (), (__VA_ARGS__))

#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(_field)                       \
  CycleCollectionNoteChild(cb, tmp->_field, #_field);

#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS                       \
  {                                                                            \
  TraceCallbackFunc noteJsChild(&nsScriptObjectTracer::NoteJSChild);           \
  Trace(p, noteJsChild, &cb);                                                  \
  }

#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                                  \
    (void)tmp;                                                                 \
    return NS_OK;                                                              \
  }

///////////////////////////////////////////////////////////////////////////////
// Helpers for implementing nsScriptObjectTracer::Trace
///////////////////////////////////////////////////////////////////////////////

#define NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(_class)                                 \
  void                                                                               \
  NS_CYCLE_COLLECTION_CLASSNAME(_class)::Trace(void *p,                              \
                                               const TraceCallbacks &aCallbacks,     \
                                               void *aClosure)                       \
  {                                                                                  \
    _class *tmp = DowncastCCParticipant<_class >(p);

#define NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(_class, _base_class)    \
  NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(_class)                                 \
    nsISupports *s = static_cast<nsISupports*>(p);                             \
    NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::Trace(s, aCallbacks, aClosure);

#define NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(_field)              \
  if (tmp->_field)                                                             \
    aCallbacks.Trace(&tmp->_field, #_field, aClosure);

#define NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(_field)           \
  aCallbacks.Trace(&tmp->_field, #_field, aClosure);

// NB: The (void)tmp; hack in the TRACE_END macro exists to support
// implementations that don't need to do anything in their Trace method.
// Without this hack, some compilers warn about the unused tmp local.
#define NS_IMPL_CYCLE_COLLECTION_TRACE_END                                     \
      (void)tmp;                                                               \
  }

///////////////////////////////////////////////////////////////////////////////
// Helpers for implementing a concrete nsCycleCollectionParticipant
///////////////////////////////////////////////////////////////////////////////

// If a class defines a participant, then QIing an instance of that class to
// nsXPCOMCycleCollectionParticipant should produce that participant.
#ifdef DEBUG
#define NS_CHECK_FOR_RIGHT_PARTICIPANT_BASE                                    \
    virtual void CheckForRightParticipant()
#define NS_CHECK_FOR_RIGHT_PARTICIPANT_DERIVED                                 \
    virtual void CheckForRightParticipant() MOZ_OVERRIDE
#define NS_CHECK_FOR_RIGHT_PARTICIPANT_BODY(_class)                            \
    {                                                                          \
      nsXPCOMCycleCollectionParticipant *p;                                    \
      CallQueryInterface(this, &p);                                            \
      MOZ_ASSERT(p == &NS_CYCLE_COLLECTION_INNERNAME,                          \
                 #_class " should QI to its own CC participant");              \
    }
#define NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class)                            \
    NS_CHECK_FOR_RIGHT_PARTICIPANT_BASE                                        \
    NS_CHECK_FOR_RIGHT_PARTICIPANT_BODY(_class)
#define NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)                  \
    NS_CHECK_FOR_RIGHT_PARTICIPANT_DERIVED                                     \
    NS_CHECK_FOR_RIGHT_PARTICIPANT_BODY(_class)
#else
# 504 "../../dist/include/nsCycleCollectionParticipant.h"
#define NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class)
#define NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)
#endif
# 507 "../../dist/include/nsCycleCollectionParticipant.h"

#define NS_DECL_CYCLE_COLLECTION_CLASS_BODY_NO_UNLINK(_class, _base)           \
public:                                                                        \
  NS_IMETHOD Traverse(void *p, nsCycleCollectionTraversalCallback &cb)         \
    MOZ_OVERRIDE;                                                              \
  NS_IMETHOD_(void) DeleteCycleCollectable(void *p) MOZ_OVERRIDE               \
  {                                                                            \
    DowncastCCParticipant<_class>(p)->DeleteCycleCollectable();                \
  }                                                                            \
  static _class* Downcast(nsISupports* s)                                      \
  {                                                                            \
    return static_cast<_class*>(static_cast<_base*>(s));                       \
  }                                                                            \
  static nsISupports* Upcast(_class *p)                                        \
  {                                                                            \
    return NS_ISUPPORTS_CAST(_base*, p);                                       \
  }                                                                            \
  template<typename T>                                                         \
  friend nsISupports*                                                          \
  ToSupports(T* p, NS_CYCLE_COLLECTION_INNERCLASS* dummy);

#define NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base)                     \
  NS_DECL_CYCLE_COLLECTION_CLASS_BODY_NO_UNLINK(_class, _base)                 \
  NS_IMETHOD_(void) Unlink(void *p) MOZ_OVERRIDE;

#define NS_PARTICIPANT_AS(type, participant)                                   \
  const_cast<type*>(reinterpret_cast<const type*>(participant))

#define NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                 \
  static MOZ_CONSTEXPR nsXPCOMCycleCollectionParticipant* GetParticipant()     \
  {                                                                            \
    return &_class::NS_CYCLE_COLLECTION_INNERNAME;                             \
  }

/**
 * We use this macro to force that classes that inherit from a ccable class and
 * declare their own participant declare themselves as inherited cc classes.
 * To avoid possibly unnecessary vtables we only do this checking in debug
 * builds.
 */
#ifdef DEBUG
#define NOT_INHERITED_CANT_OVERRIDE virtual void BaseCycleCollectable() MOZ_FINAL {}
#else
# 550 "../../dist/include/nsCycleCollectionParticipant.h"
#define NOT_INHERITED_CANT_OVERRIDE
#endif
# 552 "../../dist/include/nsCycleCollectionParticipant.h"

#define NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(_class, _base)                \
class NS_CYCLE_COLLECTION_INNERCLASS                                           \
 : public nsXPCOMCycleCollectionParticipant                                    \
{                                                                              \
  NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base)                           \
  NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                       \
};                                                                             \
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class)                                    \
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;           \
  NOT_INHERITED_CANT_OVERRIDE

#define NS_DECL_CYCLE_COLLECTION_CLASS(_class)                                 \
  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(_class, _class)

// Cycle collector helper for ambiguous classes that can sometimes be skipped.
#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS_AMBIGUOUS(_class, _base)        \
class NS_CYCLE_COLLECTION_INNERCLASS                                             \
 : public nsXPCOMCycleCollectionParticipant                                      \
{                                                                                \
public:                                                                          \
  MOZ_CONSTEXPR NS_CYCLE_COLLECTION_INNERCLASS ()                                \
  : nsXPCOMCycleCollectionParticipant(true) {}                                   \
private:                                                                         \
  NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base)                             \
  NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed) MOZ_OVERRIDE;    \
  NS_IMETHOD_(bool) CanSkipInCCReal(void *p) MOZ_OVERRIDE;                       \
  NS_IMETHOD_(bool) CanSkipThisReal(void *p) MOZ_OVERRIDE;                       \
  NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                         \
};                                                                               \
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class)                                      \
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;             \
NOT_INHERITED_CANT_OVERRIDE

#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS(_class)                       \
        NS_DECL_CYCLE_COLLECTION_SKIPPABLE_CLASS_AMBIGUOUS(_class, _class)

#define NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(_class, _base)          \
class NS_CYCLE_COLLECTION_INNERCLASS                                                   \
 : public nsXPCOMCycleCollectionParticipant                                            \
{                                                                                      \
  NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base)                                   \
  NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure)            \
    MOZ_OVERRIDE;                                                                      \
  NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                               \
};                                                                                     \
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class)                                            \
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; \
NOT_INHERITED_CANT_OVERRIDE

#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(_class, _base)   \
class NS_CYCLE_COLLECTION_INNERCLASS                                                      \
 : public nsXPCOMCycleCollectionParticipant                                               \
{                                                                                         \
public:                                                                                   \
  MOZ_CONSTEXPR NS_CYCLE_COLLECTION_INNERCLASS ()                                         \
  : nsXPCOMCycleCollectionParticipant(true) {}                                            \
private:                                                                                  \
  NS_DECL_CYCLE_COLLECTION_CLASS_BODY(_class, _base)                                      \
  NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed) MOZ_OVERRIDE;             \
  NS_IMETHOD_(bool) CanSkipInCCReal(void *p) MOZ_OVERRIDE;                                \
  NS_IMETHOD_(bool) CanSkipThisReal(void *p) MOZ_OVERRIDE;                                \
  NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                                  \
};                                                                                        \
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL(_class)                                               \
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME; \
NOT_INHERITED_CANT_OVERRIDE

#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(_class)  \
  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(_class, _class)

#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_INHERITED(_class,       \
                                                                         _base_class)  \
class NS_CYCLE_COLLECTION_INNERCLASS                                                   \
 : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class)                                   \
{                                                                                      \
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class)                   \
  NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed) MOZ_OVERRIDE;          \
  NS_IMETHOD_(bool) CanSkipInCCReal(void *p) MOZ_OVERRIDE;                             \
  NS_IMETHOD_(bool) CanSkipThisReal(void *p) MOZ_OVERRIDE;                             \
  NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                               \
}; \
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)  \
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;

#define NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(_class)  \
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(_class, _class)

#define NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY_NO_UNLINK(_class,        \
                                                                _base_class)   \
public:                                                                        \
  NS_IMETHOD Traverse(void *p, nsCycleCollectionTraversalCallback &cb)         \
    MOZ_OVERRIDE;                                                              \
  static _class* Downcast(nsISupports* s)                                      \
  {                                                                            \
    return static_cast<_class*>(static_cast<_base_class*>(                     \
      NS_CYCLE_COLLECTION_CLASSNAME(_base_class)::Downcast(s)));               \
  }

#define NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class)     \
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY_NO_UNLINK(_class, _base_class) \
  NS_IMETHOD_(void) Unlink(void *p) MOZ_OVERRIDE;

#define NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(_class, _base_class)          \
class NS_CYCLE_COLLECTION_INNERCLASS                                           \
 : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class)                           \
{                                                                              \
public:                                                                        \
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class)           \
  NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                       \
};                                                                             \
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)                          \
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;

#define NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(_class,             \
                                                           _base_class)        \
class NS_CYCLE_COLLECTION_INNERCLASS                                           \
 : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class)                           \
{                                                                              \
public:                                                                        \
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY_NO_UNLINK(_class, _base_class) \
  NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                       \
};                                                                             \
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)                          \
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;

#define NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(_class,                 \
                                                               _base_class)            \
class NS_CYCLE_COLLECTION_INNERCLASS                                                   \
 : public NS_CYCLE_COLLECTION_CLASSNAME(_base_class)                                   \
{                                                                                      \
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_BODY(_class, _base_class)                   \
  NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure)            \
    MOZ_OVERRIDE;                                                                      \
  NS_IMPL_GET_XPCOM_CYCLE_COLLECTION_PARTICIPANT(_class)                               \
};                                                                                     \
NS_CHECK_FOR_RIGHT_PARTICIPANT_IMPL_INHERITED(_class)                                  \
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;

// Cycle collector participant declarations.

#define NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class)                     \
  public:                                                                      \
    NS_IMETHOD_(void) Root(void *n) MOZ_OVERRIDE;                              \
    NS_IMETHOD_(void) Unlink(void *n) MOZ_OVERRIDE;                            \
    NS_IMETHOD_(void) Unroot(void *n) MOZ_OVERRIDE;                            \
    NS_IMETHOD Traverse(void *n, nsCycleCollectionTraversalCallback &cb)       \
  MOZ_OVERRIDE;                                                                \
    NS_IMETHOD_(void) DeleteCycleCollectable(void *n) MOZ_OVERRIDE             \
    {                                                                          \
      DowncastCCParticipant<_class>(n)->DeleteCycleCollectable();              \
    }                                                                          \
    static _class* Downcast(void* s)                                           \
    {                                                                          \
      return DowncastCCParticipant<_class>(s);                                 \
    }                                                                          \
    static void* Upcast(_class *p)                                             \
    {                                                                          \
      return static_cast<void*>(p);                                            \
    }

#define NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(_class)                          \
  void DeleteCycleCollectable(void)                                            \
  {                                                                            \
    delete this;                                                               \
  }                                                                            \
  class NS_CYCLE_COLLECTION_INNERCLASS                                         \
   : public nsCycleCollectionParticipant                                       \
  {                                                                            \
    NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class)                         \
    static MOZ_CONSTEXPR nsCycleCollectionParticipant* GetParticipant()        \
    {                                                                          \
      return &_class::NS_CYCLE_COLLECTION_INNERNAME;                           \
    }                                                                          \
  };                                                                           \
  static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;

#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_NATIVE_CLASS(_class)                \
  void DeleteCycleCollectable(void)                                            \
  {                                                                            \
    delete this;                                                               \
  }                                                                            \
  class NS_CYCLE_COLLECTION_INNERCLASS                                         \
   : public nsCycleCollectionParticipant                                       \
  {                                                                            \
  public:                                                                      \
    MOZ_CONSTEXPR NS_CYCLE_COLLECTION_INNERCLASS ()                            \
    : nsCycleCollectionParticipant(true) {}                                    \
  private:                                                                     \
    NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class)                         \
    NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed) MOZ_OVERRIDE;\
    NS_IMETHOD_(bool) CanSkipInCCReal(void *p) MOZ_OVERRIDE;                   \
    NS_IMETHOD_(bool) CanSkipThisReal(void *p) MOZ_OVERRIDE;                   \
    static nsCycleCollectionParticipant* GetParticipant()                      \
    {                                                                          \
      return &_class::NS_CYCLE_COLLECTION_INNERNAME;                           \
    }                                                                          \
  };                                                                           \
  static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;

#define NS_DECL_CYCLE_COLLECTION_SKIPPABLE_NATIVE_CLASS_WITH_CUSTOM_DELETE(_class) \
class NS_CYCLE_COLLECTION_INNERCLASS                                           \
 : public nsCycleCollectionParticipant                                         \
{                                                                              \
public:                                                                        \
  MOZ_CONSTEXPR NS_CYCLE_COLLECTION_INNERCLASS ()                              \
  : nsCycleCollectionParticipant(true) {}                                      \
private:                                                                       \
  NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class)                           \
  NS_IMETHOD_(bool) CanSkipReal(void *p, bool aRemovingAllowed) MOZ_OVERRIDE;  \
  NS_IMETHOD_(bool) CanSkipInCCReal(void *p) MOZ_OVERRIDE;                     \
  NS_IMETHOD_(bool) CanSkipThisReal(void *p) MOZ_OVERRIDE;                     \
  static nsCycleCollectionParticipant* GetParticipant()                        \
  {                                                                            \
    return &_class::NS_CYCLE_COLLECTION_INNERNAME;                             \
  }                                                                            \
};                                                                             \
static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;

#define NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(_class)            \
  void DeleteCycleCollectable(void)                                            \
  {                                                                            \
    delete this;                                                               \
  }                                                                            \
  class NS_CYCLE_COLLECTION_INNERCLASS                                         \
   : public nsScriptObjectTracer                                               \
  {                                                                            \
    NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS_BODY(_class)                         \
    NS_IMETHOD_(void) Trace(void *p, const TraceCallbacks &cb, void *closure)  \
      MOZ_OVERRIDE;                                                            \
    static MOZ_CONSTEXPR nsScriptObjectTracer* GetParticipant()                \
    {                                                                          \
      return &_class::NS_CYCLE_COLLECTION_INNERNAME;                           \
    }                                                                          \
  };                                                                           \
  static NS_CYCLE_COLLECTION_INNERCLASS NS_CYCLE_COLLECTION_INNERNAME;

#define NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(_class, _root_function)           \
  NS_IMETHODIMP_(void)                                                         \
  NS_CYCLE_COLLECTION_CLASSNAME(_class)::Root(void *p)                         \
  {                                                                            \
    _class *tmp = static_cast<_class*>(p);                                     \
    tmp->_root_function();                                                     \
  }

#define NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(_class, _unroot_function)       \
  NS_IMETHODIMP_(void)                                                         \
  NS_CYCLE_COLLECTION_CLASSNAME(_class)::Unroot(void *p)                       \
  {                                                                            \
    _class *tmp = static_cast<_class*>(p);                                     \
    tmp->_unroot_function();                                                   \
  }

#define NS_IMPL_CYCLE_COLLECTION_CLASS(_class) \
 _class::NS_CYCLE_COLLECTION_INNERCLASS _class::NS_CYCLE_COLLECTION_INNERNAME;

// NB: This is not something you usually want to use.  It is here to allow
// adding things to the CC graph to help debugging via CC logs, but it does not
// traverse or unlink anything, so it is useless for anything else.
#define NS_IMPL_CYCLE_COLLECTION_0(_class)                                     \
  NS_IMPL_CYCLE_COLLECTION_CLASS(_class)                                       \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)                                \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_END                                          \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_END                                          \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(_class, _base)             \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__)                               \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END

#define NS_CYCLE_COLLECTION_NOTE_EDGE_NAME CycleCollectionNoteEdgeName

#endif // nsCycleCollectionParticipant_h__
# 841 "../../dist/include/nsCycleCollectionParticipant.h"
# 26 "../../dist/include/mozilla/dom/NodeInfo.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/NameSpaceConstants.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/NameSpaceConstants.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_NameSpaceConstants_h__
#define mozilla_dom_NameSpaceConstants_h__

#define kNameSpaceID_Unknown -1
// 0 is special at C++, so use a static const int32_t for
// kNameSpaceID_None to keep if from being cast to pointers
// Note that the XBL cache assumes (and asserts) that it can treat a
// single-byte value higher than kNameSpaceID_LastBuiltin specially. 
static const int32_t kNameSpaceID_None = 0;
#define kNameSpaceID_XMLNS    1 // not really a namespace, but it needs to play the game
#define kNameSpaceID_XML      2
#define kNameSpaceID_XHTML    3
#define kNameSpaceID_XLink    4
#define kNameSpaceID_XSLT     5
#define kNameSpaceID_XBL      6
#define kNameSpaceID_MathML   7
#define kNameSpaceID_RDF      8
#define kNameSpaceID_XUL      9
#define kNameSpaceID_SVG      10
#define kNameSpaceID_LastBuiltin          10 // last 'built-in' namespace

#endif // mozilla_dom_NameSpaceConstants_h__
# 28 "../../dist/include/mozilla/dom/NameSpaceConstants.h"
# 27 "../../dist/include/mozilla/dom/NodeInfo.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/mozilla/dom/NodeInfo.h"

class nsIAtom;
class nsIDocument;
class nsNodeInfoManager;

namespace mozilla {
namespace dom {

class NodeInfo MOZ_FINAL
{
public:
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(NodeInfo)
  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_NATIVE_CLASS_WITH_CUSTOM_DELETE(NodeInfo)

  /*
   * Get the name from this node as a string, this does not include the prefix.
   *
   * For the HTML element "<body>" this will return "body" and for the XML
   * element "<html:body>" this will return "body".
   */
  void GetName(nsAString& aName) const;

  /*
   * Get the name from this node as an atom, this does not include the prefix.
   * This function never returns a null atom.
   *
   * For the HTML element "<body>" this will return the "body" atom and for
   * the XML element "<html:body>" this will return the "body" atom.
   */
  nsIAtom* NameAtom() const
  {
    return mInner.mName;
  }

  /*
   * Get the qualified name from this node as a string, the qualified name
   * includes the prefix, if one exists.
   *
   * For the HTML element "<body>" this will return "body" and for the XML
   * element "<html:body>" this will return "html:body".
   */
  const nsString& QualifiedName() const {
    return mQualifiedName;
  }

  /*
   * Returns the node's nodeName as defined in DOM Core
   */
  const nsString& NodeName() const {
    return mNodeName;
  }

  /*
   * Returns the node's localName as defined in DOM Core
   */
  const nsString& LocalName() const {
    return mLocalName;
  }

  /*
   * Get the prefix from this node as a string.
   *
   * For the HTML element "<body>" this will return a null string and for
   * the XML element "<html:body>" this will return the string "html".
   */
  void GetPrefix(nsAString& aPrefix) const;

  /*
   * Get the prefix from this node as an atom.
   *
   * For the HTML element "<body>" this will return a null atom and for
   * the XML element "<html:body>" this will return the "html" atom.
   */
  nsIAtom* GetPrefixAtom() const
  {
    return mInner.mPrefix;
  }

  /*
   * Get the namespace URI for a node, if the node has a namespace URI.
   */
  void GetNamespaceURI(nsAString& aNameSpaceURI) const;

  /*
   * Get the namespace ID for a node if the node has a namespace, if not this
   * returns kNameSpaceID_None.
   */
  int32_t NamespaceID() const
  {
    return mInner.mNamespaceID;
  }

  /*
   * Get the nodetype for the node. Returns the values specified in nsIDOMNode
   * for nsIDOMNode.nodeType
   */
  uint16_t NodeType() const
  {
    return mInner.mNodeType;
  }

  /*
   * Get the extra name, used by PIs and DocTypes, for the node.
   */
  

  /**
   * Get the owning node info manager. Only to be used inside Gecko, you can't
   * really do anything with the pointer outside Gecko anyway.
   */
  nsNodeInfoManager* NodeInfoManager() const
  {
    return mOwnerManager;
  }

  /*
   * Utility functions that can be used to check if a nodeinfo holds a specific
   * name, name and prefix, name and prefix and namespace ID, or just
   * namespace ID.
   */
  ;

  ;

  bool Equals(nsIAtom* aNameAtom) const
  {
    return mInner.mName == aNameAtom;
  }

  

  bool Equals(nsIAtom* aNameAtom, int32_t aNamespaceID) const
  {
    return ((mInner.mName == aNameAtom) &&
            (mInner.mNamespaceID == aNamespaceID));
  }

  

  

  ;

  ;

  nsIDocument* GetDocument() const
  {
    return mDocument;
  }

private:
  NodeInfo() = delete; 
  NodeInfo(const NodeInfo& aOther) = delete;

  // NodeInfo is only constructed by nsNodeInfoManager which is a friend class.
  // aName and aOwnerManager may not be null.
  NodeInfo(nsIAtom* aName, nsIAtom* aPrefix, int32_t aNamespaceID,
           uint16_t aNodeType, nsIAtom* aExtraName,
           nsNodeInfoManager* aOwnerManager);

  ~NodeInfo();

public:
  bool CanSkip();

  /**
   * This method gets called by the cycle collector when it's time to delete
   * this object.
   */
  void DeleteCycleCollectable();

protected:
  /*
   * NodeInfoInner is used for two things:
   *
   *   1. as a member in nsNodeInfo for holding the name, prefix and
   *      namespace ID
   *   2. as the hash key in the hash table in nsNodeInfoManager
   *
   * NodeInfoInner does not do any kind of reference counting,
   * that's up to the user of this class. Since NodeInfoInner is
   * typically used as a member of NodeInfo, the hash table doesn't
   * need to delete the keys. When the value (NodeInfo) is deleted
   * the key is automatically deleted.
   */

  class NodeInfoInner
  {
  public:
    NodeInfoInner()
      : mName(nullptr), mPrefix(nullptr), mNamespaceID(kNameSpaceID_Unknown),
        mNodeType(0), mNameString(nullptr), mExtraName(nullptr)
    {
    }
    NodeInfoInner(nsIAtom *aName, nsIAtom *aPrefix, int32_t aNamespaceID,
                    uint16_t aNodeType, nsIAtom* aExtraName)
      : mName(aName), mPrefix(aPrefix), mNamespaceID(aNamespaceID),
        mNodeType(aNodeType), mNameString(nullptr), mExtraName(aExtraName)
    {
    }
    NodeInfoInner(const nsAString& aTmpName, nsIAtom *aPrefix,
                    int32_t aNamespaceID, uint16_t aNodeType)
      : mName(nullptr), mPrefix(aPrefix), mNamespaceID(aNamespaceID),
        mNodeType(aNodeType), mNameString(&aTmpName), mExtraName(nullptr)
    {
    }

    nsIAtom*            mName;
    nsIAtom*            mPrefix;
    int32_t             mNamespaceID;
    uint16_t            mNodeType; // As defined by nsIDOMNode.nodeType
    const nsAString*    mNameString;
    nsIAtom*            mExtraName; // Only used by PIs and DocTypes
  };

  // nsNodeInfoManager needs to pass mInner to the hash table.
  friend class ::nsNodeInfoManager;

  nsIDocument* mDocument; // Weak. Cache of mOwnerManager->mDocument

  NodeInfoInner mInner;

  nsRefPtr<nsNodeInfoManager> mOwnerManager;

  /*
   * Members for various functions of mName+mPrefix that we can be
   * asked to compute.
   */

  // Qualified name
  nsString mQualifiedName;

  // nodeName for the node.
  nsString mNodeName;

  // localName for the node. This is either equal to mInner.mName, or a
  // void string, depending on mInner.mNodeType.
  nsString mLocalName;
};

} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_NodeInfo_h___ */
# 302 "../../dist/include/mozilla/dom/NodeInfo.h"
# 16 "/Users/luser/build/mozilla-central/dom/base/nsAttrName.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIAtom.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIAtom.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIAtom.idl
 */

#ifndef __gen_nsIAtom_h__
#define __gen_nsIAtom_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIAtom.h"
#endif
# 12 "../../dist/include/nsIAtom.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIAtom.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsIAtom.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsIAtom.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringBuffer.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStringBuffer.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsStringBuffer_h__
#define nsStringBuffer_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Atomics.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsStringBuffer.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsStringBuffer.h"

template<class T> struct already_AddRefed;

/**
 * This structure precedes the string buffers "we" allocate.  It may be the
 * case that nsTAString::mData does not point to one of these special
 * buffers.  The mFlags member variable distinguishes the buffer type.
 *
 * When this header is in use, it enables reference counting, and capacity
 * tracking.  NOTE: A string buffer can be modified only if its reference
 * count is 1.
 */
class nsStringBuffer
{
private:
  friend class CheckStaticAtomSizes;

  mozilla::Atomic<int32_t> mRefCount;
  uint32_t mStorageSize;

public:

  /**
   * Allocates a new string buffer, with given size in bytes and a
   * reference count of one.  When the string buffer is no longer needed,
   * it should be released via Release.
   *
   * It is up to the caller to set the bytes corresponding to the string
   * buffer by calling the Data method to fetch the raw data pointer.  Care
   * must be taken to properly null terminate the character array.  The
   * storage size can be greater than the length of the actual string
   * (i.e., it is not required that the null terminator appear in the last
   * storage unit of the string buffer's data).
   *
   * @return new string buffer or null if out of memory.
   */
  static already_AddRefed<nsStringBuffer> Alloc(size_t aStorageSize);

  /**
   * Resizes the given string buffer to the specified storage size.  This
   * method must not be called on a readonly string buffer.  Use this API
   * carefully!!
   *
   * This method behaves like the ANSI-C realloc function.  (i.e., If the
   * allocation fails, null will be returned and the given string buffer
   * will remain unmodified.)
   *
   * @see IsReadonly
   */
  static nsStringBuffer* Realloc(nsStringBuffer* aBuf, size_t aStorageSize);

  /**
   * Increment the reference count on this string buffer.
   */
  void NS_FASTCALL AddRef();

  /**
   * Decrement the reference count on this string buffer.  The string
   * buffer will be destroyed when its reference count reaches zero.
   */
  void NS_FASTCALL Release();

  /**
   * This method returns the string buffer corresponding to the given data
   * pointer.  The data pointer must have been returned previously by a
   * call to the nsStringBuffer::Data method.
   */
  static nsStringBuffer* FromData(void* aData)
  {
    return reinterpret_cast<nsStringBuffer*>(aData) - 1;
  }

  /**
   * This method returns the data pointer for this string buffer.
   */
  void* Data() const
  {
    return const_cast<char*>(reinterpret_cast<const char*>(this + 1));
  }

  /**
   * This function returns the storage size of a string buffer in bytes.
   * This value is the same value that was originally passed to Alloc (or
   * Realloc).
   */
  uint32_t StorageSize() const
  {
    return mStorageSize;
  }

  /**
   * If this method returns false, then the caller can be sure that their
   * reference to the string buffer is the only reference to the string
   * buffer, and therefore it has exclusive access to the string buffer and
   * associated data.  However, if this function returns true, then other
   * consumers may rely on the data in this buffer being immutable and
   * other threads may access this buffer simultaneously.
   */
  

  /**
   * The FromString methods return a string buffer for the given string
   * object or null if the string object does not have a string buffer.
   * The reference count of the string buffer is NOT incremented by these
   * methods.  If the caller wishes to hold onto the returned value, then
   * the returned string buffer must have its reference count incremented
   * via a call to the AddRef method.
   */
  static nsStringBuffer* FromString(const nsAString& aStr);
  ;

  /**
   * The ToString methods assign this string buffer to a given string
   * object.  If the string object does not support sharable string
   * buffers, then its value will be set to a copy of the given string
   * buffer.  Otherwise, these methods increment the reference count of the
   * given string buffer.  It is important to specify the length (in
   * storage units) of the string contained in the string buffer since the
   * length of the string may be less than its storage size.  The string
   * must have a null terminator at the offset specified by |len|.
   *
   * NOTE: storage size is measured in bytes even for wide strings;
   *       however, string length is always measured in storage units
   *       (2-byte units for wide strings).
   */
  void ToString(uint32_t aLen, nsAString& aStr, bool aMoveOwnership = false);
  ;

  /**
   * This measures the size.  It should only be used if the StringBuffer is
   * unshared.  This is checked.
   */
  ;
};

#endif /* !defined(nsStringBuffer_h__ */
# 167 "../../dist/include/nsStringBuffer.h"
# 20 "../../dist/include/nsIAtom.h" 2

/* starting interface:    nsIAtom */
#define NS_IATOM_IID_STR "1f341018-521a-49de-b806-1bef5c9a00b0"

#define NS_IATOM_IID \
  {0x1f341018, 0x521a, 0x49de, \
    { 0xb8, 0x06, 0x1b, 0xef, 0x5c, 0x9a, 0x00, 0xb0 }}

class nsIAtom : public nsISupports {
 public: 


   // note this is NOT virtual so this won't muck with the vtable!
  
  
  inline const uint32_t GetLength() const {
    return mLength;
  }
  
  inline nsStringBuffer* GetStringBuffer() const {
    return nsStringBuffer::FromData(mString);
  }
  /**
   * A hashcode that is better distributed than the actual atom
   * pointer, for use in situations that need a well-distributed
   * hashcode.
   */
  
protected:
  uint32_t mLength;
  uint32_t mHash;
  char16_t* mString;
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIAtom, NS_IATOM_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIATOM \
  NS_IMETHOD ScriptableToString(nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD ToUTF8String(nsACString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD ScriptableEquals(const nsAString & aString, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) EqualsUTF8(const nsACString & aString) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) IsStaticAtom(void) MOZ_OVERRIDE; \

#if 0
/* End of implementation class template. */
#endif
# 168 "../../dist/include/nsIAtom.h"

/*
 * The three forms of NS_NewAtom and do_GetAtom (for use with
 * |nsCOMPtr<nsIAtom>|) return the atom for the string given.  At any
 * given time there will always be one atom representing a given string.
 * Atoms are intended to make string comparison cheaper by simplifying
 * it to pointer equality.  A pointer to the atom that does not own a
 * reference is not guaranteed to be valid.
 *
 * The three forms of NS_NewPermanentAtom and do_GetPermanentAtom return
 * the atom for the given string and ensure that the atom is permanent.

/**
 * Find an atom that matches the given UTF-16 string.
 * The string is assumed to be zero terminated.  Never returns null.
 */
;

/**
 * Find an atom that matches the given UTF-16 string.  Never returns null.
 */
extern already_AddRefed<nsIAtom> NS_NewAtom(const nsAString& aUTF16String);
;
inline already_AddRefed<nsIAtom> do_GetAtom(const nsAString& aUTF16String)
    { return NS_NewAtom(aUTF16String); }
/**
 * Return a count of the total number of atoms currently
 * alive in the system.
 */
;
/**
 * Return a pointer for a static atom for the string or null if there's 
 * no static atom for this string.
 */
;
/**
 * Seal the static atom table
 */
;
class nsAtomString : public nsString
{
public:
  
};
class nsAtomCString : public nsCString
{
public:
  
};
class nsDependentAtomString : public nsDependentString
{
public:
  
};

#endif /* __gen_nsIAtom_h__ */
# 252 "../../dist/include/nsIAtom.h"
# 17 "/Users/luser/build/mozilla-central/dom/base/nsAttrName.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsDOMString.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsDOMString.h" 1
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsDOMString_h___
#define nsDOMString_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsDOMString.h"



inline void SetDOMStringToNull(nsAString& aString)
{
  aString.SetIsVoid(true);
}

#endif /* nsDOMString_h___ */
# 22 "/Users/luser/build/mozilla-central/dom/base/nsDOMString.h"
# 18 "/Users/luser/build/mozilla-central/dom/base/nsAttrName.h" 2

#define NS_ATTRNAME_NODEINFO_BIT 1
class nsAttrName
{
public:
  

  explicit nsAttrName(nsIAtom* aAtom)
    : mBits(reinterpret_cast<uintptr_t>(aAtom))
  {
    NS_ASSERTION(aAtom, "null atom-name in nsAttrName");
    NS_ADDREF(aAtom);
  }

  

  ~nsAttrName()
  {
    ReleaseInternalName();
  }

  

  

  bool IsAtom() const
  {
    return !(mBits & NS_ATTRNAME_NODEINFO_BIT);
  }

  mozilla::dom::NodeInfo* NodeInfo() const
  {
    NS_ASSERTION(!IsAtom(), "getting nodeinfo-value of atom-name");
    return reinterpret_cast<mozilla::dom::NodeInfo*>(mBits & ~NS_ATTRNAME_NODEINFO_BIT);
  }

  nsIAtom* Atom() const
  {
    NS_ASSERTION(IsAtom(), "getting atom-value of nodeinfo-name");
    return reinterpret_cast<nsIAtom*>(mBits);
  }

  

  // Faster comparison in the case we know the namespace is null
  

  // And the same but without forcing callers to atomize
  

  

  

  

  

  

  

  

  

#ifdef MOZILLA_INTERNAL_API
  void GetPrefix(nsAString& aStr) const
  {
    if (IsAtom()) {
      SetDOMStringToNull(aStr);
    }
    else {
      NodeInfo()->GetPrefix(aStr);
    }
  }
#endif
# 176 "/Users/luser/build/mozilla-central/dom/base/nsAttrName.h"

  

  

private:

  

  void ReleaseInternalName()
  {
    if (IsAtom()) {
      Atom()->Release();
    } else {
      NodeInfo()->Release();
    }
  }

  uintptr_t mBits;
};

#endif
# 214 "/Users/luser/build/mozilla-central/dom/base/nsAttrName.h"
# 19 "/Users/luser/build/mozilla-central/dom/base/nsAttrAndChildArray.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAttrValue.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * A struct that represents the value (type and actual data) of an
 * attribute.
 */

#ifndef nsAttrValue_h___
#define nsAttrValue_h___
# 1 "../../dist/include/nsColor.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsColor_h___
#define nsColor_h___

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>                     // for size_t
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#if !defined(_SIZE_T) || __has_feature(modules)
/* Always define size_t when modules are available. */
#if !__has_feature(modules)
typedef __WCHAR_TYPE__ wchar_t;
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 68 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#undef NULL
#ifdef __cplusplus
#  if !defined(__MINGW32__) && !defined(_MSC_VER)
#    define NULL __null
#  else
# 74 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#    define NULL 0
#  endif
# 76 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#else
# 77 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#  define NULL ((void*)0)
#endif
# 79 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#ifdef __cplusplus
#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
namespace std { typedef decltype(nullptr) nullptr_t; }
using ::std::nullptr_t;
#endif
# 85 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#define offsetof(t, d) __builtin_offsetof(t, d)

#endif /* __STDDEF_H */
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
__WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
#if defined(__need_wint_t)
/* Always define wint_t when modules are available. */
#if !defined(_WINT_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 10 "../../dist/include/nsColor.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>                     // for uint8_t, uint32_t
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsColor.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxCore.h"                    // for NS_GFX_
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxCore.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef gfxCore_h__
#define gfxCore_h__

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxCore.h"

#define NS_GFX
#define NS_GFX_(type) type
#define NS_GFX_STATIC_MEMBER_(type) type

#endif
# 16 "../../dist/include/gfxCore.h"
# 12 "../../dist/include/nsColor.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"                     // for nsAString
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsColor.h"

class nsAString;
class nsString;
class nsCString;

// A color is a 32 bit unsigned integer with four components: R, G, B
// and A.
typedef uint32_t nscolor;

// Make a color out of r,g,b values. This assumes that the r,g,b values are
// properly constrained to 0-255. This also assumes that a is 255.
#define NS_RGB(_r,_g,_b) \
  ((nscolor) ((255 << 24) | ((_b)<<16) | ((_g)<<8) | (_r)))

// Make a color out of r,g,b,a values. This assumes that the r,g,b,a
// values are properly constrained to 0-255.
#define NS_RGBA(_r,_g,_b,_a) \
  ((nscolor) (((_a) << 24) | ((_b)<<16) | ((_g)<<8) | (_r)))

// Make a color out of a gfxRGBA.
#define NS_RGBA_FROM_GFXRGBA(gfxColor) \
  ((nscolor) (gfxColor.Packed()))

// Extract color components from nscolor
#define NS_GET_R(_rgba) ((uint8_t) ((_rgba) & 0xff))
#define NS_GET_G(_rgba) ((uint8_t) (((_rgba) >> 8) & 0xff))
#define NS_GET_B(_rgba) ((uint8_t) (((_rgba) >> 16) & 0xff))
#define NS_GET_A(_rgba) ((uint8_t) (((_rgba) >> 24) & 0xff))

// Fast approximate division by 255. It has the property that
// for all 0 <= n <= 255*255, FAST_DIVIDE_BY_255(n) == n/255.
// But it only uses two adds and two shifts instead of an 
// integer division (which is expensive on many processors).
//
// equivalent to target=v/255
#define FAST_DIVIDE_BY_255(target,v)               \
  PR_BEGIN_MACRO                                   \
    unsigned tmp_ = v;                             \
    target = ((tmp_ << 8) + tmp_ + 255) >> 16;     \
  PR_END_MACRO

// names for the given color, the first one in nsColorNameList.h
// (which is generally the first one in alphabetical order) will be
// returned.
NS_GFX_(const char*) NS_RGBToColorName(nscolor aColor);

#endif /* nsColor_h___ */
# 91 "../../dist/include/nsColor.h"
# 18 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCaseTreatment.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsCaseTreatment.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsCaseTreatment_h___
#define nsCaseTreatment_h___

/**
 * This is the enum used by functions that need to be told whether to
 * do case-sensitive or case-insensitive string comparisons.
 */
enum nsCaseTreatment {
  eCaseMatters,
  eIgnoreCase
};

#endif /* nsCaseTreatment_h___ */
# 18 "/Users/luser/build/mozilla-central/dom/base/nsCaseTreatment.h"
# 19 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsMargin.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsMargin.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSMARGIN_H
#define NSMARGIN_H

#if 0 /* expanded by -frewrite-includes */
#include "nsCoord.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCoord.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSCOORD_H
#define NSCOORD_H

#if 0 /* expanded by -frewrite-includes */
#include "nsAlgorithm.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsCoord.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsCoord.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsMathUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsMathUtils.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsMathUtils_h__
#define nsMathUtils_h__

#define _USE_MATH_DEFINES /* needed for M_ constants on Win32 */

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsMathUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include <cmath>
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsMathUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include <float.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/float.h" 1 3 4
/*===---- float.h - Characteristics of floating point types ----------------===
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 */

#ifndef __FLOAT_H
#define __FLOAT_H

/* If we're on MinGW, fall back to the system's float.h, which might have
 * additional definitions provided for Windows.
 * For more details see http://msdn.microsoft.com/en-us/library/y0ybw9fy.aspx
 */
#if (defined(__MINGW32__) || defined(_MSC_VER)) && \
    defined(__has_include_next) && (1)/*__has_include_next(<float.h>)*/
#if 0 /* expanded by -frewrite-includes */
#  include_next <float.h>
#endif /* expanded by -frewrite-includes */
#  undef FLT_MIN
#  undef DBL_MIN
#  undef LDBL_MIN
#  if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
#    undef FLT_TRUE_MIN
#    undef DBL_TRUE_MIN
#    undef LDBL_TRUE_MIN
#  endif
# 72 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/float.h" 3 4
#endif
# 73 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/float.h" 3 4

/* Characteristics of floating point types, C99 5.2.4.2.2 */

#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
#define FLT_ROUNDS (__builtin_flt_rounds())
#define FLT_RADIX __FLT_RADIX__

#define FLT_MANT_DIG __FLT_MANT_DIG__
#define DBL_MANT_DIG __DBL_MANT_DIG__
#define LDBL_MANT_DIG __LDBL_MANT_DIG__

#define DECIMAL_DIG __DECIMAL_DIG__

#define FLT_DIG __FLT_DIG__
#define DBL_DIG __DBL_DIG__
#define LDBL_DIG __LDBL_DIG__

#define FLT_MIN_EXP __FLT_MIN_EXP__
#define DBL_MIN_EXP __DBL_MIN_EXP__
#define LDBL_MIN_EXP __LDBL_MIN_EXP__

#endif /* __FLOAT_H */
# 125 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/float.h" 3 4

/* NS_roundup30 rounds towards infinity for positive and       */
/* negative numbers.                                           */

#if defined(XP_WIN32) && defined(_M_IX86) && !defined(__GNUC__) && !defined(__clang__)
inline int32_t NS_lroundup30(float x)
{
  /* Code derived from Laurent de Soras' paper at             */
  /* http://ldesoras.free.fr/doc/articles/rounding_en.pdf     */

  /* Rounding up on Windows is expensive using the float to   */
  /* int conversion and the floor function. A faster          */
  /* approach is to use f87 rounding while assuming the       */
  /* default rounding mode of rounding to the nearest         */
  /* integer. This rounding mode, however, actually rounds    */
  /* to the nearest integer so we add the floating point      */
  }
  return i >> 1;                /* divide by 2 */
}
#endif /* XP_WIN32 && _M_IX86 && !__GNUC__ */
# 73 "../../dist/include/nsMathUtils.h"

inline int32_t
NS_lroundf(float aNum)
{
  return aNum >= 0.0f ? int32_t(aNum + 0.5f) : int32_t(aNum - 0.5f);
}
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsCoord.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsCoord.h"
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsCoord.h"

/*
 * Basic type used for the geometry classes.
 *
 * Normally all coordinates are maintained in an app unit coordinate
 * space. An app unit is 1/60th of a CSS device pixel, which is, in turn
 * an integer number of device pixels, such at the CSS DPI is as close to
 * 96dpi as possible.
 */

// This controls whether we're using integers or floats for coordinates. We
// want to eventually use floats.
//#define NS_COORD_IS_FLOAT




#ifdef NS_COORD_IS_FLOAT
typedef float nscoord;
#define nscoord_MAX NS_IEEEPositiveInfinity()
#else
# 47 "../../dist/include/nsCoord.h"
typedef int32_t nscoord;
#define nscoord_MAX nscoord(1 << 30)
#endif
# 50 "../../dist/include/nsCoord.h"

#define nscoord_MIN (-nscoord_MAX)

inline void VERIFY_COORD(nscoord aCoord) {
#ifdef NS_COORD_IS_FLOAT
  NS_ASSERTION(floorf(aCoord) == aCoord,
               "Coords cannot have fractions");
#endif
# 58 "../../dist/include/nsCoord.h"
}



inline nscoord NSToCoordRound(float aValue)
{
#if defined(XP_WIN32) && defined(_M_IX86) && !defined(__GNUC__) && !defined(__clang__)
  return NS_lroundup30(aValue);
#else
# 73 "../../dist/include/nsCoord.h"
  return nscoord(floorf(aValue + 0.5f));
#endif /* XP_WIN32 && _M_IX86 && !__GNUC__ */
# 75 "../../dist/include/nsCoord.h"
}

inline nscoord NSToCoordRound(double aValue)
{
#if defined(XP_WIN32) && defined(_M_IX86) && !defined(__GNUC__) && !defined(__clang__)
  return NS_lroundup30((float)aValue);
#else
# 82 "../../dist/include/nsCoord.h"
  return nscoord(floor(aValue + 0.5f));
#endif /* XP_WIN32 && _M_IX86 && !__GNUC__ */
}

/**
 * Returns aCoord * aScale, capping the product to nscoord_MAX or nscoord_MIN as
 * appropriate for the signs of aCoord and aScale.  If requireNotNegative is
 * true, this method will enforce that aScale is not negative; use that
 * parametrization to get a check of that fact in debug builds.
 */


/**
 * Returns aCoord * aScale, capping the product to nscoord_MAX or nscoord_MIN as
 * appropriate for the sign of aCoord.  This method requires aScale to not be
 * negative; use this method when you know that aScale should never be
 * negative to get a sanity check of that invariant in debug builds.
 */


/**
 * Returns aCoord * aScale, capping the product to nscoord_MAX or nscoord_MIN as
 * appropriate for the signs of aCoord and aScale.
 */


/**
 * Returns a + b, capping the sum to nscoord_MAX.
 *
 * This function assumes that neither argument is nscoord_MIN.
 *
 * Note: If/when we start using floats for nscoords, this function won't be as
 * necessary.  Normal float addition correctly handles adding with infinity,
 * assuming we aren't adding nscoord_MIN. (-infinity)
 * and (b), though.  (Under normal float math, those cases would return NaN
 * and -infinity, respectively.)
 */


inline float NSCoordToFloat(nscoord aCoord) {
  VERIFY_COORD(aCoord);
#ifdef NS_COORD_IS_FLOAT
  NS_ASSERTION(!NS_IEEEIsNan(aCoord), "NaN encountered in float conversion");
#endif
# 225 "../../dist/include/nsCoord.h"
  return (float)aCoord;
}

/*
 * Coord Rounding Functions
 * Int Rounding Functions
 */
inline int32_t NSToIntFloor(float aValue)
{
  return int32_t(floorf(aValue));
}

inline int32_t NSToIntCeil(float aValue)
{
  return int32_t(ceilf(aValue));
}

inline int32_t NSToIntRound(float aValue)
{
  return NS_lroundf(aValue);
}



inline int32_t NSToIntRoundUp(double aValue)
{
  return int32_t(floor(aValue + 0.5));
}

/* 
 * App Unit/Pixel conversions
 */


inline nscoord NSIntPixelsToAppUnits(int32_t aPixels, int32_t aAppUnitsPerPixel)
{
  // The cast to nscoord makes sure we don't overflow if we ever change
  // nscoord to float
  nscoord r = aPixels * (nscoord)aAppUnitsPerPixel;
  VERIFY_COORD(r);
  return r;
}

inline float NSAppUnitsToFloatPixels(nscoord aAppUnits, float aAppUnitsPerPixel)
{
  return (float(aAppUnits) / aAppUnitsPerPixel);
}

inline double NSAppUnitsToDoublePixels(nscoord aAppUnits, double aAppUnitsPerPixel)
{
  return (double(aAppUnits) / aAppUnitsPerPixel);
}

inline int32_t NSAppUnitsToIntPixels(nscoord aAppUnits, float aAppUnitsPerPixel)
{
  return NSToIntRound(float(aAppUnits) / aAppUnitsPerPixel);
}

inline float NSCoordScale(nscoord aCoord, int32_t aFromAPP, int32_t aToAPP)
{
  return (NSCoordToFloat(aCoord) * aToAPP) / aFromAPP;
}

/// handy constants
#define TWIPS_PER_POINT_INT           20
#define TWIPS_PER_POINT_FLOAT         20.0f
#define POINTS_PER_INCH_INT           72
#define POINTS_PER_INCH_FLOAT         72.0f
#define CM_PER_INCH_FLOAT             2.54f
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsPoint.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSPOINT_H
#define NSPOINT_H

#if 0 /* expanded by -frewrite-includes */
#include "nsCoord.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/BaseSize.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/BasePoint.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsSize.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSSIZE_H
#define NS_MAXSIZE nscoord_MAX

struct nsIntSize;
typedef nsIntSize gfxIntSize;

struct nsSize : public mozilla::gfx::BaseSize<nscoord, nsSize> {
  typedef mozilla::gfx::BaseSize<nscoord, nsSize> Super;

  nsSize() : Super() {}
  nsSize(nscoord aWidth, nscoord aHeight) : Super(aWidth, aHeight) {}

  ;
  ;

  // Converts this size from aFromAPP, an appunits per pixel ratio, to aToAPP.
  ;
};

struct nsIntSize : public mozilla::gfx::BaseSize<int32_t, nsIntSize> {
  typedef mozilla::gfx::BaseSize<int32_t, nsIntSize> Super;

  nsIntSize() : Super() {}
  nsIntSize(int32_t aWidth, int32_t aHeight) : Super(aWidth, aHeight) {}

  ;
  ;
};









#endif /* NSSIZE_H */
# 80 "../../dist/include/nsSize.h"
# 13 "../../dist/include/nsPoint.h" 2

struct nsIntPoint;

// nsPoint represents a point in app units.

struct nsPoint : public mozilla::gfx::BasePoint<nscoord, nsPoint> {
  typedef mozilla::gfx::BasePoint<nscoord, nsPoint> Super;

  nsPoint() : Super() {}
  nsPoint(const nsPoint& aPoint) : Super(aPoint) {}
  nsPoint(nscoord aX, nscoord aY) : Super(aX, aY) {}

  ;
  ;

  // Converts this point from aFromAPP, an appunits per pixel ratio, to aToAPP.
  ;
};

// nsIntPoint represents a point in one of the types of pixels.
// Uses of nsIntPoint should eventually be converted to CSSIntPoint,
// LayoutDeviceIntPoint, etc. (see layout/base/Units.h).

struct nsIntPoint : public mozilla::gfx::BasePoint<int32_t, nsIntPoint> {
  typedef mozilla::gfx::BasePoint<int32_t, nsIntPoint> Super;

  nsIntPoint() : Super() {}
  nsIntPoint(const nsIntPoint& aPoint) : Super(aPoint) {}
  nsIntPoint(int32_t aX, int32_t aY) : Super(aX, aY) {}

  ;
};







// app units are integer multiples of pixels, so no rounding needed


#endif /* NSPOINT_H */
# 83 "../../dist/include/nsPoint.h"
# 11 "../../dist/include/nsMargin.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "gfxCore.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsMargin.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/BaseMargin.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsMargin.h"

struct nsMargin : public mozilla::gfx::BaseMargin<nscoord, nsMargin> {
  typedef mozilla::gfx::BaseMargin<nscoord, nsMargin> Super;

  // Constructors
  nsMargin() : Super() {}
  nsMargin(const nsMargin& aMargin) : Super(aMargin) {}
  nsMargin(nscoord aTop, nscoord aRight, nscoord aBottom, nscoord aLeft)
    : Super(aTop, aRight, aBottom, aLeft) {}
};

struct nsIntMargin : public mozilla::gfx::BaseMargin<int32_t, nsIntMargin> {
  typedef mozilla::gfx::BaseMargin<int32_t, nsIntMargin> Super;

  // Constructors
  
  
  
};

#endif /* NSMARGIN_H */
# 35 "../../dist/include/nsMargin.h"
# 20 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h"
#if 0 /* expanded by -frewrite-includes */
#include "SVGAttrValueWrapper.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/svg/SVGAttrValueWrapper.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_SVGATTRVALUEWRAPPER_H__
#define MOZILLA_SVGATTRVALUEWRAPPER_H__

/**
 * Utility wrapper for handling SVG types used inside nsAttrValue so that these
 * types don't need to be exported outside the SVG module.
 */

#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/svg/SVGAttrValueWrapper.h"

class nsSVGAngle;
class nsSVGIntegerPair;
class nsSVGLength2;
class nsSVGNumberPair;
class nsSVGViewBox;

namespace mozilla {
class SVGLengthList;
class SVGNumberList;
class SVGPathData;
class SVGPointList;
class SVGAnimatedPreserveAspectRatio;
class SVGStringList;
class SVGTransformList;
}

namespace mozilla {

class SVGAttrValueWrapper
{
public:
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  static void ToString(const mozilla::SVGPointList* aPointList,
                       nsAString& aResult);
  static void ToString(
    const mozilla::SVGAnimatedPreserveAspectRatio* aPreserveAspectRatio,
    nsAString& aResult);
  static void ToString(const mozilla::SVGStringList* aStringList,
                       nsAString& aResult);
  static void ToString(const mozilla::SVGTransformList* aTransformList,
                       nsAString& aResult);
  static void ToString(const nsSVGViewBox* aViewBox, nsAString& aResult);
};

} /* namespace mozilla */

#endif // MOZILLA_SVGATTRVALUEWRAPPER_H__
# 64 "/Users/luser/build/mozilla-central/dom/svg/SVGAttrValueWrapper.h"
# 22 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTArrayForwardDeclare.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIAtom.h"
#endif /* expanded by -frewrite-includes */
# 24 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 25 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/BindingDeclarations.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* vim: set ts=2 sw=2 et tw=79: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * A header for declaring various things that binding implementation headers
 * might need.  The idea is to make binding implementation headers safe to
 * include anywhere without running into include hell like we do with
 * BindingUtils.h
 */
#ifndef mozilla_dom_BindingDeclarations_h__
#define mozilla_dom_BindingDeclarations_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/BindingDeclarations.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/mozilla/dom/BindingDeclarations.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h" // for nsRefPtr member variables
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/mozilla/dom/BindingDeclarations.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/DOMString.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_DOMString_h
#define mozilla_dom_DOMString_h

#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/DOMString.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringBuffer.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/DOMString.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/DOMString.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/DOMString.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Maybe.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/DOMString.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDOMString.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/DOMString.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIAtom.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/DOMString.h"

namespace mozilla {
namespace dom {

/**
 * A class for representing string return values.  This can be either passed to
 * callees that have an nsString or nsAString out param or passed to a callee
 * that actually knows about this class and can work with it.  Such a callee may
 * call SetStringBuffer or SetOwnedString or SetOwnedAtom on this object, but
 * only if it plans to keep holding a strong ref to the internal stringbuffer!
 *
 * The proper way to store a value in this class is to either to do nothing
 * (which leaves this as an empty string), to call SetStringBuffer with a
 * non-null stringbuffer, to call SetOwnedString, to call SetOwnedAtom, to call
 * SetNull(), or to call AsAString() and set the value in the resulting
 * nsString.  These options are mutually exclusive! Don't do more than one of
 * them.
 *
 * The proper way to extract a value is to check IsNull().  If not null, then
 * check HasStringBuffer().  If that's true, check for a zero length, and if the
 * length is nonzero call StringBuffer().  If the length is zero this is the
 * empty string.  If HasStringBuffer() returns false, call AsAString() and get
 * the value from that.
 */
class MOZ_STACK_CLASS DOMString {
public:
  DOMString()
    : mStringBuffer(nullptr)
    , mLength(0)
    , mIsNull(false)
  {}
  ~DOMString()
  {
    MOZ_ASSERT(!mString || !mStringBuffer,
               "Shouldn't have both present!");
  }

  operator nsString&()
  {
    return AsAString();
  }

  // It doesn't make any sense to convert a DOMString to a const nsString or
  // nsAString reference; this class is meant for outparams only.
  operator const nsString&() = delete;
  operator const nsAString&() = delete;

  nsString& AsAString()
  {
    MOZ_ASSERT(!mStringBuffer, "We already have a stringbuffer?");
    MOZ_ASSERT(!mIsNull, "We're already set as null");
    if (!mString) {
      mString.emplace();
    }
    return *mString;
  }

  bool HasStringBuffer() const
  {
    MOZ_ASSERT(!mString || !mStringBuffer,
               "Shouldn't have both present!");
    MOZ_ASSERT(!mIsNull, "Caller should have checked IsNull() first");
    return !mString;
  }

  // Get the stringbuffer.  This can only be called if HasStringBuffer()
  // returned true and StringBufferLength() is nonzero.  If that's true, it will
  // never return null.
  nsStringBuffer* StringBuffer() const
  {
    MOZ_ASSERT(!mIsNull, "Caller should have checked IsNull() first");
    MOZ_ASSERT(HasStringBuffer(),
               "Don't ask for the stringbuffer if we don't have it");
    MOZ_ASSERT(StringBufferLength() != 0, "Why are you asking for this?");
    MOZ_ASSERT(mStringBuffer,
               "If our length is nonzero, we better have a stringbuffer.");
    return mStringBuffer;
  }

  // Get the length of the stringbuffer.  Can only be called if
  // HasStringBuffer().
  uint32_t StringBufferLength() const
  {
    MOZ_ASSERT(HasStringBuffer(), "Don't call this if there is no stringbuffer");
    return mLength;
  }

  void SetStringBuffer(nsStringBuffer* aStringBuffer, uint32_t aLength)
  {
    MOZ_ASSERT(mString.isNothing(), "We already have a string?");
    MOZ_ASSERT(!mIsNull, "We're already set as null");
    MOZ_ASSERT(!mStringBuffer, "Setting stringbuffer twice?");
    MOZ_ASSERT(aStringBuffer, "Why are we getting null?");
    mStringBuffer = aStringBuffer;
    mLength = aLength;
  }

  void SetOwnedString(const nsAString& aString)
  {
    MOZ_ASSERT(mString.isNothing(), "We already have a string?");
    MOZ_ASSERT(!mIsNull, "We're already set as null");
    MOZ_ASSERT(!mStringBuffer, "Setting stringbuffer twice?");
    nsStringBuffer* buf = nsStringBuffer::FromString(aString);
    if (buf) {
      SetStringBuffer(buf, aString.Length());
    } else if (aString.IsVoid()) {
      SetNull();
    } else if (!aString.IsEmpty()) {
      AsAString() = aString;
    }
  }

  enum NullHandling
  {
    eTreatNullAsNull,
    eTreatNullAsEmpty,
    eNullNotExpected
  };

  void SetOwnedAtom(nsIAtom* aAtom, NullHandling aNullHandling)
  {
    MOZ_ASSERT(mString.isNothing(), "We already have a string?");
    MOZ_ASSERT(!mIsNull, "We're already set as null");
    MOZ_ASSERT(!mStringBuffer, "Setting stringbuffer twice?");
    MOZ_ASSERT(aAtom || aNullHandling != eNullNotExpected);
    if (aNullHandling == eNullNotExpected || aAtom) {
      SetStringBuffer(aAtom->GetStringBuffer(), aAtom->GetLength());
    } else if (aNullHandling == eTreatNullAsNull) {
      SetNull();
    }
  }

  void SetNull()
  {
    MOZ_ASSERT(!mStringBuffer, "Should have no stringbuffer if null");
    MOZ_ASSERT(mString.isNothing(), "Should have no string if null");
    mIsNull = true;
  }

  bool IsNull() const
  {
    MOZ_ASSERT(!mStringBuffer || mString.isNothing(),
               "How could we have a stringbuffer and a nonempty string?");
    return mIsNull || (mString && mString->IsVoid());
  }

  void ToString(nsAString& aString)
  {
    if (IsNull()) {
      SetDOMStringToNull(aString);
    } else if (HasStringBuffer()) {
      if (StringBufferLength() == 0) {
        aString.Truncate();
      } else {
        StringBuffer()->ToString(StringBufferLength(), aString);
      }
    } else {
      aString = AsAString();
    }
  }

private:
  // We need to be able to act like a string as needed
  Maybe<nsAutoString> mString;

  // For callees that know we exist, we can be a stringbuffer/length/null-flag
  // triple.
  nsStringBuffer* MOZ_UNSAFE_REF("The ways in which this can be safe are "
                                 "documented above and enforced through "
                                 "assertions") mStringBuffer;
  uint32_t mLength;
  bool mIsNull;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_DOMString_h
# 194 "../../dist/include/mozilla/dom/DOMString.h"
# 24 "../../dist/include/mozilla/dom/BindingDeclarations.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/OwningNonNull.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/OwningNonNull.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* A class for non-null strong pointers to reference-counted objects. */

#ifndef mozilla_dom_OwningNonNull_h
#define mozilla_dom_OwningNonNull_h

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/OwningNonNull.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionNoteChild.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/OwningNonNull.h"

namespace mozilla {
namespace dom {

template<class T>
class OwningNonNull
{
public:
  OwningNonNull()
#ifdef DEBUG
    : mInited(false)
#endif
# 26 "../../dist/include/mozilla/dom/OwningNonNull.h"
  {}

  // This is no worse than get() in terms of const handling.
  operator T&() const
  {
    MOZ_ASSERT(mInited);
    MOZ_ASSERT(mPtr, "OwningNonNull<T> was set to null");
    return *mPtr;
  }

  nsRefPtr<T> mPtr;
#ifdef DEBUG
  bool mInited;
#endif
# 89 "../../dist/include/mozilla/dom/OwningNonNull.h"
};

template <typename T>
inline void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
                            OwningNonNull<T>& aField,
                            const char* aName,
                            uint32_t aFlags = 0)
{
  CycleCollectionNoteChild(aCallback, aField.get(), aName, aFlags);
}

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_OwningNonNull_h
# 105 "../../dist/include/mozilla/dom/OwningNonNull.h"
# 25 "../../dist/include/mozilla/dom/BindingDeclarations.h" 2

class nsWrapperCache;

namespace mozilla {
namespace dom {

// Struct that serves as a base class for all dictionaries.  Particularly useful
// so we can use IsBaseOf to detect dictionary template arguments.
struct DictionaryBase
{
protected:
  ;

  ;

  // Struct used as a way to force a dictionary constructor to not init the
  // dictionary (via constructing from a pointer to this class).  We're putting
  // it here so that all the dictionaries will have access to it, but outside
  // code will not.
  struct FastDictionaryInitializer {
  };

private:
  // aString is expected to actually be an nsAString*.  Should only be
  // called from StringifyToJSON.
  ;
};

// Struct that serves as a base class for all typed arrays and array buffers and
// array buffer views.  Particularly useful so we can use IsBaseOf to detect
// typed array/buffer/view template arguments.
struct AllTypedArraysBase {
};

// Struct that serves as a base class for all owning unions.
// Particularly useful so we can use IsBaseOf to detect owning union
// template arguments.
struct AllOwningUnionBase {
};


struct EnumEntry {
  const char* value;
  size_t length;
};

class MOZ_STACK_CLASS GlobalObject
{
public:
  ;

  JSObject* Get() const
  {
    return mGlobalJSObject;
  }

  ;

  // The context that this returns is not guaranteed to be in the compartment of
  // the object returned from Get(), in fact it's generally in the caller's
  // compartment.
  

  

protected:
  JS::Rooted<JSObject*> mGlobalJSObject;
  JSContext* mCx;
  mutable nsISupports* MOZ_UNSAFE_REF("Valid because GlobalObject is a stack "
                                      "class, and mGlobalObject points to the "
                                      "global, so it won't be destroyed as long "
                                      "as GlobalObject lives on the stack") mGlobalObject;
};

// Class for representing optional arguments.
template<typename T, typename InternalType>
class Optional_base
{
public:
  Optional_base()
  {}

  explicit Optional_base(const T& aValue)
  {
    mImpl.emplace(aValue);
  }

  template<typename T1, typename T2>
  explicit Optional_base(const T1& aValue1, const T2& aValue2)
  {
    mImpl.emplace(aValue1, aValue2);
  }

  bool WasPassed() const
  {
    return mImpl.isSome();
  }

  // Return InternalType here so we can work with it usefully.
  InternalType& Construct()
  {
    mImpl.emplace();
    return *mImpl;
  }

  template <class T1>
  InternalType& Construct(const T1 &t1)
  {
    mImpl.emplace(t1);
    return *mImpl;
  }

  template <class T1, class T2>
  InternalType& Construct(const T1 &t1, const T2 &t2)
  {
    mImpl.emplace(t1, t2);
    return *mImpl;
  }

  void Reset()
  {
    mImpl.reset();
  }

  const T& Value() const
  {
    return *mImpl;
  }

  // Return InternalType here so we can work with it usefully.
  InternalType& Value()
  {
    return *mImpl;
  }

  // And an explicit way to get the InternalType even if we're const.
  const InternalType& InternalValue() const
  {
    return *mImpl;
  }

  // If we ever decide to add conversion operators for optional arrays
  // like the ones Nullable has, we'll need to ensure that Maybe<> has
  // the boolean before the actual data.

private:
  // Forbid copy-construction and assignment
  Optional_base(const Optional_base& other) = delete;
  const Optional_base &operator=(const Optional_base &other) = delete;

protected:
  Maybe<InternalType> mImpl;
};

template<typename T>
class Optional : public Optional_base<T, T>
{
public:
  

  
};

template<typename T>
class Optional<JS::Handle<T> > :
  public Optional_base<JS::Handle<T>, JS::Rooted<T> >
{
public:
  

  

  

  // Override the const Value() to return the right thing so we're not
  // returning references to temporaries.
  

  // And we have to override the non-const one too, since we're
  // shadowing the one on the superclass.
  
};

// A specialization of Optional for JSObject* to make sure that when someone
// calls Construct() on it we will pre-initialized the JSObject* to nullptr so
// it can be traced safely.
template<>
class Optional<JSObject*> : public Optional_base<JSObject*, JSObject*>
{
public:
  

  explicit Optional(JSObject* aValue) :
    Optional_base<JSObject*, JSObject*>(aValue)
  {}

  // Don't allow us to have an uninitialized JSObject*
  JSObject*& Construct()
  {
    // The Android compiler sucks and thinks we're trying to construct
    // a JSObject* from an int if we don't cast here.  :(
    return Optional_base<JSObject*, JSObject*>::Construct(
      static_cast<JSObject*>(nullptr));
  }

  template <class T1>
  JSObject*& Construct(const T1& t1)
  {
    return Optional_base<JSObject*, JSObject*>::Construct(t1);
    return *this->mImpl;
  }
};

// A specialization of Optional for OwningNonNull that lets us get a
// T& from Value()
template<typename T>
class Optional<OwningNonNull<T> > : public Optional_base<T, OwningNonNull<T> >
{
public:
  // We want our Value to actually return a non-const reference, even
  // if we're const.  At least for things that are normally pointer
  // types...
  T& Value() const
  {
    return *this->mImpl->get();
  }

  // And we have to override the non-const one too, since we're
  // shadowing the one on the superclass.
  OwningNonNull<T>& Value()
  {
    return *this->mImpl;
  }
};

// Specialization for strings.
// XXXbz we can't pull in FakeString here, because it depends on internal
// strings.  So we just have to forward-declare it and reimplement its
// ToAStringPtr.

namespace binding_detail {
struct FakeString;
} // namespace binding_detail

template<>
class Optional<nsAString>
{
public:
  Optional() : mPassed(false) {}

  bool WasPassed() const
  {
    return mPassed;
  }

  void operator=(const nsAString* str)
  {
    MOZ_ASSERT(str);
    mStr = str;
    mPassed = true;
  }

  // If this code ever goes away, remove the comment pointing to it in the
  // FakeString class in BindingUtils.h.
  void operator=(const binding_detail::FakeString* str)
  {
    MOZ_ASSERT(str);
    mStr = reinterpret_cast<const nsString*>(str);
    mPassed = true;
  }

  const nsAString& Value() const
  {
    MOZ_ASSERT(WasPassed());
    return *mStr;
  }

private:
  // Forbid copy-construction and assignment
  Optional(const Optional& other) = delete;
  const Optional &operator=(const Optional &other) = delete;

  bool mPassed;
  const nsAString* mStr;
};

template<class T>
class NonNull
{
public:
  NonNull()
#ifdef DEBUG
    : inited(false)
#endif
# 380 "../../dist/include/mozilla/dom/BindingDeclarations.h"
  {}

  // This is no worse than get() in terms of const handling.
  operator T&() const {
    MOZ_ASSERT(inited);
    MOZ_ASSERT(ptr, "NonNull<T> was set to null");
    return *ptr;
  }

  operator T*() const {
    MOZ_ASSERT(inited);
    MOZ_ASSERT(ptr, "NonNull<T> was set to null");
    return ptr;
  }

  void operator=(T* t) {
    ptr = t;
    MOZ_ASSERT(ptr);
#ifdef DEBUG
    inited = true;
#endif
# 401 "../../dist/include/mozilla/dom/BindingDeclarations.h"
  }

  template<typename U>
  void operator=(U* t) {
    ptr = t->ToAStringPtr();
    MOZ_ASSERT(ptr);
#ifdef DEBUG
    inited = true;
#endif
# 410 "../../dist/include/mozilla/dom/BindingDeclarations.h"
  }

  

  

  // Make us work with smart-ptr helpers that expect a get()
  

protected:
  T* ptr;
#ifdef DEBUG
  bool inited;
#endif
# 437 "../../dist/include/mozilla/dom/BindingDeclarations.h"
};

// Class for representing sequences in arguments.  We use a non-auto array
// because that allows us to use sequences of sequences and the like.  This
// needs to be fallible because web content controls the length of the array,
// and can easily try to create very large lengths.
template<typename T>
class Sequence : public FallibleTArray<T>
{
public:
  
};

inline nsWrapperCache*
GetWrapperCache(nsWrapperCache* cache)
{
  return cache;
}

inline nsWrapperCache*
GetWrapperCache(void* p)
{
  return nullptr;
}

// Helper template for smart pointers to resolve ambiguity between
// GetWrappeCache(void*) and GetWrapperCache(const ParentObject&).


struct MOZ_STACK_CLASS ParentObject {
  template<class T>
  ParentObject(T* aObject) :
    mObject(aObject),
    mWrapperCache(GetWrapperCache(aObject)),
    mUseXBLScope(false)
  {}

  

  

  // We don't want to make this an nsCOMPtr because of performance reasons, but
  // it's safe because ParentObject is a stack class.
  nsISupports* const MOZ_NON_OWNING_REF mObject;
  nsWrapperCache* const mWrapperCache;
  bool mUseXBLScope;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_BindingDeclarations_h__
# 504 "../../dist/include/mozilla/dom/BindingDeclarations.h"
# 26 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h" 2

class nsAString;
class nsIDocument;
class nsStyledElementNotElementCSSInlineStyle;
struct MiscContainer;

namespace mozilla {
namespace css {
class StyleRule;
struct URLValue;
struct ImageValue;
}
}

#define NS_ATTRVALUE_MAX_STRINGLENGTH_ATOM 12

#define NS_ATTRVALUE_BASETYPE_MASK (uintptr_t(3))
#define NS_ATTRVALUE_POINTERVALUE_MASK (~NS_ATTRVALUE_BASETYPE_MASK)

#define NS_ATTRVALUE_INTEGERTYPE_BITS 4
#define NS_ATTRVALUE_INTEGERTYPE_MASK (uintptr_t((1 << NS_ATTRVALUE_INTEGERTYPE_BITS) - 1))
#define NS_ATTRVALUE_INTEGERTYPE_MULTIPLIER (1 << NS_ATTRVALUE_INTEGERTYPE_BITS)
#define NS_ATTRVALUE_INTEGERTYPE_MAXVALUE ((1 << (31 - NS_ATTRVALUE_INTEGERTYPE_BITS)) - 1)
#define NS_ATTRVALUE_INTEGERTYPE_MINVALUE (-NS_ATTRVALUE_INTEGERTYPE_MAXVALUE - 1)

#define NS_ATTRVALUE_ENUMTABLEINDEX_BITS (32 - 16 - NS_ATTRVALUE_INTEGERTYPE_BITS)
#define NS_ATTRVALUE_ENUMTABLE_VALUE_NEEDS_TO_UPPER (1 << (NS_ATTRVALUE_ENUMTABLEINDEX_BITS - 1))
#define NS_ATTRVALUE_ENUMTABLEINDEX_MAXVALUE (NS_ATTRVALUE_ENUMTABLE_VALUE_NEEDS_TO_UPPER - 1)
#define NS_ATTRVALUE_ENUMTABLEINDEX_MASK \
};

class nsAttrValue {
  friend struct MiscContainer;
public:
  typedef nsTArray< nsCOMPtr<nsIAtom> > AtomArray;

  // This has to be the same as in ValueBaseType
  enum ValueType {
    eString =       0x00, //   00
                          //   01  this value indicates an 'misc' struct
    eAtom =         0x02, //   10
    eInteger =      0x03, // 0011
    eColor =        0x07, // 0111
    eEnum =         0x0B, // 1011  This should eventually die
    ePercent =      0x0F, // 1111
    // Values below here won't matter, they'll be always stored in the 'misc'
    // struct.
    eCSSStyleRule =            0x10
    ,eURL =                    0x11
    ,eImage =                  0x12
    ,eAtomArray =              0x13
    ,eDoubleValue  =           0x14
    ,eIntMarginValue =         0x15
    ,eSVGAngle =               0x16
    ,eSVGTypesBegin =          eSVGAngle
    ,eSVGIntegerPair =         0x17
    ,eSVGLength =              0x18
    ,eSVGLengthList =          0x19
    ,eSVGNumberList =          0x1A
    ,eSVGNumberPair =          0x1B
    ,eSVGPathData =            0x1C
    ,eSVGPointList =           0x1D
    ,eSVGPreserveAspectRatio = 0x1E
    ,eSVGStringList =          0x1F
    ,eSVGTransformList =       0x20
    ,eSVGViewBox =             0x21
    ,eSVGTypesEnd =            eSVGViewBox
  };

  nsAttrValue();
  ;
  ;
  ;
  ;
  ;
  ~nsAttrValue();

  ;

  ;
  ;

  ValueType Type() const;

  ;

  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;

  /**
   * Sets this object with the string or atom representation of aValue.
   *
   * After calling this method, this object will have type eString unless the
   * type of aValue is eAtom, in which case this object will also have type
   * eAtom.
   */
  void SetToSerialized(const nsAttrValue& aValue);

  void SwapValueWith(nsAttrValue& aOther);

  void ToString(nsAString& aResult) const;
  inline void ToString(mozilla::dom::DOMString& aResult) const;

  /**
   * Returns the value of this object as an atom. If necessary, the value will
   * first be serialised using ToString before converting to an atom.
   */
  already_AddRefed<nsIAtom> GetAsAtom() const;

  // Methods to get value. These methods do not convert so only use them
  // to retrieve the datatype that this nsAttrValue has.
  inline bool IsEmptyString() const;
  ;
  inline nsIAtom* GetAtomValue() const;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  // aIndex >= GetAtomCount().
  ;

  ;
  ;
  // aCaseSensitive == eIgnoreCase means ASCII case-insenstive matching
  bool Equals(const nsAString& aValue, nsCaseTreatment aCaseSensitive) const;
  bool Equals(nsIAtom* aValue, nsCaseTreatment aCaseSensitive) const;

  /**
   * Compares this object with aOther according to their string representation.
   *
   */
  struct EnumTable {
    /** The string the value maps to */
    const char* tag;
    /** The enum value that maps to this string */
    int16_t value;
  };

  /**
   * Parse into an enum value.
   *
   *
   * @param aString       the string to parse
   * @return              whether the value was valid
   */
  ;

  /**
   * Parse a string into a color.  This implements what HTML5 calls the
   * "rules for parsing a legacy color value".
   * @param aDocument the document this nsAttrValue belongs to.
   */
  void LoadImage(nsIDocument* aDocument);

  /**
   * Parse a string into a CSS style rule.
   *
   * @param aString the style attribute value to be parsed.
   * @param aElement the element the attribute is set on.
   */
  bool ParseStyleAttribute(const nsAString& aString,
                           nsStyledElementNotElementCSSInlineStyle* aElement);

  size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

private:
  // These have to be the same as in ValueType
  enum ValueBaseType {
    eStringBase =    eString,    // 00
    eOtherBase =     0x01,       // 01
    eAtomBase =      eAtom,      // 10
    eIntegerBase =   0x03        // 11
  };

  inline ValueBaseType BaseType() const;
  ;

  /**
   * Get the index of an EnumTable in the sEnumTableArray.
   * If the EnumTable is not in the sEnumTableArray, it is added.
   *
   * @param aTable   the EnumTable to get the index of.
   * @return         the index of the EnumTable.
   */
  ;

  ;
  ;
  ;
  ;
  ;
  ;
  ;

  inline void* GetPtr() const;
  ;
  ;

  // Clears the current MiscContainer.  This will return null if there is no
  // existing container.
  ;
  // Like ClearMiscContainer, except allocates a new container if one does not
  // exist already.
  ;
  ;
  ;
  // Given an enum table and a particular entry in that table, return
  // the actual integer value we should store.
  ;  

  static nsTArray<const EnumTable*>* sEnumTableArray;

  uintptr_t mBits;
};
inline void*
nsAttrValue::GetPtr() const
{
  NS_ASSERTION(BaseType() != eIntegerBase,
               "getting pointer from non-pointer");
  return reinterpret_cast<void*>(mBits & NS_ATTRVALUE_POINTERVALUE_MASK);
}

inline bool
nsAttrValue::IsEmptyString() const
{
  return !mBits;
}

inline void
nsAttrValue::ToString(mozilla::dom::DOMString& aResult) const
{
  switch (Type()) {
    case eString:
    {
      nsStringBuffer* str = static_cast<nsStringBuffer*>(GetPtr());
      if (str) {
        aResult.SetStringBuffer(str, str->StorageSize()/sizeof(char16_t) - 1);
      }
      // else aResult is already empty
      return;
    }
    case eAtom:
    {
      nsIAtom *atom = static_cast<nsIAtom*>(GetPtr());
      aResult.SetStringBuffer(atom->GetStringBuffer(), atom->GetLength());
      break;
    }
    default:
    {
      ToString(aResult.AsAString());
    }
  }
}

#endif
# 499 "/Users/luser/build/mozilla-central/dom/base/nsAttrValue.h"
# 20 "/Users/luser/build/mozilla-central/dom/base/nsAttrAndChildArray.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCaseTreatment.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/dom/base/nsAttrAndChildArray.h"

class nsINode;
class nsIContent;
class nsMappedAttributes;
class nsHTMLStyleSheet;
class nsRuleWalker;
class nsMappedAttributeElement;

#define ATTRCHILD_ARRAY_GROWSIZE 8
#define ATTRCHILD_ARRAY_LINEAR_THRESHOLD 32

#define ATTRCHILD_ARRAY_ATTR_SLOTS_BITS 10

#define ATTRCHILD_ARRAY_MAX_ATTR_COUNT \
    ((1 << ATTRCHILD_ARRAY_ATTR_SLOTS_BITS) - 1)

#define ATTRCHILD_ARRAY_MAX_CHILD_COUNT \
    (~uint32_t(0) >> ATTRCHILD_ARRAY_ATTR_SLOTS_BITS)

#define ATTRCHILD_ARRAY_ATTR_SLOTS_COUNT_MASK \
    ((1 << ATTRCHILD_ARRAY_ATTR_SLOTS_BITS) - 1)


#define ATTRSIZE (sizeof(InternalAttr) / sizeof(void*))

class nsAttrAndChildArray
{
public:
  ;
  ;

  uint32_t ChildCount() const
  {
    return mImpl ? (mImpl->mAttrAndChildCount >> ATTRCHILD_ARRAY_ATTR_SLOTS_BITS) : 0;
  }
  
  ;
  ;
  
  ;
  ;
  // Like RemoveChildAt but hands the reference to the child being
  // removed back to the caller instead of just releasing it.
  ;
  ;

  bool HasAttrs() const
  {
    return MappedAttrCount() || (AttrSlotCount() && AttrSlotIsTaken(0));
  }

  ;
  const nsAttrValue* GetAttr(nsIAtom* aLocalName,
                             int32_t aNamespaceID = kNameSpaceID_None) const;
  // As above but using a string attr name and always using
  // kNameSpaceID_None.  This is always case-sensitive.
  const nsAttrValue* GetAttr(const nsAString& aName) const;
  // Get an nsAttrValue by qualified name.  Can optionally do
  // ASCII-case-insensitive name matching.
  ;
  ;
  ;
  ;

  // Remove the attr at position aPos.  The value of the attr is placed in
  // aValue; any value that was already in aValue is destroyed.
  ;

  // Returns attribute name at given position, *not* out-of-bounds safe
  ;

  // Returns attribute name at given position or null if aPos is out-of-bounds
  ;

  ;
  int32_t IndexOfAttr(nsIAtom* aLocalName, int32_t aNamespaceID = kNameSpaceID_None) const;

  ;
  
  ;

  ;

  

  ;
  

private:
  nsAttrAndChildArray(const nsAttrAndChildArray& aOther) = delete;
  nsAttrAndChildArray& operator=(const nsAttrAndChildArray& aOther) = delete;

  ;

  ;
  uint32_t MappedAttrCount() const;

  // Returns a non-null zero-refcount object.
  ;
  ;

  

  uint32_t AttrSlotCount() const
  {
    return mImpl ? mImpl->mAttrAndChildCount & ATTRCHILD_ARRAY_ATTR_SLOTS_COUNT_MASK : 0;
  }

  bool AttrSlotIsTaken(uint32_t aSlot) const
  {
    NS_PRECONDITION(aSlot < AttrSlotCount(), "out-of-bounds");
    return mImpl->mBuffer[aSlot * ATTRSIZE];
  }

  /**
   * Guts of SetMappedAttrStyleSheet for the rare case when we have mapped attrs
   */
  nsresult DoSetMappedAttrStyleSheet(nsHTMLStyleSheet* aSheet);

  struct InternalAttr
  {
    nsAttrName mName;
    nsAttrValue mValue;
  };

  struct Impl {
    uint32_t mAttrAndChildCount;
    uint32_t mBufferSize;
    nsMappedAttributes* mMappedAttrs;
    void* mBuffer[1];
  };

  Impl* mImpl;
};

#endif
# 216 "/Users/luser/build/mozilla-central/dom/base/nsAttrAndChildArray.h"
# 18 "../../dist/include/mozilla/dom/FragmentOrElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_*
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/dom/FragmentOrElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIContent.h"                   // base class
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsIContent.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsIContent_h___
#define nsIContent_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/dom/base/nsIContent.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCaseTreatment.h" // for enum, cannot be forward-declared
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsIContent.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsINode.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsINode.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsINode_h___
#define nsINode_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Likely.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"               // for member, local
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsGkAtoms.h"              // for nsGkAtoms::baseURIProperty
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsGkAtoms.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * This class wraps up the creation (and destruction) of the standard
 * set of atoms used by gklayout; the atoms are created when gklayout
 * is loaded and they are destroyed when gklayout is unloaded.
 */

#ifndef nsGkAtoms_h___
#define nsGkAtoms_h___

class nsIAtom;

class nsGkAtoms {
public:

  ;

  /* Declare all atoms

     The atom names and values are stored in nsGkAtomList.h and
     are brought to you by the magic of C preprocessing

     Add new atoms to nsGkAtomList and all support logic will be auto-generated
   */
#define GK_ATOM(_name, _value) static nsIAtom* _name;
#if 0 /* expanded by -frewrite-includes */
#include "nsGkAtomList.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsGkAtomList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsGkAtoms.h"

/*
  This file contains the list of all atoms used by gklayout;
  see nsGkAtoms for access to the atoms.
*/

/*
  This file is designed to be used as inline input to nsGkAtoms.cpp and nsGkAtoms.h
  *only* through the magic of C preprocessing.

  All entries must be enclosed in the macro GK_ATOM which will have cruel
  and unusual things done to it

  The first argument to GK_ATOM is the C++ name of the atom
  The second argument it GK_ATOM is the string value of the atom
*/

// OUTPUT_CLASS=nsGkAtoms
// MACRO_NAME=GK_ATOM
#ifdef small
#undef small
#endif
# 28 "/Users/luser/build/mozilla-central/dom/base/nsGkAtomList.h"

//---------------------------------------------------------------------------
// Generic atoms
//---------------------------------------------------------------------------

GK_ATOM(_empty, "")
GK_ATOM(moz, "_moz")
GK_ATOM(mozframetype, "mozframetype")
GK_ATOM(mozallowfullscreen, "mozallowfullscreen")
GK_ATOM(moztype, "_moz-type")
GK_ATOM(mozdirty, "_moz_dirty")
GK_ATOM(abbr, "abbr")
GK_ATOM(abort, "abort")
GK_ATOM(above, "above")
GK_ATOM(acceltext, "acceltext")
GK_ATOM(accept, "accept")
GK_ATOM(acceptcharset, "accept-charset")
GK_ATOM(accesskey, "accesskey")
GK_ATOM(acronym, "acronym")
GK_ATOM(action, "action")
GK_ATOM(active, "active")
GK_ATOM(activetitlebarcolor, "activetitlebarcolor")
GK_ATOM(actuate, "actuate")
GK_ATOM(address, "address")
GK_ATOM(after, "after")
GK_ATOM(after_end, "after_end")
GK_ATOM(after_start, "after_start")
GK_ATOM(ancestor, "ancestor")
GK_ATOM(ancestorOrSelf, "ancestor-or-self")
GK_ATOM(anchor, "anchor")
GK_ATOM(_and, "and")
GK_ATOM(anonid, "anonid")
GK_ATOM(any, "any")
GK_ATOM(mozapp, "mozapp")
GK_ATOM(mozwidget, "mozwidget")
GK_ATOM(applet, "applet")
GK_ATOM(applyImports, "apply-imports")
GK_ATOM(applyTemplates, "apply-templates")
GK_ATOM(mozapptype, "mozapptype")
GK_ATOM(apz, "apz")
GK_ATOM(archive, "archive")
GK_ATOM(area, "area")
GK_ATOM(arrow, "arrow")
GK_ATOM(canvas, "canvas")
GK_ATOM(caption, "caption")
GK_ATOM(capture, "capture")
GK_ATOM(caseOrder, "case-order")
GK_ATOM(cdataSectionElements, "cdata-section-elements")
GK_ATOM(ceiling, "ceiling")
GK_ATOM(cell, "cell")
GK_ATOM(cellpadding, "cellpadding")
GK_ATOM(cellspacing, "cellspacing")
GK_ATOM(center, "center")
GK_ATOM(ch, "ch")
GK_ATOM(change, "change")
GK_ATOM(_char, "char")
GK_ATOM(characterData, "characterData")
GK_ATOM(charcode, "charcode")
GK_ATOM(charoff, "charoff")
GK_ATOM(charset, "charset")
GK_ATOM(checkbox, "checkbox")
GK_ATOM(checked, "checked")
GK_ATOM(child, "child")
GK_ATOM(children, "children")
GK_ATOM(childList, "childList")
GK_ATOM(choose, "choose")
GK_ATOM(chromemargin, "chromemargin")
GK_ATOM(chromeOnlyContent, "chromeOnlyContent")
GK_ATOM(exposeToUntrustedContent, "exposeToUntrustedContent")
GK_ATOM(circ, "circ")
GK_ATOM(circle, "circle")
GK_ATOM(cite, "cite")
GK_ATOM(_class, "class")
GK_ATOM(classid, "classid")
GK_ATOM(clear, "clear")
GK_ATOM(constructor, "constructor")
GK_ATOM(consumeoutsideclicks, "consumeoutsideclicks")
GK_ATOM(container, "container")
GK_ATOM(containment, "containment")
GK_ATOM(contains, "contains")
GK_ATOM(content, "content")
GK_ATOM(contenteditable, "contenteditable")
GK_ATOM(headerContentDisposition, "content-disposition")
GK_ATOM(declare, "declare")
GK_ATOM(decrement, "decrement")
GK_ATOM(_default, "default")
GK_ATOM(headerDefaultStyle, "default-style")
GK_ATOM(defaultAction, "defaultAction")
GK_ATOM(defaultchecked, "defaultchecked")
GK_ATOM(defaultLabel, "defaultLabel")
GK_ATOM(defaultselected, "defaultselected")
GK_ATOM(digit, "digit")
GK_ATOM(dir, "dir")
GK_ATOM(dirAutoSetBy, "dirAutoSetBy")
GK_ATOM(directionality, "directionality")
GK_ATOM(disableOutputEscaping, "disable-output-escaping")
GK_ATOM(disabled, "disabled")
GK_ATOM(disablehistory, "disablehistory")
GK_ATOM(display, "display")
GK_ATOM(distinct, "distinct")
GK_ATOM(div, "div")
GK_ATOM(dl, "dl")
GK_ATOM(doctypePublic, "doctype-public")
GK_ATOM(doctypeSystem, "doctype-system")
GK_ATOM(document, "document")
GK_ATOM(download, "download")
GK_ATOM(DOMAttrModified, "DOMAttrModified")
GK_ATOM(DOMCharacterDataModified, "DOMCharacterDataModified")
GK_ATOM(DOMNodeInserted, "DOMNodeInserted")
GK_ATOM(DOMNodeInsertedIntoDocument, "DOMNodeInsertedIntoDocument")
GK_ATOM(DOMNodeRemoved, "DOMNodeRemoved")
GK_ATOM(DOMNodeRemovedFromDocument, "DOMNodeRemovedFromDocument")
GK_ATOM(DOMSubtreeModified, "DOMSubtreeModified")
GK_ATOM(double_, "double")
GK_ATOM(drag, "drag")
GK_ATOM(dragdrop, "dragdrop")
GK_ATOM(dragend, "dragend")
GK_ATOM(dragenter, "dragenter")
GK_ATOM(dragevent, "dragevent")
GK_ATOM(dragexit, "dragexit")
GK_ATOM(draggable, "draggable")
GK_ATOM(draggesture, "draggesture")
GK_ATOM(dragging, "dragging")
GK_ATOM(element, "element")
GK_ATOM(elementAvailable, "element-available")
GK_ATOM(elements, "elements")
GK_ATOM(em, "em")
GK_ATOM(embed, "embed")
GK_ATOM(embossed, "embossed")
GK_ATOM(empty, "empty")
GK_ATOM(encoding, "encoding")
GK_ATOM(enctype, "enctype")
GK_ATOM(end, "end")
GK_ATOM(endEvent, "endEvent")
GK_ATOM(end_after, "end_after")
GK_ATOM(end_before, "end_before")
GK_ATOM(equalsize, "equalsize")
GK_ATOM(error, "error")
GK_ATOM(even, "even")
GK_ATOM(event, "event")
GK_ATOM(events, "events")
GK_ATOM(excludeResultPrefixes, "exclude-result-prefixes")
GK_ATOM(excludes, "excludes")
GK_ATOM(expr, "expr")
GK_ATOM(expectingSystemMessage, "expecting-system-message")
GK_ATOM(extends, "extends")
GK_ATOM(extensionElementPrefixes, "extension-element-prefixes")
GK_ATOM(face, "face")
GK_ATOM(fallback, "fallback")
GK_ATOM(_false, "false")
GK_ATOM(farthest, "farthest")
GK_ATOM(field, "field")
GK_ATOM(fieldset, "fieldset")
GK_ATOM(figcaption, "figcaption")
GK_ATOM(figure, "figure")
GK_ATOM(_for, "for")
GK_ATOM(forEach, "for-each")
GK_ATOM(forceOwnRefreshDriver, "forceOwnRefreshDriver")
GK_ATOM(form, "form")
GK_ATOM(handler, "handler")
GK_ATOM(handlers, "handlers")
GK_ATOM(HARD, "HARD")
GK_ATOM(hasSameNode, "has-same-node")
GK_ATOM(hbox, "hbox")
GK_ATOM(head, "head")
GK_ATOM(header, "header")
GK_ATOM(headers, "headers")
GK_ATOM(height, "height")
GK_ATOM(hgroup, "hgroup")
GK_ATOM(hidden, "hidden")
GK_ATOM(hidechrome, "hidechrome")
GK_ATOM(hidecolumnpicker, "hidecolumnpicker")
GK_ATOM(high, "high")
GK_ATOM(highest, "highest")
GK_ATOM(horizontal, "horizontal")
GK_ATOM(hover, "hover")
GK_ATOM(hr, "hr")
GK_ATOM(href, "href")
GK_ATOM(hreflang, "hreflang")
GK_ATOM(hspace, "hspace")
GK_ATOM(html, "html")
GK_ATOM(httpEquiv, "http-equiv")
GK_ATOM(i, "i")
GK_ATOM(icon, "icon")
GK_ATOM(id, "id")
GK_ATOM(_if, "if")
GK_ATOM(iframe, "iframe")
GK_ATOM(ignorecase, "ignorecase")
GK_ATOM(ignorekeys, "ignorekeys")
GK_ATOM(ignoreuserfocus, "ignoreuserfocus")
GK_ATOM(ilayer, "ilayer")
GK_ATOM(image, "image")
GK_ATOM(imageClickedPoint, "image-clicked-point")
GK_ATOM(img, "img")
GK_ATOM(implementation, "implementation")
GK_ATOM(implements, "implements")
GK_ATOM(import, "import")
GK_ATOM(inactivetitlebarcolor, "inactivetitlebarcolor")
GK_ATOM(include, "include")
GK_ATOM(includes, "includes")
GK_ATOM(increment, "increment")
GK_ATOM(indent, "indent")
GK_ATOM(indeterminate, "indeterminate")
GK_ATOM(intersection, "intersection")
GK_ATOM(is, "is")
GK_ATOM(iscontainer, "iscontainer")
GK_ATOM(isempty, "isempty")
GK_ATOM(ismap, "ismap")
GK_ATOM(itemid, "itemid")
GK_ATOM(itemprop, "itemprop")
GK_ATOM(itemref, "itemref")
GK_ATOM(itemscope, "itemscope")
GK_ATOM(itemtype, "itemtype")
GK_ATOM(kbd, "kbd")
GK_ATOM(keepcurrentinview, "keepcurrentinview")
GK_ATOM(keepobjectsalive, "keepobjectsalive")
GK_ATOM(key, "key")
GK_ATOM(keycode, "keycode")
GK_ATOM(keystatuseschange, "keystatuseschange")
GK_ATOM(keydown, "keydown")
GK_ATOM(keygen, "keygen")
GK_ATOM(keypress, "keypress")
GK_ATOM(keyset, "keyset")
GK_ATOM(keysystem, "keysystem")
GK_ATOM(keytext, "keytext")
GK_ATOM(keyup, "keyup")
GK_ATOM(kind, "kind")
GK_ATOM(label, "label")
GK_ATOM(lang, "lang")
GK_ATOM(language, "language")
GK_ATOM(last, "last")
GK_ATOM(layer, "layer")
GK_ATOM(norolluponanchor, "norolluponanchor")
GK_ATOM(nobr, "nobr")
GK_ATOM(node, "node")
GK_ATOM(null, "null")
GK_ATOM(object, "object")
GK_ATOM(objectType, "object-type")
GK_ATOM(observer, "observer")
GK_ATOM(observes, "observes")
GK_ATOM(odd, "odd")
GK_ATOM(OFF, "OFF")
GK_ATOM(ol, "ol")
GK_ATOM(omitXmlDeclaration, "omit-xml-declaration")
GK_ATOM(ona2dpstatuschanged, "ona2dpstatuschanged")
GK_ATOM(onabort, "onabort")
GK_ATOM(onactivate, "onactivate")
GK_ATOM(onadapteradded, "onadapteradded")
GK_ATOM(onadapterremoved, "onadapterremoved")
GK_ATOM(onafterprint, "onafterprint")
GK_ATOM(onafterscriptexecute, "onafterscriptexecute")
GK_ATOM(querytype, "querytype")
GK_ATOM(radio, "radio")
GK_ATOM(radiogroup, "radiogroup")
GK_ATOM(range, "range")
GK_ATOM(readonly, "readonly")
GK_ATOM(rect, "rect")
GK_ATOM(rectangle, "rectangle")
GK_ATOM(ref, "ref")
GK_ATOM(refresh, "refresh")
GK_ATOM(rel, "rel")
GK_ATOM(onreloadpage, "onreloadpage")
GK_ATOM(rem, "rem")
GK_ATOM(removeelement, "removeelement")
GK_ATOM(renderingobserverlist, "renderingobserverlist")
GK_ATOM(repeat, "repeat")
GK_ATOM(replace, "replace")
GK_ATOM(spacer, "spacer")
GK_ATOM(span, "span")
GK_ATOM(spellcheck, "spellcheck")
GK_ATOM(spinner, "spinner")
GK_ATOM(split, "split")
GK_ATOM(splitmenu, "splitmenu")
GK_ATOM(splitter, "splitter")
GK_ATOM(spring, "spring")
GK_ATOM(src, "src")
GK_ATOM(srcdoc, "srcdoc")
GK_ATOM(srclang, "srclang")
GK_ATOM(srcset, "srcset")
GK_ATOM(stack, "stack")
GK_ATOM(standalone, "standalone")
GK_ATOM(systemProperty, "system-property")
GK_ATOM(tab, "tab")
GK_ATOM(tabbox, "tabbox")
GK_ATOM(tabindex, "tabindex")
GK_ATOM(table, "table")
GK_ATOM(tabpanel, "tabpanel")
GK_ATOM(tabpanels, "tabpanels")
GK_ATOM(tag, "tag")
GK_ATOM(target, "target")
GK_ATOM(targets, "targets")
GK_ATOM(tbody, "tbody")
GK_ATOM(td, "td")
GK_ATOM(_template, "template")
GK_ATOM(text_decoration, "text-decoration")
GK_ATOM(terminate, "terminate")
GK_ATOM(test, "test")
GK_ATOM(text, "text")
GK_ATOM(textAlign, "text-align")
GK_ATOM(textarea, "textarea")
GK_ATOM(textbox, "textbox")
GK_ATOM(textnode, "textnode")
GK_ATOM(textNodeDirectionalityMap, "textNodeDirectionalityMap")
GK_ATOM(tfoot, "tfoot")
GK_ATOM(th, "th")
GK_ATOM(thead, "thead")
GK_ATOM(thumb, "thumb")
GK_ATOM(time, "time")
GK_ATOM(title, "title")
GK_ATOM(titlebar, "titlebar")
GK_ATOM(titletip, "titletip")
GK_ATOM(toggled, "toggled")
GK_ATOM(token, "token")
GK_ATOM(tokenize, "tokenize")
GK_ATOM(toolbar, "toolbar")
GK_ATOM(transparent, "transparent")
GK_ATOM(tree, "tree")
GK_ATOM(treecell, "treecell")
GK_ATOM(treechildren, "treechildren")
GK_ATOM(treecol, "treecol")
GK_ATOM(treecolpicker, "treecolpicker")
GK_ATOM(treecols, "treecols")
GK_ATOM(treeitem, "treeitem")
GK_ATOM(treerow, "treerow")
GK_ATOM(treeseparator, "treeseparator")
GK_ATOM(triple, "triple")
GK_ATOM(_true, "true")
GK_ATOM(tt, "tt")
GK_ATOM(tty, "tty")
GK_ATOM(tv, "tv")
GK_ATOM(type, "type")
GK_ATOM(valign, "valign")
GK_ATOM(value, "value")
GK_ATOM(values, "values")
GK_ATOM(valueOf, "value-of")
GK_ATOM(valuetype, "valuetype")
GK_ATOM(var, "var")
GK_ATOM(variable, "variable")
GK_ATOM(vbox, "vbox")
GK_ATOM(vcard_name, "vcard_name")
GK_ATOM(vendor, "vendor")
GK_ATOM(vendorUrl, "vendor-url")
GK_ATOM(version, "version")
GK_ATOM(vert, "vert")
GK_ATOM(vertical, "vertical")
GK_ATOM(audio, "audio")
GK_ATOM(video, "video")
# 2049 "/Users/luser/build/mozilla-central/dom/base/nsGkAtomList.h"

// Content property names
GK_ATOM(animationsProperty, "AnimationsProperty")        // FrameAnimations*
GK_ATOM(animationsOfBeforeProperty, "AnimationsOfBeforeProperty") // FrameAnimations*
GK_ATOM(animationsOfAfterProperty, "AnimationsOfAfterProperty") // FrameAnimations*
GK_ATOM(transitionsProperty, "TransitionsProperty")        // FrameTransitions*
GK_ATOM(transitionsOfBeforeProperty, "TransitionsOfBeforeProperty") // FrameTransitions*
GK_ATOM(transitionsOfAfterProperty, "TransitionsOfAfterProperty") // FrameTransitions*
GK_ATOM(genConInitializerProperty, "QuoteNodeProperty")
GK_ATOM(labelMouseDownPtProperty, "LabelMouseDownPtProperty")
GK_ATOM(baseURIProperty, "baseURIProperty")
GK_ATOM(lockedStyleStates, "lockedStyleStates")
GK_ATOM(apzCallbackTransform, "apzCallbackTransform")

// Languages for lang-specific transforms
GK_ATOM(x_devanagari, "x-devanagari")
GK_ATOM(x_tamil, "x-tamil")
GK_ATOM(x_armn, "x-armn")
GK_ATOM(x_beng, "x-beng")
GK_ATOM(x_cans, "x-cans")
GK_ATOM(x_ethi, "x-ethi")
GK_ATOM(x_geor, "x-geor")
GK_ATOM(x_gujr, "x-gujr")
GK_ATOM(x_guru, "x-guru")
GK_ATOM(x_khmr, "x-khmr")
GK_ATOM(x_knda, "x-knda")
GK_ATOM(x_mlym, "x-mlym")
GK_ATOM(scrollbars, "scrollbars")
GK_ATOM(other,      "other")

#ifdef ACCESSIBILITY
GK_ATOM(containerBusy, "container-busy")
GK_ATOM(containerLive, "container-live")
GK_ATOM(containerLiveRole, "container-live-role")
GK_ATOM(containerRelevant, "container-relevant")
GK_ATOM(contentinfo, "contentinfo")
GK_ATOM(cycles, "cycles")
GK_ATOM(datatable, "datatable")
GK_ATOM(directory, "directory")
GK_ATOM(eventFromInput, "event-from-input")
GK_ATOM(grammar, "grammar")
GK_ATOM(onresume, "onresume")
GK_ATOM(onmark, "onmark")
GK_ATOM(onboundary, "onboundary")
#endif
# 2339 "/Users/luser/build/mozilla-central/dom/base/nsGkAtomList.h"

GK_ATOM(vr_state, "vr-state")
# 31 "/Users/luser/build/mozilla-central/dom/base/nsGkAtoms.h" 2
#undef GK_ATOM
};

#endif /* nsGkAtoms_h___ */
# 35 "/Users/luser/build/mozilla-central/dom/base/nsGkAtoms.h"
# 12 "/Users/luser/build/mozilla-central/dom/base/nsINode.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMNode.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/NodeInfo.h"            // member (in nsCOMPtr)
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"

#ifndef nsNodeInfoManager_h___
#define nsNodeInfoManager_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"           // for MOZ_FINAL
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/base/nsNodeInfoManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"                     // for member
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/base/nsNodeInfoManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"                    // for nsRefPtr
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/base/nsNodeInfoManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h" // for NS_DECL_CYCLE_*
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/base/nsNodeInfoManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "plhash.h"                       // for typedef PLHashNumber
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/dom/base/nsNodeInfoManager.h"

class nsAString;
class nsBindingManager;
class nsIAtom;
class nsIDocument;
class nsIDOMDocumentType;
class nsIPrincipal;
struct PLHashEntry;
struct PLHashTable;
template<class T> struct already_AddRefed;

namespace mozilla {
namespace dom {
class NodeInfo;
}
}

class nsNodeInfoManager MOZ_FINAL
{
private:
  ~nsNodeInfoManager();

public:
  ;

  /**
   * Returns the nodeinfo for the document node. Can return null if OOM.
   */
  ;

  /**
   * Retrieve a pointer to the document that owns this node info
   * manager.
   */
  

  /**
   * Gets the principal of the document this nodeinfo manager belongs to.
   */
  nsIPrincipal *DocumentPrincipal() const {
    NS_ASSERTION(mPrincipal, "How'd that happen?");
    return mPrincipal;
  }

  ;

  

protected:
  friend class nsDocument;
  friend class nsXULPrototypeDocument;
  ;

  /**
   * Sets the principal of the document this nodeinfo manager belongs to.
   */
  ;

private:
  ;
  ;
  ;

  PLHashTable *mNodeInfoHash;
  nsIDocument *mDocument; // WEAK
  uint32_t mNonDocumentNodeInfos;
  nsCOMPtr<nsIPrincipal> mPrincipal; // Never null after Init() succeeds.
  nsCOMPtr<nsIPrincipal> mDefaultPrincipal; // Never null after Init() succeeds
  mozilla::dom::NodeInfo *mTextNodeInfo; // WEAK to avoid circular ownership
  mozilla::dom::NodeInfo *mCommentNodeInfo; // WEAK to avoid circular ownership
  mozilla::dom::NodeInfo *mDocumentNodeInfo; // WEAK to avoid circular ownership
  nsRefPtr<nsBindingManager> mBindingManager;
};


#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 27 "/Users/luser/build/mozilla-central/dom/base/nsPropertyTable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 28 "/Users/luser/build/mozilla-central/dom/base/nsPropertyTable.h"

class nsIAtom;

typedef void
(*NSPropertyFunc)(void           *aObject,
                  nsIAtom        *aPropertyName,
                  void           *aPropertyValue,
                  void           *aData);

/**
 * Callback type for property destructors.  |aObject| is the object
 * the property is being removed for, |aPropertyName| is the property
 * being removed, |aPropertyValue| is the value of the property, and |aData|
 * is the opaque destructor data that was passed to SetProperty().
 **/
typedef NSPropertyFunc NSPropertyDtorFunc;
class nsINode;
class nsIFrame;

class nsPropertyOwner
{
public:
  

  // These are the types of objects that can own properties. No object should
  // inherit more then one of these classes.
  // To add support for more types just add to this list.
  MOZ_IMPLICIT 
  MOZ_IMPLICIT 

  
  

private:
  const void* mObject;
};

class nsPropertyTable
{
 public:
  /**
   * Get the value of the property |aPropertyName| for node |aObject|.
   * |aResult|, if supplied, is filled in with a return status code.
   **/
  

  /**
   * Set the value of the property |aPropertyName| to
   * |aPropertyValue| for node |aObject|.  |aDtor| is a destructor for the
   * property value to be called if the property is removed.  It can be null
   * if no destructor is required.  |aDtorData| is an optional pointer to an
   * opaque context to be passed to the property destructor.  Note that the
   * destructor is global for each property name regardless of node; it is an

  /**
   * Function useable as destructor function for property data that is
   * XPCOM objects. The function will call NS_IF_RELASE on the value
   * to destroy it.
   */
  ;

  class PropertyList;

  ;
  ;

 private:
  ;
  ;
  ;
  ;

  PropertyList *mPropertyList;
};
#endif
# 201 "/Users/luser/build/mozilla-central/dom/base/nsPropertyTable.h"
# 17 "/Users/luser/build/mozilla-central/dom/base/nsINode.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTObserverArray.h"       // for member
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ErrorResult.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* vim: set ts=2 sw=2 et tw=79: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * A struct for tracking exceptions that need to be thrown to JS.
 */

#ifndef mozilla_ErrorResult_h
#define mozilla_ErrorResult_h

#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h>
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/ErrorResult.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/ErrorResult.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/ErrorResult.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/ErrorResult.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/ErrorResult.h"

namespace mozilla {

namespace dom {

enum ErrNum {
#define MSG_DEF(_name, _argc, _exn, _str) \
  _name,
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Errors.msg"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/Errors.msg" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * be replaced with a string value when the error is reported.
 */

MSG_DEF(MSG_INVALID_ENUM_VALUE, 3, JSEXN_TYPEERR, "{0} '{1}' is not a valid value for enumeration {2}.")
MSG_DEF(MSG_MISSING_ARGUMENTS, 1, JSEXN_TYPEERR, "Not enough arguments to {0}.")
MSG_DEF(MSG_NOT_OBJECT, 1, JSEXN_TYPEERR, "{0} is not an object.")
MSG_DEF(MSG_NOT_CALLABLE, 1, JSEXN_TYPEERR, "{0} is not callable.")
MSG_DEF(MSG_DOES_NOT_IMPLEMENT_INTERFACE, 2, JSEXN_TYPEERR, "{0} does not implement interface {1}.")
MSG_DEF(MSG_METHOD_THIS_DOES_NOT_IMPLEMENT_INTERFACE, 2, JSEXN_TYPEERR, "'{0}' called on an object that does not implement interface {1}.")
MSG_DEF(MSG_METHOD_THIS_UNWRAPPING_DENIED, 1, JSEXN_TYPEERR, "Permission to call '{0}' denied.")
MSG_DEF(MSG_GETTER_THIS_DOES_NOT_IMPLEMENT_INTERFACE, 2, JSEXN_TYPEERR, "'{0}' getter called on an object that does not implement interface {1}.")
MSG_DEF(MSG_GETTER_THIS_UNWRAPPING_DENIED, 1, JSEXN_TYPEERR, "Permission to call '{0}' getter denied.")
MSG_DEF(MSG_SETTER_THIS_DOES_NOT_IMPLEMENT_INTERFACE, 2, JSEXN_TYPEERR, "'{0}' setter called on an object that does not implement interface {1}.")
MSG_DEF(MSG_SETTER_THIS_UNWRAPPING_DENIED, 1, JSEXN_TYPEERR, "Permission to call '{0}' setter denied.")
MSG_DEF(MSG_THIS_DOES_NOT_IMPLEMENT_INTERFACE, 1, JSEXN_TYPEERR, "\"this\" object does not implement interface {0}.")
MSG_DEF(MSG_NOT_IN_UNION, 2, JSEXN_TYPEERR, "{0} could not be converted to any of: {1}.")
MSG_DEF(MSG_ILLEGAL_CONSTRUCTOR, 0, JSEXN_TYPEERR, "Illegal constructor.")
MSG_DEF(MSG_CONSTRUCTOR_WITHOUT_NEW, 1, JSEXN_TYPEERR, "Constructor {0} requires 'new'")
MSG_DEF(MSG_NO_INDEXED_SETTER, 1, JSEXN_TYPEERR, "{0} doesn't have an indexed property setter.")
MSG_DEF(MSG_NO_NAMED_SETTER, 1, JSEXN_TYPEERR, "{0} doesn't have a named property setter.")
MSG_DEF(MSG_ENFORCE_RANGE_NON_FINITE, 1, JSEXN_TYPEERR, "Non-finite value is out of range for {0}.")
MSG_DEF(MSG_ENFORCE_RANGE_OUT_OF_RANGE, 1, JSEXN_TYPEERR, "Value is out of range for {0}.")
MSG_DEF(MSG_NOT_SEQUENCE, 1, JSEXN_TYPEERR, "{0} can't be converted to a sequence.")
MSG_DEF(MSG_NOT_DICTIONARY, 1, JSEXN_TYPEERR, "{0} can't be converted to a dictionary.")
MSG_DEF(MSG_OVERLOAD_RESOLUTION_FAILED, 3, JSEXN_TYPEERR, "Argument {0} is not valid for any of the {1}-argument overloads of {2}.")
MSG_DEF(MSG_GLOBAL_NOT_NATIVE, 0, JSEXN_TYPEERR, "Global is not a native object.")
MSG_DEF(MSG_ENCODING_NOT_SUPPORTED, 1, JSEXN_RANGEERR, "The given encoding '{0}' is not supported.")
MSG_DEF(MSG_DOM_ENCODING_NOT_UTF, 0, JSEXN_RANGEERR, "The encoding must be utf-8, utf-16, or utf-16be.")
  Err_Limit
};

bool
ThrowErrorMessage(JSContext* aCx, const ErrNum aErrorNumber, ...);

} // namespace dom

class ErrorResult {
public:
  ErrorResult() {
    mResult = NS_OK;

#ifdef DEBUG
    // ErrorResult is extremely performance-sensitive code, where literally
    // every machine instruction matters. Initialize mMessage only to suppress
    // a debug-only warning from gcc 4.6.
    mMessage = nullptr;
    mMightHaveUnreportedJSException = false;
#endif
# 50 "../../dist/include/mozilla/ErrorResult.h"
  }

#ifdef DEBUG
  ~ErrorResult() {
    MOZ_ASSERT_IF(IsErrorWithMessage(), !mMessage);
    MOZ_ASSERT(!mMightHaveUnreportedJSException);
  }
#endif
# 58 "../../dist/include/mozilla/ErrorResult.h"

  void Throw(nsresult rv) {
    MOZ_ASSERT(NS_FAILED(rv), "Please don't try throwing success");
    MOZ_ASSERT(rv != NS_ERROR_TYPE_ERR, "Use ThrowTypeError()");
    MOZ_ASSERT(rv != NS_ERROR_RANGE_ERR, "Use ThrowRangeError()");
    MOZ_ASSERT(!IsErrorWithMessage(), "Don't overwrite errors with message");
    MOZ_ASSERT(rv != NS_ERROR_DOM_JS_EXCEPTION, "Use ThrowJSException()");
    MOZ_ASSERT(!IsJSException(), "Don't overwrite JS exceptions");
    MOZ_ASSERT(rv != NS_ERROR_XPC_NOT_ENOUGH_ARGS, "Use ThrowNotEnoughArgsError()");
    MOZ_ASSERT(!IsNotEnoughArgsError(), "Don't overwrite not enough args error");
    mResult = rv;
  }

  ;
  ;
  void ReportErrorWithMessage(JSContext* cx);
  ;
  bool IsErrorWithMessage() const { return ErrorCode() == NS_ERROR_TYPE_ERR || ErrorCode() == NS_ERROR_RANGE_ERR; }

  // Facilities for throwing a preexisting JS exception value via this
  // ErrorResult.  The contract is that any code which might end up calling
  // ThrowJSException() must call MightThrowJSException() even if no exception
  // is being thrown.  Code that would call ReportJSException* or
  // StealJSException as needed must first call WouldReportJSException even if
  // this ErrorResult has not failed.
  //
  // The exn argument to ThrowJSException can be in any compartment.  It does
  // not have to be in the compartment of cx.  If someone later uses it, they
  // will wrap it into whatever compartment they're working in, as needed.
  void ThrowJSException(JSContext* cx, JS::Handle<JS::Value> exn);
  void ReportJSException(JSContext* cx);
  // Used to implement throwing exceptions from the JS implementation of
  // bindings to callers of the binding.
  void ReportJSExceptionFromJSImplementation(JSContext* aCx);
  bool IsJSException() const { return ErrorCode() == NS_ERROR_DOM_JS_EXCEPTION; }

  void ThrowNotEnoughArgsError() { mResult = NS_ERROR_XPC_NOT_ENOUGH_ARGS; }
  void ReportNotEnoughArgsError(JSContext* cx,
                                const char* ifaceName,
                                const char* memberName);
  bool IsNotEnoughArgsError() const { return ErrorCode() == NS_ERROR_XPC_NOT_ENOUGH_ARGS; }

  // Support for uncatchable exceptions.
  void ThrowUncatchableException() {
    Throw(NS_ERROR_UNCATCHABLE_EXCEPTION);
  }
  bool IsUncatchableException() const {
    return ErrorCode() == NS_ERROR_UNCATCHABLE_EXCEPTION;
  }

  // StealJSException steals the JS Exception from the object. This method must
  // be called only if IsJSException() returns true. This method also resets the
  // ErrorCode() to NS_OK.
  void StealJSException(JSContext* cx, JS::MutableHandle<JS::Value> value);
  // In the future, we can add overloads of Throw that take more
  // interesting things, like strings or DOM exception types or
  // something if desired.

  // Backwards-compat to make conversion simpler.  We don't call
  // Throw() here because people can easily pass success codes to
  // this.
  void operator=(nsresult rv) {
    MOZ_ASSERT(rv != NS_ERROR_TYPE_ERR, "Use ThrowTypeError()");
    MOZ_ASSERT(rv != NS_ERROR_RANGE_ERR, "Use ThrowRangeError()");
    MOZ_ASSERT(!IsErrorWithMessage(), "Don't overwrite errors with message");
    MOZ_ASSERT(rv != NS_ERROR_DOM_JS_EXCEPTION, "Use ThrowJSException()");
    MOZ_ASSERT(!IsJSException(), "Don't overwrite JS exceptions");
    MOZ_ASSERT(rv != NS_ERROR_XPC_NOT_ENOUGH_ARGS, "Use ThrowNotEnoughArgsError()");
    MOZ_ASSERT(!IsNotEnoughArgsError(), "Don't overwrite not enough args error");
    mResult = rv;
  }

  bool Failed() const {
    return NS_FAILED(mResult);
  }

  nsresult ErrorCode() const {
    return mResult;
  }

private:
  nsresult mResult;
  struct Message;
  // mMessage is set by ThrowErrorWithMessage and cleared (and deallocated) by
  // ReportErrorWithMessage.
  // mJSException is set (and rooted) by ThrowJSException and unrooted
  // by ReportJSException.
  union {
    Message* mMessage; // valid when IsErrorWithMessage()
    JS::Value mJSException; // valid when IsJSException()
  };

#ifdef DEBUG
  // Used to keep track of codepaths that might throw JS exceptions,
  // for assertion purposes.
  bool mMightHaveUnreportedJSException;
#endif
# 169 "../../dist/include/mozilla/ErrorResult.h"

  // Not to be implemented, to make sure people always pass this by
  // reference, not by value.
  ErrorResult(const ErrorResult&) = delete;
  void ThrowErrorWithMessage(va_list ap, const dom::ErrNum errorNumber,
                             nsresult errorType);
};

/******************************************************************************
 ** Macros for checking results
 ******************************************************************************/

#define ENSURE_SUCCESS(res, ret)                                          \
  do {                                                                    \
    if (res.Failed()) {                                                   \
      nsCString msg;                                                      \
      msg.AppendPrintf("ENSURE_SUCCESS(%s, %s) failed with "              \
                       "result 0x%X", #res, #ret, res.ErrorCode());       \
      NS_WARNING(msg.get());                                              \
      return ret;                                                         \
    }                                                                     \
  } while(0)

#define ENSURE_SUCCESS_VOID(res)                                          \
  do {                                                                    \
    if (res.Failed()) {                                                   \
      nsCString msg;                                                      \
      msg.AppendPrintf("ENSURE_SUCCESS_VOID(%s) failed with "             \
                       "result 0x%X", #res, res.ErrorCode());             \
      NS_WARNING(msg.get());                                              \
      return;                                                             \
    }                                                                     \
  } while(0)

} // namespace mozilla

#endif /* mozilla_ErrorResult_h */
# 206 "../../dist/include/mozilla/ErrorResult.h"
# 19 "/Users/luser/build/mozilla-central/dom/base/nsINode.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/EventTarget.h" // for base class
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/EventTarget.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_EventTarget_h_
#define mozilla_dom_EventTarget_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMEventTarget.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMEventTarget.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMEventTarget.idl
 */

#ifndef __gen_nsIDOMEventTarget_h__
#define __gen_nsIDOMEventTarget_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMEventTarget.h"
#endif
# 12 "../../dist/include/nsIDOMEventTarget.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMEventTarget.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EventForwards.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_EventForwards_h__
#define mozilla_EventForwards_h__

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/EventForwards.h"

/**
 * XXX Following enums should be in BasicEvents.h.  However, currently, it's
 *     impossible to use foward delearation for enum.
 */

/**
 * Return status for event processors.
 */
enum nsEventStatus
{
  // The event is ignored, do default processing
  nsEventStatus_eIgnore,
  // The event is consumed, don't do default processing
  nsEventStatus_eConsumeNoDefault,
  // The event is consumed, but do default processing
  nsEventStatus_eConsumeDoDefault
};

namespace mozilla {

typedef uint8_t EventClassIDType;

enum EventClassID : EventClassIDType
{
  // The event class name will be:
  //   eBasicEventClass for WidgetEvent
  //   eFooEventClass for WidgetFooEvent or InternalFooEvent
#define NS_ROOT_EVENT_CLASS(aPrefix, aName)   eBasic##aName##Class
#define NS_EVENT_CLASS(aPrefix, aName)      , e##aName##Class

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventClassList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EventClassList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
NS_ROOT_EVENT_CLASS(Widget, Event)
NS_EVENT_CLASS(Widget, GUIEvent)
NS_EVENT_CLASS(Widget, InputEvent)
NS_EVENT_CLASS(Internal, UIEvent)

// TextEvents.h
NS_EVENT_CLASS(Widget, KeyboardEvent)
NS_EVENT_CLASS(Widget, CompositionEvent)
NS_EVENT_CLASS(Widget, QueryContentEvent)
NS_EVENT_CLASS(Widget, SelectionEvent)
NS_EVENT_CLASS(Internal, EditorInputEvent)
NS_EVENT_CLASS(Internal, BeforeAfterKeyboardEvent)

// MouseEvents.h
NS_EVENT_CLASS(Widget, MouseEventBase)
NS_EVENT_CLASS(Widget, MouseEvent)
};

typedef uint16_t Modifiers;

#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \
  KEY_NAME_INDEX_##aCPPName,

enum KeyNameIndex
{
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/KeyNameList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/KeyNameList.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * This header file defines all DOM key name which are used for DOM
 * KeyboardEvent.key.
 * You must define NS_DEFINE_KEYNAME macro before including this.
 *
 * It must have two arguments, (aCPPName, aDOMKeyName)
 * aCPPName is usable name for a part of C++ constants.
 * aDOMKeyName is the actual value.
 */

#define DEFINE_KEYNAME_INTERNAL(aCPPName, aDOMKeyName) \
  NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName)

#define DEFINE_KEYNAME_WITH_SAME_NAME(aName) \
  DEFINE_KEYNAME_INTERNAL(aName, #aName)

/******************************************************************************
DEFINE_KEYNAME_WITH_SAME_NAME(Paste)
DEFINE_KEYNAME_WITH_SAME_NAME(Redo)
DEFINE_KEYNAME_WITH_SAME_NAME(Undo)

/******************************************************************************
 * UI Keys
 *****************************************************************************/
DEFINE_KEYNAME_WITH_SAME_NAME(Accept)
DEFINE_KEYNAME_WITH_SAME_NAME(Again)
DEFINE_KEYNAME_WITH_SAME_NAME(PlaySpeedUp)
DEFINE_KEYNAME_WITH_SAME_NAME(RandomToggle)
DEFINE_KEYNAME_WITH_SAME_NAME(RcLowBattery)

#undef DEFINE_KEYNAME_WITH_SAME_NAME
#undef DEFINE_KEYNAME_INTERNAL
# 55 "../../dist/include/mozilla/EventForwards.h" 2
  // If a DOM keyboard event is synthesized by script, this is used.  Then,
  // specified key name should be stored and use it as .key value.
  KEY_NAME_INDEX_USE_STRING
};

#undef NS_DEFINE_KEYNAME

#define NS_DEFINE_PHYSICAL_KEY_CODE_NAME(aCPPName, aDOMCodeName) \
  CODE_NAME_INDEX_##aCPPName,

enum CodeNameIndex
{
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/PhysicalKeyCodeNameList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/PhysicalKeyCodeNameList.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * This header file defines all DOM code name which are used for DOM
 * KeyboardEvent.code.
 * You must define NS_DEFINE_PHYSICAL_KEY_CODE_NAME macro before including this.
 *
 * It must have two arguments, (aCPPName, aDOMCodeName)
 * aCPPName is usable name for a part of C++ constants.
 * aDOMCodeName is the actual value.
 */

#define NS_DEFINE_PHYSICAL_KEY_CODE_NAME_INTERNAL(aCPPName, aDOMCodeName) \
  NS_DEFINE_PHYSICAL_KEY_CODE_NAME(aCPPName, aDOMCodeName)

#define DEFINE_PHYSICAL_KEY_CODE_NAME_WITH_SAME_NAME(aName) \
  NS_DEFINE_PHYSICAL_KEY_CODE_NAME_INTERNAL(aName, #aName)

// Unknown key
NS_DEFINE_PHYSICAL_KEY_CODE_NAME_INTERNAL(UNKNOWN, "")

// Writing system keys
DEFINE_PHYSICAL_KEY_CODE_NAME_WITH_SAME_NAME(Backquote)
DEFINE_PHYSICAL_KEY_CODE_NAME_WITH_SAME_NAME(Backslash)
DEFINE_PHYSICAL_KEY_CODE_NAME_WITH_SAME_NAME(Undo)

// International keyboards
// DEFINE_PHYSICAL_KEY_CODE_NAME_WITH_SAME_NAME(Hiragana)
// DEFINE_PHYSICAL_KEY_CODE_NAME_WITH_SAME_NAME(Katakana)

#undef DEFINE_PHYSICAL_KEY_CODE_NAME_WITH_SAME_NAME
#undef NS_DEFINE_PHYSICAL_KEY_CODE_NAME_INTERNAL
# 68 "../../dist/include/mozilla/EventForwards.h" 2
  // If a DOM keyboard event is synthesized by script, this is used.  Then,
  // specified code name should be stored and use it as .code value.
  CODE_NAME_INDEX_USE_STRING
};

#undef NS_DEFINE_PHYSICAL_KEY_CODE_NAME

#define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName

typedef int8_t CommandInt;
enum Command : CommandInt
{
  CommandDoNothing

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CommandList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/CommandList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
NS_DEFINE_COMMAND(ScrollLineDown,              cmd_scrollLineDown)
NS_DEFINE_COMMAND(ScrollLineUp,                cmd_scrollLineUp)
NS_DEFINE_COMMAND(ScrollPageDown,              cmd_scrollPageDown)
NS_DEFINE_COMMAND(ScrollPageUp,                cmd_scrollPageUp)
# 83 "../../dist/include/mozilla/EventForwards.h" 2
};
#undef NS_DEFINE_COMMAND

} // namespace mozilla

/**
 * All header files should include this header instead of *Events.h.
 */

namespace mozilla {

#define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName;
#define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventClassList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EventClassList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * This header file lists up all event classes and related structs.
 * Define NS_EVENT_CLASS(aPrefix, aName) and NS_ROOT_EVENT_CLASS(aPrefix, aName)
 * before including this.
 * If an event name is WidgetInputEvent, aPrefix is "Widget" and aName is
 * "InputEvent".  NS_ROOT_EVENT_CLASS() is only used for WidgetEvent for
 * allowing special handling for it.  If you don't need such special handling,
 * you can define it as:
 * #define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
 */

// BasicEvents.h
NS_ROOT_EVENT_CLASS(Widget, Event)
NS_EVENT_CLASS(Widget, GUIEvent)
NS_EVENT_CLASS(Widget, InputEvent)
NS_EVENT_CLASS(Internal, UIEvent)

// TextEvents.h
NS_EVENT_CLASS(Widget, KeyboardEvent)
NS_EVENT_CLASS(Widget, CompositionEvent)
NS_EVENT_CLASS(Widget, QueryContentEvent)
NS_EVENT_CLASS(Widget, SelectionEvent)
NS_EVENT_CLASS(Internal, EditorInputEvent)
NS_EVENT_CLASS(Internal, BeforeAfterKeyboardEvent)
class TextRangeArray;

// FontRange.h
struct FontRange;

} // namespace mozilla

#endif // mozilla_EventForwards_h__
# 121 "../../dist/include/mozilla/EventForwards.h"
# 18 "../../dist/include/nsIDOMEventTarget.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/Nullable.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* vim: set ts=2 sw=2 et tw=79: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_Nullable_h
#define mozilla_dom_Nullable_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/Nullable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArrayForwardDeclare.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/Nullable.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/Nullable.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Maybe.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/Nullable.h"

class nsCycleCollectionTraversalCallback;

namespace mozilla {
namespace dom {

// Support for nullable types
template <typename T>
struct Nullable
{
private:
  Maybe<T> mValue;

public:
  Nullable()
    : mValue()
  {}

  explicit Nullable(T aValue)
    : mValue()
  {
    mValue.emplace(aValue);
  }

  
  bool operator!=(const Nullable<T>& aOtherNullable) const
  {
    return !Equals(aOtherNullable);
  }
};


template<typename T>
void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
                            Nullable<T>& aNullable,
                            const char* aName,
                            uint32_t aFlags = 0)
{
  if (!aNullable.IsNull()) {
    ImplCycleCollectionTraverse(aCallback, aNullable.Value(), aName, aFlags);
  }
}

template<typename T>
void
ImplCycleCollectionUnlink(Nullable<T>& aNullable)
{
  if (!aNullable.IsNull()) {
    ImplCycleCollectionUnlink(aNullable.Value());
  }
}

} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_Nullable_h */
# 124 "../../dist/include/mozilla/dom/Nullable.h"
# 19 "../../dist/include/nsIDOMEventTarget.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsIDOMEventTarget.h"
using mozilla::dom::Nullable;
namespace mozilla {
class EventChainPostVisitor;
class EventChainPreVisitor;
class EventListenerManager;
namespace dom {
class EventTarget;
} // namespace dom
} // namespace mozilla
class nsPresContext;
class nsIScriptContext; /* forward declaration */

class nsIDOMEventListener; /* forward declaration */

class nsIDOMEvent; /* forward declaration */


/* starting interface:    nsIDOMEventTarget */
#define NS_IDOMEVENTTARGET_IID_STR "9a78ac3c-9507-4d00-b2d6-10b508d2ec31"

#define NS_IDOMEVENTTARGET_IID \
  {0x9a78ac3c, 0x9507, 0x4d00, \
    { 0xb2, 0xd6, 0x10, 0xb5, 0x08, 0xd2, 0xec, 0x31 }}

class nsIDOMEventTarget : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMEVENTTARGET_IID)

  /* [optional_argc] void addEventListener (in DOMString type, in nsIDOMEventListener listener, [optional] in boolean useCapture, [optional] in boolean wantsUntrusted); */
  NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *listener, bool useCapture, bool wantsUntrusted, uint8_t _argc) = 0;

  /* [noscript,optional_argc] void addSystemEventListener (in DOMString type, in nsIDOMEventListener listener, [optional] in boolean aUseCapture, [optional] in boolean aWantsUntrusted); */
  NS_IMETHOD AddSystemEventListener(const nsAString & type, nsIDOMEventListener *listener, bool aUseCapture, bool aWantsUntrusted, uint8_t _argc) = 0;

   // non-virtual so it won't affect the vtable
  nsresult AddEventListener(const nsAString& aType,
                            nsIDOMEventListener* aListener,
                            bool aUseCapture)
  {
    return AddEventListener(aType, aListener, aUseCapture, false, 1);
  }
  nsresult AddSystemEventListener(const nsAString& aType,
                                  nsIDOMEventListener* aListener,
                                  bool aUseCapture,
                                  bool aWantsUntrusted)
  {
    return AddSystemEventListener(aType, aListener, aUseCapture,
                                  aWantsUntrusted, 2);
  }
  /* void removeEventListener (in DOMString type, in nsIDOMEventListener listener, [optional] in boolean useCapture); */
  NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *listener, bool useCapture) = 0;

  /* [noscript] void removeSystemEventListener (in DOMString type, in nsIDOMEventListener listener, [optional] in boolean aUseCapture); */
  NS_IMETHOD RemoveSystemEventListener(const nsAString & type, nsIDOMEventListener *listener, bool aUseCapture) = 0;

  /* boolean dispatchEvent (in nsIDOMEvent evt) raises (DOMException); */
  NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, bool *_retval) = 0;

  /* [nostdcall,notxpcom] EventTargetPtr GetTargetForDOMEvent (); */
  virtual mozilla::dom::EventTarget * GetTargetForDOMEvent(void) = 0;

  /* [nostdcall,notxpcom] EventTargetPtr GetTargetForEventTargetChain (); */
  virtual mozilla::dom::EventTarget * GetTargetForEventTargetChain(void) = 0;

  /* [noscript,nostdcall] void PreHandleEvent (in EventChainPreVisitorRef aVisitor); */
  virtual nsresult PreHandleEvent(mozilla::EventChainPreVisitor & aVisitor) = 0;

  /* [noscript,nostdcall] void WillHandleEvent (in EventChainPostVisitorRef aVisitor); */
  virtual nsresult WillHandleEvent(mozilla::EventChainPostVisitor & aVisitor) = 0;

  /* [noscript,nostdcall] void PostHandleEvent (in EventChainPostVisitorRef aVisitor); */
  virtual nsresult PostHandleEvent(mozilla::EventChainPostVisitor & aVisitor) = 0;

  /* [noscript,nostdcall] void DispatchDOMEvent (in WidgetEventPtr aEvent, in nsIDOMEvent aDOMEvent, in nsPresContextPtr aPresContext, in nsEventStatusPtr aEventStatus); */
  virtual nsresult DispatchDOMEvent(mozilla::WidgetEvent *aEvent, nsIDOMEvent *aDOMEvent, nsPresContext *aPresContext, nsEventStatus *aEventStatus) = 0;

  /* [nostdcall,notxpcom] nsIScriptContext GetContextForEventHandlers (out nsresult aRv); */
  virtual nsIScriptContext * GetContextForEventHandlers(nsresult *aRv) = 0;

  /* [nostdcall,notxpcom] JSContextPtr GetJSContextForEventHandlers (); */
  virtual JSContext * GetJSContextForEventHandlers(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMEventTarget, NS_IDOMEVENTTARGET_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMEVENTTARGET \
  NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *listener, bool useCapture, bool wantsUntrusted, uint8_t _argc) MOZ_OVERRIDE; \
  NS_IMETHOD AddSystemEventListener(const nsAString & type, nsIDOMEventListener *listener, bool aUseCapture, bool aWantsUntrusted, uint8_t _argc) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *listener, bool useCapture) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveSystemEventListener(const nsAString & type, nsIDOMEventListener *listener, bool aUseCapture) MOZ_OVERRIDE; \
  NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, bool *_retval) MOZ_OVERRIDE; \
  virtual mozilla::dom::EventTarget * GetTargetForDOMEvent(void) MOZ_OVERRIDE; \
  virtual mozilla::dom::EventTarget * GetTargetForEventTargetChain(void) MOZ_OVERRIDE; \
  virtual nsresult PreHandleEvent(mozilla::EventChainPreVisitor & aVisitor) MOZ_OVERRIDE; \
  virtual nsresult WillHandleEvent(mozilla::EventChainPostVisitor & aVisitor) MOZ_OVERRIDE; \
  virtual nsresult PostHandleEvent(mozilla::EventChainPostVisitor & aVisitor) MOZ_OVERRIDE; \
  virtual nsresult DispatchDOMEvent(mozilla::WidgetEvent *aEvent, nsIDOMEvent *aDOMEvent, nsPresContext *aPresContext, nsEventStatus *aEventStatus) MOZ_OVERRIDE; \
  virtual nsIScriptContext * GetContextForEventHandlers(nsresult *aRv) MOZ_OVERRIDE; \
  virtual JSContext * GetJSContextForEventHandlers(void) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMEVENTTARGET(_to) \
  NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *listener, bool useCapture, bool wantsUntrusted, uint8_t _argc) MOZ_OVERRIDE { return _to AddEventListener(type, listener, useCapture, wantsUntrusted, _argc); } \
  NS_IMETHOD AddSystemEventListener(const nsAString & type, nsIDOMEventListener *listener, bool aUseCapture, bool aWantsUntrusted, uint8_t _argc) MOZ_OVERRIDE { return _to AddSystemEventListener(type, listener, aUseCapture, aWantsUntrusted, _argc); } \
  NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *listener, bool useCapture) MOZ_OVERRIDE { return _to RemoveEventListener(type, listener, useCapture); } \
  NS_IMETHOD RemoveSystemEventListener(const nsAString & type, nsIDOMEventListener *listener, bool aUseCapture) MOZ_OVERRIDE { return _to RemoveSystemEventListener(type, listener, aUseCapture); } \
  NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, bool *_retval) MOZ_OVERRIDE { return _to DispatchEvent(evt, _retval); } \
  virtual mozilla::dom::EventTarget * GetTargetForDOMEvent(void) MOZ_OVERRIDE { return _to GetTargetForDOMEvent(); } \
  virtual mozilla::dom::EventTarget * GetTargetForEventTargetChain(void) MOZ_OVERRIDE { return _to GetTargetForEventTargetChain(); } \
  virtual nsresult PreHandleEvent(mozilla::EventChainPreVisitor & aVisitor) MOZ_OVERRIDE { return _to PreHandleEvent(aVisitor); } \
  virtual nsresult WillHandleEvent(mozilla::EventChainPostVisitor & aVisitor) MOZ_OVERRIDE { return _to WillHandleEvent(aVisitor); } \
  virtual nsresult PostHandleEvent(mozilla::EventChainPostVisitor & aVisitor) MOZ_OVERRIDE { return _to PostHandleEvent(aVisitor); } \
  virtual nsresult DispatchDOMEvent(mozilla::WidgetEvent *aEvent, nsIDOMEvent *aDOMEvent, nsPresContext *aPresContext, nsEventStatus *aEventStatus) MOZ_OVERRIDE { return _to DispatchDOMEvent(aEvent, aDOMEvent, aPresContext, aEventStatus); } \
  virtual nsIScriptContext * GetContextForEventHandlers(nsresult *aRv) MOZ_OVERRIDE { return _to GetContextForEventHandlers(aRv); } \
  virtual JSContext * GetJSContextForEventHandlers(void) MOZ_OVERRIDE { return _to GetJSContextForEventHandlers(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMEVENTTARGET(_to) \
  NS_IMETHOD AddEventListener(const nsAString & type, nsIDOMEventListener *listener, bool useCapture, bool wantsUntrusted, uint8_t _argc) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddEventListener(type, listener, useCapture, wantsUntrusted, _argc); } \
  NS_IMETHOD AddSystemEventListener(const nsAString & type, nsIDOMEventListener *listener, bool aUseCapture, bool aWantsUntrusted, uint8_t _argc) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddSystemEventListener(type, listener, aUseCapture, aWantsUntrusted, _argc); } \
  NS_IMETHOD RemoveEventListener(const nsAString & type, nsIDOMEventListener *listener, bool useCapture) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveEventListener(type, listener, useCapture); } \
  NS_IMETHOD RemoveSystemEventListener(const nsAString & type, nsIDOMEventListener *listener, bool aUseCapture) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveSystemEventListener(type, listener, aUseCapture); } \
  NS_IMETHOD DispatchEvent(nsIDOMEvent *evt, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->DispatchEvent(evt, _retval); } \
  virtual mozilla::dom::EventTarget * GetTargetForDOMEvent(void) MOZ_OVERRIDE; \
  virtual mozilla::dom::EventTarget * GetTargetForEventTargetChain(void) MOZ_OVERRIDE; \
  virtual nsresult PreHandleEvent(mozilla::EventChainPreVisitor & aVisitor) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->PreHandleEvent(aVisitor); } \
  virtual nsresult WillHandleEvent(mozilla::EventChainPostVisitor & aVisitor) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->WillHandleEvent(aVisitor); } \
  virtual nsresult PostHandleEvent(mozilla::EventChainPostVisitor & aVisitor) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->PostHandleEvent(aVisitor); } \
  virtual nsresult DispatchDOMEvent(mozilla::WidgetEvent *aEvent, nsIDOMEvent *aDOMEvent, nsPresContext *aPresContext, nsEventStatus *aEventStatus) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->DispatchDOMEvent(aEvent, aDOMEvent, aPresContext, aEventStatus); } \
  virtual nsIScriptContext * GetContextForEventHandlers(nsresult *aRv) MOZ_OVERRIDE; \
  virtual JSContext * GetJSContextForEventHandlers(void) MOZ_OVERRIDE; 

#if 0
/* Use the code below as a template for the implementation class for this interface. */
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [nostdcall,notxpcom] nsIScriptContext GetContextForEventHandlers (out nsresult aRv); */
nsIScriptContext * nsDOMEventTarget::GetContextForEventHandlers(nsresult *aRv)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [nostdcall,notxpcom] JSContextPtr GetJSContextForEventHandlers (); */
JSContext * nsDOMEventTarget::GetJSContextForEventHandlers()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 283 "../../dist/include/nsIDOMEventTarget.h"


#define NS_IMPL_DOMTARGET_DEFAULTS(_class) \
mozilla::dom::EventTarget* _class::GetTargetForDOMEvent() { return this; } \
mozilla::dom::EventTarget* _class::GetTargetForEventTargetChain() { return this; } \
nsresult _class::WillHandleEvent(mozilla::EventChainPostVisitor& aVisitor) { return NS_OK; } \
JSContext* _class::GetJSContextForEventHandlers() { return nullptr; }
#define NS_IMPL_REMOVE_SYSTEM_EVENT_LISTENER(aClass) \
NS_IMETHODIMP \
aClass::RemoveSystemEventListener(const nsAString& aType, \
                                  nsIDOMEventListener *aListener, \
                                  bool aUseCapture) \
{ \
  mozilla::EventListenerManager* listenerManager = \
    GetExistingListenerManager(); \
  if (!listenerManager) { \
    return NS_OK; \
  } \
  mozilla::EventListenerFlags flags; \
  flags.mInSystemGroup = true; \
  flags.mCapture = aUseCapture; \
  listenerManager->RemoveEventListenerByType(aListener, aType, flags); \
  return NS_OK; \
}

#endif /* __gen_nsIDOMEventTarget_h__ */
# 309 "../../dist/include/nsIDOMEventTarget.h"
# 10 "../../dist/include/mozilla/dom/EventTarget.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCache.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsWrapperCache_h___
#define nsWrapperCache_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Class.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/Class.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* JSClass definition and its component types, plus related interfaces. */

#ifndef js_Class_h
#define js_Class_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/js/Class.h"

#if 0 /* expanded by -frewrite-includes */
#include "jstypes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/js/Class.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/CallArgs.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/CallArgs.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 *
 * The eventual plan is to change JSNative to take |const CallArgs&| directly,
 * for automatic assertion of correct use and to make calling functions more
 * efficient.  Embedders should start internally switching away from using
 * |argc| and |vp| directly, except to create a |CallArgs|.  Then, when an
 * eventual release making that change occurs, porting efforts will require
 * changing methods' signatures but won't require invasive changes to the
 * methods' implementations, potentially under time pressure.
 */

#ifndef js_CallArgs_h
#define js_CallArgs_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 33 "../../dist/include/js/CallArgs.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 34 "../../dist/include/js/CallArgs.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 35 "../../dist/include/js/CallArgs.h"

#if 0 /* expanded by -frewrite-includes */
#include "jstypes.h"
#endif /* expanded by -frewrite-includes */
# 37 "../../dist/include/js/CallArgs.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 39 "../../dist/include/js/CallArgs.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 40 "../../dist/include/js/CallArgs.h"

/* Typedef for native functions called by the JS VM. */
typedef bool
(* JSNative)(JSContext *cx, unsigned argc, JS::Value *vp);

/*
 * Compute |this| for the |vp| inside a JSNative, either boxing primitives or
 * replacing with the global object as necessary.
 *
 * This method will go away at some point: instead use |args.thisv()|.  If the
 * value is an object, no further work is required.  If that value is |null| or
 * |undefined|, use |JS_GetGlobalForObject| to compute the global object.  If
 * the value is some other primitive, use |JS_ValueToObject| to box it.
 */
extern JS_PUBLIC_API(JS::Value)
JS_ComputeThis(JSContext *cx, JS::Value *vp);

namespace JS {

extern JS_PUBLIC_DATA(const HandleValue) UndefinedHandleValue;

/*
 * JS::CallReceiver encapsulates access to the callee, |this|, and eventual
 * return value for a function call.  The principal way to create a
 * CallReceiver is using JS::CallReceiverFromVp:
 *
 *       // As the return value was last set to |this|, returns |this|.
 *       return true;
 *   }
 *
 * A note on JS_ComputeThis and JS_THIS_OBJECT: these methods currently aren't
 * part of the CallReceiver interface.  We will likely add them at some point.
 * Until then, you should probably continue using |vp| directly for these two
 * cases.
 *
 * CallReceiver is exposed publicly and used internally.  Not all parts of its
 * public interface are meant to be used by embedders!  See inline comments to
 * for details.
 */

namespace detail {

#ifdef JS_DEBUG
extern JS_PUBLIC_API(void)
CheckIsValidConstructible(Value v);
#endif
# 102 "../../dist/include/js/CallArgs.h"

enum UsedRval { IncludeUsedRval, NoUsedRval };

template<UsedRval WantUsedRval>
class MOZ_STACK_CLASS UsedRvalBase;

template<>
class MOZ_STACK_CLASS UsedRvalBase<IncludeUsedRval>
{
  protected:
    mutable bool usedRval_;
    void setUsedRval() const { usedRval_ = true; }
    void clearUsedRval() const { usedRval_ = false; }
};

template<>
class MOZ_STACK_CLASS UsedRvalBase<NoUsedRval>
{
  protected:
    void setUsedRval() const {}
    void clearUsedRval() const {}
};

template<UsedRval WantUsedRval>
class MOZ_STACK_CLASS CallReceiverBase : public UsedRvalBase<
#ifdef JS_DEBUG
        WantUsedRval
#else
# 130 "../../dist/include/js/CallArgs.h"
        NoUsedRval
#endif
# 132 "../../dist/include/js/CallArgs.h"
    >
{
  protected:
    Value *argv_;

  public:
    /*
     * Returns the function being called, as an object.  Must not be called
     * after rval() has been used!
     */
    JSObject &callee() const {
        MOZ_ASSERT(!this->usedRval_);
        return argv_[-2].toObject();
    }

    /*
     * Returns the function being called, as a value.  Must not be called after
     * rval() has been used!
     */
    HandleValue calleev() const {
        MOZ_ASSERT(!this->usedRval_);
        return HandleValue::fromMarkedLocation(&argv_[-2]);
    }

    /*
     * Returns the |this| value passed to the function.  This method must not
     * be called when the function is being called as a constructor via |new|.
     * The value may or may not be an object: it is the individual function's
     * responsibility to box the value if needed.
     */
    HandleValue thisv() const {
        // Some internal code uses thisv() in constructing cases, so don't do
        // this yet.
        // MOZ_ASSERT(!argv_[-1].isMagic(JS_IS_CONSTRUCTING));
        return HandleValue::fromMarkedLocation(&argv_[-1]);
    }

    Value computeThis(JSContext *cx) const {
        if (thisv().isObject())
            return thisv();

        return JS_ComputeThis(cx, base());
    }

    

    /*
     * Returns the currently-set return value.  The initial contents of this
     * value are unspecified.  Once this method has been called, callee() and
     * calleev() can no longer be used.  (If you're compiling against a debug
     * build of SpiderMonkey, these methods will assert to aid debugging.)
     *
     * If the method you're implementing succeeds by returning true, you *must*
     * set this.  (SpiderMonkey doesn't currently assert this, but it will do
     * so eventually.)  You don't need to use or change this if your method
     * fails.
     */
    

  public:
    // These methods are only intended for internal use.  Embedders shouldn't
    // use them!

    Value *base() const { return argv_ - 2; }

    

  public:
    // These methods are publicly exposed, but they are *not* to be used when
    // implementing a JSNative method and encapsulating access to |vp| within
    // it.  You probably don't want to use these!

    

    

    
};

} // namespace detail

class MOZ_STACK_CLASS CallReceiver : public detail::CallReceiverBase<detail::IncludeUsedRval>
{
  private:
    ;
    friend CallReceiver CallReceiverFromArgv(Value *argv);
};

MOZ_ALWAYS_INLINE CallReceiver
CallReceiverFromArgv(Value *argv)
{
    CallReceiver receiver;
    receiver.clearUsedRval();
    receiver.argv_ = argv;
    return receiver;
}

MOZ_ALWAYS_INLINE CallReceiver
CallReceiverFromVp(Value *vp)
{
    return CallReceiverFromArgv(vp + 2);
}

/*
 * JS::CallArgs encapsulates everything JS::CallReceiver does, plus access to
 * the function call's arguments.  The principal way to create a CallArgs is
 *
 * CallArgs is exposed publicly and used internally.  Not all parts of its
 * public interface are meant to be used by embedders!  See inline comments to
 * for details.
 */
namespace detail {

template<UsedRval WantUsedRval>
class MOZ_STACK_CLASS CallArgsBase :
        public mozilla::Conditional<WantUsedRval == detail::IncludeUsedRval,
                                    CallReceiver,
                                    CallReceiverBase<NoUsedRval> >::Type
{
  protected:
    unsigned argc_;

};

} // namespace detail

class MOZ_STACK_CLASS CallArgs : public detail::CallArgsBase<detail::IncludeUsedRval>
{
  private:
    friend CallArgs CallArgsFromVp(unsigned argc, Value *vp);
    friend CallArgs CallArgsFromSp(unsigned argc, Value *sp);

    static CallArgs create(unsigned argc, Value *argv) {
        CallArgs args;
        args.clearUsedRval();
        args.argv_ = argv;
        args.argc_ = argc;
        return args;
    }

  public:
    /*
     * Returns true if there are at least |required| arguments passed in. If
     * false, it reports an error message on the context.
     */
    bool requireAtLeast(JSContext *cx, const char *fnname, unsigned required);

};

MOZ_ALWAYS_INLINE CallArgs
CallArgsFromVp(unsigned argc, Value *vp)
{
    return CallArgs::create(argc, vp + 2);
}

// This method is only intended for internal use in SpiderMonkey.  We may
// eventually move it to an internal header.  Embedders should use
// JS::CallArgsFromVp!
MOZ_ALWAYS_INLINE CallArgs
CallArgsFromSp(unsigned argc, Value *sp)
{
    return CallArgs::create(argc, sp - argc);
}

} // namespace JS

/*
 * Macros to hide interpreter stack layout details from a JSNative using its
 * JS::Value *vp parameter.  DO NOT USE THESE!  Instead use JS::CallArgs and
 * friends, above.  These macros will be removed when we change JSNative to
 * |this| is passed to functions in ES5 without change.  Functions themselves
 * do any post-processing they desire to box |this|, compute the global object,
 * &c.  This macro retrieves a function's unboxed |this| value.
 *
 * This macro must not be used in conjunction with JS_THIS or JS_THIS_OBJECT,
 * or vice versa.  Either use the provided this value with this macro, or
 * compute the boxed |this| value using those.  JS_THIS_VALUE must not be used
 * if the function is being called as a constructor.
 *
 * But: DO NOT USE THIS!  Instead use JS::CallArgs::thisv(), above.
 *
 */
#define JS_THIS_VALUE(cx,vp)    ((vp)[1])

#endif /* js_CallArgs_h */
# 403 "../../dist/include/js/CallArgs.h"
# 17 "../../dist/include/js/Class.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/Id.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/Id.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_Id_h
#define js_Id_h

// A jsid is an identifier for a property or method of an object which is
// either a 31-bit signed integer, interned string or object.

struct jsid
{
    size_t asBits;
    
    
};
#define JSID_BITS(id) (id.asBits)

#define JSID_TYPE_STRING                 0x0
#define JSID_TYPE_INT                    0x1
#define JSID_TYPE_VOID                   0x2
#define JSID_TYPE_SYMBOL                 0x4
#define JSID_TYPE_MASK                   0x7

// Avoid using canonical 'id' for jsid parameters since this is a magic word in
// Objective-C++ which, apparently, wants to be able to #include jsapi.h.
#define id iden

static MOZ_ALWAYS_INLINE bool
JSID_IS_STRING(jsid id)
{
    return (JSID_BITS(id) & JSID_TYPE_MASK) == 0;
}

static MOZ_ALWAYS_INLINE JSString *
JSID_TO_STRING(jsid id)
{
    MOZ_ASSERT(JSID_IS_STRING(id));
    return (JSString *)JSID_BITS(id);
}

/*
 * Only JSStrings that have been interned via the JSAPI can be turned into
 * jsids by API clients.
 *
 * N.B. if a jsid is backed by a string which has not been interned, that
 * string must be appropriately rooted to avoid being collected by the GC.
 */
JS_PUBLIC_API(jsid)
INTERNED_STRING_TO_JSID(JSContext *cx, JSString *str);



static MOZ_ALWAYS_INLINE bool
JSID_IS_INT(jsid id)
{
    return !!(JSID_BITS(id) & JSID_TYPE_INT);
}

static MOZ_ALWAYS_INLINE int32_t
JSID_TO_INT(jsid id)
{
    MOZ_ASSERT(JSID_IS_INT(id));
    return ((uint32_t)JSID_BITS(id)) >> 1;
}

#define JSID_INT_MIN  0
#define JSID_INT_MAX  INT32_MAX





static MOZ_ALWAYS_INLINE bool
JSID_IS_SYMBOL(jsid id)
{
    return (JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_SYMBOL &&
           JSID_BITS(id) != JSID_TYPE_SYMBOL;
}

static MOZ_ALWAYS_INLINE JS::Symbol *
JSID_TO_SYMBOL(jsid id)
{
    MOZ_ASSERT(JSID_IS_SYMBOL(id));
    return (JS::Symbol *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);
}







static MOZ_ALWAYS_INLINE bool
JSID_IS_VOID(const jsid id)
{
    MOZ_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
                 JSID_BITS(id) == JSID_TYPE_VOID);
    return (size_t)JSID_BITS(id) == JSID_TYPE_VOID;
}

static MOZ_ALWAYS_INLINE bool
JSID_IS_EMPTY(const jsid id)
{
    return (size_t)JSID_BITS(id) == JSID_TYPE_SYMBOL;
}

extern JS_PUBLIC_DATA(const jsid) JSID_VOID;
extern JS_PUBLIC_DATA(const jsid) JSID_EMPTY;

extern JS_PUBLIC_DATA(const JS::HandleId) JSID_VOIDHANDLE;
extern JS_PUBLIC_DATA(const JS::HandleId) JSID_EMPTYHANDLE;

namespace js {

inline bool
IsPoisonedId(jsid id)
{
    if (JSID_IS_STRING(id))
        return JS::IsPoisonedPtr(JSID_TO_STRING(id));
    if (JSID_IS_SYMBOL(id))
        return JS::IsPoisonedPtr(JSID_TO_SYMBOL(id));
    return false;
}

template <> struct GCMethods<jsid>
{
    static jsid initial() { return JSID_VOID; }
    static bool poisoned(jsid id) { return IsPoisonedId(id); }
    
    
    
};

#undef id

}

#endif /* js_Id_h */
# 196 "../../dist/include/js/Id.h"
# 18 "../../dist/include/js/Class.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/js/Class.h"

/*
 * A JSClass acts as a vtable for JS objects that allows JSAPI clients to
 * control various aspects of the behavior of an object like property lookup.
 * js::Class is an engine-private extension that allows more control over
 * object behavior and, e.g., allows custom slow layout.
 */

struct JSFreeOp;
struct JSFunctionSpec;

namespace js {

struct Class;
class FreeOp;
class PropertyName;
class Shape;

// This is equal to JSFunction::class_.  Use it in places where you don't want
// to #include jsfun.h.
extern JS_FRIEND_DATA(const js::Class* const) FunctionClassPtr;

} // namespace js

namespace JS {

class AutoIdVector;

/*
 * Per ES6, the [[DefineOwnProperty]] internal method has three different
 * possible outcomes:
 *
 * -   It can throw an exception (which we indicate by returning false).
 *
 * -   It can return true, indicating unvarnished success.
 *
 * -   It can return false, indicating "strict failure". The property could
 *     not be defined. It's an error, but no exception was thrown.
 *
 * It's not just [[DefineOwnProperty]]: all the mutating internal methods have
 * Users don't have to call `result.report()`; another possible ending is:
 *
 *     argv.rval().setBoolean(bool(result));
 *     return true;
 */
class ObjectOpResult
{
  private:
    uint32_t code_;

  public:
    enum { OkCode = 0, Uninitialized = 0xffffffff };

    

    /* Return true if fail() was not called. */
    bool ok() const {
        MOZ_ASSERT(code_ != Uninitialized);
        return code_ == OkCode;
    }

    

    /* Set this ObjectOpResult to true and return true. */
    

    /*
     * Set this ObjectOpResult to false with an error code.
     *
     * Always returns true, as a convenience. Typical usage will be:
     *
     *     if (funny condition)
     * throw a TypeError and return false.
     */
    

    /*
     * Convenience method. The same as checkStrict(cx, id), except the
     * operation is not associated with a particular property id.
     */
    
};

}

// JSClass operation signatures.

// Add or get a property named by id in obj.  Note the jsid id type -- id may
// be a string (Unicode property identifier) or an int (element index).  The
// *vp out parameter, on success, is the new property value after the action.
typedef bool
(* JSGetterOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
               JS::MutableHandleValue vp);

typedef JSGetterOp JSAddPropertyOp;

// Set a property named by id in obj, treating the assignment as strict
// mode code if strict is true. Note the jsid id type -- id may be a string
// (Unicode property identifier) or an int (element index). The *vp out
// parameter, on success, is the new property value after the
// set.
typedef bool
(* JSSetterOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
               JS::MutableHandleValue vp, JS::ObjectOpResult &result);

// Delete a property named by id in obj.
//
// If an error occurred, return false as per normal JSAPI error practice.
//
// If no error occurred, but the deletion attempt wasn't allowed (perhaps
// because the property was non-configurable), call result.fail() and
// return true.  This will cause |delete obj[id]| to evaluate to false in
// non-strict mode code, and to throw a TypeError in strict mode code.
//
// If no error occurred and the deletion wasn't disallowed (this is *not* the
// same as saying that a deletion actually occurred -- deleting a non-existent
// property, or an inherited property, is allowed -- it's just pointless),
// call result.succeed() and return true.
typedef bool
(* JSDeletePropertyOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
                       JS::ObjectOpResult &result);

// The type of ObjectOps::enumerate. This callback overrides a portion of SpiderMonkey's default
// [[Enumerate]] internal method. When an ordinary object is enumerated, that object and each object
// on its prototype chain is tested for an enumerate op, and those ops are called in order.
// The properties each op adds to the 'properties' vector are added to the set of values the
// for-in loop will iterate over. All of this is nonstandard.
//
// An object is "enumerated" when it's the target of a for-in loop or JS_Enumerate().
// All other property inspection, including Object.keys(obj), goes through [[OwnKeys]].
//
// The callback's job is to populate 'properties' with all property keys that the for-in loop
// should visit.
typedef bool
(* JSNewEnumerateOp)(JSContext *cx, JS::HandleObject obj, JS::AutoIdVector &properties);

// The old-style JSClass.enumerate op should define all lazy properties not
// yet reflected in obj.
typedef bool
(* JSEnumerateOp)(JSContext *cx, JS::HandleObject obj);

// Resolve a lazy property named by id in obj by defining it directly in obj.
// Lazy properties are those reflected from some peer native property space
// (e.g., the DOM attributes for a given node reflected as obj) on demand.
//
// JS looks for a property in an object, and if not found, tries to resolve
// the given id. *resolvedp should be set to true iff the property was
// was defined on |obj|.
//
typedef bool
(* JSResolveOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
                bool *resolvedp);

// Convert obj to the given type, returning true with the resulting value in
// *vp on success, and returning false on error or exception.
typedef bool
(* JSConvertOp)(JSContext *cx, JS::HandleObject obj, JSType type,
                JS::MutableHandleValue vp);

// Finalize obj, which the garbage collector has determined to be unreachable
// from other live objects or from GC roots.  Obviously, finalizers must never
// store a reference to obj.
typedef void
(* JSFinalizeOp)(JSFreeOp *fop, JSObject *obj);

// Finalizes external strings created by JS_NewExternalString.
struct JSStringFinalizer {
    void (*finalize)(const JSStringFinalizer *fin, char16_t *chars);
};

// Check whether v is an instance of obj.  Return false on error or exception,
// true on success with true in *bp if v is an instance of obj, false in
// *bp otherwise.
typedef bool
(* JSHasInstanceOp)(JSContext *cx, JS::HandleObject obj, JS::MutableHandleValue vp,
                    bool *bp);

// Function type for trace operation of the class called to enumerate all
// traceable things reachable from obj's private data structure. For each such
// thing, a trace implementation must call one of the JS_Call*Tracer variants
// on the thing.
//
// JSTraceOp implementation can assume that no other threads mutates object
// state. It must not change state of the object or corresponding native
// structures. The only exception for this rule is the case when the embedding
// needs a tight integration with GC. In that case the embedding can check if
// the traversal is a part of the marking phase through calling
// JS_IsGCMarkingTracer and apply a special code like emptying caches or
// marking its native structures.
typedef void
(* JSTraceOp)(JSTracer *trc, JSObject *obj);

typedef JSObject *
(* JSWeakmapKeyDelegateOp)(JSObject *obj);

typedef void
(* JSObjectMovedOp)(JSObject *obj, const JSObject *old);

/* js::Class operation signatures. */

namespace js {

typedef bool
(* LookupPropertyOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
                     JS::MutableHandleObject objp, JS::MutableHandle<Shape*> propp);
typedef bool
(* DefinePropertyOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::HandleValue value,
                     JSGetterOp getter, JSSetterOp setter, unsigned attrs,
                     JS::ObjectOpResult &result);
typedef bool
(* HasPropertyOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id, bool *foundp);
typedef bool
(* GetPropertyOp)(JSContext *cx, JS::HandleObject obj, JS::HandleObject receiver, JS::HandleId id,
                  JS::MutableHandleValue vp);
typedef bool
(* SetPropertyOp)(JSContext *cx, JS::HandleObject obj, JS::HandleObject receiver, JS::HandleId id,
                  JS::MutableHandleValue vp, JS::ObjectOpResult &result);
typedef bool
(* GetOwnPropertyOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
                     JS::MutableHandle<JSPropertyDescriptor> desc);
typedef bool
(* DeletePropertyOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
                     JS::ObjectOpResult &result);

typedef bool
(* WatchOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id, JS::HandleObject callable);

typedef bool
(* UnwatchOp)(JSContext *cx, JS::HandleObject obj, JS::HandleId id);

class JS_FRIEND_API(ElementAdder)
{
  public:
    enum GetBehavior {
        // Check if the element exists before performing the Get and preserve
        // holes.
        CheckHasElemPreserveHoles,

        // Perform a Get operation, like obj[index] in JS.
        GetElement
    };

  private:
    // Only one of these is used.
    JS::RootedObject resObj_;
    JS::Value *vp_;

    uint32_t index_;
    mozilla::DebugOnly<uint32_t> length_;
    GetBehavior getBehavior_;

  public:
    
    

    

    ;
    ;
};

typedef bool
(* GetElementsOp)(JSContext *cx, JS::HandleObject obj, uint32_t begin, uint32_t end,
                  ElementAdder *adder);

// A generic type for functions mapping an object to another object, or null
// if an error or exception was thrown on cx.
typedef JSObject *
(* ObjectOp)(JSContext *cx, JS::HandleObject obj);

// Hook to map an object to its inner object. Infallible.
typedef JSObject *
(* InnerObjectOp)(JSObject *obj);

typedef void
(* FinalizeOp)(FreeOp *fop, JSObject *obj);

#define JS_CLASS_MEMBERS(FinalizeOpType)                                      \
    const char          *name;                                                \
    uint32_t            flags;                                                \
                                                                              \
    /* Function pointer members (may be null). */                             \
    JSAddPropertyOp     addProperty;                                          \
    JSDeletePropertyOp  delProperty;                                          \
    JSGetterOp          getProperty;                                          \
    JSSetterOp          setProperty;                                          \
    JSEnumerateOp       enumerate;                                            \
    JSResolveOp         resolve;                                              \
    JSConvertOp         convert;                                              \
    FinalizeOpType      finalize;                                             \
    JSNative            call;                                                 \
    JSHasInstanceOp     hasInstance;                                          \
    JSNative            construct;                                            \
    JSTraceOp           trace

// Callback for the creation of constructor and prototype objects.
typedef JSObject *(*ClassObjectCreationOp)(JSContext *cx, JSProtoKey key);

// Callback for custom post-processing after class initialization via ClassSpec.
typedef bool (*FinishClassInitOp)(JSContext *cx, JS::HandleObject ctor,
                                  JS::HandleObject proto);

const size_t JSCLASS_CACHED_PROTO_WIDTH = 6;

struct ClassSpec
{
    ClassObjectCreationOp createConstructor;
    ClassObjectCreationOp createPrototype;
    const JSFunctionSpec *constructorFunctions;
    const JSFunctionSpec *prototypeFunctions;
    const JSPropertySpec *prototypeProperties;
    FinishClassInitOp finishInit;
    uintptr_t flags;

    static const size_t ParentKeyWidth = JSCLASS_CACHED_PROTO_WIDTH;

    static const uintptr_t ParentKeyMask = (1 << ParentKeyWidth) - 1;
    static const uintptr_t DontDefineConstructor = 1 << ParentKeyWidth;

    bool defined() const { return !!createConstructor; }

    bool dependent() const {
        MOZ_ASSERT(defined());
        return (flags & ParentKeyMask);
    }

    JSProtoKey parentKey() const {
        static_assert(JSProto_Null == 0, "zeroed key must be null");
        return JSProtoKey(flags & ParentKeyMask);
    }

    
};

struct ClassExtension
{
    ObjectOp            outerObject;
    InnerObjectOp       innerObject;

    /*
     * isWrappedNative is true only if the class is an XPCWrappedNative.
     * WeakMaps use this to override the wrapper disposal optimization.
     */
    bool                isWrappedNative;

    /*
     * If an object is used as a key in a weakmap, it may be desirable for the
     * garbage collector to keep that object around longer than it otherwise
     * would. A common case is when the key is a wrapper around an object in
     * another compartment, and we want to avoid collecting the wrapper (and
     * removing the weakmap entry) as long as the wrapped object is alive. In
     * that case, the wrapped object is returned by the wrapper's
     * weakmapKeyDelegateOp hook. As long as the wrapper is used as a weakmap
     * key, it will not be collected (and remain in the weakmap) until the
     * wrapped object is collected.
     */
    JSWeakmapKeyDelegateOp weakmapKeyDelegateOp;

    /*
     * Optional hook called when an object is moved by a compacting GC.
     *
     * There may exist weak pointers to an object that are not traced through
     * when the normal trace APIs are used, for example objects in the wrapper
     * cache. This hook allows these pointers to be updated.
     *
     * Note that this hook can be called before JS_NewObject() returns if a GC
     * is triggered during construction of the object. This can happen for
     * global objects for example.
     */
    JSObjectMovedOp objectMovedOp;
};

#define JS_NULL_CLASS_SPEC  {nullptr,nullptr,nullptr,nullptr,nullptr,nullptr}
#define JS_NULL_CLASS_EXT   {nullptr,nullptr,false,nullptr,nullptr}

struct ObjectOps
{
    LookupPropertyOp    lookupProperty;
    DefinePropertyOp    defineProperty;
    HasPropertyOp       hasProperty;
    GetPropertyOp       getProperty;
    SetPropertyOp       setProperty;
    GetOwnPropertyOp    getOwnPropertyDescriptor;
    DeletePropertyOp    deleteProperty;
    WatchOp             watch;
    UnwatchOp           unwatch;
    GetElementsOp       getElements;
    JSNewEnumerateOp    enumerate;
    ObjectOp            thisObject;
};

#define JS_NULL_OBJECT_OPS                                                    \
    {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,  \
     nullptr, nullptr, nullptr, nullptr}

} // namespace js

// Classes, objects, and properties.

typedef void (*JSClassInternal)();

struct JSClass {
    JS_CLASS_MEMBERS(JSFinalizeOp);

    void                *reserved[24];
};

#define JSCLASS_HAS_PRIVATE             (1<<0)  // objects have private slot
#define JSCLASS_PRIVATE_IS_NSISUPPORTS  (1<<3)  // private is (nsISupports *)
#define JSCLASS_IS_DOMJSCLASS           (1<<4)  // objects are DOM
#define JSCLASS_IMPLEMENTS_BARRIERS     (1<<5)  // Correctly implements GC read
                                                // and write barriers
#define JSCLASS_EMULATES_UNDEFINED      (1<<6)  // objects of this class act
                                                // like the value undefined,
                                                // in some contexts
#define JSCLASS_USERBIT1                (1<<7)  // Reserved for embeddings.

// To reserve slots fetched and stored via JS_Get/SetReservedSlot, bitwise-or
// JSCLASS_HAS_RESERVED_SLOTS(n) into the initializer for JSClass.flags, where
// n is a constant in [1, 255].  Reserved slots are indexed from 0 to n-1.
#define JSCLASS_RESERVED_SLOTS_SHIFT    8       // room for 8 flags below */
#define JSCLASS_RESERVED_SLOTS_WIDTH    8       // and 16 above this field */
#define JSCLASS_RESERVED_SLOTS_MASK     JS_BITMASK(JSCLASS_RESERVED_SLOTS_WIDTH)
#define JSCLASS_HAS_RESERVED_SLOTS(n)   (((n) & JSCLASS_RESERVED_SLOTS_MASK)  \
                                         << JSCLASS_RESERVED_SLOTS_SHIFT)
#define JSCLASS_RESERVED_SLOTS(clasp)   (((clasp)->flags                      \
                                          >> JSCLASS_RESERVED_SLOTS_SHIFT)    \
                                         & JSCLASS_RESERVED_SLOTS_MASK)

#define JSCLASS_HIGH_FLAGS_SHIFT        (JSCLASS_RESERVED_SLOTS_SHIFT +       \
                                         JSCLASS_RESERVED_SLOTS_WIDTH)

#define JSCLASS_IS_ANONYMOUS            (1<<(JSCLASS_HIGH_FLAGS_SHIFT+0))
#define JSCLASS_IS_GLOBAL               (1<<(JSCLASS_HIGH_FLAGS_SHIFT+1))
#define JSCLASS_INTERNAL_FLAG2          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+2))
#define JSCLASS_INTERNAL_FLAG3          (1<<(JSCLASS_HIGH_FLAGS_SHIFT+3))

#define JSCLASS_IS_PROXY                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+4))

#define JSCLASS_FINALIZE_FROM_NURSERY   (1<<(JSCLASS_HIGH_FLAGS_SHIFT+5))

// Reserved for embeddings.
#define JSCLASS_USERBIT2                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+6))
#define JSCLASS_USERBIT3                (1<<(JSCLASS_HIGH_FLAGS_SHIFT+7))

#define JSCLASS_BACKGROUND_FINALIZE     (1<<(JSCLASS_HIGH_FLAGS_SHIFT+8))

// Bits 26 through 31 are reserved for the CACHED_PROTO_KEY mechanism, see
// below.

// ECMA-262 requires that most constructors used internally create objects
// with "the original Foo.prototype value" as their [[Prototype]] (__proto__)
// member initial value.  The "original ... value" verbiage is there because
// in ECMA-262, global properties naming class objects are read/write and
// deleteable, for the most part.
//
// Implementing this efficiently requires that global objects have classes
// with the following flags. Failure to use JSCLASS_GLOBAL_FLAGS was
// previously allowed, but is now an ES5 violation and thus unsupported.
//
// JSCLASS_GLOBAL_APPLICATION_SLOTS is the number of slots reserved at
// the beginning of every global object's slots for use by the
// application.
#define JSCLASS_GLOBAL_APPLICATION_SLOTS 4
#define JSCLASS_GLOBAL_SLOT_COUNT      (JSCLASS_GLOBAL_APPLICATION_SLOTS + JSProto_LIMIT * 3 + 31)
#define JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(n)                                    \
    (JSCLASS_IS_GLOBAL | JSCLASS_HAS_RESERVED_SLOTS(JSCLASS_GLOBAL_SLOT_COUNT + (n)))
#define JSCLASS_GLOBAL_FLAGS                                                  \
    JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(0)
#define JSCLASS_HAS_GLOBAL_FLAG_AND_SLOTS(clasp)                              \
  (((clasp)->flags & JSCLASS_IS_GLOBAL)                                       \
   && JSCLASS_RESERVED_SLOTS(clasp) >= JSCLASS_GLOBAL_SLOT_COUNT)

// Fast access to the original value of each standard class's prototype.
#define JSCLASS_CACHED_PROTO_SHIFT      (JSCLASS_HIGH_FLAGS_SHIFT + 10)
#define JSCLASS_CACHED_PROTO_MASK       JS_BITMASK(JSCLASS_CACHED_PROTO_WIDTH)
#define JSCLASS_HAS_CACHED_PROTO(key)   (uint32_t(key) << JSCLASS_CACHED_PROTO_SHIFT)
#define JSCLASS_CACHED_PROTO_KEY(clasp) ((JSProtoKey)                         \
                                         (((clasp)->flags                     \
                                           >> JSCLASS_CACHED_PROTO_SHIFT)     \
                                          & JSCLASS_CACHED_PROTO_MASK))

// Initializer for unused members of statically initialized JSClass structs.
#define JSCLASS_NO_INTERNAL_MEMBERS     {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
#define JSCLASS_NO_OPTIONAL_MEMBERS     0,0,0,0,0,JSCLASS_NO_INTERNAL_MEMBERS

namespace js {

struct Class
{
    JS_CLASS_MEMBERS(FinalizeOp);
    ClassSpec          spec;
    ClassExtension      ext;
    ObjectOps           ops;

    /*
     * Objects of this class aren't native objects. They don't have Shapes that
     * describe their properties and layout. Classes using this flag must
     * provide their own property behavior, either by being proxy classes (do
     * this) or by overriding all the ObjectOps except getElements, watch,
     * unwatch, and thisObject (don't do this).
     */
    static const uint32_t NON_NATIVE = JSCLASS_INTERNAL_FLAG2;

    

    

    

    bool isJSFunction() const {
        return this == js::FunctionClassPtr;
    }

    

    bool isProxy() const {
        return flags & JSCLASS_IS_PROXY;
    }

    

    
};

static_assert(offsetof(JSClass, name) == offsetof(Class, name),
              "Class and JSClass must be consistent");
static_assert(offsetof(JSClass, flags) == offsetof(Class, flags),
              "Class and JSClass must be consistent");
static_assert(offsetof(JSClass, addProperty) == offsetof(Class, addProperty),
              "Class and JSClass must be consistent");
static_assert(offsetof(JSClass, delProperty) == offsetof(Class, delProperty),
              "Class and JSClass must be consistent");
static_assert(offsetof(JSClass, getProperty) == offsetof(Class, getProperty),
              "Class and JSClass must be consistent");
static_assert(offsetof(JSClass, setProperty) == offsetof(Class, setProperty),
              "Class and JSClass must be consistent");
static_assert(sizeof(JSClass) == sizeof(Class),
              "Class and JSClass must be consistent");

static MOZ_ALWAYS_INLINE const JSClass *
Jsvalify(const Class *c)
{
    return (const JSClass *)c;
}

static MOZ_ALWAYS_INLINE const Class *
Valueify(const JSClass *c)
{
    return (const Class *)c;
}

/*
 * Enumeration describing possible values of the [[Class]] internal property
 * value of objects.
 */
enum ESClassValue {
    ESClass_Object, ESClass_Array, ESClass_Number, ESClass_String,
    ESClass_Boolean, ESClass_RegExp, ESClass_ArrayBuffer, ESClass_SharedArrayBuffer,
    ESClass_Date, ESClass_Set, ESClass_Map,

    // Special snowflake for the ES6 IsArray method.
    // Please don't use it without calling that function.
    ESClass_IsArray
};

/*
 * Return whether the given object has the given [[Class]] internal property
 * value. Beware, this query says nothing about the js::Class of the JSObject
 * so the caller must not assume anything about obj's representation (e.g., obj
 * may be a proxy).
 */
;

/* Just a helper that checks v.isObject before calling ObjectClassIs. */
;

/* Fills |vp| with the unboxed value for boxed types, or undefined otherwise. */
inline bool
Unbox(JSContext *cx, JS::HandleObject obj, JS::MutableHandleValue vp);

#ifdef DEBUG
JS_FRIEND_API(bool)
HasObjectMovedOp(JSObject *obj);
#endif
# 737 "../../dist/include/js/Class.h"

}  /* namespace js */

#endif  /* js_Class_h */
# 741 "../../dist/include/js/Class.h"
# 12 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCache.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/Id.h"          // must come before js/RootingAPI.h
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"       // must come before js/RootingAPI.h
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TracingAPI.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCache.h"

namespace mozilla {
namespace dom {
class TabChildGlobal;
class ProcessGlobal;
} // namespace dom
} // namespace mozilla
class SandboxPrivate;
class nsInProcessTabChildGlobal;
class nsWindowRoot;
class XPCWrappedNativeScope;

#define NS_WRAPPERCACHE_IID \
{ 0x6f3179a1, 0x36f7, 0x4a5c, \
  { 0x8c, 0xf1, 0xad, 0xc8, 0x7c, 0xde, 0x3e, 0x87 } }

/**
 * Class to store the wrapper for an object. This can only be used with objects
 * that only have one non-security wrapper at a time (for an XPCWrappedNative
 * this is usually ensured by setting an explicit parent in the PreCreate hook
 * for the class).
 *
 * An instance of nsWrapperCache can be gotten from an object that implements
 * a wrapper cache by calling QueryInterface on it. Note that this breaks XPCOM
 *
 * A compacting GC can move the wrapper object. Pointers to moved objects are
 * usually found and updated by tracing the heap, however non-preserved wrappers
 * are weak references and are not traced, so another approach is
 * necessary. Instead a class hook (objectMovedOp) is provided that is called
 * when an object is moved and is responsible for ensuring pointers are
 * updated. It does this by calling UpdateWrapper() on the wrapper
 * cache. SetWrapper() asserts that the hook is implemented for any wrapper set.
 *
 * A number of the methods are implemented in nsWrapperCacheInlines.h because we
 * have to include some JS headers that don't play nicely with the rest of the
 * codebase. Include nsWrapperCacheInlines.h if you need to call those methods.
 */
class nsWrapperCache
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_WRAPPERCACHE_IID)

  nsWrapperCache() : mWrapper(nullptr), mFlags(0)
  {
  }
  ~nsWrapperCache()
  {
    MOZ_ASSERT(!PreservingWrapper(),
               "Destroying cache with a preserved wrapper!");
  }

  /**
   * Get the cached wrapper.
   *
   * This getter clears the gray bit before handing out the JSObject which means
   * that the object is guaranteed to be kept alive past the next CC.
   */
  JSObject* GetWrapper() const;

  /**
   * Get the cached wrapper.
   *
   * This getter does not change the color of the JSObject meaning that the
   * object returned is not guaranteed to be kept alive past the next CC.
   *
   * This should only be called if you are certain that the return value won't
   * be passed into a JS API function and that it won't be stored without being
   * rooted (or otherwise signaling the stored value to the CC).
   */
  JSObject* GetWrapperPreserveColor() const
  {
    return GetWrapperJSObject();
  }

  void SetWrapper(JSObject* aWrapper)
  {
    MOZ_ASSERT(!PreservingWrapper(), "Clearing a preserved wrapper!");
    MOZ_ASSERT(aWrapper, "Use ClearWrapper!");
    MOZ_ASSERT(js::HasObjectMovedOp(aWrapper),
               "Object has not provided the hook to update the wrapper if it is moved");

    SetWrapperJSObject(aWrapper);
  }

  /**
   * Clear the wrapper. This should be called from the finalizer for the
   * wrapper.
   */
  void ClearWrapper()
  {
    MOZ_ASSERT(!PreservingWrapper(), "Clearing a preserved wrapper!");

    SetWrapperJSObject(nullptr);
  }

  /**
   * Update the wrapper if the object it contains is moved.
   *
   * This method must be called from the objectMovedOp class extension hook for
   * any wrapper cached object.
   */
  void UpdateWrapper(JSObject* aNewObject, const JSObject* aOldObject)
  {
    if (mWrapper) {
      MOZ_ASSERT(mWrapper == aOldObject);
      mWrapper = aNewObject;
    }
  }

  bool PreservingWrapper()
  {
    return HasWrapperFlag(WRAPPER_BIT_PRESERVED);
  }

  bool IsDOMBinding() const
  {
    return !HasWrapperFlag(WRAPPER_IS_NOT_DOM_BINDING);
  }

  /**
   * Wrap the object corresponding to this wrapper cache. If non-null is
   * returned, the object has already been stored in the wrapper cache.
   */
  virtual JSObject* WrapObject(JSContext* cx) = 0;

  /**
   * Returns true if the object has a non-gray wrapper.
   */
  bool IsBlack();

  /**
   * Returns true if the object has a black wrapper,
   * and all the GC things it is keeping alive are black too.
   */
  ;

  bool HasNothingToTrace(nsISupports* aThis);

  // Only meant to be called by code that preserves a wrapper.
  void SetPreservingWrapper(bool aPreserve)
  {
    if(aPreserve) {
      SetWrapperFlags(WRAPPER_BIT_PRESERVED);
    }
    else {
      UnsetWrapperFlags(WRAPPER_BIT_PRESERVED);
    }
  }

  void TraceWrapper(const TraceCallbacks& aCallbacks, void* aClosure)
  {
    if (PreservingWrapper() && mWrapper) {
      aCallbacks.Trace(&mWrapper, "Preserved wrapper", aClosure);
    }
  }

  /*
   * The following methods for getting and manipulating flags allow the unused
   * bits of mFlags to be used by derived classes.
   */

  typedef uint32_t FlagsType;

  

  bool HasFlag(FlagsType aFlag) const
  {
    MOZ_ASSERT((aFlag & kWrapperFlagsMask) == 0, "Bad flag mask");
    return !!(mFlags & aFlag);
  }

  void SetFlags(FlagsType aFlagsToSet)
  {
    MOZ_ASSERT((aFlagsToSet & kWrapperFlagsMask) == 0, "Bad flag mask");
    mFlags |= aFlagsToSet;
  }

  void UnsetFlags(FlagsType aFlagsToUnset)
  {
    MOZ_ASSERT((aFlagsToUnset & kWrapperFlagsMask) == 0, "Bad flag mask");
    mFlags &= ~aFlagsToUnset;
  }

  
  void ReleaseWrapper(void* aScriptObjectHolder);

protected:
  

  

private:
  friend class mozilla::dom::TabChildGlobal;
  friend class mozilla::dom::ProcessGlobal;
  friend class SandboxPrivate;
  friend class nsInProcessTabChildGlobal;
  friend class nsWindowRoot;
  

  JSObject *GetWrapperJSObject() const
  {
    return mWrapper;
  }

  void SetWrapperJSObject(JSObject* aWrapper)
  {
    mWrapper = aWrapper;
    UnsetWrapperFlags(kWrapperFlagsMask & ~WRAPPER_IS_NOT_DOM_BINDING);
  }

  ;

  

  bool HasWrapperFlag(FlagsType aFlag) const
  {
    MOZ_ASSERT((aFlag & ~kWrapperFlagsMask) == 0, "Bad wrapper flag bits");
    return !!(mFlags & aFlag);
  }

  void SetWrapperFlags(FlagsType aFlagsToSet)
  {
    MOZ_ASSERT((aFlagsToSet & ~kWrapperFlagsMask) == 0, "Bad wrapper flag bits");
    mFlags |= aFlagsToSet;
  }

  void UnsetWrapperFlags(FlagsType aFlagsToUnset)
  {
    MOZ_ASSERT((aFlagsToUnset & ~kWrapperFlagsMask) == 0, "Bad wrapper flag bits");
    mFlags &= ~aFlagsToUnset;
  }

  static void HoldJSObjects(void* aScriptObjectHolder,
                            nsScriptObjectTracer* aTracer);

#ifdef DEBUG
  void CheckCCWrapperTraversal(void* aScriptObjectHolder,
                               nsScriptObjectTracer* aTracer);
#endif // DEBUG
# 321 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCache.h"

  /**
   * If this bit is set then we're preserving the wrapper, which in effect ties
   * the lifetime of the JS object stored in the cache to the lifetime of the
   * native object. We rely on the cycle collector to break the cycle that this
   * causes between the native object and the JS object, so it is important that
   * any native object that supports preserving of its wrapper
   * traces/traverses/unlinks the cached JS object (see
   * NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER,
   * NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS and
   * NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER).
   */
  enum { WRAPPER_BIT_PRESERVED = 1 << 0 };

  /**
   * If this bit is set then the wrapper for the native object is not a DOM
   * binding.
   */
  enum { WRAPPER_IS_NOT_DOM_BINDING = 1 << 1 };

  enum { kWrapperFlagsMask = (WRAPPER_BIT_PRESERVED | WRAPPER_IS_NOT_DOM_BINDING) };

  JS::Heap<JSObject*> mWrapper;
  FlagsType           mFlags;
};

enum { WRAPPER_CACHE_FLAGS_BITS_USED = 2 };

NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)

#define NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY                                 \
  if ( aIID.Equals(NS_GET_IID(nsWrapperCache)) ) {                            \
    *aInstancePtr = static_cast<nsWrapperCache*>(this);                       \
    return NS_OK;                                                             \
  }

#define NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY                                   \
  NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY                                       \
  else


// Cycle collector macros for wrapper caches.

#define NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER \
  tmp->TraceWrapper(aCallbacks, aClosure);

#define NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
  tmp->ReleaseWrapper(p);

#define NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class) \
  NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(_class)              \
    NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER        \
  NS_IMPL_CYCLE_COLLECTION_TRACE_END

#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(_class) \
  NS_IMPL_CYCLE_COLLECTION_CLASS(_class)                \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)         \
    NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER   \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_END                   \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class)       \
    NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS    \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                 \
  NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)

#define NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(_class, ...) \
  NS_IMPL_CYCLE_COLLECTION_CLASS(_class)                   \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(_class)            \
    NS_IMPL_CYCLE_COLLECTION_UNLINK(__VA_ARGS__)           \
    NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER      \
  NS_IMPL_CYCLE_COLLECTION_UNLINK_END                      \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class)          \
    NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__)         \
    NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS       \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                    \
  NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)

#endif /* nsWrapperCache_h___ */
# 398 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCache.h"
# 11 "../../dist/include/mozilla/dom/EventTarget.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIAtom.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/EventTarget.h"

class nsIDOMWindow;
class nsIDOMEventListener;

namespace mozilla {

class ErrorResult;
class EventListenerManager;

namespace dom {

class Event;
class EventListener;
class EventHandlerNonNull;
template <class T> struct Nullable;

// IID for the dom::EventTarget interface
#define NS_EVENTTARGET_IID \
{ 0xce3817d0, 0x177b, 0x402f, \
 { 0xae, 0x75, 0xf8, 0x4e, 0xbe, 0x5a, 0x07, 0xc3 } }

class EventTarget : public nsIDOMEventTarget,
                    public nsWrapperCache
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_EVENTTARGET_IID)

  // WebIDL API
  using nsIDOMEventTarget::AddEventListener;
  using nsIDOMEventTarget::RemoveEventListener;
  using nsIDOMEventTarget::DispatchEvent;
  virtual void AddEventListener(const nsAString& aType,
                                EventListener* aCallback,
                                bool aCapture,
                                const Nullable<bool>& aWantsUntrusted,
                                ErrorResult& aRv) = 0;
  virtual void RemoveEventListener(const nsAString& aType,
                                   EventListener* aCallback,
                                   bool aCapture,
                                   ErrorResult& aRv);
  bool DispatchEvent(Event& aEvent, ErrorResult& aRv);

  // Note, this takes the type in onfoo form!
  EventHandlerNonNull* GetEventHandler(const nsAString& aType)
  {
    nsCOMPtr<nsIAtom> type = do_GetAtom(aType);
    return GetEventHandler(type, EmptyString());
  }

  // Note, this takes the type in onfoo form!
  void SetEventHandler(const nsAString& aType, EventHandlerNonNull* aHandler,
                       ErrorResult& rv);

  // Note, for an event 'foo' aType will be 'onfoo'.
  virtual void EventListenerAdded(nsIAtom* aType) {}
  virtual void EventListenerRemoved(nsIAtom* aType) {}

  // Returns an outer window that corresponds to the inner window this event
  // target is associated with.  Will return null if the inner window is not the
  // current inner or if there is no window around at all.
  virtual nsIDOMWindow* GetOwnerGlobal() = 0;

  /**
   * Get the event listener manager, creating it if it does not already exist.
   */
  virtual EventListenerManager* GetOrCreateListenerManager() = 0;

  /**
   * Get the event listener manager, returning null if it does not already
   * exist.
   */
  virtual EventListenerManager* GetExistingListenerManager() const = 0;

protected:
  EventHandlerNonNull* GetEventHandler(nsIAtom* aType,
                                       const nsAString& aTypeString);
  void SetEventHandler(nsIAtom* aType, const nsAString& aTypeString,
                       EventHandlerNonNull* aHandler);
};

NS_DEFINE_STATIC_IID_ACCESSOR(EventTarget, NS_EVENTTARGET_IID)

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_EventTarget_h_
# 98 "../../dist/include/mozilla/dom/EventTarget.h"
# 21 "/Users/luser/build/mozilla-central/dom/base/nsINode.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"     // for Handle, Value, JSObject, JSContext
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMString.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 24 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"

// Including 'windows.h' will #define GetClassInfo to something else.
#ifdef XP_WIN
#ifdef GetClassInfo
#undef GetClassInfo
#endif
# 30 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
#endif
# 31 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"

class nsAttrAndChildArray;
class nsChildContentList;
struct nsCSSSelectorList;
class nsDOMAttributeMap;
class nsIContent;
class nsIDocument;
class nsIDOMElement;
class nsIDOMNodeList;
class nsIEditor;
class nsIFrame;
class nsIMutationObserver;
class nsINodeList;
class nsIPresShell;
class nsIPrincipal;
class nsIURI;
class nsNodeSupportsWeakRefTearoff;
class nsNodeWeakReference;
class nsXPCClassInfo;
class nsDOMMutationObserver;

namespace mozilla {
class EventListenerManager;
namespace dom {
/**
 * @return true if aChar is what the DOM spec defines as 'space character'.
 * http://dom.spec.whatwg.org/#space-character
 */
inline bool IsSpaceCharacter(char16_t aChar) {
  return aChar == ' ' || aChar == '\t' || aChar == '\n' || aChar == '\r' ||
         aChar == '\f';
}
inline bool IsSpaceCharacter(char aChar) {
  return aChar == ' ' || aChar == '\t' || aChar == '\n' || aChar == '\r' ||
         aChar == '\f';
}
struct BoxQuadOptions;
struct ConvertCoordinateOptions;
class DOMPoint;
class DOMQuad;
class DOMRectReadOnly;
class Element;
class EventHandlerNonNull;
class OnErrorEventHandlerNonNull;
template<typename T> class Optional;
class Text;
class TextOrElementOrDocument;
struct DOMPointInit;
} // namespace dom
} // namespace mozilla

#define NODE_FLAG_BIT(n_) \
  (nsWrapperCache::FlagsType(1U) << (WRAPPER_CACHE_FLAGS_BITS_USED + (n_)))

enum {
  // This bit will be set if the node has a listener manager.
  NODE_HAS_LISTENERMANAGER =              NODE_FLAG_BIT(0),

  // Whether this node has had any properties set on it
  NODE_HAS_PROPERTIES =                   NODE_FLAG_BIT(1),

  // Whether this node is the root of an anonymous subtree.  Note that this
  // need not be a native anonymous subtree.  Any anonymous subtree, including
  // XBL-generated ones, will do.  This flag is set-once: once a node has it,
  // it must not be removed.
  // NOTE: Should only be used on nsIContent nodes
  NODE_IS_ANONYMOUS_ROOT =                NODE_FLAG_BIT(2),

  // Whether the node has some ancestor, possibly itself, that is native
  // anonymous.  This includes ancestors crossing XBL scopes, in cases when an
  // XBL binding is attached to an element which has a native anonymous
  // ancestor.  This flag is set-once: once a node has it, it must not be
  // removed.
  // NOTE: Should only be used on nsIContent nodes
  NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE =          NODE_FLAG_BIT(3),

  // Whether this node is the root of a native anonymous (from the perspective
  // of its parent) subtree.  This flag is set-once: once a node has it, it
  // must not be removed.
  // NOTE: Should only be used on nsIContent nodes
  NODE_IS_NATIVE_ANONYMOUS_ROOT =         NODE_FLAG_BIT(4),

  // Forces the XBL code to treat this node as if it were
  // in the document and therefore should get bindings attached.
  NODE_FORCE_XBL_BINDINGS =               NODE_FLAG_BIT(5),

  // Whether a binding manager may have a pointer to this
  NODE_MAY_BE_IN_BINDING_MNGR =           NODE_FLAG_BIT(6),

  NODE_IS_EDITABLE =                      NODE_FLAG_BIT(7),

  // For all Element nodes, NODE_MAY_HAVE_CLASS is guaranteed to be set if the
  // node in fact has a class, but may be set even if it doesn't.
  NODE_MAY_HAVE_CLASS =                   NODE_FLAG_BIT(8),

  // Whether the node participates in a shadow tree.
  NODE_IS_IN_SHADOW_TREE =                NODE_FLAG_BIT(9),

  // Node has an :empty or :-moz-only-whitespace selector
  NODE_HAS_EMPTY_SELECTOR =               NODE_FLAG_BIT(10),

  // A child of the node has a selector such that any insertion,
  // removal, or appending of children requires restyling the parent.
  NODE_HAS_SLOW_SELECTOR =                NODE_FLAG_BIT(11),

  // A child of the node has a :first-child, :-moz-first-node,
  // :only-child, :last-child or :-moz-last-node selector.
  NODE_HAS_EDGE_CHILD_SELECTOR =          NODE_FLAG_BIT(12),

  // A child of the node has a selector such that any insertion or
  // removal of children requires restyling later siblings of that
  // element.  Additionally (in this manner it is stronger than
  // NODE_HAS_SLOW_SELECTOR), if a child's style changes due to any
  // other content tree changes (e.g., the child changes to or from
  // matching :empty due to a grandchild insertion or removal), the
  // child's later siblings must also be restyled.
  NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS = NODE_FLAG_BIT(13),

  NODE_ALL_SELECTOR_FLAGS =               NODE_HAS_EMPTY_SELECTOR |
                                          NODE_HAS_SLOW_SELECTOR |
                                          NODE_HAS_EDGE_CHILD_SELECTOR |
                                          NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS,

  // This node needs to go through frame construction to get a frame (or
  // undisplayed entry).
  NODE_NEEDS_FRAME =                      NODE_FLAG_BIT(14),

  // At least one descendant in the flattened tree has NODE_NEEDS_FRAME set.
  // This should be set on every node on the flattened tree path between the
  // node(s) with NODE_NEEDS_FRAME and the root content.
  NODE_DESCENDANTS_NEED_FRAMES =          NODE_FLAG_BIT(15),

  // Set if the node has the accesskey attribute set.
  NODE_HAS_ACCESSKEY =                    NODE_FLAG_BIT(16),

  // Set if the node has right-to-left directionality
  NODE_HAS_DIRECTION_RTL =                NODE_FLAG_BIT(17),

  // Set if the node has left-to-right directionality
  NODE_HAS_DIRECTION_LTR =                NODE_FLAG_BIT(18),

  NODE_ALL_DIRECTION_FLAGS =              NODE_HAS_DIRECTION_LTR |
                                          NODE_HAS_DIRECTION_RTL,

  NODE_CHROME_ONLY_ACCESS =               NODE_FLAG_BIT(19),

  NODE_IS_ROOT_OF_CHROME_ONLY_ACCESS =    NODE_FLAG_BIT(20),

  // Remaining bits are node type specific.
  NODE_TYPE_SPECIFIC_BITS_OFFSET =        21
};

// Make sure we have space for our bits
#define ASSERT_NODE_FLAGS_SPACE(n) \
  static_assert(WRAPPER_CACHE_FLAGS_BITS_USED + (n) <=                          \
                  sizeof(nsWrapperCache::FlagsType) * 8,                        \
                "Not enough space for our bits")
ASSERT_NODE_FLAGS_SPACE(NODE_TYPE_SPECIFIC_BITS_OFFSET);

/**
 * Class used to detect unexpected mutations. To use the class create an
 * nsMutationGuard on the stack before unexpected mutations could occur.
 * You can then at any time call Mutated to check if any unexpected mutations
 * have occurred.
 */
class nsMutationGuard {
public:
  // This is the value sGeneration had when the guard was constructed.
  uint64_t mStartingGeneration;

  // This value is incremented on every mutation, for the life of the process.
  static uint64_t sGeneration;
};

// This should be used for any nsINode sub-class that has fields of its own
// that it needs to measure;  any sub-class that doesn't use it will inherit
// SizeOfExcludingThis from its super-class.  SizeOfIncludingThis() need not be
// defined, it is inherited from nsINode.
// This macro isn't actually specific to nodes, and bug 956400 will move it into MFBT.
#define NS_DECL_SIZEOF_EXCLUDING_THIS \
  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;

// Categories of node properties
// 0 is global.
#define DOM_USER_DATA         1
#define SMIL_MAPPED_ATTR_ANIMVAL 2

// IID for the nsINode interface
#define NS_INODE_IID \
{ 0xe8fdd227, 0x27da, 0x46ee, \
  { 0xbe, 0xf3, 0x1a, 0xef, 0x5a, 0x8f, 0xc5, 0xb4 } }

/**
 * An internal interface that abstracts some DOMNode-related parts that both
 * nsIContent and nsIDocument share.  An instance of this interface has a list
 * of nsIContent children and provides access to them.
 */
class nsINode : public mozilla::dom::EventTarget
{
public:
  typedef mozilla::dom::BoxQuadOptions BoxQuadOptions;
  typedef mozilla::dom::ConvertCoordinateOptions ConvertCoordinateOptions;
  typedef mozilla::dom::DOMPoint DOMPoint;
  typedef mozilla::dom::DOMPointInit DOMPointInit;
  typedef mozilla::dom::DOMQuad DOMQuad;
  typedef mozilla::dom::DOMRectReadOnly DOMRectReadOnly;
  typedef mozilla::dom::TextOrElementOrDocument TextOrElementOrDocument;
  typedef mozilla::ErrorResult ErrorResult;

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_INODE_IID)

  // Among the sub-classes that inherit (directly or indirectly) from nsINode,
  // measurement of the following members may be added later if DMD finds it is
  // worthwhile:
  // - nsGenericHTMLElement:  mForm, mFieldSet
  // - nsGenericHTMLFrameElement: mFrameLoader (bug 672539)
  // - nsIContent: mPrimaryFrame, because it's non-owning and measured elsewhere
  //
  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

  // SizeOfIncludingThis doesn't need to be overridden by sub-classes because
  // sub-classes of nsINode are guaranteed to be laid out in memory in such a
  // way that |this| points to the start of the allocated object, even in
  // methods of nsINode's sub-classes, and so |aMallocSizeOf(this)| is always
  // safe to call no matter which object it was invoked on.
  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
  }

  friend class nsNodeUtils;
  friend class nsNodeWeakReference;
  friend class nsNodeSupportsWeakRefTearoff;
  friend class nsAttrAndChildArray;

#ifdef MOZILLA_INTERNAL_API
  explicit nsINode(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
  : mNodeInfo(aNodeInfo),
    mParent(nullptr),
    mBoolFlags(0),
    mNextSibling(nullptr),
    mPreviousSibling(nullptr),
    mFirstChild(nullptr),
    mSubtreeRoot(this),
    mSlots(nullptr)
  {
  }
#endif
# 325 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"

  virtual ~nsINode();

  /**
   * Bit-flags to pass (or'ed together) to IsNodeOfType()
   */
  enum {
    /** nsIContent nodes */
    eCONTENT             = 1 << 0,
    /** nsIDocument nodes */
    eDOCUMENT            = 1 << 1,
    /** nsIAttribute nodes */
    eATTRIBUTE           = 1 << 2,
    /** text nodes */
    eTEXT                = 1 << 3,
    /** xml processing instructions */
    ePROCESSING_INSTRUCTION = 1 << 4,
    /** comment nodes */
    eCOMMENT             = 1 << 5,
    /** form control elements */
    eHTML_FORM_CONTROL   = 1 << 6,
    /** document fragments */
    eDOCUMENT_FRAGMENT   = 1 << 7,
    /** data nodes (comments, PIs, text). Nodes of this type always
     returns a non-null value for nsIContent::GetText() */
    eDATA_NODE           = 1 << 8,
    /** HTMLMediaElement */
    eMEDIA               = 1 << 9,
    /** animation elements */
    eANIMATION           = 1 << 10,
    /** filter elements that implement SVGFilterPrimitiveStandardAttributes */
    eFILTER              = 1 << 11
  };

  /**
   * API for doing a quick check if a content is of a given
   * type, such as Text, Document, Comment ...  Use this when you can instead of
   * checking the tag.
   *
   * @param aFlags what types you want to test for (see above)
   * @return whether the content matches ALL flags passed in
   */
  virtual bool IsNodeOfType(uint32_t aFlags) const = 0;

  virtual JSObject* WrapObject(JSContext *aCx) MOZ_OVERRIDE;

  /**
   * returns true if we are in priviliged code or
   * layout.css.getBoxQuads.enabled == true.
   */
  static bool HasBoxQuadsSupport(JSContext* aCx, JSObject* /* unused */);

protected:
  /**
   * WrapNode is called from WrapObject to actually wrap this node, WrapObject
   * does some additional checks and fix-up that's common to all nodes. WrapNode
   * should just call the DOM binding's Wrap function.
   */
  virtual JSObject* WrapNode(JSContext *aCx) = 0;

public:
  mozilla::dom::ParentObject GetParentObject() const; // Implemented in nsIDocument.h

  /**
   * Return the scope chain parent for this node, for use in things
   * like event handler compilation.  Returning null means to use the
   * global object as the scope chain parent.
   */
  virtual nsINode* GetScopeChainParent() const;

  /**
   * Return whether the node is an Element node
   */
  bool IsElement() const {
    return GetBoolFlag(NodeIsElement);
  }

  /**
   * Return this node as an Element.  Should only be used for nodes
   * for which IsElement() is true.  This is defined inline in Element.h.
   */
  mozilla::dom::Element* AsElement();
  const mozilla::dom::Element* AsElement() const;

  /**
   * Return this node as nsIContent.  Should only be used for nodes for which
   * IsContent() is true.  This is defined inline in nsIContent.h.
   */
  nsIContent* AsContent();
  const nsIContent* AsContent() const
  {
    return const_cast<nsINode*>(this)->AsContent();
  }

  /**
   * Return this node as Text if it is one, otherwise null.  This is defined
   * inline in Text.h.
   */
  mozilla::dom::Text* GetAsText();
  const mozilla::dom::Text* GetAsText() const;

  virtual nsIDOMNode* AsDOMNode() = 0;

  /**
   * Return if this node has any children.
   */
  bool HasChildren() const { return !!mFirstChild; }

  /**
   * Get the number of children
   * @return the number of children
   */
  virtual uint32_t GetChildCount() const = 0;

  /**
   * Get a child by index
   * @param aIndex the index of the child to get
   * @return the child, or null if index out of bounds
   */
  virtual nsIContent* GetChildAt(uint32_t aIndex) const = 0;

  /**
   * Get a raw pointer to the child array.  This should only be used if you
   * plan to walk a bunch of the kids, promise to make sure that nothing ever
   * mutates (no attribute changes, not DOM tree changes, no script execution,
   * NOTHING), and will never ever peform an out-of-bounds access here.  This
   * method may return null if there are no children, or it may return a
   * garbage pointer.  In all cases the out param will be set to the number of
   * children.
   */
  virtual nsIContent * const * GetChildArray(uint32_t* aChildCount) const = 0;

  /**
   * Get the index of a child within this content
   * @param aPossibleChild the child to get the index of.
   * @return the index of the child, or -1 if not a child
   *
   * If the return value is not -1, then calling GetChildAt() with that value
   * will return aPossibleChild.
   */
  virtual int32_t IndexOf(const nsINode* aPossibleChild) const = 0;

  /**
   * Return the "owner document" of this node.  Note that this is not the same
   * as the DOM ownerDocument -- that's null for Document nodes, whereas for a
   * nsIDocument GetOwnerDocument returns the document itself.  For nsIContent
   * implementations the two are the same.
   */
  nsIDocument *OwnerDoc() const
  {
    return mNodeInfo->GetDocument();
  }

  /**
   * Return the "owner document" of this node as an nsINode*.  Implemented
   * in nsIDocument.h.
   */
  nsINode *OwnerDocAsNode() const;

  /**
   * Returns true if the content has an ancestor that is a document.
   *
   * @return whether this content is in a document tree
   */
  bool IsInUncomposedDoc() const
  {
    return GetBoolFlag(IsInDocument);
  }

  /**
   * @deprecated
   */
  bool IsInDoc() const
  {
    return IsInUncomposedDoc();
  }

  /**
   * The values returned by this function are the ones defined for
   * nsIDOMNode.nodeType
   */
  uint16_t NodeType() const
  {
    return mNodeInfo->NodeType();
  }
  const nsString& NodeName() const
  {
    return mNodeInfo->NodeName();
  }
  const nsString& LocalName() const
  {
    return mNodeInfo->LocalName();
  }

  /**
   * Get the NodeInfo for this element
   * @return the nodes node info
   */
  inline mozilla::dom::NodeInfo* NodeInfo() const
  {
    return mNodeInfo;
  }

  inline bool IsInNamespace(int32_t aNamespace) const
  {
    return mNodeInfo->NamespaceID() == aNamespace;
  }

protected:
  // These 2 methods are useful for the recursive templates IsHTMLElement,
  // IsSVGElement, etc.
  inline bool IsNodeInternal() const
  {
    return false;
  }

  template<typename First, typename... Args>
  inline bool IsNodeInternal(First aFirst, Args... aArgs) const
  {
    return mNodeInfo->Equals(aFirst) || IsNodeInternal(aArgs...);
  }

public:
  inline bool IsHTMLElement() const
  {
    return IsElement() && IsInNamespace(kNameSpaceID_XHTML);
  }


  

  /**
   * Insert a content node at a particular index.  This method handles calling
   * BindToTree on the child appropriately.
   *
   * @param aKid the content to insert
   * @param aIndex the index it is being inserted at (the index it will have
   *        after it is inserted)
   * @param aNotify whether to notify the document (current document for
   *        nsIContent, and |this| for nsIDocument) that the insert has
   *        occurred
   *
   * @throws NS_ERROR_DOM_HIERARCHY_REQUEST_ERR if one attempts to have more
   * than one element node as a child of a document.  Doing this will also
   * assert -- you shouldn't be doing it!  Check with
   * nsIDocument::GetRootElement() first if you're not sure.  Apart from this
   * one constraint, this doesn't do any checking on whether aKid is a valid
   * child of |this|.
   *
   * @throws NS_ERROR_OUT_OF_MEMORY in some cases (from BindToTree).
   */
  virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
                                 bool aNotify) = 0;

  /**
   * Append a content node to the end of the child list.  This method handles
  
  
  /**
   * Remove a child from this node.  This method handles calling UnbindFromTree
   * on the child appropriately.
   *
   * @param aIndex the index of the child to remove
   * @param aNotify whether to notify the document (current document for
   *        nsIContent, and |this| for nsIDocument) that the remove has
   *        occurred
   *
   * Note: If there is no child at aIndex, this method will simply do nothing.
   */
  virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) = 0;

  /**
   * Get a property associated with this node.
   *
   * @param aPropertyName  name of property to get.
   * @param aStatus        out parameter for storing resulting status.
   *                       Set to NS_PROPTABLE_PROP_NOT_THERE if the property
   *                       is not set.
   * @return               the property. Null if the property is not set
   *                       (though a null return value does not imply the
   *                       property was not set, i.e. it can be set to null).
   */
  void* GetProperty(nsIAtom *aPropertyName,
                    nsresult *aStatus = nullptr) const
  {
    return GetProperty(0, aPropertyName, aStatus);
  }

  /**
   * Get a property associated with this node.
   *
   * @param aCategory      category of property to get.
   * @param aPropertyName  name of property to get.
   * @param aStatus        out parameter for storing resulting status.
   *                       Set to NS_PROPTABLE_PROP_NOT_THERE if the property
   *                       is not set.
   * @return               the property. Null if the property is not set
   *                       (though a null return value does not imply the
   *                       property was not set, i.e. it can be set to null).
   */
  virtual void* GetProperty(uint16_t aCategory,
                            nsIAtom *aPropertyName,
                            nsresult *aStatus = nullptr) const;

  /**
   */
  nsIPrincipal* NodePrincipal() const {
    return mNodeInfo->NodeInfoManager()->DocumentPrincipal();
  }

  /**
   * Get the parent nsIContent for this node.
   * @return the parent, or null if no parent or the parent is not an nsIContent
   */
  nsIContent* GetParent() const {
    return MOZ_LIKELY(GetBoolFlag(ParentIsContent)) ?
      reinterpret_cast<nsIContent*>(mParent) : nullptr;
  }

  /**
   * Get the parent nsINode for this node. This can be either an nsIContent,
   * an nsIDocument or an nsIAttribute.
   * @return the parent node
   */
  nsINode* GetParentNode() const
  {
    return mParent;
  }
  
  /**
   * Get the parent nsINode for this node if it is an Element.
   * @return the parent node
   */
  mozilla::dom::Element* GetParentElement() const
  {
    return mParent && mParent->IsElement() ? mParent->AsElement() : nullptr;
  }

  /**
   * Get the parent Element of this node, traversing over a ShadowRoot
   * to its host if necessary.
   */
  mozilla::dom::Element* GetParentElementCrossingShadowRoot() const;

  /**
   * Get the root of the subtree this node belongs to.  This never returns
      s->mMutationObservers.RemoveElement(aMutationObserver);
    }
  }

  /**
   * Clones this node. This needs to be overriden by all node classes. aNodeInfo
   * should be identical to this node's nodeInfo, except for the document which
   * may be different. When cloning an element, all attributes of the element
   * will be cloned. The children of the node will not be cloned.
   *
   * @param aNodeInfo the nodeinfo to use for the clone
   * @param aResult the clone
   */
  virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const = 0;

  // This class can be extended by subclasses that wish to store more
  // information in the slots.
  class nsSlots
  {
  public:
    nsSlots()
      : mChildNodes(nullptr),
        mWeakReference(nullptr)
    {
    }

    // If needed we could remove the vtable pointer this dtor causes by
    // putting a DestroySlots function on nsINode
    virtual ~nsSlots();

    void Traverse(nsCycleCollectionTraversalCallback &cb);
    ;

    /**
     * A list of mutation observers
     */
    nsTObserverArray<nsIMutationObserver*> mMutationObservers;

    /**
     * An object implementing nsIDOMNodeList for this content (childNodes)
     * @see nsIDOMNodeList
     * @see nsGenericHTMLElement::GetChildNodes
     *
     * MSVC 7 doesn't like this as an nsRefPtr
     */
    nsChildContentList* mChildNodes;

    /**
     * Weak reference to this node
     */
    nsNodeWeakReference* mWeakReference;
  };

  /**

  

  

  /**
   * Returns true if |this| or any of its ancestors is native anonymous.
   */
  bool IsInNativeAnonymousSubtree() const
  {
#ifdef DEBUG
    if (HasFlag(NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE)) {
      return true;
    }
    CheckNotNativeAnonymous();
    return false;
#else
# 1095 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
    return HasFlag(NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE);
#endif
# 1097 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
  }

  bool IsInAnonymousSubtree() const;

  // Note: This asserts |IsInAnonymousSubtree()|.
  bool IsAnonymousContentInSVGUseSubtree() const;

  // True for native anonymous content and for XBL content if the binding
  // has chromeOnlyContent="true".
  

  bool IsInShadowTree() const
  {
    return HasFlag(NODE_IS_IN_SHADOW_TREE);
  }

  /**
   * Returns true if |this| node is the common ancestor of the start/end
   * nodes of a Range in a Selection or a descendant of such a common ancestor.
   * This node is definitely not selected when |false| is returned, but it may
   * or may not be selected when |true| is returned.
   */
  

  /**
   * Get the root content of an editor. So, this node must be a descendant of
   * an editor. Note that this should be only used for getting input or textarea
   * editor's root content. This method doesn't support HTML editors.
   */
  ;

  /**
   * Get the nearest selection root, ie. the node that will be selected if the
   * user does "Select All" while the focus is in this node. Note that if this
   * node is not in an editor, the result comes from the nsFrameSelection that
   * is related to aPresShell, so the result might not be the ancestor of this
   * node. Be aware that if this node and the computed selection limiter are
   * not in same subtree, this returns the root content of the closeset subtree.
   */
  ;

  virtual nsINodeList* ChildNodes();
  nsIContent* GetFirstChild() const { return mFirstChild; }
  nsIContent* GetLastChild() const
  {
    uint32_t count;
    nsIContent* const* children = GetChildArray(&count);

    return count > 0 ? children[count - 1] : nullptr;
  }

  /**
   * Implementation is in nsIDocument.h, because it needs to cast from
   * nsIDocument* to nsINode*.
   */
  ;

  void Normalize();

  /**
   * Get the base URI for any relative URIs within this piece of
   * content. Generally, this is the document's base URI, but certain
   * content carries a local base for backward compatibility, and XML
   * supports setting a per-node base URI.
   *
   * @return the base URI
   */
  virtual already_AddRefed<nsIURI> GetBaseURI(bool aTryUseXHRDocBaseURI = false) const = 0;
  already_AddRefed<nsIURI> GetBaseURIObject() const;

  /**
   * Facility for explicitly setting a base URI on a node.
   */
  nsresult SetExplicitBaseURI(nsIURI* aURI);
  /**
   * The explicit base URI, if set, otherwise null
   */
protected:
  nsIURI* GetExplicitBaseURI() const {
    if (HasExplicitBaseURI()) {
      return static_cast<nsIURI*>(GetProperty(nsGkAtoms::baseURIProperty));
    }
    return nullptr;
  }
  
public:
  void GetTextContent(nsAString& aTextContent,
                      mozilla::ErrorResult& aError)
  {
    GetTextContentInternal(aTextContent, aError);
  }
  void SetTextContent(const nsAString& aTextContent,
                      mozilla::ErrorResult& aError)
  {
    SetTextContentInternal(aTextContent, aError);
  }

  mozilla::dom::Element* QuerySelector(const nsAString& aSelector,
                                       mozilla::ErrorResult& aResult);
  already_AddRefed<nsINodeList> QuerySelectorAll(const nsAString& aSelector,
                                                 mozilla::ErrorResult& aResult);

  nsresult QuerySelector(const nsAString& aSelector, nsIDOMElement **aReturn);
  nsresult QuerySelectorAll(const nsAString& aSelector, nsIDOMNodeList **aReturn);

protected:
  // nsIDocument overrides this with its own (faster) version.  This
  nsresult SetUserData(const nsAString& aKey, nsIVariant* aData,
                       nsIVariant** aResult);

  /**
   * Get the UserData object registered for a Key on this node, if any.
   * Should only be used to implement the DOM Level 3 UserData API.
   *
   * @param aKey the key to get UserData for
   * @return aResult the previously registered object for aKey on this node, if
   *                 any
   */
  nsIVariant* GetUserData(const nsAString& aKey);

  nsresult GetUserData(const nsAString& aKey, nsIVariant** aResult)
  {
    NS_IF_ADDREF(*aResult = GetUserData(aKey));
  
    return NS_OK;
  }

  void LookupPrefix(const nsAString& aNamespace, nsAString& aResult);
  bool IsDefaultNamespace(const nsAString& aNamespaceURI)
  {
    nsAutoString defaultNamespace;
    LookupNamespaceURI(EmptyString(), defaultNamespace);
    return aNamespaceURI.Equals(defaultNamespace);
  }
  void LookupNamespaceURI(const nsAString& aNamespacePrefix,
                          nsAString& aNamespaceURI);

  nsresult IsEqualNode(nsIDOMNode* aOther, bool* aReturn);

  nsIContent* GetNextSibling() const { return mNextSibling; }
  nsIContent* GetPreviousSibling() const { return mPreviousSibling; }

  /**
   * Get the next node in the pre-order tree traversal of the DOM.  If
   * aRoot is non-null, then it must be an ancestor of |this|
   * (possibly equal to |this|) and only nodes that are descendants of
   * aRoot, not including aRoot itself, will be returned.  Returns
   * null if there are no more nodes to traverse.
   */
  nsIContent* GetNextNode(const nsINode* aRoot = nullptr) const
  {
    return GetNextNodeImpl(aRoot, false);
  }

  /**
   * Get the next node in the pre-order tree traversal of the DOM but ignoring
   * the children of this node.  If aRoot is non-null, then it must be an
   * ancestor of |this| (possibly equal to |this|) and only nodes that are
   * descendants of aRoot, not including aRoot itself, will be returned.
   * Returns null if there are no more nodes to traverse.
   */
  nsIContent* GetNextNonChildNode(const nsINode* aRoot = nullptr) const
  {
    return GetNextNodeImpl(aRoot, true);
  }

  /**
   * Returns true if 'this' is either document or element or
   * document fragment and aOther is a descendant in the same
   * anonymous tree.
   */
  bool Contains(const nsINode* aOther) const;
  nsresult Contains(nsIDOMNode* aOther, bool* aReturn);

  bool UnoptimizableCCNode() const;

private:

  nsIDocument* GetComposedDocInternal() const;

  nsIContent* GetNextNodeImpl(const nsINode* aRoot,
                              const bool aSkipChildren) const
  {
    // Can't use nsContentUtils::ContentIsDescendantOf here, since we
    // can't include it here.
#ifdef DEBUG
    if (aRoot) {
      const nsINode* cur = this;
      for (; cur; cur = cur->GetParentNode())
        if (cur == aRoot) break;
      NS_ASSERTION(cur, "aRoot not an ancestor of |this|?");
    }
#endif
# 1313 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
    if (!aSkipChildren) {
      nsIContent* kid = GetFirstChild();
      if (kid) {
        return kid;
      }
    }
    if (this == aRoot) {
      return nullptr;
    }
    const nsINode* cur = this;
    while (1) {
      nsIContent* next = cur->GetNextSibling();
      if (next) {
        return next;
      }
      nsINode* parent = cur->GetParentNode();
      if (parent == aRoot) {
        return nullptr;
      }
      cur = parent;
    }
    NS_NOTREACHED("How did we get here?");
  }

public:

  /**
   * Get the previous nsIContent in the pre-order tree traversal of the DOM.  If
   * aRoot is non-null, then it must be an ancestor of |this|
   * (possibly equal to |this|) and only nsIContents that are descendants of
   * aRoot, including aRoot itself, will be returned.  Returns
   * null if there are no more nsIContents to traverse.
   */
  nsIContent* GetPreviousContent(const nsINode* aRoot = nullptr) const
  {
      // Can't use nsContentUtils::ContentIsDescendantOf here, since we
      // can't include it here.
#ifdef DEBUG
      if (aRoot) {
        const nsINode* cur = this;
        for (; cur; cur = cur->GetParentNode())
          if (cur == aRoot) break;
        NS_ASSERTION(cur, "aRoot not an ancestor of |this|?");
      }
#endif
# 1358 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"

    if (this == aRoot) {
      return nullptr;
    }
    nsIContent* cur = this->GetParent();
    nsIContent* iter = this->GetPreviousSibling();
    while (iter) {
      cur = iter;
      iter = reinterpret_cast<nsINode*>(iter)->GetLastChild();
    }
    return cur;
  }

  /**
   * Boolean flags
   */
private:
  enum BooleanFlag {
    // Set if we're being used from -moz-element
    NodeHasRenderingObservers,
    // Set if our parent chain (including this node itself) terminates
    // in a document
    IsInDocument,
    // Set if mParent is an nsIContent
    ParentIsContent,
    // Set if this node is an Element
    NodeIsElement,
    // Set if the element has a non-empty id attribute. This can in rare
    // cases lie for nsXMLElement, such as when the node has been moved between
    // documents with different id mappings.
    ElementHasID,
    // Set if the element might have inline style.
    ElementMayHaveStyle,
    // Set if the element has a name attribute set.
    ElementHasName,
    // Set if the element might have a contenteditable attribute set.
    ElementMayHaveContentEditableAttr,
    // Set if the node is the common ancestor of the start/end nodes of a Range
    // that is in a Selection.
    NodeIsCommonAncestorForRangeInSelection,
    // Set if the node is a descendant of a node with the above bit set.
    NodeIsDescendantOfCommonAncestorForRangeInSelection,
    // Set if CanSkipInCC check has been done for this subtree root.
    NodeIsCCMarkedRoot,
    // Maybe set if this node is in black subtree.
    NodeIsCCBlackTree,
    // Maybe set if the node is a root of a subtree 
    // which needs to be kept in the purple buffer.
    NodeIsPurpleRoot,
    // Set if the node has an explicit base URI stored
    NodeHasExplicitBaseURI,
    // Set if the element has some style states locked
    ElementHasLockedStyleStates,
    // Set if element has pointer locked
    ElementHasPointerLock,
    // Set if the node may have DOMMutationObserver attached to it.
    NodeMayHaveDOMMutationObserver,
    // Set if node is Content
    NodeIsContent,
    NodeAncestorHasDirAuto,
    // Set if the element is in the scope of a scoped style sheet; this flag is
    // only accurate for elements bound to a document
    ElementIsInStyleScope,
    // Set if the element is a scoped style sheet root
    ElementIsScopedStyleRoot,
    // Set if the node is handling a click.
    NodeHandlingClick,
    // Set if the node has had :hover selectors matched against it
    NodeHasRelevantHoverRules,
    // Set if the element has a parser insertion mode other than "in body",
    // per the HTML5 "Parse state" section.
    ElementHasWeirdParserInsertionMode,
    // Parser sets this flag if it has notified about the node.
    ParserHasNotified,
    // Guard value
    BooleanFlagCount
  };

  void SetBoolFlag(BooleanFlag name, bool value) {
    static_assert(BooleanFlagCount <= 8*sizeof(mBoolFlags),
                  "Too many boolean flags");
    mBoolFlags = (mBoolFlags & ~(1 << name)) | (value << name);
  }

  void SetBoolFlag(BooleanFlag name) {
    static_assert(BooleanFlagCount <= 8*sizeof(mBoolFlags),
                  "Too many boolean flags");
    mBoolFlags |= (1 << name);
  }

  void ClearBoolFlag(BooleanFlag name) {
    static_assert(BooleanFlagCount <= 8*sizeof(mBoolFlags),
                  "Too many boolean flags");
    mBoolFlags &= ~(1 << name);
  }

  bool GetBoolFlag(BooleanFlag name) const {
    static_assert(BooleanFlagCount <= 8*sizeof(mBoolFlags),
                  "Too many boolean flags");
    return mBoolFlags & (1 << name);
  }

public:
  bool HasRenderingObservers() const
    { return GetBoolFlag(NodeHasRenderingObservers); }
  void SetHasRenderingObservers(bool aValue)
    { SetBoolFlag(NodeHasRenderingObservers, aValue); }
  bool IsContent() const { return GetBoolFlag(NodeIsContent); }
  bool HasID() const { return GetBoolFlag(ElementHasID); }
  bool MayHaveStyle() const { return GetBoolFlag(ElementMayHaveStyle); }
  bool HasName() const { return GetBoolFlag(ElementHasName); }
  bool MayHaveContentEditableAttr() const
    { return GetBoolFlag(ElementMayHaveContentEditableAttr); }
  bool IsCommonAncestorForRangeInSelection() const
    { return GetBoolFlag(NodeIsCommonAncestorForRangeInSelection); }
  void SetCommonAncestorForRangeInSelection()
    { SetBoolFlag(NodeIsCommonAncestorForRangeInSelection); }
  void ClearCommonAncestorForRangeInSelection()
    { ClearBoolFlag(NodeIsCommonAncestorForRangeInSelection); }
  bool IsDescendantOfCommonAncestorForRangeInSelection() const
    { return GetBoolFlag(NodeIsDescendantOfCommonAncestorForRangeInSelection); }
  
  
  void SetHasRelevantHoverRules() { SetBoolFlag(NodeHasRelevantHoverRules); }
  void SetParserHasNotified() { SetBoolFlag(ParserHasNotified); };
  bool HasParserNotified() { return GetBoolFlag(ParserHasNotified); }
protected:
  void SetParentIsContent(bool aValue) { SetBoolFlag(ParentIsContent, aValue); }
  void SetInDocument() { SetBoolFlag(IsInDocument); }
  void SetNodeIsContent() { SetBoolFlag(NodeIsContent); }
  void ClearInDocument() { ClearBoolFlag(IsInDocument); }
  void SetIsElement() { SetBoolFlag(NodeIsElement); }
  void SetHasID() { SetBoolFlag(ElementHasID); }
  void ClearHasID() { ClearBoolFlag(ElementHasID); }
  void SetMayHaveStyle() { SetBoolFlag(ElementMayHaveStyle); }
  void SetHasName() { SetBoolFlag(ElementHasName); }
  
  
  bool HasExplicitBaseURI() const { return GetBoolFlag(NodeHasExplicitBaseURI); }
  ;
  // After calling UnbindObject nsINode object doesn't keep
  // aObject alive anymore.
  ;

  ;

  /**
   * Returns the length of this node, as specified at
   * <http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#concept-node-length>
   */
  ;

  
  void GetBaseURI(nsAString& aBaseURI) const;
  // Return the base URI for the document.
  // The returned value may differ if the document is loaded via XHR, and
  // when accessed from chrome privileged script and
  // from content privileged script for compatibility.
  ;
  bool HasChildNodes() const
  {
    return HasChildren();
  }
  ;
  void GetNodeValue(nsAString& aNodeValue)
  {
    GetNodeValueInternal(aNodeValue);
  }
  void SetNodeValue(const nsAString& aNodeValue,
                    mozilla::ErrorResult& aError)
  {
    SetNodeValueInternal(aNodeValue, aError);
  }
  virtual void GetNodeValueInternal(nsAString& aNodeValue);
  virtual void SetNodeValueInternal(const nsAString& aNodeValue,
                                    mozilla::ErrorResult& aError)
  {
    // The DOM spec says that when nodeValue is defined to be null "setting it
    // has no effect", so we don't throw an exception.
  }
  nsINode* InsertBefore(nsINode& aNode, nsINode* aChild,
                        mozilla::ErrorResult& aError)
  {
    return ReplaceOrInsertBefore(false, &aNode, aChild, aError);
  }
  
  
  nsINode* RemoveChild(nsINode& aChild, mozilla::ErrorResult& aError);
  already_AddRefed<nsINode> CloneNode(bool aDeep, mozilla::ErrorResult& aError);
  ;
  void GetNamespaceURI(nsAString& aNamespaceURI) const
  {
    mNodeInfo->GetNamespaceURI(aNamespaceURI);
  }
#ifdef MOZILLA_INTERNAL_API
  void GetPrefix(nsAString& aPrefix)
  {
    mNodeInfo->GetPrefix(aPrefix);
  }
#endif
# 1704 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
  

  ;
  ;
  ;

  // Helper method to remove this node from its parent. This is not exposed
  // through WebIDL.
  // Only call this if the node has a parent node.
  

  // ChildNode methods
  mozilla::dom::Element* GetPreviousElementSibling() const;
  mozilla::dom::Element* GetNextElementSibling() const;
  /**
   * Remove this node from its parent, if any.
   */
  void Remove();

  // ParentNode methods
  mozilla::dom::Element* GetFirstElementChild() const;
  mozilla::dom::Element* GetLastElementChild() const;

  void GetBoxQuads(const BoxQuadOptions& aOptions,
                   nsTArray<nsRefPtr<DOMQuad> >& aResult,
                   mozilla::ErrorResult& aRv);

  already_AddRefed<DOMQuad> ConvertQuadFromNode(DOMQuad& aQuad,
                                                const TextOrElementOrDocument& aFrom,
                                                const ConvertCoordinateOptions& aOptions,
                                                ErrorResult& aRv);
  already_AddRefed<DOMQuad> ConvertRectFromNode(DOMRectReadOnly& aRect,
                                                const TextOrElementOrDocument& aFrom,
                                                const ConvertCoordinateOptions& aOptions,
                                                ErrorResult& aRv);
  already_AddRefed<DOMPoint> ConvertPointFromNode(const DOMPointInit& aPoint,
                                                  const TextOrElementOrDocument& aFrom,
                                                  const ConvertCoordinateOptions& aOptions,
                                                  ErrorResult& aRv);

protected:

  // Override this function to create a custom slots class.
  // Must not return null.
  virtual nsINode::nsSlots* CreateSlots();

  bool HasSlots() const
  {
    return mSlots != nullptr;
  }

  nsSlots* GetExistingSlots() const
  {
    return mSlots;
  }

  nsSlots* Slots()
  {
    if (!HasSlots()) {
      mSlots = CreateSlots();
      MOZ_ASSERT(mSlots);
    }
    return GetExistingSlots();
  }

  nsTObserverArray<nsIMutationObserver*> *GetMutationObservers()
  {
    return HasSlots() ? &GetExistingSlots()->mMutationObservers : nullptr;
  }

  bool IsEditableInternal() const;
  virtual bool IsEditableExternal() const
  {
    return IsEditableInternal();
  }

  virtual void GetTextContentInternal(nsAString& aTextContent,
                                      mozilla::ErrorResult& aError);
  virtual void SetTextContentInternal(const nsAString& aTextContent,
                                      mozilla::ErrorResult& aError)
  {
  }

#ifdef DEBUG
  // Note: virtual so that IsInNativeAnonymousSubtree can be called accross
  // module boundaries.
  virtual void CheckNotNativeAnonymous() const;
#endif
# 1812 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"

  // These are just used to implement nsIDOMNode using
  // NS_FORWARD_NSIDOMNODE_TO_NSINODE_HELPER and for quickstubs.
  nsresult GetParentNode(nsIDOMNode** aParentNode);
  nsresult GetParentElement(nsIDOMElement** aParentElement);
  nsresult GetChildNodes(nsIDOMNodeList** aChildNodes);
  nsresult GetFirstChild(nsIDOMNode** aFirstChild);
  nsresult GetLastChild(nsIDOMNode** aLastChild);
  nsresult GetPreviousSibling(nsIDOMNode** aPrevSibling);
  nsresult GetNextSibling(nsIDOMNode** aNextSibling);
  nsresult GetOwnerDocument(nsIDOMDocument** aOwnerDocument);
  nsresult CompareDocumentPosition(nsIDOMNode* aOther,
                                   uint16_t* aReturn);

  nsresult ReplaceOrInsertBefore(bool aReplace, nsIDOMNode *aNewChild,
                                 nsIDOMNode *aRefChild, nsIDOMNode **aReturn);
  nsINode* ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
                                 nsINode* aRefChild,
                                 mozilla::ErrorResult& aError);
  nsresult RemoveChild(nsIDOMNode* aOldChild, nsIDOMNode** aReturn);

  /**
   * Returns the Element that should be used for resolving namespaces
   * on this node (ie the ownerElement for attributes, the documentElement for
   * documents, the node itself for elements and for other nodes the parentNode
   * if it is an element).
   */
  virtual mozilla::dom::Element* GetNameSpaceElement() = 0;

  /**
   * Most of the implementation of the nsINode RemoveChildAt method.
   * Should only be called on document, element, and document fragment
   * nodes.  The aChildArray passed in should be the one for |this|.
public:
  /* Event stuff that documents and elements share.  This needs to be
     NS_IMETHOD because some subclasses implement DOM methods with
     this exact name and signature and then the calling convention
     needs to match.

     Note that we include DOCUMENT_ONLY_EVENT events here so that we
     can forward all the document stuff to this implementation.
  */
#define EVENT(name_, id_, type_, struct_)                             \
  mozilla::dom::EventHandlerNonNull* GetOn##name_();                  \
  void SetOn##name_(mozilla::dom::EventHandlerNonNull* listener);
#define TOUCH_EVENT EVENT
#define DOCUMENT_ONLY_EVENT EVENT
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventNameList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EventNameList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
#error "Don't define DEFINED_FORWARDED_EVENT"
#endif /* DEFINED_FORWARDED_EVENT */
# 81 "../../dist/include/mozilla/EventNameList.h"

#ifndef FORWARDED_EVENT
#define FORWARDED_EVENT EVENT
#define DEFINED_FORWARDED_EVENT
#endif /* FORWARDED_EVENT */
# 86 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_WINDOW_ONLY_EVENT
#error "Don't define DEFINED_WINDOW_ONLY_EVENT"
#endif /* DEFINED_WINDOW_ONLY_EVENT */
# 90 "../../dist/include/mozilla/EventNameList.h"

#ifndef WINDOW_ONLY_EVENT
#define WINDOW_ONLY_EVENT(_name, _id, _type, _struct)
#define DEFINED_WINDOW_ONLY_EVENT
#endif /* WINDOW_ONLY_EVENT */
# 95 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_WINDOW_EVENT
#error "Don't define DEFINED_WINDOW_EVENT"
#endif /* DEFINED_WINDOW_EVENT */
# 99 "../../dist/include/mozilla/EventNameList.h"

#ifndef WINDOW_EVENT
#define WINDOW_EVENT WINDOW_ONLY_EVENT
#define DEFINED_WINDOW_EVENT
#endif /* WINDOW_EVENT */
# 104 "../../dist/include/mozilla/EventNameList.h"

#ifndef DOCUMENT_ONLY_EVENT
#define DOCUMENT_ONLY_EVENT(_name, _id, _type, _struct)
#define DEFINED_DOCUMENT_ONLY_EVENT
#endif /* DOCUMENT_ONLY_EVENT */
# 122 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_NON_IDL_EVENT
#error "Don't define DEFINED_NON_IDL_EVENT"
#endif /* DEFINED_NON_IDL_EVENT */
# 126 "../../dist/include/mozilla/EventNameList.h"

#ifndef NON_IDL_EVENT
#define NON_IDL_EVENT(_name, _id, _type, _struct)
#define DEFINED_NON_IDL_EVENT
#endif /* NON_IDL_EVENT */
# 131 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_ERROR_EVENT
#error "Don't define DEFINED_ERROR_EVENT"
#endif /* DEFINED_ERROR_EVENT */
# 135 "../../dist/include/mozilla/EventNameList.h"

#ifndef ERROR_EVENT
#define ERROR_EVENT FORWARDED_EVENT
#define DEFINED_ERROR_EVENT
#endif /* ERROR_EVENT */
# 140 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_BEFOREUNLOAD_EVENT
#error "Don't define DEFINED_BEFOREUNLOAD_EVENT"
#endif /* DEFINED_BEFOREUNLOAD_EVENT */
# 144 "../../dist/include/mozilla/EventNameList.h"

#ifndef BEFOREUNLOAD_EVENT
#define BEFOREUNLOAD_EVENT WINDOW_EVENT
#define DEFINED_BEFOREUNLOAD_EVENT
#endif /* BEFOREUNLOAD_EVENT */
# 149 "../../dist/include/mozilla/EventNameList.h"

EVENT(abort,
      NS_IMAGE_ABORT,
      EventNameType_All,
      eBasicEventClass)
EVENT(canplay,
      NS_CANPLAY,
      EventNameType_HTML,
      eBasicEventClass)
EVENT(canplaythrough,
      NS_CANPLAYTHROUGH,
      EventNameType_HTML,
      eBasicEventClass)
EVENT(change,
      NS_FORM_CHANGE,
      EventNameType_HTMLXUL,
      eBasicEventClass)
EVENT(click,
      NS_MOUSE_CLICK,
      EventNameType_All,
      eMouseEventClass)
EVENT(contextmenu,
      NS_CONTEXTMENU,
      EventNameType_HTMLXUL,
      eMouseEventClass)
// Not supported yet
// EVENT(cuechange)
EVENT(dblclick,
      NS_MOUSE_DOUBLECLICK,
      EventNameType_HTMLXUL,
      eMouseEventClass)
EVENT(drag,
      NS_DRAGDROP_DRAG,
      EventNameType_HTMLXUL,
      eDragEventClass)
EVENT(dragend,
      NS_DRAGDROP_END,
      EventNameType_HTMLXUL,
      eDragEventClass)
EVENT(dragenter,
      NS_DRAGDROP_ENTER,
      EventNameType_HTMLXUL,
      eClipboardEventClass)
EVENT(paste,
      NS_PASTE,
      EventNameType_HTMLXUL,
      eClipboardEventClass)
// Gecko-specific extensions that apply to elements
EVENT(beforescriptexecute,
      NS_BEFORE_SCRIPT_EXECUTE,
      EventNameType_HTMLXUL,
      eBasicEventClass)
EVENT(afterscriptexecute,
      NS_AFTER_SCRIPT_EXECUTE,
      EventNameType_HTMLXUL,
      eBasicEventClass)

FORWARDED_EVENT(blur,
                NS_RESIZE_EVENT,
                EventNameType_All,
                eBasicEventClass)
FORWARDED_EVENT(scroll,
                NS_SCROLL_EVENT,
                (EventNameType_HTMLXUL | EventNameType_SVGSVG),
                eBasicEventClass)

WINDOW_EVENT(afterprint,
             NS_AFTERPRINT,
             EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
             eBasicEventClass)
WINDOW_EVENT(beforeprint,
             NS_BEFOREPRINT,
             EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
             eBasicEventClass)
BEFOREUNLOAD_EVENT(beforeunload,
                   NS_BEFORE_PAGE_UNLOAD,
                   EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
                   eBasicEventClass)
WINDOW_EVENT(hashchange,
             NS_HASHCHANGE,
             EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
             eBasicEventClass)
WINDOW_EVENT(languagechange,
             NS_LANGUAGECHANGE,
             EventNameType_HTMLBodyOrFramesetOnly,
             eBasicEventClass)
// XXXbz Should the onmessage attribute on <body> really not work?  If so, do we
// need a different macro to flag things like that (IDL, but not content
// attributes on body/frameset), or is just using EventNameType_None enough?
WINDOW_EVENT(message,
             NS_PAGE_SHOW,
             EventNameType_HTMLBodyOrFramesetOnly,
             eBasicEventClass)
WINDOW_EVENT(popstate,
             NS_POPSTATE,
             EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
             eBasicEventClass)
// Not supported yet
// WINDOW_EVENT(redo)
NON_IDL_EVENT(popupshown,
              NS_XUL_POPUP_SHOWN,
              EventNameType_XUL,
              eBasicEventClass)
NON_IDL_EVENT(popuphiding,
              NS_XUL_POPUP_HIDING,
              EventNameType_XUL,
              eDragEventClass)
NON_IDL_EVENT(dragdrop,
              NS_DRAGDROP_DRAGDROP,
              EventNameType_XUL,
              eDragEventClass)
NON_IDL_EVENT(draggesture,
              NS_DRAGDROP_GESTURE,
              EventNameType_XUL,
              eSVGZoomEventClass)

// Only map the ID to the real event name when ID_TO_EVENT is defined.
#ifndef ID_TO_EVENT
// This is a bit hackish, but SVG's event names are weird.
NON_IDL_EVENT(zoom,
              NS_SVG_ZOOM,
              EventNameType_SVGSVG,
              eBasicEventClass)
#endif
# 773 "../../dist/include/mozilla/EventNameList.h"
// Only map the ID to the real event name when ID_TO_EVENT is defined.
#ifndef ID_TO_EVENT
NON_IDL_EVENT(begin,
              NS_SMIL_BEGIN,
              EventNameType_SMIL,
              eBasicEventClass)
#endif
# 780 "../../dist/include/mozilla/EventNameList.h"
NON_IDL_EVENT(beginEvent,
              NS_SMIL_BEGIN,
              EventNameType_None,
              eSMILTimeEventClass)
// Only map the ID to the real event name when ID_TO_EVENT is defined.
#ifndef ID_TO_EVENT
NON_IDL_EVENT(end,
              NS_SMIL_END,
              EventNameType_SMIL,
              eBasicEventClass)
#endif
# 791 "../../dist/include/mozilla/EventNameList.h"
NON_IDL_EVENT(endEvent,
              NS_SMIL_END,
              EventNameType_None,
              eSMILTimeEventClass)
// Only map the ID to the real event name when ID_TO_EVENT is defined.
#ifndef ID_TO_EVENT
NON_IDL_EVENT(repeat,
              NS_SMIL_REPEAT,
              EventNameType_SMIL,
              eBasicEventClass)
#endif
# 802 "../../dist/include/mozilla/EventNameList.h"
NON_IDL_EVENT(repeatEvent,
              NS_SMIL_REPEAT,
              EventNameType_None,
              eSMILTimeEventClass)

NON_IDL_EVENT(MozAfterPaint,
              NS_AFTERPAINT,
              EventNameType_None,
              eBasicEventClass)

NON_IDL_EVENT(MozScrolledAreaChanged,
              NS_SCROLLEDAREACHANGED,
              EventNameType_None,
              eScrollAreaEventClass)

#ifdef MOZ_GAMEPAD
NON_IDL_EVENT(gamepadbuttondown,
              NS_GAMEPAD_BUTTONDOWN,
              EventNameType_None,
              eBasicEventClass)
NON_IDL_EVENT(gamepadbuttonup,
              NS_GAMEPAD_BUTTONUP,
              EventNameType_None,
              eBasicEventClass)
NON_IDL_EVENT(gamepadaxismove,
              NS_GAMEPAD_AXISMOVE,
              EventNameType_None,
              eBasicEventClass)
NON_IDL_EVENT(gamepadconnected,
              NS_GAMEPAD_CONNECTED,
              EventNameType_None,
              eBasicEventClass)
NON_IDL_EVENT(gamepaddisconnected,
              NS_GAMEPAD_DISCONNECTED,
              EventNameType_None,
              eBasicEventClass)
#endif
# 839 "../../dist/include/mozilla/EventNameList.h"

// Simple gesture events
NON_IDL_EVENT(MozSwipeGestureStart,
              NS_SIMPLE_GESTURE_SWIPE_START,
              EventNameType_None,
              eSimpleGestureEventClass)
NON_IDL_EVENT(MozSwipeGestureUpdate,
              NS_SIMPLE_GESTURE_EDGE_CANCELED,
              EventNameType_None,
              eSimpleGestureEventClass)
NON_IDL_EVENT(MozEdgeUICompleted,
              NS_SIMPLE_GESTURE_EDGE_COMPLETED,
              EventNameType_None,
              eSimpleGestureEventClass)

NON_IDL_EVENT(transitionend,
              NS_TRANSITION_END,
              EventNameType_None,
              eTransitionEventClass)
NON_IDL_EVENT(animationstart,
              NS_ANIMATION_START,
              EventNameType_None,
              eAnimationEventClass)
NON_IDL_EVENT(animationend,
              NS_ANIMATION_END,
              EventNameType_None,
              eAnimationEventClass)
NON_IDL_EVENT(animationiteration,
              NS_ANIMATION_ITERATION,
              EventNameType_None,
              eAnimationEventClass)

NON_IDL_EVENT(audioprocess,
              NS_AUDIO_PROCESS,
              EventNameType_None,
              eBasicEventClass)

NON_IDL_EVENT(complete,
              NS_AUDIO_COMPLETE,
              EventNameType_None,
              eBasicEventClass)

#ifdef DEFINED_FORWARDED_EVENT
#undef DEFINED_FORWARDED_EVENT
#undef FORWARDED_EVENT
#endif /* DEFINED_FORWARDED_EVENT */
# 933 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_WINDOW_EVENT
#undef DEFINED_WINDOW_EVENT
#undef WINDOW_EVENT
#endif /* DEFINED_WINDOW_EVENT */
# 938 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_WINDOW_ONLY_EVENT
#undef DEFINED_WINDOW_ONLY_EVENT
#undef WINDOW_ONLY_EVENT
#endif /* DEFINED_WINDOW_ONLY_EVENT */
# 943 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_TOUCH_EVENT
#undef DEFINED_TOUCH_EVENT
#undef TOUCH_EVENT
#endif /* DEFINED_TOUCH_EVENT */
# 948 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_DOCUMENT_ONLY_EVENT
#undef DEFINED_DOCUMENT_ONLY_EVENT
#undef DOCUMENT_ONLY_EVENT
#endif /* DEFINED_DOCUMENT_ONLY_EVENT */
# 953 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_NON_IDL_EVENT
#undef DEFINED_NON_IDL_EVENT
#undef NON_IDL_EVENT
#endif /* DEFINED_NON_IDL_EVENT */
# 958 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_ERROR_EVENT
#undef DEFINED_ERROR_EVENT
#undef ERROR_EVENT
#endif /* DEFINED_ERROR_EVENT */
# 963 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_BEFOREUNLOAD_EVENT
#undef DEFINED_BEFOREUNLOAD_EVENT
#undef BEFOREUNLOAD_EVENT
#endif /* BEFOREUNLOAD_EVENT */
# 968 "../../dist/include/mozilla/EventNameList.h"

#ifdef ID_TO_EVENT
#undef EVENT
#undef WINDOW_ONLY_EVENT
#undef TOUCH_EVENT
#undef DOCUMENT_ONLY_EVENT
#undef NON_IDL_EVENT
#endif /* ID_TO_EVENT */
# 976 "../../dist/include/mozilla/EventNameList.h"

# 1894 "/Users/luser/build/mozilla-central/dom/base/nsINode.h" 2
#undef DOCUMENT_ONLY_EVENT
#undef TOUCH_EVENT
#undef EVENT

protected:
  ;
  ;

  nsRefPtr<mozilla::dom::NodeInfo> mNodeInfo;

  nsINode* mParent;

private:
  // Boolean flags.
  uint32_t mBoolFlags;

protected:
  nsIContent* mNextSibling;
  nsIContent* mPreviousSibling;
  nsIContent* mFirstChild;

  union {
    // Pointer to our primary frame.  Might be null.
    nsIFrame* mPrimaryFrame;

    // Pointer to the root of our subtree.  Might be null.
    nsINode* mSubtreeRoot;
  };

  // Storage for more members that are usually not needed; allocated lazily.
  nsSlots* mSlots;
};




#define NS_FORWARD_NSIDOMNODE_TO_NSINODE_HELPER(...) \
  NS_IMETHOD GetNodeName(nsAString& aNodeName) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    aNodeName = nsINode::NodeName(); \
    return NS_OK; \
  } \
  NS_IMETHOD GetNodeValue(nsAString& aNodeValue) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    nsINode::GetNodeValue(aNodeValue); \
    return NS_OK; \
  } \
  NS_IMETHOD SetNodeValue(const nsAString& aNodeValue) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    mozilla::ErrorResult rv; \
    nsINode::SetNodeValue(aNodeValue, rv); \
    return rv.ErrorCode(); \
  } \
  NS_IMETHOD GetNodeType(uint16_t* aNodeType) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    *aNodeType = nsINode::NodeType(); \
    return NS_OK; \
  } \
  NS_IMETHOD GetParentNode(nsIDOMNode** aParentNode) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::GetParentNode(aParentNode); \
  } \
  NS_IMETHOD GetParentElement(nsIDOMElement** aParentElement) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::GetParentElement(aParentElement); \
  } \
  NS_IMETHOD GetChildNodes(nsIDOMNodeList** aChildNodes) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::GetChildNodes(aChildNodes); \
  } \
  NS_IMETHOD GetFirstChild(nsIDOMNode** aFirstChild) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::GetFirstChild(aFirstChild); \
  } \
  NS_IMETHOD GetLastChild(nsIDOMNode** aLastChild) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::GetLastChild(aLastChild); \
  } \
  NS_IMETHOD GetPreviousSibling(nsIDOMNode** aPreviousSibling) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::GetPreviousSibling(aPreviousSibling); \
  } \
  NS_IMETHOD GetNextSibling(nsIDOMNode** aNextSibling) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::GetNextSibling(aNextSibling); \
  } \
  NS_IMETHOD GetOwnerDocument(nsIDOMDocument** aOwnerDocument) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::GetOwnerDocument(aOwnerDocument); \
  } \
  NS_IMETHOD InsertBefore(nsIDOMNode* aNewChild, nsIDOMNode* aRefChild, nsIDOMNode** aResult) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return ReplaceOrInsertBefore(false, aNewChild, aRefChild, aResult); \
  } \
  NS_IMETHOD ReplaceChild(nsIDOMNode* aNewChild, nsIDOMNode* aOldChild, nsIDOMNode** aResult) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return NS_OK; \
  } \
  NS_IMETHOD GetNamespaceURI(nsAString& aNamespaceURI) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    nsINode::GetNamespaceURI(aNamespaceURI); \
    return NS_OK; \
  } \
  NS_IMETHOD GetPrefix(nsAString& aPrefix) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    nsINode::GetPrefix(aPrefix); \
    return NS_OK; \
  } \
  NS_IMETHOD GetLocalName(nsAString& aLocalName) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    aLocalName = nsINode::LocalName(); \
    return NS_OK; \
  } \
  NS_IMETHOD UnusedPlaceholder(bool* aResult) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    *aResult = false; \
    return NS_OK; \
  } \
  NS_IMETHOD GetDOMBaseURI(nsAString& aBaseURI) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    nsINode::GetBaseURI(aBaseURI); \
    return NS_OK; \
  } \
  NS_IMETHOD CompareDocumentPosition(nsIDOMNode* aOther, uint16_t* aResult) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::CompareDocumentPosition(aOther, aResult); \
  } \
  NS_IMETHOD SetUserData(const nsAString& aKey, nsIVariant* aData, nsIVariant** aResult) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::SetUserData(aKey, aData, aResult); \
  } \
  NS_IMETHOD GetUserData(const nsAString& aKey, nsIVariant** aResult) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::GetUserData(aKey, aResult); \
  } \
  NS_IMETHOD Contains(nsIDOMNode* aOther, bool* aResult) __VA_ARGS__ MOZ_OVERRIDE \
  { \
    return nsINode::Contains(aOther, aResult); \
  }

#define NS_FORWARD_NSIDOMNODE_TO_NSINODE \
  NS_FORWARD_NSIDOMNODE_TO_NSINODE_HELPER(MOZ_FINAL)

#define NS_FORWARD_NSIDOMNODE_TO_NSINODE_OVERRIDABLE \
  NS_FORWARD_NSIDOMNODE_TO_NSINODE_HELPER()

#endif /* nsINode_h___ */
# 2132 "/Users/luser/build/mozilla-central/dom/base/nsINode.h"
# 11 "/Users/luser/build/mozilla-central/dom/base/nsIContent.h" 2

// Forward declarations
class nsAString;
class nsIAtom;
class nsIURI;
class nsRuleWalker;
class nsAttrValue;
class nsAttrName;
class nsTextFragment;
class nsIFrame;
class nsXBLBinding;

namespace mozilla {
class EventChainPreVisitor;
namespace dom {
class ShadowRoot;
struct CustomElementData;
} // namespace dom
namespace widget {
struct IMEState;
} // namespace widget
} // namespace mozilla

enum nsLinkState {
  eLinkState_Unvisited  = 1,
  eLinkState_Visited    = 2,
  eLinkState_NotLink    = 3 
};

// IID for the nsIContent interface
#define NS_ICONTENT_IID \
{ 0x70f7e9ea, 0xa9bf, 0x48cc, \
  { 0xad, 0x9d, 0x8a, 0xca, 0xee, 0xd2, 0x9b, 0x68 } }

/**
 * A node of content in a document's content model. This interface
 * is supported by all content objects.
 */
class nsIContent : public nsINode {
public:
  typedef mozilla::widget::IMEState IMEState;

#ifdef MOZILLA_INTERNAL_API
  // If you're using the external API, the only thing you can know about
  // nsIContent is that it exists with an IID

  explicit nsIContent(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
    : nsINode(aNodeInfo)
  {
    MOZ_ASSERT(mNodeInfo);
    SetNodeIsContent();
  }
#endif // MOZILLA_INTERNAL_API
# 64 "/Users/luser/build/mozilla-central/dom/base/nsIContent.h"

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENT_IID)

  /**
   * Bind this content node to a tree.  If this method throws, the caller must
   * call UnbindFromTree() on the node.  In the typical case of a node being
   * appended to a parent, this will be called after the node has been added to
   * the parent's child list and before nsIDocumentObserver notifications for
   * @note This method must not be called by consumers of nsIContent on a node
   *       that is already bound to a tree.  Call UnbindFromTree first.
   * @note This method will handle rebinding descendants appropriately (eg
   *       changing their binding parent as needed).
   * @note This method does not add the content node to aParent's child list
   * @throws NS_ERROR_OUT_OF_MEMORY if that happens
   */
  virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                              nsIContent* aBindingParent,
                              bool aCompileEventHandlers) = 0;

  /**
   * Unbind this content node from a tree.  This will set its current document
   * and binding parent to null.  In the typical case of a node being removed
   * from a parent, this will be called after it has been removed from the
   * parent's child list and after the nsIDocumentObserver notifications for
   * the removal have been dispatched.   
   * @param aDeep Whether to recursively unbind the entire subtree rooted at
   *        this node.  The only time false should be passed is when the
   *        parent node of the content is being destroyed.
   * @param aNullParent Whether to null out the parent pointer as well.  This
   *        is usually desirable.  This argument should only be false while
   *        recursively calling UnbindFromTree when a subtree is detached.
   * @note This method is safe to call on nodes that are not bound to a tree.
   */
  virtual void UnbindFromTree(bool aDeep = true,
                              bool aNullParent = true) = 0;

  enum {
    /**
     * All XBL flattened tree children of the node, as well as :before and
     * :after anonymous content and native anonymous children.
     *   2. XBL explicit children of the node
     *   3. native anonymous nodes
     *   4. :after generated node
     */
    eAllButXBL = 1,

    /**
     * Skip native anonymous content created for placeholder of HTML input,
     * used in conjunction with eAllChildren or eAllButXBL.
     */
    eSkipPlaceholderContent = 2
  };

  /**
   * Return either the XBL explicit children of the node or the XBL flattened
   * tree children of the node, depending on the filter, as well as
   * native anonymous children.
   *
   * @note calling this method with eAllButXBL will return children that are
   *  also in the eAllButXBL and eAllChildren child lists of other descendants
   *  of this node in the tree, but those other nodes cannot be reached from the
   *  eAllButXBL child list.
   */
  virtual already_AddRefed<nsINodeList> GetChildren(uint32_t aFilter) = 0;

  /**
   * Get whether this content is C++-generated anonymous content
   * @see nsIAnonymousContentCreator
   * @return whether this content is anonymous
   */
  bool IsRootOfNativeAnonymousSubtree() const
  {
    NS_ASSERTION(!HasFlag(NODE_IS_NATIVE_ANONYMOUS_ROOT) ||
                 (HasFlag(NODE_IS_ANONYMOUS_ROOT) &&
                  HasFlag(NODE_IS_IN_NATIVE_ANONYMOUS_SUBTREE)),
                 "Some flags seem to be missing!");
    return HasFlag(NODE_IS_NATIVE_ANONYMOUS_ROOT);
  }

  /**
   * Return true iff this node is in an HTML document (in the HTML5 sense of
   * the term, i.e. not in an XHTML/XML document).
   */
  ;

  /**
   * Get the namespace that this element's tag is defined in
   * @return the namespace
   */
  

  inline bool IsHTMLElement() const
  {
    return IsInNamespace(kNameSpaceID_XHTML);
  }

  inline bool IsHTMLElement(nsIAtom* aTag) const
  {
    return mNodeInfo->Equals(aTag, kNameSpaceID_XHTML);
  }

  

  inline bool IsSVGElement() const
  {
    return IsInNamespace(kNameSpaceID_SVG);
  }

  

  

  inline bool IsXULElement() const
  {
    return IsInNamespace(kNameSpaceID_XUL);
  }

  

  template<typename First, typename... Args>
  inline bool IsAnyOfXULElements(First aFirst, Args... aArgs) const
  {
    return IsXULElement() && IsNodeInternal(aFirst, aArgs...);
  }

  inline bool IsMathMLElement() const
  {
    return IsInNamespace(kNameSpaceID_MathML);
  }

  

  
  

  /**
   * canonical String representation that can be used for these
   * methods. The SetAttr method is assumed to perform a translation
   * of the canonical form into the underlying content specific
   * form.
   *
   * @param aNameSpaceID the namespace of the attribute
   * @param aName the name of the attribute
   * @param aPrefix the prefix of the attribute
   * @param aValue the value to set
   * @param aNotify specifies how whether or not the document should be
   *        notified of the attribute change.
   */
  virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                           nsIAtom* aPrefix, const nsAString& aValue,
                           bool aNotify) = 0;

  /**
   * Get the current value of the attribute. This returns a form that is
   * suitable for passing back into SetAttr.
   *
   * @param aNameSpaceID the namespace of the attr
   * @param aName the name of the attr
   * @param aResult the value (may legitimately be the empty string) [OUT]
   * @returns true if the attribute was set (even when set to empty string)
   *          false when not set.
   */
  bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
               nsAString& aResult) const;

  /**
   * Determine if an attribute has been set (empty string or otherwise).
   *
  ;
  
  /**
   * Test whether this content node's given attribute has the given value.  If
   * the attribute is not set at all, this will return false.
   *
   * @param aNameSpaceID The namespace ID of the attribute.  Must not
   *                     be kNameSpaceID_Unknown.
   * @param aName The name atom of the attribute.  Must not be null.
   * @param aValue The value to compare to.  Must not be null.
   * @param aCaseSensitive Whether to do a case-sensitive compare on the value.
   */
  ;
  
  enum {
    ATTR_MISSING = -1,
    ATTR_VALUE_NO_MATCH = -2
  };
  /**
   * Check whether this content node's given attribute has one of a given
   * list of values. If there is a match, we return the index in the list
   * of the first matching value. If there was no attribute at all, then
   * we return ATTR_MISSING. If there was an attribute but it didn't
   * match, we return ATTR_VALUE_NO_MATCH. A non-negative result always
   * indicates a match.
   * 
   * @param aNameSpaceID The namespace ID of the attribute.  Must not
   *                     be kNameSpaceID_Unknown.
   * @param aName The name atom of the attribute.  Must not be null.
   * @param aValues a nullptr-terminated array of pointers to atom values to test
   *                against.
   * @param aCaseSensitive Whether to do a case-sensitive compare on the values.
   * @return ATTR_MISSING, ATTR_VALUE_NO_MATCH or the non-negative index
   * indicating the first value of aValues that matched
   */
  typedef nsIAtom* const* const AttrValuesArray;
  virtual int32_t FindAttrValueIn(int32_t aNameSpaceID,
                                  nsIAtom* aName,
                                  AttrValuesArray* aValues,
                                  nsCaseTreatment aCaseSensitive) const
  {
    return ATTR_MISSING;
  }

  /**
   * Remove an attribute so that it is no longer explicitly specified.
   *
   * @param aNameSpaceID the namespace id of the attribute
   * @param aAttr the name of the attribute to unset
   * @param aNotify specifies whether or not the document should be
   * notified of the attribute change
   */
  virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttr, 
                             bool aNotify) = 0;


  /**
   * Get the namespace / name / prefix of a given attribute.
   * 
   * @param   aIndex the index of the attribute name
   * @returns The name at the given index, or null if the index is
   *          out-of-bounds.
   * @note    The document returned by NodeInfo()->GetDocument() (if one is
   *          present) is *not* necessarily the owner document of the element.
   * @note    The pointer returned by this function is only valid until the
   *          next call of either GetAttrNameAt or SetAttr on the element.
   */
  virtual const nsAttrName* GetAttrNameAt(uint32_t aIndex) const = 0;

  /**
   * Get the number of all specified attributes.
   *
   * @return the number of attributes
   */
  virtual uint32_t GetAttrCount() const = 0;

  /**
   * Get direct access (but read only) to the text in the text content.
   * NOTE: For elements this is *not* the concatenation of all text children,
   * it is simply null;
   */
  virtual const nsTextFragment *GetText() = 0;

  /**
   * Get the length of the text content.
   * NOTE: This should not be called on elements.
   */
  virtual uint32_t TextLength() const = 0;

   /**
    * Determines if an event attribute name (such as onclick) is valid for
    * a given element type.
    * @note calls nsContentUtils::IsEventAttributeName with right flag
    * @note overridden by subclasses as needed
    * @param aName the event name to look up
    */
  virtual bool IsEventAttributeName(nsIAtom* aName)
  {
    return false;
  }

  /**
   * Set the text to the given value. If aNotify is true then
   * the document is notified of the content change.
   * NOTE: For elements this always ASSERTS and returns NS_ERROR_FAILURE
   */
  virtual nsresult SetText(const char16_t* aBuffer, uint32_t aLength,
                           bool aNotify) = 0;

  /**
   * Append the given value to the current text. If aNotify is true then
   * the document is notified of the content change.
   * NOTE: For elements this always ASSERTS and returns NS_ERROR_FAILURE
   */
  virtual nsresult AppendText(const char16_t* aBuffer, uint32_t aLength,
                              bool aNotify) = 0;

  /**
   * Set the text to the given value. If aNotify is true then
   * the document is notified of the content change.
   * NOTE: For elements this always asserts and returns NS_ERROR_FAILURE
   */
  nsresult SetText(const nsAString& aStr, bool aNotify)
  {
    return SetText(aStr.BeginReading(), aStr.Length(), aNotify);
  }

  /**
   * Query method to see if the frame is nothing but whitespace
   * NOTE: Always returns false for elements
   */
  virtual bool TextIsOnlyWhitespace() = 0;

  /**
   * Method to see if the text node contains data that is useful
   * for a translation: i.e., it consists of more than just whitespace,
   * digits and punctuation.
   * NOTE: Always returns false for elements.
   */
  virtual bool HasTextForTranslation() = 0;

  /**
   * Append the text content to aResult.
   * NOTE: This asserts and returns for elements
   */
  virtual void AppendTextTo(nsAString& aResult) = 0;

  /**
   * Append the text content to aResult.
   * NOTE: This asserts and returns for elements
   */
  virtual bool AppendTextTo(nsAString& aResult,
                            const mozilla::fallible_t&) NS_WARN_UNUSED_RESULT = 0;

  /**
   * Check if this content is focusable and in the current tab order.
   * Note: most callers should use nsIFrame::IsFocusable() instead as it 
   *       checks visibility and other layout factors as well.
   * Tabbable is indicated by a nonnegative tabindex & is a subset of focusable.
   * For example, only the selected radio button in a group is in the 
   * tab order, unless the radio group has no selection in which case
   * all of the visible, non-disabled radio buttons in the group are 
   * in the tab order. On the other hand, all of the visible, non-disabled 
   * radio buttons are always focusable via clicking or script.
   * Also, depending on either the accessibility.tabfocus pref or
   * a system setting (nowadays: Full keyboard access, mac only)
   * some widgets may be focusable but removed from the tab order.
   * @param  [inout, optional] aTabIndex the computed tab index
   *         In: default tabindex for element (-1 nonfocusable, == 0 focusable)
   *         Out: computed tabindex
   * @param  [optional] aTabIndex the computed tab index
   *         < 0 if not tabbable
   *         == 0 if in normal tab order
   *         > 0 can be tabbed to in the order specified by this value
   * @return whether the content is focusable via mouse, kbd or script.
   */
  bool IsFocusable(int32_t* aTabIndex = nullptr, bool aWithMouse = false);
  virtual bool IsFocusableInternal(int32_t* aTabIndex, bool aWithMouse);

  /**
   * The method focuses (or activates) element that accesskey is bound to. It is
   * called when accesskey is activated.
   *
   * @param aKeyCausesActivation - if true then element should be activated
   * @param aIsTrustedEvent - if true then event that is cause of accesskey
   *                          execution is trusted.
   */
  virtual void PerformAccesskey(bool aKeyCausesActivation,
                                bool aIsTrustedEvent)
  {
  }

  /*
   * Get desired IME state for the content.
   *
   * @return The desired IME status for the content.
   *         This is a combination of an IME enabled value and
   *         an IME open value of widget::IMEState.
   *         If you return DISABLED, you should not set the OPEN and CLOSE
   *         value.
   *         PASSWORD should be returned only from password editor, this value
   *         has a special meaning. It is used as alternative of DISABLED.
   *         PLUGIN should be returned only when plug-in has focus.  When a
   *         plug-in is focused content, we should send native events directly.
   *         Because we don't process some native events, but they may be needed
   *         by the plug-in.
   */
  virtual IMEState GetDesiredIMEState();

  /**
   * Gets content node with the binding (or native code, possibly on the
   * frame) responsible for our construction (and existence).  Used by
   * anonymous content (both XBL-generated and native-anonymous).
   *
   * null for all explicit content (i.e., content reachable from the top
   * of its GetParent() chain via child lists).
   *
   * @return the binding parent
   */
  virtual nsIContent *GetBindingParent() const = 0;

  /**
   * Gets the current XBL binding that is bound to this element.
   *
   * @return the current binding.
   */
  virtual nsXBLBinding *GetXBLBinding() const = 0;

  /**
   * Sets or unsets an XBL binding for this element. Setting a
   * binding on an element that already has a binding will remove the
   * old binding.
   *
   * @param aBinding The binding to bind to this content. If nullptr is
   *        provided as the argument, then existing binding will be
   *        removed.
   *
   * @param aOldBindingManager The old binding manager that contains
   *                           this content if this content was adopted
   *                           to another document.
   */
  virtual void SetXBLBinding(nsXBLBinding* aBinding,
                             nsBindingManager* aOldBindingManager = nullptr) = 0;

  /**
   * Sets the ShadowRoot binding for this element. The contents of the
   * binding is rendered in place of this node's children.
   *
   * @param aShadowRoot The ShadowRoot to be bound to this element.
   */
  virtual void SetShadowRoot(mozilla::dom::ShadowRoot* aShadowRoot) = 0;

  /**
   * Gets the ShadowRoot binding for this element.
   *
   * @return The ShadowRoot currently bound to this element.
   */
  virtual mozilla::dom::ShadowRoot *GetShadowRoot() const = 0;

  /**
   * Gets the root of the node tree for this content if it is in a shadow tree.
   * This method is called |GetContainingShadow| instead of |GetRootShadowRoot|
   * to avoid confusion with |GetShadowRoot|.
   *
   * @return The ShadowRoot that is the root of the node tree.
   */
  virtual mozilla::dom::ShadowRoot *GetContainingShadow() const = 0;

  /**
   * Gets an array of destination insertion points where this content
   * is distributed by web component distribution algorithms.
   * The array is created if it does not already exist.
   */
  virtual nsTArray<nsIContent*> &DestInsertionPoints() = 0;

  /**
   * Same as DestInsertionPoints except that this method will return
   * null if the array of destination insertion points does not already
   * exist.
   */
  virtual nsTArray<nsIContent*> *GetExistingDestInsertionPoints() const = 0;

  /**
   * Gets the insertion parent element of the XBL binding.
   * The insertion parent is our one true parent in the transformed DOM.
   *
   * @return the insertion parent element.
   */
  virtual nsIContent *GetXBLInsertionParent() const = 0;

  /**
   * Sets the insertion parent element of the XBL binding.
   *
   * @param aContent The insertion parent element.
   */
  virtual void SetXBLInsertionParent(nsIContent* aContent) = 0;

  /**
   * Returns the content node that is the parent of this node in the flattened
   * tree. For nodes that are not filtered into an insertion point, this
   * simply returns their DOM parent in the original DOM tree.
   *
   * @return the flattened tree parent
   */
  nsIContent *GetFlattenedTreeParent() const;

  /**
   * Gets the custom element data used by web components custom element.
   * Custom element data is created at the first attempt to enqueue a callback.
   *
   * @return The custom element data or null if none.
   */
  virtual mozilla::dom::CustomElementData *GetCustomElementData() const = 0;

  /**
   * Sets the custom element data, ownership of the
   * callback data is taken by this content.
   *
   * @param aCallbackData The custom element data.
   */
  virtual void SetCustomElementData(mozilla::dom::CustomElementData* aData) = 0;

  /**
   * API to check if this is a link that's traversed in response to user input
   * (e.g. a click event). Specializations for HTML/SVG/generic XML allow for
   * different types of link in different types of content.
   *
   * @param aURI Required out param. If this content is a link, a new nsIURI
   *             set to this link's URI will be passed out.
   *
   * @note The out param, aURI, is guaranteed to be set to a non-null pointer
   *   when the return value is true.
   *
   * XXXjwatt: IMO IsInteractiveLink would be a better name.
   */
  virtual bool IsLink(nsIURI** aURI) const = 0;

  /**
    * Get a pointer to the full href URI (fully resolved and canonicalized,
    * since it's an nsIURI object) for link elements.
    *
    * @return A pointer to the URI or null if the element is not a link or it
    *         has no HREF attribute.
   * DoneCreatingElement() has already been called and is out of the picture).
   */
  virtual void DoneCreatingElement()
  {
  }

  /**
   * This method is called when the parser begins creating the element's 
   * children, if any are present.
    }
    return nullptr;
  }

  /**
   * Walk aRuleWalker over the content style rules (presentational
   * hint rules) for this content node.
   */
  NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) = 0;

  /**
   * Should be called when the node can become editable or when it can stop
   * being editable (for example when its contentEditable attribute changes,
   * when it is moved into an editable parent, ...).  If aNotify is true and
   * the node is an element, this will notify the state change.
   */
  virtual void UpdateEditableState(bool aNotify);

  /**
   * Destroy this node and its children. Ideally this shouldn't be needed
   * but for now we need to do it to break cycles.
   */
  virtual void DestroyContent() = 0;

  /**
   * Saves the form state of this node and its children.
   */
  virtual void SaveSubtreeState() = 0;

  /**
   * Getter and setter for our primary frame pointer.  This is the frame that
   * is most closely associated with the content. A frame is more closely
   */
  mozilla::dom::Element* GetEditingHost();

  /**
   * Determing language. Look at the nearest ancestor element that has a lang
   * attribute in the XML namespace or is an HTML/SVG element and has a lang in
   * no namespace attribute.
   */
  void GetLang(nsAString& aResult) const {
    for (const nsIContent* content = this; content; content = content->GetParent()) {
      if (content->GetAttrCount() > 0) {
        // xml:lang has precedence over lang on HTML elements (see
        // XHTML1 section C.7).
        bool hasAttr = content->GetAttr(kNameSpaceID_XML, nsGkAtoms::lang,
                                          aResult);
        if (!hasAttr && (content->IsHTMLElement() || content->IsSVGElement())) {
          hasAttr = content->GetAttr(kNameSpaceID_None, nsGkAtoms::lang,
                                     aResult);
        }
        NS_ASSERTION(hasAttr || aResult.IsEmpty(),
                     "GetAttr that returns false should not make string non-empty");
        if (hasAttr) {
          return;
        }
      }
    }
  }

  // Overloaded from nsINode
  virtual already_AddRefed<nsIURI> GetBaseURI(bool aTryUseXHRDocBaseURI = false) const MOZ_OVERRIDE;

  virtual nsresult PreHandleEvent(
                     mozilla::EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;

  virtual bool IsPurple() = 0;
  virtual void RemovePurple() = 0;

  virtual bool OwnedOnlyByTheDOMTree() { return false; }
protected:
  /**
   * Hook for implementing GetID.  This is guaranteed to only be
   * called if HasID() is true.
   */
  nsIAtom* DoGetID() const;

private:
  /**
   * Hook for implementing GetClasses.  This is guaranteed to only be
   * called if the NODE_MAY_HAVE_CLASS flag is set.
   */
  const nsAttrValue* DoGetClasses() const;

public:
#ifdef DEBUG
  /**
   * List the content (and anything it contains) out to the given
   * file stream. Use aIndent as the base indent during formatting.
   */
  virtual void List(FILE* out = stdout, int32_t aIndent = 0) const = 0;

  /**
   * Dump the content (and anything it contains) out to the given
   * file stream. Use aIndent as the base indent during formatting.
   */
  virtual void DumpContent(FILE* out = stdout, int32_t aIndent = 0,
                           bool aDumpAll = true) const = 0;
#endif
# 974 "/Users/luser/build/mozilla-central/dom/base/nsIContent.h"

  /**
   * Append to aOutDescription a short (preferably one line) string
   * describing the content.
   * Currently implemented for elements only.
   */
  virtual void Describe(nsAString& aOutDescription) const {
    aOutDescription = NS_LITERAL_STRING("(not an element)");
  }

  enum ETabFocusType {
  //eTabFocus_textControlsMask = (1<<0),  // unused - textboxes always tabbable
    eTabFocus_formElementsMask = (1<<1),  // non-text form elements
    eTabFocus_linksMask = (1<<2),         // links
    eTabFocus_any = 1 + (1<<1) + (1<<2)   // everything that can be focused
  };

  // Tab focus model bit field:
  static int32_t sTabFocusModel;

  // accessibility.tabfocus_applies_to_xul pref - if it is set to true,
  // the tabfocus bit field applies to xul elements.
  static bool sTabFocusModelAppliesToXUL;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIContent, NS_ICONTENT_IID)

inline nsIContent* nsINode::AsContent()
{
  MOZ_ASSERT(IsContent());
  return static_cast<nsIContent*>(this);
}

#define NS_IMPL_FROMCONTENT_HELPER(_class, _check)                             \
  static _class* FromContent(nsIContent* aContent)                             \
  {                                                                            \
    return aContent->_check ? static_cast<_class*>(aContent) : nullptr;        \
  }                                                                            \
  static _class* FromContentOrNull(nsIContent* aContent)                       \
  {                                                                            \
    return aContent ? FromContent(aContent) : nullptr;                         \
  }

#define NS_IMPL_FROMCONTENT(_class, _nsid)                                     \
  NS_IMPL_FROMCONTENT_HELPER(_class, IsInNamespace(_nsid))

#define NS_IMPL_FROMCONTENT_WITH_TAG(_class, _nsid, _tag)                      \
  NS_IMPL_FROMCONTENT_HELPER(_class, NodeInfo()->Equals(nsGkAtoms::_tag, _nsid))

#define NS_IMPL_FROMCONTENT_HTML_WITH_TAG(_class, _tag)                        \
  NS_IMPL_FROMCONTENT_WITH_TAG(_class, kNameSpaceID_XHTML, _tag)

#endif /* nsIContent_h___ */
# 1027 "/Users/luser/build/mozilla-central/dom/base/nsIContent.h"
# 20 "../../dist/include/mozilla/dom/FragmentOrElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsINodeList.h"                  // base class
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsINodeList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsINodeList_h___
#define nsINodeList_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMNodeList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMNodeList.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMNodeList.idl
 */

#ifndef __gen_nsIDOMNodeList_h__

/* starting interface:    nsIDOMNodeList */
#define NS_IDOMNODELIST_IID_STR "450cf0ba-de90-4f86-85bf-e10cc8b8713f"

#define NS_IDOMNODELIST_IID \
  {0x450cf0ba, 0xde90, 0x4f86, \
    { 0x85, 0xbf, 0xe1, 0x0c, 0xc8, 0xb8, 0x71, 0x3f }}

class NS_NO_VTABLE nsIDOMNodeList : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMNODELIST_IID)

  /* nsIDOMNode item (in unsigned long index); */
  NS_IMETHOD Item(uint32_t index, nsIDOMNode * *_retval) = 0;

  /* readonly attribute unsigned long length; */
  NS_IMETHOD GetLength(uint32_t *aLength) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMNodeList, NS_IDOMNODELIST_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMNODELIST \
  NS_IMETHOD Item(uint32_t index, nsIDOMNode * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMNODELIST(_to) \
  NS_IMETHOD Item(uint32_t index, nsIDOMNode * *_retval) MOZ_OVERRIDE { return _to Item(index, _retval); } \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return _to GetLength(aLength); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMNODELIST(_to) \
  NS_IMETHOD Item(uint32_t index, nsIDOMNode * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Item(index, _retval); } \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLength(aLength); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMNodeList : public nsIDOMNodeList
{
public:
/* readonly attribute unsigned long length; */
NS_IMETHODIMP nsDOMNodeList::GetLength(uint32_t *aLength)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 101 "../../dist/include/nsIDOMNodeList.h"


#endif /* __gen_nsIDOMNodeList_h__ */
# 104 "../../dist/include/nsIDOMNodeList.h"
# 10 "/Users/luser/build/mozilla-central/dom/base/nsINodeList.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsINodeList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIContent.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/base/nsINodeList.h"

// IID for the nsINodeList interface
#define NS_INODELIST_IID \
{ 0xadb5e54c, 0x6e96, 0x4102, \
 { 0x8d, 0x40, 0xe0, 0x12, 0x3d, 0xcf, 0x48, 0x7a } }

/**
 * An internal interface for a reasonably fast indexOf.
 */
class nsINodeList : public nsIDOMNodeList,
                    public nsWrapperCache
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_INODELIST_IID)

  /**
   * Get the index of the given node in the list.  Will return -1 if the node
   * is not in the list.
   */
  virtual int32_t IndexOf(nsIContent* aContent) = 0;

  /**
   * Get the root node for this nodelist.
   */
  virtual nsINode* GetParentObject() = 0;

  using nsIDOMNodeList::Item;

  uint32_t Length()
  {
    uint32_t length;
    GetLength(&length);
    return length;
  }
  virtual nsIContent* Item(uint32_t aIndex) = 0;
  nsIContent* IndexedGetter(uint32_t aIndex, bool& aFound)
  {
    nsIContent* item = Item(aIndex);
    aFound = !!item;
    return item;
  }
};

#define NS_NODELIST_OFFSET_AND_INTERFACE_TABLE_BEGIN(_class)                  \
  NS_OFFSET_AND_INTERFACE_TABLE_BEGIN_AMBIGUOUS(_class, nsINodeList)

NS_DEFINE_STATIC_IID_ACCESSOR(nsINodeList, NS_INODELIST_IID)

#endif /* nsINodeList_h___ */
# 61 "/Users/luser/build/mozilla-central/dom/base/nsINodeList.h"
# 21 "../../dist/include/mozilla/dom/FragmentOrElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIWeakReference.h"             // base class
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIWeakReference.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIWeakReference.idl
 */

#ifndef __gen_nsIWeakReference_h__
#define __gen_nsIWeakReference_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIWeakReference.h"
#endif
# 12 "../../dist/include/nsIWeakReference.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIWeakReference.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsIWeakReference.h"

/* starting interface:    nsIWeakReference */
#define NS_IWEAKREFERENCE_IID_STR "9188bc85-f92e-11d2-81ef-0060083a0bcf"

#define NS_IWEAKREFERENCE_IID \
  {0x9188bc85, 0xf92e, 0x11d2, \
    { 0x81, 0xef, 0x00, 0x60, 0x08, 0x3a, 0x0b, 0xcf }}

class nsIWeakReference : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWEAKREFERENCE_IID)

  /* void QueryReferent (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  NS_IMETHOD QueryReferent(const nsIID & uuid, void **result) = 0;

     virtual size_t SizeOfOnlyThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIWeakReference, NS_IWEAKREFERENCE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIWEAKREFERENCE \
  NS_IMETHOD QueryReferent(const nsIID & uuid, void **result) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIWEAKREFERENCE(_to) \
  NS_IMETHOD QueryReferent(const nsIID & uuid, void **result) MOZ_OVERRIDE { return _to QueryReferent(uuid, result); } \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIWEAKREFERENCE(_to) \
  NS_IMETHOD QueryReferent(const nsIID & uuid, void **result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->QueryReferent(uuid, result); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsWeakReference : public nsIWeakReference
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIWEAKREFERENCE

  nsWeakReference();

{
  /* destructor code */
}

/* void QueryReferent (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
NS_IMETHODIMP nsWeakReference::QueryReferent(const nsIID & uuid, void **result)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 91 "../../dist/include/nsIWeakReference.h"


/* starting interface:    nsISupportsWeakReference */
#define NS_ISUPPORTSWEAKREFERENCE_IID_STR "9188bc86-f92e-11d2-81ef-0060083a0bcf"

#define NS_ISUPPORTSWEAKREFERENCE_IID \
  {0x9188bc86, 0xf92e, 0x11d2, \
    { 0x81, 0xef, 0x00, 0x60, 0x08, 0x3a, 0x0b, 0xcf }}

class NS_NO_VTABLE nsISupportsWeakReference : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISUPPORTSWEAKREFERENCE_IID)

  /* nsIWeakReference GetWeakReference (); */
  NS_IMETHOD GetWeakReference(nsIWeakReference * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsISupportsWeakReference, NS_ISUPPORTSWEAKREFERENCE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISUPPORTSWEAKREFERENCE \
  NS_IMETHOD GetWeakReference(nsIWeakReference * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISUPPORTSWEAKREFERENCE(_to) \
  NS_IMETHOD GetWeakReference(nsIWeakReference * *_retval) MOZ_OVERRIDE { return _to GetWeakReference(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISUPPORTSWEAKREFERENCE(_to) \
  NS_IMETHOD GetWeakReference(nsIWeakReference * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWeakReference(_retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsSupportsWeakReference : public nsISupportsWeakReference
{
public:
  NS_DECL_ISUPPORTS
#endif
# 164 "../../dist/include/nsIWeakReference.h"

#ifdef MOZILLA_INTERNAL_API
#if 0 /* expanded by -frewrite-includes */
#include "nsIWeakReferenceUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIWeakReferenceUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsIWeakReferenceUtils_h__
#define nsIWeakReferenceUtils_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIWeakReferenceUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIWeakReference.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIWeakReference.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIWeakReference.idl
 */

#ifndef __gen_nsIWeakReference_h__
#define __gen_nsIWeakReference_h__

  /* void QueryReferent (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  NS_IMETHOD QueryReferent(const nsIID & uuid, void **result) = 0;

     virtual size_t SizeOfOnlyThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIWeakReference, NS_IWEAKREFERENCE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIWEAKREFERENCE \
  NS_IMETHOD QueryReferent(const nsIID & uuid, void **result) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIWEAKREFERENCE(_to) \
  NS_IMETHOD QueryReferent(const nsIID & uuid, void **result) MOZ_OVERRIDE { return _to QueryReferent(uuid, result); } \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIWEAKREFERENCE(_to) \
  NS_IMETHOD QueryReferent(const nsIID & uuid, void **result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->QueryReferent(uuid, result); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsWeakReference : public nsIWeakReference
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIWEAKREFERENCE

{
  /* destructor code */
}

/* nsIWeakReference GetWeakReference (); */
NS_IMETHODIMP nsSupportsWeakReference::GetWeakReference(nsIWeakReference * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 164 "../../dist/include/nsIWeakReference.h"

#ifdef MOZILLA_INTERNAL_API
#if 0 /* expanded by -frewrite-includes */
#include "nsIWeakReferenceUtils.h"
#endif /* expanded by -frewrite-includes */
# 167 "../../dist/include/nsIWeakReference.h"
#endif
# 168 "../../dist/include/nsIWeakReference.h"

#endif /* __gen_nsIWeakReference_h__ */
# 170 "../../dist/include/nsIWeakReference.h"
# 12 "../../dist/include/nsIWeakReferenceUtils.h" 2

typedef nsCOMPtr<nsIWeakReference> nsWeakPtr;



class MOZ_STACK_CLASS nsQueryReferent : public nsCOMPtr_helper
{
public:
  nsQueryReferent(nsIWeakReference* aWeakPtr, nsresult* aError)
    : mWeakPtr(aWeakPtr)
    , mErrorPtr(aError)
  {
  }

  virtual nsresult NS_FASTCALL operator()(const nsIID& aIID, void**) const
    MOZ_OVERRIDE;

private:
  nsIWeakReference* MOZ_NON_OWNING_REF mWeakPtr;
  nsresult*          mErrorPtr;
};

inline const nsQueryReferent
do_QueryReferent(nsIWeakReference* aRawPtr, nsresult* aError = 0)
{
  return nsQueryReferent(aRawPtr, aError);
}


/**
 * Deprecated, use |do_GetWeakReference| instead.
 */
extern nsIWeakReference* NS_GetWeakReference(nsISupports*,
                                             nsresult* aResult = 0);

/**
 * |do_GetWeakReference| is a convenience function that bundles up all the work needed
 * to get a weak reference to an arbitrary object, i.e., the |QueryInterface|, test, and
 * call through to |GetWeakReference|, and put it into your |nsCOMPtr|.
 * It is specifically designed to cooperate with |nsCOMPtr| (or |nsWeakPtr|) like so:
 * |nsWeakPtr myWeakPtr = do_GetWeakReference(aPtr);|.
 */
inline already_AddRefed<nsIWeakReference>
do_GetWeakReference(nsISupports* aRawPtr, nsresult* aError = 0)
{
  return dont_AddRef(NS_GetWeakReference(aRawPtr, aError));
}

inline void
do_GetWeakReference(nsIWeakReference* aRawPtr, nsresult* aError = 0)
{
  // This signature exists solely to _stop_ you from doing a bad thing.
  //  Saying |do_GetWeakReference()| on a weak reference itself,
  //  is very likely to be a programmer error.
}

template<class T>
inline void
do_GetWeakReference(already_AddRefed<T>&)
{
  // This signature exists solely to _stop_ you from doing the bad thing.
  //  Saying |do_GetWeakReference()| on a pointer that is not otherwise owned by
  //  someone else is an automatic leak.  See <http://bugzilla.mozilla.org/show_bug.cgi?id=8221>.
}

template<class T>
inline void
do_GetWeakReference(already_AddRefed<T>&, nsresult*)
{
  // This signature exists solely to _stop_ you from doing the bad thing.
  //  Saying |do_GetWeakReference()| on a pointer that is not otherwise owned by
  //  someone else is an automatic leak.  See <http://bugzilla.mozilla.org/show_bug.cgi?id=8221>.
}

#endif
# 103 "../../dist/include/nsIWeakReferenceUtils.h"
# 167 "../../dist/include/nsIWeakReference.h" 2
#endif
# 168 "../../dist/include/nsIWeakReference.h"

#endif /* __gen_nsIWeakReference_h__ */
# 170 "../../dist/include/nsIWeakReference.h"
# 22 "../../dist/include/mozilla/dom/FragmentOrElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsNodeUtils.h"                  // class member nsNodeUtils::CloneNodeImpl
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsNodeUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsNodeUtils_h___
#define nsNodeUtils_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsIContent.h"          // for use in inline function (ParentChainChanged)
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsNodeUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIMutationObserver.h" // for use in inline function (ParentChainChanged)
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsIMutationObserver.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsIMutationObserver_h
#define nsIMutationObserver_h

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsIMutationObserver.h"

class nsIAtom;
class nsIContent;
class nsIDocument;
class nsINode;

namespace mozilla {
namespace dom {
class Element;
} // namespace dom
} // namespace mozilla

#define NS_IMUTATION_OBSERVER_IID \
{ 0x16fe5e3e, 0xeadc, 0x4312, \
  { 0x9d, 0x44, 0xb6, 0xbe, 0xdd, 0x6b, 0x54, 0x74 } }

/**
 * Information details about a characterdata change.  Basically, we
 * view all changes as replacements of a length of text at some offset
 * with some other text (of possibly some other length).
 */
struct CharacterDataChangeInfo
{
  /**
   * True if this character data change is just an append.
   */
  bool mAppend;

  /**
   * The offset in the text where the change occurred.
   */
  uint32_t mChangeStart;

  /**
   * The offset such that mChangeEnd - mChangeStart is equal to the length of
   * the text we removed. If this was a pure insert or append, this is equal to
   * mChangeStart.
   */
  uint32_t mChangeEnd;

  /**
   * The length of the text that was inserted in place of the removed text.  If
   * this was a pure text removal, this is 0.
   */
  uint32_t mReplaceLength;

  /**
   * The net result is that mChangeStart characters at the beginning of the
   * text remained as they were.  The next mChangeEnd - mChangeStart characters
   * were removed, and mReplaceLength characters were inserted in their place.
   * The text that used to begin at mChangeEnd now begins at
   * mChangeStart + mReplaceLength.
   */

  struct Details {
    enum {
      eMerge,  // two text nodes are merged as a result of normalize()
      eSplit   // a text node is split as a result of splitText()
    } mType;
    /**
     * For eMerge it's the text node that will be removed, for eSplit it's the
     * new text node.
     */
    nsIContent* mNextSibling;
  };

  /**
   * Used for splitText() and normalize(), otherwise null.
   */
  Details* mDetails;
};

/**
 * Mutation observer interface
 *
 * See nsINode::AddMutationObserver, nsINode::RemoveMutationObserver for how to
 * attach or remove your observers.
 *
 * WARNING: During these notifications, you are not allowed to perform
 * any mutations to the current or any other document, or start a
 * network load.  If you need to perform such operations do that
 * during the _last_ nsIDocumentObserver::EndUpdate notification.  The
 * expection for this is ParentChainChanged, where mutations should be
 * done from an async event, as the notification might not be
 * surrounded by BeginUpdate/EndUpdate calls.
 */
class nsIMutationObserver : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMUTATION_OBSERVER_IID)

  /**
   * Notification that the node value of a data node (text, cdata, pi, comment)
   * will be changed.
   *
   * This notification is not sent when a piece of content is
   * added/removed from the document (the other notifications are used
   * for that).
   *
   * @param aDocument The owner-document of aContent. Can be null.
   * @param aContent  The piece of content that changed. Is never null.
   * @param aInfo     The structure with information details about the change.
   *
   * @note Callers of this method might not hold a strong reference to the
   *       observer.  The observer is responsible for making sure it stays
   *       alive for the duration of the call as needed.  The observer may
   *       assume that this call will happen when there are script blockers on
   *       the stack.
   */
  virtual void CharacterDataWillChange(nsIDocument *aDocument,
                                       nsIContent* aContent,
                                       CharacterDataChangeInfo* aInfo) = 0;

  /**
   * Notification that the node value of a data node (text, cdata, pi, comment)
   * has changed.
   *
   * This notification is not sent when a piece of content is
   * added/removed from the document (the other notifications are used
   * for that).
   *
   * @param aDocument The owner-document of aContent. Can be null.
   * @param aContent  The piece of content that changed. Is never null.
   * @param aInfo     The structure with information details about the change.
   *
   * @note Callers of this method might not hold a strong reference to the
   *       observer.  The observer is responsible for making sure it stays
   *       alive for the duration of the call as needed.  The observer may
   *       assume that this call will happen when there are script blockers on
   *       the stack.
   */
  virtual void CharacterDataChanged(nsIDocument *aDocument,
                                    nsIContent* aContent,
                                    CharacterDataChangeInfo* aInfo) = 0;

  /**
   * Notification that an attribute of an element will change.  This
   * can happen before the BeginUpdate for the change and may not
   * always be followed by an AttributeChanged (in particular, if the
   * attribute doesn't actually change there will be no corresponding
   * AttributeChanged).
   *
   * @param aDocument    The owner-document of aContent. Can be null.
   * @param aContent     The element whose attribute will change
   * @param aNameSpaceID The namespace id of the changing attribute
   * @param aAttribute   The name of the changing attribute
   * @param aModType     Whether or not the attribute will be added, changed, or
   *                     removed. The constants are defined in
   *                     nsIDOMMutationEvent.h.
   *
   * @note Callers of this method might not hold a strong reference to the
   *       observer.  The observer is responsible for making sure it stays
   *       alive for the duration of the call as needed.  The observer may
   *       assume that this call will happen when there are script blockers on
   *       the stack.
   */
  virtual void AttributeWillChange(nsIDocument* aDocument,
                                   mozilla::dom::Element* aElement,
                                   int32_t      aNameSpaceID,
                                   nsIAtom*     aAttribute,
                                   int32_t      aModType) = 0;

  /**
   * Notification that an attribute of an element has changed.
   *
   * @param aDocument    The owner-document of aContent. Can be null.
   * @param aElement     The element whose attribute changed
   * @param aNameSpaceID The namespace id of the changed attribute
   * @param aAttribute   The name of the changed attribute
   * @param aModType     Whether or not the attribute was added, changed, or
   *                     removed. The constants are defined in
   *                     nsIDOMMutationEvent.h.
   *
   * @note Callers of this method might not hold a strong reference to the
   *       observer.  The observer is responsible for making sure it stays
   *       alive for the duration of the call as needed.  The observer may
   *       assume that this call will happen when there are script blockers on
   *       the stack.
   */
  virtual void AttributeChanged(nsIDocument* aDocument,
                                mozilla::dom::Element* aElement,
                                int32_t      aNameSpaceID,
                                nsIAtom*     aAttribute,
                                int32_t      aModType) = 0;

  virtual void ContentAppended(nsIDocument *aDocument,
                               nsIContent* aContainer,
                               nsIContent* aFirstNewContent,
                               int32_t     aNewIndexInContainer) = 0;

  /**
   * Notification that a content node has been inserted as child to another
   */
  virtual void ContentInserted(nsIDocument *aDocument,
                               nsIContent* aContainer,
                               nsIContent* aChild,
                               int32_t aIndexInContainer) = 0;

  /**
   * Notification that a content node has been removed from the child list of
   * another node in the tree.
   *
   * @param aDocument  The owner-document of aContent, or, when aContainer
   *                   is null, the container that had the child removed.
   *                   Can be null.
   * @param aContainer The container that had new a child removed. Can be
   *                   null to indicate that the child was removed from
   *                   aDocument.
   * @param aChild     The child that was removed.
   * @param aIndexInContainer The index in the container which the child used
   *                          to have.
   * @param aPreviousSibling The previous sibling to the child that was removed.
   *                         Can be null if there was no previous sibling.
   *
   * @note Callers of this method might not hold a strong reference to the
   *       observer.  The observer is responsible for making sure it stays
   *       alive for the duration of the call as needed.  The observer may
   *       assume that this call will happen when there are script blockers on
   *       the stack.
   */
  virtual void ContentRemoved(nsIDocument *aDocument,
                              nsIContent* aContainer,
                              nsIContent* aChild,
                              int32_t aIndexInContainer,
                              nsIContent* aPreviousSibling) = 0;

 /**
   * The node is in the process of being destroyed. Calling QI on the node is
   * not supported, however it is possible to get children and flags through
   * nsINode as well as calling IsNodeOfType(eCONTENT) and casting to
   * nsIContent to get attributes.
   *
   * NOTE: This notification is only called on observers registered directly
   * on the node. This is because when the node is destroyed it can not have
   * any ancestors. If you want to know when a descendant node is being
   * removed from the observed node, use the ContentRemoved notification.
   * 
   * @param aNode The node being destroyed.
   *
   * @note Callers of this method might not hold a strong reference to
   *       the observer.  The observer is responsible for making sure it
   *       stays alive for the duration of the call as needed.
   */
  virtual void NodeWillBeDestroyed(const nsINode *aNode) = 0;

  /**
   * Notification that the node's parent chain has changed. This
   * happens when either the node or one of its ancestors is inserted
   * or removed as a child of another node.
   *
   * Note that when a node is inserted this notification is sent to
   * all descendants of that node, since all such nodes have their
   * parent chain changed.
   *
   * @param aContent  The piece of content that had its parent changed.
   *
   * @note Callers of this method might not hold a strong reference to
   *       the observer.  The observer is responsible for making sure it
   *       stays alive for the duration of the call as needed.
   */

  virtual void ParentChainChanged(nsIContent *aContent) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIMutationObserver, NS_IMUTATION_OBSERVER_IID)

#define NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATAWILLCHANGE                  \
    virtual void CharacterDataWillChange(nsIDocument* aDocument,             \
                                         nsIContent* aContent,               \
                                         CharacterDataChangeInfo* aInfo) MOZ_OVERRIDE;

#define NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED                     \
    virtual void CharacterDataChanged(nsIDocument* aDocument,                \
                                      nsIContent* aContent,                  \
                                      CharacterDataChangeInfo* aInfo) MOZ_OVERRIDE;

#define NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTEWILLCHANGE                      \
    virtual void AttributeWillChange(nsIDocument* aDocument,                 \
                                     mozilla::dom::Element* aElement,        \
                                     int32_t aNameSpaceID,                   \
                                     nsIAtom* aAttribute,                    \
                                     int32_t aModType) MOZ_OVERRIDE;

#define NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED                         \
    virtual void AttributeChanged(nsIDocument* aDocument,                    \
                                  mozilla::dom::Element* aElement,           \
                                  int32_t aNameSpaceID,                      \
                                  nsIAtom* aAttribute,                       \
                                  int32_t aModType) MOZ_OVERRIDE;

#define NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED                          \
    virtual void ContentAppended(nsIDocument* aDocument,                     \
                                 nsIContent* aContainer,                     \
                                 nsIContent* aFirstNewContent,               \
                                 int32_t aNewIndexInContainer) MOZ_OVERRIDE;

#define NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED                          \
    virtual void ContentInserted(nsIDocument* aDocument,                     \
                                 nsIContent* aContainer,                     \
                                 nsIContent* aChild,                         \
                                 int32_t aIndexInContainer) MOZ_OVERRIDE;

#define NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED                           \
    virtual void ContentRemoved(nsIDocument* aDocument,                      \
                                nsIContent* aContainer,                      \
                                nsIContent* aChild,                          \
                                int32_t aIndexInContainer,                   \
                                nsIContent* aPreviousSibling) MOZ_OVERRIDE;

#define NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED                      \
    virtual void NodeWillBeDestroyed(const nsINode* aNode) MOZ_OVERRIDE;

#define NS_DECL_NSIMUTATIONOBSERVER_PARENTCHAINCHANGED                       \
    virtual void ParentChainChanged(nsIContent *aContent) MOZ_OVERRIDE;

#define NS_DECL_NSIMUTATIONOBSERVER                                          \
    NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATAWILLCHANGE                      \
    NS_DECL_NSIMUTATIONOBSERVER_CHARACTERDATACHANGED                         \
    NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTEWILLCHANGE                          \
    NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED                             \
    NS_DECL_NSIMUTATIONOBSERVER_CONTENTAPPENDED                              \
    NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED                              \
    NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED                               \
    NS_DECL_NSIMUTATIONOBSERVER_NODEWILLBEDESTROYED                          \
    NS_DECL_NSIMUTATIONOBSERVER_PARENTCHAINCHANGED

#define NS_IMPL_NSIMUTATIONOBSERVER_CORE_STUB(_class)                     \
void                                                                      \
_class::NodeWillBeDestroyed(const nsINode* aNode)                               \
{                                                                         \
}

#define NS_IMPL_NSIMUTATIONOBSERVER_CONTENT(_class)                       \
void                                                                      \
_class::CharacterDataWillChange(nsIDocument* aDocument,                   \
                                nsIContent* aContent,                     \

// See below for the definition of nsCOMArray<T>

// a class that's nsISupports-specific, so that we can contain the
// work of this class in the XPCOM dll
class nsCOMArray_base
{
  friend class nsArrayBase;
protected:
  
  explicit nsCOMArray_base(int32_t aCount) : mArray(aCount) {}
  ;
  ;

  ;
  

  ;
  
  
  
  
  bool RemoveObject(nsISupports* aObject);
  
  void SwapElements(nsCOMArray_base& aOther)
  {
    mArray.SwapElements(aOther.mArray);
  }

  ;
  ;
public:
  // elements in the array (including null elements!)
  int32_t Count() const { return mArray.Length(); }
  // nsTArray-compatible version
  uint32_t Length() const { return mArray.Length(); }
  

  // If the array grows, the newly created entries will all be null;
  // if the array shrinks, the excess entries will all be released.
  ;
  // nsTArray-compatible version
  

  // remove all elements in the array, and call NS_RELEASE on each one
  void Clear();

  nsISupports* ObjectAt(int32_t aIndex) const { return mArray[aIndex]; }
  // nsTArray-compatible version
  nsISupports* ElementAt(uint32_t aIndex) const { return mArray[aIndex]; }

  
  // nsTArray-compatible version
  nsISupports* SafeElementAt(uint32_t aIndex) const
  {
    return mArray.SafeElementAt(aIndex, nullptr);
  }

  nsISupports* operator[](int32_t aIndex) const { return mArray[aIndex]; }

  // remove an element at a specific position, shrinking the array
  // as necessary
  ;
  // nsTArray-compatible version
  ;

  // remove a range of elements at a specific position, shrinking the array
  // as necessary
  ;
  // nsTArray-compatible version
  ;

  

  // Ensures there is enough space to store a total of aCapacity objects.
  // This method never deletes any objects.
  
  

  typedef size_t (*nsBaseArraySizeOfElementIncludingThisFunc)(
    nsISupports* aElement, mozilla::MallocSizeOf aMallocSizeOf, void* aData);

  // Measures the size of the array's element storage, and if
  // |aSizeOfElement| is non-nullptr, measures the size of things pointed to
  // by elements.
  ;

private:

  // the actual storage
  nsTArray<nsISupports*> mArray;

  // don't implement these, defaults will muck with refcounts!
  nsCOMArray_base& operator=(const nsCOMArray_base& aOther) = delete;
};

inline void
ImplCycleCollectionUnlink(nsCOMArray_base& aField)
{
  aField.Clear();
}

inline void
ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
                            nsCOMArray_base& aField,
                            const char* aName,
                            uint32_t aFlags = 0)
{
  aFlags |= CycleCollectionEdgeNameArrayFlag;
  int32_t length = aField.Count();
  for (int32_t i = 0; i < length; ++i) {
    CycleCollectionNoteChild(aCallback, aField[i], aName, aFlags);
  }
}


// a non-XPCOM, refcounting array of XPCOM objects
// used as a member variable or stack variable - this object is NOT
// refcounted, but the objects that it holds are
//
// most of the read-only accessors like ObjectAt()/etc do NOT refcount
// on the way out. This means that you can do one of two things:
//
// * does an addref, but holds onto a reference
// nsCOMPtr<T> foo = array[i];
//
// * avoids the refcount, but foo might go stale if array[i] is ever
// * modified/removed. Be careful not to NS_RELEASE(foo)!
// T* foo = array[i];
//
// This array will accept null as an argument for any object, and will
// store null in the array, just like nsVoidArray. But that also means
// that methods like ObjectAt() may return null when referring to an
// existing, but null entry in the array.
template<class T>
class nsCOMArray : public nsCOMArray_base
{
public:
  nsCOMArray() {}
  explicit nsCOMArray(int32_t aCount) : nsCOMArray_base(aCount) {}
  explicit nsCOMArray(const nsCOMArray<T>& aOther) : nsCOMArray_base(aOther) {}
  nsCOMArray(nsCOMArray<T>&& aOther) { SwapElements(aOther); }

  /**
   * Export the contents of this array to an XPIDL outparam. The array will be
   * Clear()'d after this operation.
   *
   * Example usage:
   * nsCOMArray<nsISomeInterface> array;
   * *length = array.Forget(retval);
   */
  

private:

  // don't implement these!
  nsCOMArray<T>& operator=(const nsCOMArray<T>& aOther) = delete;
};

template<typename T>
inline void
ImplCycleCollectionUnlink(nsCOMArray<T>& aField)
{
  aField.Clear();
}



#endif
# 478 "../../dist/include/nsCOMArray.h"
# 13 "/Users/luser/build/mozilla-central/dom/base/nsNodeUtils.h" 2

struct CharacterDataChangeInfo;
class nsIVariant;
class nsIDOMNode;
template<class E> class nsCOMArray;
class nsCycleCollectionTraversalCallback;

class nsNodeUtils
{
public:
  /**
   * Send CharacterDataWillChange notifications to nsIMutationObservers.
   * @param aContent  Node whose data changed
   * @param aInfo     Struct with information details about the change
   * @see nsIMutationObserver::CharacterDataWillChange
   */
  ;

  /**
   * Send CharacterDataChanged notifications to nsIMutationObservers.
   * @param aContent  Node whose data changed
   */
  ;
};

#endif // nsNodeUtils_h___
# 279 "/Users/luser/build/mozilla-central/dom/base/nsNodeUtils.h"
# 23 "../../dist/include/mozilla/dom/FragmentOrElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIHTMLCollection.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/html/nsIHTMLCollection.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsIHTMLCollection_h___
#define nsIHTMLCollection_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMHTMLCollection.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMHTMLCollection.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMHTMLCollection.idl
 */

#ifndef __gen_nsIDOMHTMLCollection_h__
#define __gen_nsIDOMHTMLCollection_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMHTMLCollection.h"
#endif
# 12 "../../dist/include/nsIDOMHTMLCollection.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMHTMLCollection.h"

/* starting interface:    nsIDOMHTMLCollection */
#define NS_IDOMHTMLCOLLECTION_IID_STR "bb07f567-5b37-4172-92aa-7d00ceed4809"

#define NS_IDOMHTMLCOLLECTION_IID \
  {0xbb07f567, 0x5b37, 0x4172, \
    { 0x92, 0xaa, 0x7d, 0x00, 0xce, 0xed, 0x48, 0x09 }}

class NS_NO_VTABLE nsIDOMHTMLCollection : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMHTMLCOLLECTION_IID)

  /* readonly attribute unsigned long length; */
  NS_IMETHOD GetLength(uint32_t *aLength) = 0;

  /* nsIDOMNode item (in unsigned long index); */
  NS_IMETHOD Item(uint32_t index, nsIDOMNode * *_retval) = 0;

  /* nsIDOMNode namedItem (in DOMString name); */
  NS_IMETHOD NamedItem(const nsAString & name, nsIDOMNode * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMHTMLCollection, NS_IDOMHTMLCOLLECTION_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMHTMLCOLLECTION \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE; \
  NS_IMETHOD Item(uint32_t index, nsIDOMNode * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD NamedItem(const nsAString & name, nsIDOMNode * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMHTMLCOLLECTION(_to) \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return _to GetLength(aLength); } \
  NS_IMETHOD Item(uint32_t index, nsIDOMNode * *_retval) MOZ_OVERRIDE { return _to Item(index, _retval); } \
  NS_IMETHOD NamedItem(const nsAString & name, nsIDOMNode * *_retval) MOZ_OVERRIDE { return _to NamedItem(name, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMHTMLCOLLECTION(_to) \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLength(aLength); } \
  NS_IMETHOD Item(uint32_t index, nsIDOMNode * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Item(index, _retval); } \
  NS_IMETHOD NamedItem(const nsAString & name, nsIDOMNode * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->NamedItem(name, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMHTMLCollection : public nsIDOMHTMLCollection
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMHTMLCOLLECTION

  nsDOMHTMLCollection();

private:
  ~nsDOMHTMLCollection();

protected:
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 113 "../../dist/include/nsIDOMHTMLCollection.h"


#endif /* __gen_nsIDOMHTMLCollection_h__ */
# 116 "../../dist/include/nsIDOMHTMLCollection.h"
# 10 "/Users/luser/build/mozilla-central/dom/html/nsIHTMLCollection.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTArrayForwardDeclare.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/html/nsIHTMLCollection.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/html/nsIHTMLCollection.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/html/nsIHTMLCollection.h"

class nsINode;
class nsString;

namespace mozilla {
class ErrorResult;

namespace dom {
class Element;
} // namespace dom
} // namespace mozilla

// IID for the nsIHTMLCollection interface
#define NS_IHTMLCOLLECTION_IID \
{ 0x4e169191, 0x5196, 0x4e17, \
  { 0xa4, 0x79, 0xd5, 0x35, 0x0b, 0x5b, 0x0a, 0xcd } }

/**
 * An internal interface
 */
class nsIHTMLCollection : public nsIDOMHTMLCollection
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTMLCOLLECTION_IID)

  /**
   * Get the root node for this HTML collection.
   */
  ;

  using nsIDOMHTMLCollection::Item;
  using nsIDOMHTMLCollection::NamedItem;

  uint32_t Length()
  {
    uint32_t length;
    GetLength(&length);
    return length;
  }
  virtual mozilla::dom::Element* GetElementAt(uint32_t index) = 0;
  mozilla::dom::Element* Item(uint32_t index)
  {
    return GetElementAt(index);
  }
  
  
  mozilla::dom::Element* NamedGetter(const nsAString& aName, bool& aFound)
  {
    return GetFirstNamedElement(aName, aFound);
  }
  
  virtual mozilla::dom::Element*
  GetFirstNamedElement(const nsAString& aName, bool& aFound) = 0;

  ;

  
  ;
protected:
  virtual JSObject* GetWrapperPreserveColorInternal() = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIHTMLCollection, NS_IHTMLCOLLECTION_IID)

#endif /* nsIHTMLCollection_h___ */
# 94 "/Users/luser/build/mozilla-central/dom/html/nsIHTMLCollection.h"
# 24 "../../dist/include/mozilla/dom/FragmentOrElement.h" 2

class ContentUnbinder;
class nsContentList;
class nsDOMAttributeMap;
class nsDOMTokenList;
class nsIControllers;
class nsICSSDeclaration;
class nsIDocument;
class nsDOMStringMap;
class nsIURI;

namespace mozilla {
namespace dom {
class Element;
}
}

/**
 * Class that implements the nsIDOMNodeList interface (a list of children of
 * the content), by holding a reference to the content and delegating GetLength
 * and Item to its existing child list.
 * @see nsIDOMNodeList
 */
class nsChildContentList MOZ_FINAL : public nsINodeList
{
public:
  

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsChildContentList)
  

  // The node whose children make up the list (weak reference)
  nsINode* mNode;
};

/**
 * A class that implements nsIWeakReference
 */

class nsNodeWeakReference MOZ_FINAL : public nsIWeakReference
{
public:
  

  // nsISupports
  NS_DECL_ISUPPORTS

  // nsIWeakReference
  NS_DECL_NSIWEAKREFERENCE
  virtual size_t SizeOfOnlyThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;

  

private:
  ;

  nsINode* mNode;
};

/**
 * Tearoff to use for nodes to implement nsISupportsWeakReference

private:
  ~nsNodeSupportsWeakRefTearoff() {}

  nsCOMPtr<nsINode> mNode;
};

/**
 * A generic base class for DOM elements, implementing many nsIContent,
 * nsIDOMNode and nsIDOMElement methods.
 */
namespace mozilla {
namespace dom {

class ShadowRoot;
class UndoManager;

class FragmentOrElement : public nsIContent
{
public:
  explicit FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
  explicit FragmentOrElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS

  NS_DECL_SIZEOF_EXCLUDING_THIS

  // nsINode interface methods
  virtual uint32_t GetChildCount() const MOZ_OVERRIDE;
  virtual nsIContent *GetChildAt(uint32_t aIndex) const MOZ_OVERRIDE;
  virtual nsIContent * const * GetChildArray(uint32_t* aChildCount) const MOZ_OVERRIDE;
  virtual int32_t IndexOf(const nsINode* aPossibleChild) const MOZ_OVERRIDE;
  virtual nsIContent *GetXBLInsertionParent() const MOZ_OVERRIDE;
  virtual void SetXBLInsertionParent(nsIContent* aContent) MOZ_OVERRIDE;
  virtual bool IsLink(nsIURI** aURI) const MOZ_OVERRIDE;

  virtual CustomElementData *GetCustomElementData() const MOZ_OVERRIDE;
  virtual void SetCustomElementData(CustomElementData* aData) MOZ_OVERRIDE;

  virtual void DestroyContent() MOZ_OVERRIDE;
  virtual void SaveSubtreeState() MOZ_OVERRIDE;

  NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) MOZ_OVERRIDE;

  nsIHTMLCollection* Children();
  uint32_t ChildElementCount()
  {
    return Children()->Length();
  }

  /**
   * Sets the IsElementInStyleScope flag on each element in the subtree rooted
   * at this node, including any elements reachable through shadow trees.
   *
   * @param aInStyleScope The flag value to set.
   */
  ;

public:
  /**
   * If there are listeners for DOMNodeInserted event, fires the event on all
   * aNodes
   */
  ;

  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(FragmentOrElement)

  /**
   * Fire a DOMNodeRemoved mutation event for all children of this node
   */
  ;

  virtual bool OwnedOnlyByTheDOMTree() MOZ_OVERRIDE
  {
    uint32_t rc = mRefCnt.get();
    if (GetParent()) {
      --rc;
    }
    rc -= mAttrsAndChildren.ChildCount();
    return rc == 0;
  }

  virtual bool IsPurple() MOZ_OVERRIDE
  {
    return mRefCnt.IsPurple();
  }

  virtual void RemovePurple() MOZ_OVERRIDE
  {
    mRefCnt.RemovePurple();
  }

  ;
  ;
  ;
  ;
  ;
  static void MarkNodeChildren(nsINode* aNode);
  ;
  ;

  /**
   * Is the HTML local name a void element?
   */
  ;
protected:
  virtual ~FragmentOrElement();

  /**
   * Copy attributes and state to another element
   * @param aDest the object to copy to
   */
  ;

public:
  // Because of a bug in MS C++ compiler nsDOMSlots must be declared public,
  // otherwise nsXULElement::nsXULSlots doesn't compile.
  /**
   * There are a set of DOM- and scripting-specific instance variables
   * that may only be instantiated when a content object is accessed
   * through the DOM. Rather than burn actual slots in the content
   * objects for each of these instance variables, we put them off
   * in a side structure that's only allocated when the content is
   * accessed through the DOM.
   */
  class nsDOMSlots : public nsINode::nsSlots
  {
  public:
    ;
    ;

    ;
    ;

    ;

    /**
     * The .style attribute (an interface that forwards to the actual
     * style rules)
     * @see nsGenericHTMLElement::GetStyle
     */
    nsCOMPtr<nsICSSDeclaration> mStyle;

    /**

    /**
     * Holds any SMIL override style rules for this element.
     */
    nsRefPtr<mozilla::css::StyleRule> mSMILOverrideStyleRule;

    /**
     * An object implementing nsIDOMMozNamedAttrMap for this content (attributes)
     * @see FragmentOrElement::GetAttributes
     */
    nsRefPtr<nsDOMAttributeMap> mAttributeMap;

    union {
      /**
      * The nearest enclosing content node with a binding that created us.
      * @see FragmentOrElement::GetBindingParent
      */
      nsIContent* mBindingParent;  // [Weak]

      /**
      * The controllers of the XUL Element.
      */
      nsIControllers* mControllers; // [OWNER]
    };

    /**
     * An object implementing the .children property for this element.
     */
    nsCOMPtr<nsIContent> mXBLInsertionParent;

    /**
     * Web components custom element data.
     */
    nsRefPtr<CustomElementData> mCustomElementData;
  };

protected:
  ;
  ;

  // Override from nsINode
  virtual nsINode::nsSlots* CreateSlots() MOZ_OVERRIDE;

  nsDOMSlots *DOMSlots()
  {
    return static_cast<nsDOMSlots*>(Slots());
  }

  nsDOMSlots *GetExistingDOMSlots() const
  {
    return static_cast<nsDOMSlots*>(GetExistingSlots());
  }

  /**
   * Calls SetIsElementInStyleScopeFlagOnSubtree for each shadow tree attached
   * to this node, which is assumed to be an Element.
   *
   * @param aInStyleScope The IsElementInStyleScope flag value to set.
   */
  ;

  friend class ::ContentUnbinder;
  /**
   * Array containing all attributes and children for this element
   */
  nsAttrAndChildArray mAttrsAndChildren;
};

} // namespace dom
} // namespace mozilla

#define NS_ELEMENT_INTERFACE_TABLE_TO_MAP_SEGUE                               \
    if (NS_SUCCEEDED(rv))                                                     \
      return rv;                                                              \
                                                                              \
    rv = FragmentOrElement::QueryInterface(aIID, aInstancePtr);               \
    NS_INTERFACE_TABLE_TO_MAP_SEGUE

#endif /* FragmentOrElement_h___ */
# 441 "../../dist/include/mozilla/dom/FragmentOrElement.h"
# 17 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsChangeHint.h"                  // for enum
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsChangeHint.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* constants for what needs to be recomputed in response to style changes */

#ifndef nsChangeHint_h___
#define nsChangeHint_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsChangeHint.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Types.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsChangeHint.h"

// Defines for various style related constants

enum nsChangeHint {
  // change was visual only (e.g., COLOR=)
  // Invalidates all descendant frames (including following
  // placeholders to out-of-flow frames).
  nsChangeHint_RepaintFrame = 0x01,

  // For reflow, we want flags to give us arbitrary FrameNeedsReflow behavior.
  // just do a FrameNeedsReflow.
  nsChangeHint_NeedReflow = 0x02,

  // Invalidate intrinsic widths on the frame's ancestors.  Must not be set
  // without setting nsChangeHint_NeedReflow.
  nsChangeHint_ClearAncestorIntrinsics = 0x04,

  // Invalidate intrinsic widths on the frame's descendants.  Must not be set
  // without also setting nsChangeHint_ClearAncestorIntrinsics.
  nsChangeHint_ClearDescendantIntrinsics = 0x08,

  // Force unconditional reflow of all descendants.  Must not be set without
  // setting nsChangeHint_NeedReflow, but is independent of both the
  // Clear*Intrinsics flags.
  nsChangeHint_NeedDirtyReflow = 0x10,

  // change requires view to be updated, if there is one (e.g., clip:).
  // Updates all descendants (including following placeholders to out-of-flows).
  nsChangeHint_SyncFrameView = 0x20,

  // The currently shown mouse cursor needs to be updated
  nsChangeHint_UpdateCursor = 0x40,

  /**
   * Used when the computed value (a URI) of one or more of an element's
   * filter/mask/clip/etc CSS properties changes, causing the element's frame
   * to start/stop referencing (or reference different) SVG resource elements.
   * (_Not_ used to handle changes to referenced resource elements.) Using this
   * hint results in nsSVGEffects::UpdateEffects being called on the element's
   * frame.
   */
  nsChangeHint_UpdateEffects = 0x80,

  /**
   * Visual change only, but the change can be handled entirely by
   * updating the layer(s) for the frame.
   * Updates all descendants (including following placeholders to out-of-flows).
   */
  nsChangeHint_UpdateOpacityLayer = 0x100,
  /**
   * Updates all descendants. Any placeholder descendants' out-of-flows
   * are also descendants of the transformed frame, so they're updated.
   */
  nsChangeHint_UpdateTransformLayer = 0x200,

  /**
   * Change requires frame change (e.g., display:).
   * This subsumes all the above. Reconstructs all frame descendants,
   * including following placeholders to out-of-flows.
   */
  nsChangeHint_ReconstructFrame = 0x400,

  /**
   * The frame's overflow area has changed. Does not update any descendant
   * frames.
   */
  nsChangeHint_UpdateOverflow = 0x800,

  /**
   * The overflow area of the frame and all of its descendants has changed. This
   * can happen through a text-decoration change.   
   */
  nsChangeHint_UpdateSubtreeOverflow = 0x1000,

  /**
   * The frame's overflow area has changed, through a change in its transform.
   * In other words, the frame's pre-transform overflow is unchanged, but
   * its post-transform overflow has changed, and thus its effect on its
   * parent's overflow has changed.  If the pre-transform overflow has
  /**
   * Behaves like ReconstructFrame, but only if the frame has descendants
   * that are absolutely or fixed position. Use this hint when a style change
   * has changed whether the frame is a container for fixed-pos or abs-pos
   * elements, but reframing is otherwise not needed.
   */
  nsChangeHint_AddOrRemoveTransform = 0x20000,

  /**
   * This change hint has *no* change handling behavior.  However, it
   * exists to be a non-inherited hint, because when the border-style
   * changes, and it's inherited by a child, that might require a reflow
   * due to the border-width change on the child.
   */
  nsChangeHint_BorderStyleNoneChange = 0x40000,

  /**
   * SVG textPath needs to be recomputed because the path has changed.
   * This means that the glyph positions of the text need to be recomputed.
   */
  nsChangeHint_UpdateTextPath = 0x80000,

  /**
   * This will schedule an invalidating paint. This is useful if something
   * has changed which will be invalidated by DLBI.
   */
  nsChangeHint_SchedulePaint = 0x100000,

  /**
   * A hint reflecting that style data changed with no change handling
   * behavior.  We need to return this, rather than NS_STYLE_HINT_NONE,
   * so that certain optimizations that manipulate the style context tree are
   * correct.
   *
   * nsChangeHint_NeutralChange must be returned by CalcDifference on a given
   * style struct if the data in the style structs are meaningfully different
   * and if no other change hints are returned.  If any other change hints are
   * set, then nsChangeHint_NeutralChange need not also be included, but it is
   * safe to do so.  (An example of style structs having non-meaningfully
   * different data would be cached information that would be re-calculated
   * to the same values, such as nsStyleBorder::mSubImages.)
   */
  nsChangeHint_NeutralChange = 0x200000,

  /**
   * This will cause rendering observers to be invalidated.
   */
  nsChangeHint_InvalidateRenderingObservers = 0x400000

  // IMPORTANT NOTE: When adding new hints, consider whether you need to
  // add them to NS_HintsNotHandledForDescendantsIn() below.  Please also
  // add them to RestyleManager::ChangeHintToString.
};

// Redefine these operators to return nothing. This will catch any use
// of these operators on hints. We should not be using these operators
// on nsChangeHints







// Operators on nsChangeHints

// Merge two hints, taking the union
inline nsChangeHint NS_CombineHint(nsChangeHint aH1, nsChangeHint aH2) {
  return (nsChangeHint)(aH1 | aH2);
}

// Merge two hints, taking the union


// Merge the "src" hint into the "dst" hint
// Returns true iff the destination changed
inline bool NS_UpdateHint(nsChangeHint& aDest, nsChangeHint aSrc) {
  nsChangeHint r = (nsChangeHint)(aDest | aSrc);
  bool changed = (int)r != (int)aDest;
  aDest = r;
  return changed;
}

// Returns true iff the second hint contains all the hints of the first hint
inline bool NS_IsHintSubset(nsChangeHint aSubset, nsChangeHint aSuperSet) {
  return (aSubset & aSuperSet) == aSubset;
}

/**
 * We have an optimization when processing change hints which prevents
 * us from visiting the descendants of a node when a hint on that node
 * is being processed.  This optimization does not apply in some of the
 * cases where applying a hint to an element does not necessarily result
 * in the same hint being handled on the descendants.
 */

// The most hints that NS_HintsNotHandledForDescendantsIn could possibly return:
#define nsChangeHint_Hints_NotHandledForDescendants nsChangeHint( \
          nsChangeHint_UpdateTransformLayer | \
          nsChangeHint_UpdateEffects | \
          nsChangeHint_InvalidateRenderingObservers | \
          nsChangeHint_UpdateOpacityLayer | \
          nsChangeHint_UpdateOverflow | \
          nsChangeHint_UpdatePostTransformOverflow | \
          nsChangeHint_UpdateParentOverflow | \
          nsChangeHint_ChildrenOnlyTransform | \
          nsChangeHint_RecomputePosition | \
          nsChangeHint_AddOrRemoveTransform | \
          nsChangeHint_BorderStyleNoneChange | \
          nsChangeHint_NeedReflow | \
          nsChangeHint_ClearAncestorIntrinsics)



// Redefine the old NS_STYLE_HINT constants in terms of the new hint structure
#define NS_STYLE_HINT_NONE \
  nsChangeHint(0)
#define NS_STYLE_HINT_VISUAL \
  nsChangeHint(nsChangeHint_RepaintFrame | nsChangeHint_SyncFrameView | \
               nsChangeHint_SchedulePaint)
#define nsChangeHint_AllReflowHints                     \
  nsChangeHint(nsChangeHint_NeedReflow |                \
               nsChangeHint_ClearAncestorIntrinsics |   \
               nsChangeHint_ClearDescendantIntrinsics | \
               nsChangeHint_NeedDirtyReflow)
#define NS_STYLE_HINT_REFLOW \
  nsChangeHint(NS_STYLE_HINT_VISUAL | nsChangeHint_AllReflowHints)
#define NS_STYLE_HINT_FRAMECHANGE \
  nsChangeHint(NS_STYLE_HINT_REFLOW | nsChangeHint_ReconstructFrame)

/**
 * |nsRestyleHint| is a bitfield for the result of
 * |HasStateDependentStyle| and |HasAttributeDependentStyle|.  When no
 * restyling is necessary, use |nsRestyleHint(0)|.
 *
 * Without eRestyle_Force or eRestyle_ForceDescendants, the restyling process
 * can stop processing at a frame when it detects no style changes and it is
 * known that the styles of the subtree beneath it will not change, leaving
 * the old style context on the frame.  eRestyle_Force can be used to skip this
 * optimization on a frame, and to force its new style context to be used.
 *
 * Similarly, eRestyle_ForceDescendants will cause the frame and all of its
 * descendants to be traversed and for the new style contexts that are created
 * to be set on the frames.
 *
 * NOTE: When adding new restyle hints, please also add them to
 * RestyleManager::RestyleHintToString.
 */
enum nsRestyleHint {
  // Rerun selector matching on the element.  If a new style context
  // results, update the style contexts of descendants.  (Irrelevant if
  // eRestyle_Subtree is also set, since that implies a superset of the
  // work.)
  eRestyle_Self = (1<<0),
};

// The functions below need an integral type to cast to to avoid
// infinite recursion.
typedef decltype(nsRestyleHint(0) + nsRestyleHint(0)) nsRestyleHint_size_t;

inline nsRestyleHint operator|(nsRestyleHint aLeft, nsRestyleHint aRight)
{
  return nsRestyleHint(nsRestyleHint_size_t(aLeft) |
                       nsRestyleHint_size_t(aRight));
}

inline nsRestyleHint operator&(nsRestyleHint aLeft, nsRestyleHint aRight)
{
  return nsRestyleHint(nsRestyleHint_size_t(aLeft) &
                       nsRestyleHint_size_t(aRight));
}







inline nsRestyleHint operator^(nsRestyleHint aLeft, nsRestyleHint aRight)
{
  return nsRestyleHint(nsRestyleHint_size_t(aLeft) ^
                       nsRestyleHint_size_t(aRight));
}



#endif /* nsChangeHint_h___ */
# 420 "../../dist/include/nsChangeHint.h"
# 18 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventStates.h"           // for member
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EventStates.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_EventStates_h_
#define mozilla_EventStates_h_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/EventStates.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/EventStates.h"

namespace mozilla {

/**
 * EventStates is the class used to represent the event states of nsIContent
 * instances. These states are calculated by IntrinsicState() and
 * ContentStatesChanged() has to be called when one of them changes thus
 * informing the layout/style engine of the change.
 * Event states are associated with pseudo-classes.
 */
class EventStates
{
public:
  typedef uint64_t InternalType;

  MOZ_CONSTEXPR 

  // NOTE: the ideal scenario would be to have the default constructor public
  // setting mStates to 0 and this constructor (without = 0) private.
  // In that case, we could be sure that only macros at the end were creating
  // EventStates instances with mStates set to something else than 0.
  // Unfortunately, this constructor is needed at at least two places now.
  explicit MOZ_CONSTEXPR EventStates(InternalType aStates)
    : mStates(aStates)
  {
  }

  EventStates MOZ_CONSTEXPR operator|(const EventStates& aEventStates) const
  {
    return EventStates(mStates | aEventStates.mStates);
  }

  EventStates& operator|=(const EventStates& aEventStates)
  {
    mStates |= aEventStates.mStates;
    return *this;
  }

  // NOTE: calling if (eventStates1 & eventStates2) will not build.
  // This might work correctly if operator bool() is defined
  // but using HasState, HasAllStates or HasAtLeastOneOfStates is recommended.
  

  EventStates& operator&=(const EventStates& aEventStates)
  {
    mStates &= aEventStates.mStates;
    return *this;
  }

  

  

  EventStates operator~() const
  {
    return EventStates(~mStates);
  }

  

  

  /**
   * Returns true if the EventStates instance is empty.
   * A EventStates instance is empty if it contains no state.
   *
   * @return Whether if the object is empty.
   */
  

  /**
   * Returns true if the EventStates instance contains the state
   * contained in aEventStates.
   * @note aEventStates should contain only one state.
   *
   * @param aEventStates The state to check.
   *
   * @return Whether the object has the state from aEventStates
   */
  

  /**
   * Returns true if the EventStates instance contains one of the states
   * contained in aEventStates.
   *
   * @param aEventStates The states to check.
   *
   * @return Whether the object has at least one state from aEventStates
   */
  bool HasAtLeastOneOfStates(EventStates aEventStates) const
  {
    return mStates & aEventStates.mStates;
  }

  /**
   * Returns true if the EventStates instance contains all states
   * contained in aEventStates.
   *
   * @param aEventStates The states to check.
   *
   * @return Whether the object has all states from aEventStates
   */
  

  // We only need that method for inDOMUtils::GetContentState.
  // If inDOMUtils::GetContentState is removed, this method should be removed.
  InternalType GetInternalValue() const {
    return mStates;
  }

private:
  InternalType mStates;
};

} // namespace mozilla

/**
 * The following macros are creating EventStates instance with different
 * values depending of their meaning.
 * Ideally, EventStates instance with values different than 0 should only be
 * created that way.
 */

// Helper to define a new EventStates macro.
#define NS_DEFINE_EVENT_STATE_MACRO(_val)               \
  (mozilla::EventStates(mozilla::EventStates::InternalType(1) << _val))

// Mouse is down on content.
#define NS_EVENT_STATE_ACTIVE        NS_DEFINE_EVENT_STATE_MACRO(0)
// Content has focus.
#define NS_EVENT_STATE_FOCUS         NS_DEFINE_EVENT_STATE_MACRO(1)
// Mouse is hovering over content.
#define NS_EVENT_STATE_HOVER         NS_DEFINE_EVENT_STATE_MACRO(2)
// Drag is hovering over content.
#define NS_EVENT_STATE_DRAGOVER      NS_DEFINE_EVENT_STATE_MACRO(3)
// Content is URL's target (ref).
#define NS_EVENT_STATE_URLTARGET     NS_DEFINE_EVENT_STATE_MACRO(4)
// Content is invalid.
#define NS_EVENT_STATE_INVALID       NS_DEFINE_EVENT_STATE_MACRO(13)
// Content value is in-range (and can be out-of-range).
#define NS_EVENT_STATE_INRANGE       NS_DEFINE_EVENT_STATE_MACRO(14)
// Content value is out-of-range.
#define NS_EVENT_STATE_OUTOFRANGE    NS_DEFINE_EVENT_STATE_MACRO(15)
// These two are temporary (see bug 302188)
// Content is read-only.
#define NS_EVENT_STATE_MOZ_READONLY  NS_DEFINE_EVENT_STATE_MACRO(16)
// Content is editable.
#define NS_EVENT_STATE_MOZ_READWRITE NS_DEFINE_EVENT_STATE_MACRO(17)
// Content is the default one (meaning depends of the context).
#define NS_EVENT_STATE_DEFAULT       NS_DEFINE_EVENT_STATE_MACRO(18)
// Content could not be rendered (image/object/etc).
#define NS_EVENT_STATE_BROKEN        NS_DEFINE_EVENT_STATE_MACRO(19)
// Content disabled by the user (images turned off, say).
#define NS_EVENT_STATE_HANDLER_CRASHED NS_DEFINE_EVENT_STATE_MACRO(28)
// Content has focus and should show a ring.
#define NS_EVENT_STATE_FOCUSRING     NS_DEFINE_EVENT_STATE_MACRO(29)
// Content is a submit control and the form isn't valid.
#define NS_EVENT_STATE_MOZ_SUBMITINVALID NS_DEFINE_EVENT_STATE_MACRO(30)
// UI friendly version of :invalid pseudo-class.
#define NS_EVENT_STATE_MOZ_UI_INVALID NS_DEFINE_EVENT_STATE_MACRO(31)
// UI friendly version of :valid pseudo-class.
#define NS_EVENT_STATE_MOZ_UI_VALID NS_DEFINE_EVENT_STATE_MACRO(32)
// Content is the full screen element, or a frame containing the
// current full-screen element.
#define NS_EVENT_STATE_FULL_SCREEN   NS_DEFINE_EVENT_STATE_MACRO(33)
// Content is an ancestor of the DOM full-screen element.
#define NS_EVENT_STATE_FULL_SCREEN_ANCESTOR   NS_DEFINE_EVENT_STATE_MACRO(34)
// Handler for click to play plugin
#define NS_EVENT_STATE_TYPE_CLICK_TO_PLAY NS_DEFINE_EVENT_STATE_MACRO(35)
// Content is in the optimum region.
#define NS_EVENT_STATE_OPTIMUM NS_DEFINE_EVENT_STATE_MACRO(36)
// Content is in the suboptimal region.
#define NS_EVENT_STATE_SUB_OPTIMUM NS_DEFINE_EVENT_STATE_MACRO(37)
// Content is in the sub-suboptimal region.
#define NS_EVENT_STATE_SUB_SUB_OPTIMUM NS_DEFINE_EVENT_STATE_MACRO(38)
// Handler for click to play plugin (vulnerable w/update)
#define NS_EVENT_STATE_VULNERABLE_UPDATABLE NS_DEFINE_EVENT_STATE_MACRO(39)
// Handler for click to play plugin (vulnerable w/no update)
#define NS_EVENT_STATE_VULNERABLE_NO_UPDATE NS_DEFINE_EVENT_STATE_MACRO(40)
// Platform does not support plugin content (some mobile platforms)
#define NS_EVENT_STATE_TYPE_UNSUPPORTED_PLATFORM NS_DEFINE_EVENT_STATE_MACRO(41)
// Element is ltr (for :dir pseudo-class)
#define NS_EVENT_STATE_LTR NS_DEFINE_EVENT_STATE_MACRO(42)
// Element is rtl (for :dir pseudo-class)
#define NS_EVENT_STATE_RTL NS_DEFINE_EVENT_STATE_MACRO(43)
// Handler for play preview plugin
#define NS_EVENT_STATE_TYPE_PLAY_PREVIEW NS_DEFINE_EVENT_STATE_MACRO(44)
// Element is highlighted (devtools inspector)
#define NS_EVENT_STATE_DEVTOOLS_HIGHLIGHTED NS_DEFINE_EVENT_STATE_MACRO(45)
// Element is an unresolved custom element candidate
#define NS_EVENT_STATE_UNRESOLVED NS_DEFINE_EVENT_STATE_MACRO(46)

// Event state that is used for values that need to be parsed but do nothing.
#define NS_EVENT_STATE_IGNORE NS_DEFINE_EVENT_STATE_MACRO(63)

/**
 * NOTE: do not go over 63 without updating EventStates::InternalType!
 */

#define DIRECTION_STATES (NS_EVENT_STATE_LTR | NS_EVENT_STATE_RTL)

#define ESM_MANAGED_STATES (NS_EVENT_STATE_ACTIVE | NS_EVENT_STATE_FOCUS |     \
                            NS_EVENT_STATE_HOVER | NS_EVENT_STATE_DRAGOVER |   \
                            NS_EVENT_STATE_URLTARGET | NS_EVENT_STATE_FOCUSRING | \
                            NS_EVENT_STATE_FULL_SCREEN | NS_EVENT_STATE_FULL_SCREEN_ANCESTOR | \
                            NS_EVENT_STATE_UNRESOLVED)

#define INTRINSIC_STATES (~ESM_MANAGED_STATES)

#endif // mozilla_EventStates_h_
# 289 "../../dist/include/mozilla/EventStates.h"

# 19 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DirectionalityUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/DirectionalityUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef DirectionalityUtils_h___
#define DirectionalityUtils_h___

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/DirectionalityUtils.h"

class nsIContent;
class nsIDocument;
class nsINode;
class nsAString;
class nsAttrValue;
class nsTextNode;

namespace mozilla {
namespace dom {
class Element;
} // namespace dom
} // namespace mozilla

namespace mozilla {

enum Directionality {
  eDir_NotSet,
  eDir_RTL,
  eDir_LTR,
  eDir_Auto
};

/**
                  bool hadDirAuto,
                  bool aNotify);

/**
 * Called when binding a new element to the tree, to set the
 * NodeAncestorHasDirAuto flag and set the direction of the element and its
 * ancestors if necessary
 */
void SetDirOnBind(mozilla::dom::Element* aElement, nsIContent* aParent);

/**
 * Called when unbinding an element from the tree, to recompute the
 * directionality of the element if it doesn't have autodirection, and to
 * clean up any entries in nsTextDirectionalityMap that refer to it.
 */
void ResetDir(mozilla::dom::Element* aElement);
} // end namespace mozilla

#endif /* DirectionalityUtils_h___ */
# 151 "../../dist/include/mozilla/dom/DirectionalityUtils.h"
# 20 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMElement.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsILinkHandler.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsILinkHandler.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsILinkHandler_h___
#define nsILinkHandler_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsILinkHandler.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsILinkHandler.h"

class nsIContent;
class nsIDocShell;
class nsIInputStream;
class nsIRequest;
class nsString;

// Interface ID for nsILinkHandler
#define NS_ILINKHANDLER_IID \
  { 0xceb9aade, 0x43da, 0x4f1a, \
    { 0xac, 0x8a, 0xc7, 0x09, 0xfb, 0x22, 0x46, 0x64 } }

/**
 * Interface used for handling clicks on links
 */
class nsILinkHandler : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILINKHANDLER_IID)

  /**
   * Process a click on a link.
   *
   * @param aContent the content for the frame that generated the trigger
   * @param aURI a URI object that defines the destination for the link
   * @param aTargetSpec indicates where the link is targeted (may be an empty
   *        string)
   * @param aPostDataStream the POST data to send
   * @param aFileName non-null when the link should be downloaded as the given file
   * @param aHeadersDataStream ???
   * @param aContent the content for the frame that generated the trigger
   * @param aURI a URI obect that defines the destination for the link
   */
  NS_IMETHOD OnLeaveLink() = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsILinkHandler, NS_ILINKHANDLER_IID)

#endif /* nsILinkHandler_h___ */
# 97 "../../dist/include/nsILinkHandler.h"
# 22 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsNodeUtils.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAttrAndChildArray.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozFlushType.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDOMAttributeMap.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsDOMAttributeMap.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Implementation of the |attributes| property of DOM Core's Element object.
 */

#ifndef nsDOMAttributeMap_h
#define nsDOMAttributeMap_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/base/nsDOMAttributeMap.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/base/nsDOMAttributeMap.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Attr.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/Attr.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Implementation of DOM Core's nsIDOMAttr node.
 */

#ifndef mozilla_dom_Attr_h
#define mozilla_dom_Attr_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/Attr.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIAttribute.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsIAttribute.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsIAttribute_h___
#define nsIAttribute_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsINode.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsIAttribute.h"

class nsDOMAttributeMap;
class nsIContent;

#define NS_IATTRIBUTE_IID  \
{ 0x233a9c4d, 0xb27f, 0x4662, \
    { 0xbd, 0x90, 0xba, 0xd6, 0x2e, 0x76, 0xc8, 0xe1 } }

class nsIAttribute : public nsINode
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IATTRIBUTE_IID)

  virtual void SetMap(nsDOMAttributeMap *aMap) = 0;
  
  nsDOMAttributeMap *GetMap()
  {
    return mAttrMap;
  }

  mozilla::dom::NodeInfo *NodeInfo() const
  {
    return mNodeInfo;
  }

  /**
   * Called when our ownerElement is moved into a new document.
   * Updates the nodeinfo of this node.
   */
  virtual nsresult SetOwnerDocument(nsIDocument* aDocument) = 0;

protected:
#ifdef MOZILLA_INTERNAL_API
  nsIAttribute(nsDOMAttributeMap *aAttrMap,
               already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
               bool aNsAware);
#endif //MOZILLA_INTERNAL_API
# 47 "/Users/luser/build/mozilla-central/dom/base/nsIAttribute.h"
  ;

  nsRefPtr<nsDOMAttributeMap> mAttrMap;
  bool mNsAware;
};

/* starting interface:    nsIDOMAttr */
#define NS_IDOMATTR_IID_STR "7db491e8-a3a3-4432-ad67-e6c33e24ac6d"

#define NS_IDOMATTR_IID \
  {0x7db491e8, 0xa3a3, 0x4432, \
    { 0xad, 0x67, 0xe6, 0xc3, 0x3e, 0x24, 0xac, 0x6d }}

class NS_NO_VTABLE nsIDOMAttr : public nsIDOMNode {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMATTR_IID)

  /* readonly attribute DOMString name; */
  NS_IMETHOD GetName(nsAString & aName) = 0;

  /* readonly attribute boolean specified; */
  NS_IMETHOD GetSpecified(bool *aSpecified) = 0;

  /* attribute DOMString value; */
  NS_IMETHOD GetValue(nsAString & aValue) = 0;
  NS_IMETHOD SetValue(const nsAString & aValue) = 0;

  /* readonly attribute nsIDOMElement ownerElement; */
  NS_IMETHOD GetOwnerElement(nsIDOMElement * *aOwnerElement) = 0;

  /* readonly attribute boolean isId; */
  NS_IMETHOD GetIsId(bool *aIsId) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMAttr, NS_IDOMATTR_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMATTR \
  NS_IMETHOD GetName(nsAString & aName) MOZ_OVERRIDE; \
  NS_IMETHOD GetSpecified(bool *aSpecified) MOZ_OVERRIDE; \
  NS_IMETHOD GetValue(nsAString & aValue) MOZ_OVERRIDE; \
  NS_IMETHOD SetValue(const nsAString & aValue) MOZ_OVERRIDE; \
  NS_IMETHOD GetOwnerElement(nsIDOMElement * *aOwnerElement) MOZ_OVERRIDE; \
  NS_IMETHOD GetIsId(bool *aIsId) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMATTR(_to) \
  NS_IMETHOD GetName(nsAString & aName) MOZ_OVERRIDE { return _to GetName(aName); } \
  NS_IMETHOD GetSpecified(bool *aSpecified) MOZ_OVERRIDE { return _to GetSpecified(aSpecified); } \
  NS_IMETHOD GetValue(nsAString & aValue) MOZ_OVERRIDE { return _to GetValue(aValue); } \
  NS_IMETHOD SetValue(const nsAString & aValue) MOZ_OVERRIDE { return _to SetValue(aValue); } \
  NS_IMETHOD GetOwnerElement(nsIDOMElement * *aOwnerElement) MOZ_OVERRIDE { return _to GetOwnerElement(aOwnerElement); } \
  NS_IMETHOD GetIsId(bool *aIsId) MOZ_OVERRIDE { return _to GetIsId(aIsId); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMATTR(_to) \
  NS_IMETHOD GetName(nsAString & aName) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \
  NS_IMETHOD GetSpecified(bool *aSpecified) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSpecified(aSpecified); } \
  NS_IMETHOD GetValue(nsAString & aValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aValue); } \
  NS_IMETHOD SetValue(const nsAString & aValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetValue(aValue); } \
  NS_IMETHOD GetOwnerElement(nsIDOMElement * *aOwnerElement) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnerElement(aOwnerElement); } \
  NS_IMETHOD GetIsId(bool *aIsId) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsId(aIsId); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMAttr : public nsIDOMAttr
{
#endif
# 145 "../../dist/include/nsIDOMAttr.h"


#endif /* __gen_nsIDOMAttr_h__ */
# 148 "../../dist/include/nsIDOMAttr.h"
# 16 "../../dist/include/mozilla/dom/Attr.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMText.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMText.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMText.idl
 */

#ifndef __gen_nsIDOMText_h__
#define __gen_nsIDOMText_h__


#ifndef __gen_nsIDOMCharacterData_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMCharacterData.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMCharacterData.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMCharacterData.idl
 */

#ifndef __gen_nsIDOMCharacterData_h__
#define __gen_nsIDOMCharacterData_h__



#define NS_IDOMCHARACTERDATA_IID \
  {0x4109a2d2, 0xe7af, 0x445d, \
    { 0xbb, 0x72, 0xc7, 0xc9, 0xb8, 0x75, 0xf3, 0x5e }}

class NS_NO_VTABLE nsIDOMCharacterData : public nsIDOMNode {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMCHARACTERDATA_IID)

  /* attribute DOMString data; */
  NS_IMETHOD GetData(nsAString & aData) = 0;
  NS_IMETHOD SetData(const nsAString & aData) = 0;

  /* readonly attribute unsigned long length; */
  NS_IMETHOD GetLength(uint32_t *aLength) = 0;
  /* [binaryname(MozRemove)] void remove (); */
  NS_IMETHOD MozRemove(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMCharacterData, NS_IDOMCHARACTERDATA_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMCHARACTERDATA \
  NS_IMETHOD ReplaceData(uint32_t offset, uint32_t count, const nsAString & arg) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ReplaceData(offset, count, arg); } \
  NS_IMETHOD MozRemove(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->MozRemove(); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */

/* End of implementation class template. */
#endif
# 181 "../../dist/include/nsIDOMCharacterData.h"


#endif /* __gen_nsIDOMCharacterData_h__ */
# 184 "../../dist/include/nsIDOMCharacterData.h"
# 11 "../../dist/include/nsIDOMText.h" 2
#endif
# 12 "../../dist/include/nsIDOMText.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMText.h"

/* starting interface:    nsIDOMText */
#define NS_IDOMTEXT_IID_STR "67273994-6aff-4091-9de9-b788a249f783"

#define NS_IDOMTEXT_IID \
  {0x67273994, 0x6aff, 0x4091, \
    { 0x9d, 0xe9, 0xb7, 0x88, 0xa2, 0x49, 0xf7, 0x83 }}

class NS_NO_VTABLE nsIDOMText : public nsIDOMCharacterData {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMTEXT_IID)

  /* nsIDOMText splitText (in unsigned long offset) raises (DOMException); */
  NS_IMETHOD SplitText(uint32_t offset, nsIDOMText * *_retval) = 0;

  /* readonly attribute DOMString wholeText; */
  NS_IMETHOD GetWholeText(nsAString & aWholeText) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMText, NS_IDOMTEXT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMTEXT \
  NS_IMETHOD SplitText(uint32_t offset, nsIDOMText * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetWholeText(nsAString & aWholeText) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMTEXT(_to) \
  NS_IMETHOD SplitText(uint32_t offset, nsIDOMText * *_retval) MOZ_OVERRIDE { return _to SplitText(offset, _retval); } \
  NS_IMETHOD GetWholeText(nsAString & aWholeText) MOZ_OVERRIDE { return _to GetWholeText(aWholeText); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMTEXT(_to) \
  NS_IMETHOD SplitText(uint32_t offset, nsIDOMText * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SplitText(offset, _retval); } \
  NS_IMETHOD GetWholeText(nsAString & aWholeText) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWholeText(aWholeText); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMText : public nsIDOMText
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMTEXT

  nsDOMText();

private:
  ~nsDOMText();
#endif
# 101 "../../dist/include/nsIDOMText.h"


#endif /* __gen_nsIDOMText_h__ */
# 104 "../../dist/include/nsIDOMText.h"
# 17 "../../dist/include/mozilla/dom/Attr.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMNodeList.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/dom/Attr.h"
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * nsStubMutationObserver is an implementation of the nsIMutationObserver
 * interface (except for the methods on nsISupports) that is intended to be
 * used as a base class within the content/layout library.  All methods do
 * nothing.
 */

#ifndef nsStubMutationObserver_h_
#define nsStubMutationObserver_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsIMutationObserver.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/base/nsStubMutationObserver.h"

/**
 * There are two advantages to inheriting from nsStubMutationObserver
 * rather than directly from nsIMutationObserver:
 *  1. smaller compiled code size (since there's no need for the code
 *     for the empty virtual function implementations for every
 *     nsIMutationObserver implementation)
 *  2. the performance of document's loop over observers benefits from
 *     the fact that more of the functions called are the same (which
 *     can reduce instruction cache misses and perhaps improve branch
 *     prediction)
 */
class nsStubMutationObserver : public nsIMutationObserver {
public:
  NS_DECL_NSIMUTATIONOBSERVER
};

#endif /* !defined(nsStubMutationObserver_h_) */
# 35 "/Users/luser/build/mozilla-central/dom/base/nsStubMutationObserver.h"
# 22 "../../dist/include/mozilla/dom/Attr.h" 2

class nsIDocument;

namespace mozilla {
class EventChainPreVisitor;
namespace dom {

// Attribute helper class used to wrap up an attribute with a dom
// object that implements nsIDOMAttr and nsIDOMNode
class Attr MOZ_FINAL : public nsIAttribute,
                       public nsIDOMAttr
{
  

public:
  ;

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS

  // nsIDOMNode interface
  NS_FORWARD_NSIDOMNODE_TO_NSINODE
  virtual void GetTextContentInternal(nsAString& aTextContent,
                                      ErrorResult& aError) MOZ_OVERRIDE;
  virtual void SetTextContentInternal(const nsAString& aTextContent,
                                      ErrorResult& aError) MOZ_OVERRIDE;
  ;

protected:
  

  static bool sInitialized;

private:
  ;

  nsString mValue;
};

} // namespace dom
} // namespace mozilla

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMMozNamedAttrMap.h"

/* starting interface:    nsIDOMMozNamedAttrMap */
#define NS_IDOMMOZNAMEDATTRMAP_IID_STR "cb5564cd-26ec-418f-a6d6-1d57cd2c971c"

#define NS_IDOMMOZNAMEDATTRMAP_IID \
  {0xcb5564cd, 0x26ec, 0x418f, \
    { 0xa6, 0xd6, 0x1d, 0x57, 0xcd, 0x2c, 0x97, 0x1c }}

class NS_NO_VTABLE nsIDOMMozNamedAttrMap : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMMOZNAMEDATTRMAP_IID)

  /* nsIDOMAttr getNamedItem (in DOMString name); */
  NS_IMETHOD GetNamedItem(const nsAString & name, nsIDOMAttr * *_retval) = 0;

  /* nsIDOMAttr setNamedItem (in nsIDOMAttr arg) raises (DOMException); */
  NS_IMETHOD SetNamedItem(nsIDOMAttr *arg, nsIDOMAttr * *_retval) = 0;

  /* nsIDOMAttr removeNamedItem (in DOMString name) raises (DOMException); */
  NS_IMETHOD RemoveNamedItem(const nsAString & name, nsIDOMAttr * *_retval) = 0;

  /* nsIDOMAttr item (in unsigned long index); */
  NS_IMETHOD Item(uint32_t index, nsIDOMAttr * *_retval) = 0;

  /* readonly attribute unsigned long length; */
  NS_IMETHOD GetLength(uint32_t *aLength) = 0;

  /* nsIDOMAttr getNamedItemNS (in DOMString namespaceURI, in DOMString localName); */
  NS_IMETHOD GetNamedItemNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMAttr * *_retval) = 0;

  /* nsIDOMAttr setNamedItemNS (in nsIDOMAttr arg) raises (DOMException); */
  NS_IMETHOD SetNamedItemNS(nsIDOMAttr *arg, nsIDOMAttr * *_retval) = 0;

  /* nsIDOMAttr removeNamedItemNS (in DOMString namespaceURI, in DOMString localName) raises (DOMException); */
  NS_IMETHOD RemoveNamedItemNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMAttr * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMMozNamedAttrMap, NS_IDOMMOZNAMEDATTRMAP_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMMOZNAMEDATTRMAP \
  NS_IMETHOD GetNamedItem(const nsAString & name, nsIDOMAttr * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD SetNamedItem(nsIDOMAttr *arg, nsIDOMAttr * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveNamedItem(const nsAString & name, nsIDOMAttr * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD Item(uint32_t index, nsIDOMAttr * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE; \
  NS_IMETHOD GetNamedItemNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMAttr * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD SetNamedItemNS(nsIDOMAttr *arg, nsIDOMAttr * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveNamedItemNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMAttr * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMMOZNAMEDATTRMAP(_to) \
  NS_IMETHOD GetNamedItem(const nsAString & name, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return _to GetNamedItem(name, _retval); } \
  NS_IMETHOD SetNamedItem(nsIDOMAttr *arg, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return _to SetNamedItem(arg, _retval); } \
  NS_IMETHOD RemoveNamedItem(const nsAString & name, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return _to RemoveNamedItem(name, _retval); } \
  NS_IMETHOD Item(uint32_t index, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return _to Item(index, _retval); } \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return _to GetLength(aLength); } \
  NS_IMETHOD GetNamedItemNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return _to GetNamedItemNS(namespaceURI, localName, _retval); } \
  NS_IMETHOD SetNamedItemNS(nsIDOMAttr *arg, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return _to SetNamedItemNS(arg, _retval); } \
  NS_IMETHOD RemoveNamedItemNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return _to RemoveNamedItemNS(namespaceURI, localName, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMMOZNAMEDATTRMAP(_to) \
  NS_IMETHOD GetNamedItem(const nsAString & name, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNamedItem(name, _retval); } \
  NS_IMETHOD SetNamedItem(nsIDOMAttr *arg, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetNamedItem(arg, _retval); } \
  NS_IMETHOD RemoveNamedItem(const nsAString & name, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveNamedItem(name, _retval); } \
  NS_IMETHOD Item(uint32_t index, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Item(index, _retval); } \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLength(aLength); } \
  NS_IMETHOD GetNamedItemNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNamedItemNS(namespaceURI, localName, _retval); } \
  NS_IMETHOD SetNamedItemNS(nsIDOMAttr *arg, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetNamedItemNS(arg, _retval); } \
  NS_IMETHOD RemoveNamedItemNS(const nsAString & namespaceURI, const nsAString & localName, nsIDOMAttr * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveNamedItemNS(namespaceURI, localName, _retval); } 

#if 0
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/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 RefPtr the reference-type being wrapped
 * @see nsDataHashtable, nsClassHashtable
 */
template<class KeyClass, class RefPtr>
class nsRefPtrHashtable
  : public nsBaseHashtable<KeyClass, nsRefPtr<RefPtr>, RefPtr*>
{
public:
  typedef typename KeyClass::KeyType KeyType;
  typedef RefPtr* UserDataType;
  typedef nsBaseHashtable<KeyClass, nsRefPtr<RefPtr>, RefPtr*> base_type;

  
  

  /**
   * @copydoc nsBaseHashtable::Get
   * @param aData This is an XPCOM getter, so aData is already_addrefed.
   *   If the key doesn't exist, aData will be set to nullptr.
   */
  ;

  /**
  using base_type::Remove;

  /**
   * Remove the data for the associated key, swapping the current value into
   * pData, thereby avoiding calls to AddRef and Release.
   * @param aKey the key to remove from the hashtable
   * @param aData This is an XPCOM getter, so aData is already_addrefed.
   *   If the key doesn't exist, aData will be set to nullptr. Must be non-null.
   */
  ;
};



#endif // nsRefPtrHashtable_h__
# 193 "../../dist/include/nsRefPtrHashtable.h"
class nsAttrKey
{
public:
  /**
   * The namespace of the attribute
   */
  int32_t  mNamespaceID;

  /**
   * The atom for attribute, weak ref. is fine as we only use it for the
   * hashcode, we never dereference it.
   */
  nsIAtom* mLocalName;

  

  
};

/**
 * PLDHashEntryHdr implementation for nsAttrKey.
 */
class nsAttrHashKey : public PLDHashEntryHdr
{
public:
  typedef const nsAttrKey& KeyType;
  typedef const nsAttrKey* KeyTypePointer;

  
  
  

  
  

  
  
  enum { ALLOW_MEMMOVE = true };

private:
  nsAttrKey mKey;
};

// Helper class that implements the nsIDOMMozNamedAttrMap interface.
class nsDOMAttributeMap : public nsIDOMMozNamedAttrMap
                        , public nsWrapperCache
{
public:
  typedef mozilla::dom::Attr Attr;
  typedef mozilla::dom::Element Element;
  typedef mozilla::ErrorResult ErrorResult;

  explicit nsDOMAttributeMap(Element *aContent);

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsDOMAttributeMap)

  // nsIDOMMozNamedAttrMap interface
  NS_DECL_NSIDOMMOZNAMEDATTRMAP

  ;

  

  /**
   * Called when mContent is moved into a new document.
   * Updates the nodeinfos of all owned nodes.
   */
  ;

  /**
   * Drop an attribute from the map's cache (does not remove the attribute
   * from the node!)
   */
  ;

  /**
   * Returns the number of attribute nodes currently in the map.
   * Note: this is just the number of cached attribute nodes, not the number of
   * attributes in mContent.
   *
   * @return The number of attribute nodes in the map.
   */
  ;

  typedef nsRefPtrHashtable<nsAttrHashKey, Attr> AttrCache;

  /**
   * Enumerates over the attribute nodess in the map and calls aFunc for each
   * one. If aFunc returns PL_DHASH_STOP we'll stop enumerating at that point.
   *
   * @return The number of attribute nodes that aFunc was called for.
   */
  ;

  
  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

  // WebIDL
  ;
  ;
  ;
  
  ;
  ;
 
  ;
  ;
  ;

  ;
  
  ;
};

// XXX khuey yes this is crazy.  The bindings code needs to see this include,
// but if we pull it in at the top of the file we get a circular include
// problem.
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Element.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/Element.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 et :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Base class for all element classes; this provides an implementation
 * of DOM Core's nsIDOMElement, implements nsIContent, provides
 * utility methods for subclasses, and so forth.
 */

#ifndef mozilla_dom_Element_h__
#define mozilla_dom_Element_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/FragmentOrElement.h" // for base class
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsChangeHint.h"                  // for enum
#endif /* expanded by -frewrite-includes */
  return nsINode::QuerySelector(aSelector, aReturn);                          \
}                                                                             \
using nsINode::QuerySelectorAll;                                              \
NS_IMETHOD QuerySelectorAll(const nsAString& aSelector,                       \
                            nsIDOMNodeList **aReturn) MOZ_FINAL MOZ_OVERRIDE  \
{                                                                             \
  return nsINode::QuerySelectorAll(aSelector, aReturn);                       \
}

#endif // mozilla_dom_Element_h__
# 1807 "../../dist/include/mozilla/dom/Element.h"
# 218 "/Users/luser/build/mozilla-central/dom/base/nsDOMAttributeMap.h" 2

#endif /* nsDOMAttributeMap_h */
# 220 "/Users/luser/build/mozilla-central/dom/base/nsDOMAttributeMap.h"
# 26 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsPresContext.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsPresContext.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* a presentation of a document, part 1 */

#ifndef nsPresContext_h___
#define nsPresContext_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsPresContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/WeakPtr.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/WeakPtr.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Weak pointer functionality, implemented as a mixin for use with any class. */

/**
 * SupportsWeakPtr lets you have a pointer to an object 'Foo' without affecting
 *   MOZ_ASSERT(!other, "Deleting |ptr| clears all weak pointers to it.");
 *
 * WeakPtr is typesafe and may be used with any class. It is not required that
 * the class be reference-counted or allocated in any particular way.
 *
 * The API was loosely inspired by Chromium's weak_ptr.h:
 * http://src.chromium.org/svn/trunk/src/base/memory/weak_ptr.h
 */

#ifndef mozilla_WeakPtr_h
#define mozilla_WeakPtr_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ArrayUtils.h"
#endif /* expanded by -frewrite-includes */
# 71 "../../dist/include/mozilla/WeakPtr.h"

#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 77 "../../dist/include/mozilla/WeakPtr.h"

namespace mozilla {

template <typename T> class WeakPtr;
template <typename T> class SupportsWeakPtr;

namespace detail {

// This can live beyond the lifetime of the class derived from
// SupportsWeakPtr.
template<class T>
class WeakReference : public ::mozilla::RefCounted<WeakReference<T> >
{
public:
  

  T* get() const { return mPtr; }

#ifdef MOZ_REFCOUNTED_LEAK_CHECKING
  const char* typeName() const
  {
    static char nameBuffer[1024];
    const char* innerType = mPtr->typeName();
    // We could do fancier length checks at runtime, but innerType is
    // controlled by us so we can ensure that this never causes a buffer
    // overflow by this assertion.
    MOZ_ASSERT(strlen(innerType) + sizeof("WeakReference<>") <
               ArrayLength(nameBuffer),
               "Exceedingly large type name");
#if defined(_MSC_VER) && _MSC_VER < 1900
    _snprintf
#else
# 109 "../../dist/include/mozilla/WeakPtr.h"
    ::snprintf
#endif
# 111 "../../dist/include/mozilla/WeakPtr.h"
         (nameBuffer, ArrayLength(nameBuffer), "WeakReference<%s>", innerType);
    // This is usually not OK, but here we are returning a pointer to a static
    // buffer which will immediately be used by the caller.
    return nameBuffer;
  }
  size_t typeSize() const { return sizeof(*this); }
#endif
# 118 "../../dist/include/mozilla/WeakPtr.h"

private:
  friend class mozilla::SupportsWeakPtr<T>;

  void detach() { mPtr = nullptr; }

  T* MOZ_NON_OWNING_REF mPtr;
};

} // namespace detail

template <typename T>
class SupportsWeakPtr
{
protected:

  WeakPtr<T> mSelfReferencingWeakPtr;
};

template <typename T>
class WeakPtr
{
  typedef detail::WeakReference<T> WeakReference;

public:
  

  

  


  RefPtr<WeakReference> mRef;
};

} // namespace mozilla

#endif /* mozilla_WeakPtr_h */
# 211 "../../dist/include/mozilla/WeakPtr.h"
# 13 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsColor.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsPresContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCoord.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsPresContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsPresContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIPresShell.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIPresShell.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This Original Code has been modified by IBM Corporation.
 * Modifications made by IBM described herein are
 * Copyright (c) International Business Machines
 * Corporation, 2000
 *
 * Modifications to Mozilla code or documentation
 * identified per MPL Section 3.3
 *
 * Date         Modified by     Description of modification
 * 05/03/2000   IBM Corp.       Observer related defines for reflow
 */

/* a presentation of a document, part 2 */

#ifndef nsIPresShell_h___
#define nsIPresShell_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/nsIPresShell.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/nsIPresShell.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/WeakPtr.h"
#endif /* expanded by -frewrite-includes */
# 26 "../../dist/include/nsIPresShell.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxPoint.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxPoint.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_POINT_H
#define GFX_POINT_H

#if 0 /* expanded by -frewrite-includes */
#include "nsMathUtils.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/BaseSize.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/BasePoint.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/gfxPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsPoint.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxPoint.h"

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxTypes.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_TYPES_H
#define GFX_TYPES_H

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxTypes.h"

typedef struct _cairo_surface cairo_surface_t;
typedef struct _cairo_user_data_key cairo_user_data_key_t;

typedef void (*thebes_destroy_func_t) (void *data);

/**
 * Currently needs to be 'double' for Cairo compatibility. Could
 * become 'float', perhaps, in some configurations.
 */
typedef double gfxFloat;

/**
 * Priority of a line break opportunity.
 *
 * eNoBreak       The line has no break opportunities
 * eWordWrapBreak The line has a break opportunity only within a word. With
 *                word-wrap: break-word we will break at this point only if
 *                there are no other break opportunities in the line.
 * eNormalBreak   The line has a break opportunity determined by the standard

/**
  * The format for an image surface. For all formats with alpha data, 0
  * means transparent, 1 or 255 means fully opaque.
  */
enum class gfxImageFormat {
  ARGB32, ///< ARGB data in native endianness, using premultiplied alpha
  RGB24,  ///< xRGB data in native endianness
  A8,     ///< Only an alpha channel
  A1,     ///< Packed transparency information (one byte refers to 8 pixels)
  RGB16_565,  ///< RGB_565 data in native endianness
  Unknown
};

enum class gfxSurfaceType {
  Image,
  VG,
  GL,
  DRM,
  Tee,
  XML,
  Skia,
  Subsurface,
  D2D,
  Max
};

enum class gfxContentType {
  COLOR       = 0x1000,
  ALPHA       = 0x2000,
  COLOR_ALPHA = 0x3000,
  SENTINEL    = 0xffff
};

/**
  * The memory used by a gfxASurface (as reported by KnownMemoryUsed()) can
  * either live in this process's heap, in this process but outside the
  * heap, or in another process altogether.
  */
enum class gfxMemoryLocation {
  IN_PROCESS_HEAP,
  IN_PROCESS_NONHEAP,
  OUT_OF_PROCESS
};

#endif /* GFX_TYPES_H */
# 108 "../../dist/include/gfxTypes.h"
# 16 "../../dist/include/gfxPoint.h" 2

struct gfxSize : public mozilla::gfx::BaseSize<gfxFloat, gfxSize> {
    typedef mozilla::gfx::BaseSize<gfxFloat, gfxSize> Super;

    
    gfxSize(gfxFloat aWidth, gfxFloat aHeight) : Super(aWidth, aHeight) {}
    MOZ_IMPLICIT 
};

struct gfxPoint : public mozilla::gfx::BasePoint<gfxFloat, gfxPoint> {
    typedef mozilla::gfx::BasePoint<gfxFloat, gfxPoint> Super;

    gfxPoint() : Super() {}
    gfxPoint(gfxFloat aX, gfxFloat aY) : Super(aX, aY) {}
    MOZ_IMPLICIT 

    
};







#endif /* GFX_POINT_H */
# 56 "../../dist/include/gfxPoint.h"
# 27 "../../dist/include/nsIPresShell.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTHashtable.h"
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/nsIPresShell.h"
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsQueryFrame_h
#define nsQueryFrame_h

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/nsQueryFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsQueryFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsQueryFrame.h"

// NOTE: the long lines in this file are intentional to make compiler error
// messages more readable.

#define NS_DECL_QUERYFRAME_TARGET(classname)                    \
  static const nsQueryFrame::FrameIID kFrameIID = nsQueryFrame::classname##_id; \
  typedef classname Has_NS_DECL_QUERYFRAME_TARGET;

#define NS_DECL_QUERYFRAME                                      \
  virtual void* QueryFrame(FrameIID id) MOZ_OVERRIDE;

#define NS_QUERYFRAME_HEAD(class)                               \
  void* class::QueryFrame(FrameIID id) { switch (id) {

class nsQueryFrame
{
public:
  enum FrameIID {
#define FRAME_ID(classname) classname##_id,
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameIdList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsFrameIdList.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

FRAME_ID(BRFrame)
FRAME_ID(nsAutoRepeatBoxFrame)
FRAME_ID(nsBCTableCellFrame)
FRAME_ID(nsBlockFrame)
FRAME_ID(nsBox)
FRAME_ID(nsBoxFrame)
FRAME_ID(nsBulletFrame)
FRAME_ID(nsButtonBoxFrame)
FRAME_ID(nsCanvasFrame)
FRAME_ID(nsColorControlFrame)
FRAME_ID(nsColumnSetFrame)
FRAME_ID(nsComboboxControlFrame)
FRAME_ID(nsComboboxDisplayFrame)
FRAME_ID(nsContainerFrame)
FRAME_ID(nsContinuingTextFrame)
FRAME_ID(nsDeckFrame)
FRAME_ID(nsDocElementBoxFrame)
FRAME_ID(nsFieldSetFrame)
FRAME_ID(nsHTMLFramesetBorderFrame)
FRAME_ID(nsHTMLFramesetFrame)
FRAME_ID(nsHTMLScrollFrame)
FRAME_ID(nsIAnonymousContentCreator)
FRAME_ID(nsIComboboxControlFrame)
FRAME_ID(nsIFormControlFrame)
FRAME_ID(nsIFrame)
FRAME_ID(nsIFrameFrame)
FRAME_ID(nsIListControlFrame)
FRAME_ID(nsIMathMLFrame)
FRAME_ID(nsIMenuFrame)
FRAME_ID(nsIObjectFrame)
FRAME_ID(nsIPageSequenceFrame)
FRAME_ID(nsIPercentHeightObserver)
FRAME_ID(nsIRootBox)
FRAME_ID(nsISVGChildFrame)
FRAME_ID(nsISVGSVGFrame)
FRAME_ID(nsIScrollableFrame)
FRAME_ID(nsIScrollbarMediator)
FRAME_ID(nsISelectControlFrame)
FRAME_ID(nsIStatefulFrame)
FRAME_ID(nsITableCellLayout)
FRAME_ID(nsITableLayout)
FRAME_ID(nsITextControlFrame)
FRAME_ID(nsITreeBoxObject)
FRAME_ID(nsImageBoxFrame)
FRAME_ID(nsImageControlFrame)
FRAME_ID(nsImageFrame)
FRAME_ID(nsInlineFrame)
FRAME_ID(nsLeafBoxFrame)
FRAME_ID(nsLeafFrame)
FRAME_ID(nsLegendFrame)
#undef FRAME_ID

    // The PresArena implementation uses this bit to distinguish objects
    // allocated by size from objects allocated by type ID (that is, frames
    // using AllocateByFrameID, and other objects using AllocateByObjectID).
    // It should not collide with any frame ID (above) or Object ID (in
    // nsPresArena.h).  It is not 0x80000000 to avoid the question of
    // whether enumeration constants are signed.
    NON_FRAME_MARKER = 0x20000000
  };

  virtual void* QueryFrame(FrameIID id) = 0;
};

class do_QueryFrame
{
public:
  

  // The return and argument types here are arbitrarily selected so no
  // corresponding member function exists.
  typedef void (do_QueryFrame::* MatchNullptr)(double, float);
  // Implicit constructor for nullptr, trick borrowed from already_AddRefed.
  MOZ_IMPLICIT 

  

private:
  nsQueryFrame *mRawPtr;
};

#endif // nsQueryFrame_h
# 103 "../../dist/include/nsQueryFrame.h"
# 32 "../../dist/include/nsIPresShell.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCoord.h"
#endif /* expanded by -frewrite-includes */
# 33 "../../dist/include/nsIPresShell.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsColor.h"
#endif /* expanded by -frewrite-includes */
# 34 "../../dist/include/nsIPresShell.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCompatibility.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCompatibility.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* constants for quirks mode, standards mode, and almost standards mode */

#ifndef nsCompatibility_h___
#define nsCompatibility_h___

enum nsCompatibility {
  eCompatibility_FullStandards   = 1,
  eCompatibility_AlmostStandards = 2,
  eCompatibility_NavQuirks       = 3
};

#endif /* nsCompatibility_h___ */
# 18 "../../dist/include/nsCompatibility.h"
# 35 "../../dist/include/nsIPresShell.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameManagerBase.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsFrameManagerBase.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim:cindent:ts=2:et:sw=2:
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This Original Code has been modified by IBM Corporation. Modifications made
 * by IBM described herein are Copyright (c) International Business Machines
 * Corporation, 2000. Modifications to Mozilla code or documentation identified
 * per MPL Section 3.3
 *
 * Date             Modified by     Description of modification
 * 04/20/2000       IBM Corp.      OS/2 VisualAge build.
 */

/* part of nsFrameManager, to work around header inclusionordering */

#ifndef _nsFrameManagerBase_h_
#define _nsFrameManagerBase_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsFrameManagerBase.h"
#if 0 /* expanded by -frewrite-includes */
#include "pldhash.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/nsFrameManagerBase.h"

class nsIFrame;
class nsIPresShell;
class nsStyleSet;

class nsFrameManagerBase
{
public:
  

  // on Android. Unfortunately, this is static to match
  // the single consumer which is also static. Keeping
  // this the same greatly simplifies lifetime issues and
  // makes sure we always using the correct number.
  // A per PresContext generation number is available
  // via nsPresContext::GetDOMGeneration
  static uint32_t                 sGlobalGenerationNumber;
};

#endif
# 83 "../../dist/include/nsFrameManagerBase.h"
# 36 "../../dist/include/nsIPresShell.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozFlushType.h"
#endif /* expanded by -frewrite-includes */
# 37 "../../dist/include/nsIPresShell.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWeakReference.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsWeakReference.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsWeakReference_h__
#define nsWeakReference_h__

// nsWeakReference.h

// See mfbt/WeakPtr.h for a more typesafe C++ implementation of weak references

#if 0 /* expanded by -frewrite-includes */
#include "nsIWeakReferenceUtils.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsWeakReference.h"

class nsWeakReference;

class nsSupportsWeakReference : public nsISupportsWeakReference
{
public:
  nsSupportsWeakReference() : mProxy(0) {}

  NS_DECL_NSISUPPORTSWEAKREFERENCE

protected:
  inline ~nsSupportsWeakReference();

private:
  friend class nsWeakReference;

  // Called (only) by an |nsWeakReference| from _its_ dtor.
  void NoticeProxyDestruction() { mProxy = 0; }

  nsWeakReference* MOZ_NON_OWNING_REF mProxy;

protected:

  void ClearWeakReferences();
  bool HasWeakReferences() const { return mProxy != 0; }
};

inline
nsSupportsWeakReference::~nsSupportsWeakReference()
{
  ClearWeakReferences();
}

#endif
# 49 "../../dist/include/nsWeakReference.h"
# 38 "../../dist/include/nsIPresShell.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h> // for FILE definition
#endif /* expanded by -frewrite-includes */
# 39 "../../dist/include/nsIPresShell.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsChangeHint.h"
#endif /* expanded by -frewrite-includes */
# 40 "../../dist/include/nsIPresShell.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRefPtrHashtable.h"
#endif /* expanded by -frewrite-includes */
/* arena allocation for the frame tree and closely-related objects */

#ifndef nsPresArena_h___
#define nsPresArena_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryChecking.h" // Note: Do not remove this, needed for MOZ_HAVE_MEM_CHECKS below
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsPresArena.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsPresArena.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsPresArena.h"
#if 0 /* expanded by -frewrite-includes */
#include "plarena.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plarena.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef plarena_h___
#define plarena_h___
/*
 * Lifetime-based fast allocation, inspired by much prior art, including
 * "Fast Allocation and Deallocation of Memory Based on Object Lifetimes"
 * David R. Hanson, Software -- Practice and Experience, Vol. 20(1).
 *
 * Also supports LIFO allocation (PL_ARENA_MARK/PL_ARENA_RELEASE).
 */
#if 0 /* expanded by -frewrite-includes */
#include "prtypes.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plarena.h"
#if 0 /* expanded by -frewrite-includes */
#include "plarenas.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plarenas.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef PLARENAS_H
#define PLARENAS_H

PR_BEGIN_EXTERN_C

typedef struct PLArenaPool      PLArenaPool;

/*
** Initialize an arena pool with the given name for debugging and metering,
** with a minimum gross size per arena of size bytes.  The net size per arena
** is smaller than the gross size by a header of four pointers plus any
** necessary padding for alignment.
**
** Note: choose a gross size that's a power of two to avoid the heap allocator
** rounding the size up.
**/
PR_EXTERN(void) PL_InitArenaPool(
    PLArenaPool *pool, const char *name, PRUint32 size, PRUint32 align);

/*
** Finish using arenas, freeing all memory associated with them.
**/
PR_EXTERN(void) PL_ArenaRelease(PLArenaPool *pool, char *mark);

/*
** memset contents of all arenas in pool to pattern
*/
PR_EXTERN(void) PL_ClearArenaPool(PLArenaPool *pool, PRInt32 pattern);

/*
** A function like malloc_size() or malloc_usable_size() that measures the
** size of a heap block.
*/
typedef size_t (*PLMallocSizeFn)(const void *ptr);

/*
** Measure all memory used by a PLArenaPool, excluding the PLArenaPool
** structure.
*/
PR_EXTERN(size_t) PL_SizeOfArenaPoolExcludingPool(
    const PLArenaPool *pool, PLMallocSizeFn mallocSizeOf);

PR_END_EXTERN_C

#endif /* PLARENAS_H */
# 82 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plarenas.h"
# 17 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plarena.h" 2

PR_BEGIN_EXTERN_C

typedef struct PLArena          PLArena;

struct PLArena {
    PLArena     *next;          /* next arena for this lifetime */
    PRUword     base;           /* aligned base address, follows this header */
    PRUword     limit;          /* one beyond last byte in arena */
    PRUword     avail;          /* points to next available byte */
};

#ifdef PL_ARENAMETER
typedef struct PLArenaStats PLArenaStats;

struct PLArenaStats {
    PLArenaStats  *next;        /* next in arenaStats list */
    char          *name;        /* name for debugging */
    PRUint32      narenas;      /* number of arenas in pool */
    PRUint32      nallocs;      /* number of PL_ARENA_ALLOCATE() calls */
    PRUint32      nreclaims;    /* number of reclaims from freeArenas */
    PRUint32      nmallocs;     /* number of malloc() calls */
    PRUint32      ndeallocs;    /* number of lifetime deallocations */
    PRUint32      ngrows;       /* number of PL_ARENA_GROW() calls */
    PRUint32      ninplace;     /* number of in-place growths */
    PRUint32      nreleases;    /* number of PL_ARENA_RELEASE() calls */
    PRUint32      nfastrels;    /* number of "fast path" releases */
    PRUint32      nbytes;       /* total bytes allocated */
    PRUint32      maxalloc;     /* maximum allocation size in bytes */
    PRFloat64     variance;     /* size variance accumulator */
};
#endif
# 49 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plarena.h"

struct PLArenaPool {
    PLArena     first;          /* first arena in pool list */
    PLArena     *current;       /* arena from which to allocate space */
    PRUint32    arenasize;      /* net exact size of a new arena */
    PRUword     mask;           /* alignment mask (power-of-2 - 1) */
#ifdef PL_ARENAMETER
    PLArenaStats stats;
#endif
# 58 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plarena.h"
};

/*
 * WARNING: The PL_MAKE_MEM_ macros are for internal use by NSPR. Do NOT use
 * them in your code.
 *
 *
 * With no memory checker available, all macros expand to the empty statement.
 */
#define PL_ARENA_ALLOCATE(p, pool, nb) \
    PR_BEGIN_MACRO \
        PLArena *_a = (pool)->current; \
        PRUint32 _nb = PL_ARENA_ALIGN(pool, nb); \
        PRUword _p = _a->avail; \
        PRUword _q = _p + _nb; \
        if (_q > _a->limit) { \
            _p = (PRUword)PL_ArenaAllocate(pool, _nb); \
        } else { \
            _a->avail = _q; \
        } \
        p = (void *)_p; \
        PL_MAKE_MEM_UNDEFINED(p, nb); \
        } \
        PL_ArenaCountGrowth(pool, size, incr); \
    PR_END_MACRO

#define PL_ARENA_MARK(pool) ((void *) (pool)->current->avail)
#define PR_UPTRDIFF(p,q) ((PRUword)(p) - (PRUword)(q))

#define PL_CLEAR_UNUSED_PATTERN(a, pattern) \
    PR_BEGIN_MACRO \
        PR_ASSERT((a)->avail <= (a)->limit); \
        PL_MAKE_MEM_UNDEFINED((void*)(a)->avail, (a)->limit - (a)->avail); \
        memset((void*)(a)->avail, (pattern), (a)->limit - (a)->avail); \
    PR_END_MACRO
#ifdef DEBUG
#define PL_FREE_PATTERN 0xDA
#define PL_CLEAR_UNUSED(a) PL_CLEAR_UNUSED_PATTERN((a), PL_FREE_PATTERN)
#define PL_CLEAR_ARENA(a) \
    PR_BEGIN_MACRO \
        PL_MAKE_MEM_UNDEFINED((void*)(a), (a)->limit - (PRUword)(a)); \
        memset((void*)(a), PL_FREE_PATTERN, (a)->limit - (PRUword)(a)); \
    PR_END_MACRO
#else
# 188 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plarena.h"
#define PL_CLEAR_UNUSED(a)
#define PL_CLEAR_ARENA(a)
#endif
# 191 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plarena.h"

#define PL_ARENA_RELEASE(pool, mark) \
    PR_BEGIN_MACRO \
        char *_m = (char *)(mark); \
        PLArena *_a = (pool)->current; \

PR_END_EXTERN_C

#endif /* plarena_h___ */
# 254 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plarena.h"
# 21 "../../dist/include/nsPresArena.h" 2

struct nsArenaMemoryStats;

class nsPresArena {
public:
  nsPresArena();
  ~nsPresArena();

  enum ObjectID {
    nsLineBox_id = nsQueryFrame::NON_FRAME_MARKER,
    nsRuleNode_id,
    nsStyleContext_id,
    nsInheritedStyleData_id,
    nsResetStyleData_id,
    nsFrameList_id,

    CustomCounterStyle_id,
    DependentBuiltinCounterStyle_id,

    First_nsStyleStruct_id,
    DummyBeforeStyleStructs_id = First_nsStyleStruct_id - 1,

    #define STYLE_STRUCT(name_, checkdata_cb_) \
      nsStyle##name_##_id,
    #if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructList.h" 1
/* THIS FILE IS AUTOGENERATED BY generate-stylestructlist.py - DO NOT EDIT */

// IWYU pragma: private, include "nsStyleStructFwd.h"

/*
 * list of structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#endif
# 27 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_DEP
#define STYLE_STRUCT_DEP(dep)
#define UNDEF_STYLE_STRUCT_DEP
#endif
# 32 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_END
#define STYLE_STRUCT_END()
#define UNDEF_STYLE_STRUCT_END
#endif
# 37 "../../dist/include/nsStyleStructList.h"

#ifdef STYLE_STRUCT_TEST
#define STYLE_STRUCT_TEST_CODE(c) c
#else
# 41 "../../dist/include/nsStyleStructList.h"
#define STYLE_STRUCT_TEST_CODE(c)
#endif
# 43 "../../dist/include/nsStyleStructList.h"

// The inherited structs are listed before the Reset structs.
// nsStyleStructID assumes this is the case, and callers other than
// nsStyleStructFwd.h that want the structs in id-order just define
// STYLE_STRUCT rather than including the file twice.


  STYLE_STRUCT_TEST_CODE(if (STYLE_STRUCT_TEST < 8) {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 4) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 2) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 0) {)
STYLE_STRUCT_INHERITED(Font, CheckFontCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Color, CheckColorCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 2) {)
STYLE_STRUCT_INHERITED(List, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Text, CheckTextCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 6) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 4) {)
STYLE_STRUCT_INHERITED(Visibility, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Quotes, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 6) {)
STYLE_STRUCT_INHERITED(UserInterface, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(TableBorder, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 16) {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 12) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 10) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 8) {)
STYLE_STRUCT_INHERITED(SVG, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Variables, CheckVariablesCallback)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 10) {)
STYLE_STRUCT_RESET(Background, nullptr)
STYLE_STRUCT_RESET(TextReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Display, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 14) {)
STYLE_STRUCT_RESET(Content, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(UIReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(} else {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 20) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 18) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 16) {)
STYLE_STRUCT_RESET(Table, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(XUL, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 22) {)
STYLE_STRUCT_RESET(SVGReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Column, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(})

#ifdef UNDEF_STYLE_STRUCT_INHERITED
#undef STYLE_STRUCT_INHERITED
#undef UNDEF_STYLE_STRUCT_INHERITED
#endif
# 230 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_RESET
#undef STYLE_STRUCT_RESET
#undef UNDEF_STYLE_STRUCT_RESET
#endif
# 235 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_DEP
#undef STYLE_STRUCT_DEP
#undef UNDEF_STYLE_STRUCT_DEP
#endif
# 240 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_END
#undef STYLE_STRUCT_END
#undef UNDEF_STYLE_STRUCT_END
#endif
# 245 "../../dist/include/nsStyleStructList.h"

#undef STYLE_STRUCT_TEST_CODE

# 46 "../../dist/include/nsPresArena.h" 2
    #undef STYLE_STRUCT

    DummyAfterStyleStructs_id,
    Last_nsStyleStruct_id = DummyAfterStyleStructs_id - 1,

    /**
     * The PresArena implementation uses this bit to distinguish objects
     * allocated by size from objects allocated by type ID (that is, frames
     * using AllocateByFrameID and other objects using AllocateByObjectID).
     * It should not collide with any Object ID (above) or frame ID (in
     * nsQueryFrame.h).  It is not 0x80000000 to avoid the question of
     * whether enumeration constants are signed.
     */
    NON_OBJECT_MARKER = 0x40000000
  };

  /**
   * Pool allocation with recycler lists indexed by object size, aSize.
   */
  void* AllocateBySize(size_t aSize)
  {
    return Allocate(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aSize);
  }
  void FreeBySize(size_t aSize, void* aPtr)
  {
    Free(uint32_t(aSize) | uint32_t(NON_OBJECT_MARKER), aPtr);
  }

  /**
   * Pool allocation with recycler lists indexed by frame-type ID.
   * Every aID must always be used with the same object size, aSize.
   */
  void* AllocateByFrameID(nsQueryFrame::FrameIID aID, size_t aSize)
  {
    return Allocate(aID, aSize);
  }
  void FreeByFrameID(nsQueryFrame::FrameIID aID, void* aPtr)
  {
    Free(aID, aPtr);
  }

  /**
   * Pool allocation with recycler lists indexed by object-type ID (see above).
   * Every aID must always be used with the same object size, aSize.
   */
  void* AllocateByObjectID(ObjectID aID, size_t aSize)
  {
    return Allocate(aID, aSize);
  }
  void FreeByObjectID(ObjectID aID, void* aPtr)
  {
    Free(aID, aPtr);
  }

  /**
   * Increment aArenaStats with sizes of interesting objects allocated in this
   * arena and its mOther field with the size of everything else.
   */
  void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf,
                              nsArenaMemoryStats* aArenaStats);

private:
  void* Allocate(uint32_t aCode, size_t aSize);
  void Free(uint32_t aCode, void* aPtr);

  // All keys to this hash table fit in 32 bits (see below) so we do not
  // bother actually hashing them.
  class FreeList : public PLDHashEntryHdr
  {
  public:
    typedef uint32_t KeyType;
    nsTArray<void *> mEntries;
    size_t mEntrySize;
    size_t mEntriesEverAllocated;

    typedef const void* KeyTypePointer;
    KeyTypePointer mKey;

    explicit FreeList(KeyTypePointer aKey)
    : mEntrySize(0), mEntriesEverAllocated(0), mKey(aKey) {}
    // Default copy constructor and destructor are ok.

    

    

    

    

    enum { ALLOW_MEMMOVE = false };
  };

#if defined(MOZ_HAVE_MEM_CHECKS)
  static PLDHashOperator UnpoisonFreeList(FreeList* aEntry, void*);
#endif
# 146 "../../dist/include/nsPresArena.h"
  ;

  nsTHashtable<FreeList> mFreeLists;
  PLArenaPool mPool;
};

#endif
# 153 "../../dist/include/nsPresArena.h"
# 43 "../../dist/include/nsIPresShell.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIImageLoadingContent.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIImageLoadingContent.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIImageLoadingContent.idl
 */

#ifndef __gen_nsIImageLoadingContent_h__
#define __gen_nsIImageLoadingContent_h__


#ifndef __gen_imgINotificationObserver_h__
#if 0 /* expanded by -frewrite-includes */
#include "imgINotificationObserver.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/imgINotificationObserver.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/imgINotificationObserver.idl
 */

#ifndef __gen_imgINotificationObserver_h__
#define __gen_imgINotificationObserver_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/imgINotificationObserver.h"
#endif
# 12 "../../dist/include/imgINotificationObserver.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NSRECT_H
#define NSRECT_H

#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>                      // for FILE
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsRect.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>                     // for int32_t, int64_t
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsRect.h"
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>                    // for min/max
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsRect.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"                     // for NS_BUILD_REFCNT_LOGGING
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsRect.h"

struct nsIntRect;
struct nsMargin;
struct nsIntMargin;

struct NS_GFX nsRect :
  public mozilla::gfx::BaseRect<nscoord, nsRect, nsPoint, nsSize, nsMargin> {
  typedef mozilla::gfx::BaseRect<nscoord, nsRect, nsPoint, nsSize, nsMargin> Super;

  

  // Constructors
  nsRect() : Super()
  {
    MOZ_COUNT_CTOR(nsRect);
  }
  nsRect(const nsRect& aRect) : Super(aRect)
  {
    MOZ_COUNT_CTOR(nsRect);
  }
  nsRect(const nsPoint& aOrigin, const nsSize &aSize) : Super(aOrigin, aSize)
  {
    MOZ_COUNT_CTOR(nsRect);
  }
  nsRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight) :
      Super(aX, aY, aWidth, aHeight)
  {
    MOZ_COUNT_CTOR(nsRect);
  }

#ifdef NS_BUILD_REFCNT_LOGGING
  ~nsRect() {
    MOZ_COUNT_DTOR(nsRect);
  }
#endif
# 57 "../../dist/include/nsRect.h"

  // We have saturating versions of all the Union methods. These avoid
  // overflowing nscoord values in the 'width' and 'height' fields by
  // clamping the width and height values to nscoord_MAX if necessary.

  

  nsRect SaturatingUnionEdges(const nsRect& aRect) const
  {
#ifdef NS_COORD_IS_FLOAT
    return UnionEdges(aRect);
#else
# 78 "../../dist/include/nsRect.h"
    nsRect result;
    result.x = std::min(aRect.x, x);
    int64_t w = std::max(int64_t(aRect.x) + aRect.width, int64_t(x) + width) - result.x;
    if (MOZ_UNLIKELY(w > nscoord_MAX)) {
      NS_WARNING("Overflowed nscoord_MAX in conversion to nscoord width");
      // Clamp huge negative x to nscoord_MIN / 2 and try again.
      result.x = std::max(result.x, nscoord_MIN / 2);
      w = std::max(int64_t(aRect.x) + aRect.width, int64_t(x) + width) - result.x;
      if (MOZ_UNLIKELY(w > nscoord_MAX)) {
        w = nscoord_MAX;
      }
    }
    result.width = nscoord(w);

    result.y = std::min(aRect.y, y);
    int64_t h = std::max(int64_t(aRect.y) + aRect.height, int64_t(y) + height) - result.y;
    if (MOZ_UNLIKELY(h > nscoord_MAX)) {
      NS_WARNING("Overflowed nscoord_MAX in conversion to nscoord height");
      // Clamp huge negative y to nscoord_MIN / 2 and try again.
      result.y = std::max(result.y, nscoord_MIN / 2);
      h = std::max(int64_t(aRect.y) + aRect.height, int64_t(y) + height) - result.y;
      if (MOZ_UNLIKELY(h > nscoord_MAX)) {
        h = nscoord_MAX;
      }
    }
    result.height = nscoord(h);
    return result;
#endif
# 106 "../../dist/include/nsRect.h"
  }

#ifndef NS_COORD_IS_FLOAT
  // Make all nsRect Union methods be saturating.
  
  
  
  
#endif
# 127 "../../dist/include/nsRect.h"

  
  

  // Converts this rect from aFromAPP, an appunits per pixel ratio, to aToAPP.
  // This is here only to keep IPDL-generated code happy. DO NOT USE.
  
};

struct NS_GFX nsIntRect :
  public mozilla::gfx::BaseRect<int32_t, nsIntRect, nsIntPoint, nsIntSize, nsIntMargin> {
  typedef mozilla::gfx::BaseRect<int32_t, nsIntRect, nsIntPoint, nsIntSize, nsIntMargin> Super;

  // Constructors
  nsIntRect() : Super()
  {
  }
  nsIntRect(const nsIntRect& aRect) : Super(aRect)
  {
  }
  
  nsIntRect(int32_t aX, int32_t aY, int32_t aWidth, int32_t aHeight) :
      Super(aX, aY, aWidth, aHeight)
  {
  }

  ;

  // Returns a special nsIntRect that's used in some places to signify
  // "all available space".
  static const nsIntRect& GetMaxSizedIntRect() {
    static const nsIntRect r(0, 0, INT32_MAX, INT32_MAX);
    return r;
  }

  // This is here only to keep IPDL-generated code happy. DO NOT USE.
  bool operator==(const nsIntRect& aRect) const
  {
    return IsEqualEdges(aRect);
  }
};

/*
 * App Unit/Pixel conversions
 */





// scale the rect but round to preserve centers


// scale the rect but round to smallest containing rect


// scale the rect but round to largest contained rect








// app units are integer multiples of pixels, so no rounding needed


#ifdef DEBUG
// Diagnostics
extern NS_GFX FILE* operator<<(FILE* out, const nsRect& rect);
#endif // DEBUG
# 319 "../../dist/include/nsRect.h"

#endif /* NSRECT_H */
# 321 "../../dist/include/nsRect.h"
# 20 "../../dist/include/imgINotificationObserver.h" 2

/* starting interface:    imgINotificationObserver */
#define IMGINOTIFICATIONOBSERVER_IID_STR "03da5641-a333-454a-a859-036d0bb683b7"

#define IMGINOTIFICATIONOBSERVER_IID \
  {0x03da5641, 0xa333, 0x454a, \
    { 0xa8, 0x59, 0x03, 0x6d, 0x0b, 0xb6, 0x83, 0xb7 }}

class NS_NO_VTABLE imgINotificationObserver : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(IMGINOTIFICATIONOBSERVER_IID)

  enum {
    SIZE_AVAILABLE = 1,
    FRAME_UPDATE = 2,
    FRAME_COMPLETE = 3,
    LOAD_COMPLETE = 4,
    DECODE_COMPLETE = 5,
    DISCARD = 6,
    UNLOCKED_DRAW = 7,
    IS_ANIMATED = 8,
    HAS_TRANSPARENCY = 9
  };

  /* [noscript] void notify (in imgIRequest aProxy, in long aType, [const] in nsIntRect aRect); */
  NS_IMETHOD Notify(imgIRequest *aProxy, int32_t aType, const nsIntRect *aRect) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(imgINotificationObserver, IMGINOTIFICATIONOBSERVER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_IMGINOTIFICATIONOBSERVER \
  NS_IMETHOD Notify(imgIRequest *aProxy, int32_t aType, const nsIntRect *aRect) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_IMGINOTIFICATIONOBSERVER(_to) \
  NS_IMETHOD Notify(imgIRequest *aProxy, int32_t aType, const nsIntRect *aRect) MOZ_OVERRIDE { return _to Notify(aProxy, aType, aRect); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_IMGINOTIFICATIONOBSERVER(_to) \
  NS_IMETHOD Notify(imgIRequest *aProxy, int32_t aType, const nsIntRect *aRect) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Notify(aProxy, aType, aRect); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class _MYCLASS_ : public imgINotificationObserver
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_IMGINOTIFICATIONOBSERVER

  _MYCLASS_();

{
  /* destructor code */
}

/* [noscript] void notify (in imgIRequest aProxy, in long aType, [const] in nsIntRect aRect); */
NS_IMETHODIMP _MYCLASS_::Notify(imgIRequest *aProxy, int32_t aType, const nsIntRect *aRect)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 104 "../../dist/include/imgINotificationObserver.h"


#endif /* __gen_imgINotificationObserver_h__ */
# 107 "../../dist/include/imgINotificationObserver.h"
# 11 "../../dist/include/nsIImageLoadingContent.h" 2
#endif
# 12 "../../dist/include/nsIImageLoadingContent.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIImageLoadingContent.h"
class imgIRequest; /* forward declaration */

class nsIChannel; /* forward declaration */

class nsIStreamListener; /* forward declaration */

class nsIURI; /* forward declaration */

class nsIDocument; /* forward declaration */

class nsIFrame; /* forward declaration */


/* starting interface:    nsIImageLoadingContent */
#define NS_IIMAGELOADINGCONTENT_IID_STR "5794d12b-3195-4526-a814-a2181f6c71fe"

#define NS_IIMAGELOADINGCONTENT_IID \
  {0x5794d12b, 0x3195, 0x4526, \
    { 0xa8, 0x14, 0xa2, 0x18, 0x1f, 0x6c, 0x71, 0xfe }}

class NS_NO_VTABLE nsIImageLoadingContent : public imgINotificationObserver {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIMAGELOADINGCONTENT_IID)

  enum {
    UNKNOWN_REQUEST = -1,
    CURRENT_REQUEST = 0,
    PENDING_REQUEST = 1
  };

  /* attribute boolean loadingEnabled; */
  NS_IMETHOD GetLoadingEnabled(bool *aLoadingEnabled) = 0;
  NS_IMETHOD SetLoadingEnabled(bool aLoadingEnabled) = 0;

  /* readonly attribute short imageBlockingStatus; */
  NS_IMETHOD GetImageBlockingStatus(int16_t *aImageBlockingStatus) = 0;

  /* void addObserver (in imgINotificationObserver aObserver); */
  NS_IMETHOD AddObserver(imgINotificationObserver *aObserver) = 0;

  /* void removeObserver (in imgINotificationObserver aObserver); */
  NS_IMETHOD RemoveObserver(imgINotificationObserver *aObserver) = 0;

  /* imgIRequest getRequest (in long aRequestType); */
  NS_IMETHOD GetRequest(int32_t aRequestType, imgIRequest * *_retval) = 0;

  /* [notxpcom] void frameCreated (in nsIFrame aFrame); */
  NS_IMETHOD_(void) FrameCreated(nsIFrame *aFrame) = 0;

  /* [notxpcom] void frameDestroyed (in nsIFrame aFrame); */
  NS_IMETHOD_(void) FrameDestroyed(nsIFrame *aFrame) = 0;

  /* long getRequestType (in imgIRequest aRequest); */
  NS_IMETHOD GetRequestType(imgIRequest *aRequest, int32_t *_retval) = 0;

  /* readonly attribute nsIURI currentURI; */
  NS_IMETHOD GetCurrentURI(nsIURI * *aCurrentURI) = 0;

  /* nsIStreamListener loadImageWithChannel (in nsIChannel aChannel); */
  NS_IMETHOD LoadImageWithChannel(nsIChannel *aChannel, nsIStreamListener * *_retval) = 0;

  /* [optional_argc] void forceReload ([optional] in boolean aNotify); */
  NS_IMETHOD ForceReload(bool aNotify, uint8_t _argc) = 0;

  /* void forceImageState (in boolean aForce, in unsigned long long aState); */
  NS_IMETHOD ForceImageState(bool aForce, uint64_t aState) = 0;

  /* readonly attribute unsigned long naturalWidth; */
  NS_IMETHOD GetNaturalWidth(uint32_t *aNaturalWidth) = 0;

  /* readonly attribute unsigned long naturalHeight; */
  NS_IMETHOD GetNaturalHeight(uint32_t *aNaturalHeight) = 0;

  /* [noscript,notxpcom] void IncrementVisibleCount (); */
  NS_IMETHOD_(void) IncrementVisibleCount(void) = 0;

  /* [noscript,notxpcom] void DecrementVisibleCount (in uint32_t aNonvisibleAction); */
  NS_IMETHOD_(void) DecrementVisibleCount(uint32_t aNonvisibleAction) = 0;

  /* [noscript,notxpcom] uint32_t GetVisibleCount (); */
  NS_IMETHOD_(uint32_t) GetVisibleCount(void) = 0;

  enum {
    ON_NONVISIBLE_NO_ACTION = 0,
    ON_NONVISIBLE_REQUEST_DISCARD = 1
  };

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIImageLoadingContent, NS_IIMAGELOADINGCONTENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIIMAGELOADINGCONTENT \
  NS_IMETHOD GetLoadingEnabled(bool *aLoadingEnabled) MOZ_OVERRIDE; \
  NS_IMETHOD SetLoadingEnabled(bool aLoadingEnabled) MOZ_OVERRIDE; \
  NS_IMETHOD GetImageBlockingStatus(int16_t *aImageBlockingStatus) MOZ_OVERRIDE; \
  NS_IMETHOD AddObserver(imgINotificationObserver *aObserver) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveObserver(imgINotificationObserver *aObserver) MOZ_OVERRIDE; \
  NS_IMETHOD GetRequest(int32_t aRequestType, imgIRequest * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD_(void) FrameCreated(nsIFrame *aFrame) MOZ_OVERRIDE; \
  NS_IMETHOD_(void) FrameDestroyed(nsIFrame *aFrame) MOZ_OVERRIDE; \
  NS_IMETHOD GetRequestType(imgIRequest *aRequest, int32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetCurrentURI(nsIURI * *aCurrentURI) MOZ_OVERRIDE; \
  NS_IMETHOD LoadImageWithChannel(nsIChannel *aChannel, nsIStreamListener * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD ForceReload(bool aNotify, uint8_t _argc) MOZ_OVERRIDE; \
  NS_IMETHOD ForceImageState(bool aForce, uint64_t aState) MOZ_OVERRIDE; \
  NS_IMETHOD GetNaturalWidth(uint32_t *aNaturalWidth) MOZ_OVERRIDE; \
  NS_IMETHOD GetNaturalHeight(uint32_t *aNaturalHeight) MOZ_OVERRIDE; \
  NS_IMETHOD_(void) IncrementVisibleCount(void) MOZ_OVERRIDE; \
  NS_IMETHOD_(void) DecrementVisibleCount(uint32_t aNonvisibleAction) MOZ_OVERRIDE; \
  NS_IMETHOD_(uint32_t) GetVisibleCount(void) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIIMAGELOADINGCONTENT(_to) \
  NS_IMETHOD GetLoadingEnabled(bool *aLoadingEnabled) MOZ_OVERRIDE { return _to GetLoadingEnabled(aLoadingEnabled); } \
  NS_IMETHOD SetLoadingEnabled(bool aLoadingEnabled) MOZ_OVERRIDE { return _to SetLoadingEnabled(aLoadingEnabled); } \
  NS_IMETHOD GetImageBlockingStatus(int16_t *aImageBlockingStatus) MOZ_OVERRIDE { return _to GetImageBlockingStatus(aImageBlockingStatus); } \
  NS_IMETHOD AddObserver(imgINotificationObserver *aObserver) MOZ_OVERRIDE { return _to AddObserver(aObserver); } \
  NS_IMETHOD RemoveObserver(imgINotificationObserver *aObserver) MOZ_OVERRIDE { return _to RemoveObserver(aObserver); } \
  NS_IMETHOD GetRequest(int32_t aRequestType, imgIRequest * *_retval) MOZ_OVERRIDE { return _to GetRequest(aRequestType, _retval); } \
  NS_IMETHOD_(void) FrameCreated(nsIFrame *aFrame) MOZ_OVERRIDE { return _to FrameCreated(aFrame); } \
  NS_IMETHOD_(uint32_t) GetVisibleCount(void) MOZ_OVERRIDE; \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

}

/* [noscript,notxpcom] void DecrementVisibleCount (in uint32_t aNonvisibleAction); */
NS_IMETHODIMP_(void) nsImageLoadingContent::DecrementVisibleCount(uint32_t aNonvisibleAction)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript,notxpcom] uint32_t GetVisibleCount (); */
NS_IMETHODIMP_(uint32_t) nsImageLoadingContent::GetVisibleCount()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 312 "../../dist/include/nsIImageLoadingContent.h"


#endif /* __gen_nsIImageLoadingContent_h__ */
# 315 "../../dist/include/nsIImageLoadingContent.h"
# 44 "../../dist/include/nsIPresShell.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsMargin.h"
#endif /* expanded by -frewrite-includes */
# 45 "../../dist/include/nsIPresShell.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameState.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsFrameState.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* constants for frame state bits and a type to store them in a uint64_t */

#ifndef nsFrameState_h_
#define nsFrameState_h_
typedef uint64_t nsFrameState_size_t;

#define NS_FRAME_STATE_BIT(n_) (nsFrameState(nsFrameState_size_t(1) << (n_)))

#if (_MSC_VER == 1600)
/*
 * Visual Studio 2010 has trouble with the sized enum.  Although sized enums
 * are supported, two problems arise:
 *
 *   1. Implicit conversions from the enum type to the equivalently sized
 *      integer size are not performed, leading to many compile errors.
 *   2. Even with explicit casts added to avoid the errors from (1), odd
 *      test failures result, which might well be due to a compiler bug.
 *
 * So with VS2010 we use consts for the state bits and forgo the increased
 * type safety of the enum.  (Visual Studio 2012 has no problem with
 * nsFrameState being a sized enum, however.)
 */

typedef nsFrameState_size_t nsFrameState;

#define FRAME_STATE_BIT(group_, value_, name_) \
const nsFrameState name_ = NS_FRAME_STATE_BIT(value_);
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameStateBits.h"
#endif /* expanded by -frewrite-includes */
# 43 "../../dist/include/nsFrameState.h"
#undef FRAME_STATE_BIT

#else
# 46 "../../dist/include/nsFrameState.h"

enum nsFrameState : nsFrameState_size_t {
#define FRAME_STATE_BIT(group_, value_, name_) \
  name_ = NS_FRAME_STATE_BIT(value_),
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameStateBits.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsFrameStateBits.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* a list of all frame state bits, for preprocessing */

/******


  FRAME_STATE_BIT(group_, value_, name_)

    This denotes the existence of a frame state bit.  group_ indicates
    which group the bit belongs to, value_ is the bit number (0..63),
    and name_ is the name of the frame state bit constant.

  Note that if you add a new frame state group, you'll need to #include
  the header for its frame classes in nsFrameState.cpp and, if they don't
  already, add nsQueryFrame implementations (which can be DEBUG-only) to
  the frame classes.

 ******/

#ifndef FRAME_STATE_GROUP
#define FRAME_STATE_GROUP(name_, class_) /* nothing */
#define DEFINED_FRAME_STATE_GROUP
#endif
# 44 "../../dist/include/nsFrameStateBits.h"

#ifndef FRAME_STATE_BIT
#define FRAME_STATE_BIT(group_, value_, name_) /* nothing */
#define DEFINED_FRAME_STATE_BIT
#endif
# 49 "../../dist/include/nsFrameStateBits.h"

// == Frame state bits that apply to all frames ===============================

FRAME_STATE_GROUP(Generic, nsIFrame)

FRAME_STATE_BIT(Generic, 0, NS_FRAME_IN_REFLOW)

FRAME_STATE_BIT(Generic, 4, NS_FRAME_EXTERNAL_REFERENCE)

// If this bit is set, this frame or one of its descendants has a
// percentage height that depends on an ancestor of this frame.
// (Or it did at one point in the past, since we don't necessarily clear
// the bit when it's no longer needed; it's an optimization.)
FRAME_STATE_BIT(Generic, 5, NS_FRAME_CONTAINS_RELATIVE_HEIGHT)

// If this bit is set, then the frame corresponds to generated content
FRAME_STATE_BIT(Generic, 6, NS_FRAME_GENERATED_CONTENT)

// If this bit is set the frame is a continuation that is holding overflow,
// i.e. it is a next-in-flow created to hold overflow after the box's
// height has ended. This means the frame should be a) at the top of the
//  3. the frame has had a style change that requires the frame to be reflowed
//     but does not _necessarily_ require its descendants to be reflowed (e.g.,
// This state bit is set on frames within token MathML elements if the
// token represents an <mi> tag whose inner HTML consists of a single
// non-whitespace character to allow special rendering behaviour.
FRAME_STATE_BIT(Generic, 59, NS_FRAME_IS_IN_SINGLE_CHAR_MI)

// NOTE: Bits 20-31 and 60-63 of the frame state are reserved for specific
// frame classes.


// == Frame state bits that apply to box frames ===============================

FRAME_STATE_GROUP(Box, nsBoxFrame)

FRAME_STATE_BIT(Box, 20, NS_STATE_BOX_CHILD_RESERVED)
FRAME_STATE_BIT(Box, 21, NS_STATE_STACK_NOT_POSITIONED)
FRAME_STATE_BIT(Box, 22, NS_STATE_IS_HORIZONTAL)
FRAME_STATE_BIT(Box, 23, NS_STATE_AUTO_STRETCH)
FRAME_STATE_BIT(Box, 24, NS_STATE_IS_ROOT)
FRAME_STATE_BIT(Box, 25, NS_STATE_CURRENTLY_IN_DEBUG)
FRAME_STATE_BIT(Box, 26, NS_STATE_SET_TO_DEBUG)
FRAME_STATE_BIT(Box, 27, NS_STATE_DEBUG_WAS_SET)
FRAME_STATE_BIT(Box, 28, NS_STATE_MENU_HAS_POPUP_LIST)
FRAME_STATE_BIT(Box, 29, NS_STATE_BOX_WRAPS_KIDS_IN_BLOCK)
FRAME_STATE_BIT(Box, 30, NS_STATE_EQUAL_SIZE)
FRAME_STATE_BIT(Box, 31, NS_STATE_IS_DIRECTION_NORMAL)
FRAME_STATE_BIT(Box, 60, NS_FRAME_MOUSE_THROUGH_ALWAYS)
FRAME_STATE_BIT(Box, 61, NS_FRAME_MOUSE_THROUGH_NEVER)


// == Frame state bits that apply to flex container frames ====================

FRAME_STATE_GROUP(FlexContainer, nsFlexContainerFrame)
# 51 "../../dist/include/nsFrameState.h" 2
#undef FRAME_STATE_BIT
};

inline nsFrameState operator|(nsFrameState aLeft, nsFrameState aRight)
{
  return nsFrameState(nsFrameState_size_t(aLeft) | nsFrameState_size_t(aRight));
}

inline nsFrameState operator&(nsFrameState aLeft, nsFrameState aRight)
{
  return nsFrameState(nsFrameState_size_t(aLeft) & nsFrameState_size_t(aRight));
}

inline nsFrameState& operator|=(nsFrameState& aLeft, nsFrameState aRight)
{
  aLeft = aLeft | aRight;
  return aLeft;
}

inline nsFrameState& operator&=(nsFrameState& aLeft, nsFrameState aRight)
{
  aLeft = aLeft & aRight;
  return aLeft;
}

inline nsFrameState operator~(nsFrameState aRight)
{
  return nsFrameState(~nsFrameState_size_t(aRight));
}

inline nsFrameState operator^(nsFrameState aLeft, nsFrameState aRight)
{
  return nsFrameState(nsFrameState_size_t(aLeft) ^ nsFrameState_size_t(aRight));
}

inline nsFrameState& operator^=(nsFrameState& aLeft, nsFrameState aRight)
{
  aLeft = aLeft ^ aRight;
  return aLeft;
}

#endif
# 93 "../../dist/include/nsFrameState.h"

// Bits 20-31 and 60-63 of the frame state are reserved for implementations.
#define NS_FRAME_IMPL_RESERVED                      nsFrameState(0xF0000000FFF00000)
#define NS_FRAME_RESERVED                           ~NS_FRAME_IMPL_RESERVED

namespace mozilla {
#ifdef DEBUG
nsCString GetFrameState(nsIFrame* aFrame);
void PrintFrameState(nsIFrame* aFrame);
#endif
# 103 "../../dist/include/nsFrameState.h"
}

#endif /* nsFrameState_h_ */ 
# 106 "../../dist/include/nsFrameState.h"
# 46 "../../dist/include/nsIPresShell.h" 2

class nsDocShell;
class nsIDocument;
class nsIFrame;
class nsPresContext;
class nsStyleSet;
class nsViewManager;
class nsView;
class nsRenderingContext;
class nsIPageSequenceFrame;
class nsCanvasFrame;
class nsAString;
class nsCaret;
namespace mozilla {
class TouchCaret;
class SelectionCarets;
} // namespace mozilla
class nsFrameSelection;
class nsFrameManager;
class nsILayoutHistoryState;
class nsIReflowCallback;
class nsIDOMNode;
class nsIntRegion;
class nsIStyleSheet;
class nsCSSFrameConstructor;
class nsISelection;
template<class E> class nsCOMArray;
class nsWeakFrame;
class nsIScrollableFrame;
class gfxContext;
class nsIDOMEvent;
class nsDisplayList;
class nsDisplayListBuilder;
class nsPIDOMWindow;
struct nsPoint;
class nsINode;
struct nsIntPoint;
struct nsIntRect;
struct nsRect;
class nsRegion;
class nsRefreshDriver;
class nsARefreshObserver;
class nsAPostRefreshObserver;
#ifdef ACCESSIBILITY
class nsAccessibilityService;
namespace mozilla {
namespace a11y {
class DocAccessible;
} // namespace a11y
} // namespace mozilla
#endif
# 97 "../../dist/include/nsIPresShell.h"
class nsIWidget;
struct nsArenaMemoryStats;
class nsITimer;

typedef short SelectionType;

namespace mozilla {
class EventStates;

namespace dom {
class Element;
class Touch;
class Selection;
class ShadowRoot;
} // namespace dom

namespace layers {
class LayerManager;
} // namespace layers

namespace gfx {
class SourceSurface;
} // namespace gfx
} // namespace mozilla

// Flags to pass to SetCapturingContent
//
// when assigning capture, ignore whether capture is allowed or not
#define CAPTURE_IGNOREALLOWED 1
// true if events should be targeted at the capturing content or its children
#define CAPTURE_RETARGETTOELEMENT 2
// true if the current capture wants drags to be prevented
#define CAPTURE_PREVENTDRAG 4
// true when the mouse is pointer locked, and events are sent to locked element
#define CAPTURE_POINTERLOCK 8

typedef struct CapturingContentInfo {
  // capture should only be allowed during a mousedown event
  bool mAllowed;
  bool mPointerLock;
  bool mRetargetToElement;
  bool mPreventDrag;
  nsIContent* mContent;
} CapturingContentInfo;

// 9d010f90-2d90-471c-b640-038cc350c187
#define NS_IPRESSHELL_IID \
  { 0x9d010f90, 0x2d90, 0x471c, \
    { 0xb6, 0x40, 0x03, 0x8c, 0xc3, 0x50, 0xc1, 0x87 } }

// debug VerifyReflow flags
#define VERIFY_REFLOW_ON                    0x01
#define VERIFY_REFLOW_NOISY                 0x02
#define VERIFY_REFLOW_ALL                   0x04
#define VERIFY_REFLOW_DUMP_COMMANDS         0x08
#define VERIFY_REFLOW_NOISY_RC              0x10
#define VERIFY_REFLOW_REALLY_NOISY_RC       0x20
#define VERIFY_REFLOW_DURING_RESIZE_REFLOW  0x40

#undef NOISY_INTERRUPTIBLE_REFLOW

enum nsRectVisibility {
  nsRectVisibility_kVisible,
  nsRectVisibility_kAboveViewport,
  nsRectVisibility_kBelowViewport,
  nsRectVisibility_kLeftOfViewport,
  nsRectVisibility_kRightOfViewport
};

/**
 * Presentation shell interface. Presentation shells are the
 * controlling point for managing the presentation of a document. The
 * presentation shell holds a live reference to the document, the
 * presentation context, the style manager, the style set and the root
 * frame. <p>
 *
 * When this object is Release'd, it will release the document, the
 * presentation context, the style manager, the style set and the root
 * frame.
 */

class nsIPresShell : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRESSHELL_IID)

protected:
  typedef mozilla::layers::LayerManager LayerManager;
  typedef mozilla::gfx::SourceSurface SourceSurface;

  enum eRenderFlag {
    STATE_IGNORING_VIEWPORT_SCROLLING = 0x1,
    STATE_DRAWWINDOW_NOT_FLUSHING = 0x2
  };
  typedef uint8_t RenderFlags; // for storing the above flags

public:
  /**
   * All callers are responsible for calling |Destroy| after calling
   * |EndObservingDocument|.  It needs to be separate only because form
   * controls incorrectly store their data in the frames rather than the
   * content model and printing calls |EndObservingDocument| multiple
   * times to make form controls behave nicely when printed.
   */
  ;

  bool IsDestroying() { return mIsDestroying; }

  /**
   * Make a one-way transition into a "zombie" state.  In this state,
   * no reflow is done, no painting is done, and no refresh driver
   * ticks are processed.  This is a dangerous state: it can leave

  

  /**
   * This is for allocating other types of objects (not frames).  Separate free
   * lists are maintained for each type (aID), which must always correspond to
   * the same aSize value.  AllocateByObjectID returns zero-filled memory.
   * AllocateByObjectID is infallible and will abort on out-of-memory.
   */
  void* AllocateByObjectID(nsPresArena::ObjectID aID, size_t aSize)
  {
#ifdef DEBUG
    mPresArenaAllocCount++;
#endif
# 254 "../../dist/include/nsIPresShell.h"
    void* result = mFrameArena.AllocateByObjectID(aID, aSize);
    memset(result, 0, aSize);
    return result;
  }

  void FreeByObjectID(nsPresArena::ObjectID aID, void* aPtr)
  {
#ifdef DEBUG
    mPresArenaAllocCount--;
#endif
# 264 "../../dist/include/nsIPresShell.h"
    if (!mIsDestroying)
      mFrameArena.FreeByObjectID(aID, aPtr);
  }

  /**
   * Other objects closely related to the frame tree that are allocated
   * from a separate set of per-size free lists.  Note that different types
   * of objects that has the same size are allocated from the same list.
   * AllocateMisc does *not* clear the memory that it returns.
   * AllocateMisc is infallible and will abort on out-of-memory.
   *
   * @deprecated use AllocateByObjectID/FreeByObjectID instead
   */
  

  

  nsIDocument* GetDocument() const { return mDocument; }

  nsPresContext* GetPresContext() const { return mPresContext; }

  

#ifdef MOZILLA_INTERNAL_API
  nsStyleSet* StyleSet() const { return mStyleSet; }

  nsCSSFrameConstructor* FrameConstructor() const { return mFrameConstructor; }

  nsFrameManager* FrameManager() const {
    // reinterpret_cast is valid since nsFrameManager does not add
    // any members over nsFrameManagerBase.
    return reinterpret_cast<nsFrameManager*>
                           (const_cast<nsIPresShell*>(this)->mFrameManager);
  }

#endif
# 331 "../../dist/include/nsIPresShell.h"

  /* Enable/disable author style level. Disabling author style disables the entire
   * author level of the cascade, including the HTML preshint level.
   */
  // XXX these could easily be inlined, but there is a circular #include
  // problem with nsStyleSet.
  void SetAuthorStyleDisabled(bool aDisabled);
  bool GetAuthorStyleDisabled() const;

  /*
   * Called when stylesheets are added/removed/enabled/disabled to rebuild
   * all style data for a given pres shell without necessarily reconstructing
   * all of the frames.  This will not reconstruct style synchronously; if
   * you need to do that, call FlushPendingNotifications to flush out style
   * reresolves.
   * // XXXbz why do we have this on the interface anyway?  The only consumer
   * is calling AddOverrideStyleSheet/RemoveOverrideStyleSheet, and I think
   * Set the verify-reflow enable flag.
   */
  ;

  ;

#ifdef MOZ_REFLOW_PERF
  ;
  ;
  virtual void PaintCount(const char * aName,
                                      nsRenderingContext* aRenderingContext,
                                      nsPresContext * aPresContext,
                                      nsIFrame * aFrame,
                                      const nsPoint& aOffset,
                                      uint32_t aColor) = 0;
  ;
   * Return true if accessibility is active.
   */
  ;

  /**
   * Return accessibility service if accessibility is active.
   */
  ;
#endif
# 1035 "../../dist/include/nsIPresShell.h"

  /**
   * Stop all active elements (plugins and the caret) in this presentation and
   * in the presentations of subdocuments.  Resets painting to a suppressed state.
   * XXX this should include image animations
   */
  ;
  

  /**
   * Restarts active elements (plugins) in this presentation and in the
   * presentations of subdocuments, then do a full invalidate of the content area.
   */
  ;

  ;

  /**
   * When this shell is disconnected from its containing docshell, we
   * lose our container pointer.  However, we'd still like to be able to target
  /**
   * Computes the backstop color for the view: transparent if in a transparent
   * widget, otherwise the PresContext default background color. This color is
   * only visible if the contents of the view as a whole are translucent.
   */
  virtual nscolor ComputeBackstopColor(nsView* aDisplayRoot) = 0;

  void ObserveNativeAnonMutationsForPrint(bool aObserve)
  {
    mObservesMutationsForPrint = aObserve;
  }
  bool ObservesNativeAnonMutationsForPrint()
  {
    return mObservesMutationsForPrint;
  }

  virtual nsresult SetIsActive(bool aIsActive) = 0;

  

  // mouse capturing
  static CapturingContentInfo gCaptureInfo;

  struct PointerCaptureInfo
  {
    nsCOMPtr<nsIContent> mPendingContent;
    nsCOMPtr<nsIContent> mOverrideContent;
    bool                 mReleaseContent;
    bool                 mPrimaryState;
    
    
    

    
  };

  // Keeps a map between pointerId and element that currently capturing pointer
  // with such pointerId. If pointerId is absent in this map then nobody is
  // capturing it. Additionally keep information about pending capturing content.
  // Additionally keep information about primaryState of pointer event.
  static nsClassHashtable<nsUint32HashKey, PointerCaptureInfo>* gPointerCaptureList;

  struct PointerInfo
  {
    bool      mActiveState;
    uint16_t  mPointerType;
    bool      mPrimaryState;
    
  };
  // Keeps information about pointers such as pointerId, activeState, pointerType, primaryState
  static nsClassHashtable<nsUint32HashKey, PointerInfo>* gActivePointersIds;

  ;
  ;
  ;
  ;

  // CheckPointerCaptureState checks cases, when got/lostpointercapture events should be fired.
  // Function returns true, if any of events was fired; false, if no one event was fired.
  ;

  // GetPointerInfo returns true if pointer with aPointerId is situated in device, false otherwise.
  static void SetCapturingContent(nsIContent* aContent, uint8_t aFlags);

  /**
   * Return the active content currently capturing the mouse if any.
   */
  static nsIContent* GetCapturingContent()
  {
    return gCaptureInfo.mContent;
  }

  /**
   * Allow or disallow mouse capturing.
   */
  

  /**
   * Returns true if there is an active mouse capture that wants to prevent
   * drags.
   */
  

  // IMPORTANT: The ownership implicit in the following member variables
  // has been explicitly checked.  If you add any members to this class,
  // please make the ownership explicit (pinkerton, scc).

  // These are the same Document and PresContext owned by the DocViewer.
  // we must share ownership.
  nsIDocument*              mDocument;      // [STRONG]
  nsPresContext*            mPresContext;   // [STRONG]
  nsStyleSet*               mStyleSet;      // [OWNS]
  nsCSSFrameConstructor*    mFrameConstructor; // [OWNS]
  nsViewManager*           mViewManager;   // [WEAK] docViewer owns it so I don't have to
  nsPresArena               mFrameArena;
  nsFrameSelection*         mSelection;
  // Pointer into mFrameConstructor - this is purely so that FrameManager() and
  // GetRootFrame() can be inlined:
  nsFrameManagerBase*       mFrameManager;
  mozilla::WeakPtr<nsDocShell>                 mForwardingContainer;
  nsRefreshDriver*          mHiddenInvalidationObserverRefreshDriver;
#ifdef ACCESSIBILITY
  mozilla::a11y::DocAccessible* mDocAccessible;
#endif
# 1701 "../../dist/include/nsIPresShell.h"

  // At least on Win32 and Mac after interupting a reflow we need to post
  // the resume reflow event off a timer to avoid event starvation because
  // posted messages are processed before other messages when the modal
  // moving/sizing loop is running, see bug 491700 for details.
  nsCOMPtr<nsITimer>        mReflowContinueTimer;

#ifdef DEBUG
  nsIFrame*                 mDrawEventTargetFrame;
  // Ensure that every allocation from the PresArena is eventually freed.
  uint32_t                  mPresArenaAllocCount;
#endif
# 1713 "../../dist/include/nsIPresShell.h"

  // Count of the number of times this presshell has been painted to a window.
  uint64_t                  mPaintCount;

  nsSize                    mScrollPositionClampingScrollPortSize;

  // This margin is intended to be used when laying out fixed position children
  // on this PresShell's viewport frame. See the documentation of
  // nsIDOMWindowUtils.setContentDocumentFixedPositionMargins for details of
  // their use.
  nsMargin                  mContentDocumentFixedPositionMargins;

  // changes in a way that prevents us from being able to (usefully)
  // re-use old pixels.
  RenderFlags               mRenderFlags;

  // Indicates that the whole document must be restyled.  Changes to scoped
  // style sheets are recorded in mChangedScopeStyleRoots rather than here
  // in mStylesHaveChanged.
  bool                      mStylesHaveChanged : 1;
  bool                      mDidInitialize : 1;
  bool                      mIsDestroying : 1;
  bool                      mIsZombie : 1;
  bool                      mIsReflowing : 1;

  // For all documents we initially lock down painting.
  bool                      mPaintingSuppressed : 1;

  // Whether or not form controls should use nsITheme in this shell.
  bool                      mIsThemeSupportDisabled : 1;

  bool                      mIsActive : 1;
  bool                      mFrozen : 1;
  bool                      mIsFirstPaint : 1;
  bool                      mObservesMutationsForPrint : 1;

  bool mFontSizeInflationEnabledIsDirty;

  // Flag to indicate whether or not there is a reflow on zoom event pending.
  // See IsReflowOnZoomPending() for more information.
  bool mReflowOnZoomPending;

  // The maximum width of a line box. Text on a single line that exceeds this
  // width will be wrapped. A value of 0 indicates that no limit is enforced.
  nscoord mMaxLineBoxWidth;

  // If a document belongs to an invisible DocShell, this flag must be set
  // to true, so we can avoid any paint calls for widget related to this
  // presshell.
  bool mIsNeverPainting;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIPresShell, NS_IPRESSHELL_IID)

#endif /* nsIPresShell_h___ */
# 1815 "../../dist/include/nsIPresShell.h"
# 17 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsRect.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsPresContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsFont.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsFont.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsFont_h___
#define nsFont_h___

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>                     // for uint8_t, uint16_t
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsFont.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>                  // for int16_t
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsFont.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxCore.h"                    // for NS_GFX
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsFont.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxFontFamilyList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxFontFamilyList.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_FONT_FAMILY_LIST_H
#define GFX_FONT_FAMILY_LIST_H

#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxFontFamilyList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxFontFamilyList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/gfxFontFamilyList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsUnicharUtils.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxFontFamilyList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxFontFamilyList.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/gfxFontFamilyList.h"

namespace mozilla {

/**
 * type of font family name, either a name (e.g. Helvetica) or a
 * generic (e.g. serif, sans-serif), with the ability to distinguish
 * between unquoted and quoted names for serializaiton
 */ 

enum FontFamilyType {
  eFamily_none = 0,  // used when finding generics

  // explicitly named font family (e.g. Helvetica)
  eFamily_named,
  eFamily_named_quoted,

  // generics
  eFamily_serif,
  eFamily_sans_serif,
  eFamily_monospace,
  eFamily_cursive,
  eFamily_fantasy,

  // special
  eFamily_moz_variable,
  eFamily_moz_fixed
};

enum QuotedName { eQuotedName, eUnquotedName };

/**
 * font family name, a string for the name if not a generic and
 * a font type indicated named family or which generic family
 */

struct FontFamilyName MOZ_FINAL {
    

    // named font family - e.g. Helvetica
    explicit FontFamilyName(const nsAString& aFamilyName,
                            QuotedName aQuoted = eUnquotedName) {
        mType = (aQuoted == eQuotedName) ? eFamily_named_quoted : eFamily_named;
        mName = aFamilyName;
    }

    // generic font family - e.g. sans-serif
    explicit FontFamilyName(FontFamilyType aType) {
        NS_ASSERTION(aType != eFamily_named &&
                     aType != eFamily_named_quoted &&
                     aType != eFamily_none,
                     "expected a generic font type");
        mName.Truncate();
        mType = aType;
    }

    FontFamilyName(const FontFamilyName& aCopy) {
        mType = aCopy.mType;
        mName = aCopy.mName;
    }

    bool IsNamed() const {
        return mType == eFamily_named || mType == eFamily_named_quoted;
    }

    

    

    // helper method that converts generic names to the right enum value
    

    // memory reporting
    

    

    FontFamilyType mType;
    nsString       mName; // empty if mType != eFamily_named
};



/**
 * font family list, array of font families and a default font type.
 * font family names are either named strings or generics. the default
 * font type is used to preserve the variable font fallback behavior
 */ 

class FontFamilyList {
public:
    FontFamilyList()
        : mDefaultFontType(eFamily_none)
    {
    }

    explicit FontFamilyList(FontFamilyType aGenericType)
        : mDefaultFontType(eFamily_none)
    {
        Append(FontFamilyName(aGenericType));
    }

    

    

    void Append(const FontFamilyName& aFamilyName) {
        mFontlist.AppendElement(aFamilyName);
    }

    

    

    


    
    

    // memory reporting
    

    

private:
    nsTArray<FontFamilyName>   mFontlist;
    FontFamilyType             mDefaultFontType; // none, serif or sans-serif
};



} // namespace mozilla

#endif /* GFX_FONT_FAMILY_LIST_H */
# 334 "../../dist/include/gfxFontFamilyList.h"
# 13 "../../dist/include/nsFont.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "gfxFontFeatures.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxFontFeatures.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_FONT_FEATURES_H
struct gfxFontFeature {
    uint32_t mTag; // see http://www.microsoft.com/typography/otspec/featuretags.htm
    uint32_t mValue; // 0 = off, 1 = on, larger values may be used as parameters
                     // to features that select among multiple alternatives
};





struct gfxAlternateValue {
    uint32_t           alternate;  // constants in gfxFontConstants.h
    nsString           value;      // string value to be looked up
};





class gfxFontFeatureValueSet MOZ_FINAL {
public:
    NS_INLINE_DECL_REFCOUNTING(gfxFontFeatureValueSet)

    ;

    struct ValueList {
        
        nsString             name;
        nsTArray<uint32_t>   featureSelectors;
    };

    struct FeatureValues {
        uint32_t             alternate;
        nsTArray<ValueList>  valuelist;
    };

    // returns true if found, false otherwise
    ;
    ;

private:
    // Private destructor, to discourage deletion outside of Release():
    ~gfxFontFeatureValueSet() {}

    struct FeatureValueHashKey {
        nsString mFamily;
        uint32_t mPropVal;
        nsString mName;

        
        
        
    };

    class FeatureValueHashEntry : public PLDHashEntryHdr {
    public:
        typedef const FeatureValueHashKey &KeyType;
        typedef const FeatureValueHashKey *KeyTypePointer;

        
        
        

        ;
        
        ;
        enum { ALLOW_MEMMOVE = true };

        FeatureValueHashKey mKey;
        nsTArray<uint32_t>  mValues;
    };

    nsTHashtable<FeatureValueHashEntry> mFontFeatureValues;
  };

#endif
# 127 "../../dist/include/gfxFontFeatures.h"
// NOTE: 0, 1 are reserved for the special IDs of the default variable
// and fixed fonts in the presentation context, see nsPresContext.h
const uint8_t kGenericFont_NONE         = 0x00;
// Special
const uint8_t kGenericFont_moz_variable = 0x00; // for the default variable width font
const uint8_t kGenericFont_moz_fixed    = 0x01; // our special "use the user's fixed font"
// CSS
const uint8_t kGenericFont_serif        = 0x02;
const uint8_t kGenericFont_sans_serif   = 0x04;
const uint8_t kGenericFont_monospace    = 0x08;
const uint8_t kGenericFont_cursive      = 0x10;
const uint8_t kGenericFont_fantasy      = 0x20;

// Font structure.
struct NS_GFX nsFont {

  // list of font families, either named or generic
  mozilla::FontFamilyList fontlist;

  // The style of font (normal, italic, oblique; see gfxFontConstants.h)
  uint8_t style;

  // Force this font to not be considered a 'generic' font, even if
  // the name is the same as a CSS generic font family.
  bool systemFont;

  // Variant subproperties
  uint8_t variantCaps;
  uint8_t variantNumeric;
  uint8_t variantPosition;

  nscoord size;

  // The aspect-value (ie., the ratio actualsize:actualxheight) that any
  // actual physical font created from this font structure must have when
   ;
  // Compare ignoring differences in 'variant' and 'decoration'
  ;

  ;

  ;

  // Add featureSettings into style
  ;

protected:
  ; // helper method for initialization
};

#define NS_FONT_VARIANT_NORMAL            0
#define NS_FONT_VARIANT_SMALL_CAPS        1

#define NS_FONT_DECORATION_NONE           0x0
#define NS_FONT_DECORATION_UNDERLINE      0x1
#define NS_FONT_DECORATION_OVERLINE       0x2
#define NS_FONT_DECORATION_LINE_THROUGH   0x4

#endif /* nsFont_h___ */
# 157 "../../dist/include/nsFont.h"
# 19 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "gfxFontConstants.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxFontConstants.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* font constants shared by both thebes and layout */

#ifndef GFX_FONT_CONSTANTS_H
#define GFX_FONT_CONSTANTS_H

/*
 * This file is separate from gfxFont.h so that layout can include it
 * without bringing in gfxFont.h and everything it includes.
 */

#define NS_FONT_STYLE_NORMAL            0
#define NS_FONT_STYLE_ITALIC            1
#define NS_FONT_STYLE_OBLIQUE           2

#define NS_FONT_WEIGHT_NORMAL           400
#define NS_FONT_WEIGHT_BOLD             700

#define NS_FONT_STRETCH_ULTRA_CONDENSED (-4)
#define NS_FONT_STRETCH_EXTRA_CONDENSED (-3)
#define NS_FONT_STRETCH_CONDENSED       (-2)
#define NS_FONT_STRETCH_SEMI_CONDENSED  (-1)
#define NS_FONT_STRETCH_NORMAL          0

#endif
# 213 "../../dist/include/gfxFontConstants.h"
# 20 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIAtom.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsPresContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIObserver.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIObserver.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIObserver.idl
 */

#ifndef __gen_nsIObserver_h__
#define __gen_nsIObserver_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIObserver.h"
#endif
# 12 "../../dist/include/nsIObserver.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIObserver.h"

/* starting interface:    nsIObserver */
#define NS_IOBSERVER_IID_STR "db242e01-e4d9-11d2-9dde-000064657374"

#define NS_IOBSERVER_IID \
  {0xdb242e01, 0xe4d9, 0x11d2, \
    { 0x9d, 0xde, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 }}

class NS_NO_VTABLE nsIObserver : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOBSERVER_IID)

  /* void observe (in nsISupports aSubject, in string aTopic, in wstring aData); */
  NS_IMETHOD Observe(nsISupports *aSubject, const char * aTopic, const char16_t * aData) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIObserver, NS_IOBSERVER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIOBSERVER \
  NS_IMETHOD Observe(nsISupports *aSubject, const char * aTopic, const char16_t * aData) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIOBSERVER(_to) \
  NS_IMETHOD Observe(nsISupports *aSubject, const char * aTopic, const char16_t * aData) MOZ_OVERRIDE { return _to Observe(aSubject, aTopic, aData); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIOBSERVER(_to) \
  NS_IMETHOD Observe(nsISupports *aSubject, const char * aTopic, const char16_t * aData) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Observe(aSubject, aTopic, aData); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsObserver : public nsIObserver
{
#endif
# 17 "../../dist/include/nsITimer.h"
class nsIObserver; /* forward declaration */

class nsIEventTarget; /* forward declaration */

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsITimer.h"
/**
 * The signature of the timer callback function passed to initWithFuncCallback.
 * This is the function that will get called when the timer expires if the
 * timer is initialized via initWithFuncCallback.
 *
 * @param aTimer the timer which has expired
 * @param aClosure opaque parameter passed to initWithFuncCallback
 */
class nsITimer;
typedef void (*nsTimerCallbackFunc) (nsITimer *aTimer, void *aClosure);
class nsITimer; /* forward declaration */


/* starting interface:    nsITimerCallback */
#define NS_ITIMERCALLBACK_IID_STR "a796816d-7d47-4348-9ab8-c7aeb3216a7d"

#define NS_ITIMERCALLBACK_IID \
  {0xa796816d, 0x7d47, 0x4348, \
    { 0x9a, 0xb8, 0xc7, 0xae, 0xb3, 0x21, 0x6a, 0x7d }}

class NS_NO_VTABLE nsITimerCallback : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITIMERCALLBACK_IID)

  /* void notify (in nsITimer timer); */
  NS_IMETHOD Notify(nsITimer *timer) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsITimerCallback, NS_ITIMERCALLBACK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITIMERCALLBACK \
  NS_IMETHOD Notify(nsITimer *timer) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSITIMERCALLBACK(_to) \
  NS_IMETHOD Notify(nsITimer *timer) MOZ_OVERRIDE { return _to Notify(timer); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSITIMERCALLBACK(_to) \
  NS_IMETHOD Notify(nsITimer *timer) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Notify(timer); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsTimerCallback : public nsITimerCallback
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSITIMERCALLBACK


nsTimerCallback::~nsTimerCallback()
{
  /* destructor code */
}

/* void notify (in nsITimer timer); */
NS_IMETHODIMP nsTimerCallback::Notify(nsITimer *timer)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 106 "../../dist/include/nsITimer.h"

// Two timer deadlines must differ by less than half the PRIntervalTime domain.
#define DELAY_INTERVAL_LIMIT    PR_BIT(8 * sizeof(PRIntervalTime) - 1)

/* starting interface:    nsITimer */
#define NS_ITIMER_IID_STR "193fc37a-8aa4-4d29-aa57-1acd87c26b66"

#define NS_ITIMER_IID \
  {0x193fc37a, 0x8aa4, 0x4d29, \
    { 0xaa, 0x57, 0x1a, 0xcd, 0x87, 0xc2, 0x6b, 0x66 }}

class nsITimer : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITIMER_IID)

  enum {
    TYPE_ONE_SHOT = 0,
    TYPE_REPEATING_SLACK = 1,
    TYPE_REPEATING_PRECISE = 2,
    TYPE_REPEATING_PRECISE_CAN_SKIP = 3
  };

  /* void init (in nsIObserver aObserver, in unsigned long aDelay, in unsigned long aType); */
  NS_IMETHOD Init(nsIObserver *aObserver, uint32_t aDelay, uint32_t aType) = 0;

  /* [noscript] void initWithFuncCallback (in nsTimerCallbackFunc aCallback, in voidPtr aClosure, in unsigned long aDelay, in unsigned long aType); */
  NS_IMETHOD InitWithFuncCallback(nsTimerCallbackFunc aCallback, void *aClosure, uint32_t aDelay, uint32_t aType) = 0;

  /* void initWithCallback (in nsITimerCallback aCallback, in unsigned long aDelay, in unsigned long aType); */
  NS_IMETHOD InitWithCallback(nsITimerCallback *aCallback, uint32_t aDelay, uint32_t aType) = 0;

  /* void cancel (); */
  /* attribute nsIEventTarget target; */
  NS_IMETHOD GetTarget(nsIEventTarget * *aTarget) = 0;
  NS_IMETHOD SetTarget(nsIEventTarget *aTarget) = 0;

   ;
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsITimer, NS_ITIMER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITIMER \
  NS_IMETHOD Init(nsIObserver *aObserver, uint32_t aDelay, uint32_t aType) MOZ_OVERRIDE; \
  NS_IMETHOD InitWithFuncCallback(nsTimerCallbackFunc aCallback, void *aClosure, uint32_t aDelay, uint32_t aType) MOZ_OVERRIDE; \
  NS_IMETHOD InitWithCallback(nsITimerCallback *aCallback, uint32_t aDelay, uint32_t aType) MOZ_OVERRIDE; \
  NS_IMETHOD Cancel(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetDelay(uint32_t *aDelay) MOZ_OVERRIDE; \
  NS_IMETHOD SetType(uint32_t aType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetType(aType); } \
  NS_IMETHOD GetClosure(void **aClosure) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetClosure(aClosure); } \
  NS_IMETHOD GetCallback(nsITimerCallback * *aCallback) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCallback(aCallback); } \
  NS_IMETHOD GetTarget(nsIEventTarget * *aTarget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTarget(aTarget); } \
  NS_IMETHOD SetTarget(nsIEventTarget *aTarget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetTarget(aTarget); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsTimer : public nsITimer
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSITIMER
NS_IMETHODIMP nsTimer::SetType(uint32_t aType)
/* attribute nsIEventTarget target; */
NS_IMETHODIMP nsTimer::GetTarget(nsIEventTarget * *aTarget)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsTimer::SetTarget(nsIEventTarget *aTarget)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 309 "../../dist/include/nsITimer.h"

#define NS_TIMER_CONTRACTID "@mozilla.org/timer;1"
#define NS_TIMER_CALLBACK_TOPIC "timer-callback"

#endif /* __gen_nsITimer_h__ */
# 314 "../../dist/include/nsITimer.h"
# 23 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCRT.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCRT.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsCRT_h___
#define nsCRT_h___

#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/nsCRT.h"
#if 0 /* expanded by -frewrite-includes */
#include <ctype.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsCRT.h"
#if 0 /* expanded by -frewrite-includes */
#include "plstr.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plstr.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _plstr_h
#define _plstr_h

/*
 * plstr.h
 *
 * This header file exports the API to the NSPR portable library or string-
 * handling functions.  
 * 
 * This API was not designed as an "optimal" or "ideal" string library; it 
 * was based on the good ol' unix string.3 functions, and was written to
 *
 *  1) replace the libc functions, for cross-platform consistency, 
 *  2) complete the API on platforms lacking common functions (e.g., 
 *     strcase*), and
 *  3) to implement some obvious "closure" functions that I've seen
 *     people hacking around in our code.
 *
 * Point number three largely means that most functions have an "strn"
 * limited-length version, and all comparison routines have a non-case-
 * sensitive version available.
 */

#if 0 /* expanded by -frewrite-includes */
#include "prtypes.h"
#endif /* expanded by -frewrite-includes */
# 30 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plstr.h"

PR_BEGIN_EXTERN_C
/*
 * PL_strlen
 *
 * Any and all i18n/l10n stuff.
 */

PR_END_EXTERN_C

#endif /* _plstr_h */
# 438 "/Users/luser/build/iphone-device-debug/dist/include/nspr/plstr.h"
# 11 "../../dist/include/nsCRT.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsCRT.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCRTGlue.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsCRT.h"
// This macro can be used in a class declaration for classes that want
// to ensure that their instance memory is zeroed.
#define NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW   \
  void* operator new(size_t sz) CPP_THROW_NEW { \
    void* rv = ::operator new(sz);              \
    if (rv) {                                   \
      memset(rv, 0, sz);                        \
    }                                           \
    return rv;                                  \
  }                                             \
  void operator delete(void* ptr) {             \
    ::operator delete(ptr);                     \
  }

// This macro works with the next macro to declare a non-inlined
// version of the above.
// Freeing helper
#define CRTFREEIF(x) if (x) { nsCRT::free(x); x = 0; }

/// This is a wrapper class around all the C runtime functions.

class nsCRT
{
public:
  enum
  {
    LF = '\n'   /* Line Feed */,
    VTAB = '\v' /* Vertical Tab */,
    CR = '\r'   /* Carriage Return */
  };

  /// String comparison.
  

  
  

  
  
  
  
  
  
  
};




#define NS_IS_CNTRL(i)   ((((unsigned int) (i)) > 0x7f) ? (int) 0 : iscntrl(i))
#define NS_IS_DIGIT(i)   ((((unsigned int) (i)) > 0x7f) ? (int) 0 : isdigit(i))
#if defined(XP_WIN)
#define NS_IS_ALPHA(VAL) (isascii((int)(VAL)) && isalpha((int)(VAL)))
#else
# 181 "../../dist/include/nsCRT.h"
#define NS_IS_ALPHA(VAL) ((((unsigned int) (VAL)) > 0x7f) ? (int) 0 : isalpha((int)(VAL)))
#endif
# 183 "../../dist/include/nsCRT.h"


#endif /* nsCRT_h___ */
# 186 "../../dist/include/nsCRT.h"
# 24 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "FramePropertyTable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/FramePropertyTable.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef FRAMEPROPERTYTABLE_H_
#define FRAMEPROPERTYTABLE_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/FramePropertyTable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/FramePropertyTable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTHashtable.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/FramePropertyTable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/FramePropertyTable.h"

class nsIFrame;

namespace mozilla {

struct FramePropertyDescriptor;

typedef void (*FramePropertyDestructor)(void* aPropertyValue);
typedef void (*FramePropertyDestructorWithFrame)(nsIFrame* aFrame,
                                                 void* aPropertyValue);

/**
 * A pointer to a FramePropertyDescriptor serves as a unique property ID.
 * The FramePropertyDescriptor stores metadata about the property.
 * Currently the only metadata is a destructor function. The destructor
 * function is called on property values when they are overwritten or
 * deleted.
 * 
 * To use this class, declare a global (i.e., file, class or function-scope
 * static member) FramePropertyDescriptor and pass its address as
 * aProperty in the FramePropertyTable methods.
 */
struct FramePropertyDescriptor {
  /**
   * mDestructor will be called if it's non-null.
   */
  FramePropertyDestructor          mDestructor;
  /**
   * mDestructorWithFrame will be called if it's non-null and mDestructor
   * is null. WARNING: The frame passed to mDestructorWithFrame may
   * be a dangling frame pointer, if this is being called during
   * presshell teardown. Do not use it except to compare against
   * other frame pointers. No frame will have been allocated with
   * the same address yet.
   */
  FramePropertyDestructorWithFrame mDestructorWithFrame;
  /**
   * mDestructor and mDestructorWithFrame may both be null, in which case
   * no value destruction is a no-op.
   */
};

/**
 * The FramePropertyTable is optimized for storing 0 or 1 properties on
 * a given frame. Storing very large numbers of properties on a single
 * frame will not be efficient.
 * 
 * Property values are passed as void* but do not actually have to be
 * valid pointers. You can use NS_INT32_TO_PTR/NS_PTR_TO_INT32 to
 * store int32_t values. Null/zero values can be stored and retrieved.
 * Of course, the destructor function (if any) must handle such values
 * correctly.
 */
class FramePropertyTable {
public:
  
  

  /**
   * Set a property value on a frame. This requires one hashtable
   * lookup (using the frame as the key) and a linear search through
   * the properties of that frame. Any existing value for the property
   * is destroyed.
   */
  void Set(nsIFrame* aFrame, const FramePropertyDescriptor* aProperty,
           void* aValue);
  /**
   * Get a property value for a frame. This requires one hashtable
   * lookup (using the frame as the key) and a linear search through
   * the properties of that frame. If the frame has no such property,
   * returns null.
   * @param aFoundResult if non-null, receives a value 'true' iff
   * the frame has a value for the property. This lets callers
   * disambiguate a null result, which can mean 'no such property' or
   * 'property value is null'.
   */
  void* Get(const nsIFrame* aFrame, const FramePropertyDescriptor* aProperty,
            bool* aFoundResult = nullptr);
  /**
   * Remove a property value for a frame. This requires one hashtable
   * lookup (using the frame as the key) and a linear search through
   * the properties of that frame. The old property value is returned
   * (and not destroyed). If the frame has no such property,
   * returns null.
   * @param aFoundResult if non-null, receives a value 'true' iff
  ;
  /**
   * Remove and destroy all property values for all frames.
   */
  ;

  ;

protected:
  /**
   * Stores a property descriptor/value pair. It can also be used to
   * store an nsTArray of PropertyValues.
   */
  struct PropertyValue {
    
    

    bool IsArray() { return !mProperty && mValue; }
    nsTArray<PropertyValue>* ToArray()
    {
      NS_ASSERTION(IsArray(), "Must be array");
      return reinterpret_cast<nsTArray<PropertyValue>*>(&mValue);
    }

    

    

    const FramePropertyDescriptor* mProperty;
    void* mValue;
  };

  /**
   * Used with an array of PropertyValues to allow lookups that compare
   * only on the FramePropertyDescriptor.
   */
  class PropertyComparator {
  public:
    
    
    
  };

  /**
   * Our hashtable entry. The key is an nsIFrame*, the value is a
   * PropertyValue representing one or more property/value pairs.
   */
  class Entry : public nsPtrHashKey<nsIFrame>
  {
  public:
    
    

    

    PropertyValue mProp;
  };

  ;
  ;

  nsTHashtable<Entry> mEntries;
  nsIFrame* mLastFrame;
  Entry* mLastEntry;
};

/**
 * This class encapsulates the properties of a frame.
 */
class FrameProperties {
public:
  
  FrameProperties(FramePropertyTable* aTable, const nsIFrame* aFrame)
    : mTable(aTable), mFrame(const_cast<nsIFrame*>(aFrame)) {}

  void Set(const FramePropertyDescriptor* aProperty, void* aValue) const
  {
    mTable->Set(mFrame, aProperty, aValue);
  }
  void* Get(const FramePropertyDescriptor* aProperty,
            bool* aFoundResult = nullptr) const
  {
    return mTable->Get(mFrame, aProperty, aFoundResult);
  }
  
  

private:
  FramePropertyTable* mTable;
  nsIFrame* mFrame;
};

}

#endif /* FRAMEPROPERTYTABLE_H_ */
# 251 "../../dist/include/FramePropertyTable.h"
# 29 "../../dist/include/nsPresContext.h"
// This also pulls in gfxTypes.h, which we cannot include directly.
#if 0 /* expanded by -frewrite-includes */
#include "gfxRect.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxRect.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_RECT_H
#define GFX_RECT_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxRect.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/BaseRect.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/gfxRect.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/gfxRect.h"

struct gfxMargin : public mozilla::gfx::BaseMargin<gfxFloat, gfxMargin> {
  typedef mozilla::gfx::BaseMargin<gfxFloat, gfxMargin> Super;

  // Constructors
  
  
  
};

namespace mozilla {
    namespace css {
        enum Corner {
            // this order is important!
            eCornerTopLeft = 0,
            eCornerTopRight = 1,
            eCornerBottomRight = 2,
            eCornerBottomLeft = 3,
            eNumCorners = 4
        };
    }
}
#define NS_CORNER_TOP_LEFT mozilla::css::eCornerTopLeft
#define NS_CORNER_TOP_RIGHT mozilla::css::eCornerTopRight
#define NS_CORNER_BOTTOM_RIGHT mozilla::css::eCornerBottomRight
#define NS_CORNER_BOTTOM_LEFT mozilla::css::eCornerBottomLeft
#define NS_NUM_CORNERS mozilla::css::eNumCorners

#define NS_FOR_CSS_CORNERS(var_)                         \
    for (mozilla::css::Corner var_ = NS_CORNER_TOP_LEFT; \
         var_ <= NS_CORNER_BOTTOM_LEFT;                  \
         var_++)



struct gfxRect :
    public mozilla::gfx::BaseRect<gfxFloat, gfxRect, gfxPoint, gfxSize, gfxMargin> {
    typedef mozilla::gfx::BaseRect<gfxFloat, gfxRect, gfxPoint, gfxSize, gfxMargin> Super;

    gfxRect() : Super() {}
    
    gfxRect(gfxFloat aX, gfxFloat aY, gfxFloat aWidth, gfxFloat aHeight) :
        Super(aX, aY, aWidth, aHeight) {}
    MOZ_IMPLICIT 

    /**
     * Return true if all components of this rect are within
     * aEpsilon of integer coordinates, defined as
     *   |round(coord) - coord| <= |aEpsilon|
     * for x,y,width,height.
     */
    ;

    

    

    

    /* Conditions this border to Cairo's max coordinate space.
     * The caller can check IsEmpty() after Condition() -- if it's TRUE,
     * the caller can possibly avoid doing any extra rendering.
     */
    ;

    void Scale(gfxFloat k) {
        NS_ASSERTION(k >= 0.0, "Invalid (negative) scale factor");
        x *= k;
        y *= k;
        width *= k;
        height *= k;
    }

    

    void ScaleInverse(gfxFloat k) {
        NS_ASSERTION(k > 0.0, "Invalid (negative) scale factor");
        x /= k;
        y /= k;
        width /= k;
        height /= k;
    }
};

#endif /* GFX_RECT_H */
# 143 "../../dist/include/gfxRect.h"
# 35 "../../dist/include/nsPresContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/AppUnits.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/AppUnits.h" 1
/* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_AppUnits_h
#define mozilla_AppUnits_h

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/AppUnits.h"

namespace mozilla {
inline int32_t AppUnitsPerCSSPixel() { return 60; }
inline int32_t AppUnitsPerCSSInch() { return 96 * AppUnitsPerCSSPixel(); }
}
#endif /* _NS_APPUNITS_H_ */
# 16 "../../dist/include/mozilla/AppUnits.h"
# 36 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "prclist.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prclist.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef prclist_h___
#define prclist_h___

#if 0 /* expanded by -frewrite-includes */
#include "prtypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prclist.h"

typedef struct PRCListStr PRCList;

/*
** Circular linked list
*/
struct PRCListStr {
    PRCList	*next;
    PRCList	*prev;
};

/*
** Insert element "_e" into the list, before "_l".
*/
#define PR_INSERT_BEFORE(_e,_l)	 \
    PR_BEGIN_MACRO		 \
	(_e)->next = (_l);	 \
	(_e)->prev = (_l)->prev; \
	(_l)->prev->next = (_e); \
	(_l)->prev = (_e);	 \
    PR_END_MACRO

/*
** Insert element "_e" into the list, after "_l".
*/
#define PR_INSERT_AFTER(_e,_l)	 \
    PR_BEGIN_MACRO		 \
	(_e)->next = (_l)->next; \
	(_e)->prev = (_l);	 \
	(_l)->next->prev = (_e); \
	(_l)->next = (_e);	 \
    PR_END_MACRO

#define PR_INIT_STATIC_CLIST(_l) \
    {(_l), (_l)}

#endif /* prclist_h___ */
# 109 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prclist.h"
# 37 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsThreadUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsThreadUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsThreadUtils_h__
#define nsThreadUtils_h__

#if 0 /* expanded by -frewrite-includes */
#include "prthread.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsThreadUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "prinrval.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsThreadUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "MainThreadUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/MainThreadUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MainThreadUtils_h_
# 23 "../../dist/include/mozilla/threads/nsThreadIDs.h"
# 12 "../../dist/include/MainThreadUtils.h" 2

class nsIThread;

/**
 * Get a reference to the main thread.
 *
 * @param aResult
 *   The resulting nsIThread object.
 */
extern NS_METHOD NS_GetMainThread(nsIThread** aResult);

#ifdef MOZILLA_INTERNAL_API
// Fast access to the current thread.  Do not release the returned pointer!  If
// you want to use this pointer from some other thread, then you will need to
extern bool NS_IsMainThread();
#endif
# 42 "../../dist/include/MainThreadUtils.h"

#endif // MainThreadUtils_h_
# 44 "../../dist/include/MainThreadUtils.h"
# 13 "../../dist/include/nsThreadUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIThreadManager.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIThreadManager.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIThreadManager.idl
 */

#ifndef __gen_nsIThreadManager_h__
class nsIThread; /* forward declaration */


/* starting interface:    nsIThreadManager */
#define NS_ITHREADMANAGER_IID_STR "1be89eca-e2f7-453b-8d38-c11ba247f6f3"

#define NS_ITHREADMANAGER_IID \
  {0x1be89eca, 0xe2f7, 0x453b, \
    { 0x8d, 0x38, 0xc1, 0x1b, 0xa2, 0x47, 0xf6, 0xf3 }}

class NS_NO_VTABLE nsIThreadManager : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITHREADMANAGER_IID)

  enum {
    DEFAULT_STACK_SIZE = 0U
  };

  /* nsIThread newThread (in unsigned long creationFlags, [optional] in unsigned long stackSize); */
  NS_IMETHOD NewThread(uint32_t creationFlags, uint32_t stackSize, nsIThread * *_retval) = 0;

  /* [noscript] nsIThread getThreadFromPRThread (in PRThread prthread); */
  NS_IMETHOD GetThreadFromPRThread(PRThread *prthread, nsIThread * *_retval) = 0;

  /* readonly attribute nsIThread mainThread; */
  NS_IMETHOD GetMainThread(nsIThread * *aMainThread) = 0;

  /* readonly attribute nsIThread currentThread; */
  NS_IMETHOD GetCurrentThread(nsIThread * *aCurrentThread) = 0;

  /* readonly attribute boolean isMainThread; */
  NS_IMETHOD GetIsMainThread(bool *aIsMainThread) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIThreadManager, NS_ITHREADMANAGER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITHREADMANAGER \
  NS_IMETHOD NewThread(uint32_t creationFlags, uint32_t stackSize, nsIThread * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetThreadFromPRThread(PRThread *prthread, nsIThread * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetMainThread(nsIThread * *aMainThread) MOZ_OVERRIDE; \
  NS_IMETHOD GetCurrentThread(nsIThread * *aCurrentThread) MOZ_OVERRIDE; \
  NS_IMETHOD GetIsMainThread(bool *aIsMainThread) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSITHREADMANAGER(_to) \
  NS_IMETHOD NewThread(uint32_t creationFlags, uint32_t stackSize, nsIThread * *_retval) MOZ_OVERRIDE { return _to NewThread(creationFlags, stackSize, _retval); } \
  NS_IMETHOD GetThreadFromPRThread(PRThread *prthread, nsIThread * *_retval) MOZ_OVERRIDE { return _to GetThreadFromPRThread(prthread, _retval); } \
  NS_IMETHOD GetMainThread(nsIThread * *aMainThread) MOZ_OVERRIDE { return _to GetMainThread(aMainThread); } \
  NS_IMETHOD GetCurrentThread(nsIThread * *aCurrentThread) MOZ_OVERRIDE { return _to GetCurrentThread(aCurrentThread); } \
  NS_IMETHOD GetIsMainThread(bool *aIsMainThread) MOZ_OVERRIDE { return _to GetIsMainThread(aIsMainThread); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSITHREADMANAGER(_to) \
  NS_IMETHOD NewThread(uint32_t creationFlags, uint32_t stackSize, nsIThread * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->NewThread(creationFlags, stackSize, _retval); } \
  NS_IMETHOD GetThreadFromPRThread(PRThread *prthread, nsIThread * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetThreadFromPRThread(prthread, _retval); } \
  NS_IMETHOD GetMainThread(nsIThread * *aMainThread) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMainThread(aMainThread); } \
  NS_IMETHOD GetCurrentThread(nsIThread * *aCurrentThread) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentThread(aCurrentThread); } \
  NS_IMETHOD GetIsMainThread(bool *aIsMainThread) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsMainThread(aIsMainThread); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* readonly attribute nsIThread currentThread; */
NS_IMETHODIMP nsThreadManager::GetCurrentThread(nsIThread * *aCurrentThread)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute boolean isMainThread; */
NS_IMETHODIMP nsThreadManager::GetIsMainThread(bool *aIsMainThread)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 143 "../../dist/include/nsIThreadManager.h"

#ifndef __gen_nsIEventTarget_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIEventTarget.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIEventTarget.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIEventTarget.idl
 */

#ifndef __gen_nsIEventTarget_h__
#define __gen_nsIEventTarget_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIEventTarget.h"
#endif
# 12 "../../dist/include/nsIEventTarget.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIEventTarget.h"
class nsIRunnable; /* forward declaration */


/* starting interface:    nsIEventTarget */
#define NS_IEVENTTARGET_IID_STR "4e8febe4-6631-49dc-8ac9-308c1cb9b09c"

#define NS_IEVENTTARGET_IID \
  {0x4e8febe4, 0x6631, 0x49dc, \
    { 0x8a, 0xc9, 0x30, 0x8c, 0x1c, 0xb9, 0xb0, 0x9c }}

class NS_NO_VTABLE nsIEventTarget : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IEVENTTARGET_IID)

  /* void dispatch (in nsIRunnable event, in unsigned long flags); */
  NS_IMETHOD Dispatch(nsIRunnable *event, uint32_t flags) = 0;

  enum {
    DISPATCH_NORMAL = 0U,
    DISPATCH_SYNC = 1U
  };

  /* boolean isOnCurrentThread (); */
  NS_IMETHOD IsOnCurrentThread(bool *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIEventTarget, NS_IEVENTTARGET_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIEVENTTARGET \
  NS_IMETHOD Dispatch(nsIRunnable *event, uint32_t flags) MOZ_OVERRIDE; \
  NS_IMETHOD IsOnCurrentThread(bool *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIEVENTTARGET(_to) \
  NS_IMETHOD Dispatch(nsIRunnable *event, uint32_t flags) MOZ_OVERRIDE { return _to Dispatch(event, flags); } \
  NS_IMETHOD IsOnCurrentThread(bool *_retval) MOZ_OVERRIDE { return _to IsOnCurrentThread(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIEVENTTARGET(_to) \
  NS_IMETHOD Dispatch(nsIRunnable *event, uint32_t flags) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Dispatch(event, flags); } \
  NS_IMETHOD IsOnCurrentThread(bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsOnCurrentThread(_retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsEventTarget : public nsIEventTarget
{
public:
  NS_DECL_ISUPPORTS
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 108 "../../dist/include/nsIEventTarget.h"

// convenient aliases:
#define NS_DISPATCH_NORMAL nsIEventTarget::DISPATCH_NORMAL
#define NS_DISPATCH_SYNC   nsIEventTarget::DISPATCH_SYNC

#endif /* __gen_nsIEventTarget_h__ */
# 114 "../../dist/include/nsIEventTarget.h"
# 11 "../../dist/include/nsIThread.h" 2
#endif
# 12 "../../dist/include/nsIThread.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIThread.h"

/* starting interface:    nsIThread */
#define NS_ITHREAD_IID_STR "9c889946-a73a-4af3-ae9a-ea64f7d4e3ca"

#define NS_ITHREAD_IID \
  {0x9c889946, 0xa73a, 0x4af3, \
    { 0xae, 0x9a, 0xea, 0x64, 0xf7, 0xd4, 0xe3, 0xca }}

class NS_NO_VTABLE nsIThread : public nsIEventTarget {
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIThread, NS_ITHREAD_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITHREAD \
  NS_IMETHOD GetPRThread(PRThread **aPRThread) MOZ_OVERRIDE; \
  NS_IMETHOD Shutdown(void) MOZ_OVERRIDE; \
  NS_IMETHOD HasPendingEvents(bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD ProcessNextEvent(bool mayWait, bool *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSITHREAD(_to) \
  NS_IMETHOD GetPRThread(PRThread **aPRThread) MOZ_OVERRIDE { return _to GetPRThread(aPRThread); } \
  NS_IMETHOD Shutdown(void) MOZ_OVERRIDE { return _to Shutdown(); } \
  NS_IMETHOD HasPendingEvents(bool *_retval) MOZ_OVERRIDE { return _to HasPendingEvents(_retval); } \
  NS_IMETHOD ProcessNextEvent(bool mayWait, bool *_retval) MOZ_OVERRIDE { return _to ProcessNextEvent(mayWait, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSITHREAD(_to) \
  NS_IMETHOD GetPRThread(PRThread **aPRThread) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPRThread(aPRThread); } \
  NS_IMETHOD Shutdown(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Shutdown(); } \
  NS_IMETHOD HasPendingEvents(bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->HasPendingEvents(_retval); } \
  NS_IMETHOD ProcessNextEvent(bool mayWait, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ProcessNextEvent(mayWait, _retval); } 

#if 0
/* [noscript] readonly attribute PRThread PRThread; */
NS_IMETHODIMP nsThread::GetPRThread(PRThread **aPRThread)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

}

/* End of implementation class template. */
#endif
# 125 "../../dist/include/nsIThread.h"


#endif /* __gen_nsIThread_h__ */
# 128 "../../dist/include/nsIThread.h"
# 15 "../../dist/include/nsThreadUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIRunnable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIRunnable.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIRunnable.idl
 */

#ifndef __gen_nsIRunnable_h__
#define __gen_nsIRunnable_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIRunnable.h"
#endif
# 12 "../../dist/include/nsIRunnable.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIRunnable.h"

/* starting interface:    nsIRunnable */
#define NS_IRUNNABLE_IID_STR "4a2abaf0-6886-11d3-9382-00104ba0fd40"

#define NS_IRUNNABLE_IID \
  {0x4a2abaf0, 0x6886, 0x11d3, \
    { 0x93, 0x82, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }}

class NS_NO_VTABLE nsIRunnable : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRUNNABLE_IID)

  /* void run (); */
  NS_IMETHOD Run(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIRunnable, NS_IRUNNABLE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIRUNNABLE \
  NS_IMETHOD Run(void) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIRUNNABLE(_to) \
  NS_IMETHOD Run(void) MOZ_OVERRIDE { return _to Run(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIRUNNABLE(_to) \
  NS_IMETHOD Run(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Run(); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 89 "../../dist/include/nsIRunnable.h"


#endif /* __gen_nsIRunnable_h__ */
# 92 "../../dist/include/nsIRunnable.h"
# 16 "../../dist/include/nsThreadUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsICancelableRunnable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsICancelableRunnable.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsICancelableRunnable.idl
 */

#ifndef __gen_nsICancelableRunnable_h__
#define __gen_nsICancelableRunnable_h__


#ifndef __gen_nsIRunnable_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIRunnable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsICancelableRunnable.h"
#endif
# 12 "../../dist/include/nsICancelableRunnable.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsICancelableRunnable.h"

/* starting interface:    nsICancelableRunnable */
#define NS_ICANCELABLERUNNABLE_IID_STR "de93dc4c-5eea-4eb7-b6d1-dbf1e0cef65c"

#define NS_ICANCELABLERUNNABLE_IID \
  {0xde93dc4c, 0x5eea, 0x4eb7, \
    { 0xb6, 0xd1, 0xdb, 0xf1, 0xe0, 0xce, 0xf6, 0x5c }}

class NS_NO_VTABLE nsICancelableRunnable : public nsIRunnable {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICANCELABLERUNNABLE_IID)

  /* void cancel (); */
  NS_IMETHOD Cancel(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsICancelableRunnable, NS_ICANCELABLERUNNABLE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICANCELABLERUNNABLE \
  NS_IMETHOD Cancel(void) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICANCELABLERUNNABLE(_to) \
  NS_IMETHOD Cancel(void) MOZ_OVERRIDE { return _to Cancel(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICANCELABLERUNNABLE(_to) \
  NS_IMETHOD Cancel(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Cancel(); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsCancelableRunnable : public nsICancelableRunnable

/* End of implementation class template. */
#endif
# 89 "../../dist/include/nsICancelableRunnable.h"


#endif /* __gen_nsICancelableRunnable_h__ */
# 92 "../../dist/include/nsICancelableRunnable.h"
# 17 "../../dist/include/nsThreadUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsThreadUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsThreadUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsThreadUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Likely.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsThreadUtils.h"

//-----------------------------------------------------------------------------
// These methods are alternatives to the methods on nsIThreadManager, provided
// for convenience.

/**
 * Set name of the target thread.  This operation is asynchronous.
/**
 * Create a new thread, and optionally provide an initial event for the thread.
/**
 * Dispatch the given event to the main thread.
 *
 * @param aEvent
 *   The event to dispatch.
 * @param aDispatchFlags
 *   The flags to pass to the main thread's dispatch method.
 *
 * @returns NS_ERROR_INVALID_ARG
 *   If event is null.
 */
extern NS_METHOD
NS_DispatchToMainThread(nsIRunnable* aEvent,
                        uint32_t aDispatchFlags = NS_DISPATCH_NORMAL);

#ifndef XPCOM_GLUE_AVOID_NSPR
/**
 * Process all pending events for the given thread before returning.  This
 * method simply calls ProcessNextEvent on the thread while HasPendingEvents
 * continues to return true and the time spent in NS_ProcessPendingEvents
 * does not exceed the given timeout value.
 *
 * @param aThread
 *   The thread object for which to process pending events.  If null, then
 *   events will be processed for the current thread.
 * @param aTimeout
 *   The maximum number of milliseconds to spend processing pending events.
 *   Events are not pre-empted to honor this timeout.  Rather, the timeout
 *   value is simply used to determine whether or not to process another event.
 *   Pass PR_INTERVAL_NO_TIMEOUT to specify no timeout.
 */
extern NS_METHOD
NS_ProcessPendingEvents(nsIThread* aThread,
                        PRIntervalTime aTimeout = PR_INTERVAL_NO_TIMEOUT);
#endif
# 143 "../../dist/include/nsThreadUtils.h"

/**
 * Shortcut for nsIThread::HasPendingEvents.
 *
 * It is an error to call this function when the given thread is not the
 * current thread.  This function will return false if called from some
 * other thread.
 *
 * @param aThread
 *   The current thread or null.
 * @param aMayWait
 *   A boolean parameter that if "true" indicates that the method may block
 *   the calling thread to wait for a pending event.
 *
 * @returns
 *   A boolean value that if "true" indicates that an event from the current
 *   thread's event queue was processed.
 */
extern bool NS_ProcessNextEvent(nsIThread* aThread = nullptr,
                                bool aMayWait = true);

//-----------------------------------------------------------------------------
// Helpers that work with nsCOMPtr:





//-----------------------------------------------------------------------------

#ifdef MOZILLA_INTERNAL_API
// Fast access to the current thread.  Do not release the returned pointer!  If
// you want to use this pointer from some other thread, then you will need to
// AddRef it.  Otherwise, you should only consider this pointer valid from code
// running on the current thread.
extern nsIThread* NS_GetCurrentThread();
#endif
# 208 "../../dist/include/nsThreadUtils.h"

//-----------------------------------------------------------------------------

#ifndef XPCOM_GLUE_AVOID_NSPR

// This class is designed to be subclassed.
class nsRunnable : public nsIRunnable
{
public:
  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSIRUNNABLE

  nsRunnable() {}

protected:
  virtual ~nsRunnable() {}
};

// This class is designed to be subclassed.
class nsCancelableRunnable : public nsICancelableRunnable
{
public:
  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSIRUNNABLE
  NS_DECL_NSICANCELABLERUNNABLE

  

protected:
  
};

// An event that can be used to call a method on a class.  The class type must
// support reference counting. This event supports Revoke for use
// with nsRevocableEventPtr.
template<class ClassType,
         typename ReturnType = void,
         bool Owning = true>
class nsRunnableMethod : public nsRunnable
{
public:
  ;

  // These ReturnTypeEnforcer classes set up a blacklist for return types that
  // we know are not safe. The default ReturnTypeEnforcer compiles just fine but
  // already_AddRefed will not.
  template<typename OtherReturnType>
  class ReturnTypeEnforcer
  {
  public:
    typedef int ReturnTypeIsSafe;
  };

  template<class T>
  class ReturnTypeEnforcer<already_AddRefed<T>>
  {
    // No ReturnTypeIsSafe makes this illegal!
  };

  // Make sure this return type is safe.
  typedef typename ReturnTypeEnforcer<ReturnType>::ReturnTypeIsSafe check;
};

template<class ClassType, bool Owning>
struct nsRunnableMethodReceiver
{
  nsRefPtr<ClassType> mObj;
  
  
  
  
};

template<class ClassType>
struct nsRunnableMethodReceiver<ClassType, false>
{
  ClassType* MOZ_NON_OWNING_REF mObj;
  
  
  
};

template<typename Method, bool Owning> struct nsRunnableMethodTraits;

template<class C, typename R, bool Owning, typename... As>
struct nsRunnableMethodTraits<R(C::*)(As...), Owning>
{
  typedef C class_type;
  typedef R return_type;
  typedef nsRunnableMethod<C, R, Owning> base_type;
};

#ifdef NS_HAVE_STDCALL
template<class C, typename R, bool Owning, typename... As>
struct nsRunnableMethodTraits<R(__stdcall C::*)(As...), Owning>
{
  typedef C class_type;
  typedef R return_type;
  typedef nsRunnableMethod<C, R, Owning> base_type;
};

template<class C, typename R, bool Owning>
struct nsRunnableMethodTraits<R(NS_STDCALL C::*)(), Owning>
{
  typedef C class_type;
  typedef R return_type;
  typedef nsRunnableMethod<C, R, Owning> base_type;
};
#endif
# 317 "../../dist/include/nsThreadUtils.h"


// IsParameterStorageClass<T>::value is true if T is a parameter-storage class
// that will be recognized by NS_New[NonOwning]RunnableMethodWithArg[s] to
// force a specific storage&passing strategy (instead of inferring one,
// see ParameterStorage).
// When creating a new storage class, add a specialization for it to be
// recognized.
template<typename T>
struct IsParameterStorageClass : public mozilla::FalseType {};

// StoreXPassByY structs used to inform nsRunnableMethodArguments how to
// store arguments, and how to pass them to the target method.

template<typename T>
struct StoreCopyPassByValue
{
  typedef T stored_type;
  typedef T passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StoreCopyPassByValue<S>>
  : public mozilla::TrueType {};

template<typename T>
struct StoreCopyPassByConstLRef
{
  typedef T stored_type;
  typedef const T& passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StoreCopyPassByConstLRef<S>>
  : public mozilla::TrueType {};

template<typename T>
struct StoreCopyPassByLRef
{
  typedef T stored_type;
  typedef T& passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StoreCopyPassByLRef<S>>
  : public mozilla::TrueType {};

template<typename T>
struct StoreCopyPassByRRef
{
  typedef T stored_type;
  typedef T&& passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StoreCopyPassByRRef<S>>
  : public mozilla::TrueType {};

template<typename T>
struct StoreRefPassByLRef
{
  typedef T& stored_type;
  typedef T& passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StoreRefPassByLRef<S>>
  : public mozilla::TrueType {};

template<typename T>
struct StoreConstRefPassByConstLRef
{
  typedef const T& stored_type;
  typedef const T& passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StoreConstRefPassByConstLRef<S>>
  : public mozilla::TrueType {};

template<typename T>
struct StorensRefPtrPassByPtr
{
  typedef nsRefPtr<T> stored_type;
  typedef T* passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StorensRefPtrPassByPtr<S>>
  : public mozilla::TrueType {};

template<typename T>
struct StorePtrPassByPtr
{
  typedef T* stored_type;
  typedef T* passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StorePtrPassByPtr<S>>
  : public mozilla::TrueType {};

template<typename T>
struct StoreConstPtrPassByConstPtr
{
  typedef const T* stored_type;
  typedef const T* passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StoreConstPtrPassByConstPtr<S>>
  : public mozilla::TrueType {};

template<typename T>
struct StoreCopyPassByConstPtr
{
  typedef T stored_type;
  typedef const T* passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StoreCopyPassByConstPtr<S>>
  : public mozilla::TrueType {};

template<typename T>
struct StoreCopyPassByPtr
{
  typedef T stored_type;
  typedef T* passed_type;
  stored_type m;
  
  
};
template<typename S>
struct IsParameterStorageClass<StoreCopyPassByPtr<S>>
  : public mozilla::TrueType {};

namespace detail {

template<typename TWithoutPointer>
struct NonnsISupportsPointerStorageClass
  : mozilla::Conditional<mozilla::IsConst<TWithoutPointer>::value,
                         StoreConstPtrPassByConstPtr<
                           typename mozilla::RemoveConst<TWithoutPointer>::Type>,
                         StorePtrPassByPtr<TWithoutPointer>>
{};

template<typename TWithoutPointer>
struct PointerStorageClass
  : mozilla::Conditional<mozilla::IsBaseOf<nsISupports, TWithoutPointer>::value,
                         StorensRefPtrPassByPtr<TWithoutPointer>,
                         typename NonnsISupportsPointerStorageClass<
                           TWithoutPointer
                         >::Type>
{};

template<typename TWithoutRef>
struct LValueReferenceStorageClass
  : mozilla::Conditional<mozilla::IsConst<TWithoutRef>::value,
                         StoreConstRefPassByConstLRef<
                           typename mozilla::RemoveConst<TWithoutRef>::Type>,
                         StoreRefPassByLRef<TWithoutRef>>
{};

template<typename T>
struct NonLValueReferenceStorageClass
  : mozilla::Conditional<mozilla::IsRvalueReference<T>::value,
                         StoreCopyPassByRRef<
                           typename mozilla::RemoveReference<T>::Type>,
                         StoreCopyPassByValue<T>>
{};

template<typename T>
struct NonPointerStorageClass
  : mozilla::Conditional<mozilla::IsLvalueReference<T>::value,
                         typename LValueReferenceStorageClass<
                           typename mozilla::RemoveReference<T>::Type
                         >::Type,
                         typename NonLValueReferenceStorageClass<T>::Type>
{};

template<typename T>
struct NonParameterStorageClass
  : mozilla::Conditional<mozilla::IsPointer<T>::value,
                         typename PointerStorageClass<
                           typename mozilla::RemovePointer<T>::Type
                         >::Type,
                         typename NonPointerStorageClass<T>::Type>
{};

// Choose storage&passing strategy based on preferred storage type:
// - If IsParameterStorageClass<T>::value is true, use as-is.
// - nsISupports* -> StorensRefPtrPassByPtr<T>   : Store nsRefPtr<T>, pass T*
// - const T*  -> StoreConstPtrPassByConstPtr<T> : Store const T*, pass const T*
// - T*        -> StorePtrPassByPtr<T>           : Store T*, pass T*.
// - const T&  -> StoreConstRefPassByConstLRef<T>: Store const T&, pass const T&.
// - T&        -> StoreRefPassByLRef<T>          : Store T&, pass T&.
// - T&&       -> StoreCopyPassByRRef<T>         : Store T, pass Move(T).
// - Other T   -> StoreCopyPassByValue<T>        : Store T, pass T.
// Other available explicit options:
// -              StoreCopyPassByConstLRef<T>    : Store T, pass const T&.
// -              StoreCopyPassByLRef<T>         : Store T, pass T& (of copy!)
// -              StoreCopyPassByConstPtr<T>     : Store T, pass const T*
// -              StoreCopyPassByPtr<T>          : Store T, pass T* (of copy!)
// Or create your own class with PassAsParameter() method, optional
// clean-up in destructor, and with associated IsParameterStorageClass<>.
template<typename T>
struct ParameterStorage
  : mozilla::Conditional<IsParameterStorageClass<T>::value,
                         T,
                         typename NonParameterStorageClass<T>::Type>
{};

} /* namespace detail */

// struct used to store arguments and later apply them to a method.
template <typename... Ts> struct nsRunnableMethodArguments;

// Specializations for 0-4 arguments, add more as required.
// TODO Use tuple instead; And/or use lambdas.
template <>
struct nsRunnableMethodArguments<>
{
  
};
template <typename T0>
struct nsRunnableMethodArguments<T0>
{
  typename ::detail::ParameterStorage<T0>::Type m0;
  
  
};
template <typename T0, typename T1>
struct nsRunnableMethodArguments<T0, T1>
{
  typename ::detail::ParameterStorage<T0>::Type m0;
  typename ::detail::ParameterStorage<T1>::Type m1;
  
  
};
template <typename T0, typename T1, typename T2>
struct nsRunnableMethodArguments<T0, T1, T2>
{
  typename ::detail::ParameterStorage<T0>::Type m0;
  typename ::detail::ParameterStorage<T1>::Type m1;
  typename ::detail::ParameterStorage<T2>::Type m2;
  
  
};
template <typename T0, typename T1, typename T2, typename T3>
struct nsRunnableMethodArguments<T0, T1, T2, T3>
{
  typename ::detail::ParameterStorage<T0>::Type m0;
  typename ::detail::ParameterStorage<T1>::Type m1;
  typename ::detail::ParameterStorage<T2>::Type m2;
  typename ::detail::ParameterStorage<T3>::Type m3;
  
  
};

template<typename Method, bool Owning, typename... Storages>
class nsRunnableMethodImpl
  : public nsRunnableMethodTraits<Method, Owning>::base_type
{
  typedef typename nsRunnableMethodTraits<Method, Owning>::class_type
      ClassType;
  nsRunnableMethodReceiver<ClassType, Owning> mReceiver;
  Method mMethod;
  nsRunnableMethodArguments<Storages...> mArgs;
public:
  ;
  
  NS_IMETHOD Run()
  {
    if (MOZ_LIKELY(mReceiver.Get())) {
      mArgs.apply(mReceiver.Get(), mMethod);
    }
    return NS_OK;
  }
  
};

// Use this template function like so:
//
//   nsCOMPtr<nsIRunnable> event =
//     NS_NewRunnableMethod(myObject, &MyClass::HandleEvent);
//   NS_DispatchToCurrentThread(event);
//
// Statically enforced constraints:
//  - myObject must be of (or implicitly convertible to) type MyClass




#endif  // XPCOM_GLUE_AVOID_NSPR
# 734 "../../dist/include/nsThreadUtils.h"

// This class is designed to be used when you have an event class E that has a
// pointer back to resource class R.  If R goes away while E is still pending,
// then it is important to "revoke" E so that it does not try use R after R has
// been destroyed.  nsRevocableEventPtr makes it easy for R to manage such
// situations:
//
//   class R;
//
//   class E : public nsRunnable {
//     mResource->EventHandled();
//     return NS_OK;
//   }
//
template<class T>
class nsRevocableEventPtr
{
public:
  
  

  

  

  
  
  

private:
  // Not implemented
  ;
  ;

  nsRefPtr<T> mEvent;
};

/**
 * A simple helper to suffix thread pool name
 * with incremental numbers.
 */
class nsThreadPoolNaming
{
public:
  nsThreadPoolNaming() : mCounter(0) {}

  /**
   * Creates and sets next thread name as "<aPoolName> #<n>"
   * on the specified thread.  If no thread is specified (aThread
   * is null) then the name is synchronously set on the current thread.
   */
  void SetThreadPoolName(const nsACString& aPoolName,
                         nsIThread* aThread = nullptr);

private:
  volatile uint32_t mCounter;

  nsThreadPoolNaming(const nsThreadPoolNaming&) = delete;
  bool lowIOPrioritySet;
#if defined(XP_MACOSX)
  int oldPriority;
#endif
# 857 "../../dist/include/nsThreadUtils.h"
};

void
NS_SetMainThread();

/**
 * Helpers for thread to report their status when compiled with Nuwa.
 */
#ifdef MOZILLA_INTERNAL_API
#ifdef MOZ_NUWA_PROCESS
extern void
NS_SetIgnoreStatusOfCurrentThread();
#else // MOZ_NUWA_PROCESS
# 870 "../../dist/include/nsThreadUtils.h"
inline void
NS_SetIgnoreStatusOfCurrentThread()
{
}
#endif // MOZ_NUWA_PROCESS
# 875 "../../dist/include/nsThreadUtils.h"
#endif // MOZILLA_INTERNAL_API
# 876 "../../dist/include/nsThreadUtils.h"

#endif  // nsThreadUtils_h__
# 878 "../../dist/include/nsThreadUtils.h"
# 38 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "ScrollbarStyles.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/ScrollbarStyles.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef ScrollbarStyles_h
#define ScrollbarStyles_h

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/ScrollbarStyles.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleConsts.h" // for NS_STYLE_SCROLL_SNAP_*
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleConsts.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* constants used in the style struct data provided by nsStyleContext */

#ifndef nsStyleConsts_h___
#define nsStyleConsts_h___

#if 0 /* expanded by -frewrite-includes */
#include "gfxRect.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsStyleConsts.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsFont.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsStyleConsts.h"

// XXX fold this into nsStyleContext and group by nsStyleXXX struct

// Indices into border/padding/margin arrays
namespace mozilla {
namespace css {
typedef mozilla::Side Side;
}
}

#define NS_FOR_CSS_SIDES(var_) for (mozilla::css::Side var_ = NS_SIDE_TOP; var_ <= NS_SIDE_LEFT; var_++)
#define NS_SIDE_TO_HALF_CORNER(side_, second_, parallel_) \
  ((((side_) + !!(second_))*2 + ((side_) + !(parallel_))%2) % 8)

// box-sizing
#define NS_STYLE_BOX_SIZING_CONTENT       0
#define NS_STYLE_BOX_SIZING_PADDING       1
#define NS_STYLE_BOX_SIZING_BORDER        2

// clip-path sizing
#define NS_STYLE_CLIP_SHAPE_SIZING_NOBOX   0
#define NS_STYLE_CLIP_SHAPE_SIZING_CONTENT 1
#define NS_STYLE_CLIP_SHAPE_SIZING_PADDING 2
#define NS_STYLE_CLIP_SHAPE_SIZING_BORDER  3
#define NS_STYLE_CLIP_SHAPE_SIZING_MARGIN  4
#define NS_STYLE_CLIP_SHAPE_SIZING_FILL    5
#define NS_STYLE_CLIP_SHAPE_SIZING_STROKE  6
#define NS_STYLE_CURSOR_NS_RESIZE               34
#define NS_STYLE_CURSOR_EW_RESIZE               35
#define NS_STYLE_CURSOR_NONE                    36

// See nsStyleVisibility
#define NS_STYLE_DIRECTION_LTR                  0
#define NS_STYLE_DIRECTION_RTL                  1

// See nsStyleVisibility
// WritingModes.h depends on the particular values used here
#define NS_STYLE_WRITING_MODE_HORIZONTAL_TB     0
#define NS_STYLE_WRITING_MODE_VERTICAL_RL       1
// #define NS_STYLE_WRITING_MODE_HORIZONTAL_BT  2  // hypothetical
#define NS_STYLE_WRITING_MODE_VERTICAL_LR       3

// See nsStyleDisplay
#define NS_STYLE_DISPLAY_NONE                   0
#define NS_STYLE_DISPLAY_BLOCK                  1
#define NS_STYLE_DISPLAY_INLINE                 2
#define NS_STYLE_DISPLAY_INLINE_BLOCK           3
#define NS_STYLE_DISPLAY_LIST_ITEM              4
#define NS_STYLE_DISPLAY_TABLE                  8
#define NS_STYLE_DISPLAY_INLINE_TABLE           9
#define NS_STYLE_DISPLAY_TABLE_ROW_GROUP        10

// See nsStyleDisplay.mOverflowClipBox
#define NS_STYLE_OVERFLOW_CLIP_BOX_PADDING_BOX  0
#define NS_STYLE_OVERFLOW_CLIP_BOX_CONTENT_BOX  1

// See nsStyleList
#define NS_STYLE_LIST_STYLE_CUSTOM                -1 // for @counter-style
#define NS_STYLE_LIST_STYLE_NONE                  0
#define NS_STYLE_LIST_STYLE_DISC                  1
#define NS_STYLE_LIST_STYLE_CIRCLE                2
#define NS_STYLE_LIST_STYLE_SQUARE                3
#define NS_STYLE_LIST_STYLE_DECIMAL               4
#define NS_STYLE_LIST_STYLE_HEBREW                5
#define NS_STYLE_LIST_STYLE_JAPANESE_INFORMAL     6
#define NS_STYLE_LIST_STYLE_JAPANESE_FORMAL       7
#define NS_STYLE_LIST_STYLE_KOREAN_HANGUL_FORMAL  8
#define NS_STYLE_LIST_STYLE_KOREAN_HANJA_INFORMAL 9
#define NS_STYLE_LIST_STYLE_KOREAN_HANJA_FORMAL   10
#define NS_STYLE_LIST_STYLE_SIMP_CHINESE_INFORMAL 11
#define NS_STYLE_LIST_STYLE_SIMP_CHINESE_FORMAL   12
#define NS_STYLE_LIST_STYLE_TRAD_CHINESE_INFORMAL 13
#define NS_STYLE_LIST_STYLE_TRAD_CHINESE_FORMAL   14
#define NS_STYLE_LIST_STYLE_ETHIOPIC_NUMERIC      15
#define NS_STYLE_LIST_STYLE_DISCLOSURE_CLOSED     16
#define NS_STYLE_RUBY_POSITION_OVER             0
#define NS_STYLE_RUBY_POSITION_UNDER            1
#define NS_STYLE_RUBY_POSITION_INTER_CHARACTER  2 /* placeholder, not yet parsed */

// See nsStyleText
#define NS_STYLE_TEXT_SIZE_ADJUST_NONE          0
#define NS_STYLE_TEXT_SIZE_ADJUST_AUTO          1

// See nsStyleText
#define NS_STYLE_TEXT_ORIENTATION_MIXED          0
#define NS_STYLE_TEXT_ORIENTATION_UPRIGHT        1
#define NS_STYLE_TEXT_ORIENTATION_SIDEWAYS_RIGHT 2
#define NS_STYLE_TEXT_ORIENTATION_SIDEWAYS_LEFT  3 /* placeholder, not yet parsed */
#define NS_STYLE_TEXT_ORIENTATION_SIDEWAYS       4 /* placeholder, not yet parsed */

// See nsStyleText
#define NS_STYLE_TEXT_COMBINE_UPRIGHT_NONE        0
#define NS_STYLE_TEXT_COMBINE_UPRIGHT_ALL         1
#define NS_STYLE_TEXT_COMBINE_UPRIGHT_DIGITS_2    2
#if 0 /* expanded by -frewrite-includes */
#include "nsCoord.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsStyleCoord.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleConsts.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsStyleCoord.h"

enum nsStyleUnit : uint8_t {
  eStyleUnit_Null         = 0,      // (no value) value is not specified
  eStyleUnit_Normal       = 1,      // (no value)
  eStyleUnit_Auto         = 2,      // (no value)
  eStyleUnit_None         = 3,      // (no value)
  eStyleUnit_Percent      = 10,     // (float) 1.0 == 100%
  eStyleUnit_Factor       = 11,     // (float) a multiplier
  eStyleUnit_Degree       = 12,     // (float) angle in degrees
  eStyleUnit_Grad         = 13,     // (float) angle in grads
  eStyleUnit_Radian       = 14,     // (float) angle in radians
  eStyleUnit_Turn         = 15,     // (float) angle in turns
  eStyleUnit_FlexFraction = 16,     // (float) <flex> in fr units
  eStyleUnit_Coord        = 20,     // (nscoord) value is twips
  eStyleUnit_Integer      = 30,     // (int) value is simple integer
  eStyleUnit_Enumerated   = 32,     // (int) value has enumerated meaning

  // The following are reference counted allocated types.
  eStyleUnit_Calc         = 40,     // (Calc*) calc() toplevel; always present
                                    // to distinguish 50% from calc(50%), etc.

  eStyleUnit_MAX          = 40      // highest valid nsStyleUnit value
};

typedef union {
  int32_t     mInt;   // nscoord is a int32_t for now
  float       mFloat;
  // An mPointer is a reference counted pointer.  Currently this can only
  // ever be an nsStyleCoord::Calc*.
  void*       mPointer;
} nsStyleUnion;

/**
 * Class that hold a single size specification used by the style
 * system.  The size specification consists of two parts -- a number
 * and a unit.  The number is an integer, a floating point value, an
 * nscoord, or undefined, and the unit is an nsStyleUnit.  Checking
 * the unit is a must before asking for the value in any particular
 * form.
 */
class nsStyleCoord {
public:
  // Non-reference counted calc() value.  See nsStyleStruct.h for some uses
  // of this.
  struct CalcValue {
    // Every calc() expression evaluates to a length plus a percentage.
    nscoord mLength;
    float mPercent;
    bool mHasPercent; // whether there was any % syntax, even if 0

    bool operator==(const CalcValue& aOther) const {
      return mLength == aOther.mLength &&
             mPercent == aOther.mPercent &&
             mHasPercent == aOther.mHasPercent;
    }
    bool operator!=(const CalcValue& aOther) const {
      return !(*this == aOther);
    }
  };

  // Reference counted calc() value.  This is the type that is used to store
  // the calc() value in nsStyleCoord.
  struct Calc MOZ_FINAL : public CalcValue {
    NS_INLINE_DECL_REFCOUNTING(Calc)
    Calc() {}

  private:
    Calc(const Calc&) = delete;
    ~Calc() {}
    Calc& operator=(const Calc&) = delete;
  };

  explicit nsStyleCoord(nsStyleUnit aUnit = eStyleUnit_Null);
  enum CoordConstructorType { CoordConstructor };
  inline nsStyleCoord(nscoord aValue, CoordConstructorType);
  nsStyleCoord(int32_t aValue, nsStyleUnit aUnit);
  nsStyleCoord(float aValue, nsStyleUnit aUnit);
  inline nsStyleCoord(const nsStyleCoord& aCopy);
  inline nsStyleCoord(const nsStyleUnion& aValue, nsStyleUnit aUnit);
  ~nsStyleCoord() { Reset(); }

  nsStyleCoord&  operator=(const nsStyleCoord& aOther)
  {
    if (this != &aOther) {
      SetValue(mUnit, mValue, aOther);
    }
    return *this;
  }
  bool           operator==(const nsStyleCoord& aOther) const;
  bool           operator!=(const nsStyleCoord& aOther) const;

  nsStyleUnit GetUnit() const {
    NS_ASSERTION(mUnit != eStyleUnit_Null, "reading uninitialized value");
    return mUnit;
  }

  bool IsAngleValue() const {
    return eStyleUnit_Degree <= mUnit && mUnit <= eStyleUnit_Turn;
  }

  static bool IsCalcUnit(nsStyleUnit aUnit) {
    return aUnit == eStyleUnit_Calc;
  }

  static bool IsPointerUnit(nsStyleUnit aUnit) {
    return IsCalcUnit(aUnit);
  }

  bool IsCalcUnit() const {
    return IsCalcUnit(mUnit);
  }

  bool IsPointerValue() const {
    return IsPointerUnit(mUnit);
  }

  bool IsCoordPercentCalcUnit() const {
    return mUnit == eStyleUnit_Coord ||
           mUnit == eStyleUnit_Percent ||
           IsCalcUnit();
  }

  // Does this calc() expression have any percentages inside it?  Can be
  // called only when IsCalcUnit() is true.
  bool CalcHasPercent() const {
    return GetCalcValue()->mHasPercent;
  }

  bool HasPercent() const {
    return mUnit == eStyleUnit_Percent ||
           (IsCalcUnit() && CalcHasPercent());
  }

  bool ConvertsToLength() const {
    return mUnit == eStyleUnit_Coord ||
           (IsCalcUnit() && !CalcHasPercent());
  }

  nscoord     GetCoordValue() const;
  int32_t     GetIntValue() const;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  Calc*       GetCalcValue() const;
  ;

  // Sets to null and releases any refcounted objects.  Only use this if the
  // object is initialized (i.e. don't use it in nsStyleCoord constructors).
  void Reset();

  ;
  ;
  ;
  ;
  ;
  ;
  void  SetNormalValue();
  void  SetAutoValue();
  void  SetNoneValue();
  void  SetCalcValue(Calc* aValue);

  // Resets a coord represented by a unit/value pair.
  static inline void Reset(nsStyleUnit& aUnit, nsStyleUnion& aValue);

  // Sets a coord represented by a unit/value pair from a second
  // unit/value pair.
  static inline void SetValue(nsStyleUnit& aUnit,
                              nsStyleUnion& aValue,
                              nsStyleUnit aOtherUnit,
                              const nsStyleUnion& aOtherValue);

  // Sets a coord represented by a unit/value pair from an nsStyleCoord.
  static inline void SetValue(nsStyleUnit& aUnit, nsStyleUnion& aValue,
                              const nsStyleCoord& aOther);

private:
  nsStyleUnit   mUnit;
  nsStyleUnion  mValue;
};

/**
 * Class that represents a set of top/right/bottom/left nsStyleCoords.
 * This is commonly used to hold the widths of the borders, margins,
 * or paddings of a box.
 */
class nsStyleSides {
public:
  ;
  ;
  ;

  ;
  bool           operator==(const nsStyleSides& aOther) const;
  ;

  ;
  ;
  ;
  ;
  ;

  inline nsStyleCoord Get(mozilla::css::Side aSide) const;
  ;
  ;
  ;
  ;

  // Sets each side to null and releases any refcounted objects.  Only use this
  // if the object is initialized (i.e. don't use it in nsStyleSides
  // constructors).
  ;

  inline void Set(mozilla::css::Side aSide, const nsStyleCoord& aCoord);
  ;
  ;
  ;
  ;

protected:
  nsStyleUnit   mUnits[4];
  nsStyleUnion  mValues[4];
};

/**
 * Class that represents a set of top-left/top-right/bottom-left/bottom-right
 * nsStyleCoord pairs.  This is used to hold the dimensions of the
 * corners of a box (for, e.g., border-radius and outline-radius).
 */
class nsStyleCorners {
public:
  ;
  ;
  ;

  // use compiler's version
  ;
  bool           operator==(const nsStyleCorners& aOther) const;
  ;

  // aCorner is always one of NS_CORNER_* defined in nsStyleConsts.h
  ;

  ;

  // Sets each corner to null and releases any refcounted objects.  Only use
  // this if the object is initialized (i.e. don't use it in nsStyleCorners
  // constructors).
  void Reset();

  inline void Set(uint8_t aHalfCorner, const nsStyleCoord& aCoord);

protected:
  nsStyleUnit   mUnits[8];
  nsStyleUnion  mValues[8];
};











inline nsStyleCoord::Calc* nsStyleCoord::GetCalcValue() const
{
  NS_ASSERTION(IsCalcUnit(), "not a pointer value");
  if (IsCalcUnit()) {
    return static_cast<Calc*>(mValue.mPointer);
  }
  return nullptr;
}

/* static */ inline void
nsStyleCoord::Reset(nsStyleUnit& aUnit, nsStyleUnion& aValue)
{
  MOZ_ASSERT(aUnit <= eStyleUnit_MAX,
             "calling Reset on uninitialized nsStyleCoord?");

  switch (aUnit) {
    case eStyleUnit_Calc:
      static_cast<Calc*>(aValue.mPointer)->Release();
      break;
    default:
      MOZ_ASSERT(!IsPointerUnit(aUnit), "check pointer refcounting logic");
  }

  aUnit = eStyleUnit_Null;
  aValue.mInt = 0;
}

/* static */ inline void
nsStyleCoord::SetValue(nsStyleUnit& aUnit,
                       nsStyleUnion& aValue,
                       nsStyleUnit aOtherUnit,
                       const nsStyleUnion& aOtherValue)
{
  Reset(aUnit, aValue);

  aUnit = aOtherUnit;
  aValue = aOtherValue;

  switch (aUnit) {
    case eStyleUnit_Calc:
      static_cast<Calc*>(aValue.mPointer)->AddRef();
      break;
    default:
      MOZ_ASSERT(!IsPointerUnit(aUnit), "check pointer refcounting logic");
  }
}

/* static */ inline void
nsStyleCoord::SetValue(nsStyleUnit& aUnit, nsStyleUnion& aValue,
                       const nsStyleCoord& aOther)
{
  SetValue(aUnit, aValue, aOther.mUnit, aOther.mValue);
}


// -------------------------
// nsStyleSides inlines
//












inline nsStyleCoord nsStyleSides::Get(mozilla::css::Side aSide) const
{
  return nsStyleCoord(mValues[aSide], nsStyleUnit(mUnits[aSide]));
}









inline void nsStyleSides::Set(mozilla::css::Side aSide, const nsStyleCoord& aCoord)
{
  nsStyleCoord::SetValue(mUnits[aSide], mValues[aSide], aCoord);
}


inline void nsStyleCorners::Set(uint8_t aCorner, const nsStyleCoord& aCoord)
{
  nsStyleCoord::SetValue(mUnits[aCorner], mValues[aCorner], aCoord);
}

#endif /* nsStyleCoord_h___ */
# 529 "../../dist/include/nsStyleCoord.h"
# 12 "../../dist/include/ScrollbarStyles.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/WindowBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/WindowBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_WindowBinding_h
#define mozilla_dom_WindowBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "WindowBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/WindowBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_WindowBinding_h
#define mozilla_dom_WindowBinding_h

  inline NonNull<mozilla::dom::External>&
  SetAsExternal()
  {
    if (mType == eExternal) {
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_WindowBinding_h
# 702 "../../dist/include/mozilla/dom/WindowBinding.h"
# 7 "../../dist/include/mozilla/dom/WindowBinding.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/jsapi.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* JavaScript API. */

#ifndef jsapi_h
#define jsapi_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/FloatingPoint.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/jsapi.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/jsapi.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Range.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Range.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_Range_h
#define mozilla_Range_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RangedPtr.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/RangedPtr.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Implements a smart pointer asserted to remain within a range specified at
 * construction.
 */

#ifndef mozilla_RangedPtr_h
#define mozilla_RangedPtr_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ArrayUtils.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/RangedPtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/RangedPtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/RangedPtr.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/RangedPtr.h"

namespace mozilla {

/*
 * RangedPtr is a smart pointer restricted to an address range specified at
 * creation.  The pointer (and any smart pointers derived from it) must remain
 * within the range [start, end] (inclusive of end to facilitate use as
 * sentinels).  Dereferencing or indexing into the pointer (or pointers derived
 * from it) must remain within the range [start, end).  All the standard pointer
 * operators are defined on it; in debug builds these operations assert that the
 * range specified at construction is respected.
 *
 * In theory passing a smart pointer instance as an argument can be slightly
 * slower than passing a T* (due to ABI requirements for passing structs versus
 * passing pointers), if the method being called isn't inlined.  If you are in
 * extremely performance-critical code, you may want to be careful using this
 * smart pointer as an argument type.
 *
 * RangedPtr<T> intentionally does not implicitly convert to T*.  Use get() to
 * explicitly convert to T*.  Keep in mind that the raw pointer of course won't
 * implement bounds checking in debug builds.
 */
template<typename T>
class RangedPtr
{
  T* mPtr;

#ifdef DEBUG
  T* const mRangeStart;
  T* const mRangeEnd;
#endif
# 51 "../../dist/include/mozilla/RangedPtr.h"

  void checkSanity()
  {
    MOZ_ASSERT(mRangeStart <= mPtr);
    MOZ_ASSERT(mPtr <= mRangeEnd);
  }

  /* Creates a new pointer for |aPtr|, restricted to this pointer's range. */
  RangedPtr<T> create(T* aPtr) const
  {
#ifdef DEBUG
    return RangedPtr<T>(aPtr, mRangeStart, mRangeEnd);
#else
# 64 "../../dist/include/mozilla/RangedPtr.h"
    return RangedPtr<T>(aPtr, nullptr, size_t(0));
#endif
# 66 "../../dist/include/mozilla/RangedPtr.h"
  }

  uintptr_t asUintptr() const { return reinterpret_cast<uintptr_t>(mPtr); }

public:
  RangedPtr(T* aPtr, T* aStart, T* aEnd)
    : mPtr(aPtr)
#ifdef DEBUG
    , mRangeStart(aStart), mRangeEnd(aEnd)
#endif
# 76 "../../dist/include/mozilla/RangedPtr.h"
  {
    MOZ_ASSERT(mRangeStart <= mRangeEnd);
    checkSanity();
  }
  RangedPtr(T* aPtr, T* aStart, size_t aLength)
    : mPtr(aPtr)
#ifdef DEBUG
    , mRangeStart(aStart), mRangeEnd(aStart + aLength)
#endif
# 85 "../../dist/include/mozilla/RangedPtr.h"
  {
    MOZ_ASSERT(aLength <= size_t(-1) / sizeof(T));
    MOZ_ASSERT(reinterpret_cast<uintptr_t>(mRangeStart) + aLength * sizeof(T) >=
               reinterpret_cast<uintptr_t>(mRangeStart));
    checkSanity();
  }

  /* Equivalent to RangedPtr(aPtr, aPtr, aLength). */
  

  /* Equivalent to RangedPtr(aArr, aArr, N). */
  

  

  


  T& operator*() const
  {
    MOZ_ASSERT(mPtr >= mRangeStart);
    MOZ_ASSERT(mPtr < mRangeEnd);
    return *mPtr;
  }

  template <typename U>
  bool operator==(const RangedPtr<U>& aOther) const
  {
    return mPtr == aOther.mPtr;
  }
  template <typename U>
  bool operator!=(const RangedPtr<U>& aOther) const
  {
    return !(*this == aOther);
  }

  
  

  template <typename U>
  bool operator<(const RangedPtr<U>& aOther) const
  {
    return mPtr < aOther.mPtr;
  }
  template <typename U>
  bool operator<=(const RangedPtr<U>& aOther) const
  {
    return mPtr <= aOther.mPtr;
  }

  template <typename U>
  bool operator>(const RangedPtr<U>& aOther) const
  {
    return mPtr > aOther.mPtr;
  }
  

  size_t operator-(const RangedPtr<T>& aOther) const
  {
    MOZ_ASSERT(mPtr >= aOther.mPtr);
    return PointerRangeSize(aOther.mPtr, mPtr);
  }

private:
  RangedPtr() = delete;
  T* operator&() = delete;
};

} /* namespace mozilla */

#endif /* mozilla_RangedPtr_h */
# 281 "../../dist/include/mozilla/RangedPtr.h"
# 11 "../../dist/include/mozilla/Range.h" 2

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#if !defined(_SIZE_T) || __has_feature(modules)
/* Always define size_t when modules are available. */
#if !__has_feature(modules)
#define _SIZE_T
#endif
# 42 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ size_t;
#endif

#undef NULL
#ifdef __cplusplus
#  if !defined(__MINGW32__) && !defined(_MSC_VER)
#    define NULL __null
#  else
# 74 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#    define NULL 0
#  endif
# 76 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#else
# 77 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#  define NULL ((void*)0)
#endif
# 79 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#ifdef __cplusplus
#if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
namespace std { typedef decltype(nullptr) nullptr_t; }
using ::std::nullptr_t;
#endif
# 85 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#define offsetof(t, d) __builtin_offsetof(t, d)

#endif /* __STDDEF_H */
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
__WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
#if defined(__need_wint_t)
/* Always define wint_t when modules are available. */
#if !defined(_WINT_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 13 "../../dist/include/mozilla/Range.h" 2

namespace mozilla {

// Range<T> is a tuple containing a pointer and a length.
template <typename T>
class Range
{
  const RangedPtr<T> mStart;
  const RangedPtr<T> mEnd;

public:
  Range() : mStart(nullptr, 0), mEnd(nullptr, 0) {}
  Range(T* aPtr, size_t aLength)
    : mStart(aPtr, aPtr, aPtr + aLength),
      mEnd(aPtr + aLength, aPtr, aPtr + aLength)
  {}

  
  
  

  

  
};

} // namespace mozilla

#endif /* mozilla_Range_h */
# 42 "../../dist/include/mozilla/Range.h"
# 15 "../../dist/include/jsapi.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RangedPtr.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/jsapi.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h>
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/jsapi.h"
#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/jsapi.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/CallArgs.h"
#endif /* expanded by -frewrite-includes */
# 26 "../../dist/include/jsapi.h"
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* JSPrincipals and related interfaces. */

#ifndef js_Principals_h
#define js_Principals_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Atomics.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/js/Principals.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/js/Principals.h"

#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/js/Principals.h"

struct JSPrincipals {
    /* Don't call "destroy"; use reference counting macros below. */
    mozilla::Atomic<int32_t> refcount;

#ifdef JS_DEBUG
    /* A helper to facilitate principals debugging. */
    uint32_t    debugToken;
#endif
# 26 "../../dist/include/js/Principals.h"

    

    

    /*
     * This is not defined by the JS engine but should be provided by the
     * embedding.
     */
    JS_PUBLIC_API(void) dump();
};

;

;

// Return whether the first principal subsumes the second. The exact meaning of
// 'subsumes' is left up to the browser. Subsumption is checked inside the JS
// engine when determining, e.g., which stack frames to display in a backtrace.
typedef bool
(* JSSubsumesOp)(JSPrincipals *first, JSPrincipals *second);

/*
 * Used to check if a CSP instance wants to disable eval() and friends.
 * See js_CheckCSPPermitsJSAction() in jsobj.
 */
typedef bool
(* JSCSPEvalChecker)(JSContext *cx);

struct JSSecurityCallbacks {
    JSCSPEvalChecker           contentSecurityPolicyAllows;
    JSSubsumesOp               subsumes;
};

;

;

/*
 * Code running with "trusted" principals will be given a deeper stack
 * allocation than ordinary scripts. This allows trusted script to run after
 * untrusted script has exhausted the stack. This function sets the
 * runtime-wide trusted principal.
 *
 * This principals is not held (via JS_HoldPrincipals/JS_DropPrincipals) since
 * there is no available JSContext. Instead, the caller must ensure that the
 * given principals stays valid for as long as 'rt' may point to it. If the
 * principals would be destroyed before 'rt', JS_SetTrustedPrincipals must be
 * called again, passing nullptr for 'prin'.
 */
;

typedef void
(* JSDestroyPrincipalsOp)(JSPrincipals *principals);

/*
 * Initialize the callback that is called to destroy JSPrincipals instance
 * when its reference counter drops to zero. The initialization can be done
 * only once per JS runtime.
 */
;

#endif  /* js_Principals_h */
# 99 "../../dist/include/js/Principals.h"
# 30 "../../dist/include/jsapi.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 31 "../../dist/include/jsapi.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TracingAPI.h"
#endif /* expanded by -frewrite-includes */
# 32 "../../dist/include/jsapi.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Utility.h"
#endif /* expanded by -frewrite-includes */
# 33 "../../dist/include/jsapi.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 34 "../../dist/include/jsapi.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Vector.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/Vector.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_Vector_h
#define js_Vector_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Vector.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Vector.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* A type/length-parametrized vector class. */

#ifndef mozilla_Vector_h
#define mozilla_Vector_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Alignment.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/Vector.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/AllocPolicy.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/AllocPolicy.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * An allocation policy concept, usable for structures and algorithms to
 * control how memory is allocated and how failures are handled.
 */

#ifndef mozilla_AllocPolicy_h
#define mozilla_AllocPolicy_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TemplateLib.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/AllocPolicy.h"

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
#endif
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#if !defined(_SIZE_T) || __has_feature(modules)
/* Always define size_t when modules are available. */
#if !__has_feature(modules)
#define _SIZE_T
#endif
# 42 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ size_t;
#endif
# 44 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* ISO9899:2011 7.20 (C11 Annex K): Define rsize_t if __STDC_WANT_LIB_EXT1__ is
 * enabled. */
#if (defined(__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__ >= 1 && \
     !defined(_RSIZE_T)) || __has_feature(modules)
/* Always define rsize_t when modules are available. */
#if !__has_feature(modules)
#define _RSIZE_T
#endif
# 53 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __SIZE_TYPE__ rsize_t;
#endif
# 55 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#ifndef __cplusplus
/* Always define wchar_t when modules are available. */
#if !defined(_WCHAR_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WCHAR_T
#if defined(_MSC_EXTENSIONS)
#define _WCHAR_T_DEFINED
#endif
# 64 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 65 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WCHAR_TYPE__ wchar_t;
#endif
# 67 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 68 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#undef NULL
#ifdef __cplusplus
#  if !defined(__MINGW32__) && !defined(_MSC_VER)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 18 "../../dist/include/mozilla/AllocPolicy.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/AllocPolicy.h"

namespace mozilla {

/*
 * Allocation policies are used to implement the standard allocation behaviors
 * in a customizable way.  Additionally, custom behaviors may be added to these
 * behaviors, such as additionally reporting an error through an out-of-band
 * mechanism when OOM occurs.  The concept modeled here is as follows:
 *
 *  - public copy constructor, assignment, destructor
 *  - template <typename T> T* pod_malloc(size_t)
 *      Responsible for OOM reporting when null is returned.
 *  - template <typename T> T* pod_calloc(size_t)
 *      Responsible for OOM reporting when null is returned.
 *  - template <typename T> T* pod_realloc(T*, size_t, size_t)
 *      Responsible for OOM reporting when null is returned.  The old allocation
 *      size is passed in, in addition to the new allocation size requested.
 *  - void free_(void*)
 *  - void reportAllocOverflow() const
 *      Called on allocation overflow (that is, an allocation implicitly tried
 *      to allocate more than the available memory space -- think allocating an
 *      array of large-size objects, where N * size overflows) before null is
 *      returned.
 *
 * mfbt provides (and typically uses by default) only MallocAllocPolicy, which
 * does nothing more than delegate to the malloc/alloc/free functions.
 */

/*
 * A policy that straightforwardly uses malloc/calloc/realloc/free and adds no
 * extra behaviors.
 */
class MallocAllocPolicy
{
public:
  

  

  

  

  
};

} // namespace mozilla

#endif /* mozilla_AllocPolicy_h */
# 91 "../../dist/include/mozilla/AllocPolicy.h"
# 14 "../../dist/include/mozilla/Vector.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ArrayUtils.h" // for PointerRangeSize
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/Vector.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/Vector.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/Vector.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MathAlgorithms.h"
#pragma warning(disable:4345)
#endif
# 31 "../../dist/include/mozilla/Vector.h"

namespace mozilla {

template<typename T, size_t N, class AllocPolicy, class ThisVector>
class VectorBase;

namespace detail {

/*
 * Check that the given capacity wastes the minimal amount of space if
 * allocated on the heap. This means that aCapacity*sizeof(T) is as close to a
 * power-of-two as possible. growStorageBy() is responsible for ensuring this.
 */
template<typename T>
static bool CapacityHasExcessSpace(size_t aCapacity)
{
  size_t size = aCapacity * sizeof(T);
  return RoundUpPow2(size) - size >= sizeof(T);
}

/*
 * This template class provides a default implementation for vector operations
 * when the element type is not known to be a POD, as judged by IsPod.
 */
template<typename T, size_t N, class AP, class ThisVector, bool IsPod>
struct VectorImpl
{
  /*
   * Constructs a default object in the uninitialized memory at *aDst.
   */
  /* Destroys constructed objects in the range [aBegin, aEnd). */
  static inline void destroy(T* aBegin, T* aEnd)
  {
    MOZ_ASSERT(aBegin <= aEnd);
    for (T* p = aBegin; p < aEnd; ++p) {
      p->~T();
    }
  }

  /* Constructs objects in the uninitialized range [aBegin, aEnd). */
  

  /*
   * Copy-constructs objects in the uninitialized range
   * [aDst, aDst+(aSrcEnd-aSrcStart)) from the range [aSrcStart, aSrcEnd).
   */
  

  /*
   * Move-constructs objects in the uninitialized range
   * [aDst, aDst+(aSrcEnd-aSrcStart)) from the range [aSrcStart, aSrcEnd).
   */
  template<typename U>
  static inline void moveConstruct(T* aDst, U* aSrcStart, U* aSrcEnd)
  {
    MOZ_ASSERT(aSrcStart <= aSrcEnd);
    for (U* p = aSrcStart; p < aSrcEnd; ++p, ++aDst) {
      new_(aDst, Move(*p));
    }
  }

  /*
   * Copy-constructs objects in the uninitialized range [aDst, aDst+aN) from
   * the same object aU.
   */
  

  /*
   * Grows the given buffer to have capacity aNewCap, preserving the objects
   * constructed in the range [begin, end) and updating aV. Assumes that (1)
   * aNewCap has not overflowed, and (2) multiplying aNewCap by sizeof(T) will
   * not overflow.
   */
  static inline bool
  growTo(VectorBase<T, N, AP, ThisVector>& aV, size_t aNewCap)
  {
    MOZ_ASSERT(!aV.usingInlineStorage());
    MOZ_ASSERT(!CapacityHasExcessSpace<T>(aNewCap));
    T* newbuf = aV.template pod_malloc<T>(aNewCap);
    if (MOZ_UNLIKELY(!newbuf)) {
      return false;
    }
    T* dst = newbuf;
    T* src = aV.beginNoCheck();
    for (; src < aV.endNoCheck(); ++dst, ++src) {
      new_(dst, Move(*src));
    }
    VectorImpl::destroy(aV.beginNoCheck(), aV.endNoCheck());
    aV.free_(aV.mBegin);
    aV.mBegin = newbuf;
    /* aV.mLength is unchanged. */
    aV.mCapacity = aNewCap;
    return true;
  }
};

/*
 * This partial template specialization provides a default implementation for
 * vector operations when the element type is known to be a POD, as judged by
 * IsPod.
 */
template<typename T, size_t N, class AP, class ThisVector>
struct VectorImpl<T, N, AP, ThisVector, true>
{
  static inline void new_(T* aDst)
  {
    *aDst = T();
  }

  

  static inline void destroy(T*, T*) {}

  

  

  

  

  
};

// A struct for TestVector.cpp to access private internal fields.
// DO NOT DEFINE IN YOUR OWN CODE.
struct VectorTesting;

} // namespace detail

/*
 * A CRTP base class for vector-like classes.  Unless you really really want
 * your own vector class -- and you almost certainly don't -- you should use
 * mozilla::Vector instead!
 *
 * See mozilla::Vector for interface requirements.
 */
template<typename T, size_t N, class AllocPolicy, class ThisVector>
class VectorBase : private AllocPolicy
{
  /* utilities */

  static const bool kElemIsPod = IsPod<T>::value;
  typedef detail::VectorImpl<T, N, AllocPolicy, ThisVector, kElemIsPod> Impl;
  friend struct detail::VectorImpl<T, N, AllocPolicy, ThisVector, kElemIsPod>;

  friend struct detail::VectorTesting;

  bool growStorageBy(size_t aIncr);
  bool convertToHeapStorage(size_t aNewCap);

  /* magic constants */

  static const int kMaxInlineBytes = 1024;

  /* compute constants */

  /*
   * Consider element size to be 1 for buffer sizing if there are 0 inline
   * elements.  This allows us to compile when the definition of the element
   * type is not visible here.
   *
   * Explicit specialization is only allowed at namespace scope, so in order
   * to keep everything here, we use a dummy template parameter with partial
   * specialization.
   */
  template<int M, int Dummy>
  struct ElemSize
  {
    static const size_t value = sizeof(T);
  };
  template<int Dummy>
  struct ElemSize<0, Dummy>
  {
    static const size_t value = 1;
  };

  static const size_t kInlineCapacity =
    tl::Min<N, kMaxInlineBytes / ElemSize<N, 0>::value>::value;

  /* Calculate inline buffer size; avoid 0-sized array. */
  static const size_t kInlineBytes =
    tl::Max<1, kInlineCapacity * ElemSize<N, 0>::value>::value;

  /* member data */

  /*
   * Pointer to the buffer, be it inline or heap-allocated. Only [mBegin,
   * mBegin + mLength) hold valid constructed T objects. The range [mBegin +
   * mLength, mBegin + mCapacity) holds uninitialized memory. The range
   * [mBegin + mLength, mBegin + mReserved) also holds uninitialized memory
   * previously allocated by a call to reserve().
   */
  T* mBegin;

  /* Number of elements in the vector. */
  size_t mLength;

  /* Max number of elements storable in the vector without resizing. */
  size_t mCapacity;

#ifdef DEBUG
  /* Max elements of reserved or used space in this vector. */
  size_t mReserved;
#endif
# 328 "../../dist/include/mozilla/Vector.h"

  /* Memory used for inline storage. */
  AlignedStorage<kInlineBytes> mStorage;

#ifdef DEBUG
  friend class ReentrancyGuard;
  bool mEntered;
#endif
# 336 "../../dist/include/mozilla/Vector.h"

  /* private accessors */

  bool usingInlineStorage() const
  {
    return mBegin == const_cast<VectorBase*>(this)->inlineStorage();
  }

  T* inlineStorage()
  {
    return static_cast<T*>(mStorage.addr());
  }

  T* beginNoCheck() const
  {
    return mBegin;
  }

  T* endNoCheck()
  {
    return mBegin + mLength;
  }

  

#ifdef DEBUG
  /**
   * The amount of explicitly allocated space in this vector that is immediately
   * available to be filled by appending additional elements.  This value is
   * always greater than or equal to |length()| -- the vector's actual elements
   * are implicitly reserved.  This value is always less than or equal to
   * |capacity()|.  It may be explicitly increased using the |reserve()| method.
   */
  size_t reserved() const
  {
    MOZ_ASSERT(mLength <= mReserved);
    MOZ_ASSERT(mReserved <= mCapacity);
    return mReserved;
  }
#endif
# 379 "../../dist/include/mozilla/Vector.h"

  /* Append operations guaranteed to succeed due to pre-reserved space. */
  ;
  ;
  ;
  ;

public:
  static const size_t sMaxInlineStorage = N;

  typedef T ElementType;

  explicit VectorBase(AllocPolicy = AllocPolicy());
  ; /* Move constructor. */
  ; /* Move assignment. */
  ~VectorBase();

  /* accessors */

  const AllocPolicy& allocPolicy() const { return *this; }

  AllocPolicy& allocPolicy() { return *this; }

  enum { InlineLength = N };

  size_t length() const { return mLength; }

  bool empty() const { return mLength == 0; }

  size_t capacity() const { return mCapacity; }

  T* begin()
  {
    MOZ_ASSERT(!mEntered);
    return mBegin;
  }

  const T* begin() const
  {
    MOZ_ASSERT(!mEntered);
    return mBegin;
  }

  T* end()
  {
    MOZ_ASSERT(!mEntered);
    return mBegin + mLength;
  }

  const T* end() const
  {
    MOZ_ASSERT(!mEntered);
    return mBegin + mLength;
  }

  T& operator[](size_t aIndex)
  {
    MOZ_ASSERT(!mEntered);
    MOZ_ASSERT(aIndex < mLength);
    return begin()[aIndex];
  }

  

  

  

  class Range
  {
    friend class VectorBase;
    T* mCur;
    T* mEnd;
    

  public:
    
    
    
    
    
    
  };

  

  /* mutators */

  /**
   * Given that the vector is empty and has no inline storage, grow to
   * |capacity|.
   */
  ;

  /**
   * If reserve(aRequest) succeeds and |aRequest >= length()|, then appending
   * |aRequest - length()| elements, in any sequence of append/appendAll calls,
   * is guaranteed to succeed.
   *
   * A request to reserve an amount less than the current length does not affect
   * reserved space.
   */
  ;

  /**
   * Destroy elements in the range [end() - aIncr, end()). Does not deallocate
   * or unreserve storage for those elements.
   */
  void shrinkBy(size_t aIncr);


  /** Clears and releases any heap-allocated storage. */
  
  

  void popBack();

  ;

  /**
   * Transfers ownership of the internal buffer used by this vector to the
   * caller.  (It's the caller's responsibility to properly deallocate this
   * buffer, in accordance with this vector's AllocPolicy.)  After this call,
   * the vector is empty.  Since the returned buffer may need to be allocated
   * (if the elements are currently stored in-place), the call can fail,
   * returning nullptr.
  /**
   * Removes the element |aT|, which must fall in the bounds [begin, end),
   * shifting existing elements from |aT + 1| onward one position lower.
   */
  ;

  /**
   * Removes the elements [|aBegin|, |aEnd|), which must fall in the bounds
   * [begin, end), shifting existing elements from |aEnd + 1| onward to aBegin's
   * old position.
   */
  ;

  /**
   * Measure the size of the vector's heap-allocated storage.
   */
  size_t sizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const;

  /**
   * Like sizeOfExcludingThis, but also measures the size of the vector
   * object (which must be heap-allocated) itself.
   */
  ;

  ;

private:
  VectorBase(const VectorBase&) = delete;
  void operator=(const VectorBase&) = delete;

  /* Move-construct/assign only from our derived class, ThisVector. */
  VectorBase(VectorBase&&) = delete;
  void operator=(VectorBase&&) = delete;
};

/* This does the re-entrancy check plus several other sanity checks. */
#define MOZ_REENTRANCY_GUARD_ET_AL \
  ReentrancyGuard g(*this); \
  MOZ_ASSERT_IF(usingInlineStorage(), mCapacity == kInlineCapacity); \
  MOZ_ASSERT(reserved() <= mCapacity); \
  MOZ_ASSERT(mLength <= reserved()); \
  MOZ_ASSERT(mLength <= mCapacity)

/* Vector Implementation */

template<typename T, size_t N, class AP, class TV>
MOZ_ALWAYS_INLINE
VectorBase<T, N, AP, TV>::VectorBase(AP aAP)
  : AP(aAP)
  , mLength(0)
  , mCapacity(kInlineCapacity)
#ifdef DEBUG
  , mReserved(0)
  , mEntered(false)
#endif
# 674 "../../dist/include/mozilla/Vector.h"
{
  mBegin = static_cast<T*>(mStorage.addr());
}

/* Move constructor. */


/* Move assignment. */


template<typename T, size_t N, class AP, class TV>
MOZ_ALWAYS_INLINE
VectorBase<T, N, AP, TV>::~VectorBase()
{
  MOZ_REENTRANCY_GUARD_ET_AL;
  Impl::destroy(beginNoCheck(), endNoCheck());
  if (!usingInlineStorage()) {
    this->free_(beginNoCheck());
  }
}

/*
 * This function will create a new heap buffer with capacity aNewCap,
 * move all elements in the inline buffer to this new buffer,
 * and fail on OOM.
 */
template<typename T, size_t N, class AP, class TV>
inline bool
VectorBase<T, N, AP, TV>::convertToHeapStorage(size_t aNewCap)
{
  MOZ_ASSERT(usingInlineStorage());

  /* Allocate buffer. */
  MOZ_ASSERT(!detail::CapacityHasExcessSpace<T>(aNewCap));
  T* newBuf = this->template pod_malloc<T>(aNewCap);
  if (MOZ_UNLIKELY(!newBuf)) {
    return false;
  }

  /* Copy inline elements into heap buffer. */
  Impl::moveConstruct(newBuf, beginNoCheck(), endNoCheck());
  Impl::destroy(beginNoCheck(), endNoCheck());

  /* Switch in heap buffer. */
  mBegin = newBuf;
  /* mLength is unchanged. */
  mCapacity = aNewCap;
  return true;
}

template<typename T, size_t N, class AP, class TV>
MOZ_NEVER_INLINE bool
VectorBase<T, N, AP, TV>::growStorageBy(size_t aIncr)
{
  MOZ_ASSERT(mLength + aIncr > mCapacity);

  /*
   * When choosing a new capacity, its size should is as close to 2**N bytes
   * as possible.  2**N-sized requests are best because they are unlikely to
   * be rounded up by the allocator.  Asking for a 2**N number of elements
   * isn't as good, because if sizeof(T) is not a power-of-two that would
   * result in a non-2**N request size.
   */

  size_t newCap;

  if (aIncr == 1) {
    if (usingInlineStorage()) {
      /* This case occurs in ~70--80% of the calls to this function. */
      size_t newSize =
        tl::RoundUpPow2<(kInlineCapacity + 1) * sizeof(T)>::value;
      newCap = newSize / sizeof(T);
      goto convert;
    }

    if (mLength == 0) {
      /* This case occurs in ~0--10% of the calls to this function. */
      newCap = 1;
      goto grow;
    }

    /* This case occurs in ~15--20% of the calls to this function. */

    /*
     * Will mLength * 4 *sizeof(T) overflow?  This condition limits a vector
     * to 1GB of memory on a 32-bit system, which is a reasonable limit.  It
     * also ensures that
     *
      newCap += 1;
    }
  } else {
    /* This case occurs in ~2% of the calls to this function. */
    size_t newMinCap = mLength + aIncr;

    /* Did mLength + aIncr overflow?  Will newCap * sizeof(T) overflow? */
    if (MOZ_UNLIKELY(newMinCap < mLength ||
                     newMinCap & tl::MulOverflowMask<2 * sizeof(T)>::value))
    {
      this->reportAllocOverflow();
      return false;
    }

    size_t newMinSize = newMinCap * sizeof(T);
    size_t newSize = RoundUpPow2(newMinSize);
    newCap = newSize / sizeof(T);
  }

  if (usingInlineStorage()) {
convert:
    return convertToHeapStorage(newCap);
  }

grow:
  return Impl::growTo(*this, newCap);
}





template<typename T, size_t N, class AP, class TV>
inline void
VectorBase<T, N, AP, TV>::shrinkBy(size_t aIncr)
{
  MOZ_REENTRANCY_GUARD_ET_AL;
  MOZ_ASSERT(aIncr <= mLength);
  Impl::destroy(endNoCheck() - aIncr, endNoCheck());
  mLength -= aIncr;
}

template<typename T, size_t N, class AP, class TV>
MOZ_ALWAYS_INLINE void
VectorBase<T, N, AP, TV>::popBack()
{
  MOZ_REENTRANCY_GUARD_ET_AL;
  MOZ_ASSERT(!empty());
  --mLength;
  endNoCheck()->~T();
}







template<typename T, size_t N, class AP, class TV>
inline size_t
VectorBase<T, N, AP, TV>::sizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
{
  return usingInlineStorage() ? 0 : aMallocSizeOf(beginNoCheck());
}





/*
 * STL-like container providing a short-lived, dynamic buffer.  Vector calls the
 * constructors/destructors of all elements stored in its internal buffer, so
 * non-PODs may be safely used.  Additionally, Vector will store the first N
 * elements in-place before resorting to dynamic allocation.
 *
 * T requirements:
 *  - default and copy constructible, assignable, destructible
 *  - operations do not throw
 * N requirements:
 *  - any value, however, N is clamped to min/max values
 * AllocPolicy:
 *  - see "Allocation policies" in AllocPolicy.h (defaults to
 *    mozilla::MallocAllocPolicy)
 *
 * Vector is not reentrant: T member functions called during Vector member
 * functions must not call back into the same object!
 */
template<typename T,
         size_t MinInlineCapacity = 0,
         class AllocPolicy = MallocAllocPolicy>
class Vector
  : public VectorBase<T,
                      MinInlineCapacity,
                      AllocPolicy,
                      Vector<T, MinInlineCapacity, AllocPolicy> >
{
  typedef VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;

public:
  explicit Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}
  
  
};

} // namespace mozilla

#ifdef _MSC_VER
#pragma warning(pop)
#endif
# 1329 "../../dist/include/mozilla/Vector.h"

#endif /* mozilla_Vector_h */
# 1331 "../../dist/include/mozilla/Vector.h"
# 11 "../../dist/include/js/Vector.h" 2

/* Silence dire "bugs in previous versions of MSVC have been fixed" warnings */
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4345)
#endif
# 17 "../../dist/include/js/Vector.h"

namespace js {

class TempAllocPolicy;

// If we had C++11 template aliases, we could just use this:
//
// ready via CRTP -- or rather, via mozilla::VectorBase, which basically no one
// should use.  :-)  Third, we have to redefine the constructors and the non-
// inherited operators.  Blech.  Happily there aren't too many of these, so it
// isn't the end of the world.

template <typename T,
          size_t MinInlineCapacity = 0,
          class AllocPolicy = TempAllocPolicy>
class Vector
  : public mozilla::VectorBase<T,
                               MinInlineCapacity,
                               AllocPolicy,
                               Vector<T, MinInlineCapacity, AllocPolicy> >
{
    typedef typename mozilla::VectorBase<T, MinInlineCapacity, AllocPolicy, Vector> Base;

  public:
    explicit Vector(AllocPolicy alloc = AllocPolicy()) : Base(alloc) {}
    
    
};

} // namespace js

#endif /* js_Vector_h */
# 67 "../../dist/include/js/Vector.h"
# 35 "../../dist/include/jsapi.h" 2

/************************************************************************/

namespace JS {

class Latin1CharsZ;
class TwoByteChars;

#ifdef JS_DEBUG

class JS_PUBLIC_API(AutoCheckRequestDepth)
{
    JSContext *cx;
  public:
    ;
    ;
    ;
};

# define CHECK_REQUEST(cx) \
    JS::AutoCheckRequestDepth _autoCheckRequestDepth(cx)

#else
# 58 "../../dist/include/jsapi.h"

# define CHECK_REQUEST(cx) \
    ((void) 0)

#endif /* JS_DEBUG */
# 63 "../../dist/include/jsapi.h"

/* AutoValueArray roots an internal fixed-size array of Values. */
template <size_t N>
class AutoValueArray : public AutoGCRooter
{
    const size_t length_;
    Value elements_[N];

  public:
    

    
    
    

    
    

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

template<class T>
class AutoVectorRooter : protected AutoGCRooter
{
    typedef js::Vector<T, 8> VectorImpl;
    VectorImpl vector;

  public:
    explicit AutoVectorRooter(JSContext *cx, ptrdiff_t tag
                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
      : AutoGCRooter(cx, tag), vector(cx)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    explicit AutoVectorRooter(js::ContextFriendFields *cx, ptrdiff_t tag
                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
      : AutoGCRooter(cx, tag), vector(cx)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    typedef T ElementType;
    typedef typename VectorImpl::Range Range;

    size_t length() const { return vector.length(); }
    

    
    
    

    

    /* For use when space has already been reserved. */
    

    
    

    bool growBy(size_t inc) {
        size_t oldLength = vector.length();
        if (!vector.growByUninitialized(inc))
            return false;
        makeRangeGCSafe(oldLength);
        return true;
    }

    bool resize(size_t newLength) {
        size_t oldLength = vector.length();
        if (newLength <= oldLength) {
            vector.shrinkBy(oldLength - newLength);
            return true;
        }
        if (!vector.growByUninitialized(newLength - oldLength))
            return false;
        makeRangeGCSafe(oldLength);
        return true;
    }

    

    

    JS::MutableHandle<T> operator[](size_t i) {
        return JS::MutableHandle<T>::fromMarkedLocation(&vector[i]);
    }
    

    const T *begin() const { return vector.begin(); }
    

    
    

    

    

    friend void AutoGCRooter::trace(JSTracer *trc);

  private:
    void makeRangeGCSafe(size_t oldLength) {
        T *t = vector.begin() + oldLength;
        for (size_t i = oldLength; i < vector.length(); ++i, ++t)
            memset(t, 0, sizeof(T));
    }

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

template<class Key, class Value>
class AutoHashMapRooter : protected AutoGCRooter
{
  private:
    typedef js::HashMap<Key, Value> HashMapImpl;

  public:
    

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

template<class T>
class AutoHashSetRooter : protected AutoGCRooter
{
  private:
    typedef js::HashSet<T> HashSetImpl;

  public:
    explicit AutoHashSetRooter(JSContext *cx, ptrdiff_t tag
                               MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
      : AutoGCRooter(cx, tag), set(cx)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    typedef typename HashSetImpl::Lookup Lookup;
    HashSetImpl set;

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

class MOZ_STACK_CLASS AutoValueVector : public AutoVectorRooter<Value>
{
  public:
    explicit AutoValueVector(JSContext *cx
                             MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
        : AutoVectorRooter<Value>(cx, VALVECTOR)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

class AutoIdVector : public AutoVectorRooter<jsid>
{
  public:
    explicit AutoIdVector(JSContext *cx
                          MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
        : AutoVectorRooter<jsid>(cx, IDVECTOR)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

class AutoObjectVector : public AutoVectorRooter<JSObject *>
{
  public:
    explicit AutoObjectVector(JSContext *cx
                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
        : AutoVectorRooter<JSObject *>(cx, OBJVECTOR)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

class AutoFunctionVector : public AutoVectorRooter<JSFunction *>
{
  public:
    explicit AutoFunctionVector(JSContext *cx
                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    explicit AutoFunctionVector(js::ContextFriendFields *cx
                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
        : AutoVectorRooter<JSFunction *>(cx, FUNVECTOR)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

class AutoScriptVector : public AutoVectorRooter<JSScript *>
{
  public:
    explicit AutoScriptVector(JSContext *cx
                              MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
        : AutoVectorRooter<JSScript *>(cx, SCRIPTVECTOR)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

/*
 * Custom rooting behavior for internal and external clients.
 */
class JS_PUBLIC_API(CustomAutoRooter) : private AutoGCRooter
{
  public:
    template <typename CX>
    explicit CustomAutoRooter(CX *cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
      : AutoGCRooter(cx, CUSTOM)
    {
        MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    }

    friend void AutoGCRooter::trace(JSTracer *trc);

  protected:
    /* Supplied by derived class to trace roots. */
    virtual void trace(JSTracer *trc) = 0;

  private:
    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

/*
 * RootedGeneric<T> allows a class to instantiate its own Rooted type by
 * including the method:
 *
 *    void trace(JSTracer *trc);
 *
 * The trace() method must trace all of the class's fields.
 */
template <class T>
class RootedGeneric : private CustomAutoRooter
{
  public:
    

    

    
    

  private:
    

    T value;

    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

/* A handle to an array of rooted values. */
class HandleValueArray
{
    const size_t length_;
    const Value * const elements_;

    HandleValueArray(size_t len, const Value *elements) : length_(len), elements_(elements) {}

  public:
    

    MOZ_IMPLICIT HandleValueArray(const AutoValueVector& values)
      : length_(values.length()), elements_(values.begin()) {}

};

}  /* namespace JS */

/************************************************************************/

struct JSFreeOp {
  private:
    JSRuntime   *runtime_;

  protected:
    

  public:
    
};

/* Callbacks and their arguments. */

/************************************************************************/

typedef enum JSContextOp {
    JSCONTEXT_NEW,
    JSCONTEXT_DESTROY
} JSContextOp;

/*
 * The possible values for contextOp when the runtime calls the callback are:
 *   JSCONTEXT_NEW      JS_NewContext successfully created a new JSContext
 *                      instance. The callback can initialize the instance as
 *                      required. If the callback returns false, the instance
 *                      will be destroyed and JS_NewContext returns null. In
 *                      this case the callback is not called again.
 *   JSCONTEXT_DESTROY  One of JS_DestroyContext* methods is called. The
 *                      callback may perform its own cleanup and must always
 *                      return true.
 *   Any other value    For future compatibility the callback must do nothing
 *                      and return true in this case.
 */
typedef bool
(* JSContextCallback)(JSContext *cx, unsigned contextOp, void *data);

typedef enum JSGCStatus {
    JSGC_BEGIN,
    JSGC_END
} JSGCStatus;

typedef void
(* JSGCCallback)(JSRuntime *rt, JSGCStatus status, void *data);

typedef enum JSFinalizeStatus {
    /*
     * Called when preparing to sweep a group of compartments, before anything
     * has been swept.  The collector will not yield to the mutator before
     * calling the callback with JSFINALIZE_GROUP_END status.
     */
    JSFINALIZE_GROUP_START,

    /*
     * Called when preparing to sweep a group of compartments. Weak references
     * to unmarked things have been removed and things that are not swept
     * incrementally have been finalized at this point.  The collector may yield
     * to the mutator after this point.
     */
    JSFINALIZE_GROUP_END,

    /*
     * Called at the end of collection when everything has been swept.
     */
    JSFINALIZE_COLLECTION_END
} JSFinalizeStatus;

typedef void
(* JSFinalizeCallback)(JSFreeOp *fop, JSFinalizeStatus status, bool isCompartment, void *data);

typedef void
(* JSWeakPointerCallback)(JSRuntime *rt, void *data);

typedef bool
(* JSInterruptCallback)(JSContext *cx);

typedef void
(* JSErrorReporter)(JSContext *cx, const char *message, JSErrorReport *report);

/*
 * Possible exception types. These types are part of a JSErrorFormatString
 * structure. They define which error to throw in case of a runtime error.
 * JSEXN_NONE marks an unthrowable error.
 */
typedef enum JSExnType {
    JSEXN_NONE = -1,
      JSEXN_ERR,
        JSEXN_INTERNALERR,
        JSEXN_EVALERR,
        JSEXN_RANGEERR,
        JSEXN_REFERENCEERR,
        JSEXN_SYNTAXERR,
        JSEXN_TYPEERR,
        JSEXN_URIERR,
        JSEXN_LIMIT
} JSExnType;

typedef struct JSErrorFormatString {
    /* The error format string in ASCII. */
    const char *format;

    /* The number of arguments to expand in the formatted error message. */
    uint16_t argCount;

    /* One of the JSExnType constants above. */
    int16_t exnType;
} JSErrorFormatString;

typedef const JSErrorFormatString *
(* JSErrorCallback)(void *userRef, const unsigned errorNumber);

typedef bool
(* JSLocaleToUpperCase)(JSContext *cx, JS::HandleString src, JS::MutableHandleValue rval);

typedef bool
(* JSLocaleToLowerCase)(JSContext *cx, JS::HandleString src, JS::MutableHandleValue rval);

typedef bool
(* JSLocaleCompare)(JSContext *cx, JS::HandleString src1, JS::HandleString src2,
                    JS::MutableHandleValue rval);

typedef bool
(* JSLocaleToUnicode)(JSContext *cx, const char *src, JS::MutableHandleValue rval);
namespace JS {

// Container class for passing in script source buffers to the JS engine.  This
// not only groups the buffer and length values, it also provides a way to
// optionally pass ownership of the buffer to the JS engine without copying.
// Rules for use:
//
//  1) The data array must be allocated with js_malloc() or js_realloc() if
//     ownership is being granted to the SourceBufferHolder.
//  2) If ownership is not given to the SourceBufferHolder, then the memory
//     must be kept alive until the JS compilation is complete.
//  3) Any code calling SourceBufferHolder::take() must guarantee to keep the
//     memory alive until JS compilation completes.  Normally only the JS
//     engine should be calling take().
//
// Example use:
//
//    size_t length = 512;
//    char16_t* chars = static_cast<char16_t*>(js_malloc(sizeof(char16_t) * length));
//    JS::SourceBufferHolder srcBuf(chars, length, JS::SourceBufferHolder::GiveOwnership);
//    JS::Compile(cx, obj, options, srcBuf);
//
class MOZ_STACK_CLASS SourceBufferHolder MOZ_FINAL
{
  public:
    enum Ownership {
      NoOwnership,
      GiveOwnership
    };

    SourceBufferHolder(const char16_t *data, size_t dataLength, Ownership ownership)
      : data_(data),
        length_(dataLength),
        ownsChars_(ownership == GiveOwnership)
    {
        // Ensure that null buffers properly return an unowned, empty,
        // null-terminated string.
        static const char16_t NullChar_ = 0;
        if (!get()) {
            data_ = &NullChar_;
            length_ = 0;
            ownsChars_ = false;
        }
    }

    ~SourceBufferHolder() {
        if (ownsChars_)
            js_free(const_cast<char16_t *>(data_));
    }

    // Access the underlying source buffer without affecting ownership.
    const char16_t *get() const { return data_; }

    // Length of the source buffer in char16_t code units (not bytes)
    size_t length() const { return length_; }

    // Returns true if the SourceBufferHolder owns the buffer and will free
    // it upon destruction.  If true, it is legal to call take().
    bool ownsChars() const { return ownsChars_; }

    // Retrieve and take ownership of the underlying data buffer.  The caller
    // is now responsible for calling js_free() on the returned value, *but only
    // after JS script compilation has completed*.
    //
    SourceBufferHolder &operator=(SourceBufferHolder &) = delete;

    const char16_t *data_;
    size_t length_;
    bool ownsChars_;
};

} /* namespace JS */

/************************************************************************/

/* Property attributes, set in JSPropertySpec and passed to API functions.
 *
 * NB: The data structure in which some of these values are stored only uses
 *     a uint8_t to store the relevant information. Proceed with caution if
 *     trying to reorder or change the the first byte worth of flags.
 */
#define JSPROP_ENUMERATE        0x01    /* property is visible to for/in loop */
#define JSPROP_READONLY         0x02    /* not settable: assignment is no-op.
                                           This flag is only valid when neither
                                           JSPROP_GETTER nor JSPROP_SETTER is
                                           set. */
#define JSPROP_PERMANENT        0x04    /* property cannot be deleted */
#define JSPROP_PROPOP_ACCESSORS 0x08    /* Passed to JS_Define(UC)Property* and
                                           JS_DefineElement if getters/setters
                                           are JSGetterOp/JSSetterOp */
#define JSPROP_GETTER           0x10    /* property holds getter function */
#define JSPROP_SETTER           0x20    /* property holds setter function */
#define JSPROP_SHARED           0x40    /* don't allocate a value slot for this
                                           property; don't copy the property on
                                           set of the same-named property in an
                                           object that delegates to a prototype
 * Later calls to JS_CallOnce with the same JSCallOnceType object will be
 * suppressed.
 *
 * Equivalently: each distinct JSCallOnceType object will allow one JS_CallOnce
 * to invoke its JSInitCallback.
 */
extern JS_PUBLIC_API(bool)
JS_CallOnce(JSCallOnceType *once, JSInitCallback func);

/* Microseconds since the epoch, midnight, January 1, 1970 UTC. */
extern JS_PUBLIC_API(int64_t)
JS_Now(void);

/* Don't want to export data, so provide accessors for non-inline jsvals. */
;

;

;

extern JS_PUBLIC_API(jsval)
JS_GetEmptyStringValue(JSContext *cx);

;

struct CompartmentTimeStats {
    char compartmentName[1024];
    JSAddonId *addonId;
    JSCompartment *compartment;
    uint64_t time;  // microseconds
    uint64_t cpowTime; // microseconds
};
;

JS_PUBLIC_API(void)
JS_SetRuntimePrivate(JSRuntime *rt, void *data);

;

extern JS_PUBLIC_API(void)
JS_EndRequest(JSContext *cx);

namespace js {

;

;

} /* namespace js */

class JSAutoRequest
{
  public:
    
    

  protected:
    JSContext *mContext;
    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER

#if 0
  private:
    static void *operator new(size_t) CPP_THROW_NEW { return 0; }
    static void operator delete(void *, size_t) { }
#endif
# 1139 "../../dist/include/jsapi.h"
};

;

;

;

;

;

;

JS_PUBLIC_API(void)
JS_SetVersionForCompartment(JSCompartment *compartment, JSVersion version);

;

;

namespace JS {

class JS_PUBLIC_API(RuntimeOptions) {
  public:
    
    
    
    

  private:
    bool baseline_ : 1;
    bool ion_ : 1;
    bool asmJS_ : 1;
    bool nativeRegExp_ : 1;
    bool unboxedObjects_ : 1;
    bool werror_ : 1;
    bool strictMode_ : 1;
    bool extraWarnings_ : 1;
    bool varObjFix_ : 1;
};

JS_PUBLIC_API(RuntimeOptions &)
RuntimeOptionsRef(JSRuntime *rt);

JS_PUBLIC_API(RuntimeOptions &)
RuntimeOptionsRef(JSContext *cx);

class JS_PUBLIC_API(ContextOptions) {
  public:
    

    
    
    

    
    
    

    
    
    


  private:
    bool privateIsNSISupports_ : 1;
    bool dontReportUncaught_ : 1;
    // dontReportUncaught isn't respected by all JSAPI codepaths, particularly the
    // JS_ReportError* functions that eventually report the error even when dontReportUncaught is
    // set, if script is not running. We want a way to indicate that the embedder will always
    // handle any exceptions, and that SpiderMonkey should just leave them on the context. This is
    // the way we want to do all future error handling in Gecko - stealing the exception explicitly
    // from the context and handling it as per the situation. This will eventually become the
    // default and these 2 flags should go away.
    bool autoJSAPIOwnsErrorReporting_ : 1;
};

JS_PUBLIC_API(ContextOptions &)
ContextOptionsRef(JSContext *cx);

class JS_PUBLIC_API(AutoSaveContextOptions) {
  public:
    

    

  private:
    JSContext *cx_;
    JS::ContextOptions oldOptions_;
};

} /* namespace JS */

extern JS_PUBLIC_API(void)
JS_SetZoneUserData(JS::Zone *zone, void *data);

extern JS_PUBLIC_API(void *)
JS_GetZoneUserData(JS::Zone *zone);

extern JS_PUBLIC_API(bool)
JS_WrapObject(JSContext *cx, JS::MutableHandleObject objp);

extern JS_PUBLIC_API(bool)
JS_WrapValue(JSContext *cx, JS::MutableHandleValue vp);

;

;

/*
 * At any time, a JSContext has a current (possibly-nullptr) compartment.
 * Compartments are described in:
 *
 *   developer.mozilla.org/en-US/docs/SpiderMonkey/SpiderMonkey_compartments
 *
 * The current compartment of a context may be changed. The preferred way to do
 * this is with JSAutoCompartment:
 *
 *   void foo(JSContext *cx, JSObject *obj) {
 *     // in some compartment 'c'
 *     {
 *       JSAutoCompartment ac(cx, obj);  // constructor enters
 *       // in the compartment of 'obj'
 *     }                                 // destructor leaves
 *     // back in compartment 'c'
 * the corresponding JS_LeaveCompartment call.
 */

class JS_PUBLIC_API(JSAutoCompartment)
{
    JSContext *cx_;
    JSCompartment *oldCompartment_;
  public:
    JSAutoCompartment(JSContext *cx, JSObject *target);
    ;
    ~JSAutoCompartment();
};

class JS_PUBLIC_API(JSAutoNullableCompartment)
{
    JSContext *cx_;
    JSCompartment *oldCompartment_;
  public:
    ;
    ;
};

/* NB: This API is infallible; a nullptr return value does not indicate error. */
;

;

typedef void (*JSIterateCompartmentCallback)(JSRuntime *rt, void *data, JSCompartment *compartment);

/*
 * This function calls |compartmentCallback| on every compartment. Beware that
 * there is no guarantee that the compartment will survive after the callback
 * class name in obj if possible, defining the class's constructor and/or
 * prototype and storing true in *resolved.  If id does not name a standard
 * class or a top-level property induced by initializing a standard class,
 * store false in *resolved and just return true.  Return false on error,
 * as usual for bool result-typed API entry points.
 *
;

/*
 * May return nullptr, if |c| never had a global (e.g. the atoms compartment),
 * or if |c|'s global has been collected.
 */
;

namespace JS {

extern JS_PUBLIC_API(JSObject *)
CurrentGlobalOrNull(JSContext *cx);

}

/*
 * Initialize the 'Reflect' object on a global object.
 */
;

/*
 * Add various profiling-related functions as properties of the given object.
 * Defined in builtin/Profilers.cpp.
 */
;

/* Defined in vm/Debugger.cpp. */
;

#ifdef JS_HAS_CTYPES
/*
 * Initialize the 'ctypes' object on a global variable 'obj'. The 'ctypes'
 * object will be sealed.
 */
;

/*
 * Convert a unicode string 'source' of length 'slen' to the platform native
 * charset, returning a null-terminated string allocated with JS_malloc. On
 * failure, this function should report an error.
 */
typedef char *
 * may safely be altered after calling this function and without having
 * to call this function again.
 */
;
#endif
# 1660 "../../dist/include/jsapi.h"

;

;

/*
 * A wrapper for js_free(p) that may delay js_free(p) invocation as a
 * performance optimization.
 * cx may be nullptr.
 */
;

/*

/*
 * Weak pointers and garbage collection
 *
 * Weak pointers are by their nature not marked as part of garbage collection,
 * but they may need to be updated in two cases after a GC:
 *
 *  1) Their referent was found not to be live and is about to be finalized
 *  2) Their referent has been moved by a compacting GC
 *
 * To handle this, any part of the system that maintain weak pointers to
 * JavaScript GC things must register a callback with
 * JS_(Add,Remove)WeakPointerCallback().  This callback must then call
 * JS_UpdateWeakPointerAfterGC() on all weak pointers it knows about.
 *
 * The argument to JS_UpdateWeakPointerAfterGC() is an in-out param.  If the
 * referent is about to be finalized the pointer will be set to null.  If the
 * referent has been moved then the pointer will be updated to point to the new
 * location.
 *
 * Callers of this method are responsible for updating any state that is
 * dependent on the object's address. For example, if the object's address is
 * used as a key in a hashtable, then the object must be removed and
 * re-inserted with the correct hash.
 */

;

;

;

;

typedef enum JSGCParamKey {
    /* Maximum nominal heap before last ditch GC. */
    JSGC_MAX_BYTES          = 0,

    /* Number of JS_malloc bytes before last ditch GC. */
    JSGC_MAX_MALLOC_BYTES   = 1,

    /* Amount of bytes allocated by the GC. */
    JSGC_BYTES = 3,

    /* Number of times GC has been invoked. Includes both major and minor GC. */

    JSGC_DYNAMIC_MARK_SLICE = 18,

    /* Lower limit after which we limit the heap growth. */
    JSGC_ALLOCATION_THRESHOLD = 19,

    /*
     * We decommit memory lazily. If more than this number of megabytes is
     * available to be decommitted, then JS_MaybeGC will trigger a shrinking GC
     * to decommit it.
     */
    JSGC_DECOMMIT_THRESHOLD = 20,

    /*
     * We try to keep at least this many unused chunks in the free chunk pool at
     * all times, even after a shrinking GC.
     */
    JSGC_MIN_EMPTY_CHUNK_COUNT = 21,

    /* We never keep more than this many unused chunks in the free chunk pool. */
    JSGC_MAX_EMPTY_CHUNK_COUNT = 22,

    /* Whether compacting GC is enabled. */
    JSGC_COMPACTING_ENABLED = 23
} JSGCParamKey;

;

;

;

;

;

/*
 * Create a new JSString whose chars member refers to external memory, i.e.,
 * memory requiring application-specific finalization.
 */
extern JS_PUBLIC_API(JSString *)
JS_NewExternalString(JSContext *cx, const char16_t *chars, size_t length,
                     const JSStringFinalizer *fin);

/*
 * Return whether 'str' was created with JS_NewExternalString or
 * JS_NewExternalStringWithClosure.
 */
extern JS_PUBLIC_API(bool)
JS_IsExternalString(JSString *str);

/*
 * Return the 'fin' arg passed to JS_NewExternalString.
 */
extern JS_PUBLIC_API(const JSStringFinalizer *)
JS_GetExternalStringFinalizer(JSString *str);

/*
 * Set the size of the native stack that should not be exceed. To disable
 * stack size checking pass 0.
 *
 * SpiderMonkey allows for a distinction between system code (such as GCs, which
 * may incidentally be triggered by script but are not strictly performed on
 * behalf of such script), trusted script (as determined by JS_SetTrustedPrincipals),
 * and untrusted script. Each kind of code may have a different stack quota,
 * allowing embedders to keep higher-priority machinery running in the face of
 * scripted stack exhaustion by something else.
 *
 * The stack quotas for each kind of code should be monotonically descending,
 * and may be specified with this function. If 0 is passed for a given kind
 * of code, it defaults to the value of the next-highest-priority kind.
 *
 * This function may only be called immediately after the runtime is initialized
 * and before any code is executed and/or interrupts requested.
 */
;

/************************************************************************/

extern JS_PUBLIC_API(int)
JS_IdArrayLength(JSContext *cx, JSIdArray *ida);

extern JS_PUBLIC_API(jsid)
JS_IdArrayGet(JSContext *cx, JSIdArray *ida, unsigned index);

extern JS_PUBLIC_API(void)
JS_DestroyIdArray(JSContext *cx, JSIdArray *ida);

namespace JS {

class AutoIdArray : private AutoGCRooter
{
  public:
    
    
    
    AutoIdArray(AutoIdArray &ida) = delete;
    void operator=(AutoIdArray &ida) = delete;
};

} /* namespace JS */

extern JS_PUBLIC_API(bool)
JS_ValueToId(JSContext *cx, JS::HandleValue v, JS::MutableHandleId idp);

extern JS_PUBLIC_API(bool)
JS_StringToId(JSContext *cx, JS::HandleString s, JS::MutableHandleId idp);

extern JS_PUBLIC_API(bool)
JS_IdToValue(JSContext *cx, jsid id, JS::MutableHandle<JS::Value> vp);

/*
 * Invoke the [[DefaultValue]] hook (see ES5 8.6.2) with the provided hint on
 * the specified object, computing a primitive default value for the object.
 * The hint must be JSTYPE_STRING, JSTYPE_NUMBER, or JSTYPE_VOID (no hint).  On
 * success the resulting value is stored in *vp.
 */
extern JS_PUBLIC_API(bool)
JS_DefaultValue(JSContext *cx, JS::Handle<JSObject*> obj, JSType hint,
                JS::MutableHandle<JS::Value> vp);

extern JS_PUBLIC_API(bool)
JS_PropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
                JS::MutableHandleValue vp);

extern JS_PUBLIC_API(bool)
JS_StrictPropertyStub(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
                      JS::MutableHandleValue vp, JS::ObjectOpResult &result);

template<typename T>
struct JSConstScalarSpec {
    const char *name;
    T val;
};

typedef JSConstScalarSpec<double> JSConstDoubleSpec;
typedef JSConstScalarSpec<int32_t> JSConstIntegerSpec;

struct JSJitInfo;

/*
 * Wrapper to relace JSNative for JSPropertySpecs and JSFunctionSpecs. This will
 * allow us to pass one JSJitInfo per function with the property/function spec,
 * without additional field overhead.
 */
typedef struct JSNativeWrapper {
    JSNative        op;
    const JSJitInfo *info;
} JSNativeWrapper;

/*
 * Macro static initializers which make it easy to pass no JSJitInfo as part of a
 * JSPropertySpec or JSFunctionSpec.
 */
#define JSNATIVE_WRAPPER(native) { {native, nullptr} }

/*
 * To define an array element rather than a named property member, cast the
 * element's index to (const char *) and initialize name with it, and set the
 * JSPROP_INDEX bit in flags.
 */
struct JSPropertySpec {
    struct SelfHostedWrapper {
        void       *unused;
        const char *funname;
    };

    const char                  *name;
    uint8_t                     flags;
    union {
        JSNativeWrapper     native;
        SelfHostedWrapper   selfHosted;
    } getter;
    union {
        JSNativeWrapper           native;
        SelfHostedWrapper         selfHosted;
    } setter;

    bool isSelfHosted() const {
#ifdef DEBUG
        // Verify that our accessors match our JSPROP_GETTER flag.
        if (flags & JSPROP_GETTER)
            checkAccessorsAreSelfHosted();
        else
            checkAccessorsAreNative();
#endif
# 2060 "../../dist/include/jsapi.h"
        return (flags & JSPROP_GETTER);
    }

    static_assert(sizeof(SelfHostedWrapper) == sizeof(JSNativeWrapper),
                  "JSPropertySpec::getter/setter must be compact");
    static_assert(offsetof(SelfHostedWrapper, funname) == offsetof(JSNativeWrapper, info),
                  "JS_SELF_HOSTED* macros below require that "
                  "SelfHostedWrapper::funname overlay "
                  "JSNativeWrapper::info");
private:
    void checkAccessorsAreNative() const {
        MOZ_ASSERT(getter.native.op);
        // We may not have a setter at all.  So all we can assert here, for the
        // native case is that if we have a jitinfo for the setter then we have
        // a setter op too.  This is good enough to make sure we don't have a
        // SelfHostedWrapper for the setter.
        MOZ_ASSERT_IF(setter.native.info, setter.native.op);
    }

    void checkAccessorsAreSelfHosted() const {
        MOZ_ASSERT(!getter.selfHosted.unused);
        MOZ_ASSERT(!setter.selfHosted.unused);
    }
};

namespace JS {
namespace detail {

/* NEVER DEFINED, DON'T USE.  For use by JS_CAST_NATIVE_TO only. */
inline int CheckIsNative(JSNative native);

/* NEVER DEFINED, DON'T USE.  For use by JS_CAST_STRING_TO only. */
template<size_t N>
inline int
CheckIsCharacterLiteral(const char (&arr)[N]);

/* NEVER DEFINED, DON'T USE.  For use by JS_PROPERTYOP_GETTER only. */
inline int CheckIsGetterOp(JSGetterOp op);

/* NEVER DEFINED, DON'T USE.  For use by JS_PROPERTYOP_SETTER only. */
;


} // namespace detail
} // namespace JS

#define JS_CAST_NATIVE_TO(v, To) \
  (static_cast<void>(sizeof(JS::detail::CheckIsNative(v))), \
   reinterpret_cast<To>(v))

#define JS_CAST_STRING_TO(s, To) \
  (static_cast<void>(sizeof(JS::detail::CheckIsCharacterLiteral(s))), \
   reinterpret_cast<To>(s))
;

;

;

;

;

namespace JS {

enum ZoneSpecifier {
    FreshZone = 0,
    SystemZone = 1
};

class JS_PUBLIC_API(CompartmentOptions)
{
  public:
    class Override {
      public:
        Override() : mode_(Default) {}

        

        

        

      private:
        enum Mode {
            Default,
            ForceTrue,
            ForceFalse
        };

        Mode mode_;
    };

    explicit CompartmentOptions()
      : version_(JSVERSION_UNKNOWN)
      , invisibleToDebugger_(false)
      , mergeable_(false)
      , discardSource_(false)
      , cloneSingletons_(false)
      , traceGlobal_(nullptr)
      , singletonsAsTemplates_(true)
      , addonId_(nullptr)
      , preserveJitCode_(false)
    {
        zone_.spec = JS::FreshZone;
    }

    
    

    // Certain scopes (i.e. XBL compilation scopes) are implementation details
    // of the embedding, and references to them should never leak out to script.
    // This flag causes the this compartment to skip firing onNewGlobalObject
    // and makes addDebuggee a no-op for this global.
    
    

    // Compartments used for off-thread compilation have their contents merged
    // into a target compartment when the compilation is finished. This is only
    // allowed if this flag is set.  The invisibleToDebugger flag must also be
    // set for such compartments.
    
    

  private:
    JSVersion version_;
    bool invisibleToDebugger_;
    bool mergeable_;
    bool discardSource_;
    bool cloneSingletons_;
    Override extraWarningsOverride_;
    union {
        ZoneSpecifier spec;
        void *pointer; // js::Zone* is not exposed in the API.
    } zone_;
    JSTraceOp traceGlobal_;

    // To XDR singletons, we need to ensure that all singletons are all used as
    // templates, by making JSOP_OBJECT return a clone of the JSScript
    // singleton, instead of returning the value which is baked in the JSScript.
    bool singletonsAsTemplates_;

    JSAddonId *addonId_;
    bool preserveJitCode_;
};

JS_PUBLIC_API(CompartmentOptions &)
CompartmentOptionsRef(JSCompartment *compartment);

// If callers have no additional state on the global to set up, they may pass
// |FireOnNewGlobalHook| to JS_NewGlobalObject, which causes that function to
// fire the hook as its final act before returning. Otherwise, callers should
// pass |DontFireOnNewGlobalHook|, which means that they are responsible for
// invoking JS_FireOnNewGlobalObject upon successfully creating the global. If
// an error occurs and the operation aborts, callers should skip firing the
// hook. But otherwise, callers must take care to fire the hook exactly once
// before compiling any script in the global's scope (we have assertions in
// place to enforce this). This lets us be sure that debugger clients never miss
// breakpoints.
enum OnNewGlobalHookOption {
    FireOnNewGlobalHook,
    DontFireOnNewGlobalHook
};

} /* namespace JS */

;
/*
 * Freeze obj, and all objects it refers to, recursively. This will not recurse
 * through non-extensible objects, on the assumption that those are already
 * deep-frozen.
 */
;

/*
 * Freezes an object; see ES5's Object.freeze(obj) method.
 */
;

/*
 * Attempt to make |obj| non-extensible.  If an error occurs while making the
 * attempt, return false (with a pending exception set, depending upon the
 * nature of the error).  If no error occurs, return true with |result| set
 * to indicate whether the attempt successfully set the [[Extensible]] property
 * to false.
 */
;

;


/*** Property descriptors ************************************************************************/

struct JSPropertyDescriptor {
    JSObject *obj;
    unsigned attrs;
    JSGetterOp getter;
    JSSetterOp setter;
    JS::Value value;

    

    ;

    
};

namespace JS {

template <typename Outer>
class PropertyDescriptorOperations
{
    
    

    

    
    
    
    
    
    
    
};

template <typename Outer>
class MutablePropertyDescriptorOperations : public PropertyDescriptorOperations<Outer>
{

    
    
    
    

    
    
};

} /* namespace JS */

namespace js {

template <>
struct GCMethods<JSPropertyDescriptor> {
    
    
};

template <>
class RootedBase<JSPropertyDescriptor>
  : public JS::MutablePropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >
{
    friend class JS::PropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >;
    friend class JS::MutablePropertyDescriptorOperations<JS::Rooted<JSPropertyDescriptor> >;
    
    
};

template <>
class HandleBase<JSPropertyDescriptor>
  : public JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >
{
    friend class JS::PropertyDescriptorOperations<JS::Handle<JSPropertyDescriptor> >;
    
};

template <>
class MutableHandleBase<JSPropertyDescriptor>
  : public JS::MutablePropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >
{
    friend class JS::PropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >;
    friend class JS::MutablePropertyDescriptorOperations<JS::MutableHandle<JSPropertyDescriptor> >;
    
    
};

} /* namespace js */

namespace JS {

;

} // namespace JS


/*** [[DefineOwnProperty]] and variations ********************************************************/

;

;

;

;

;

;

;

extern JS_PUBLIC_API(JSObject *)
JS_NewArrayObject(JSContext *cx, const JS::HandleValueArray& contents);

;

;

;

extern JS_PUBLIC_API(bool)
JS_GetArrayLength(JSContext *cx, JS::Handle<JSObject*> obj, uint32_t *lengthp);

;

;

;

;

;

;

;

;

;

extern JS_PUBLIC_API(bool)
JS_GetElement(JSContext *cx, JS::HandleObject obj, uint32_t index, JS::MutableHandleValue vp);

;

;

;

;

;

;

;

;

;


/*
 * API for determining callability and constructability. This does the right
 * thing for proxies.
JS_ObjectIsFunction(JSContext *cx, JSObject *obj);

extern JS_PUBLIC_API(bool)
JS_IsNativeFunction(JSObject *funobj, JSNative call);

/* Return whether the given function is a valid constructor. */
extern JS_PUBLIC_API(bool)
JS_IsConstructor(JSFunction *fun);

/*
 * Bind the given callable to use the given object as "this".
 *
 * If |callable| is not callable, will throw and return nullptr.
 */
extern JS_PUBLIC_API(JSObject*)
JS_BindCallable(JSContext *cx, JS::Handle<JSObject*> callable, JS::Handle<JSObject*> newThis);

// This enum is used to select if properties with JSPROP_DEFINE_LATE flag
// should be defined on the object.
// Normal JSAPI consumers probably always want DefineAllProperties here.
enum PropertyDefinitionBehavior {
    DefineAllProperties,
    OnlyDefineLateProperties,
    DontDefineLateProperties
};

extern JS_PUBLIC_API(bool)
JS_DefineFunctions(JSContext *cx, JS::Handle<JSObject*> obj, const JSFunctionSpec *fs,
                   PropertyDefinitionBehavior behavior = DefineAllProperties);

extern JS_PUBLIC_API(JSFunction *)
JS_DefineFunction(JSContext *cx, JS::Handle<JSObject*> obj, const char *name, JSNative call,
                  unsigned nargs, unsigned attrs);

extern JS_PUBLIC_API(JSFunction *)
JS_DefineUCFunction(JSContext *cx, JS::Handle<JSObject*> obj,
                    const char16_t *name, size_t namelen, JSNative call,
                    unsigned nargs, unsigned attrs);

;

namespace JS {

/*
 * Clone a top-level function into cx's global. This function will dynamically
 * fail if funobj was lexically nested inside some other function.
 */
;

/*
 * As above, but providing an explicit scope chain.  scopeChain must not include
 * the global object on it; that's implicit.  It needs to contain the other
 * objects that should end up on the clone's scope chain.
 */
;

} // namespace JS

/*
 * Given a buffer, return false if the buffer might become a valid
 * javascript statement with the addition of more lines.  Otherwise return
 * true.  The intent is to support interactive compilation - accumulate
 * lines in a buffer until JS_BufferIsCompilableUnit is true, then pass it to
 * the compiler.
 */
;

/*
 * |script| will always be set. On failure, it will be set to nullptr.
 */
;

/*
 * |script| will always be set. On failure, it will be set to nullptr.
 */
;

;

;

extern JS_PUBLIC_API(unsigned)
JS_GetScriptBaseLineNumber(JSContext *cx, JSScript *script);

extern JS_PUBLIC_API(JSScript *)
JS_GetFunctionScript(JSContext *cx, JS::HandleFunction fun);

namespace JS {

/* Options for JavaScript compilation. */

/*
 * In the most common use case, a CompileOptions instance is allocated on the
 * stack, and holds non-owning references to non-POD option values: strings;
 * principals; objects; and so on. The code declaring the instance guarantees
 * that such option values will outlive the CompileOptions itself: objects are
 * Use this in code that only needs to access compilation options created
 * elsewhere, like the compiler. Don't instantiate this class (the constructor
 * is protected anyway); instead, create instances only of the derived classes:
 * CompileOptions and OwningCompileOptions.
 */
class JS_FRIEND_API(ReadOnlyCompileOptions)
{
    friend class CompileOptions;

  protected:
    // The Web Platform allows scripts to be loaded from arbitrary cross-origin
    // sources. This allows an attack by which a malicious website loads a
    // sensitive file (say, a bank statement) cross-origin (using the user's
    // cookies), and sniffs the generated syntax errors (via a window.onerror
    // handler) for juicy morsels of its contents.
    //
    // To counter this attack, HTML5 specifies that script errors should be
    // sanitized ("muted") when the script is not same-origin with the global
    // for which it is loaded. Callers should set this flag for cross-origin
    // scripts, and it will be propagated appropriately to child scripts and
    // passed back in JSErrorReports.
    bool mutedErrors_;
    const char *filename_;
    const char *introducerFilename_;
    const char16_t *sourceMapURL_;

    // This constructor leaves 'version' set to JSVERSION_UNKNOWN. The structure
    // is unusable until that's set to something more specific; the derived
    // classes' constructors take care of that, in ways appropriate to their
    // purpose.
    ReadOnlyCompileOptions()
      : mutedErrors_(false),
        asmJSOption(false),
        forceAsync(false),
        installedFile(false),
        sourceIsLazy(false),
        introductionType(nullptr),
        introductionLineno(0),
        introductionOffset(0),
        hasIntroductionInfo(false)
    { }

    // Set all POD options (those not requiring reference counts, copies,
    // rooting, or other hand-holding) to their values in |rhs|.
    void copyPODOptions(const ReadOnlyCompileOptions &rhs);

  public:
    // Read-only accessors for non-POD options. The proper way to set these
    bool forEval;
    bool noScriptRval;
    bool selfHostingMode;
    bool canLazilyParse;
    bool strictOption;
    bool extraWarningsOption;
    bool werrorOption;
    bool asmJSOption;
    bool forceAsync;
    bool installedFile;  // 'true' iff pre-compiling js file in packaged app
    bool sourceIsLazy;

    // |introductionType| is a statically allocated C string:
    // one of "eval", "Function", or "GeneratorFunction".
    const char *introductionType;
    unsigned introductionLineno;
    uint32_t introductionOffset;
    bool hasIntroductionInfo;

  private:
    static JSObject * const nullObjectPtr;
    void operator=(const ReadOnlyCompileOptions &) = delete;
};

/*
 * Compilation options, with dynamic lifetime. An instance of this type
 * makes a copy of / holds / roots all dynamically allocated resources
 * (principals; elements; strings) that it refers to. Its destructor frees
 * / drops / unroots them. This is heavier than CompileOptions, below, but
 * unlike CompileOptions, it can outlive any given stack frame.
 *
 * Note that this *roots* any JS values it refers to - they're live
 * unconditionally. Thus, instances of this type can't be owned, directly
 * or indirectly, by a JavaScript object: if any value that this roots ever
 * comes to refer to the object that owns this, then the whole cycle, and
 * anything else it entrains, will never be freed.
 */
class JS_FRIEND_API(OwningCompileOptions) : public ReadOnlyCompileOptions
{
    JSRuntime *runtime;
    PersistentRootedObject elementRoot;
    PersistentRootedString elementAttributeNameRoot;
    PersistentRootedScript introductionScriptRoot;

  public:
    // A minimal constructor, for use with OwningCompileOptions::copy. This
    // leaves |this.version| set to JSVERSION_UNKNOWN; the instance
    // shouldn't be used until we've set that to something real (as |copy|
    // will).
    explicit OwningCompileOptions(JSContext *cx);
    ~OwningCompileOptions();

    
    
    

    // Set this to a copy of |rhs|. Return false on OOM.
    ;

    /* These setters make copies of their string arguments, and are fallible. */
    ;
    ;
    ;
    bool setIntroducerFilename(JSContext *cx, const char *s);
};

/*
 * Compilation options stored on the stack. An instance of this type
 * simply holds references to dynamically allocated resources (element;
 * filename; source map URL) that are owned by something else. If you
 * create an instance of this type, it's up to you to guarantee that
 * everything you store in it will outlive it.
 */
class MOZ_STACK_CLASS JS_FRIEND_API(CompileOptions) : public ReadOnlyCompileOptions
{
    RootedObject elementRoot;
    RootedString elementAttributeNameRoot;
    RootedScript introductionScriptRoot;

  public:
};

/*
 * |script| will always be set. On failure, it will be set to nullptr.
 */
extern JS_PUBLIC_API(bool)
Compile(JSContext *cx, JS::HandleObject obj, const ReadOnlyCompileOptions &options,
        SourceBufferHolder &srcBuf, JS::MutableHandleScript script);

extern JS_PUBLIC_API(bool)
Compile(JSContext *cx, JS::HandleObject obj, const ReadOnlyCompileOptions &options,
        const char *bytes, size_t length, JS::MutableHandleScript script);

extern JS_PUBLIC_API(bool)
Compile(JSContext *cx, JS::HandleObject obj, const ReadOnlyCompileOptions &options,
        const char16_t *chars, size_t length, JS::MutableHandleScript script);






;



;

} /* namespace JS */

/*
 * These functions allow setting an interrupt callback that will be called

;

/*
 * Saving and restoring frame chains.
 *
 * These two functions are used to set aside cx's call stack while that stack
 * is inactive. After a call to JS_SaveFrameChain, it looks as if there is no
 * code running on cx. Before calling JS_RestoreFrameChain, cx's call stack
 * must be balanced and all nested calls to JS_SaveFrameChain must have had
 * matching JS_RestoreFrameChain calls.
 *
 * JS_SaveFrameChain deals with cx not having any code running on it.
 */
;

;

namespace JS {

/*
 * This class can be used to store a pointer to the youngest frame of a saved
 * stack in the specified JSContext. This reference will be picked up by any new
 * calls performed until the class is destroyed, with the specified asyncCause,
 * that must not be empty.
 *
 * Any stack capture initiated during these new calls will go through the async
 * stack instead of the current stack.
 *
 * Capturing the stack before a new call is performed will not be affected.
 *
 * The provided chain of SavedFrame objects can live in any compartment,
 * although it will be copied to the compartment where the stack is captured.
 */
class MOZ_STACK_CLASS JS_PUBLIC_API(AutoSetAsyncStackForNewCalls)
{
    JSContext *cx;
    RootedObject oldAsyncStack;
    RootedString oldAsyncCause;

  public:
    // The stack parameter cannot be null by design, because it would be
    // ambiguous whether that would clear any scheduled async stack and make the
    // normal stack reappear in the new call, or just keep the async stack
    // already scheduled for the new call, if any.
    ;
    ;
};

}

/************************************************************************/

/*
 * Strings.
 *
 * NB: JS_NewUCString takes ownership of bytes on success, avoiding a copy;
 * but on error (signified by null return), it leaves chars owned by the
 * caller. So the caller must free bytes in the error case, if it has no use
 * for them. In contrast, all the JS_New*StringCopy* functions do not take
 * ownership of the character memory passed to them -- they copy it.
 */
;


class JSAutoByteString
{
  public:
    

    

    

    /* Take ownership of the given byte array. */
    

    

    ;
    ;
    ;
};

namespace JS {

;

;

;

} // namespace JS

/************************************************************************/
/*
 * Symbols
 */

namespace JS {

/*
 * Create a new Symbol with the given description. This function never returns
 * a Symbol that is in the Runtime-wide symbol registry.
 *
 * If description is null, the new Symbol's [[Description]] attribute is
 * undefined.
 */
JS_PUBLIC_API(Symbol *)
NewSymbol(JSContext *cx, HandleString description);

/*
GetSymbolDescription(HandleSymbol symbol);

/* Well-known symbols. */
enum class SymbolCode : uint32_t {
    iterator,                       // well-known Symbol.iterator
    InSymbolRegistry = 0xfffffffe,  // created by Symbol.for() or JS::GetSymbolFor()
    UniqueSymbol = 0xffffffff       // created by Symbol() or JS::NewSymbol()
};

/* For use in loops that iterate over the well-known symbols. */
const size_t WellKnownSymbolLimit = 1;

/*
 * Return the SymbolCode telling what sort of symbol `symbol` is.
 *
 * A symbol's SymbolCode never changes once it is created.
 */


JS_PUBLIC_API(bool)
PropertySpecNameEqualsId(const char *name, HandleId id);

/*
 * Create a jsid that does not need to be marked for GC.
 *
 * 'name' is a JSPropertySpec::name or JSFunctionSpec::name value. The
 * resulting jsid, on success, is either an interned string or a well-known
 * symbol; either way it is immune to GC so there is no need to visit *idp
 * during GC marking.
 */
JS_PUBLIC_API(bool)
PropertySpecNameToPermanentId(JSContext *cx, const char *name, jsid *idp);

} /* namespace JS */

/************************************************************************/
/*
 * JSON functions
 */
typedef bool (* JSONWriteCallback)(const char16_t *buf, uint32_t len, void *data);

/*
 * JSON.stringify as specified by ES5.
 */
JS_PUBLIC_API(bool)
JS_Stringify(JSContext *cx, JS::MutableHandleValue value, JS::HandleObject replacer,
             JS::HandleValue space, JSONWriteCallback callback, void *data);


/*
 * Return the address of the current locale callbacks struct, which may
 * be nullptr.
 */
;

/************************************************************************/

/*
 * Error reporting.
 */

/*
 * Report an exception represented by the sprintf-like conversion of format
 * and its arguments.  This exception message string is passed to a pre-set

/*
 * Complain when out of memory.
 */
extern JS_PUBLIC_API(void)
JS_ReportOutOfMemory(JSContext *cx);

/*
 * Complain when an allocation size overflows the maximum supported limit.
 */
;

class JSErrorReport
{
  public:
    

    const char      *filename;      /* source file name, URL, etc., or null */
    unsigned        lineno;         /* source line number */
    unsigned        column;         /* zero-based column index in line */
    bool            isMuted;        /* See the comment in ReadOnlyCompileOptions. */
    const char      *linebuf;       /* offending source line without final \n */
    const char      *tokenptr;      /* pointer to error token in linebuf */
    const char16_t  *uclinebuf;     /* unicode (original) line buffer */
    const char16_t  *uctokenptr;    /* unicode (original) token pointer */
    unsigned        flags;          /* error/warning, etc. */
    unsigned        errorNumber;    /* the error number, e.g. see js.msg */
    const char16_t  *ucmessage;     /* the (default) error message */
    const char16_t  **messageArgs;  /* arguments for the error message */
    int16_t         exnType;        /* One of the JSExnType constants */
};


namespace JS {

;

/************************************************************************/

/*
 * Weak Maps.
 */

;

;

;
;

;

;

;

} /* namespace JS */

/*
 * Dates.
 */

;

;

/*
 * Infallible predicate to test whether obj is a date object.
 */
extern JS_PUBLIC_API(bool)
JS_ObjectIsDate(JSContext *cx, JS::HandleObject obj);

/*
 * Clears the cache of calculated local time from each Date object.
 * Call to propagate a system timezone change.
 */
;

/************************************************************************/

;

/* RegExp interface for clients without a global object. */

;

;

;

extern JS_PUBLIC_API(bool)
JS_ObjectIsRegExp(JSContext *cx, JS::HandleObject obj);

;

;

/************************************************************************/

extern JS_PUBLIC_API(bool)
JS_IsExceptionPending(JSContext *cx);

;

;

extern JS_PUBLIC_API(void)
JS_ClearPendingException(JSContext *cx);

;

namespace JS {

/*
 * Save and later restore the current exception state of a given JSContext.
 * This is useful for implementing behavior in C++ that's like try/catch
 * or try/finally in JS.
 *
 * Typical usage:
 *
 *     bool ok = JS::Evaluate(cx, ...);
 *     AutoSaveExceptionState savedExc(cx);
 *     ... cleanup that might re-enter JS ...
 *     return ok;
 */
class JS_PUBLIC_API(AutoSaveExceptionState)
{
  private:
    JSContext *context;
    bool wasPropagatingForcedReturn;
    bool wasOverRecursed;
    bool wasThrowing;
    RootedValue exceptionValue;

  public:
    /*
     * Take a snapshot of cx's current exception state. Then clear any current
     * pending exception in cx.
     */
    ;

    /*
     * If neither drop() nor restore() was called, restore the exception
     * state only if no exception is currently pending on cx.
     */
    ;

    /*
     * Discard any stored exception state.
     * If this is called, the destructor is a no-op.
     */
    

    /*
     * Replace cx's exception state with the stored exception state. Then
     * discard the stored exception state. If this is called, the
     * destructor is a no-op.
     */
    ;
};

} /* namespace JS */

/* Deprecated API. Use AutoSaveExceptionState instead. */
;

;

;

/*
 * If the given object is an exception object, the exception will have (or be
 * able to lazily create) an error report struct, and this function will return
 * the address of that struct.  Otherwise, it returns nullptr. The lifetime
 * of the error report struct that might be returned is the same as the
 * lifetime of the exception object.
 * |chars| may not be an index.
 */
extern JS_PUBLIC_API(bool)
JS_CharsToId(JSContext* cx, JS::TwoByteChars chars, JS::MutableHandleId);

/*
 *  Test if the given string is a valid ECMAScript identifier
 */
extern JS_PUBLIC_API(bool)
JS_IsIdentifier(JSContext *cx, JS::HandleString str, bool *isIdentifier);

/*
 * Test whether the given chars + length are a valid ECMAScript identifier.
 * This version is infallible, so just returns whether the chars are an
 * identifier.
 */
extern JS_PUBLIC_API(bool)
JS_IsIdentifier(const char16_t *chars, size_t length);

namespace JS {

/*
 * AutoFilename encapsulates a pointer to a C-string and keeps the C-string
 * alive for as long as the associated AutoFilename object is alive.
 * calculations, by hiding the scripted caller in the JS engine and pushing data
 * onto a separate stack, which it inspects when DescribeScriptedCaller returns
 * null.
 *
 * We maintain a counter on each activation record. Add() increments the counter
 * of the topmost activation, and Remove() decrements it. The count may never
 * drop below zero, and must always be exactly zero when the activation is
 * popped from the stack.
 */
extern JS_PUBLIC_API(void)
HideScriptedCaller(JSContext *cx);

extern JS_PUBLIC_API(void)
UnhideScriptedCaller(JSContext *cx);

class AutoHideScriptedCaller
{
  public:
    
    

  protected:
    JSContext *mContext;
    MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

} /* namespace JS */

/*
 * Encode/Decode interpreted scripts and functions to/from memory.
 */

;

;

;

extern JS_PUBLIC_API(JSObject *)
JS_DecodeInterpretedFunction(JSContext *cx, const void *data, uint32_t length);

namespace JS {

/*
 * This callback represents a request by the JS engine to open for reading the
 * existing cache entry for the given global and char range that may contain a
 * module. If a cache entry exists, the callback shall return 'true' and return
 * the size, base address and an opaque file handle as outparams. If the
 * callback returns 'true', the JS engine guarantees a call to
 * CloseAsmJSCacheEntryForReadOp, passing the same base address, size and
 * handle.
 */
typedef bool
(* OpenAsmJSCacheEntryForReadOp)(HandleObject global, const char16_t *begin, const char16_t *limit,
                                 size_t *size, const uint8_t **memory, intptr_t *handle);
typedef void
(* CloseAsmJSCacheEntryForReadOp)(size_t size, const uint8_t *memory, intptr_t handle);

/* The list of reasons why an asm.js module may not be stored in the cache. */
enum AsmJSCacheResult
{
    AsmJSCache_MIN,
    AsmJSCache_Success = AsmJSCache_MIN,
    AsmJSCache_ModuleTooSmall,
    AsmJSCache_SynchronousScript,
    AsmJSCache_QuotaExceeded,
    AsmJSCache_Disabled_Internal,
    AsmJSCache_Disabled_ShellFlags,
    AsmJSCache_Disabled_JitInspector,
    AsmJSCache_InternalError,
    AsmJSCache_LIMIT
};
typedef AsmJSCacheResult
(* OpenAsmJSCacheEntryForWriteOp)(HandleObject global, bool installed,
                                  const char16_t *begin, const char16_t *end,
                                  size_t size, uint8_t **memory, intptr_t *handle);
typedef void
(* CloseAsmJSCacheEntryForWriteOp)(size_t size, uint8_t *memory, intptr_t handle);

typedef js::Vector<char, 0, js::SystemAllocPolicy> BuildIdCharVector;

// Return the buildId (represented as a sequence of characters) associated with
// the currently-executing build. If the JS engine is embedded such that a
// single cache entry can be observed by different compiled versions of the JS
// engine, it is critical that the buildId shall change for each new build of
// the JS engine.

typedef bool
(* BuildIdOp)(BuildIdCharVector *buildId);

struct AsmJSCacheOps
{
    OpenAsmJSCacheEntryForReadOp openEntryForRead;
    CloseAsmJSCacheEntryForReadOp closeEntryForRead;
    OpenAsmJSCacheEntryForWriteOp openEntryForWrite;
    CloseAsmJSCacheEntryForWriteOp closeEntryForWrite;
    BuildIdOp buildId;
};

extern JS_PUBLIC_API(void)
SetAsmJSCacheOps(JSRuntime *rt, const AsmJSCacheOps *callbacks);

/*
 * Convenience class for imitating a JS level for-of loop. Typical usage:
 *
 *     ForOfIterator it(cx);
 *     if (!it.init(iterable))
 *       return false;
 *     RootedValue val(cx);
 *     while (true) {
 *       bool done;
 *       if (!it.next(&val, &done))
 *         return false;
 *       if (done)
 *         break;
 *       if (!DoStuff(cx, val))
 *         return false;
 *     }
 */
class MOZ_STACK_CLASS JS_PUBLIC_API(ForOfIterator) {
  protected:
    JSContext *cx_;
    /*
     * Use the ForOfPIC on the global object (see vm/GlobalObject.h) to try
     * to optimize iteration across arrays.
     *
     *  Case 1: Regular Iteration
     *      iterator - pointer to the iterator object.
     *      index - fixed to NOT_ARRAY (== UINT32_MAX)
     *
     *  Case 2: Optimized Array Iteration
     *      iterator - pointer to the array object.
     *      index - current position in array.
     *
     * The cases are distinguished by whether or not |index| is equal to NOT_ARRAY.
     */
    /*
     * Initialize the iterator.  If AllowNonIterable is passed then if getting
     * the @@iterator property from iterable returns undefined init() will just
     * return true instead of throwing.  Callers must then check
     * valueIsIterable() before continuing with the iteration.
     */
    ;

    /*
     * This method assumes that |iterator| is already an iterator.  It will not
     * check for, and call @@iterator.  Callers should make sure that the passed
     * in value is in fact an iterator.
     */
    ;

    /*
     * Get the next value from the iterator.  If false *done is true
     * after this call, do not examine val.
     */
    ;

    /*
     * If initialized with throwOnNonCallable = false, check whether
     * the value is iterable.
     */
    

  private:
    ;
    ;
};


/*
 * Given a SavedFrame JSObject stack, stringify it in the same format as
 * Error.prototype.stack. The stringified stack out parameter is placed in the
 * cx's compartment. Defaults to the empty string.
 */
;


} /* namespace JS */

#endif /* jsapi_h */
# 5203 "../../dist/include/jsapi.h"
# 8 "../../dist/include/mozilla/dom/WindowBinding.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/WindowBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/WindowBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/BindingUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* vim: set ts=2 sw=2 et tw=79: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_BindingUtils_h__
#define mozilla_dom_BindingUtils_h__

#if 0 /* expanded by -frewrite-includes */
#include "jsfriendapi.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/jsfriendapi.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef jsfriendapi_h
#define jsfriendapi_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Casting.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/jsfriendapi.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/jsfriendapi.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/jsfriendapi.h"

#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h" // For JSAutoByteString.  See bug 1033916.
#include "js/CallArgs.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/jsfriendapi.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/CallNonGenericMethod.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/CallNonGenericMethod.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_CallNonGenericMethod_h
#define js_CallNonGenericMethod_h

#if 0 /* expanded by -frewrite-includes */
#include "jstypes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/js/CallNonGenericMethod.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/CallArgs.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/js/CallNonGenericMethod.h"

namespace JS {

// Returns true if |v| is considered an acceptable this-value.
typedef bool (*IsAcceptableThis)(HandleValue v);

// Implements the guts of a method; guaranteed to be provided an acceptable
// this-value, as determined by a corresponding IsAcceptableThis method.
typedef bool (*NativeImpl)(JSContext *cx, CallArgs args);

namespace detail {

// DON'T CALL THIS DIRECTLY.  It's for use only by CallNonGenericMethod!
extern JS_PUBLIC_API(bool)
CallMethodIfWrapped(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args);

} // namespace detail

// Methods usually act upon |this| objects only from a single global object and
// compartment.  Sometimes, however, a method must act upon |this| values from
// multiple global objects or compartments.  In such cases the |this| value a
// method might see will be wrapped, such that various access to the object --
// to its class, its private data, its reserved slots, and so on -- will not
// work properly without entering that object's compartment.  This method
// JS::CallNonGenericMethod will test whether |args.thisv()| is acceptable.  If
// it is, it will call the provided implementation function, which will return
// a value and indicate success.  If it is not, it will attempt to unwrap
// |this| and call the implementation function on the unwrapped |this|.  If
// that succeeds, all well and good.  If it doesn't succeed, a TypeError will
// be thrown.
//
// Note: JS::CallNonGenericMethod will only work correctly if it's called in
//       tail position in a JSNative.  Do not call it from any other place.
//
template<IsAcceptableThis Test, NativeImpl Impl>
MOZ_ALWAYS_INLINE bool
CallNonGenericMethod(JSContext *cx, CallArgs args)
{
    HandleValue thisv = args.thisv();
    if (Test(thisv))
        return Impl(cx, args);

    return detail::CallMethodIfWrapped(cx, Test, Impl, args);
}

MOZ_ALWAYS_INLINE bool
CallNonGenericMethod(JSContext *cx, IsAcceptableThis Test, NativeImpl Impl, CallArgs args)
{
    HandleValue thisv = args.thisv();
    if (Test(thisv))
        return Impl(cx, args);

    return detail::CallMethodIfWrapped(cx, Test, Impl, args);
}

} // namespace JS

#endif /* js_CallNonGenericMethod_h */
# 118 "../../dist/include/js/CallNonGenericMethod.h"
# 20 "../../dist/include/jsfriendapi.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/Class.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/jsfriendapi.h"

#if JS_STACK_GROWTH_DIRECTION > 0
# define JS_CHECK_STACK_SIZE(limit, sp) (MOZ_LIKELY(((uintptr_t)(sp) < (limit)))
#else
# 25 "../../dist/include/jsfriendapi.h"
# define JS_CHECK_STACK_SIZE(limit, sp) (MOZ_LIKELY((uintptr_t)(sp) > (limit)))
#endif
# 27 "../../dist/include/jsfriendapi.h"

class JSAtom;
struct JSErrorFormatString;
class JSLinearString;
struct JSJitInfo;
class JSErrorReport;

namespace JS {
template <class T>
class Heap;
} /* namespace JS */

namespace js {
class JS_FRIEND_API(BaseProxyHandler);
class InterpreterFrame;
} /* namespace js */
;


/* Safe to call with input obj == nullptr. Returns non-nullptr iff obj != nullptr. */
;

/* Requires obj != nullptr. */
extern JS_FRIEND_API(JSObject *)
JS_ObjectToOuterObject(JSContext *cx, JS::HandleObject obj);

;

/*
 * Copy the own properties of src to dst in a fast way.  src and dst must both
 * be native and must be in the compartment of cx.  They must have the same
 * class, the same parent, and the same prototype.  Class reserved slots will
 * NOT be copied.
 *
 * dst must not have any properties on it before this function is called.
 *
 * src must have been allocated via JS_NewObjectWithoutMetadata so that we can
 * be sure it has no metadata that needs copying to dst.  This also means that
 * dst needs to have the compartment global as its parent.  This function will
 * preserve the existing metadata on dst, if any.
 */
;

;

namespace js {

JS_FRIEND_API(bool)
ObjectClassIs(JSContext *cx, JS::HandleObject obj, ESClassValue classValue);

JS_FRIEND_API(const char *)
ObjectClassName(JSContext *cx, JS::HandleObject obj);

JS_FRIEND_API(void)
ReportOverRecursed(JSContext *maybecx);

JS_FRIEND_API(bool)
AddRawValueRoot(JSContext *cx, JS::Value *vp, const char *name);

JS_FRIEND_API(void)
RemoveRawValueRoot(JSContext *cx, JS::Value *vp);

#ifdef JS_DEBUG

;

;

;

;

#endif
# 227 "../../dist/include/jsfriendapi.h"

;

} // namespace js

namespace JS {

// Exposed for DumpJSStack
;

} // namespace JS

/*
 * Copies all own properties from |obj| to |target|. |obj| must be a "native"
 * object (that is to say, normal-ish - not an Array or a Proxy).
 *
 * This function immediately enters a compartment, and does not impose any
 * restrictions on the compartment of |cx|.
 */
;

/*
 * Single-property version of the above. This function asserts that an |own|
 * property of the given name exists on |obj|.
 *
 * On entry, |cx| must be same-compartment with |obj|.
 *
 * The copyBehavior argument controls what happens with
 * non-configurable properties.
 */
typedef enum  {
    MakeNonConfigurableIntoConfigurable,
    CopyNonConfigurableAsIs
} PropertyCopyBehavior;

;

;

namespace js {

/*
 * Helper Macros for creating JSClasses that function as proxies.
 *
 * NB: The macro invocation must be surrounded by braces, so as to
 *     allow for potential JSClass extensions.
 */
#define PROXY_MAKE_EXT(outerObject, innerObject, isWrappedNative,       \
                       objectMoved)                                     \
    {                                                                   \
        outerObject,                                                    \
        innerObject,                                                    \
        isWrappedNative,                                                \
        js::proxy_WeakmapKeyDelegate,                                   \
;
;
;
;
;
;
;
;
;
;
;

/*
 * A class of objects that return source code on demand.
 *
 * When code is compiled with setSourceIsLazy(true), SpiderMonkey doesn't
    ;
};

/*
 * Have |rt| use |hook| to retrieve lazily-retrieved source code. See the
 * comments for SourceHook. The runtime takes ownership of the hook, and
 * will delete it when the runtime itself is deleted, or when a new hook is
 * set.
 */
;

/* Remove |rt|'s source hook, and return it. The caller now owns the hook. */
;

;

typedef bool
(* PreserveWrapperCallback)(JSContext *cx, JSObject *obj);


;

JS_FRIEND_API(JSGCTraceKind)
GCThingTraceKind(void *thing);

/*
 * Invoke cellCallback on every gray JS_OBJECT in the given zone.
 */
;

#ifdef JS_HAS_CTYPES
;
#endif
# 536 "../../dist/include/jsfriendapi.h"

;

/*
 * Shadow declarations of JS internal structures, for access by inline access
 * functions below. Do not use these structures in any other way. When adding
 * new fields for access by inline methods, make sure to add static asserts to
 * the original header file to ensure that offsets are consistent.
 */
namespace shadow {

struct ObjectGroup {
    const Class *clasp;
    JSObject    *proto;
    JSCompartment *compartment;
};

struct BaseShape {
    const js::Class *clasp_;
    JSObject *parent;
};

class Shape {
public:
    shadow::BaseShape *base;
    jsid              _1;
    uint32_t          slotInfo;

    static const uint32_t FIXED_SLOTS_SHIFT = 27;
};

// This layout is shared by all native objects. For non-native objects, the
// group may always be accessed safely, and other members may be as well,
// depending on the object's specific layout.
struct Object {
    shadow::ObjectGroup *group;
    shadow::Shape       *shape;
    JS::Value           *slots;
    void                *_1;

    size_t numFixedSlots() const { return shape->slotInfo >> Shape::FIXED_SLOTS_SHIFT; }
    JS::Value *fixedSlots() const {
        return (JS::Value *)(uintptr_t(this) + sizeof(shadow::Object));
    }

    JS::Value &slotRef(size_t slot) const {
        size_t nfixed = numFixedSlots();
        if (slot < nfixed)
            return fixedSlots()[slot];
        return slots[slot - nfixed];
    }
};

struct Function {
    Object base;
    uint16_t nargs;
    uint16_t flags;
    /* Used only for natives */
    JSNative native;
    const JSJitInfo *jitinfo;
    void *_1;
};

struct String
{
    static const uint32_t INLINE_CHARS_BIT = JS_BIT(2);
    static const uint32_t LATIN1_CHARS_BIT = JS_BIT(6);
    static const uint32_t ROPE_FLAGS       = 0;
    static const uint32_t TYPE_FLAGS_MASK  = JS_BIT(6) - 1;
    uint32_t flags;
    uint32_t length;
    union {
        const JS::Latin1Char *nonInlineCharsLatin1;
        const char16_t *nonInlineCharsTwoByte;
        JS::Latin1Char inlineStorageLatin1[1];
        char16_t inlineStorageTwoByte[1];
    };
};

} /* namespace shadow */

// This is equal to |&JSObject::class_|.  Use it in places where you don't want
// to #include jsobj.h.
extern JS_FRIEND_DATA(const js::Class* const) ObjectClassPtr;

inline const js::Class *
GetObjectClass(JSObject *obj)
{
    return reinterpret_cast<const shadow::Object*>(obj)->group->clasp;
}



JS_FRIEND_API(const Class *)
ProtoKeyToClass(JSProtoKey key);

// Returns true if the standard class identified by |key| inherits from
// another standard class (in addition to Object) along its proto chain.
//
// In practice, this only returns true for Error subtypes.


// Returns the key for the class inherited by a given standard class (that
// is to say, the prototype of this standard class's prototype).
//
// You must be sure that this corresponds to a standard class with a cached
// JSProtoKey before calling this function. In general |key| will match the
// cached proto key, except in cases where multiple JSProtoKeys share a
// JSClass.


inline bool
IsInnerObject(JSObject *obj) {
    return !!GetObjectClass(obj)->ext.outerObject;
}



JS_FRIEND_API(bool)
IsFunctionObject(JSObject *obj);

JS_FRIEND_API(bool)
IsScopeObject(JSObject *obj);

JS_FRIEND_API(bool)
IsCallObject(JSObject *obj);

JS_FRIEND_API(bool)
CanAccessObjectShape(JSObject *obj);

static MOZ_ALWAYS_INLINE JSCompartment *
GetObjectCompartment(JSObject *obj)
{
    return reinterpret_cast<shadow::Object*>(obj)->group->compartment;
}

JS_FRIEND_API(JSObject *)
GetGlobalForObjectCrossCompartment(JSObject *obj);

JS_FRIEND_API(JSObject *)
GetPrototypeNoProxy(JSObject *obj);


JS_FRIEND_API(void)
NotifyAnimationActivity(JSObject *obj);

/*
 * Return the outermost enclosing function (script) of the scripted caller.
 * This function returns nullptr in several cases:
 *  - no script is running on the context
 *  - the caller is in global or eval code
 * In particular, this function will "stop" its outermost search at eval() and
 * thus it will really return the outermost enclosing function *since the
 * innermost eval*.
 */
inline void *
GetObjectPrivate(JSObject *obj)
{
    MOZ_ASSERT(GetObjectClass(obj)->flags & JSCLASS_HAS_PRIVATE);
    const shadow::Object *nobj = reinterpret_cast<const shadow::Object*>(obj);
    void **addr = reinterpret_cast<void**>(&nobj->fixedSlots()[nobj->numFixedSlots()]);
    return *addr;
}

inline const JS::Value &
GetReservedSlot(JSObject *obj, size_t slot)
{
    MOZ_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));
    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);
}

JS_FRIEND_API(void)
SetReservedOrProxyPrivateSlotWithBarrier(JSObject *obj, size_t slot, const JS::Value &value);

inline void
SetReservedSlot(JSObject *obj, size_t slot, const JS::Value &value)
{
    MOZ_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)));
    shadow::Object *sobj = reinterpret_cast<shadow::Object *>(obj);
    if (sobj->slotRef(slot).isMarkable() || value.isMarkable())
        SetReservedOrProxyPrivateSlotWithBarrier(obj, slot, value);
    else
        sobj->slotRef(slot) = value;
}

JS_FRIEND_API(uint32_t)
GetObjectSlotSpan(JSObject *obj);



MOZ_ALWAYS_INLINE size_t
GetAtomLength(JSAtom *atom)
{
    return reinterpret_cast<shadow::String*>(atom)->length;
}

static const uint32_t MaxStringLength = (1 << 28) - 1;

MOZ_ALWAYS_INLINE size_t
GetStringLength(JSString *s)
{
    return reinterpret_cast<shadow::String*>(s)->length;
}

MOZ_ALWAYS_INLINE size_t
GetFlatStringLength(JSFlatString *s)
{
    return reinterpret_cast<shadow::String*>(s)->length;
}

MOZ_ALWAYS_INLINE size_t
GetLinearStringLength(JSLinearString *s)
{
    return reinterpret_cast<shadow::String*>(s)->length;
}

MOZ_ALWAYS_INLINE bool
LinearStringHasLatin1Chars(JSLinearString *s)
{
    return reinterpret_cast<shadow::String *>(s)->flags & shadow::String::LATIN1_CHARS_BIT;
}

MOZ_ALWAYS_INLINE bool
AtomHasLatin1Chars(JSAtom *atom)
{
    return reinterpret_cast<shadow::String *>(atom)->flags & shadow::String::LATIN1_CHARS_BIT;
}

MOZ_ALWAYS_INLINE bool
StringHasLatin1Chars(JSString *s)
{
    return reinterpret_cast<shadow::String *>(s)->flags & shadow::String::LATIN1_CHARS_BIT;
}

MOZ_ALWAYS_INLINE const JS::Latin1Char *
GetLatin1LinearStringChars(const JS::AutoCheckCannotGC &nogc, JSLinearString *linear)
{
    MOZ_ASSERT(LinearStringHasLatin1Chars(linear));

    using shadow::String;
    String *s = reinterpret_cast<String *>(linear);
    if (s->flags & String::INLINE_CHARS_BIT)
        return s->inlineStorageLatin1;
    return s->nonInlineCharsLatin1;
}

MOZ_ALWAYS_INLINE const char16_t *
GetTwoByteLinearStringChars(const JS::AutoCheckCannotGC &nogc, JSLinearString *linear)
{
    MOZ_ASSERT(!LinearStringHasLatin1Chars(linear));

    using shadow::String;
    String *s = reinterpret_cast<String *>(linear);
    if (s->flags & String::INLINE_CHARS_BIT)
        return s->inlineStorageTwoByte;
    return s->nonInlineCharsTwoByte;
}

MOZ_ALWAYS_INLINE JSLinearString *
AtomToLinearString(JSAtom *atom)
{
    return reinterpret_cast<JSLinearString *>(atom);
}

MOZ_ALWAYS_INLINE JSLinearString *
FlatStringToLinearString(JSFlatString *s)
{
    return reinterpret_cast<JSLinearString *>(s);
}

MOZ_ALWAYS_INLINE const JS::Latin1Char *
GetLatin1AtomChars(const JS::AutoCheckCannotGC &nogc, JSAtom *atom)
{
    return GetLatin1LinearStringChars(nogc, AtomToLinearString(atom));
}

MOZ_ALWAYS_INLINE const char16_t *
GetTwoByteAtomChars(const JS::AutoCheckCannotGC &nogc, JSAtom *atom)
{
    return GetTwoByteLinearStringChars(nogc, AtomToLinearString(atom));
}

JS_FRIEND_API(JSLinearString *)
StringToLinearStringSlow(JSContext *cx, JSString *str);

MOZ_ALWAYS_INLINE JSLinearString *
StringToLinearString(JSContext *cx, JSString *str)
{
    using shadow::String;
    String *s = reinterpret_cast<String *>(str);
    if (MOZ_UNLIKELY((s->flags & String::TYPE_FLAGS_MASK) == String::ROPE_FLAGS))
        return StringToLinearStringSlow(cx, str);
    return reinterpret_cast<JSLinearString *>(str);
}

MOZ_ALWAYS_INLINE void
CopyLinearStringChars(char16_t *dest, JSLinearString *s, size_t len)
{
    JS::AutoCheckCannotGC nogc;
    if (LinearStringHasLatin1Chars(s)) {
        const JS::Latin1Char *src = GetLatin1LinearStringChars(nogc, s);
        for (size_t i = 0; i < len; i++)
            dest[i] = src[i];
    } else {
        const char16_t *src = GetTwoByteLinearStringChars(nogc, s);
        mozilla::PodCopy(dest, src, len);
    }
}

inline bool
CopyStringChars(JSContext *cx, char16_t *dest, JSString *s, size_t len)
{
    JSLinearString *linear = StringToLinearString(cx, s);
    if (!linear)
        return false;

    CopyLinearStringChars(dest, linear, len);
    return true;
}



JS_FRIEND_API(bool)
GetPropertyKeys(JSContext *cx, JS::HandleObject obj, unsigned flags, JS::AutoIdVector *props);

JS_FRIEND_API(bool)
AppendUnique(JSContext *cx, JS::AutoIdVector &base, JS::AutoIdVector &others);

JS_FRIEND_API(bool)
GetGeneric(JSContext *cx, JSObject *obj, JSObject *receiver, jsid id, JS::Value *vp);

JS_FRIEND_API(bool)
StringIsArrayIndex(JSLinearString *str, uint32_t *indexp);

JS_FRIEND_API(void)
SetPreserveWrapperCallback(JSRuntime *rt, PreserveWrapperCallback callback);

JS_FRIEND_API(bool)
IsObjectInContextCompartment(JSObject *obj, const JSContext *cx);

/*


/*
 * These macros report a stack overflow and run |onerror| if we are close to
 * using up the C stack. The JS_CHECK_CHROME_RECURSION variant gives us a
 * little extra space so that we can ensure that crucial code is able to run.
 * JS_CHECK_RECURSION_CONSERVATIVE allows less space than any other check,
 * including a safety buffer (as in, it uses the untrusted limit and subtracts
GetEnterCompartmentDepth(JSContext* cx);
 */
struct CompartmentFilter {
    ;
};

struct AllCompartments : public CompartmentFilter {
    
};

struct ContentCompartmentsOnly : public CompartmentFilter {
    
};

struct ChromeCompartmentsOnly : public CompartmentFilter {
    
};

/*
 * The DOMProxyShadowsCheck function will be called to check if the property for
 * id should be gotten from the prototype, or if there is an own property that
 * shadows it.

typedef enum DOMProxyShadowsResult {
  ShadowCheckFailed,
  Shadows,
  DoesntShadow,
  DoesntShadowUnique,
  ShadowsViaDirectExpando,
  ShadowsViaIndirectExpando
} DOMProxyShadowsResult;
typedef DOMProxyShadowsResult
(* DOMProxyShadowsCheck)(JSContext* cx, JS::HandleObject object, JS::HandleId id);
JS_FRIEND_API(void)
SetDOMProxyInformation(const void *domProxyHandlerFamily, uint32_t domProxyExpandoSlot,
                       DOMProxyShadowsCheck domProxyShadowsCheck);

;
;
;


/* Implemented in jsdate.cpp. */

/*
 * Detect whether the internal date value is NaN.  (Because failure is
 * out-of-band for js_DateGet*)
 */
;

;

} /* namespace js */

/* Implemented in jscntxt.cpp. */

/*
 * Report an exception, which is currently realized as a printf-style format
 * string and its arguments.
 */
typedef enum JSErrNum {
#define MSG_DEF(name, count, exception, format) \
    name,
#if 0 /* expanded by -frewrite-includes */
#include "js.msg"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js.msg" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * This is the JavaScript error message file.
 *
 * The format for each JS error message is:
 *
 * MSG_DEF(<SYMBOLIC_NAME>, <ARGUMENT_COUNT>, <EXCEPTION_NAME>,
 *         <FORMAT_STRING>)
 *
 *
 * MSG_DEF(JSMSG_NOT_A_SUBSPECIES, 2, JSEXN_NONE,
 *         "{0} is not a member of the {1} family")
 *
 * can be used:
 *
 * JS_ReportErrorNumber(JSMSG_NOT_A_SUBSPECIES, "Rhino", "Monkey");
 *
 * to report:
 *
 * "Rhino is not a member of the Monkey family"
 */

MSG_DEF(JSMSG_NOT_AN_ERROR,            0, JSEXN_NONE, "<Error #0 is reserved>")
MSG_DEF(JSMSG_NOT_DEFINED,             1, JSEXN_REFERENCEERR, "{0} is not defined")
MSG_DEF(JSMSG_MORE_ARGS_NEEDED,        3, JSEXN_TYPEERR, "{0} requires more than {1} argument{2}")
MSG_DEF(JSMSG_INCOMPATIBLE_PROTO,      3, JSEXN_TYPEERR, "{0}.prototype.{1} called on incompatible {2}")
MSG_DEF(JSMSG_NO_CONSTRUCTOR,          1, JSEXN_TYPEERR, "{0} has no constructor")
MSG_DEF(JSMSG_BAD_PROTOTYPE,           1, JSEXN_TYPEERR, "'prototype' property of {0} is not an object")
MSG_DEF(JSMSG_IN_NOT_OBJECT,           1, JSEXN_TYPEERR, "invalid 'in' operand {0}")

// XPConnect wrappers and DOM bindings
MSG_DEF(JSMSG_CANT_SET_INTERPOSED,      1, JSEXN_TYPEERR, "unable to set interposed data property '{0}'")
MSG_DEF(JSMSG_CANT_DELETE_WINDOW_ELEMENT, 0, JSEXN_TYPEERR, "can't delete elements from a Window object")
MSG_DEF(JSMSG_CANT_DELETE_WINDOW_NAMED_PROPERTY, 1, JSEXN_TYPEERR, "can't delete property {0} from window's named properties object")
MSG_DEF(JSMSG_CANT_PREVENT_EXTENSIONS,  0, JSEXN_TYPEERR, "can't prevent extensions on this proxy object")
# 1276 "../../dist/include/jsfriendapi.h" 2
#undef MSG_DEF
    JSErr_Limit
} JSErrNum;

namespace js {

;

// AutoStableStringChars is here so we can use it in ErrorReport.  It
// should get moved out of here if we can manage it.  See bug 1040316.

/*
 * This class provides safe access to a string's chars across a GC. Once
 * we allocate strings and chars in the nursery (bug 903519), this class
 * will have to make a copy of the string's chars if they are allocated
 * in the nursery, so it's best to avoid using this class unless you really
 * need it. It's usually more efficient to use the latin1Chars/twoByteChars
 * JSString methods and often the code can be rewritten so that only indexes
 * instead of char pointers are used in parts of the code that can GC.
 */
class MOZ_STACK_CLASS AutoStableStringChars
{
  private:
    AutoStableStringChars(const AutoStableStringChars &other) = delete;
    void operator=(const AutoStableStringChars &other) = delete;
};

// Creates a string of the form |ErrorType: ErrorMessage| for a JSErrorReport,
// which generally matches the toString() behavior of an ErrorObject.
extern JS_FRIEND_API(JSString *)
ErrorReportToString(JSContext *cx, JSErrorReport *reportp);

struct MOZ_STACK_CLASS JS_FRIEND_API(ErrorReport)
{
    explicit ErrorReport(JSContext *cx);
    ;

};

/* Implemented in vm/StructuredClone.cpp. */
;

namespace Scalar {

/* Scalar types which can appear in typed arrays and typed objects.  The enum
 * values need to be kept in sync with the JS_SCALARTYPEREPR_ constants, as
 * well as the TypedArrayObject::classes and TypedArrayObject::protoClasses
 * definitions.
 */
enum Type {
    Int8 = 0,
    Uint8,
    Int16,

    Float32x4,
    Int32x4
};







} /* namespace Scalar */
} /* namespace js */

/*
 * Create a new typed array with nelements elements.
 *
 * These functions (except the WithBuffer variants) fill in the array with zeros.
 */

extern JS_FRIEND_API(JSObject *)
JS_NewInt8Array(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
JS_NewUint8Array(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
JS_NewUint8ClampedArray(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
JS_NewInt16Array(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
JS_NewUint16Array(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
JS_NewInt32Array(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
JS_NewUint32Array(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
JS_NewFloat32Array(JSContext *cx, uint32_t nelements);
extern JS_FRIEND_API(JSObject *)
JS_NewFloat64Array(JSContext *cx, uint32_t nelements);

;
;
;
;
;
;
;
;
;
;

/*
 * Create a new ArrayBuffer with the given byte length.
 */
extern JS_FRIEND_API(JSObject *)
JS_NewArrayBuffer(JSContext *cx, uint32_t nbytes);

/*
 * Check whether obj supports JS_GetTypedArray* APIs. Note that this may return
 * false if a security wrapper is encountered that denies the unwrapping. If
 * this test or one of the JS_Is*Array tests succeeds, then it is safe to call
 * the various accessor JSAPI calls defined below.
 */
;

/*
 * Ditto for JS_GetSharedTypedArray* APIs.
 */
;

/*
 * Check whether obj supports JS_GetArrayBufferView* APIs. Note that this may
 * return false if a security wrapper is encountered that denies the
 * unwrapping. If this test or one of the more specific tests succeeds, then it
 * is safe to call the various ArrayBufferView accessor JSAPI calls defined
 * below.
 */
namespace js {

extern JS_FRIEND_API(JSObject *)
UnwrapInt8Array(JSObject *obj);
extern JS_FRIEND_API(JSObject *)
UnwrapUint8Array(JSObject *obj);
extern JS_FRIEND_API(JSObject *)
UnwrapUint8ClampedArray(JSObject *obj);
extern JS_FRIEND_API(JSObject *)
UnwrapInt16Array(JSObject *obj);
extern JS_FRIEND_API(JSObject *)
UnwrapUint16Array(JSObject *obj);
extern JS_FRIEND_API(JSObject *)
UnwrapInt32Array(JSObject *obj);
extern JS_FRIEND_API(JSObject *)
UnwrapUint32Array(JSObject *obj);
extern JS_FRIEND_API(JSObject *)
UnwrapFloat32Array(JSObject *obj);
extern JS_FRIEND_API(JSObject *)
UnwrapFloat64Array(JSObject *obj);

extern JS_FRIEND_API(JSObject *)
UnwrapArrayBuffer(JSObject *obj);

extern JS_FRIEND_API(JSObject *)
UnwrapArrayBufferView(JSObject *obj);

;
;
;
;
;
;
;
;
;

namespace detail {

extern JS_FRIEND_DATA(const Class* const) Int8ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) Uint8ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) Uint8ClampedArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) Int16ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) Uint16ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) Int32ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) Uint32ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) Float32ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) Float64ArrayClassPtr;

extern JS_FRIEND_DATA(const Class* const) SharedInt8ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) SharedUint8ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) SharedUint8ClampedArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) SharedInt16ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) SharedUint16ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) SharedInt32ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) SharedUint32ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) SharedFloat32ArrayClassPtr;
extern JS_FRIEND_DATA(const Class* const) SharedFloat64ArrayClassPtr;

const size_t TypedArrayLengthSlot = 1;

} // namespace detail

/*
 * Test for specific typed array types (ArrayBufferView subtypes) and return
 * the unwrapped object if so, else nullptr.  Never throws.
 */

#define JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Type, type) \
inline void \
Get ## Type ## ArrayLengthAndData(JSObject *obj, uint32_t *length, type **data) \
{ \
    MOZ_ASSERT(GetObjectClass(obj) == detail::Type ## ArrayClassPtr); \
    const JS::Value &slot = GetReservedSlot(obj, detail::TypedArrayLengthSlot); \
    *length = mozilla::AssertedCast<uint32_t>(slot.toInt32()); \
    *data = static_cast<type*>(GetObjectPrivate(obj)); \
}

JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Int8, int8_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Uint8, uint8_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Uint8Clamped, uint8_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Int16, int16_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Uint16, uint16_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Int32, int32_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Uint32, uint32_t)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Float32, float)
JS_DEFINE_DATA_AND_LENGTH_ACCESSOR(Float64, double)

#undef JS_DEFINE_DATA_AND_LENGTH_ACCESSOR

// This one isn't inlined because it's rather tricky (by dint of having to deal
// with a dozen-plus classes and varying slot layouts.
extern JS_FRIEND_API(void)
GetArrayBufferViewLengthAndData(JSObject *obj, uint32_t *length, uint8_t **data);

// This one isn't inlined because there are a bunch of different ArrayBuffer
// classes that would have to be individually handled here.
extern JS_FRIEND_API(void)
GetArrayBufferLengthAndData(JSObject *obj, uint32_t *length, uint8_t **data);

} // namespace js

/*
 * Unwrap Typed arrays all at once. Return nullptr without throwing if the
 * object cannot be viewed as the correct typed array, or the typed array
 * object on success, filling both outparameters.
 */
;
;
;
;
;
;
;
;
;
;
;

/*
 * Get the type of elements in a typed array, or MaxTypedArrayViewType if a DataView.
 *
 * |obj| must have passed a JS_IsArrayBufferView/JS_Is*Array test, or somehow
 * be known that it would pass such a test: it is an ArrayBufferView or a
 * wrapper of an ArrayBufferView, and the unwrapping will succeed.
 */
;

/*
 * Check whether obj supports the JS_GetArrayBuffer* APIs. Note that this may
 * return false if a security wrapper is encountered that denies the
 * unwrapping. If this test succeeds, then it is safe to call the various
 * Return true if the arrayBuffer contains any data. This will return false for
 * ArrayBuffer.prototype and neutered ArrayBuffers.
 *
 * pass such a test: it is a typed array or a wrapper of a typed array, and the
 * unwrapping will succeed.
 */

extern JS_FRIEND_API(uint8_t *)
JS_GetArrayBufferData(JSObject *obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(int8_t *)
JS_GetInt8ArrayData(JSObject *obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(uint8_t *)
JS_GetUint8ArrayData(JSObject *obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(uint8_t *)
JS_GetUint8ClampedArrayData(JSObject *obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(int16_t *)
JS_GetInt16ArrayData(JSObject *obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(uint16_t *)
JS_GetUint16ArrayData(JSObject *obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(int32_t *)
JS_GetInt32ArrayData(JSObject *obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(uint32_t *)
JS_GetUint32ArrayData(JSObject *obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(float *)
JS_GetFloat32ArrayData(JSObject *obj, const JS::AutoCheckCannotGC&);
extern JS_FRIEND_API(double *)
JS_GetFloat64ArrayData(JSObject *obj, const JS::AutoCheckCannotGC&);

/*
 * Same as above, but for any kind of ArrayBufferView. Prefer the type-specific
 * versions when possible.
 */
;

/*
 * Return the ArrayBuffer underlying an ArrayBufferView. If the buffer has been
 * neutered, this will still return the neutered buffer. |obj| must be an
 * object that would return true for JS_IsArrayBufferViewObject().

/*
 * Return the byte offset of a data view into its array buffer. |obj| must be a
 * DataView.
 *
 * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that
 * it would pass such a test: it is a data view or a wrapper of a data view,
 * and the unwrapping will succeed.
 */
JS_FRIEND_API(uint32_t)
JS_GetDataViewByteOffset(JSObject *obj);

/*
 * Return the byte length of a data view.
 *
 * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that
 * it would pass such a test: it is a data view or a wrapper of a data view,
 * and the unwrapping will succeed. If cx is nullptr, then DEBUG builds may be
 * unable to assert when unwrapping should be disallowed.
 */
JS_FRIEND_API(uint32_t)
JS_GetDataViewByteLength(JSObject *obj);

/*
 * Return a pointer to the beginning of the data referenced by a DataView.
 *
 * |obj| must have passed a JS_IsDataViewObject test, or somehow be known that
 * it would pass such a test: it is a data view or a wrapper of a data view,
 * and the unwrapping will succeed. If cx is nullptr, then DEBUG builds may be
 * unable to assert when unwrapping should be disallowed.
 */
JS_FRIEND_API(void *)
JS_GetDataViewData(JSObject *obj, const JS::AutoCheckCannotGC&);

namespace js {

/*
 * Add a watchpoint -- in the Object.prototype.watch sense -- to |obj| for the
 * property |id|, using the callable object |callable| as the function to be
 * called for notifications.
 *
 * This is an internal function exposed -- temporarily -- only so that DOM
 * proxies can be watchable.  Don't use it!  We'll soon kill off the
 * Object.prototype.{,un}watch functions, at which point this will go too.
 */
;

/*
 * Remove a watchpoint -- in the Object.prototype.watch sense -- from |obj| for
 * the property |id|.
 *
 * This is an internal function exposed -- temporarily -- only so that DOM
 * proxies can be watchable.  Don't use it!  We'll soon kill off the
 * Object.prototype.{,un}watch functions, at which point this will go too.
 */
;

} // namespace js

/*
 * A class, expected to be passed by value, which represents the CallArgs for a
 * JSJitGetterOp.
 */
class JSJitGetterCallArgs : protected JS::MutableHandleValue
{
  public:
    

    

    
};

/*
 * A class, expected to be passed by value, which represents the CallArgs for a
 * JSJitSetterOp.
 */
class JSJitSetterCallArgs : protected JS::MutableHandleValue
{
  public:
    

    

    

    // Add get() or maybe hasDefined() as needed
};

struct JSJitMethodCallArgsTraits;

/*
 * A class, expected to be passed by reference, which represents the CallArgs
 * for a JSJitMethodOp.
 */
class JSJitMethodCallArgs : protected JS::detail::CallArgsBase<JS::detail::NoUsedRval>
{
  private:
    typedef JS::detail::CallArgsBase<JS::detail::NoUsedRval> Base;
    friend struct JSJitMethodCallArgsTraits;

  public:
    

    

    

    

    

    

    // Add get() as needed
};

struct JSJitMethodCallArgsTraits
{
    static const size_t offsetOfArgv = offsetof(JSJitMethodCallArgs, argv_);
    static const size_t offsetOfArgc = offsetof(JSJitMethodCallArgs, argc_);
};

/*
 * This struct contains metadata passed from the DOM to the JS Engine for JIT
 * optimizations on DOM property accessors. Eventually, this should be made
 * available to general JSAPI users, but we are not currently ready to do so.
 */
typedef bool
(* JSJitGetterOp)(JSContext *cx, JS::HandleObject thisObj,
                  void *specializedThis, JSJitGetterCallArgs args);
typedef bool
(* JSJitSetterOp)(JSContext *cx, JS::HandleObject thisObj,
                  void *specializedThis, JSJitSetterCallArgs args);
typedef bool
(* JSJitMethodOp)(JSContext *cx, JS::HandleObject thisObj,
                  void *specializedThis, const JSJitMethodCallArgs& args);

struct JSJitInfo {
    enum OpType {
        Getter,
        Setter,
        Method,
        StaticMethod,
        // Must be last
        OpTypeCount
    };

    enum ArgType {
        // Basic types
        String = (1 << 0),
        Integer = (1 << 1), // Only 32-bit or less
        Double = (1 << 2), // Maybe we want to add Float sometime too
        Boolean = (1 << 3),
        Object = (1 << 4),
        Null = (1 << 5),

        // And derived types
        Numeric = Integer | Double,
        // Should "Primitive" use the WebIDL definition, which
        // excludes string and null, or the typical JS one that includes them?
        Primitive = Numeric | Boolean | Null | String,
        ObjectOrNull = Object | Null,
        Any = ObjectOrNull | Primitive,

        // Our sentinel value.
        ArgTypeListEnd = (1 << 31)
    };

    static_assert(Any & String, "Any must include String.");
    static_assert(Any & Integer, "Any must include Integer.");
    static_assert(Any & Double, "Any must include Double.");
    static_assert(Any & Boolean, "Any must include Boolean.");
    static_assert(Any & Object, "Any must include Object.");
    static_assert(Any & Null, "Any must include Null.");

    enum AliasSet {
        // An enum that describes what this getter/setter/method aliases.  This
        // determines what things can be hoisted past this call, and if this
        // call is movable what it can be hoisted past.

        // Alias nothing: a constant value, getting it can't affect any other
        // values, nothing can affect it.
        AliasNone,

        // Alias things that can modify the DOM but nothing else.  Doing the
        // call can't affect the behavior of any other function.
        AliasDOMSets,

        // Alias the world.  Calling this can change arbitrary values anywhere
        // in the system.  Most things fall in this bucket.
        AliasEverything,

        // Must be last.
        AliasSetCount
    };

    

    

    OpType type() const
    {
        return OpType(type_);
    }

    

    

    union {
        JSJitGetterOp getter;
        JSJitSetterOp setter;
        JSJitMethodOp method;
        /* A DOM static method, used for Promise wrappers */
        JSNative staticMethod;
    };

    uint16_t protoID;
    uint16_t depth;

    // These fields are carefully packed to take up 4 bytes.  If you need more
    // bits for whatever reason, please see if you can steal bits from existing
    // fields before adding more members to this structure.

#define JITINFO_OP_TYPE_BITS 4
#define JITINFO_ALIAS_SET_BITS 4
#define JITINFO_RETURN_TYPE_BITS 8

    // The OpType that says what sort of function we are.
    uint32_t type_ : JITINFO_OP_TYPE_BITS;

    // The alias set for this op.  This is a _minimal_ alias set; in
    // particular for a method it does not include whatever argument
#undef JITINFO_OP_TYPE_BITS

    uint32_t isInfallible : 1; /* Is op fallible? False in setters. */
    uint32_t isMovable : 1;    /* Is op movable?  To be movable the op must
                                  not AliasEverything, but even that might
                                  not be enough (e.g. in cases when it can
                                  throw). */
    // XXXbz should we have a JSValueType for the type of the member?
    uint32_t isAlwaysInSlot : 1; /* True if this is a getter that can always
                                    get the value from a slot of the "this"
                                    object. */
    uint32_t isLazilyCachedInSlot : 1; /* True if this is a getter that can
                                          sometimes (if the slot doesn't contain
                                          UndefinedValue()) get the value from a
                                          slot of the "this" object. */
    uint32_t isTypedMethod : 1; /* True if this is an instance of
    // classes. Using C++ style inheritance and constructors instead of
    // brace-initialization would also force the creation of static
    // constructors (on some compilers) when JSJitInfo and JSTypedMethodJitInfo
    // structures are declared. Since there can be several thousand of these
    // structures present and we want to have roughly equivalent performance
    // across a range of compilers, we do things manually.
    JSJitInfo base;

    const JSJitInfo::ArgType* const argTypes; /* For a method, a list of sets of
                                                 types that the function
                                                 expects.  This can be used,
                                                 for example, to figure out
                                                 when argument coercions can
                                                 have side-effects. */
};



/*
 * Engine-internal extensions of jsid.  This code is here only until we
 * eliminate Gecko's dependencies on it!
 */



namespace js {
namespace detail {
;
}
}

/*
 *
 * Thus, it is only the rare third case which needs this function, which
 * handles any JSAtom* that is known not to be representable with an int jsid.
 */


/* All strings stored in jsids are atomized, but are not necessarily property names. */






JS_STATIC_ASSERT(sizeof(jsid) == sizeof(void*));

namespace js {

static MOZ_ALWAYS_INLINE JS::Value
IdToValue(jsid id)
{
    if (JSID_IS_STRING(id))
        return JS::StringValue(JSID_TO_STRING(id));
    if (JSID_IS_INT(id))
        return JS::Int32Value(JSID_TO_INT(id));
    if (JSID_IS_SYMBOL(id))
        return JS::SymbolValue(JSID_TO_SYMBOL(id));
    MOZ_ASSERT(JSID_IS_VOID(id));
    return JS::UndefinedValue();
}

/*
 * If the embedder has registered a default JSContext callback, returns the
 * Get the stored principal of the stack frame this SavedFrame object
 * represents.  note that this is not the same thing as the object principal of
 * the object itself.  Do NOT pass a non-SavedFrame object here.
 */
;

/*
 * Get the first SavedFrame object in this SavedFrame stack whose principals are
 * subsumed by the cx's principals. If there is no such frame, return nullptr.
 *
 * Do NOT pass a non-SavedFrame object here.
 *
 * The savedFrame and cx do not need to be in the same compartment.
 */
;

;

;

} /* namespace js */

;

;

#endif /* jsfriendapi_h */
# 2726 "../../dist/include/jsfriendapi.h"
# 11 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "jswrapper.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/jswrapper.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef jswrapper_h
#define jswrapper_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/jswrapper.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/Proxy.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/Proxy.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef js_Proxy_h
#define js_Proxy_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Maybe.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/js/Proxy.h"

#if 0 /* expanded by -frewrite-includes */
#include "jsfriendapi.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/js/Proxy.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/CallNonGenericMethod.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/js/Proxy.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Class.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/js/Proxy.h"

namespace js {

using JS::AutoIdVector;
using JS::CallArgs;
using JS::HandleId;
using JS::HandleObject;
using JS::HandleValue;
using JS::IsAcceptableThis;
using JS::MutableHandle;
using JS::MutableHandleObject;
using JS::MutableHandleValue;
using JS::NativeImpl;
using JS::ObjectOpResult;
using JS::PrivateValue;
using JS::Value;

class RegExpGuard;
class JS_FRIEND_API(Wrapper);

/*
 * A proxy is a JSObject with highly customizable behavior. ES6 specifies a
 * single kind of proxy, but the customization mechanisms we use to implement
 * ES6 Proxy objects are also useful wherever an object with weird behavior is
 * wanted. Proxies are used to implement:
 *
 * -   the scope objects used by the Debugger's frame.eval() method
 *     (see js::GetDebugScopeForFunction)
 *
 * -   the khuey hack, whereby a whole compartment can be blown away
 *     even if other compartments hold references to objects in it
 *     (see js::NukeCrossCompartmentWrappers)
 *
 * -   XPConnect security wrappers, which protect chrome from malicious content
 *     (js/xpconnect/wrappers)
 *
 * -   DOM objects with special property behavior, like named getters
 *     (dom/bindings/Codegen.py generates these proxies from WebIDL)
 * calling the low-level methods, like getOwnPropertyDescriptor().
 *
 * Important: If you add a method here, you should probably also add a
 * Proxy::foo entry point with an AutoEnterPolicy. If you don't, you need an
 * explicit override for the method in SecurityWrapper. See bug 945826 comment 0.
 */
class JS_FRIEND_API(BaseProxyHandler)
{
    /*
     * Sometimes it's desirable to designate groups of proxy handlers as "similar".
     * For this, we use the notion of a "family": A consumer-provided opaque pointer
     * that designates the larger group to which this proxy belongs.
     *
     * If it will never be important to differentiate this proxy from others as
     * part of a distinct group, nullptr may be used instead.
     */
    const void *mFamily;

    /*
     * Proxy handlers can use mHasPrototype to request the following special
     * treatment from the JS engine:
     *
     *   - When mHasPrototype is true, the engine never calls these methods:
     *     getPropertyDescriptor, has, set, enumerate, iterate.  Instead, for
     *     these operations, it calls the "own" methods like
     *     getOwnPropertyDescriptor, hasOwn, defineProperty,
     *     getOwnEnumerablePropertyKeys, etc., and consults the prototype chain
     *     if needed.
     *
     *   - When mHasPrototype is true, the engine calls handler->get() only if
     *     handler->hasOwn() says an own property exists on the proxy. If not,
     *     it consults the prototype chain.
     *
     * This is useful because it frees the ProxyHandler from having to implement
     * any behavior having to do with the prototype chain.
     */
    bool mHasPrototype;

    /*
     * All proxies indicate whether they have any sort of interesting security
     * policy that might prevent the caller from doing something it wants to
     * the object. In the case of wrappers, this distinction is used to
     * determine whether the caller may strip off the wrapper if it so desires.
     */
    bool mHasSecurityPolicy;

  public:
    explicit MOZ_CONSTEXPR BaseProxyHandler(const void *aFamily, bool aHasPrototype = false,
                                            bool aHasSecurityPolicy = false)
      : mFamily(aFamily),
        mHasPrototype(aHasPrototype),
        mHasSecurityPolicy(aHasSecurityPolicy)
    { }

    bool hasPrototype() const {
        return mHasPrototype;
    }

    bool hasSecurityPolicy() const {
        return mHasSecurityPolicy;
    }

    inline const void *family() const {
        return mFamily;
    }
    static size_t offsetOfFamily() {
        return offsetof(BaseProxyHandler, mFamily);
    }

    virtual bool finalizeInBackground(Value priv) const {
        /*
         * Called on creation of a proxy to determine whether its finalize
         * method can be finalized on the background thread.
         */
        return true;
    }
    typedef uint32_t Action;
    enum {
        NONE      = 0x00,
        GET       = 0x01,
        SET       = 0x02,
        CALL      = 0x04,
        ENUMERATE = 0x08,
        GET_PROPERTY_DESCRIPTOR = 0x10
    };

    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Action act,
                       bool *bp) const;

    /* Standard internal methods. */
    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
                                          MutableHandle<JSPropertyDescriptor> desc) const = 0;
    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,
                                MutableHandle<JSPropertyDescriptor> desc,
                                ObjectOpResult &result) const = 0;
    virtual bool ownPropertyKeys(JSContext *cx, HandleObject proxy,
                                 AutoIdVector &props) const = 0;
    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id,
                         ObjectOpResult &result) const = 0;

    /*
     * Because [[Enumerate]] is one of the standard traps it should be overridden.
     * However for convenience BaseProxyHandler includes a pure virtual implementation,
     * that turns the properties returned by getOwnEnumerablePropertyKeys (and proto walking)
     * into an Iterator object.
     */
    virtual bool enumerate(JSContext *cx, HandleObject proxy, MutableHandleObject objp) const = 0;

    /*
     * These methods are standard, but the engine does not normally call them.
     * They're opt-in. See "Proxy prototype chains" above.
     *
     * getPrototype() crashes if called. setPrototype() throws a TypeError.
     */
    virtual bool getPrototype(JSContext *cx, HandleObject proxy, MutableHandleObject protop) const;
    virtual bool setPrototype(JSContext *cx, HandleObject proxy, HandleObject proto,
                              ObjectOpResult &result) const;

    /* Non-standard but conceptual kin to {g,s}etPrototype, so lives here. */
    virtual bool setImmutablePrototype(JSContext *cx, HandleObject proxy, bool *succeeded) const;

    virtual bool preventExtensions(JSContext *cx, HandleObject proxy,
                                   ObjectOpResult &result) const = 0;
    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) const = 0;

    /*
     * These standard internal methods are implemented, as a convenience, so
     * that ProxyHandler subclasses don't have to provide every single method.
     *
     * The base-class implementations work by calling getPropertyDescriptor().
     * They do not follow any standard. When in doubt, override them.
     */
    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) const;
    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,
                     HandleId id, MutableHandleValue vp) const;
    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,
                     HandleId id, MutableHandleValue vp, ObjectOpResult &result) const;

    /*
     * [[Call]] and [[Construct]] are standard internal methods but according
     * to the spec, they are not present on every object.
     *
     * SpiderMonkey never calls a proxy's call()/construct() internal method
     * unless isCallable()/isConstructor() returns true for that proxy.
     *
     * BaseProxyHandler::isCallable()/isConstructor() always return false, and
     * BaseProxyHandler::call()/construct() crash if called. So if you're
     * creating a kind of that is never callable, you don't have to override
     * anything, but otherwise you probably want to override all four.
     */
    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) const;
    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) const;

    /* SpiderMonkey extensions. */
    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
                                       MutableHandle<JSPropertyDescriptor> desc) const = 0;
    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id, bool *bp) const;
    virtual bool getOwnEnumerablePropertyKeys(JSContext *cx, HandleObject proxy,
                                              AutoIdVector &props) const;
    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl, CallArgs args) const;
    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v, bool *bp) const;
    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue, JSContext *cx) const;
    virtual const char *className(JSContext *cx, HandleObject proxy) const;
    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy, unsigned indent) const;
    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) const;
    virtual bool boxedValue_unbox(JSContext *cx, HandleObject proxy, MutableHandleValue vp) const;
    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint, MutableHandleValue vp) const;
    virtual void trace(JSTracer *trc, JSObject *proxy) const;
    virtual void finalize(JSFreeOp *fop, JSObject *proxy) const;
    virtual void objectMoved(JSObject *proxy, const JSObject *old) const;

    // Allow proxies, wrappers in particular, to specify callability at runtime.
    // Note: These do not take const JSObject *, but they do in spirit.
    //       We are not prepared to do this, as there's little const correctness
    //       in the external APIs that handle proxies.
    virtual bool isCallable(JSObject *obj) const;
    virtual bool isConstructor(JSObject *obj) const;

    // These two hooks must be overridden, or not overridden, in tandem -- no
    // overriding just one!
    virtual bool watch(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
                       JS::HandleObject callable) const;
    virtual bool unwatch(JSContext *cx, JS::HandleObject proxy, JS::HandleId id) const;

    virtual bool getElements(JSContext *cx, HandleObject proxy, uint32_t begin, uint32_t end,
                             ElementAdder *adder) const;

    /* See comment for weakmapKeyDelegateOp in js/Class.h. */
    virtual JSObject *weakmapKeyDelegate(JSObject *proxy) const;
    virtual bool isScripted() const { return false; }
};

/*
 * DirectProxyHandler includes a notion of a target object. All methods are
 * reimplemented such that they forward their behavior to the target. This
 * allows consumers of this class to forward to another object as transparently
 * and efficiently as possible.
 *
 * Important: If you add a method implementation here, you probably also need
 * to add an override in CrossCompartmentWrapper. If you don't, you risk
 * compartment mismatches. See bug 945826 comment 0.
 */
class JS_FRIEND_API(DirectProxyHandler) : public BaseProxyHandler
{
  public:
    explicit MOZ_CONSTEXPR DirectProxyHandler(const void *aFamily, bool aHasPrototype = false,
                                              bool aHasSecurityPolicy = false)
      : BaseProxyHandler(aFamily, aHasPrototype, aHasSecurityPolicy)
    { }

    /* Standard internal methods. */
    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
                                          MutableHandle<JSPropertyDescriptor> desc) const MOZ_OVERRIDE;
    virtual bool defineProperty(JSContext *cx, HandleObject proxy, HandleId id,
                                MutableHandle<JSPropertyDescriptor> desc,
                                ObjectOpResult &result) const MOZ_OVERRIDE;
    virtual bool ownPropertyKeys(JSContext *cx, HandleObject proxy,
                                 AutoIdVector &props) const MOZ_OVERRIDE;
    virtual bool delete_(JSContext *cx, HandleObject proxy, HandleId id,
                         ObjectOpResult &result) const MOZ_OVERRIDE;
    virtual bool enumerate(JSContext *cx, HandleObject proxy,
                           MutableHandleObject objp) const MOZ_OVERRIDE;
    virtual bool getPrototype(JSContext *cx, HandleObject proxy,
                              MutableHandleObject protop) const MOZ_OVERRIDE;
    virtual bool setPrototype(JSContext *cx, HandleObject proxy, HandleObject proto,
                              ObjectOpResult &result) const MOZ_OVERRIDE;
    virtual bool setImmutablePrototype(JSContext *cx, HandleObject proxy,
                                       bool *succeeded) const MOZ_OVERRIDE;
    virtual bool preventExtensions(JSContext *cx, HandleObject proxy,
                                   ObjectOpResult &result) const MOZ_OVERRIDE;
    virtual bool isExtensible(JSContext *cx, HandleObject proxy, bool *extensible) const MOZ_OVERRIDE;
    virtual bool has(JSContext *cx, HandleObject proxy, HandleId id,
                     bool *bp) const MOZ_OVERRIDE;
    virtual bool get(JSContext *cx, HandleObject proxy, HandleObject receiver,
                     HandleId id, MutableHandleValue vp) const MOZ_OVERRIDE;
    virtual bool set(JSContext *cx, HandleObject proxy, HandleObject receiver,
                     HandleId id, MutableHandleValue vp,
                     ObjectOpResult &result) const MOZ_OVERRIDE;
    virtual bool call(JSContext *cx, HandleObject proxy, const CallArgs &args) const MOZ_OVERRIDE;
    virtual bool construct(JSContext *cx, HandleObject proxy, const CallArgs &args) const MOZ_OVERRIDE;

    /* SpiderMonkey extensions. */
    virtual bool getPropertyDescriptor(JSContext *cx, HandleObject proxy, HandleId id,
                                       MutableHandle<JSPropertyDescriptor> desc) const MOZ_OVERRIDE;
    virtual bool hasOwn(JSContext *cx, HandleObject proxy, HandleId id,
                        bool *bp) const MOZ_OVERRIDE;
    virtual bool getOwnEnumerablePropertyKeys(JSContext *cx, HandleObject proxy,
                                              AutoIdVector &props) const MOZ_OVERRIDE;
    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,
                            CallArgs args) const MOZ_OVERRIDE;
    virtual bool hasInstance(JSContext *cx, HandleObject proxy, MutableHandleValue v,
                             bool *bp) const MOZ_OVERRIDE;
    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,
                               JSContext *cx) const MOZ_OVERRIDE;
    virtual const char *className(JSContext *cx, HandleObject proxy) const MOZ_OVERRIDE;
    virtual JSString *fun_toString(JSContext *cx, HandleObject proxy,
                                   unsigned indent) const MOZ_OVERRIDE;
    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy,
                                 RegExpGuard *g) const MOZ_OVERRIDE;
    virtual bool boxedValue_unbox(JSContext *cx, HandleObject proxy, MutableHandleValue vp) const MOZ_OVERRIDE;
    virtual bool isCallable(JSObject *obj) const MOZ_OVERRIDE;
    virtual JSObject *weakmapKeyDelegate(JSObject *proxy) const MOZ_OVERRIDE;
};

extern JS_FRIEND_DATA(const js::Class* const) ProxyClassPtr;

inline bool IsProxy(JSObject *obj)
{
    return GetObjectClass(obj)->isProxy();
}

const uint32_t PROXY_EXTRA_SLOTS = 2;

// Layout of the values stored by a proxy. Note that API clients require the
// private slot to be the first slot in the proxy's values, so that the private
// slot can be accessed in the same fashion as the first reserved slot, via
// {Get,Set}ReservedOrProxyPrivateSlot.

struct ProxyValueArray
{
    Value privateSlot;
    Value extraSlots[PROXY_EXTRA_SLOTS];

    
};

// All proxies share the same data layout. Following the object's shape and
// type, the proxy has a ProxyDataLayout structure with a pointer to an array
// of values and the proxy's handler. This is designed both so that proxies can
// be easily swapped with other objects (via RemapWrapper) and to mimic the
// layout of other objects (proxies and other objects have the same size) so
// that common code can access either type of object.
//
// See GetReservedOrProxyPrivateSlot below.
struct ProxyDataLayout
{
    ProxyValueArray *values;
    const BaseProxyHandler *handler;
};

const uint32_t ProxyDataOffset = 2 * sizeof(void *);

// This method should only be used internally and by the accessors below.
inline ProxyDataLayout *
GetProxyDataLayout(JSObject *obj)
{
    MOZ_ASSERT(IsProxy(obj));
    return reinterpret_cast<ProxyDataLayout *>(reinterpret_cast<uint8_t *>(obj) + ProxyDataOffset);
}

inline const BaseProxyHandler *
GetProxyHandler(JSObject *obj)
{
    return GetProxyDataLayout(obj)->handler;
}




inline const Value &
GetReservedOrProxyPrivateSlot(JSObject *obj, size_t slot)
{
    MOZ_ASSERT(slot == 0);
    MOZ_ASSERT(slot < JSCLASS_RESERVED_SLOTS(GetObjectClass(obj)) || IsProxy(obj));
    return reinterpret_cast<const shadow::Object *>(obj)->slotRef(slot);
}



class MOZ_STACK_CLASS ProxyOptions {
  protected:
    /* protected constructor for subclass */

  private:
    bool singleton_;
    bool lazyProto_;
    const Class *clasp_;
};

JS_FRIEND_API(JSObject *)
NewProxyObject(JSContext *cx, const BaseProxyHandler *handler, HandleValue priv,
               JSObject *proto, const ProxyOptions &options = ProxyOptions());

;

class JS_FRIEND_API(AutoEnterPolicy)
{
  public:
    typedef BaseProxyHandler::Action Action;
    

    
    
    

  protected:
    // no-op constructor for subclass
    
    ;
    bool allow;
    bool rv;

#ifdef JS_DEBUG
    JSContext *context;
#endif
# 654 "../../dist/include/js/Proxy.h"

};

#ifdef JS_DEBUG
class JS_FRIEND_API(AutoWaivePolicy) : public AutoEnterPolicy {
public:
    
};
#else
# 668 "../../dist/include/js/Proxy.h"
class JS_FRIEND_API(AutoWaivePolicy) {
  public:
    AutoWaivePolicy(JSContext *cx, HandleObject proxy, HandleId id,
                    BaseProxyHandler::Action act)
    {}
};
#endif
# 675 "../../dist/include/js/Proxy.h"

#ifdef JS_DEBUG
;
#else
# 681 "../../dist/include/js/Proxy.h"
inline void assertEnteredPolicy(JSContext *cx, JSObject *obj, jsid id,
                                BaseProxyHandler::Action act)
{}
#endif
# 685 "../../dist/include/js/Proxy.h"

;

} /* namespace js */

#endif /* js_Proxy_h */
# 692 "../../dist/include/js/Proxy.h"
# 13 "../../dist/include/jswrapper.h" 2

namespace js {

class DummyFrameGuard;

/*
 * Helper for Wrapper::New default options.
 *
 * Callers of Wrapper::New() who wish to specify a prototype for the created
 * Wrapper, *MUST* construct a WrapperOptions with a JSContext.
 * operations, but may restrict access to certain operations or instrument the
 * methods in various ways. A wrapper is distinct from a Direct Proxy Handler
 * in the sense that it can be "unwrapped" in C++, exposing the underlying
 * object (Direct Proxy Handlers have an underlying target object, but don't
 * expect to expose this object via any kind of unwrapping operation). Callers
 * should be careful to avoid unwrapping security wrappers in the wrong
 * context.
 */
class JS_FRIEND_API(Wrapper) : public DirectProxyHandler
{
    unsigned mFlags;

  public:
    using BaseProxyHandler::Action;

    enum Flags {
        CROSS_COMPARTMENT = 1 << 0,
        LAST_USED_FLAG = CROSS_COMPARTMENT
    };

    virtual bool defaultValue(JSContext *cx, HandleObject obj, JSType hint,
                              MutableHandleValue vp) const MOZ_OVERRIDE;

    ;

    ;

    ;

    ;

    

    

    virtual bool finalizeInBackground(Value priv) const MOZ_OVERRIDE;
    virtual bool isConstructor(JSObject *obj) const MOZ_OVERRIDE;

    static const char family;
    static const Wrapper singleton;
    static const Wrapper singletonWithPrototype;

    static JSObject *defaultProto;
};



/* Base class for all cross compartment wrapper handlers. */
class JS_FRIEND_API(CrossCompartmentWrapper) : public Wrapper
{
  public:
    

    /* Standard internal methods. */
    virtual bool getOwnPropertyDescriptor(JSContext *cx, HandleObject wrapper, HandleId id,
                                          MutableHandle<JSPropertyDescriptor> desc) const MOZ_OVERRIDE;
    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
                                MutableHandle<JSPropertyDescriptor> desc,
                                ObjectOpResult &result) const MOZ_OVERRIDE;
    virtual bool ownPropertyKeys(JSContext *cx, HandleObject wrapper,
                                 AutoIdVector &props) const MOZ_OVERRIDE;
    virtual bool delete_(JSContext *cx, HandleObject wrapper, HandleId id,
                         ObjectOpResult &result) const MOZ_OVERRIDE;
    virtual bool enumerate(JSContext *cx, HandleObject wrapper, MutableHandleObject objp) const MOZ_OVERRIDE;
    virtual bool getPrototype(JSContext *cx, HandleObject proxy,
                              MutableHandleObject protop) const MOZ_OVERRIDE;
    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,
                              MutableHandleValue vp) const MOZ_OVERRIDE;

    static const CrossCompartmentWrapper singleton;
    static const CrossCompartmentWrapper singletonWithPrototype;
};

/*
 * Base class for security wrappers. A security wrapper is potentially hiding
 * all or part of some wrapped object thus SecurityWrapper defaults to denying
 * access to the wrappee. This is the opposite of Wrapper which tries to be
 * completely transparent.
 *
 * NB: Currently, only a few ProxyHandler operations are overridden to deny
 * access, relying on derived SecurityWrapper to block access when necessary.
 */
template <class Base>
class JS_FRIEND_API(SecurityWrapper) : public Base
{
  public:
    

    virtual bool enter(JSContext *cx, HandleObject wrapper, HandleId id, Wrapper::Action act,
                       bool *bp) const MOZ_OVERRIDE;

    virtual bool defineProperty(JSContext *cx, HandleObject wrapper, HandleId id,
                                MutableHandle<JSPropertyDescriptor> desc,
                                ObjectOpResult &result) const MOZ_OVERRIDE;
    virtual bool isExtensible(JSContext *cx, HandleObject wrapper, bool *extensible) const MOZ_OVERRIDE;
    virtual bool preventExtensions(JSContext *cx, HandleObject wrapper,
                                   ObjectOpResult &result) const MOZ_OVERRIDE;
    virtual bool setPrototype(JSContext *cx, HandleObject proxy, HandleObject proto,
                              ObjectOpResult &result) const MOZ_OVERRIDE;
    virtual bool setImmutablePrototype(JSContext *cx, HandleObject proxy, bool *succeeded) const MOZ_OVERRIDE;

    virtual bool nativeCall(JSContext *cx, IsAcceptableThis test, NativeImpl impl,
                            CallArgs args) const MOZ_OVERRIDE;
    virtual bool objectClassIs(HandleObject obj, ESClassValue classValue,
                               JSContext *cx) const MOZ_OVERRIDE;
    virtual bool regexp_toShared(JSContext *cx, HandleObject proxy, RegExpGuard *g) const MOZ_OVERRIDE;
    virtual bool boxedValue_unbox(JSContext *cx, HandleObject proxy, MutableHandleValue vp) const MOZ_OVERRIDE;
    virtual bool defaultValue(JSContext *cx, HandleObject wrapper, JSType hint,
                              MutableHandleValue vp) const MOZ_OVERRIDE;

    // Allow isCallable and isConstructor. They used to be class-level, and so could not be guarded
    // against.

    virtual bool watch(JSContext *cx, JS::HandleObject proxy, JS::HandleId id,
                       JS::HandleObject callable) const MOZ_OVERRIDE;
    virtual bool unwatch(JSContext *cx, JS::HandleObject proxy, JS::HandleId id) const MOZ_OVERRIDE;

    /*
     * Allow our subclasses to select the superclass behavior they want without
     * needing to specify an exact superclass.
     */
    typedef Base Permissive;
    typedef SecurityWrapper<Base> Restrictive;
};

typedef SecurityWrapper<Wrapper> SameCompartmentSecurityWrapper;
typedef SecurityWrapper<CrossCompartmentWrapper> CrossCompartmentSecurityWrapper;

;

inline bool
IsWrapper(JSObject *obj)
{
    return IsProxy(obj) && GetProxyHandler(obj)->family() == &Wrapper::family;
}

// Given a JSObject, returns that object stripped of wrappers. If
// stopAtOuter is true, then this returns the outer window if it was
// previously wrapped. Otherwise, this returns the first object for
// which JSObject::isWrapper returns false.
JS_FRIEND_API(JSObject *)
UncheckedUnwrap(JSObject *obj, bool stopAtOuter = true, unsigned *flagsp = nullptr);

// Given a JSObject, returns that object stripped of wrappers. At each stage,
// the security wrapper has the opportunity to veto the unwrap. Since checked
// code should never be unwrapping outer window wrappers, we always stop at
// outer windows.
JS_FRIEND_API(JSObject *)
CheckedUnwrap(JSObject *obj, bool stopAtOuter = true);

// Unwrap only the outermost security wrapper, with the same semantics as
// above. This is the checked version of Wrapper::wrappedObject.
JS_FRIEND_API(JSObject *)
UnwrapOneChecked(JSObject *obj, bool stopAtOuter = true);

JS_FRIEND_API(bool)
IsCrossCompartmentWrapper(JSObject *obj);

;

;

JS_FRIEND_API(bool)
RemapAllWrappersForObject(JSContext *cx, JSObject *oldTarget,
                          JSObject *newTarget);

// API to recompute all cross-compartment wrappers whose source and target
// match the given filters.
JS_FRIEND_API(bool)
RecomputeWrappers(JSContext *cx, const CompartmentFilter &sourceFilter,
                  const CompartmentFilter &targetFilter);

} /* namespace js */

#endif /* jswrapper_h */
# 274 "../../dist/include/jswrapper.h"
# 12 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/Conversions.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/js/Conversions.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sts=4 et sw=4 tw=99:
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* ECMAScript conversion operations. */

#ifndef js_Conversions_h
#define js_Conversions_h

struct JSContext;

namespace js {

/* DO NOT CALL THIS. Use JS::ToBoolean. */
extern JS_PUBLIC_API(bool)
ToBooleanSlow(JS::HandleValue v);

/* DO NOT CALL THIS.  Use JS::ToNumber. */
extern JS_PUBLIC_API(bool)
ToNumberSlow(JSContext *cx, JS::Value v, double *dp);

/* DO NOT CALL THIS. Use JS::ToInt32. */
extern JS_PUBLIC_API(bool)
ToInt32Slow(JSContext *cx, JS::HandleValue v, int32_t *out);

/* DO NOT CALL THIS. Use JS::ToUint32. */
extern JS_PUBLIC_API(bool)
ToUint32Slow(JSContext *cx, JS::HandleValue v, uint32_t *out);

/* DO NOT CALL THIS. Use JS::ToUint16. */
extern JS_PUBLIC_API(bool)
ToUint16Slow(JSContext *cx, JS::HandleValue v, uint16_t *out);

/* DO NOT CALL THIS. Use JS::ToInt64. */
extern JS_PUBLIC_API(bool)
ToInt64Slow(JSContext *cx, JS::HandleValue v, int64_t *out);

/* DO NOT CALL THIS. Use JS::ToUint64. */
extern JS_PUBLIC_API(bool)
ToUint64Slow(JSContext *cx, JS::HandleValue v, uint64_t *out);

/* DO NOT CALL THIS. Use JS::ToString. */
extern JS_PUBLIC_API(JSString*)
ToStringSlow(JSContext *cx, JS::HandleValue v);

/* DO NOT CALL THIS. Use JS::ToObject. */
;

} // namespace js

namespace JS {

namespace detail {

#ifdef JS_DEBUG
/*
 * Assert that we're not doing GC on cx, that we're in a request as
 * needed, and that the compartments for cx and v are correct.
 * Also check that GC would be safe at this point.
 */
extern JS_PUBLIC_API(void)
AssertArgumentsAreSane(JSContext *cx, HandleValue v);
#else
# 78 "../../dist/include/js/Conversions.h"
inline void AssertArgumentsAreSane(JSContext *cx, HandleValue v)
{}
#endif /* JS_DEBUG */
# 81 "../../dist/include/js/Conversions.h"

} // namespace detail

/*
 * ES6 draft 20141224, 7.1.1, second algorithm.
 *
 * Most users shouldn't call this -- use JS::ToBoolean, ToNumber, or ToString
 * instead.  This will typically only be called from custom convert hooks that
 * wish to fall back to the ES6 default conversion behavior shared by most
 * objects in JS, codified as OrdinaryToPrimitive.
 */
;

/* ES6 draft 20141224, 7.1.2. */
MOZ_ALWAYS_INLINE bool
ToBoolean(HandleValue v)
{
    if (v.isBoolean())
        return v.toBoolean();
    if (v.isInt32())
        return v.toInt32() != 0;
    if (v.isNullOrUndefined())
        return false;
    if (v.isDouble()) {
        double d = v.toDouble();
        return !mozilla::IsNaN(d) && d != 0;
    }
    if (v.isSymbol())
        return true;

    /* The slow path handles strings and objects. */
    return js::ToBooleanSlow(v);
}

/* ES6 draft 20141224, 7.1.3. */
MOZ_ALWAYS_INLINE bool
ToNumber(JSContext *cx, HandleValue v, double *out)
{
    detail::AssertArgumentsAreSane(cx, v);

    if (v.isNumber()) {
        *out = v.toNumber();
        return true;
    }
    return js::ToNumberSlow(cx, v, out);
}

/* ES6 draft 20141224, ToInteger (specialized for doubles). */


/* ES6 draft 20141224, 7.1.5. */
MOZ_ALWAYS_INLINE bool
ToInt32(JSContext *cx, JS::HandleValue v, int32_t *out)
{
    detail::AssertArgumentsAreSane(cx, v);

    if (v.isInt32()) {
        *out = v.toInt32();
        return true;
    }
    return js::ToInt32Slow(cx, v, out);
}
MOZ_ALWAYS_INLINE bool
ToInt64(JSContext *cx, HandleValue v, int64_t *out)
{
    detail::AssertArgumentsAreSane(cx, v);

    if (v.isInt32()) {
        *out = int64_t(v.toInt32());
        return true;
    }
    return js::ToInt64Slow(cx, v, out);
}

/*
 * Non-standard, with behavior similar to that of ToUint32, except in its
 * producing a uint64_t.
 */
MOZ_ALWAYS_INLINE bool
ToUint64(JSContext *cx, HandleValue v, uint64_t *out)
{
    detail::AssertArgumentsAreSane(cx, v);

    if (v.isInt32()) {
        *out = uint64_t(v.toInt32());
        return true;
    }
    return js::ToUint64Slow(cx, v, out);
}

/* ES6 draft 20141224, 7.1.12. */
MOZ_ALWAYS_INLINE JSString*
ToString(JSContext *cx, HandleValue v)
{
    detail::AssertArgumentsAreSane(cx, v);

    if (v.isString())
        return v.toString();
    return js::ToStringSlow(cx, v);
}

/* ES6 draft 20141224, 7.1.13. */


namespace detail {

/*
 * Convert a double value to ResultType (an unsigned integral type) using
 * ECMAScript-style semantics (that is, in like manner to how ECMAScript's
 * ToInt32 converts to int32_t).
 *
 *   If d is infinite or NaN, return 0.
 *   Otherwise compute d2 = sign(d) * floor(abs(d)), and return the ResultType
 *   value congruent to d2 mod 2**(bit width of ResultType).
 *
 * The algorithm below is inspired by that found in
 * <http://trac.webkit.org/changeset/67825/trunk/JavaScriptCore/runtime/JSValue.cpp>
 * but has been generalized to all integer widths.
 */
template<typename ResultType>
inline ResultType
ToUintWidth(double d)
{
    static_assert(mozilla::IsUnsigned<ResultType>::value,
                  "ResultType must be an unsigned type");

    uint64_t bits = mozilla::BitwiseCast<uint64_t>(d);
    unsigned DoubleExponentShift = mozilla::FloatingPoint<double>::kExponentShift;

    // Extract the exponent component.  (Be careful here!  It's not technically
    // the exponent in NaN, infinities, and subnormals.)
    int_fast16_t exp =
        int_fast16_t((bits & mozilla::FloatingPoint<double>::kExponentBits) >> DoubleExponentShift) -
        int_fast16_t(mozilla::FloatingPoint<double>::kExponentBias);

    // If the exponent's less than zero, abs(d) < 1, so the result is 0.  (This
    // also handles subnormals.)
    if (exp < 0)
        return 0;

    uint_fast16_t exponent = mozilla::AssertedCast<uint_fast16_t>(exp);

    // If the exponent is greater than or equal to the bits of precision of a
    // double plus ResultType's width, the number is either infinite, NaN, or
    // too large to have lower-order bits in the congruent value.  (Example:
    // 2**84 is exactly representable as a double.  The next exact double is
    // 2**84 + 2**32.  Thus if ResultType is int32_t, an exponent >= 84 implies
    // floor(abs(d)) == 0 mod 2**32.)  Return 0 in all these cases.
    const size_t ResultWidth = CHAR_BIT * sizeof(ResultType);
    if (exponent >= DoubleExponentShift + ResultWidth)
        return 0;

    // The significand contains the bits that will determine the final result.
    // Shift those bits left or right, according to the exponent, to their
    // locations in the unsigned binary representation of floor(abs(d)).
    static_assert(sizeof(ResultType) <= sizeof(uint64_t),
                  "Left-shifting below would lose upper bits");
    ResultType result = (exponent > DoubleExponentShift)
                        ? ResultType(bits << (exponent - DoubleExponentShift))
                        : ResultType(bits >> (DoubleExponentShift - exponent));

    // Two further complications remain.  First, |result| may contain bogus
    // sign/exponent bits.  Second, IEEE-754 numbers' significands (excluding
    // subnormals, but we already handled those) have an implicit leading 1
    // which may affect the final result.
    //   |exponent| is negative, but we excluded that above.  So bogus bits
    //   need only |exponent < ResultWidth|.
    //   The implicit leading bit matters identically to the other case, so
    //   again, |exponent < ResultWidth|.
    if (exponent < ResultWidth) {
        ResultType implicitOne = ResultType(1) << exponent;
        result &= implicitOne - 1; // remove bogus bits
        result += implicitOne; // add the implicit bit
    }

    // Compute the congruent value in the signed range.
    return (bits & mozilla::FloatingPoint<double>::kSignBit) ? ~result + 1 : result;
}

template<typename ResultType>
inline ResultType
ToIntWidth(double d)
{
    static_assert(mozilla::IsSigned<ResultType>::value,
                  "ResultType must be a signed type");

    const ResultType MaxValue = (1ULL << (CHAR_BIT * sizeof(ResultType) - 1)) - 1;
    const ResultType MinValue = -MaxValue - 1;

    typedef typename mozilla::MakeUnsigned<ResultType>::Type UnsignedResult;
    UnsignedResult u = ToUintWidth<UnsignedResult>(d);
    if (u <= UnsignedResult(MaxValue))
        return static_cast<ResultType>(u);
    return (MinValue + static_cast<ResultType>(u - MaxValue)) - 1;
}

} // namespace detail

/* ES5 9.5 ToInt32 (specialized for doubles). */
inline int32_t
ToInt32(double d)
{
#if defined (__arm__) && defined (__GNUC__)
    int32_t i;
    uint32_t    tmp0;
    uint32_t    tmp1;
    uint32_t    tmp2;
    asm (
    // We use a pure integer solution here. In the 'softfp' ABI, the argument
    // will start in r0 and r1, and VFP can't do all of the necessary ECMA
    // conversions by itself so some integer code will be required anyway. A
    // hybrid solution is faster on A9, but this pure integer solution is
    // notably faster for A8.
"   orr     %Q4, %Q4, %2\n"
    // Negate the result if we have to, and move it to %0 in the process. To
    // avoid conditionals, we can do this by inverting on %R4[31], then adding
    // %R4[31]>>31.
"   eor     %Q4, %Q4, %R4, ASR #31\n"
"   add     %0, %Q4, %R4, LSR #31\n"
"   b       9f\n"
"8:\n"
    // +/-INFINITY, +/-0, subnormals, NaNs, and anything else out-of-range that
    // will result in a conversion of '0'.
"   mov     %0, #0\n"
"9:\n"
    : "=r" (i), "=&r" (tmp0), "=&r" (tmp1), "=&r" (tmp2), "=&r" (d)
    : "4" (d)
    : "cc"
        );
    return i;
#else
# 474 "../../dist/include/js/Conversions.h"
    return detail::ToIntWidth<int32_t>(d);
#endif
# 476 "../../dist/include/js/Conversions.h"
}

/* ES5 9.6 (specialized for doubles). */


/* WEBIDL 4.2.10 */


/* WEBIDL 4.2.11 */


} // namespace JS

#endif /* js_Conversions_h */
# 502 "../../dist/include/js/Conversions.h"
# 13 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ArrayUtils.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Alignment.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Array.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CallbackObject.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/CallbackObject.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * A common base class for representing WebIDL callback function and
 * callback interface types in C++.
 *
 * This class implements common functionality like lifetime
 * management, initialization with the JS object, and setup of the
 * call environment.  Subclasses are responsible for providing methods
 * that do the call into JS as needed.
 */

#ifndef mozilla_dom_CallbackObject_h
#define mozilla_dom_CallbackObject_h
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_HoldDropJSObjects_h
#define mozilla_HoldDropJSObjects_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/HoldDropJSObjects.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/HoldDropJSObjects.h"

class nsISupports;
class nsScriptObjectTracer;

// Only HoldJSObjects and DropJSObjects should be called directly.

namespace mozilla {
namespace cyclecollector {

// These methods are defined in nsCycleCollector.cpp
void HoldJSObjectsImpl(void* aHolder, nsScriptObjectTracer* aTracer);
void HoldJSObjectsImpl(nsISupports* aHolder);
void DropJSObjectsImpl(void* aHolder);
void DropJSObjectsImpl(nsISupports* aHolder);

} // namespace cyclecollector


template<class T, bool isISupports = IsBaseOf<nsISupports, T>::value>
struct HoldDropJSObjectsHelper
{
  
  
};

template<class T>
struct HoldDropJSObjectsHelper<T, true>
{
  static void Hold(T* aHolder)
  {
    cyclecollector::HoldJSObjectsImpl(ToSupports(aHolder));
  }
  static void Drop(T* aHolder)
  {
    cyclecollector::DropJSObjectsImpl(ToSupports(aHolder));
  }
};


template<class T>
void
HoldJSObjects(T* aHolder)
{
  HoldDropJSObjectsHelper<T>::Hold(aHolder);
}

template<class T>
void
DropJSObjects(T* aHolder)
{
  HoldDropJSObjectsHelper<T>::Drop(aHolder);
}

} // namespace mozilla

#endif // mozilla_HoldDropJSObjects_h
# 75 "../../dist/include/mozilla/HoldDropJSObjects.h"
# 27 "../../dist/include/mozilla/dom/CallbackObject.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/mozilla/dom/CallbackObject.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ScriptSettings.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/ScriptSettings.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// vim: ft=cpp tw=78 sw=2 et ts=2
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Utilities for managing the script settings object stack defined in webapps */

#ifndef mozilla_dom_ScriptSettings_h
#define mozilla_dom_ScriptSettings_h

#if 0 /* expanded by -frewrite-includes */
#include "MainThreadUtils.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/ScriptSettings.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIGlobalObject.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsIGlobalObject.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsIGlobalObject_h__
#define nsIGlobalObject_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsIGlobalObject.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsIGlobalObject.h"

#define NS_IGLOBALOBJECT_IID \
{ 0xe2538ded, 0x13ef, 0x4f4d, \
{ 0x94, 0x6b, 0x65, 0xd3, 0x33, 0xb4, 0xf0, 0x3c } }

class nsIPrincipal;

class nsIGlobalObject : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IGLOBALOBJECT_IID)

  virtual JSObject* GetGlobalJSObject() = 0;

  // This method is not meant to be overridden.
  ;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIGlobalObject,
                              NS_IGLOBALOBJECT_IID)

#endif // nsIGlobalObject_h__
# 33 "/Users/luser/build/mozilla-central/dom/base/nsIGlobalObject.h"
# 14 "../../dist/include/mozilla/dom/ScriptSettings.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrincipal.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIPrincipal.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIPrincipal.idl
 */

#ifndef __gen_nsIPrincipal_h__
#define __gen_nsIPrincipal_h__


#ifndef __gen_nsISerializable_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISerializable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISerializable.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsISerializable.idl
 */

#ifndef __gen_nsISerializable_h__
#define __gen_nsISerializable_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsISerializable.h"
#endif
# 12 "../../dist/include/nsISerializable.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsISerializable.h"
class nsIObjectInputStream; /* forward declaration */

class nsIObjectOutputStream; /* forward declaration */


/* starting interface:    nsISerializable */
#define NS_ISERIALIZABLE_IID_STR "91cca981-c26d-44a8-bebe-d9ed4891503a"

#define NS_ISERIALIZABLE_IID \
  {0x91cca981, 0xc26d, 0x44a8, \
    { 0xbe, 0xbe, 0xd9, 0xed, 0x48, 0x91, 0x50, 0x3a }}

class NS_NO_VTABLE nsISerializable : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISERIALIZABLE_IID)

  /* void read (in nsIObjectInputStream aInputStream); */
  NS_IMETHOD Read(nsIObjectInputStream *aInputStream) = 0;

  /* void write (in nsIObjectOutputStream aOutputStream); */
  NS_IMETHOD Write(nsIObjectOutputStream *aOutputStream) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsISerializable, NS_ISERIALIZABLE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISERIALIZABLE \
  NS_IMETHOD Read(nsIObjectInputStream *aInputStream) MOZ_OVERRIDE; \
  NS_IMETHOD Write(nsIObjectOutputStream *aOutputStream) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISERIALIZABLE(_to) \
  NS_IMETHOD Read(nsIObjectInputStream *aInputStream) MOZ_OVERRIDE { return _to Read(aInputStream); } \
  NS_IMETHOD Write(nsIObjectOutputStream *aOutputStream) MOZ_OVERRIDE { return _to Write(aOutputStream); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISERIALIZABLE(_to) \
  NS_IMETHOD Read(nsIObjectInputStream *aInputStream) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Read(aInputStream); } \
  NS_IMETHOD Write(nsIObjectOutputStream *aOutputStream) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Write(aOutputStream); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
}

/* void write (in nsIObjectOutputStream aOutputStream); */
NS_IMETHODIMP nsSerializable::Write(nsIObjectOutputStream *aOutputStream)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 105 "../../dist/include/nsISerializable.h"


#endif /* __gen_nsISerializable_h__ */
# 108 "../../dist/include/nsISerializable.h"
# 11 "../../dist/include/nsIPrincipal.h" 2
#endif
# 12 "../../dist/include/nsIPrincipal.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsIPrincipal.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsIPrincipal.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
#define NS_IPRINCIPAL_IID_STR "204555e7-04ad-4cc8-9f0e-840615cc43e8"

#define NS_IPRINCIPAL_IID \
  {0x204555e7, 0x04ad, 0x4cc8, \
    { 0x9f, 0x0e, 0x84, 0x06, 0x15, 0xcc, 0x43, 0xe8 }}

class nsIPrincipal : public nsISerializable {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPRINCIPAL_IID)

  /* boolean equals (in nsIPrincipal other); */
  NS_IMETHOD Equals(nsIPrincipal *other, bool *_retval) = 0;

  /* boolean equalsConsideringDomain (in nsIPrincipal other); */
  NS_IMETHOD EqualsConsideringDomain(nsIPrincipal *other, bool *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrincipal, NS_IPRINCIPAL_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPRINCIPAL \
  NS_IMETHOD Equals(nsIPrincipal *other, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD EqualsConsideringDomain(nsIPrincipal *other, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetHashValue(uint32_t *aHashValue) MOZ_OVERRIDE; \
  NS_IMETHOD GetURI(nsIURI * *aURI) MOZ_OVERRIDE; \
  NS_IMETHOD GetDomain(nsIURI * *aDomain) MOZ_OVERRIDE; \
  NS_IMETHOD SetDomain(nsIURI *aDomain) MOZ_OVERRIDE; \
  NS_IMETHOD GetOrigin(char * *aOrigin) MOZ_OVERRIDE; \
  NS_IMETHOD Subsumes(nsIPrincipal *other, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD SubsumesConsideringDomain(nsIPrincipal *other, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetIsNullPrincipal(bool *aIsNullPrincipal) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsNullPrincipal(aIsNullPrincipal); } 

#if 0
}

/* End of implementation class template. */
#endif
# 448 "../../dist/include/nsIPrincipal.h"


#endif /* __gen_nsIPrincipal_h__ */
# 451 "../../dist/include/nsIPrincipal.h"
# 15 "../../dist/include/mozilla/dom/ScriptSettings.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Maybe.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/ScriptSettings.h"

#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/dom/ScriptSettings.h"

class nsPIDOMWindow;
class nsGlobalWindow;
class nsIScriptContext;
class nsIDocument;
class nsIDocShell;

namespace mozilla {
namespace dom {

// For internal use only - use AutoJSAPI instead.
namespace danger {

/**
 * Fundamental cx pushing class. All other cx pushing classes are implemented
 * in terms of this class.
 */
class MOZ_STACK_CLASS AutoCxPusher
{
public:
  ;
  ;

  

  // Returns true if this AutoCxPusher performed the push that is currently at
  // the top of the cx stack.
  bool IsStackTop() const;

private:
  mozilla::Maybe<JSAutoRequest> mAutoRequest;
  nsCOMPtr<nsIScriptContext> mScx;
  uint32_t mStackDepthAfterPush;
#ifdef DEBUG
  JSContext* mPushedContext;
  unsigned mCompartmentDepthOnEntry;
#endif
# 56 "../../dist/include/mozilla/dom/ScriptSettings.h"
};

} /* namespace danger */

class ScriptSettingsStackEntry {
  friend class ScriptSettingsStack;

public:
  ;

  

protected:
  ;

  nsCOMPtr<nsIGlobalObject> mGlobalObject;
  bool mIsCandidateEntryPoint;

private:
  // This constructor is only for use by AutoNoJSAPI.
  friend class AutoNoJSAPI;
  ;

  ScriptSettingsStackEntry *mOlder;
};

/*
 * For any interaction with JSAPI, an AutoJSAPI (or one of its subclasses)
 * must be on the stack.
 *
 * This base class should be instantiated as-is when the caller wants to use
 * JSAPI but doesn't expect to run script. The caller must then call one of its
 * Init functions before being able to access the JSContext through cx().
 * Its current duties are as-follows (see individual Init comments for details):
 *
 *   JSAutoRequests may go away.
 *
 * In situations where the consumer expects to run script, AutoEntryScript
 * should be used, which does additional manipulation of the script settings
 * stack. In bug 991758, we'll add hard invariants to SpiderMonkey, such that
 * any attempt to run script without an AutoEntryScript on the stack will
 * fail. This prevents system code from accidentally triggering script
 * execution at inopportune moments via surreptitious getters and proxies.
 */
class MOZ_STACK_CLASS AutoJSAPI {
public:
  // Trivial constructor. One of the Init functions must be called before
  // accessing the JSContext through cx().
  ;

  bool mOldAutoJSAPIOwnsErrorReporting;
  Maybe<JSErrorReporter> mOldErrorReporter;

  void InitInternal(JSObject* aGlobal, JSContext* aCx, bool aIsMainThread);

  AutoJSAPI(const AutoJSAPI&) = delete;
  AutoJSAPI& operator= (const AutoJSAPI&) = delete;
};

/*
 * A class that represents a new script entry point.
 */
class MOZ_STACK_CLASS AutoEntryScript : public AutoJSAPI,
                                        protected ScriptSettingsStackEntry {
public:
  explicit AutoEntryScript(nsIGlobalObject* aGlobalObject,
                  bool aIsMainThread = NS_IsMainThread(),
                  // Note: aCx is mandatory off-main-thread.
                  JSContext* aCx = nullptr);

  ~AutoEntryScript();

  

private:
  // It's safe to make this a weak pointer, since it's the subject principal
  // when we go on the stack, so can't go away until after we're gone.  In
  // particular, this is only used from the CallSetup constructor, and only in
  // the aIsJSImplementedWebIDL case.  And in that case, the subject principal
  // is the principal of the callee function that is part of the CallArgs just a
  // bit up the stack, and which will outlive us.  So we know the principal
  // can't go away until then either.
  nsIPrincipal* MOZ_NON_OWNING_REF mWebIDLCallerPrincipal;
  ;

  nsCOMPtr<nsIDocShell> mDocShellForJSRunToCompletion;

  bool mIsMainThread;
};

/*
 * A class that can be used to force a particular incumbent script on the stack.
 */
class AutoIncumbentScript : protected ScriptSettingsStackEntry {
public:
  ;
private:
  JS::AutoHideScriptedCaller mCallerOverride;
};
} // namespace dom

/**
 * Use AutoJSContext when you need a JS context on the stack but don't have one
 * passed as a parameter. AutoJSContext will take care of finding the most
 * appropriate JS context and release it when leaving the stack.
 */
class MOZ_STACK_CLASS AutoJSContext {
public:
  ;
  ;

protected:
  ;

  // We need this Init() method because we can't use delegating constructor for
  // the moment. It is a C++11 feature and we do not require C++11 to be
  // supported to be able to compile Gecko.
  ;

  JSContext* mCx;
  dom::AutoJSAPI mJSAPI;
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

/**
 * Use ThreadsafeAutoJSContext when you want an AutoJSContext but might be
 * running on a worker thread.
 */
class MOZ_STACK_CLASS ThreadsafeAutoJSContext {
public:
  explicit ThreadsafeAutoJSContext(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM);
  ;

private:
  JSContext* mCx; // Used on workers.  Null means mainthread.
  Maybe<JSAutoRequest> mRequest; // Used on workers.
  Maybe<AutoJSContext> mAutoJSContext; // Used on main thread.
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

/**
 * AutoSafeJSContext is similar to AutoJSContext but will only return the safe
 * JS context. That means it will never call nsContentUtils::GetCurrentJSContext().
 *
 * Note - This is deprecated. Please use AutoJSAPI instead.
 */
class MOZ_STACK_CLASS AutoSafeJSContext : public AutoJSContext {
public:
  ;
private:
  JSAutoCompartment mAc;
};

/**
 * Like AutoSafeJSContext but can be used safely on worker threads.
 */
class MOZ_STACK_CLASS ThreadsafeAutoSafeJSContext {
public:
  ;
  ;

private:
  JSContext* mCx; // Used on workers.  Null means mainthread.
  Maybe<JSAutoRequest> mRequest; // Used on workers.
  Maybe<AutoSafeJSContext> mAutoSafeJSContext; // Used on main thread.
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};


} // namespace mozilla

#endif // mozilla_dom_ScriptSettings_h
# 450 "../../dist/include/mozilla/dom/ScriptSettings.h"
# 29 "../../dist/include/mozilla/dom/CallbackObject.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsContentUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* A namespace class for static content utilities. */

#ifndef nsContentUtils_h___
#define nsContentUtils_h___

#if defined(XP_WIN)
#if 0 /* expanded by -frewrite-includes */
#include <float.h>
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h"
#endif
# 15 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h"

#if defined(SOLARIS)
#if 0 /* expanded by -frewrite-includes */
#include <ieeefp.h>
#endif /* expanded by -frewrite-includes */

// This is a callback function type that can be used to implement an
// arbitrary matching algorithm.  aContent is the content that may
// match the list, while aNamespaceID, aAtom, and aData are whatever
// was passed to the list's constructor.
typedef bool (*nsContentListMatchFunc)(nsIContent* aContent,
                                       int32_t aNamespaceID,
                                       nsIAtom* aAtom,
                                       void* aData);

#include "Units.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/Units.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZ_UNITS_H_
#define MOZ_UNITS_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Coord.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/Units.h"

#ifndef MOZILLA_GFX_SCALEFACTOR_H_
#define MOZILLA_GFX_SCALEFACTOR_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/ScaleFactor.h"

#if 0 /* expanded by -frewrite-includes */
#include "gfxPoint.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/gfx/ScaleFactor.h"

namespace mozilla {
namespace gfx {

/*
 * This class represents a scaling factor between two different pixel unit
 * systems. This is effectively a type-safe float, intended to be used in
 * combination with the known-type instances of gfx::Point, gfx::Rect, etc.
 *
 * Note that some parts of the code that pre-date this class used separate
 * scaling factors for the x and y axes. However, at runtime these values
 * were always expected to be the same, so this class uses only one scale
 * factor for both axes. The two constructors that take two-axis scaling
 * factors check to ensure that this assertion holds.
 */
template<class src, class dst>
struct ScaleFactor {
  float scale;

  MOZ_CONSTEXPR 
  MOZ_CONSTEXPR ScaleFactor(const ScaleFactor<src, dst>& aCopy) : scale(aCopy.scale) {}
  explicit MOZ_CONSTEXPR ScaleFactor(float aScale) : scale(aScale) {}

  

  

  bool operator==(const ScaleFactor<src, dst>& aOther) const {
    return scale == aOther.scale;
  }

  

  bool operator<(const ScaleFactor<src, dst>& aOther) const {
    return scale < aOther.scale;
  }

  bool operator<=(const ScaleFactor<src, dst>& aOther) const {
    return scale <= aOther.scale;
  }

  

  

  template<class other>
  ScaleFactor<other, dst> operator/(const ScaleFactor<src, other>& aOther) const {
    return ScaleFactor<other, dst>(scale / aOther.scale);
  }

  template<class other>
  ScaleFactor<src, other> operator/(const ScaleFactor<other, dst>& aOther) const {
    return ScaleFactor<src, other>(scale / aOther.scale);
  }

  template<class other>
  ScaleFactor<src, other> operator*(const ScaleFactor<dst, other>& aOther) const {
    return ScaleFactor<src, other>(scale * aOther.scale);
  }

  template<class other>
  ScaleFactor<other, dst> operator*(const ScaleFactor<other, src>& aOther) const {
    return ScaleFactor<other, dst>(scale * aOther.scale);
  }
};

}
}

#endif /* MOZILLA_GFX_SCALEFACTOR_H_ */
# 92 "../../dist/include/mozilla/gfx/ScaleFactor.h"
# 14 "../../dist/include/Units.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsRect.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/Units.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsMargin.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/Units.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/AppUnits.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/Units.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/Units.h"

namespace mozilla {

template <typename T>
struct IsPixel : FalseType {};

// See struct declaration for a description of each unit type.
struct CSSPixel;
struct LayoutDevicePixel;
struct LayerPixel;
struct RenderTargetPixel;
struct ScreenPixel;
struct ParentLayerPixel;

template<> struct IsPixel<CSSPixel>          : TrueType {};
template<> struct IsPixel<LayoutDevicePixel> : TrueType {};
template<> struct IsPixel<LayerPixel>        : TrueType {};
template<> struct IsPixel<RenderTargetPixel> : TrueType {};
template<> struct IsPixel<ScreenPixel>       : TrueType {};
template<> struct IsPixel<ParentLayerPixel>  : TrueType {};

typedef gfx::CoordTyped<CSSPixel> CSSCoord;
typedef gfx::IntCoordTyped<CSSPixel> CSSIntCoord;
typedef gfx::PointTyped<CSSPixel> CSSPoint;
typedef gfx::IntPointTyped<CSSPixel> CSSIntPoint;
typedef gfx::SizeTyped<CSSPixel> CSSSize;
typedef gfx::IntSizeTyped<CSSPixel> CSSIntSize;
typedef gfx::RectTyped<CSSPixel> CSSRect;
typedef gfx::IntRectTyped<CSSPixel> CSSIntRect;
typedef gfx::MarginTyped<CSSPixel> CSSMargin;
typedef gfx::IntMarginTyped<CSSPixel> CSSIntMargin;

typedef gfx::CoordTyped<LayoutDevicePixel> LayoutDeviceCoord;
typedef gfx::IntCoordTyped<LayoutDevicePixel> LayoutDeviceIntCoord;
typedef gfx::PointTyped<LayoutDevicePixel> LayoutDevicePoint;
typedef gfx::IntPointTyped<LayoutDevicePixel> LayoutDeviceIntPoint;
typedef gfx::SizeTyped<LayoutDevicePixel> LayoutDeviceSize;
typedef gfx::IntSizeTyped<LayoutDevicePixel> LayoutDeviceIntSize;
typedef gfx::RectTyped<LayoutDevicePixel> LayoutDeviceRect;
typedef gfx::IntRectTyped<LayoutDevicePixel> LayoutDeviceIntRect;
typedef gfx::MarginTyped<LayoutDevicePixel> LayoutDeviceMargin;
typedef gfx::IntMarginTyped<LayoutDevicePixel> LayoutDeviceIntMargin;

typedef gfx::CoordTyped<LayerPixel> LayerCoord;
typedef gfx::IntCoordTyped<LayerPixel> LayerIntCoord;
typedef gfx::PointTyped<LayerPixel> LayerPoint;
typedef gfx::IntPointTyped<LayerPixel> LayerIntPoint;
typedef gfx::SizeTyped<LayerPixel> LayerSize;
typedef gfx::IntSizeTyped<LayerPixel> LayerIntSize;
typedef gfx::RectTyped<LayerPixel> LayerRect;
typedef gfx::IntRectTyped<LayerPixel> LayerIntRect;
typedef gfx::MarginTyped<LayerPixel> LayerMargin;
typedef gfx::IntMarginTyped<LayerPixel> LayerIntMargin;

typedef gfx::PointTyped<RenderTargetPixel> RenderTargetPoint;
typedef gfx::IntPointTyped<RenderTargetPixel> RenderTargetIntPoint;
typedef gfx::SizeTyped<RenderTargetPixel> RenderTargetSize;
typedef gfx::IntSizeTyped<RenderTargetPixel> RenderTargetIntSize;
typedef gfx::RectTyped<RenderTargetPixel> RenderTargetRect;
typedef gfx::IntRectTyped<RenderTargetPixel> RenderTargetIntRect;
typedef gfx::MarginTyped<RenderTargetPixel> RenderTargetMargin;
typedef gfx::IntMarginTyped<RenderTargetPixel> RenderTargetIntMargin;

typedef gfx::CoordTyped<ScreenPixel> ScreenCoord;
typedef gfx::IntCoordTyped<ScreenPixel> ScreenIntCoord;
typedef gfx::PointTyped<ScreenPixel> ScreenPoint;
typedef gfx::IntPointTyped<ScreenPixel> ScreenIntPoint;
typedef gfx::SizeTyped<ScreenPixel> ScreenSize;
typedef gfx::IntSizeTyped<ScreenPixel> ScreenIntSize;
typedef gfx::RectTyped<ScreenPixel> ScreenRect;
typedef gfx::IntRectTyped<ScreenPixel> ScreenIntRect;
typedef gfx::MarginTyped<ScreenPixel> ScreenMargin;
typedef gfx::IntMarginTyped<ScreenPixel> ScreenIntMargin;

typedef gfx::CoordTyped<ParentLayerPixel> ParentLayerCoord;
typedef gfx::IntCoordTyped<ParentLayerPixel> ParentLayerIntCoord;
typedef gfx::PointTyped<ParentLayerPixel> ParentLayerPoint;
typedef gfx::IntPointTyped<ParentLayerPixel> ParentLayerIntPoint;
typedef gfx::SizeTyped<ParentLayerPixel> ParentLayerSize;
typedef gfx::IntSizeTyped<ParentLayerPixel> ParentLayerIntSize;
typedef gfx::RectTyped<ParentLayerPixel> ParentLayerRect;
typedef gfx::IntRectTyped<ParentLayerPixel> ParentLayerIntRect;
typedef gfx::MarginTyped<ParentLayerPixel> ParentLayerMargin;
typedef gfx::IntMarginTyped<ParentLayerPixel> ParentLayerIntMargin;

typedef gfx::ScaleFactor<CSSPixel, LayoutDevicePixel> CSSToLayoutDeviceScale;
typedef gfx::ScaleFactor<CSSPixel, LayerPixel> CSSToLayerScale;
typedef gfx::ScaleFactor<CSSPixel, ScreenPixel> CSSToScreenScale;
typedef gfx::ScaleFactor<CSSPixel, ParentLayerPixel> CSSToParentLayerScale;
typedef gfx::ScaleFactor<LayoutDevicePixel, CSSPixel> LayoutDeviceToCSSScale;
typedef gfx::ScaleFactor<LayoutDevicePixel, LayerPixel> LayoutDeviceToLayerScale;
typedef gfx::ScaleFactor<LayoutDevicePixel, ScreenPixel> LayoutDeviceToScreenScale;
typedef gfx::ScaleFactor<LayoutDevicePixel, ParentLayerPixel> LayoutDeviceToParentLayerScale;
typedef gfx::ScaleFactor<LayerPixel, CSSPixel> LayerToCSSScale;
typedef gfx::ScaleFactor<LayerPixel, LayoutDevicePixel> LayerToLayoutDeviceScale;
typedef gfx::ScaleFactor<LayerPixel, RenderTargetPixel> LayerToRenderTargetScale;
typedef gfx::ScaleFactor<LayerPixel, ScreenPixel> LayerToScreenScale;
typedef gfx::ScaleFactor<LayerPixel, ParentLayerPixel> LayerToParentLayerScale;
typedef gfx::ScaleFactor<RenderTargetPixel, ScreenPixel> RenderTargetToScreenScale;
typedef gfx::ScaleFactor<ScreenPixel, CSSPixel> ScreenToCSSScale;
typedef gfx::ScaleFactor<ScreenPixel, LayoutDevicePixel> ScreenToLayoutDeviceScale;
typedef gfx::ScaleFactor<ScreenPixel, LayerPixel> ScreenToLayerScale;
typedef gfx::ScaleFactor<ScreenPixel, ParentLayerPixel> ScreenToParentLayerScale;
typedef gfx::ScaleFactor<ParentLayerPixel, LayerPixel> ParentLayerToLayerScale;
typedef gfx::ScaleFactor<ParentLayerPixel, ScreenPixel> ParentLayerToScreenScale;
typedef gfx::ScaleFactor<ParentLayerPixel, ParentLayerPixel> ParentLayerToParentLayerScale;

/*
 * The pixels that content authors use to specify sizes in.
 */
struct CSSPixel {

  // Conversions from app units

  

  

  

  

  

  

  // Conversions to app units

  

  

  
};

/*
 * The pixels that are referred to as "device pixels" in layout code. In
 * general values measured in LayoutDevicePixels are obtained by dividing a
 * value in app units by AppUnitsPerDevPixel(). Conversion between CSS pixels
 * and LayoutDevicePixels is affected by:
 * 1) the "full zoom" (see nsPresContext::SetFullZoom)
 * 2) the "widget scale" (see nsIWidget::GetDefaultScale)
 */
struct LayoutDevicePixel {
  

  

  

  

  

  

  

  

  

  

  

  
};

/*
 * The pixels that layout rasterizes and delivers to the graphics code.
 * These also are generally referred to as "device pixels" in layout code.
 * Conversion between CSS pixels and LayerPixels is affected by:
 * 1) the "display resolution" (see nsIPresShell::SetResolution)
 * 2) the "full zoom" (see nsPresContext::SetFullZoom)
 * 3) the "widget scale" (see nsIWidget::GetDefaultScale)
 * 4) rasterizing at a different scale in the presence of some CSS transforms
 */
struct LayerPixel {
  

  

  

  


  

  

  
};

/*
 * The pixels that are displayed on the screen.
 * On non-OMTC platforms this should be equivalent to LayerPixel units.
 * On OMTC platforms these may diverge from LayerPixel units temporarily,
 * while an asynchronous zoom is happening, but should eventually converge
 * back to LayerPixel units. Some variables (such as those representing
 * chrome UI element sizes) that are not subject to content zoom should
 * generally be represented in ScreenPixel units.
 */
struct ScreenPixel {
  
};

/* The layer coordinates of the parent frame.
 * This can be arrived at in three ways:
 *   - Start with the CSS coordinates of the parent frame, multiply by the
 *     device scale and the cumulative resolution of the parent frame.
 *   - Start with the CSS coordinates of current frame, multiply by the device
 *     scale, the cumulative resolution of the current frame, and the scales
 *     from the CSS and async transforms of the current frame.
 *   - Start with global screen coordinates and unapply all CSS and async
 *     transforms from the root down to and including the parent.
 * It's helpful to look at https://wiki.mozilla.org/Platform/GFX/APZ#Coordinate_systems
 * to get a picture of how the various coordinate systems relate to each other.
 */
struct ParentLayerPixel {
  
};

// Operators to apply ScaleFactors directly to Coords, Points, Rects, Sizes and Margins

















}

#endif
# 454 "../../dist/include/Units.h"
# 30 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/AutocompleteInfoBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/AutocompleteInfoBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_AutocompleteInfoBinding_h
#define mozilla_dom_AutocompleteInfoBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/AutocompleteInfoBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/AutocompleteInfoBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/AutocompleteInfoBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/AutocompleteInfoBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/AutocompleteInfoBinding.h"

namespace mozilla {
namespace dom {

struct AutocompleteInfoAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

struct AutocompleteInfo : public DictionaryBase
{
  nsString mAddressType;
  nsString mContactType;
  nsString mFieldName;
  nsString mSection;

  ;

private:
  ;
};

namespace binding_detail {
struct FastAutocompleteInfo : public AutocompleteInfo
{
  
};
} // namespace binding_detail


} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_AutocompleteInfoBinding_h
# 83 "../../dist/include/mozilla/dom/AutocompleteInfoBinding.h"
# 31 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ScriptSettings.h"
#endif /* expanded by -frewrite-includes */
# 32 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/FloatingPoint.h"
#endif /* expanded by -frewrite-includes */
# 33 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/net/ReferrerPolicy.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/net/ReferrerPolicy.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef ReferrerPolicy_h__
#define ReferrerPolicy_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/net/ReferrerPolicy.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIHttpChannel.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIHttpChannel.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIHttpChannel.idl
 */

#ifndef __gen_nsIHttpChannel_h__
#define __gen_nsIHttpChannel_h__


#ifndef __gen_nsIChannel_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIChannel.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIChannel.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIChannel.idl
 */

#ifndef __gen_nsIChannel_h__
#define __gen_nsIChannel_h__


#ifndef __gen_nsIRequest_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIRequest.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIRequest.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIRequest.idl
 */

#ifndef __gen_nsIRequest_h__
#define __gen_nsIRequest_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIRequest.h"
#endif
# 12 "../../dist/include/nsIRequest.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIRequest.h"
class nsILoadGroup; /* forward declaration */

typedef uint32_t  nsLoadFlags;


/* starting interface:    nsIRequest */
#define NS_IREQUEST_IID_STR "ef6bfbd2-fd46-48d8-96b7-9f8f0fd387fe"

#define NS_IREQUEST_IID \
  {0xef6bfbd2, 0xfd46, 0x48d8, \
    { 0x96, 0xb7, 0x9f, 0x8f, 0x0f, 0xd3, 0x87, 0xfe }}

class NS_NO_VTABLE nsIRequest : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IREQUEST_IID)

  /* readonly attribute AUTF8String name; */
  NS_IMETHOD GetName(nsACString & aName) = 0;

  /* boolean isPending (); */
  NS_IMETHOD IsPending(bool *_retval) = 0;

  /* readonly attribute nsresult status; */
  NS_IMETHOD GetStatus(nsresult *aStatus) = 0;

  /* void cancel (in nsresult aStatus); */
  NS_IMETHOD Cancel(nsresult aStatus) = 0;

  /* void suspend (); */
  NS_IMETHOD Suspend(void) = 0;

  /* void resume (); */
  NS_IMETHOD Resume(void) = 0;

  /* attribute nsILoadGroup loadGroup; */
  NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup) = 0;
  NS_IMETHOD SetLoadGroup(nsILoadGroup *aLoadGroup) = 0;

  /* attribute nsLoadFlags loadFlags; */
  NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags) = 0;
  NS_IMETHOD SetLoadFlags(nsLoadFlags aLoadFlags) = 0;

  enum {
    LOAD_REQUESTMASK = 65535U,
    LOAD_NORMAL = 0U,
    LOAD_BACKGROUND = 1U,
    INHIBIT_PIPELINE = 64U,
    INHIBIT_CACHING = 128U,
    INHIBIT_PERSISTENT_CACHING = 256U,
    LOAD_BYPASS_CACHE = 512U,
    LOAD_FROM_CACHE = 1024U,
    VALIDATE_ALWAYS = 2048U,
    VALIDATE_NEVER = 4096U,
    VALIDATE_ONCE_PER_SESSION = 8192U,
    LOAD_ANONYMOUS = 16384U,
    LOAD_FRESH_CONNECTION = 32768U
  };

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIRequest, NS_IREQUEST_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIREQUEST \
  NS_IMETHOD GetName(nsACString & aName) MOZ_OVERRIDE; \
  NS_IMETHOD IsPending(bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetStatus(nsresult *aStatus) MOZ_OVERRIDE; \
  NS_IMETHOD Cancel(nsresult aStatus) MOZ_OVERRIDE; \
  NS_IMETHOD Suspend(void) MOZ_OVERRIDE; \
  NS_IMETHOD Resume(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetLoadGroup(nsILoadGroup * *aLoadGroup) MOZ_OVERRIDE; \
  NS_IMETHOD SetLoadGroup(nsILoadGroup *aLoadGroup) MOZ_OVERRIDE; \
  NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags) MOZ_OVERRIDE; \
  NS_IMETHOD SetLoadFlags(nsLoadFlags aLoadFlags) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIREQUEST(_to) \
  NS_IMETHOD GetName(nsACString & aName) MOZ_OVERRIDE { return _to GetName(aName); } \
  NS_IMETHOD IsPending(bool *_retval) MOZ_OVERRIDE { return _to IsPending(_retval); } \
  NS_IMETHOD GetStatus(nsresult *aStatus) MOZ_OVERRIDE { return _to GetStatus(aStatus); } \
  NS_IMETHOD Cancel(nsresult aStatus) MOZ_OVERRIDE { return _to Cancel(aStatus); } \
  NS_IMETHOD Suspend(void) MOZ_OVERRIDE { return _to Suspend(); } \
  NS_IMETHOD Resume(void) MOZ_OVERRIDE { return _to Resume(); } \
  NS_IMETHOD SetLoadFlags(nsLoadFlags aLoadFlags) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetLoadFlags(aLoadFlags); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsRequest : public nsIRequest
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIREQUEST

  nsRequest();

private:
  ~nsRequest();

protected:

/* attribute nsLoadFlags loadFlags; */
NS_IMETHODIMP nsRequest::GetLoadFlags(nsLoadFlags *aLoadFlags)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsRequest::SetLoadFlags(nsLoadFlags aLoadFlags)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 209 "../../dist/include/nsIRequest.h"


#endif /* __gen_nsIRequest_h__ */
# 212 "../../dist/include/nsIRequest.h"
# 11 "../../dist/include/nsIChannel.h" 2
#endif
# 12 "../../dist/include/nsIChannel.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIChannel.h"
class nsIURI; /* forward declaration */

class nsIInterfaceRequestor; /* forward declaration */

class nsIInputStream; /* forward declaration */

class nsIStreamListener; /* forward declaration */

class nsILoadInfo; /* forward declaration */


/* starting interface:    nsIChannel */
#define NS_ICHANNEL_IID_STR "1bc48693-c45d-45f4-8ab1-46e323037fe1"

#define NS_ICHANNEL_IID \
  {0x1bc48693, 0xc45d, 0x45f4, \
    { 0x8a, 0xb1, 0x46, 0xe3, 0x23, 0x03, 0x7f, 0xe1 }}

class NS_NO_VTABLE nsIChannel : public nsIRequest {
  NS_IMETHOD SetContentLength(int64_t aContentLength) = 0;

  /* nsIInputStream open (); */
  NS_IMETHOD Open(nsIInputStream * *_retval) = 0;

  /* void asyncOpen (in nsIStreamListener aListener, in nsISupports aContext); */
  NS_IMETHOD AsyncOpen(nsIStreamListener *aListener, nsISupports *aContext) = 0;

  enum {
    LOAD_DOCUMENT_URI = 65536U,
    LOAD_RETARGETED_DOCUMENT_URI = 131072U,
    LOAD_REPLACE = 262144U,
    LOAD_INITIAL_DOCUMENT_URI = 524288U,
    LOAD_TARGETED = 1048576U,
    LOAD_CALL_CONTENT_SNIFFERS = 2097152U,
    LOAD_CLASSIFY_URI = 4194304U,
    LOAD_MEDIA_SNIFFER_OVERRIDES_CONTENT_TYPE = 8388608U,
    LOAD_EXPLICIT_CREDENTIALS = 16777216U
  };

  /* attribute unsigned long contentDisposition; */
  NS_IMETHOD GetContentDisposition(uint32_t *aContentDisposition) = 0;
  NS_IMETHOD SetContentDisposition(uint32_t aContentDisposition) = 0;

  enum {
    DISPOSITION_INLINE = 0U,
    DISPOSITION_ATTACHMENT = 1U
  };

  /* attribute AString contentDispositionFilename; */
  NS_IMETHOD GetContentDispositionFilename(nsAString & aContentDispositionFilename) = 0;
  NS_IMETHOD SetContentDispositionFilename(const nsAString & aContentDispositionFilename) = 0;

  /* readonly attribute ACString contentDispositionHeader; */
  NS_IMETHOD GetContentDispositionHeader(nsACString & aContentDispositionHeader) = 0;

  /* attribute nsILoadInfo loadInfo; */
  NS_IMETHOD GetLoadInfo(nsILoadInfo * *aLoadInfo) = 0;
  NS_IMETHOD SetLoadInfo(nsILoadInfo *aLoadInfo) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIChannel, NS_ICHANNEL_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICHANNEL \
  NS_IMETHOD GetContentCharset(nsACString & aContentCharset) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentCharset(aContentCharset); } \
  NS_IMETHOD SetContentCharset(const nsACString & aContentCharset) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetContentCharset(aContentCharset); } \
  NS_IMETHOD GetContentLength(int64_t *aContentLength) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentLength(aContentLength); } \
  NS_IMETHOD SetContentLength(int64_t aContentLength) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetContentLength(aContentLength); } \
  NS_IMETHOD Open(nsIInputStream * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Open(_retval); } \
  NS_IMETHOD AsyncOpen(nsIStreamListener *aListener, nsISupports *aContext) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncOpen(aListener, aContext); } \
  NS_IMETHOD GetContentDisposition(uint32_t *aContentDisposition) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentDisposition(aContentDisposition); } \
  NS_IMETHOD SetContentDisposition(uint32_t aContentDisposition) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetContentDisposition(aContentDisposition); } \
  NS_IMETHOD GetContentDispositionFilename(nsAString & aContentDispositionFilename) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentDispositionFilename(aContentDispositionFilename); } \
  NS_IMETHOD SetContentDispositionFilename(const nsAString & aContentDispositionFilename) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetContentDispositionFilename(aContentDispositionFilename); } \
  NS_IMETHOD GetContentDispositionHeader(nsACString & aContentDispositionHeader) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentDispositionHeader(aContentDispositionHeader); } \
  NS_IMETHOD GetLoadInfo(nsILoadInfo * *aLoadInfo) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLoadInfo(aLoadInfo); } \
  NS_IMETHOD SetLoadInfo(nsILoadInfo *aLoadInfo) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetLoadInfo(aLoadInfo); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
NS_IMETHODIMP nsChannel::GetLoadInfo(nsILoadInfo * *aLoadInfo)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsChannel::SetLoadInfo(nsILoadInfo *aLoadInfo)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 344 "../../dist/include/nsIChannel.h"


#endif /* __gen_nsIChannel_h__ */
# 347 "../../dist/include/nsIChannel.h"
# 11 "../../dist/include/nsIHttpChannel.h" 2
#endif
# 12 "../../dist/include/nsIHttpChannel.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIHttpChannel.h"
class nsIHttpHeaderVisitor; /* forward declaration */


/* starting interface:    nsIHttpChannel */
#define NS_IHTTPCHANNEL_IID_STR "a8bed710-653c-4ea4-9747-a629cc482cf8"

#define NS_IHTTPCHANNEL_IID \
  {0xa8bed710, 0x653c, 0x4ea4, \
    { 0x97, 0x47, 0xa6, 0x29, 0xcc, 0x48, 0x2c, 0xf8 }}

class NS_NO_VTABLE nsIHttpChannel : public nsIChannel {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTTPCHANNEL_IID)

  /* attribute ACString requestMethod; */
  NS_IMETHOD GetRequestMethod(nsACString & aRequestMethod) = 0;
  NS_IMETHOD SetRequestMethod(const nsACString & aRequestMethod) = 0;

  /* attribute nsIURI referrer; */
  NS_IMETHOD GetReferrer(nsIURI * *aReferrer) = 0;
  NS_IMETHOD SetReferrer(nsIURI *aReferrer) = 0;

  enum {
    REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE = 0U,
    REFERRER_POLICY_NO_REFERRER = 1U,
    REFERRER_POLICY_ORIGIN = 2U,
    REFERRER_POLICY_ORIGIN_WHEN_XORIGIN = 3U,
    REFERRER_POLICY_UNSAFE_URL = 4U
  };

  /* readonly attribute unsigned long referrerPolicy; */
  NS_IMETHOD GetReferrerPolicy(uint32_t *aReferrerPolicy) = 0;

  NS_IMETHOD GetRequestSucceeded(bool *aRequestSucceeded) = 0;

  /* ACString getResponseHeader (in ACString header); */
  NS_IMETHOD GetResponseHeader(const nsACString & header, nsACString & _retval) = 0;

  NS_IMETHOD RedirectTo(nsIURI *aNewURI) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIHttpChannel, NS_IHTTPCHANNEL_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIHTTPCHANNEL \
  NS_IMETHOD GetRequestMethod(nsACString & aRequestMethod) MOZ_OVERRIDE; \
  NS_IMETHOD SetRequestMethod(const nsACString & aRequestMethod) MOZ_OVERRIDE; \
  NS_IMETHOD VisitRequestHeaders(nsIHttpHeaderVisitor *aVisitor) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->VisitRequestHeaders(aVisitor); } \
  NS_IMETHOD GetAllowPipelining(bool *aAllowPipelining) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllowPipelining(aAllowPipelining); } \
  NS_IMETHOD SetAllowPipelining(bool aAllowPipelining) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAllowPipelining(aAllowPipelining); } \
  NS_IMETHOD GetAllowSTS(bool *aAllowSTS) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllowSTS(aAllowSTS); } \
  NS_IMETHOD SetAllowSTS(bool aAllowSTS) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAllowSTS(aAllowSTS); } \
  NS_IMETHOD GetRedirectionLimit(uint32_t *aRedirectionLimit) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRedirectionLimit(aRedirectionLimit); } \
  NS_IMETHOD SetRedirectionLimit(uint32_t aRedirectionLimit) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRedirectionLimit(aRedirectionLimit); } \
  NS_IMETHOD GetResponseStatus(uint32_t *aResponseStatus) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResponseStatus(aResponseStatus); } \
  NS_IMETHOD GetResponseStatusText(nsACString & aResponseStatusText) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResponseStatusText(aResponseStatusText); } \
  NS_IMETHOD GetRequestSucceeded(bool *aRequestSucceeded) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRequestSucceeded(aRequestSucceeded); } \
  NS_IMETHOD GetResponseHeader(const nsACString & header, nsACString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResponseHeader(header, _retval); } \
  NS_IMETHOD SetResponseHeader(const nsACString & header, const nsACString & value, bool merge) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetResponseHeader(header, value, merge); } \
  NS_IMETHOD VisitResponseHeaders(nsIHttpHeaderVisitor *aVisitor) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->VisitResponseHeaders(aVisitor); } \
  NS_IMETHOD IsNoStoreResponse(bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsNoStoreResponse(_retval); } \
  NS_IMETHOD IsNoCacheResponse(bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsNoCacheResponse(_retval); } \
  NS_IMETHOD IsPrivateResponse(bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsPrivateResponse(_retval); } \
  NS_IMETHOD RedirectTo(nsIURI *aNewURI) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RedirectTo(aNewURI); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
#endif
# 367 "../../dist/include/nsIHttpChannel.h"


#endif /* __gen_nsIHttpChannel_h__ */
# 370 "../../dist/include/nsIHttpChannel.h"
# 10 "../../dist/include/mozilla/net/ReferrerPolicy.h" 2

namespace mozilla { namespace net {

enum ReferrerPolicy {
  /* spec tokens: never no-referrer */
  RP_No_Referrer                 = nsIHttpChannel::REFERRER_POLICY_NO_REFERRER,

  /* spec tokens: origin */
  RP_Origin                      = nsIHttpChannel::REFERRER_POLICY_ORIGIN,

  /* spec tokens: default no-referrer-when-downgrade */
  RP_No_Referrer_When_Downgrade  = nsIHttpChannel::REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE,
  RP_Default                     = nsIHttpChannel::REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE,

  /* spec tokens: origin-when-crossorigin */
  RP_Origin_When_Crossorigin     = nsIHttpChannel::REFERRER_POLICY_ORIGIN_WHEN_XORIGIN,

  /* spec tokens: always unsafe-url */
  RP_Unsafe_URL                  = nsIHttpChannel::REFERRER_POLICY_UNSAFE_URL
};





} } //namespace mozilla::net

#endif
# 75 "../../dist/include/mozilla/net/ReferrerPolicy.h"
# 34 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIContentPolicy.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIContentPolicy.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIContentPolicy.idl
 */

#ifndef __gen_nsIContentPolicy_h__
#define __gen_nsIContentPolicy_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIContentPolicy.h"
#endif
# 12 "../../dist/include/nsIContentPolicy.h"

#ifndef __gen_nsIContentPolicyBase_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIContentPolicyBase.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIContentPolicyBase.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIContentPolicyBase.idl
 */

#ifndef __gen_nsIContentPolicyBase_h__
#define __gen_nsIContentPolicyBase_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIContentPolicyBase.h"
#endif
# 12 "../../dist/include/nsIContentPolicyBase.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIContentPolicyBase.h"
class nsIURI; /* forward declaration */

class nsIDOMNode; /* forward declaration */

class nsIPrincipal; /* forward declaration */

typedef uint32_t  nsContentPolicyType;


/* starting interface:    nsIContentPolicyBase */
#define NS_ICONTENTPOLICYBASE_IID_STR "21bb54b0-ab3c-11e4-bcd8-0800200c9a66"

#define NS_ICONTENTPOLICYBASE_IID \
  {0x21bb54b0, 0xab3c, 0x11e4, \
    { 0xbc, 0xd8, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }}

class NS_NO_VTABLE nsIContentPolicyBase : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTPOLICYBASE_IID)

  enum {
    TYPE_INVALID = 0U,
    TYPE_OTHER = 1U,
    TYPE_SCRIPT = 2U,
    TYPE_IMAGE = 3U,
    TYPE_STYLESHEET = 4U,
    TYPE_OBJECT = 5U,
    TYPE_DOCUMENT = 6U,
    REJECT_REQUEST = -1,
    REJECT_TYPE = -2,
    REJECT_SERVER = -3,
    REJECT_OTHER = -4,
    ACCEPT = 1
  };

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentPolicyBase, NS_ICONTENTPOLICYBASE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICONTENTPOLICYBASE \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICONTENTPOLICYBASE(_to) \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICONTENTPOLICYBASE(_to) \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsContentPolicyBase : public nsIContentPolicyBase
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSICONTENTPOLICYBASE

  nsContentPolicyBase();

{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 116 "../../dist/include/nsIContentPolicyBase.h"


#endif /* __gen_nsIContentPolicyBase_h__ */
# 119 "../../dist/include/nsIContentPolicyBase.h"
# 15 "../../dist/include/nsIContentPolicy.h" 2
#endif
# 16 "../../dist/include/nsIContentPolicy.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 21 "../../dist/include/nsIContentPolicy.h"
class nsIURI; /* forward declaration */

class nsIDOMNode; /* forward declaration */

class nsIPrincipal; /* forward declaration */


/* starting interface:    nsIContentPolicy */
#define NS_ICONTENTPOLICY_IID_STR "447a2300-ab3c-11e4-bcd8-0800200c9a66"

#define NS_ICONTENTPOLICY_IID \
  {0x447a2300, 0xab3c, 0x11e4, \

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICONTENTPOLICY \
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeTypeGuess, nsISupports *aExtra, nsIPrincipal *aRequestPrincipal, int16_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD ShouldProcess(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeType, nsISupports *aExtra, nsIPrincipal *aRequestPrincipal, int16_t *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICONTENTPOLICY(_to) \
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeTypeGuess, nsISupports *aExtra, nsIPrincipal *aRequestPrincipal, int16_t *_retval) MOZ_OVERRIDE { return _to ShouldLoad(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeTypeGuess, aExtra, aRequestPrincipal, _retval); } \
  NS_IMETHOD ShouldProcess(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeType, nsISupports *aExtra, nsIPrincipal *aRequestPrincipal, int16_t *_retval) MOZ_OVERRIDE { return _to ShouldProcess(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeType, aExtra, aRequestPrincipal, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICONTENTPOLICY(_to) \
  NS_IMETHOD ShouldLoad(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeTypeGuess, nsISupports *aExtra, nsIPrincipal *aRequestPrincipal, int16_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ShouldLoad(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeTypeGuess, aExtra, aRequestPrincipal, _retval); } \
  NS_IMETHOD ShouldProcess(nsContentPolicyType aContentType, nsIURI *aContentLocation, nsIURI *aRequestOrigin, nsISupports *aContext, const nsACString & aMimeType, nsISupports *aExtra, nsIPrincipal *aRequestPrincipal, int16_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ShouldProcess(aContentType, aContentLocation, aRequestOrigin, aContext, aMimeType, aExtra, aRequestPrincipal, _retval); } 



#endif /* __gen_nsIContentPolicy_h__ */
# 114 "../../dist/include/nsIContentPolicy.h"
# 35 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h" 2

#if defined(XP_WIN)
// Undefine LoadImage to prevent naming conflict with Windows.
#undef LoadImage
#endif
# 40 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h"

class imgICache;
class imgIContainer;
class imgINotificationObserver;
class imgIRequest;
struct JSRuntime;
struct nsIntMargin;

template<class E> class nsCOMArray;
template<class K, class V> class nsDataHashtable;
template<class K, class V> class nsRefPtrHashtable;
template<class T> class nsReadingIterator;

namespace mozilla {
class ErrorResult;
class EventListenerManager;

namespace dom {
class DocumentFragment;
class Element;
class EventTarget;
class NodeInfo;
class Selection;
class TabParent;
} // namespace dom

namespace layers {
class LayerManager;
} // namespace layers

} // namespace mozilla

class nsIBidiKeyboard;

extern const char kLoadAsData[];

// Stolen from nsReadableUtils, but that's OK, since we can declare the same

typedef void (*CallOnRemoteChildFunction) (mozilla::dom::TabParent* aTabParent,
                                           void* aArg);

class nsContentUtils
{
  friend class nsAutoScriptBlockerSuppressNodeRemoved;
  typedef mozilla::dom::Element Element;
  typedef mozilla::TimeDuration TimeDuration;

public:
  ;

  ;
  ;
  ;
  ;

  /**
   * Returns the common ancestor, if any, for two nodes. Returns null if the
   * nodes are disconnected.
   */
  ;

  /**
   * Returns true if aNode1 is before aNode2 in the same connected
   * tree.
   */
  static bool PositionIsBefore(nsINode* aNode1, nsINode* aNode2);

  /**
   *  Utility routine to compare two "points", where a point is a
   * WARNING! Calling this function could synchronously execute scripts.
   */
  static void RemoveScriptBlocker();

  /**
   * Add a runnable that is to be executed as soon as it's safe to execute
   * scripts.
   * NOTE: If it's currently safe to execute scripts, aRunnable will be run
   *       synchronously before the function returns.
   *
   * @param aRunnable  The nsIRunnable to run as soon as it's safe to execute
   *                   scripts. Passing null is allowed and results in nothing
   *                   happening. It is also allowed to pass an object that
   *                   has not yet been AddRefed.
   * @return false on out of memory, true otherwise.
   */
  ;

  // Call EnterMicroTask when you're entering JS execution.
  // Usually the best way to do this is to use nsAutoMicroTask.
  static void EnterMicroTask();
  static void LeaveMicroTask();

  ;
  ;
  ;

  ;

  /* Process viewport META data. This gives us information for the scale
   * and zoom of a page on mobile devices. We stick the information in
   * the document header and use it later on after rendering.
  static nsIFragmentContentSink* sXMLFragmentSink;

  /**
   * True if there's a fragment parser activation on the stack.
   */
  static bool sFragmentParsingActive;

  static nsString* sShiftText;
  static nsString* sControlText;
  static nsString* sMetaText;
  static nsString* sOSText;
  static nsString* sAltText;
  static nsString* sModifierSeparator;

#if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
  static bool sDOMWindowDumpEnabled;
#endif
# 2408 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h"
};

class MOZ_STACK_CLASS nsAutoScriptBlocker {
public:
  
  ~nsAutoScriptBlocker() {
    nsContentUtils::RemoveScriptBlocker();
  }
private:
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

class MOZ_STACK_CLASS nsAutoScriptBlockerSuppressNodeRemoved :
                          public nsAutoScriptBlocker {
};

namespace mozilla {
namespace dom {

class TreeOrderComparator {
public:
  bool Equals(nsINode* aElem1, nsINode* aElem2) const {
    return aElem1 == aElem2;
  }
  bool LessThan(nsINode* aElem1, nsINode* aElem2) const {
    return nsContentUtils::PositionIsBefore(aElem1, aElem2);
  }
};

} // namespace dom
} // namespace mozilla

#define NS_INTERFACE_MAP_ENTRY_TEAROFF(_interface, _allocator)                \
  if (aIID.Equals(NS_GET_IID(_interface))) {                                  \
    foundInterface = static_cast<_interface *>(_allocator);                   \
    if (!foundInterface) {                                                    \
      *aInstancePtr = nullptr;                                                \
      return NS_ERROR_OUT_OF_MEMORY;                                          \
    }                                                                         \
  } else

/*
 * In the following helper macros we exploit the fact that the result of a
 * series of additions will not be finite if any one of the operands in the
 * series is not finite.
 */
#define NS_ENSURE_FINITE(f, rv)                                               \
  if (!mozilla::IsFinite(f)) {                                                \
    return (rv);                                                              \
  }

#define NS_ENSURE_FINITE2(f1, f2, rv)                                         \
  if (!mozilla::IsFinite((f1)+(f2))) {                                        \
    return (rv);                                                              \
  }

#define NS_ENSURE_FINITE4(f1, f2, f3, f4, rv)                                 \
  if (!mozilla::IsFinite((f1)+(f2)+(f3)+(f4))) {                              \
    return (rv);                                                              \
  }

#define NS_ENSURE_FINITE5(f1, f2, f3, f4, f5, rv)                             \
      cur->member_ = nullptr;                                                  \
      delete cur;                                                             \
      cur = next;                                                             \
    }                                                                         \
  }

#endif /* nsContentUtils_h___ */
# 2516 "/Users/luser/build/mozilla-central/dom/base/nsContentUtils.h"
# 30 "../../dist/include/mozilla/dom/CallbackObject.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 31 "../../dist/include/mozilla/dom/CallbackObject.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsJSEnvironment.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsJSEnvironment_h
#define nsJSEnvironment_h

#if 0 /* expanded by -frewrite-includes */
#include "nsIScriptContext.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsIScriptContext.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsIScriptContext_h__
#define nsIScriptContext_h__

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsIScriptContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsIScriptContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/base/nsIScriptContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/base/nsIScriptContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIProgrammingLanguage.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIProgrammingLanguage.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIProgrammingLanguage.idl
 */

#ifndef __gen_nsIProgrammingLanguage_h__
#define __gen_nsIProgrammingLanguage_h__



#define NS_IPROGRAMMINGLANGUAGE_IID \
  {0xea604e90, 0x40ba, 0x11d5, \
    { 0x90, 0xbb, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a }}

class NS_NO_VTABLE nsIProgrammingLanguage : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPROGRAMMINGLANGUAGE_IID)

  enum {
    UNKNOWN = 0U,
    CPLUSPLUS = 1U,
    JAVASCRIPT = 2U,
    PYTHON = 3U,
    PERL = 4U,
    JAVA = 5U,
    ZX81_BASIC = 6U,
    JAVASCRIPT2 = 7U,
    RUBY = 8U,
    PHP = 9U,
    TCL = 10U,
    MAX = 10U
  };

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIProgrammingLanguage, NS_IPROGRAMMINGLANGUAGE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPROGRAMMINGLANGUAGE \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPROGRAMMINGLANGUAGE(_to) \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPROGRAMMINGLANGUAGE(_to) \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsProgrammingLanguage : public nsIProgrammingLanguage
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPROGRAMMINGLANGUAGE


nsProgrammingLanguage::~nsProgrammingLanguage()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 92 "../../dist/include/nsIProgrammingLanguage.h"


#endif /* __gen_nsIProgrammingLanguage_h__ */
# 95 "../../dist/include/nsIProgrammingLanguage.h"
# 14 "/Users/luser/build/mozilla-central/dom/base/nsIScriptContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/base/nsIScriptContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/GCAPI.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/base/nsIScriptContext.h"

class nsIScriptGlobalObject;
class nsIScriptSecurityManager;
class nsIPrincipal;
class nsIAtom;
class nsIArray;
class nsIVariant;
class nsIObjectInputStream;
class nsIObjectOutputStream;
class nsIScriptObjectPrincipal;
class nsIDOMWindow;
class nsIURI;

#define NS_ISCRIPTCONTEXT_IID \
{ 0x901f0d5e, 0x217a, 0x45fa, \
  { 0x9a, 0xca, 0x45, 0x0f, 0xe7, 0x2f, 0x10, 0x9a } }

class nsIOffThreadScriptReceiver;

/**
 * It is used by the application to initialize a runtime and run scripts.
 * A script runtime would implement this interface.
 */
class nsIScriptContext : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTCONTEXT_IID)

  /**
   * Return the global object.
   *
   **/
  virtual nsIScriptGlobalObject *GetGlobalObject() = 0;

  /**
   * Return the native script context
   *
   **/
  virtual JSContext* GetNativeContext() = 0;

  /**
   * Initialize the context generally. Does not create a global object.
   **/
  virtual nsresult InitContext() = 0;

  /**
   * Check to see if context is as yet intialized. Used to prevent
   * reentrancy issues during the initialization process.
   *
   * @return true if initialized, false if not
   *
   */
  virtual bool IsContextInitialized() = 0;

  // SetProperty is suspect and jst believes should not be needed.  Currenly
  // used only for "arguments".
  virtual nsresult SetProperty(JS::Handle<JSObject*> aTarget,
                               const char* aPropName, nsISupports* aVal) = 0;
  /**
   * Called to set/get information if the script context is
   * currently processing a script tag
   */
  virtual bool GetProcessingScriptTag() = 0;
  virtual void SetProcessingScriptTag(bool aResult) = 0;

  /**
   * Initialize DOM classes on aGlobalObj, always call
   * WillInitializeContext() before calling InitContext(), and always
   * call DidInitializeContext() when a context is fully
   * (successfully) initialized.
   */
  virtual nsresult InitClasses(JS::Handle<JSObject*> aGlobalObj) = 0;

  /**
   * Tell the context we're about to be reinitialize it.
   */
  virtual void WillInitializeContext() = 0;

  /**
   * Tell the context we're done reinitializing it.
   */
  virtual void DidInitializeContext() = 0;

  /**
   * Access the Window Proxy. The setter should only be called by nsGlobalWindow.
   */
  virtual void SetWindowProxy(JS::Handle<JSObject*> aWindowProxy) = 0;
  virtual JSObject* GetWindowProxy() = 0;
  virtual JSObject* GetWindowProxyPreserveColor() = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptContext, NS_ISCRIPTCONTEXT_IID)

#define NS_IOFFTHREADSCRIPTRECEIVER_IID \
{0x3a980010, 0x878d, 0x46a9,            \
  {0x93, 0xad, 0xbc, 0xfd, 0xd3, 0x8e, 0xa0, 0xc2}}

class nsIOffThreadScriptReceiver : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOFFTHREADSCRIPTRECEIVER_IID)

  /**
   * Notify this object that a previous CompileScript call specifying this as
   * aOffThreadReceiver has completed. The script being passed in must be
   * rooted before any call which could trigger GC.
   */
  NS_IMETHOD OnScriptCompileComplete(JSScript* aScript, nsresult aStatus) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIOffThreadScriptReceiver, NS_IOFFTHREADSCRIPTRECEIVER_IID)

#endif // nsIScriptContext_h__
# 129 "/Users/luser/build/mozilla-central/dom/base/nsIScriptContext.h"
# 9 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIScriptGlobalObject.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsIScriptGlobalObject.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 sw=2 et tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsIScriptGlobalObject_h__
#define nsIScriptGlobalObject_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsIScriptGlobalObject.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIGlobalObject.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/base/nsIScriptGlobalObject.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/base/nsIScriptGlobalObject.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/base/nsIScriptGlobalObject.h"

class nsIScriptContext;
class nsIScriptGlobalObject;

namespace mozilla {
namespace dom {
struct ErrorEventInit;
} // namespace dom
} // namespace mozilla

// A helper function for nsIScriptGlobalObject implementations to use
// when handling a script error.  Generally called by the global when a context
// notifies it of an error via nsIScriptGlobalObject::HandleScriptError.
// Returns true if HandleDOMEvent was actually called, in which case
// aStatus will be filled in with the status.
bool
NS_HandleScriptError(nsIScriptGlobalObject *aScriptGlobal,
                     const mozilla::dom::ErrorEventInit &aErrorEvent,
                     nsEventStatus *aStatus);


#define NS_ISCRIPTGLOBALOBJECT_IID \
{ 0x876f83bd, 0x6314, 0x460a, \
  { 0xa0, 0x45, 0x1c, 0x8f, 0x46, 0x2f, 0xb8, 0xe1 } }

/**
 * The global object which keeps a script context for each supported script
 * language. This often used to store per-window global state.
 * This is a heavyweight interface implemented only by DOM globals, and
 * it might go away some time in the future.
 */

class nsIScriptGlobalObject : public nsIGlobalObject
{
public:
  virtual bool IsBlackForCC(bool aTracingNeeded = true) { return false; }
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptGlobalObject,
                              NS_ISCRIPTGLOBALOBJECT_IID)

#endif
# 87 "/Users/luser/build/mozilla-central/dom/base/nsIScriptGlobalObject.h"
# 10 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIObserver.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h"
#if 0 /* expanded by -frewrite-includes */
#include "prtime.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIXPConnect.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIXPConnect.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIXPConnect.idl
 */

#ifndef __gen_nsIXPConnect_h__
#define __gen_nsIXPConnect_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIXPConnect.h"
#endif
# 12 "../../dist/include/nsIXPConnect.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsIXPConnect.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 19 "../../dist/include/nsIXPConnect.h"
struct JSFreeOp;
class nsWrapperCache;
class nsAXPCNativeCallContext;
class nsIXPCScriptable; /* forward declaration */

class nsIXPConnect; /* forward declaration */

class nsIXPConnectWrappedNative; /* forward declaration */

class nsIInterfaceInfo; /* forward declaration */

class nsIXPCSecurityManager; /* forward declaration */

class nsIPrincipal; /* forward declaration */

class nsIClassInfo; /* forward declaration */

class nsIVariant; /* forward declaration */

class nsIStackFrame; /* forward declaration */

class nsIObjectInputStream; /* forward declaration */

class nsIObjectOutputStream; /* forward declaration */


/* starting interface:    nsIXPConnectJSObjectHolder */
#define NS_IXPCONNECTJSOBJECTHOLDER_IID_STR "73e6ff4a-ab99-4d99-ac00-ba39ccb8e4d7"

#define NS_IXPCONNECTJSOBJECTHOLDER_IID \
  {0x73e6ff4a, 0xab99, 0x4d99, \
    { 0xac, 0x00, 0xba, 0x39, 0xcc, 0xb8, 0xe4, 0xd7 }}

class NS_NO_VTABLE nsIXPConnectJSObjectHolder : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPCONNECTJSOBJECTHOLDER_IID)

  /* [nostdcall,notxpcom] JSObjectPtr GetJSObject (); */
  virtual JSObject * GetJSObject(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPConnectJSObjectHolder, NS_IXPCONNECTJSOBJECTHOLDER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXPCONNECTJSOBJECTHOLDER \
  virtual JSObject * GetJSObject(void) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIXPCONNECTJSOBJECTHOLDER(_to) \
  virtual JSObject * GetJSObject(void) MOZ_OVERRIDE { return _to GetJSObject(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIXPCONNECTJSOBJECTHOLDER(_to) \
  virtual JSObject * GetJSObject(void) MOZ_OVERRIDE; 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsXPConnectJSObjectHolder : public nsIXPConnectJSObjectHolder
{
public:
#endif
# 120 "../../dist/include/nsIXPConnect.h"


/* starting interface:    nsIXPConnectWrappedNative */
#define NS_IXPCONNECTWRAPPEDNATIVE_IID_STR "e787be29-db5d-4a45-a3d6-1de1d6b85c30"

#define NS_IXPCONNECTWRAPPEDNATIVE_IID \
  {0xe787be29, 0xdb5d, 0x4a45, \
    { 0xa3, 0xd6, 0x1d, 0xe1, 0xd6, 0xb8, 0x5c, 0x30 }}

class nsIXPConnectWrappedNative : public nsIXPConnectJSObjectHolder {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPCONNECTWRAPPEDNATIVE_IID)

  NS_IMETHOD DebugDump(int16_t depth) = 0;

     /**
     * Faster access to the native object from C++.  Will never return null.
     */
    nsISupports* Native() const { return mIdentity; }
protected:
    nsCOMPtr<nsISupports> mIdentity;
public:
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPConnectWrappedNative, NS_IXPCONNECTWRAPPEDNATIVE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXPCONNECTWRAPPEDNATIVE \
  NS_IMETHOD GetNative(nsISupports * *aNative) MOZ_OVERRIDE; \
#define NS_FORWARD_SAFE_NSIXPCONNECTWRAPPEDNATIVE(_to) \
  NS_IMETHOD GetNative(nsISupports * *aNative) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNative(aNative); } \
  NS_IMETHOD GetJSObjectPrototype(JSObject **aJSObjectPrototype) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetJSObjectPrototype(aJSObjectPrototype); } \
  NS_IMETHOD FindInterfaceWithMember(JS::Handle<jsid> nameID, nsIInterfaceInfo * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->FindInterfaceWithMember(nameID, _retval); } \
  NS_IMETHOD FindInterfaceWithName(JS::Handle<jsid> nameID, nsIInterfaceInfo * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->FindInterfaceWithName(nameID, _retval); } \
  NS_IMETHOD_(bool) HasNativeMember(JS::Handle<jsid> name) MOZ_OVERRIDE; \
  NS_IMETHOD DebugDump(int16_t depth) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->DebugDump(depth); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsXPConnectWrappedNative : public nsIXPConnectWrappedNative
{
public:
  NS_DECL_ISUPPORTS

/* [notxpcom] bool HasNativeMember (in JSHandleId name); */
NS_IMETHODIMP_(bool) nsXPConnectWrappedNative::HasNativeMember(JS::Handle<jsid> name)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void debugDump (in short depth); */
NS_IMETHODIMP nsXPConnectWrappedNative::DebugDump(int16_t depth)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 260 "../../dist/include/nsIXPConnect.h"
/* starting interface:    nsIXPConnectWrappedJS */
#define NS_IXPCONNECTWRAPPEDJS_IID_STR "3a01b0d6-074b-49ed-bac3-08c76366cae4"

#define NS_IXPCONNECTWRAPPEDJS_IID \
  {0x3a01b0d6, 0x074b, 0x49ed, \
    { 0xba, 0xc3, 0x08, 0xc7, 0x63, 0x66, 0xca, 0xe4 }}

class NS_NO_VTABLE nsIXPConnectWrappedJS : public nsIXPConnectJSObjectHolder {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPCONNECTWRAPPEDJS_IID)

  /* readonly attribute nsIInterfaceInfo InterfaceInfo; */
  NS_IMETHOD GetInterfaceInfo(nsIInterfaceInfo * *aInterfaceInfo) = 0;

  /* readonly attribute nsIIDPtr InterfaceIID; */
  NS_IMETHOD GetInterfaceIID(nsIID **aInterfaceIID) = 0;

  /* void debugDump (in short depth); */
  NS_IMETHOD DebugDump(int16_t depth) = 0;

  /* void aggregatedQueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  NS_IMETHOD AggregatedQueryInterface(const nsIID & uuid, void **result) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPConnectWrappedJS, NS_IXPCONNECTWRAPPEDJS_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXPCONNECTWRAPPEDJS \
  NS_IMETHOD GetInterfaceInfo(nsIInterfaceInfo * *aInterfaceInfo) MOZ_OVERRIDE; \
  NS_IMETHOD GetInterfaceIID(nsIID **aInterfaceIID) MOZ_OVERRIDE; \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsXPConnectWrappedJS : public nsIXPConnectWrappedJS
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIXPCONNECTWRAPPEDJS

  nsXPConnectWrappedJS();

private:
  ~nsXPConnectWrappedJS();

    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void aggregatedQueryInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
NS_IMETHODIMP nsXPConnectWrappedJS::AggregatedQueryInterface(const nsIID & uuid, void **result)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 383 "../../dist/include/nsIXPConnect.h"


/* starting interface:    nsIXPCWrappedJSObjectGetter */
#define NS_IXPCWRAPPEDJSOBJECTGETTER_IID_STR "254bb2e0-6439-11d4-8fe0-0010a4e73d9a"

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXPCWRAPPEDJSOBJECTGETTER \
  NS_IMETHOD GetNeverCalled(nsISupports * *aNeverCalled) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIXPCWRAPPEDJSOBJECTGETTER(_to) \
  NS_IMETHOD GetNeverCalled(nsISupports * *aNeverCalled) MOZ_OVERRIDE { return _to GetNeverCalled(aNeverCalled); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIXPCWRAPPEDJSOBJECTGETTER(_to) \
  NS_IMETHOD GetNeverCalled(nsISupports * *aNeverCalled) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNeverCalled(aNeverCalled); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 456 "../../dist/include/nsIXPConnect.h"


/* starting interface:    nsIXPCFunctionThisTranslator */
#define NS_IXPCFUNCTIONTHISTRANSLATOR_IID_STR "f5f84b70-92eb-41f1-a1dd-2eaac0ed564c"

#define NS_IXPCFUNCTIONTHISTRANSLATOR_IID \
  {0xf5f84b70, 0x92eb, 0x41f1, \
    { 0xa1, 0xdd, 0x2e, 0xaa, 0xc0, 0xed, 0x56, 0x4c }}

class NS_NO_VTABLE nsIXPCFunctionThisTranslator : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPCFUNCTIONTHISTRANSLATOR_IID)

  /* nsISupports TranslateThis (in nsISupports aInitialThis); */
  NS_IMETHOD TranslateThis(nsISupports *aInitialThis, nsISupports * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPCFunctionThisTranslator, NS_IXPCFUNCTIONTHISTRANSLATOR_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXPCFUNCTIONTHISTRANSLATOR \
  NS_IMETHOD TranslateThis(nsISupports *aInitialThis, nsISupports * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIXPCFUNCTIONTHISTRANSLATOR(_to) \
  NS_IMETHOD TranslateThis(nsISupports *aInitialThis, nsISupports * *_retval) MOZ_OVERRIDE { return _to TranslateThis(aInitialThis, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIXPCFUNCTIONTHISTRANSLATOR(_to) \
  NS_IMETHOD TranslateThis(nsISupports *aInitialThis, nsISupports * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->TranslateThis(aInitialThis, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsXPCFunctionThisTranslator : public nsIXPCFunctionThisTranslator
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIXPCFUNCTIONTHISTRANSLATOR
}

nsXPCFunctionThisTranslator::~nsXPCFunctionThisTranslator()
{
  /* destructor code */
}

/* nsISupports TranslateThis (in nsISupports aInitialThis); */
NS_IMETHODIMP nsXPCFunctionThisTranslator::TranslateThis(nsISupports *aInitialThis, nsISupports * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 529 "../../dist/include/nsIXPConnect.h"

// For use with the service manager
// {CB6593E0-F9B2-11d2-BDD6-000064657374}
#define NS_XPCONNECT_CID \
{ 0xcb6593e0, 0xf9b2, 0x11d2, \
    { 0xbd, 0xd6, 0x0, 0x0, 0x64, 0x65, 0x73, 0x74 } }

/* starting interface:    nsIXPConnect */
#define NS_IXPCONNECT_IID_STR "6872bfd6-660b-4aa3-b54b-41ce1d2d69e3"

#define NS_IXPCONNECT_IID \
  {0x6872bfd6, 0x660b, 0x4aa3, \
    { 0xb5, 0x4b, 0x41, 0xce, 0x1d, 0x2d, 0x69, 0xe3 }}

class nsIXPConnect : public nsISupports {
 public: 
  NS_IMETHOD ReadFunction(nsIObjectInputStream *aStream, JSContext *aJSContext, JSObject **_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPConnect, NS_IXPCONNECT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXPCONNECT \
  NS_IMETHOD InitClassesWithNewWrappedGlobal(JSContext *aJSContext, nsISupports *aCOMObj, nsIPrincipal *aPrincipal, uint32_t aFlags, JS::CompartmentOptions & aOptions, nsIXPConnectJSObjectHolder * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD WrapNative(JSContext *aJSContext, JSObject *aScope, nsISupports *aCOMObj, const nsIID & aIID, nsIXPConnectJSObjectHolder * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD WrapNativeToJSVal(JSContext *aJSContext, JSObject *aScope, nsISupports *aCOMObj, nsWrapperCache *aCache, const nsIID *aIID, bool aAllowWrapper, JS::MutableHandleValue aVal) MOZ_OVERRIDE; \
  NS_IMETHOD WrapJS(JSContext *aJSContext, JSObject *aJSObj, const nsIID & aIID, void **result) MOZ_OVERRIDE; \
  NS_IMETHOD JSValToVariant(JSContext *cx, JS::HandleValue aJSVal, nsIVariant * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetWrappedNativeOfJSObject(JSContext *aJSContext, JSObject *aJSObj, nsIXPConnectWrappedNative * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD_(nsISupports *) GetNativeOfWrapper(JSContext *aJSContext, JSObject *aJSObj) MOZ_OVERRIDE; \
  NS_IMETHOD CreateStackFrameLocation(uint32_t aLanguage, const char * aFilename, const char * aFunctionName, int32_t aLineNumber, nsIStackFrame *aCaller, nsIStackFrame * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GarbageCollect(uint32_t reason) MOZ_OVERRIDE; \
  NS_IMETHOD NotifyDidPaint(void) MOZ_OVERRIDE; \
  NS_IMETHOD WriteScript(nsIObjectOutputStream *aStream, JSContext *aJSContext, JSScript *aJSScript) MOZ_OVERRIDE; \
  NS_IMETHOD ReadScript(nsIObjectInputStream *aStream, JSContext *aJSContext, JSScript **_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GarbageCollect(uint32_t reason) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GarbageCollect(reason); } \
  NS_IMETHOD NotifyDidPaint(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyDidPaint(); } \
  NS_IMETHOD WriteScript(nsIObjectOutputStream *aStream, JSContext *aJSContext, JSScript *aJSScript) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteScript(aStream, aJSContext, aJSScript); } \
  NS_IMETHOD ReadScript(nsIObjectInputStream *aStream, JSContext *aJSContext, JSScript **_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadScript(aStream, aJSContext, _retval); } \
  NS_IMETHOD WriteFunction(nsIObjectOutputStream *aStream, JSContext *aJSContext, JSObject *aJSObject) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->WriteFunction(aStream, aJSContext, aJSObject); } \
  NS_IMETHOD ReadFunction(nsIObjectInputStream *aStream, JSContext *aJSContext, JSObject **_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadFunction(aStream, aJSContext, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsXPConnect : public nsIXPConnect
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
#endif
# 12 "../../dist/include/nsIArray.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIArray.h"
class nsISimpleEnumerator; /* forward declaration */


/* starting interface:    nsIArray */
#define NS_IARRAY_IID_STR "114744d9-c369-456e-b55a-52fe52880d2d"

#define NS_IARRAY_IID \
  {0x114744d9, 0xc369, 0x456e, \
    { 0xb5, 0x5a, 0x52, 0xfe, 0x52, 0x88, 0x0d, 0x2d }}

class NS_NO_VTABLE nsIArray : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IARRAY_IID)

  /* readonly attribute unsigned long length; */
  NS_IMETHOD GetLength(uint32_t *aLength) = 0;

  /* void queryElementAt (in unsigned long index, in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  NS_IMETHOD QueryElementAt(uint32_t index, const nsIID & uuid, void **result) = 0;

  /* unsigned long indexOf (in unsigned long startIndex, in nsISupports element); */
  NS_IMETHOD IndexOf(uint32_t startIndex, nsISupports *element, uint32_t *_retval) = 0;

  /* nsISimpleEnumerator enumerate (); */
  NS_IMETHOD Enumerate(nsISimpleEnumerator * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIArray, NS_IARRAY_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIARRAY \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE; \
  NS_IMETHOD QueryElementAt(uint32_t index, const nsIID & uuid, void **result) MOZ_OVERRIDE; \
  NS_IMETHOD IndexOf(uint32_t startIndex, nsISupports *element, uint32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD Enumerate(nsISimpleEnumerator * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIARRAY(_to) \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return _to GetLength(aLength); } \
  NS_IMETHOD QueryElementAt(uint32_t index, const nsIID & uuid, void **result) MOZ_OVERRIDE { return _to QueryElementAt(index, uuid, result); } \
  NS_IMETHOD IndexOf(uint32_t startIndex, nsISupports *element, uint32_t *_retval) MOZ_OVERRIDE { return _to IndexOf(startIndex, element, _retval); } \
  NS_IMETHOD Enumerate(nsISimpleEnumerator * *_retval) MOZ_OVERRIDE { return _to Enumerate(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIARRAY(_to) \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLength(aLength); } \
  NS_IMETHOD QueryElementAt(uint32_t index, const nsIID & uuid, void **result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->QueryElementAt(index, uuid, result); } \
  NS_IMETHOD IndexOf(uint32_t startIndex, nsISupports *element, uint32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IndexOf(startIndex, element, _retval); } \
  NS_IMETHOD Enumerate(nsISimpleEnumerator * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Enumerate(_retval); } 

#if 0
}

/* nsISimpleEnumerator enumerate (); */
NS_IMETHODIMP nsArray::Enumerate(nsISimpleEnumerator * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 127 "../../dist/include/nsIArray.h"


#endif /* __gen_nsIArray_h__ */
# 130 "../../dist/include/nsIArray.h"
# 16 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsPIDOMWindow.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 sw=2 et tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef nsPIDOMWindow_h__
#define nsPIDOMWindow_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMWindow.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMWindow.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMWindow.idl
 */

#ifndef __gen_nsIDOMWindow_h__
#define __gen_nsIDOMWindow_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMWindow.h"
#endif
# 12 "../../dist/include/nsIDOMWindow.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsIDOMWindow.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 19 "../../dist/include/nsIDOMWindow.h"
class nsIFrameRequestCallback; /* forward declaration */

class nsIControllers; /* forward declaration */

class nsIDOMBlob; /* forward declaration */

class nsIDOMLocation; /* forward declaration */

class nsIDOMOfflineResourceList; /* forward declaration */

class nsIPrompt; /* forward declaration */

class nsISelection; /* forward declaration */

class nsIVariant; /* forward declaration */


/* starting interface:    nsIDOMWindow */
#define NS_IDOMWINDOW_IID_STR "8146f3fc-9fc1-47c5-85ef-95d686e4ca6d"

#define NS_IDOMWINDOW_IID \
  {0x8146f3fc, 0x9fc1, 0x47c5, \
    { 0x85, 0xef, 0x95, 0xd6, 0x86, 0xe4, 0xca, 0x6d }}

class nsIDOMWindow : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMWINDOW_IID)

  /* readonly attribute nsIDOMWindow window; */
  NS_IMETHOD GetWindow(nsIDOMWindow * *aWindow) = 0;

  /* [optional_argc] nsIVariant showModalDialog (in DOMString aURI, [optional] in nsIVariant aArgs, [optional] in DOMString aOptions); */
  NS_IMETHOD ShowModalDialog(const nsAString & aURI, nsIVariant *aArgs, const nsAString & aOptions, uint8_t _argc, nsIVariant * *_retval) = 0;

  /* [binaryname(PostMessageMoz),implicit_jscontext] void postMessage (in jsval message, in DOMString targetOrigin, [optional] in jsval transfer); */
  NS_IMETHOD PostMessageMoz(JS::HandleValue message, const nsAString & targetOrigin, JS::HandleValue transfer, JSContext* cx) = 0;

  NS_IMETHOD GetConsole(JSContext* cx, JS::MutableHandleValue aConsole) = 0;
  NS_IMETHOD SetConsole(JSContext* cx, JS::HandleValue aConsole) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMWindow, NS_IDOMWINDOW_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMWINDOW \
  NS_IMETHOD GetWindow(nsIDOMWindow * *aWindow) MOZ_OVERRIDE; \
  NS_IMETHOD GetConsole(JSContext* cx, JS::MutableHandleValue aConsole) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetConsole(cx, aConsole); } \
  NS_IMETHOD SetConsole(JSContext* cx, JS::HandleValue aConsole) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetConsole(cx, aConsole); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMWindow : public nsIDOMWindow
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMWINDOW

  nsDOMWindow();

private:
  /* destructor code */
}
NS_IMETHODIMP nsDOMWindow::SetConsole(JSContext* cx, JS::HandleValue aConsole)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 1327 "../../dist/include/nsIDOMWindow.h"


/* starting interface:    nsIDOMWindowInternal */
#define NS_IDOMWINDOWINTERNAL_IID_STR "2ec49e81-b2ba-4633-991a-f48f1e1d8800"

#define NS_IDOMWINDOWINTERNAL_IID \
  {0x2ec49e81, 0xb2ba, 0x4633, \
    { 0x99, 0x1a, 0xf4, 0x8f, 0x1e, 0x1d, 0x88, 0x00 }}

class NS_NO_VTABLE nsIDOMWindowInternal : public nsIDOMWindow {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMWINDOWINTERNAL_IID)

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMWindowInternal, NS_IDOMWINDOWINTERNAL_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMWINDOWINTERNAL \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMWINDOWINTERNAL(_to) \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMWINDOWINTERNAL(_to) \
  /* no methods! */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMWindowInternal : public nsIDOMWindowInternal
{
public:
  NS_DECL_ISUPPORTS
  /* member initializers and constructor code */
}

nsDOMWindowInternal::~nsDOMWindowInternal()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 1391 "../../dist/include/nsIDOMWindow.h"


#endif /* __gen_nsIDOMWindow_h__ */
# 1394 "../../dist/include/nsIDOMWindow.h"
# 12 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h" 2
# 17 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h"

#define DOM_WINDOW_DESTROYED_TOPIC "dom-window-destroyed"
#define DOM_WINDOW_FROZEN_TOPIC "dom-window-frozen"
#define DOM_WINDOW_THAWED_TOPIC "dom-window-thawed"

class nsIArray;
class nsIContent;
class nsIDocShell;
class nsIDocument;
class nsIIdleObserver;
class nsIPrincipal;
class nsIScriptTimeoutHandler;
class nsIURI;
class nsPerformance;
class nsPIWindowRoot;
class nsXBLPrototypeHandler;
struct nsTimeout;

namespace mozilla {
namespace dom {
class AudioContext;
class Element;
}
namespace gfx {
class VRHMDInfo;
}
}

// Popup control state enum. The values in this enum must go from most
// permissive to least permissive so that it's safe to push state in
// all situations. Pushing popup state onto the stack never makes the
// current popup state less permissive (see
// nsGlobalWindow::PushPopupControlState()).
enum PopupControlState {
  openAllowed = 0,  // open that window without worries
  openControlled,   // it's a popup, but allow it
  openAbused,       // it's a popup. disallow it, but allow domain override.
  openOverridden    // disallow window open
};

enum UIStateChangeType
{
  UIStateChangeType_NoChange,
  UIStateChangeType_Set,
  UIStateChangeType_Clear
};

#define NS_PIDOMWINDOW_IID \
{ 0x19fb3019, 0x7b5d, 0x4235, \
  { 0xa9, 0x59, 0xa2, 0x31, 0xa2, 0xe7, 0x94, 0x79 } }

class nsPIDOMWindow : public nsIDOMWindowInternal
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_PIDOMWINDOW_IID)

  virtual nsPIDOMWindow* GetPrivateRoot() = 0;

  // Outer windows only.
  virtual void ActivateOrDeactivate(bool aActivate) = 0;

  // this is called GetTopWindowRoot to avoid conflicts with nsIDOMWindow::GetWindowRoot
  virtual already_AddRefed<nsPIWindowRoot> GetTopWindowRoot() = 0;

  // Inner windows only.
  virtual nsresult RegisterIdleObserver(nsIIdleObserver* aIdleObserver) = 0;
  virtual nsresult UnregisterIdleObserver(nsIIdleObserver* aIdleObserver) = 0;

  // Outer windows only.
  virtual void SetActive(bool aActive)
  {
    MOZ_ASSERT(IsOuterWindow());
    mIsActive = aActive;
  }
  bool IsActive()
  {
    MOZ_ASSERT(IsOuterWindow());
    return mIsActive;
  }

  // Outer windows only.
  virtual void SetIsBackground(bool aIsBackground)
  {
    MOZ_ASSERT(IsOuterWindow());
    mIsBackground = aIsBackground;
  }
  bool IsBackground()
  {
    MOZ_ASSERT(IsOuterWindow());
    return mIsBackground;
  }
  virtual void MaybeUpdateTouchState() {}
  virtual void UpdateTouchState() {}

  
  ;
  ;

  nsIDocument* GetDoc()
  {
    if (!mDoc) {
      MaybeCreateDoc();
    }
    return mDoc;
  }

  ;

  // Audio API
  ;
  ;

  ;
  ;

  ;

protected:
  // Lazily instantiate an about:blank document if necessary, and if
  // we have what it takes to do so.
  void MaybeCreateDoc();

  ;
  ;

public:
  // Internal getter/setter for the frame element, this version of the
  // getter crosses chrome boundaries whereas the public scriptable
  // one doesn't for security reasons.
  ;
  ;

  

  // Check whether a document is currently loading
  

  bool IsHandlingResizeEvent() const
  {
    const nsPIDOMWindow *win;

    if (IsOuterWindow()) {
      win = GetCurrentInnerWindow();

      if (!win) {
        NS_ERROR("No current inner window available!");

        return false;
      }
    } else {
      if (!mOuterWindow) {
        NS_ERROR("IsHandlingResizeEvent() called on orphan inner window!");

        return false;
      }

      win = this;
    }

    return win->mIsHandlingResizeEvent;
  }

  // Set the window up with an about:blank document with the current subject
  // principal.
  // Outer windows only.
  virtual void SetInitialPrincipalToSubject() = 0;

  virtual PopupControlState PushPopupControlState(PopupControlState aState,
                                                  bool aForce) const = 0;
  virtual void PopPopupControlState(PopupControlState state) const = 0;
  virtual PopupControlState GetPopupControlState() const = 0;

  // Fire any DOM notification events related to things that happened while
  // the window was frozen.
  virtual nsresult FireDelayedDOMEvents() = 0;

  virtual bool IsFrozen() const = 0;

  // Add a timeout to this window.
  virtual nsresult SetTimeoutOrInterval(nsIScriptTimeoutHandler *aHandler,
                                        int32_t interval,
                                        bool aIsInterval, int32_t *aReturn) = 0;

  // Clear a timeout from this window.
  virtual nsresult ClearTimeoutOrInterval(int32_t aTimerID) = 0;

  nsPIDOMWindow *GetOuterWindow()
  {
    return mIsInnerWindow ? mOuterWindow.get() : this;
  }

  nsPIDOMWindow *GetCurrentInnerWindow() const
  {
    MOZ_ASSERT(IsOuterWindow());
    return mInnerWindow;
  }

  nsPIDOMWindow *EnsureInnerWindow()
  {
    NS_ASSERTION(IsOuterWindow(), "EnsureInnerWindow called on inner window");
    // GetDoc forces inner window creation if there isn't one already
    GetDoc();
    return GetCurrentInnerWindow();
  }

  bool IsInnerWindow() const
  {
    return mIsInnerWindow;
  }

  // Returns true if this object has an outer window and it is the current inner
  // window of that outer. Only call this on inner windows.
  bool IsCurrentInnerWindow() const
  {
    MOZ_ASSERT(IsInnerWindow(),
               "It doesn't make sense to call this on outer windows.");
    return mOuterWindow && mOuterWindow->GetCurrentInnerWindow() == this;
  }

  // Returns true if the document of this window is the active document.  This
  // is not identical to IsCurrentInnerWindow() because document.open() will
  // keep the same document active but create a new window.
  bool HasActiveDocument()
  {
    MOZ_ASSERT(IsInnerWindow());
    return IsCurrentInnerWindow() ||
      (mOuterWindow &&
       mOuterWindow->GetCurrentInnerWindow() &&
       mOuterWindow->GetCurrentInnerWindow()->GetDoc() == mDoc);
  }

  bool IsOuterWindow() const
  {
    return !IsInnerWindow();
  }
  /**
   * Set the docshell in the window.  Must not be called with a null docshell
   * (use DetachFromDocShell for that).
   */
  virtual void SetDocShell(nsIDocShell *aDocShell) = 0;

  /**
   * Detach an outer window from its docshell.
   */
  virtual void DetachFromDocShell() = 0;

  /**
   * Set a new document in the window. Calling this method will in
   * most cases create a new inner window. If this method is called on
   * an inner window the call will be forewarded to the outer window,
   * if the inner window is not the current inner window an
  }

  /**
   * Call this to check whether some node (this window, its document,
   * or content in that document) has a Pointerenter/leave event listener.
   */
  bool HasPointerEnterLeaveEventListeners()
  {
    return mMayHavePointerEnterLeaveEventListener;
  }

  /**
   * Call this to indicate that some node (this window, its document,
   * or content in that document) has a Pointerenter/leave event listener.
   */
  void SetHasPointerEnterLeaveEventListeners()
  {
    mMayHavePointerEnterLeaveEventListener = true;
  }


  virtual JSObject* GetCachedXBLPrototypeHandler(nsXBLPrototypeHandler* aKey) = 0;
  virtual void CacheXBLPrototypeHandler(nsXBLPrototypeHandler* aKey,
                                        JS::Handle<JSObject*> aHandler) = 0;

  /*
   * Get and set the currently focused element within the document. If
   * aNeedsFocus is true, then set mNeedsFocus to true to indicate that a
   * document focus event is needed.
   *
   * DO NOT CALL EITHER OF THESE METHODS DIRECTLY. USE THE FOCUS MANAGER
   * INSTEAD.

  /*
   * Tells the window that it now has focus or has lost focus, based on the
   * state of aFocus. If this method returns true, then the document loaded
   * in the window has never received a focus event and expects to receive
   * one. If false is returned, the document has received a focus event before
   * and should only receive one if the window is being focused.
   *
   * aFocusMethod may be set to one of the focus method constants in
   * nsIFocusManager to indicate how focus was set.
   */
  virtual bool TakeFocus(bool aFocus, uint32_t aFocusMethod) = 0;

  /**
   * Indicates that the window may now accept a document focus event. This
   * should be called once a document has been loaded into the window.
   */
  virtual void SetReadyForFocus() = 0;

  /**
   * Whether the focused content within the window should show a focus ring.
   */
  virtual bool ShouldShowFocusRing() = 0;

  /**
   * Set the keyboard indicator state for accelerators and focus rings.
   */
  virtual void SetKeyboardIndicators(UIStateChangeType aShowAccelerators,
                                     UIStateChangeType aShowFocusRings) = 0;

  /**
   * Get the keyboard indicator state for accelerators and focus rings.
   */
  virtual void GetKeyboardIndicators(bool* aShowAccelerators,
                                     bool* aShowFocusRings) = 0;

  /**
   * Indicates that the page in the window has been hidden. This is used to
   * reset the focus state.
   */
  virtual void PageHidden() = 0;

  /**
   * Instructs this window to asynchronously dispatch a hashchange event.  This
   * method must be called on an inner window.
   */
  virtual nsresult DispatchAsyncHashchange(nsIURI *aOldURI,
                                           nsIURI *aNewURI) = 0;

  /**
   * Instructs this window to synchronously dispatch a popState event.
   */
  virtual nsresult DispatchSyncPopState() = 0;

  /**
   * Tell this window that it should listen for sensor changes of the given
   * type.
   *
   * Inner windows only.
   */
  virtual void EnableDeviceSensor(uint32_t aType) = 0;

  /**
   * Tell this window that it should remove itself from sensor change
   * notifications.
   *
   * Inner windows only.
   */
  virtual void DisableDeviceSensor(uint32_t aType) = 0;

  virtual void EnableTimeChangeNotifications() = 0;
  virtual void DisableTimeChangeNotifications() = 0;

#ifdef MOZ_B2G
  /**
   * Tell the window that it should start to listen to the network event of the
   * given aType.
   *
   * Inner windows only.
   */
  virtual void EnableNetworkEvent(uint32_t aType) = 0;

  /**
   * Tell the window that it should stop to listen to the network event of the
   * given aType.
   *
   * Inner windows only.
   */
  virtual void DisableNetworkEvent(uint32_t aType) = 0;
#endif // MOZ_B2G
# 651 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h"

  /**
   * Tell this window that there is an observer for gamepad input
   *
   * Inner windows only.
   */
  virtual void SetHasGamepadEventListener(bool aHasGamepad = true) = 0;

  /**
   * Set a arguments for this window. This will be set on the window
   * right away (if there's an existing document) and it will also be
   * installed on the window when the next document is loaded.
   *
   * This function serves double-duty for passing both |arguments| and
   * |dialogArguments| back from nsWindowWatcher to nsGlobalWindow. For the
   * latter, the array is an array of length 0 whose only element is a
   * DialogArgumentsHolder representing the JS value passed to showModalDialog.
   *
   * Outer windows only.
   */
  virtual nsresult SetArguments(nsIArray *aArguments) = 0;

  /**
   * NOTE! This function *will* be called on multiple threads so the
   * implementation must not do any AddRef/Release or other actions that will
   * mutate internal state.
   */
  virtual uint32_t GetSerial() = 0;

  /**
   * Return the window id of this window
   */
  uint64_t WindowID() const { return mWindowID; }

  /**
   * Dispatch a custom event with name aEventName targeted at this window.
   * Returns whether the default action should be performed.
   * Outer windows only.
   */
  virtual nsresult
  OpenNoNavigate(const nsAString& aUrl, const nsAString& aName,
                 const nsAString& aOptions, nsIDOMWindow **_retval) = 0;

  /**
   * Fire a popup blocked event on the document.
   */
  virtual void
  FirePopupBlockedEvent(nsIDocument* aDoc,
                        nsIURI* aPopupURI,
                        const nsAString& aPopupWindowName,
                        const nsAString& aPopupWindowFeatures) = 0;

  // Inner windows only.
  // sure you keep them in sync!
  nsCOMPtr<mozilla::dom::EventTarget> mChromeEventHandler; // strong
  nsCOMPtr<nsIDocument> mDoc; // strong
  // Cache the URI when mDoc is cleared.
  nsCOMPtr<nsIURI> mDocumentURI; // strong
  nsCOMPtr<nsIURI> mDocBaseURI; // strong

  nsCOMPtr<mozilla::dom::EventTarget> mParentTarget; // strong

  // These members are only used on outer windows.
  nsCOMPtr<mozilla::dom::Element> mFrameElement;
  nsIDocShell           *mDocShell;  // Weak Reference

  // mPerformance is only used on inner windows.
  nsRefPtr<nsPerformance>       mPerformance;

  uint32_t               mModalStateDepth;

  // These variables are only used on inner windows.
  nsTimeout             *mRunningTimeout;

  uint32_t               mMutationBits;

  bool                   mIsDocumentLoaded;
  bool                   mIsHandlingResizeEvent;
  bool                   mIsInnerWindow;
  bool                   mMayHavePaintEventListener;
  bool                   mMayHaveTouchEventListener;
  bool                   mMayHaveTouchCaret;
  bool                   mMayHaveScrollWheelEventListener;
  bool                   mMayHaveMouseEnterLeaveEventListener;
  bool                   mMayHavePointerEnterLeaveEventListener;

  // This variable is used on both inner and outer windows (and they
  // should match).
  bool                   mIsModalContentWindow;

  // Tracks activation state that's used for :-moz-window-inactive.
  // Only used on outer windows.
  bool                   mIsActive;

  // Tracks whether our docshell is active.  If it is, mIsBackground
  // is false.  Too bad we have so many different concepts of
  // "active".  Only used on outer windows.
  bool                   mIsBackground;

  bool                   mAudioMuted;
  float                  mAudioVolume;

  // And these are the references between inner and outer windows.
  nsPIDOMWindow* MOZ_NON_OWNING_REF mInnerWindow;
  nsCOMPtr<nsPIDOMWindow> mOuterWindow;

  // the element within the document that is currently focused when this
  // window is active
  nsCOMPtr<nsIContent> mFocusedNode;

  // The AudioContexts created for the current document, if any.
  nsTArray<mozilla::dom::AudioContext*> mAudioContexts; // Weak

  // A unique (as long as our 64-bit counter doesn't roll over) id for
  // this window.
  uint64_t mWindowID;

  // This is only used by the inner window. Set to true once we've sent
  // the (chrome|content)-document-global-created notification.
  bool mHasNotifiedGlobalCreated;

  uint32_t mMarkedCCGeneration;
};


NS_DEFINE_STATIC_IID_ACCESSOR(nsPIDOMWindow, NS_PIDOMWINDOW_IID)

#ifdef MOZILLA_INTERNAL_API
PopupControlState
PushPopupControlState(PopupControlState aState, bool aForce);

void
PopPopupControlState(PopupControlState aState);

#define NS_AUTO_POPUP_STATE_PUSHER nsAutoPopupStatePusherInternal
#else
# 860 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h"
#define NS_AUTO_POPUP_STATE_PUSHER nsAutoPopupStatePusherExternal
#endif
# 862 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h"

// Helper class that helps with pushing and popping popup control
// state. Note that this class looks different from within code that's
// part of the layout library than it does in code outside the layout
// library.  We give the two object layouts different names so the symbols
// don't conflict, but code should always use the name
// |nsAutoPopupStatePusher|.
class NS_AUTO_POPUP_STATE_PUSHER
{
public:
#ifdef MOZILLA_INTERNAL_API
  explicit NS_AUTO_POPUP_STATE_PUSHER(PopupControlState aState, bool aForce = false)
    : mOldState(::PushPopupControlState(aState, aForce))
  {
  }

  ~NS_AUTO_POPUP_STATE_PUSHER()
  {
    PopPopupControlState(mOldState);
  }
#else
# 883 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h"
  NS_AUTO_POPUP_STATE_PUSHER(nsPIDOMWindow *aWindow, PopupControlState aState)
    : mWindow(aWindow), mOldState(openAbused)
  {
    if (aWindow) {
      mOldState = aWindow->PushPopupControlState(aState, false);
    }
  }

  
#endif
# 898 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h"

protected:
#ifndef MOZILLA_INTERNAL_API
  nsCOMPtr<nsPIDOMWindow> mWindow;
#endif
# 903 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h"
  PopupControlState mOldState;

private:
  // Hide so that this class can only be stack-allocated
  
  
};

#define nsAutoPopupStatePusher NS_AUTO_POPUP_STATE_PUSHER

#endif // nsPIDOMWindow_h__
# 914 "/Users/luser/build/mozilla-central/dom/base/nsPIDOMWindow.h"
# 18 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsThreadUtils.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h"
#if 0 /* expanded by -frewrite-includes */
#include "xpcpublic.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=4 et sw=4 tw=99: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef xpcpublic_h
#define xpcpublic_h

#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h"
# 16 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIURI.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIURI.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIURI.idl
 */

#ifndef __gen_nsIURI_h__
#define __gen_nsIURI_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIURI.h"
#endif
# 12 "../../dist/include/nsIURI.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIURI.h"
#undef GetPort  // XXX Windows!
#undef SetPort  // XXX Windows!

/* starting interface:    nsIURI */
#define NS_IURI_IID_STR "395fe045-7d18-4adb-a3fd-af98c8a1af11"

#define NS_IURI_IID \
  {0x395fe045, 0x7d18, 0x4adb, \
    { 0xa3, 0xfd, 0xaf, 0x98, 0xc8, 0xa1, 0xaf, 0x11 }}

class NS_NO_VTABLE nsIURI : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IURI_IID)

  /* attribute AUTF8String spec; */
  NS_IMETHOD GetSpec(nsACString & aSpec) = 0;
  NS_IMETHOD SetSpec(const nsACString & aSpec) = 0;

  /* readonly attribute AUTF8String prePath; */
  NS_IMETHOD GetPrePath(nsACString & aPrePath) = 0;

  /* boolean equals (in nsIURI other); */
  NS_IMETHOD Equals(nsIURI *other, bool *_retval) = 0;

  /* boolean schemeIs (in string scheme); */
  NS_IMETHOD SchemeIs(const char * scheme, bool *_retval) = 0;

  /* nsIURI clone (); */
  NS_IMETHOD Clone(nsIURI * *_retval) = 0;

  /* AUTF8String resolve (in AUTF8String relativePath); */
  NS_IMETHOD Resolve(const nsACString & relativePath, nsACString & _retval) = 0;

  /* readonly attribute ACString asciiSpec; */
  NS_IMETHOD GetAsciiSpec(nsACString & aAsciiSpec) = 0;

  /* readonly attribute ACString asciiHost; */
  NS_IMETHOD GetSpecIgnoringRef(nsACString & aSpecIgnoringRef) = 0;

  /* readonly attribute boolean hasRef; */
  NS_IMETHOD GetHasRef(bool *aHasRef) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIURI, NS_IURI_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIURI \
  NS_IMETHOD GetSpec(nsACString & aSpec) MOZ_OVERRIDE; \
  NS_IMETHOD GetAsciiHost(nsACString & aAsciiHost) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAsciiHost(aAsciiHost); } \
  NS_IMETHOD GetOriginCharset(nsACString & aOriginCharset) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOriginCharset(aOriginCharset); } \
  NS_IMETHOD GetRef(nsACString & aRef) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRef(aRef); } \
  NS_IMETHOD SetRef(const nsACString & aRef) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRef(aRef); } \
  NS_IMETHOD EqualsExceptRef(nsIURI *other, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->EqualsExceptRef(other, _retval); } \
  NS_IMETHOD CloneIgnoringRef(nsIURI * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->CloneIgnoringRef(_retval); } \
  NS_IMETHOD GetSpecIgnoringRef(nsACString & aSpecIgnoringRef) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSpecIgnoringRef(aSpecIgnoringRef); } \
  NS_IMETHOD GetHasRef(bool *aHasRef) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHasRef(aHasRef); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsURI : public nsIURI
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIURI

    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsURI::SetUsername(const nsACString & aUsername)
{
}

/* readonly attribute boolean hasRef; */
NS_IMETHODIMP nsURI::GetHasRef(bool *aHasRef)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 423 "../../dist/include/nsIURI.h"


#endif /* __gen_nsIURI_h__ */
# 426 "../../dist/include/nsIURI.h"
# 17 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrincipal.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIGlobalObject.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsPIDOMWindow.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/JSSlots.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/JSSlots.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * This file defines various reserved slot indices used by JavaScript
 * reflections of DOM objects.
 */
#ifndef mozilla_dom_DOMSlots_h
#define mozilla_dom_DOMSlots_h

// We use slot 0 for holding the raw object.  This is safe for both
// globals and non-globals.
// NOTE: This is baked into the Ion JIT as 0 in codegen for LGetDOMProperty and
// LSetDOMProperty. Those constants need to be changed accordingly if this value
// changes.
#define DOM_OBJECT_SLOT 0

// The total number of slots non-proxy DOM objects use by default.
// Specific objects may have more for storing cached values.
#define DOM_INSTANCE_RESERVED_SLOTS 1

// Interface objects store a number of reserved slots equal to
// DOM_INTERFACE_SLOTS_BASE + number of named constructors.
#define DOM_INTERFACE_SLOTS_BASE 0

// Interface prototype objects store a number of reserved slots equal to
// DOM_INTERFACE_PROTO_SLOTS_BASE or DOM_INTERFACE_PROTO_SLOTS_BASE + 1 if a
// slot for the unforgeable holder is needed.
#define DOM_INTERFACE_PROTO_SLOTS_BASE 0

#endif /* mozilla_dom_DOMSlots_h */
class nsIPrincipal;
class nsScriptNameSpaceManager;
class nsIMemoryReporterCallback;

namespace xpc {

class Scriptability {
public:
    ;
    ;
    ;

    ;
    ;
    ;


    // Whether the new-style domain policy when this compartment was created
    // forbids script execution.
    bool mScriptBlockedByPolicy;
};

;
// Returns whether we will use an XBL scope for this compartment. This is
// semantically equivalent to comparing global != GetXBLScope(global), but it
// does not have the side-effect of eagerly creating the XBL scope if it does
// not already exist.
;

;

;
;

} /* namespace xpc */

namespace JS {

struct RuntimeStats;

}

#define XPCONNECT_GLOBAL_FLAGS_WITH_EXTRA_SLOTS(n)                            \
    JSCLASS_DOM_GLOBAL | JSCLASS_HAS_PRIVATE |                                \
    JSCLASS_PRIVATE_IS_NSISUPPORTS | JSCLASS_IMPLEMENTS_BARRIERS |            \
    JSCLASS_GLOBAL_FLAGS_WITH_SLOTS(DOM_GLOBAL_SLOTS + n)

#define XPCONNECT_GLOBAL_EXTRA_SLOT_OFFSET (JSCLASS_GLOBAL_SLOT_COUNT + DOM_GLOBAL_SLOTS)
// readable string conversions, static methods and members only
class XPCStringConvert
{
    // One-slot cache, because it turns out it's common for web pages to
    // get the same string a few times in a row.  We get about a 40% cache
    // hit rate on this cache last it was measured.  We'd get about 70%
    // hit rate with a hashtable with removal on finalization, but that
    // would take a lot more machinery.
    struct ZoneStringCache
    {
        // mString owns mBuffer.  mString is a JS thing, so it can only die
        // during GC.  We clear mString and mBuffer during GC.  As long as
        // the above holds, mBuffer should not be a dangling pointer, so
        // using this as a cache key should be safe.
        void* mBuffer;
        JSString* mString;
    };

public:

    // If the string shares the readable's buffer, that buffer will
    // get assigned to *sharedBuffer.  Otherwise null will be
    // assigned.
    ;

    // Convert the given stringbuffer/length pair to a jsval
    static MOZ_ALWAYS_INLINE bool
    StringBufferToJSVal(JSContext* cx, nsStringBuffer* buf, uint32_t length,
                        JS::MutableHandleValue rval, bool* sharedBuffer)
    {
        JS::Zone *zone = js::GetContextZone(cx);
        ZoneStringCache *cache = static_cast<ZoneStringCache*>(JS_GetZoneUserData(zone));
        if (cache && buf == cache->mBuffer) {
            MOZ_ASSERT(JS::GetTenuredGCThingZone(cache->mString) == zone);
            JS::MarkStringAsLive(zone, cache->mString);
            rval.setString(cache->mString);
            *sharedBuffer = false;
            return true;
        }

        JSString *str = JS_NewExternalString(cx,
                                             static_cast<char16_t*>(buf->Data()),
                                             length, &sDOMStringFinalizer);
        if (!str) {
            return false;
        }
        rval.setString(str);
        if (!cache) {
            cache = new ZoneStringCache();
            JS_SetZoneUserData(zone, cache);
        }
        cache->mBuffer = buf;
        cache->mString = str;
        *sharedBuffer = true;
        return true;
    }

    ;
    ;

    

    

private:
    static const JSStringFinalizer sLiteralFinalizer, sDOMStringFinalizer;

    ;

    ;

    ;         // not implemented
};

class nsIAddonInterposition;

namespace xpc {

// If these functions return false, then an exception will be set on cx.
;
;

/**
 * Convert an nsString to jsval, returning true on success.
 * Note, the ownership of the string buffer may be moved from str to rval.
 * If that happens, str will point to an empty string after this call.
 */
bool NonVoidStringToJsval(JSContext *cx, nsAString &str, JS::MutableHandleValue rval);


inline bool
NonVoidStringToJsval(JSContext* cx, const nsAString& str, JS::MutableHandleValue rval)
{
    nsString mutableCopy(str);
    return NonVoidStringToJsval(cx, mutableCopy, rval);
}

inline bool
StringToJsval(JSContext* cx, const nsAString& str, JS::MutableHandleValue rval)
{
    nsString mutableCopy(str);
    return StringToJsval(cx, mutableCopy, rval);
}

/**
 * As above, but for mozilla::dom::DOMString.
 */
MOZ_ALWAYS_INLINE
bool NonVoidStringToJsval(JSContext* cx, mozilla::dom::DOMString& str,
                          JS::MutableHandleValue rval)
{
    if (!str.HasStringBuffer()) {
        // It's an actual XPCOM string
        return NonVoidStringToJsval(cx, str.AsAString(), rval);
    }

    uint32_t length = str.StringBufferLength();
    if (length == 0) {
        rval.set(JS_GetEmptyStringValue(cx));
        return true;
    }

    nsStringBuffer* buf = str.StringBuffer();
    bool shared;
    if (!XPCStringConvert::StringBufferToJSVal(cx, buf, length, rval,
                                               &shared)) {
        return false;
    }
}

nsIPrincipal *GetCompartmentPrincipal(JSCompartment *compartment);

void SetLocationForGlobal(JSObject *global, const nsACString& location);
void SetLocationForGlobal(JSObject *global, nsIURI *locationURI);

// ReportJSRuntimeExplicitTreeStats will expect this in the |extra| member
// of JS::ZoneStats.
class ZoneStatsExtras {
public:
    ZoneStatsExtras()
    {}

    nsAutoCString pathPrefix;

private:
    ZoneStatsExtras(const ZoneStatsExtras &other) = delete;
    ZoneStatsExtras& operator=(const ZoneStatsExtras &other) = delete;
};

// ReportJSRuntimeExplicitTreeStats will expect this in the |extra| member
// of JS::CompartmentStats.
class CompartmentStatsExtras {
public:
    CompartmentStatsExtras()
    {}

    nsAutoCString jsPathPrefix;
    nsAutoCString domPathPrefix;
    nsCOMPtr<nsIURI> location;

private:
    CompartmentStatsExtras(const CompartmentStatsExtras &other) = delete;
    CompartmentStatsExtras& operator=(const CompartmentStatsExtras &other) = delete;
};

// This reports all the stats in |rtStats| that belong in the "explicit" tree,
// (which isn't all of them).
// @see ZoneStatsExtras
// @see CompartmentStatsExtras
nsresult
ReportJSRuntimeExplicitTreeStats(const JS::RuntimeStats &rtStats,
                                 const nsACString &rtPath,
                                 nsIMemoryReporterCallback *cb,
                                 nsISupports *closure,
                                 bool anonymize,
                                 size_t *rtTotal = nullptr);

/**
 * Throws an exception on cx and returns false.
 */
;

/**
 * Returns the nsISupports native behind a given reflector (either DOM or
 * XPCWN).
 */
;

/**
 * Singleton scopes for stuff that really doesn't fit anywhere else.
 *
 * If you find yourself wanting to use these compartments, you're probably doing
 * something wrong. Callers MUST consult with the XPConnect module owner before
 * using this compartment. If you don't, bholley will hunt you down.
 */
;

;

/**
 * Shared compilation scope for XUL prototype documents and XBL
 * precompilation. This compartment has a null principal. No code may run, and
 * it is invisible to the debugger.
 */
;

;

// This function may be used off-main-thread, in which case it is benignly
// racey.
;

;

;

class ErrorReport {
  public:
    NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ErrorReport);

    

    ;
    void LogToConsole();

  public:

    nsCString mCategory;
    nsString mErrorMsg;
    nsString mFileName;
    nsString mSourceLine;
    uint64_t mWindowID;
    uint32_t mLineNumber;
    uint32_t mColumn;
    uint32_t mFlags;
    bool mIsMuted;

  private:
    ~ErrorReport() {}
};

;

} // namespace xpc

namespace mozilla {
namespace dom {

typedef JSObject*
(*DefineInterface)(JSContext *cx, JS::Handle<JSObject*> global,
                   JS::Handle<jsid> id, bool defineOnGlobal);

typedef JSObject*
(*ConstructNavigatorProperty)(JSContext *cx, JS::Handle<JSObject*> naviObj);

// Check whether a constructor should be enabled for the given object.
} // namespace dom
} // namespace mozilla

#endif
# 562 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcpublic.h"
# 20 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h" 2

class nsICycleCollectorListener;
class nsIXPConnectJSObjectHolder;
class nsScriptNameSpaceManager;
class nsCycleCollectionNoteRootCallback;

namespace JS {
class AutoValueVector;
}

namespace mozilla {
template <class> class Maybe;
struct CycleCollectorResults;
}

// The amount of time we wait between a request to GC (due to leaving
// a page) and doing the actual GC.
#define NS_GC_DELAY                 4000 // ms

#define NS_MAJOR_FORGET_SKIPPABLE_CALLS 5

class nsJSContext : public nsIScriptContext
{
public:
  ;

  // context does. It is eventually collected by the cycle collector.
  nsCOMPtr<nsIScriptGlobalObject> mGlobalObjectRef;

  ;

  ;
};

class nsIJSRuntimeService;
#endif /* nsJSEnvironment_h */
# 242 "/Users/luser/build/mozilla-central/dom/base/nsJSEnvironment.h"
# 32 "../../dist/include/mozilla/dom/CallbackObject.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "xpcpublic.h"
#endif /* expanded by -frewrite-includes */
# 33 "../../dist/include/mozilla/dom/CallbackObject.h"

namespace mozilla {
namespace dom {

#define DOM_CALLBACKOBJECT_IID \
{ 0xbe74c190, 0x6d76, 0x4991, \
 { 0x84, 0xb9, 0x65, 0x06, 0x99, 0xe6, 0x93, 0x2b } }

class CallbackObject : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(DOM_CALLBACKOBJECT_IID)

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CallbackObject)

  // The caller may pass a global object which will act as an override for the
  // incumbent script settings object when the callback is invoked (overriding
  // the entry point computed from aCallback). If no override is required, the
  // caller should pass null.
  explicit CallbackObject(JS::Handle<JSObject*> aCallback, nsIGlobalObject *aIncumbentGlobal)
  {
    Init(aCallback, aIncumbentGlobal);
  }

  JS::Handle<JSObject*> Callback() const
  {
    JS::ExposeObjectToActiveJS(mCallback);
    return CallbackPreserveColor();
  }

  /*
   * This getter does not change the color of the JSObject meaning that the
   * object returned is not guaranteed to be kept alive past the next CC.
   *
   * This should only be called if you are certain that the return value won't
   * be passed into a JS API function and that it won't be stored without being
   * rooted (or otherwise signaling the stored value to the CC).
   */
  JS::Handle<JSObject*> CallbackPreserveColor() const
  {
    // Calling fromMarkedLocation() is safe because we trace our mCallback, and
    // because the value of mCallback cannot change after if has been set.
    return JS::Handle<JSObject*>::fromMarkedLocation(mCallback.address());
  }

  nsIGlobalObject* IncumbentGlobalOrNull() const
  {
    return mIncumbentGlobal;
  }

  enum ExceptionHandling {
    // Report any exception and don't throw it to the caller code.
    eReportExceptions,
    // Throw an exception to the caller code if the thrown exception is a
    // binding object for a DOMError or DOMException from the caller's scope,
    // otherwise report it.
    eRethrowContentExceptions,
    // Throw exceptions to the caller code, unless the caller compartment is
    // provided, the exception is not a DOMError or DOMException from the
    // caller compartment, and the caller compartment does not subsume our
    // unwrapped callback.
    eRethrowExceptions
  };

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
  {
    return aMallocSizeOf(this);
  }

protected:
  virtual ~CallbackObject()
  {
    DropJSObjects();
  }

  explicit CallbackObject(CallbackObject* aCallbackObject)
  {
    Init(aCallbackObject->mCallback, aCallbackObject->mIncumbentGlobal);
  }

  bool operator==(const CallbackObject& aOther) const
  {
    JSObject* thisObj =
      js::UncheckedUnwrap(CallbackPreserveColor());
    JSObject* otherObj =
      js::UncheckedUnwrap(aOther.CallbackPreserveColor());
    return thisObj == otherObj;
  }

private:
  inline void Init(JSObject* aCallback, nsIGlobalObject* aIncumbentGlobal)
  {
    MOZ_ASSERT(aCallback && !mCallback);
    // Set script objects before we hold, on the off chance that a GC could
    // somehow happen in there... (which would be pretty odd, granted).
    mCallback = aCallback;
    if (aIncumbentGlobal) {
      mIncumbentGlobal = aIncumbentGlobal;
      mIncumbentJSGlobal = aIncumbentGlobal->GetGlobalJSObject();
    }
    mozilla::HoldJSObjects(this);
  }

  CallbackObject(const CallbackObject&) = delete;
  CallbackObject& operator =(const CallbackObject&) = delete;

protected:
  void DropJSObjects()
  {
    MOZ_ASSERT_IF(mIncumbentJSGlobal, mCallback);
    if (mCallback) {
      mCallback = nullptr;
      mIncumbentJSGlobal = nullptr;
      mozilla::DropJSObjects(this);
    }
  }

  JS::Heap<JSObject*> mCallback;
  // Ideally, we'd just hold a reference to the nsIGlobalObject, since that's
  // what we need to pass to AutoIncumbentScript. Unfortunately, that doesn't
  // hold the actual JS global alive. So we maintain an additional pointer to
  // the JS global itself so that we can trace it.
  //
  // At some point we should consider trying to make native globals hold their
  // scripted global alive, at which point we can get rid of the duplication
  // here.
  nsCOMPtr<nsIGlobalObject> mIncumbentGlobal;
  JS::TenuredHeap<JSObject*> mIncumbentJSGlobal;

  class MOZ_STACK_CLASS CallSetup
  {
    /**
     * A class that performs whatever setup we need to safely make a
     * call while this class is on the stack, After the constructor
     * returns, the call is safe to make if GetContext() returns
     * non-null.
     */
  public:
    // If aExceptionHandling == eRethrowContentExceptions then aCompartment
    // needs to be set to the compartment in which exceptions will be rethrown.
    //
    // If aExceptionHandling == eRethrowExceptions then aCompartment may be set
    // to the compartment in which exceptions will be rethrown.  In that case
    Maybe<JS::Rooted<JSObject*> > mRootedCallable;

    // Can't construct a JSAutoCompartment without a JSContext either.  Also,
    // Put mAc after mAutoEntryScript so that we exit the compartment before
    // we pop the JSContext. Though in practice we'll often manually order
    // those two things.
    Maybe<JSAutoCompartment> mAc;

    // An ErrorResult to possibly re-throw exceptions on and whether
    // we should re-throw them.
    ErrorResult& mErrorResult;
    const ExceptionHandling mExceptionHandling;
    JS::ContextOptions mSavedJSContextOptions;
    const bool mIsMainThread;
  };
};

template<class WebIDLCallbackT, class XPCOMCallbackT>
class CallbackObjectHolder;

template<class T, class U>
void ImplCycleCollectionUnlink(CallbackObjectHolder<T, U>& aField);

class CallbackObjectHolderBase
{
protected:
  // Returns null on all failures
  already_AddRefed<nsISupports> ToXPCOMCallback(CallbackObject* aCallback,
                                                const nsIID& aIID) const;
};

template<class WebIDLCallbackT, class XPCOMCallbackT>
class CallbackObjectHolder : CallbackObjectHolderBase
{

  

  nsISupports* GetISupports() const
  {
    return reinterpret_cast<nsISupports*>(mPtrBits & ~XPCOMCallbackFlag);
  }

  // Boolean conversion operator so people can use this in boolean tests
  

  // Even if HasWebIDLCallback returns true, GetWebIDLCallback() might still
  // return null.
  bool HasWebIDLCallback() const
  {
    return !(mPtrBits & XPCOMCallbackFlag);
  }

  WebIDLCallbackT* GetWebIDLCallback() const
  {
    MOZ_ASSERT(HasWebIDLCallback());
    return reinterpret_cast<WebIDLCallbackT*>(mPtrBits);
  }

  

  bool operator==(WebIDLCallbackT* aOtherCallback) const
  {
    if (!aOtherCallback) {
      // If other is null, then we must be null to be equal.
      return !GetISupports();
    }

    if (!HasWebIDLCallback() || !GetWebIDLCallback()) {
      // If other is non-null, then we can't be equal if we have a
      // non-WebIDL callback or a null callback.
      return false;
    }

    return *GetWebIDLCallback() == *aOtherCallback;
  }

  

  

  // Try to return an XPCOMCallbackT version of this object.
  

  // Try to return a WebIDLCallbackT version of this object.
  

private:
  static const uintptr_t XPCOMCallbackFlag = 1u;

  friend void
  ImplCycleCollectionUnlink<WebIDLCallbackT,
                            XPCOMCallbackT>(CallbackObjectHolder& aField);

  

  uintptr_t mPtrBits;
};

NS_DEFINE_STATIC_IID_ACCESSOR(CallbackObject, DOM_CALLBACKOBJECT_IID)



template<class T, class U>
void
ImplCycleCollectionUnlink(CallbackObjectHolder<T, U>& aField)
{
  aField.UnlinkSelf();
}

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_CallbackObject_h
# 428 "../../dist/include/mozilla/dom/CallbackObject.h"
# 19 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMJSClass.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/DOMJSClass.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_DOMJSClass_h
#define mozilla_dom_DOMJSClass_h

#if 0 /* expanded by -frewrite-includes */
#include "jsfriendapi.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/DOMJSClass.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/DOMJSClass.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/PrototypeList.h" // auto-generated
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/PrototypeList.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_PrototypeList_h
#define mozilla_dom_PrototypeList_h

namespace mozilla {
namespace dom {
namespace prototypes {

namespace id {

enum ID
{
  _ID_Start = 0,
  ActivityRequestHandler = _ID_Start,
  AlarmsManager,
  AnalyserNode,
  Animation,
  AnimationEffect,
  AnimationEvent,
  AnimationPlayer,
  AnimationTimeline,
  AnonymousContent,
  ArchiveReader,
  ArchiveRequest,
  Attr,
  AudioBuffer,
  AudioBufferSourceNode,
  AudioContext,
  AudioDestinationNode,
  AudioListener,
  AudioNode,
  AudioParam,
  AudioProcessingEvent,
  AudioStreamTrack,
  AudioTrack,
  AudioTrackList,
  AutocompleteErrorEvent,
  BarProp,
  BatteryManager,
  BeforeAfterKeyboardEvent,
  BeforeUnloadEvent,
  BiquadFilterNode,
  Blob,
  BlobEvent,
  BoxObject,
  BroadcastChannel,
  BrowserFeedWriter,
  CDATASection,
  CFStateChangeEvent,
  CSS2Properties,
  CSSFontFaceLoadEvent,
  CSSPrimitiveValue,
  CSSRuleList,
  CSSStyleDeclaration,
  CSSStyleSheet,
  CSSValue,
  CSSValueList,
  Cache,
  CacheStorage,
  CallEvent,
  CallGroupErrorEvent,
  CallsList,
  CameraCapabilities,
  CameraClosedEvent,
  CameraConfigurationEvent,
  CameraControl,
  CameraDetectedFace,
  CameraFacesDetectedEvent,
  CameraManager,
  CameraRecorderAudioProfile,
  CameraRecorderProfile,
  CameraRecorderProfiles,
  CameraRecorderVideoProfile,
  CameraStateChangeEvent,
  CanvasGradient,
  CanvasPattern,
  CanvasRenderingContext2D,
  CaretPosition,
  ChannelMergerNode,
  ChannelSplitterNode,
  CharacterData,
  ChromeNotifications,
  ChromeWorker,
  Client,
  Clients,
  ClipboardEvent,
  CloseEvent,
  CommandEvent,
  Comment,
  CompositionEvent,
  Console,
  ContactManager,
  ContainerBoxObject,
  ConvolverNode,
  Coordinates,
  Crypto,
  CryptoKey,
  CustomEvent,
  DOMApplication,
  DOMRectList,
  DOMRectReadOnly,
  DOMRequest,
  DOMSettableTokenList,
  DOMStringList,
  DOMStringMap,
  DOMTokenList,
  DOMTransactionEvent,
  DataContainerEvent,
  DataErrorEvent,
  DataStore,
  DataStoreChangeEvent,
  DataStoreCursor,
  DataStoreCursorImpl,
  DataStoreCursor_workers,
  DataStoreImpl,
  DataStore_workers,
  DataTransfer,
  DedicatedWorkerGlobalScope_workers,
  DelayNode,
  DesktopNotification,
  DesktopNotificationCenter,
  DeviceAcceleration,
  DeviceLightEvent,
  DeviceMotionEvent,
  DeviceOrientationEvent,
  DeviceProximityEvent,
  DeviceRotationRate,
  DeviceStorage,
  DeviceStorageChangeEvent,
  Directory,
  Document,
  DocumentFragment,
  DocumentType,
  DownloadEvent,
  DragEvent,
  DummyInterface,
  DummyInterfaceWorkers_workers,
  DynamicsCompressorNode,
  Element,
  EngineeringMode,
  ErrorEvent,
  Event,
  EventSource,
  EventTarget,
  Exception,
  ExtendableEvent,
  External,
  FetchEvent,
  File,
  FileList,
  FileReader,
  FileReaderSync_workers,
  FocusEvent,
  FontFace,
  FontFaceSet,
  FormData,
  GainNode,
  Geolocation,
  GetUserMediaRequest,
  HMDVRDevice,
  HTMLAllCollection,
  HTMLAnchorElement,
  HTMLAppletElement,
  HTMLAreaElement,
  HTMLAudioElement,
  HTMLBRElement,
  HTMLBaseElement,
  HTMLBodyElement,
  HTMLButtonElement,
  HTMLCanvasElement,
  HTMLCollection,
  HTMLContentElement,
  HTMLDListElement,
  HTMLDataElement,
  HTMLDataListElement,
  HTMLDirectoryElement,
  HTMLDivElement,
  HTMLDocument,
  HTMLElement,
  HTMLEmbedElement,
  HTMLFieldSetElement,
  HTMLFontElement,
  HTMLFormControlsCollection,
  HTMLFormElement,
  HTMLFrameElement,
  HTMLFrameSetElement,
  HTMLHRElement,
  HTMLHeadElement,
  HTMLHeadingElement,
  HTMLHtmlElement,
  HTMLIFrameElement,
  HTMLImageElement,
  HTMLInputElement,
  HTMLLIElement,
  HTMLLabelElement,
  HTMLLegendElement,
  HTMLLinkElement,
  HTMLMapElement,
  HTMLMediaElement,
  HTMLMenuElement,
  HTMLMenuItemElement,
  HTMLMetaElement,
  HTMLMeterElement,
  HTMLModElement,
  HTMLOListElement,
  HTMLObjectElement,
  HTMLOptGroupElement,
  HTMLOptionElement,
  HTMLOptionsCollection,
  HTMLOutputElement,
  HTMLParagraphElement,
  HTMLParamElement,
  HTMLPictureElement,
  HTMLPreElement,
  HTMLProgressElement,
  HTMLPropertiesCollection,
  HTMLQuoteElement,
  HTMLScriptElement,
  HTMLSelectElement,
  HTMLShadowElement,
  HTMLSourceElement,
  HTMLSpanElement,
  HTMLStyleElement,
  HTMLTableCaptionElement,
  HTMLTableCellElement,
  HTMLTableColElement,
  HTMLTableElement,
  HTMLTableRowElement,
  HTMLTableSectionElement,
  HTMLTemplateElement,
  HTMLTextAreaElement,
  HTMLTimeElement,
  HTMLTitleElement,
  HTMLTrackElement,
  HTMLUListElement,
  HTMLUnknownElement,
  HTMLVideoElement,
  HashChangeEvent,
  Headers,
  History,
  IDBCursor,
  IDBCursorWithValue,
  IDBDatabase,
  IDBFactory,
  IDBFileHandle,
  IDBFileRequest,
  IDBIndex,
  IDBKeyRange,
  IDBMutableFile,
  IDBObjectStore,
  IDBOpenDBRequest,
  IDBRequest,
  IDBTransaction,
  IDBVersionChangeEvent,
  IccChangeEvent,
  IdentityManager,
  ImageCapture,
  ImageCaptureError,
  ImageCaptureErrorEvent,
  ImageData,
  ImageDocument,
  InputEvent,
  InstallEvent,
  InstallTriggerImpl,
  KeyboardEvent,
  ListBoxObject,
  LocalMediaStream,
  Location,
  MMICall,
  MediaDevices,
  MediaElementAudioSourceNode,
  MediaError,
  MediaList,
  MediaQueryList,
  MediaRecorder,
  MediaSource,
  MediaStream,
  MediaStreamAudioDestinationNode,
  MediaStreamAudioSourceNode,
  MediaStreamError,
  MediaStreamEvent,
  MediaStreamTrack,
  MediaStreamTrackEvent,
  MenuBoxObject,
  MessageChannel,
  MessageEvent,
  MessagePort,
  MessagePortList,
  MimeType,
  MimeTypeArray,
  MouseEvent,
  MouseScrollEvent,
  MozAbortablePromise,
  MozActivity,
  MozApplicationEvent,
  MozCanvasPrintState,
  MozCellBroadcast,
  MozCellBroadcastEtwsInfo,
  MozCellBroadcastEvent,
  MozCellBroadcastMessage,
  MozClirModeEvent,
  MozContactChangeEvent,
  MozEmergencyCbModeEvent,
  MozInputContext,
  MozInputMethod,
  MozInputMethodManager,
  MozInterAppConnection,
  MozInterAppConnectionRequest,
  MozInterAppMessageEvent,
  MozInterAppMessagePort,
  MozMessageDeletedEvent,
  MozMmsEvent,
  MozMobileCellInfo,
  MozMobileConnection,
  MozMobileConnectionArray,
  MozMobileConnectionInfo,
  MozMobileMessageManager,
  MozMobileNetworkInfo,
  MozOtaStatusEvent,
  MozPowerManager,
  MozSelfSupport,
  MozSettingsEvent,
  MozSettingsTransactionEvent,
  NodeIterator,
  NodeList,
  Notification,
  NotifyPaintEvent,
  OfflineAudioCompletionEvent,
  OfflineAudioContext,
  OfflineResourceList,
  OnlyForUseInConstructor,
  OscillatorNode,
  PageTransitionEvent,
  PaintRequest,
  PaintRequestList,
  PannerNode,
  Path2D,
  Performance,
  PerformanceEntry,
  PerformanceMark,
  PerformanceMeasure,
  PerformanceNavigation,
  PerformanceResourceTiming,
  PerformanceTiming,
  Performance_workers,
  PeriodicWave,
  PermissionSettings,
  PhoneNumberService,
  Plugin,
  PluginArray,
  PluginCrashedEvent,
  PointerEvent,
  PopStateEvent,
  PopupBlockedEvent,
  PopupBoxObject,
  Position,
  PositionError,
  PositionSensorVRDevice,
  PowerStatsData,
  PresentationDeviceInfoManager,
  ProcessingInstruction,
  ProgressEvent,
  Promise,
  PropertyNodeList,
  PushManager,
  RGBColor,
  RTCDataChannelEvent,
  RTCIdentityAssertion,
  RTCIdentityProviderRegistrar,
  RTCPeerConnectionIceEvent,
  RTCRtpReceiver,
  RTCRtpSender,
  RTCStatsReport,
  RadioNodeList,
  Range,
  RecordErrorEvent,
  Rect,
  Request,
  RequestSyncApp,
  RequestSyncManager,
  RequestSyncScheduler,
  RequestSyncTask,
  ResourceStats,
  ResourceStatsAlarm,
  ResourceStatsManager,
  Response,
  SEChannel,
  SEManager,
  SEReader,
  SEResponse,
  SESession,
  SVGAElement,
  SVGAltGlyphElement,
  SVGAngle,
  SVGAnimateElement,
  SVGAnimateMotionElement,
  SVGAnimateTransformElement,
  SVGAnimatedAngle,
  SVGAnimatedBoolean,
  SVGAnimatedEnumeration,
  SVGAnimatedInteger,
  SVGAnimatedLength,
  SVGAnimatedLengthList,
  SVGAnimatedNumber,
  SVGAnimatedNumberList,
  SVGAnimatedPreserveAspectRatio,
  SVGAnimatedRect,
  SVGAnimatedString,
  SVGAnimatedTransformList,
  SVGAnimationElement,
  SVGCircleElement,
  SVGClipPathElement,
  SVGComponentTransferFunctionElement,
  SVGDefsElement,
  SVGDescElement,
  SVGDocument,
  SVGElement,
  SVGEllipseElement,
  SVGFEBlendElement,
  SVGFEColorMatrixElement,
  SVGFEComponentTransferElement,
  SVGFECompositeElement,
  SVGFEConvolveMatrixElement,
  SVGFEDiffuseLightingElement,
  SVGFEDisplacementMapElement,
  SVGFEDistantLightElement,
  SVGFEDropShadowElement,
  SVGFEFloodElement,
  SVGFEFuncAElement,
  SVGFEFuncBElement,
  SVGFEFuncGElement,
  SVGFEFuncRElement,
  SVGFEGaussianBlurElement,
  SVGFEImageElement,
  SVGFEMergeElement,
  SVGFEMergeNodeElement,
  SVGFEMorphologyElement,
  SVGFEOffsetElement,
  SVGFEPointLightElement,
  SVGFESpecularLightingElement,
  SVGFESpotLightElement,
  SVGFETileElement,
  SVGFETurbulenceElement,
  SVGFilterElement,
  SVGForeignObjectElement,
  SVGGElement,
  SVGGradientElement,
  SVGGraphicsElement,
  SVGImageElement,
  SVGLength,
  SVGLengthList,
  SVGLineElement,
  SVGLinearGradientElement,
  SVGMPathElement,
  SVGMarkerElement,
  SVGMaskElement,
  SVGMatrix,
  SVGMetadataElement,
  SVGNumber,
  SVGNumberList,
  SVGPathElement,
  SVGPathSeg,
  SVGPathSegArcAbs,
  SVGPathSegArcRel,
  SVGPathSegClosePath,
  SVGPathSegCurvetoCubicAbs,
  SVGPathSegCurvetoCubicRel,
  SVGPathSegCurvetoCubicSmoothAbs,
  SVGPathSegCurvetoCubicSmoothRel,
  SVGPathSegCurvetoQuadraticAbs,
  SVGPathSegCurvetoQuadraticRel,
  SVGPathSegCurvetoQuadraticSmoothAbs,
  SVGPathSegCurvetoQuadraticSmoothRel,
  SVGPathSegLinetoAbs,
  SVGPathSegLinetoHorizontalAbs,
  SVGPathSegLinetoHorizontalRel,
  SVGPathSegLinetoRel,
  SVGPathSegLinetoVerticalAbs,
  SVGPathSegLinetoVerticalRel,
  SVGPathSegList,
  SVGPathSegMovetoAbs,
  SVGPathSegMovetoRel,
  SVGPatternElement,
  SVGPoint,
  SVGPointList,
  SVGPolygonElement,
  SVGPolylineElement,
  SVGPreserveAspectRatio,
  SVGRadialGradientElement,
  SVGRect,
  SVGRectElement,
  SVGSVGElement,
  SVGScriptElement,
  SVGSetElement,
  SVGStopElement,
  SVGStringList,
  SVGStyleElement,
  SVGSwitchElement,
  SVGSymbolElement,
  SVGTSpanElement,
  SVGTextContentElement,
  SVGTextElement,
  SVGTextPathElement,
  SVGTextPositioningElement,
  SVGTitleElement,
  SVGTransform,
  SVGTransformList,
  SVGUseElement,
  SVGViewElement,
  SVGZoomEvent,
  Screen,
  ScriptProcessorNode,
  ScrollAreaEvent,
  ScrollBoxObject,
  ScrollViewChangeEvent,
  Selection,
  SelectionStateChangedEvent,
  ServiceWorker,
  ServiceWorkerContainer,
  ServiceWorkerGlobalScope_workers,
  ServiceWorkerRegistration,
  SettingsLock,
  SettingsManager,
  ShadowRoot,
  SharedWorker,
  SharedWorkerGlobalScope_workers,
  SimpleGestureEvent,
  SourceBuffer,
  SourceBufferList,
  SpeechGrammar,
  SpeechGrammarList,
  SpeechRecognition,
  SpeechRecognitionAlternative,
  SpeechRecognitionError,
  SpeechRecognitionEvent,
  SpeechRecognitionResult,
  SpeechRecognitionResultList,
  SpeechSynthesis,
  SpeechSynthesisEvent,
  SpeechSynthesisUtterance,
  SpeechSynthesisVoice,
  StereoPannerNode,
  Storage,
  StorageEvent,
  StyleRuleChangeEvent,
  StyleSheet,
  StyleSheetApplicableStateChangeEvent,
  TestCImplementedInterface,
  TestCImplementedInterface2,
  TestChildInterface,
  TestCppKeywordNamedMethodsInterface,
  TestExampleInterface,
  TestExampleProxyInterface,
  TestIndexedAndNamedDeleterInterface,
  TestIndexedAndNamedGetterAndSetterInterface,
  TestIndexedAndNamedGetterInterface,
  TestIndexedAndNamedSetterInterface,
  TestIndexedDeleterInterface,
  TestIndexedDeleterWithRetvalInterface,
  TestIndexedGetterAndSetterAndNamedGetterInterface,
  TestIndexedGetterInterface,
  TestIndexedSetterInterface,
  TestInterface,
  TestInterfaceJS,
  TestJSImplInterface,
  TestJSImplInterface2,
  TestJSImplInterface3,
  TestJSImplInterface4,
  TestJSImplInterface5,
  TestJSImplInterface6,
  TestJSImplNoInterfaceObject,
  TestNamedDeleterInterface,
  TestNamedDeleterWithRetvalInterface,
  TestNamedGetterInterface,
  TestNamedSetterInterface,
  TestNavigator,
  TestNavigatorWithConstructor,
  TestNonWrapperCacheInterface,
  TestParentInterface,
  TestRenamedInterface,
  Text,
  TextDecoder,
  TextEncoder,
  TextMetrics,
  TextTrack,
  TextTrackCueList,
  TextTrackList,
  TimeEvent,
  TimeRanges,
  Touch,
  TouchEvent,
  TouchList,
  TrackEvent,
  TransitionEvent,
  TreeBoxObject,
  TreeColumn,
  TreeColumns,
  TreeWalker,
  UDPMessageEvent,
  UDPSocket,
  UIEvent,
  URL,
  URLSearchParams,
  URL_workers,
  USSDReceivedEvent,
  USSDSession,
  UndoManager,
  UserProximityEvent,
  VRDevice,
  VRFieldOfView,
  VRFieldOfViewReadOnly,
  VRPositionState,
  VTTCue,
  VTTRegion,
  ValidityState,
  VideoPlaybackQuality,
  VideoStreamTrack,
  VideoTrack,
  VideoTrackList,
  WaveShaperNode,
  WebGL2RenderingContext,
  WebGLActiveInfo,
  WebGLBuffer,
  WebGLExtensionBlendMinMax,
  WebGLExtensionColorBufferFloat,
  WebGLExtensionColorBufferHalfFloat,
  WebGLExtensionCompressedTextureATC,
  WebGLExtensionCompressedTextureETC1,
  WebGLExtensionCompressedTexturePVRTC,
  WebGLExtensionCompressedTextureS3TC,
  WebGLExtensionDebugRendererInfo,
  WebGLExtensionDebugShaders,
  WebGLExtensionDepthTexture,
  WebGLExtensionDrawBuffers,
  WebGLExtensionElementIndexUint,
  WebGLExtensionFragDepth,
  WebGLExtensionInstancedArrays,
  WebGLExtensionLoseContext,
  WebGLExtensionSRGB,
  WebGLExtensionShaderTextureLod,
  WebGLExtensionStandardDerivatives,
  WebGLExtensionTextureFilterAnisotropic,
  WebGLExtensionTextureFloat,
  WebGLExtensionTextureFloatLinear,
  WebGLExtensionTextureHalfFloat,
  WebGLExtensionTextureHalfFloatLinear,
  WebGLExtensionVertexArray,
  WebGLFramebuffer,
  WebGLProgram,
  WebGLQuery,
  WebGLRenderbuffer,
  WebGLRenderingContext,
  WebGLSampler,
  WebGLShader,
  WebGLShaderPrecisionFormat,
  WebGLSync,
  WebGLTexture,
  WebGLTransformFeedback,
  WebGLUniformLocation,
  WebGLVertexArray,
  WebSocket,
  WheelEvent,
  Window,
  WindowClient,
  WindowRoot,
  Worker,
  WorkerDebuggerGlobalScope,
  WorkerGlobalScope_workers,
  WorkerLocation_workers,
  WorkerNavigator_workers,
  XMLDocument,
  XMLHttpRequest,
  XMLHttpRequestEventTarget,
  XMLHttpRequestUpload,
  XMLHttpRequestUpload_workers,
  XMLHttpRequest_workers,
  XMLSerializer,
  XMLStylesheetProcessingInstruction,
  XPathEvaluator,
  XPathExpression,
  XPathResult,
  XSLTProcessor,
  XULCommandEvent,
  XULDocument,
  XULElement,
  mozContact,
  mozRTCIceCandidate,
  mozRTCPeerConnection,
  mozRTCPeerConnectionStatic,
  mozRTCSessionDescription,
  _ID_Count
};

} // namespace id

typedef id::ID ID;

static_assert(id::_ID_Count < (uint64_t(1) << (sizeof(((JSJitInfo*)nullptr)->protoID) * 8)), "Too many prototypes!");

} // namespace prototypes
} // namespace dom
} // namespace mozilla

#define MAX_PROTOTYPE_CHAIN_LENGTH 8

static_assert(MAX_PROTOTYPE_CHAIN_LENGTH < (uint64_t(1) << (sizeof(((JSJitInfo*)nullptr)->depth) * 8)), "Some inheritance chain is too long!");

namespace mozilla {
namespace dom {
namespace constructors {

namespace id {

enum ID
{
  _ID_Start = prototypes::id::_ID_Count,
  ActivityRequestHandler = _ID_Start,
  AlarmsManager,
  AnalyserNode,
  Animation,
  AnimationEffect,
  AnimationEvent,
  AnimationPlayer,
  AnimationTimeline,
  AnonymousContent,
  ArchiveReader,
  ArchiveRequest,
  Attr,
  AudioBuffer,
  AudioBufferSourceNode,
  AudioContext,
  AudioDestinationNode,
  mozRTCSessionDescription,
  _ID_Count
};

} // namespace id

typedef id::ID ID;

} // namespace constructors
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace namedpropertiesobjects {

namespace id {

enum ID
{
  _ID_Start = constructors::id::_ID_Count,
  Window = _ID_Start,
  _ID_Count
};

} // namespace id

typedef id::ID ID;

} // namespace namedpropertiesobjects
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
template <prototypes::ID PrototypeID>
struct PrototypeTraits;
template <>
struct PrototypeTraits<prototypes::id::ActivityRequestHandler>
{
  enum
  {
    Depth = 0
  };
};
template <>
struct PrototypeTraits<prototypes::id::AudioProcessingEvent>
{
  enum
  {
    Depth = 1
  };
};
template <>
template <>
template <>
template <>
struct PrototypeTraits<prototypes::id::DOMSettableTokenList>
{
  enum
  {
    Depth = 1
  };
};
template <>
struct PrototypeTraits<prototypes::id::DOMStringList>
{
  enum
  {
    Depth = 0
  };
};
template <>
struct PrototypeTraits<prototypes::id::DeviceStorageChangeEvent>
{
  enum
  {
    Depth = 1
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::DownloadEvent>
{
  enum
  {
    Depth = 1
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::HTMLAudioElement>
{
  enum
  {
    Depth = 5
  };
};
template <>
struct PrototypeTraits<prototypes::id::HTMLBRElement>
{
  enum
  {
    Depth = 4
  };
};
template <>
struct PrototypeTraits<prototypes::id::HTMLIFrameElement>
{
  enum
  {
    Depth = 4
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::HTMLLegendElement>
{
  enum
  {
    Depth = 0
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::IDBFileRequest>
{
  enum
  {
    Depth = 2
  };
};
template <>
struct PrototypeTraits<prototypes::id::IDBIndex>
{
  enum
  {
    Depth = 2
  };
};
template <>
struct PrototypeTraits<prototypes::id::MediaError>
{
  enum
  {
    Depth = 0
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::MediaStream>
{
  enum
  {
    Depth = 1
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::MozInterAppConnectionRequest>
{
  enum
  {
    Depth = 0
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::RTCIdentityAssertion>
{
  enum
  {
    Depth = 0
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::RTCStatsReport>
{
  enum
  {
    Depth = 0
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::SVGAnimatedNumber>
{
  enum
  {
    Depth = 0
  };
};
template <>
struct PrototypeTraits<prototypes::id::SVGAnimatedNumberList>
{
  enum
  {
    Depth = 0
  };
};
template <>
struct PrototypeTraits<prototypes::id::SVGImageElement>
{
  enum
  {
    Depth = 5
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::SVGMPathElement>
{
  enum
  {
    Depth = 0
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::SVGPointList>
{
  enum
  {
    Depth = 0
  };
};
template <>
struct PrototypeTraits<prototypes::id::SVGPolygonElement>
{
  enum
  {
    Depth = 2
  };
};
template <>
struct PrototypeTraits<prototypes::id::Screen>
{
  enum
  {
    Depth = 1
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::Selection>
{
  enum
  {
    Depth = 2
  };
};
template <>
template <>
struct PrototypeTraits<prototypes::id::TestChildInterface>
{
  enum
  {
    Depth = 1
  };
};
template <>
struct PrototypeTraits<prototypes::id::TestCppKeywordNamedMethodsInterface>
{
  enum
  {
    Depth = 0
  };
};
template <>
struct PrototypeTraits<prototypes::id::TestNavigator>
{
  enum
  {
    Depth = 0
  };
};
template <>
template <>
template <>
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionTextureFloat>
{
  enum
  {
    Depth = 0
  };
};
template <>
struct PrototypeTraits<prototypes::id::WebGLExtensionTextureFloatLinear>
{
  enum
  {
    Depth = 0
  };
};
template <>
struct PrototypeTraits<prototypes::id::mozRTCSessionDescription>
{
  enum
  {
    Depth = 0
  };
};
;
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_PrototypeList_h
# 7290 "../../dist/include/mozilla/dom/PrototypeList.h"
# 13 "../../dist/include/mozilla/dom/DOMJSClass.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/JSSlots.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/DOMJSClass.h"

class nsCycleCollectionParticipant;

// All DOM globals must have a slot at DOM_PROTOTYPE_SLOT.
#define DOM_PROTOTYPE_SLOT JSCLASS_GLOBAL_SLOT_COUNT

// Keep this count up to date with any extra global slots added above.
#define DOM_GLOBAL_SLOTS 1

// We use these flag bits for the new bindings.
#define JSCLASS_DOM_GLOBAL JSCLASS_USERBIT1
#define JSCLASS_IS_DOMIFACEANDPROTOJSCLASS JSCLASS_USERBIT2

namespace mozilla {
namespace dom {

typedef bool
(* ResolveOwnProperty)(JSContext* cx, JS::Handle<JSObject*> wrapper,
                       JS::Handle<JSObject*> obj, JS::Handle<jsid> id,
                       JS::MutableHandle<JSPropertyDescriptor> desc);

typedef bool
(* EnumerateOwnProperties)(JSContext* cx, JS::Handle<JSObject*> wrapper,
                           JS::Handle<JSObject*> obj,
                           JS::AutoIdVector& props);

;

struct ConstantSpec
{
  const char* name;
  JS::Value value;
};

typedef bool (*PropertyEnabled)(JSContext* cx, JSObject* global);

template<typename T>
struct Prefable {
  

  // A boolean indicating whether this set of specs is enabled
  bool enabled;
  // A function pointer to a function that can say the property is disabled
  // even if "enabled" is set to true.  If the pointer is null the value of
  // "enabled" is used as-is unless availableFunc overrides.
  PropertyEnabled enabledFunc;
  // A function pointer to a function that can be used to disable a
  // property even if "enabled" is true and enabledFunc allowed.  This
  // is basically a hack to avoid having to codegen PropertyEnabled
  // implementations in case when we need to do two separate checks.
  PropertyEnabled availableFunc;
  const char* const* checkPermissions;
  // Array of specs, terminated in whatever way is customary for T.
  // Null to indicate a end-of-array for Prefable, when such an
  // indicator is needed.
  const T* specs;
};

struct NativeProperties
{
  const Prefable<const JSFunctionSpec>* staticMethods;
  jsid* staticMethodIds;
};

enum DOMObjectType {
  eInstance,
  eGlobalInstance,
  eInterface,
  eInterfacePrototype,
  eGlobalInterfacePrototype,
  eNamedPropertiesObject
};





typedef JSObject* (*ParentGetter)(JSContext* aCx, JS::Handle<JSObject*> aObj);

typedef JSObject* (*ProtoGetter)(JSContext* aCx,
                                 JS::Handle<JSObject*> aGlobal);
/**
 * Returns a handle to the relevent WebIDL prototype object for the given global
 * (which may be a handle to null on out of memory).  Once allocated, the
 * prototype object is guaranteed to exist as long as the global does, since the
 * global traces its array of WebIDL prototypes and constructors.
 */
typedef JS::Handle<JSObject*> (*ProtoHandleGetter)(JSContext* aCx,
                                                   JS::Handle<JSObject*> aGlobal);

// Special JSClass for reflected DOM objects.
struct DOMJSClass
{
  // It would be nice to just inherit from JSClass, but that precludes pure
  // compile-time initialization of the form |DOMJSClass = {...};|, since C++
  // only allows brace initialization for aggregate/POD types.
  const js::Class mBase;

  // A list of interfaces that this object implements, in order of decreasing
  // derivedness.
  const prototypes::ID mInterfaceChain[MAX_PROTOTYPE_CHAIN_LENGTH];

  // We store the DOM object in reserved slot with index DOM_OBJECT_SLOT or in
  // the proxy private if we use a proxy object.
  // Sometimes it's an nsISupports and sometimes it's not; this class tells
  // us which it is.
  const bool mDOMObjectIsISupports;

  const NativePropertyHooks* mNativeHooks;

  ParentGetter mGetParent;
  ProtoHandleGetter mGetProto;

  // This stores the CC participant for the native, null if this class is for a
  // worker or for a native inheriting from nsISupports (we can get the CC
  // participant by QI'ing in that case).
  nsCycleCollectionParticipant* mParticipant;

  static const DOMJSClass* FromJSClass(const JSClass* base) {
    MOZ_ASSERT(base->flags & JSCLASS_IS_DOMJSCLASS);
    return reinterpret_cast<const DOMJSClass*>(base);
  }

  static const DOMJSClass* FromJSClass(const js::Class* base) {
    return FromJSClass(Jsvalify(base));
  }

  
};

// Special JSClass for DOM interface and interface prototype objects.
struct DOMIfaceAndProtoJSClass
{
  // It would be nice to just inherit from js::Class, but that precludes pure
  // compile-time initialization of the form
  // |DOMJSInterfaceAndPrototypeClass = {...};|, since C++ only allows brace
  // initialization for aggregate/POD types.
  const js::Class mBase;

  // Either eInterface, eInterfacePrototype, eGlobalInterfacePrototype or
  // eNamedPropertiesObject.
  DOMObjectType mType;

  const NativePropertyHooks* mNativeHooks;

  // The value to return for toString() on this interface or interface prototype
  // object.
  const char* mToString;

  const prototypes::ID mPrototypeID;
  const uint32_t mDepth;

  ProtoGetter mGetParentProto;

  static const DOMIfaceAndProtoJSClass* FromJSClass(const JSClass* base) {
    MOZ_ASSERT(base->flags & JSCLASS_IS_DOMIFACEANDPROTOJSCLASS);
    return reinterpret_cast<const DOMIfaceAndProtoJSClass*>(base);
  }
  static const DOMIfaceAndProtoJSClass* FromJSClass(const js::Class* base) {
    return FromJSClass(Jsvalify(base));
  }

  
};

class ProtoAndIfaceCache;





} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_DOMJSClass_h */
# 297 "../../dist/include/mozilla/dom/DOMJSClass.h"
# 20 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMJSProxyHandler.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/DOMJSProxyHandler.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_DOMJSProxyHandler_h
#define mozilla_dom_DOMJSProxyHandler_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/DOMJSProxyHandler.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Likely.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/DOMJSProxyHandler.h"

#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/DOMJSProxyHandler.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Proxy.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/DOMJSProxyHandler.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/DOMJSProxyHandler.h"

#define DOM_PROXY_OBJECT_SLOT js::PROXY_PRIVATE_SLOT

namespace mozilla {
namespace dom {

enum {
  /**
   * DOM proxies have an extra slot for the expando object at index
   */
  JSPROXYSLOT_EXPANDO = 0
};

template<typename T> struct Prefable;

class BaseDOMProxyHandler : public js::BaseProxyHandler
{
public:
  

  // Implementations of methods that can be implemented in terms of
  // other lower-level methods.
  bool getOwnPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> proxy,
                                JS::Handle<jsid> id,
                                JS::MutableHandle<JSPropertyDescriptor> desc) const MOZ_OVERRIDE;

  ;

  /* GetAndClearExpandoObject does not DROP or clear the preserving wrapper flag. */
  ;
  ;

  static const char family;
};





extern jsid s_length_id;

;

// XXXbz this should really return uint32_t, with the maximum value
// meaning "not an index"...










} // namespace dom
} // namespace mozilla
// DOM exception throwing machinery (for both main thread and workers).

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/Exceptions.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#define NS_FORWARD_SAFE_NSISTACKFRAME(_to) \
  NS_IMETHOD GetLanguage(uint32_t *aLanguage) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLanguage(aLanguage); } \
  NS_IMETHOD GetLanguageName(nsACString & aLanguageName) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLanguageName(aLanguageName); } \
  NS_IMETHOD GetFilename(nsAString & aFilename) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFilename(aFilename); } \
  NS_IMETHOD GetName(nsAString & aName) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \
  NS_IMETHOD GetLineNumber(int32_t *aLineNumber) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLineNumber(aLineNumber); } \
  NS_IMETHOD GetColumnNumber(int32_t *aColumnNumber) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetColumnNumber(aColumnNumber); } \
  NS_IMETHOD GetSourceLine(nsACString & aSourceLine) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSourceLine(aSourceLine); } \
  NS_IMETHOD GetAsyncCause(nsAString & aAsyncCause) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAsyncCause(aAsyncCause); } \
  NS_IMETHOD GetAsyncCaller(nsIStackFrame * *aAsyncCaller) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAsyncCaller(aAsyncCaller); } \
  NS_IMETHOD GetCaller(nsIStackFrame * *aCaller) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCaller(aCaller); } \
  NS_IMETHOD GetFormattedStack(nsAString & aFormattedStack) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFormattedStack(aFormattedStack); } \
  NS_IMETHOD GetNativeSavedFrame(JS::MutableHandleValue aNativeSavedFrame) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNativeSavedFrame(aNativeSavedFrame); } \
  NS_IMETHOD ToString(nsACString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ToString(_retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsStackFrame : public nsIStackFrame
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISTACKFRAME
    return NS_ERROR_NOT_IMPLEMENTED;
}
/* AUTF8String toString (); */
NS_IMETHODIMP nsException::ToString(nsACString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 416 "../../dist/include/nsIException.h"


#endif /* __gen_nsIException_h__ */
# 419 "../../dist/include/nsIException.h"
# 14 "../../dist/include/mozilla/dom/Exceptions.h" 2

class nsIStackFrame;
class nsPIDOMWindow;
template <class T>
struct already_AddRefed;

namespace mozilla {
namespace dom {

class Exception;

bool
Throw(JSContext* cx, nsresult rv, const char* sz = nullptr);

// Create, throw and report an exception to a given window.
;

;

;

// Create an exception object for the given nsresult and message but
// don't set it pending on aCx.  This never returns null.
;

;

// Throwing a TypeError on an ErrorResult may result in SpiderMonkey using its
// own error reporting mechanism instead of just setting the exception on the
// context.  This happens if no script is running. Bug 1107777 adds a flag that
// forcibly turns this behaviour off. This is a stack helper to set the flag.
class MOZ_STACK_CLASS AutoForceSetExceptionOnContext {
private:
  JSContext* mCx;
  bool mOldValue;
public:
  ;
  ;
};

// Internal stuff not intended to be widely used.
namespace exceptions {

// aMaxDepth can be used to define a maximal depth for the stack trace. If the
// value is -1, a default maximal depth will be selected.
;

;

} // namespace exceptions
} // namespace dom
} // namespace mozilla

#endif
# 80 "../../dist/include/mozilla/dom/Exceptions.h"
# 22 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/NonRefcountedDOMObject.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/NonRefcountedDOMObject.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* vim: set ts=2 sw=2 et tw=79: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_NonRefcountedDOMObject_h__
#define mozilla_dom_NonRefcountedDOMObject_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/NonRefcountedDOMObject.h"

namespace mozilla {
namespace dom {

// Natives for DOM classes that aren't refcounted need to inherit from this
// class.
// If you're seeing objects of this class leak then natives for one of the DOM
// classes inheriting from it is leaking. If the native for that class has
// MOZ_COUNT_CTOR/DTOR in its constructor/destructor then it should show up in
// the leak log too.
class NonRefcountedDOMObject
{
protected:
  NonRefcountedDOMObject()
  {
    MOZ_COUNT_CTOR(NonRefcountedDOMObject);
  }
  ~NonRefcountedDOMObject()
  {
    MOZ_COUNT_DTOR(NonRefcountedDOMObject);
  }
};

} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_NonRefcountedDOMObject_h__ */
# 38 "../../dist/include/mozilla/dom/NonRefcountedDOMObject.h"
# 23 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/RootedDictionary.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/RootedDictionary.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* vim: set ts=2 sw=2 et tw=79: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_RootedDictionary_h__
#define mozilla_dom_RootedDictionary_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/GuardObjects.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/RootedDictionary.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/RootedDictionary.h"
#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/RootedDictionary.h"

namespace mozilla {
namespace dom {

template<typename T>
class MOZ_STACK_CLASS RootedDictionary : public T,
                                         private JS::CustomAutoRooter
{
public:
  explicit RootedDictionary(JSContext* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) :
    T(),
    JS::CustomAutoRooter(cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)
  {
  }

  virtual void trace(JSTracer *trc) MOZ_OVERRIDE
  {
    this->TraceDictionary(trc);
  }
};

template<typename T>
class MOZ_STACK_CLASS NullableRootedDictionary : public Nullable<T>,
                                                 private JS::CustomAutoRooter
{
public:
  

  
};

} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_RootedDictionary_h__ */
# 57 "../../dist/include/mozilla/dom/RootedDictionary.h"
# 25 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/workers/Workers.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/workers/Workers.h" 1
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_workers_workers_h__
#define mozilla_dom_workers_workers_h__

#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/workers/Workers.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/workers/Workers.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Mutex.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Mutex.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_Mutex_h
#define mozilla_Mutex_h

#if 0 /* expanded by -frewrite-includes */
#include "prlock.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/Mutex.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/BlockingResourceBase.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/BlockingResourceBase.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef mozilla_BlockingResourceBase_h
#define mozilla_BlockingResourceBase_h

#if 0 /* expanded by -frewrite-includes */
#include "prlog.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlog.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef prlog_h___
#define prlog_h___

#if 0 /* expanded by -frewrite-includes */
#include "prtypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlog.h"

PR_BEGIN_EXTERN_C

/*
** After compiling and linking you application, set the environment:
** 
** set NSPR_LOG_MODULES=gizmo:5
** set NSPR_LOG_FILE=logfile.txt
** 
** When you execute your application, the string "Log this! 1" will be
** written to the file "logfile.txt".
** 
** Note to NSPR engineers: a number of PRLogModuleInfo structures are
** defined and initialized in prinit.c. See this module for ideas on
** what to log where.
** 
*/

typedef enum PRLogModuleLevel {
    PR_LOG_NONE = 0,                /* nothing */
    PR_LOG_ALWAYS = 1,              /* always printed */
    PR_LOG_ERROR = 2,               /* error messages */
    PR_LOG_WARNING = 3,             /* warning messages */
    PR_LOG_DEBUG = 4,               /* debug messages */

    PR_LOG_NOTICE = PR_LOG_DEBUG,   /* notice messages */
    PR_LOG_WARN = PR_LOG_WARNING,   /* warning messages */
    PR_LOG_MIN = PR_LOG_DEBUG,      /* minimal debugging messages */
    PR_LOG_MAX = PR_LOG_DEBUG       /* maximal debugging messages */
} PRLogModuleLevel;

/*
** One of these structures is created for each module that uses logging.
**    "name" is the name of the module
**    "level" is the debugging level selected for that module
*/
typedef struct PRLogModuleInfo {
    const char *name;
    PRLogModuleLevel level;
    struct PRLogModuleInfo *next;
} PRLogModuleInfo;

/*
** Create a new log module.
*/
NSPR_API(PRLogModuleInfo*) PR_NewLogModule(const char *name);

/*
** Set the file to use for logging. Returns PR_FALSE if the file cannot
** be created
*/
NSPR_API(PRBool) PR_SetLogFile(const char *name);

/*
** Set the size of the logging buffer. If "buffer_size" is zero then the
** logging becomes "synchronous" (or unbuffered).
*/
NSPR_API(void) PR_SetLogBuffering(PRIntn buffer_size);

/*
** Print a string to the log. "fmt" is a PR_snprintf format type. All
** messages printed to the log are preceeded by the name of the thread
** and a time stamp. Also, the routine provides a missing newline if one
** is not provided.
*/
NSPR_API(void) PR_LogPrint(const char *fmt, ...);

/*
** Flush the log to its file.
*/
NSPR_API(void) PR_LogFlush(void);

NSPR_API(void) PR_Assert(const char *s, const char *file, PRIntn ln);

#if defined(DEBUG) || defined(FORCE_PR_LOG)
#define PR_LOGGING 1

#define PR_LOG_TEST(_module,_level) \
    ((_module)->level >= (_level))

/*
** Log something.
**    "module" is the address of a PRLogModuleInfo structure
**    "level" is the desired logging level
**    "args" is a variable length list of arguments to print, in the following
**       format:  ("printf style format string", ...)
*/
#define PR_LOG(_module,_level,_args)     \
    PR_BEGIN_MACRO             \
      if (PR_LOG_TEST(_module,_level)) { \
      PR_LogPrint _args;         \
      }                     \
    PR_END_MACRO

#else /* defined(DEBUG) || defined(FORCE_PR_LOG) */
# 183 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlog.h"

#undef PR_LOGGING
#define PR_LOG_TEST(module,level) 0
#define PR_LOG(module,level,args)
#define PR_ASSERT(expr) ((void) 0)
#define PR_NOT_REACHED(reasonStr)

#endif /* defined(DEBUG) || defined(FORCE_PR_ASSERT) */
# 218 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlog.h"

PR_END_EXTERN_C

#endif /* prlog_h___ */
# 222 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlog.h"
# 12 "../../dist/include/mozilla/BlockingResourceBase.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/BlockingResourceBase.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/BlockingResourceBase.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/BlockingResourceBase.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/BlockingResourceBase.h"

#ifdef DEBUG

// NB: Comment this out to enable callstack tracking.
#define MOZ_CALLSTACK_DISABLED

#if 0 /* expanded by -frewrite-includes */
#include "prinit.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinit.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef prinit_h___
#define prinit_h___

#if 0 /* expanded by -frewrite-includes */
#include "prthread.h"
#define prwin16_h___

/*
** Condition use of this header on platform.
*/
#if (defined(XP_PC) && !defined(_WIN32) && !defined(XP_OS2) && defined(MOZILLA_CLIENT)) || defined(WIN16)
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prwin16.h"

PR_BEGIN_EXTERN_C
/* 
** Win16 stdio special case.
** To get stdio to work for Win16, all calls to printf() and related
** things must be called from the environment of the .EXE; calls to
** printf() from the .DLL send output to the bit-bucket.
**
** To make sure that PR_fprintf(), and related functions, work correctly,
** the actual stream I/O to stdout, stderr, stdin must be done in the
** .EXE. To do this, a hack is placed in _MD_Write() such that the
** fd for stdio handles results in a call to the .EXE.
PR_END_EXTERN_C
#else
# 149 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prwin16.h"
/*
** For platforms other than Win16, define
** PR_STDIO_INIT() as a No-Op.
*/
#define PR_STDIO_INIT()
#endif /* WIN16 || MOZILLA_CLIENT */
# 155 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prwin16.h"

#endif /* prwin16_h___ */
# 157 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prwin16.h"








# 12 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinit.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinit.h"

PR_BEGIN_EXTERN_C

/************************************************************************/
/**************************IDENTITY AND VERSIONING***********************/
/************************************************************************/

/*
** NSPR's name, this should persist until at least the turn of the
** century.
*/
#define PR_NAME     "NSPR"

/*
** NSPR's version is used to determine the likelihood that the version you
** used to build your component is anywhere close to being compatible with
/*
 ****************************************************************
 *
 * Module initialization:
 *
 ****************************************************************
 */

typedef struct PRCallOnceType {
    PRIntn initialized;
    PRInt32 inProgress;
    PRStatus status;
} PRCallOnceType;

typedef PRStatus (PR_CALLBACK *PRCallOnceFN)(void);

typedef PRStatus (PR_CALLBACK *PRCallOnceWithArgFN)(void *arg);

NSPR_API(PRStatus) PR_CallOnce(
    PRCallOnceType *once,
    PRCallOnceFN    func
);

NSPR_API(PRStatus) PR_CallOnceWithArg(
    PRCallOnceType      *once,
    PRCallOnceWithArgFN  func,
    void                *arg
);


PR_END_EXTERN_C

#endif /* prinit_h___ */
# 216 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prinit.h"
# 24 "../../dist/include/mozilla/BlockingResourceBase.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 26 "../../dist/include/mozilla/BlockingResourceBase.h"

#ifndef MOZ_CALLSTACK_DISABLED
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 29 "../../dist/include/mozilla/BlockingResourceBase.h"
#endif
# 30 "../../dist/include/mozilla/BlockingResourceBase.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsXPCOM.h"
#endif /* expanded by -frewrite-includes */
# 32 "../../dist/include/mozilla/BlockingResourceBase.h"
#endif
# 33 "../../dist/include/mozilla/BlockingResourceBase.h"

//
// This header is not meant to be included by client code.
//

namespace mozilla {

#ifdef DEBUG
template <class T> class DeadlockDetector;
#endif
# 43 "../../dist/include/mozilla/BlockingResourceBase.h"

/**
 * BlockingResourceBase
 * Base class of resources that might block clients trying to acquire them.
 * Does debugging and deadlock detection in DEBUG builds.
 **/
class BlockingResourceBase
{
public:
  // Needs to be kept in sync with kResourceTypeNames.
  enum BlockingResourceType { eMutex, eReentrantMonitor, eCondVar };

  /**
   * kResourceTypeName
   * Human-readable version of BlockingResourceType enum.
   */
  static const char* const kResourceTypeName[];


#ifdef DEBUG

  static size_t
  SizeOfDeadlockDetector(MallocSizeOf aMallocSizeOf);

  /**
   * Print
   * Write a description of this blocking resource to |aOut|.  If
   * the resource appears to be currently acquired, the current
   * acquisition context is printed and true is returned.
   * Otherwise, we print the context from |aFirstSeen|, the
   * first acquisition from which the code calling |Print()|
   * became interested in us, and return false.
   *
   * *NOT* thread safe.  Reads |mAcquisitionContext| without
   * synchronization, but this will not cause correctness
   * problems.
   *
   * FIXME bug 456272: hack alert: because we can't write call
   * contexts into strings, all info is written to stderr, but
   * only some info is written into |aOut|
   */
  bool Print(nsACString& aOut) const;

  size_t
  SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
  {
    // NB: |mName| is not reported as it's expected to be a static string.
    //     If we switch to a nsString it should be added to the tally.
    //     |mChainPrev| is not reported because its memory is not owned.
    size_t n = aMallocSizeOf(this);
    return n;
  }

  // ``DDT'' = ``Deadlock Detector Type''
  typedef DeadlockDetector<BlockingResourceBase> DDT;

protected:
#ifdef MOZ_CALLSTACK_DISABLED
  typedef bool AcquisitionState;
#else
# 103 "../../dist/include/mozilla/BlockingResourceBase.h"
  typedef nsAutoTArray<void*, 24> AcquisitionState;
#endif
# 105 "../../dist/include/mozilla/BlockingResourceBase.h"

  /**
   * BlockingResourceBase
   * Initialize this blocking resource.  Also hooks the resource into
   * instrumentation code.
   *
   * Thread safe.
   *
   * @param aName A meaningful, unique name that can be used in
   *              error messages, et al.
   * @param aType The specific type of |this|, if any.
   **/
  BlockingResourceBase(const char* aName, BlockingResourceType aType);

  /**
   * Release
   * Remove this resource from the current thread's acquisition chain.
   * The resource does not have to be at the front of the chain, although
   * it is confusing to release resources in a different order than they
   * *NOT* thread safe.
   */
  static void Shutdown();

  static void StackWalkCallback(uint32_t aFrameNumber, void* aPc,
                                void* aSp, void* aClosure);
  static void GetStackTrace(AcquisitionState& aState);

#  ifdef MOZILLA_INTERNAL_API
  // so it can call BlockingResourceBase::Shutdown()
  friend void LogTerm();
#  endif  // ifdef MOZILLA_INTERNAL_API
# 330 "../../dist/include/mozilla/BlockingResourceBase.h"

#else  // non-DEBUG implementation
# 332 "../../dist/include/mozilla/BlockingResourceBase.h"

  BlockingResourceBase(const char* aName, BlockingResourceType aType) {}

  ~BlockingResourceBase() {}

#endif
# 338 "../../dist/include/mozilla/BlockingResourceBase.h"
};


} // namespace mozilla


#endif // mozilla_BlockingResourceBase_h
# 345 "../../dist/include/mozilla/BlockingResourceBase.h"
# 13 "../../dist/include/mozilla/Mutex.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/GuardObjects.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/Mutex.h"

//
// Provides:
//
//  - Mutex, a non-recursive mutex
//  - MutexAutoLock, an RAII class for ensuring that Mutexes are properly
//    locked and unlocked
//  - MutexAutoUnlock, complementary sibling to MutexAutoLock
//
//  - OffTheBooksMutex, a non-recursive mutex that doesn't do leak checking
//  - OffTheBooksMutexAuto{Lock,Unlock} - Like MutexAuto{Lock,Unlock}, but for
//    an OffTheBooksMutex.
//
// Using MutexAutoLock/MutexAutoUnlock etc. is MUCH preferred to making bare
// calls to Lock and Unlock.
//
namespace mozilla {

/**
 * OffTheBooksMutex is identical to Mutex, except that OffTheBooksMutex doesn't
 * include leak checking.  Sometimes you want to intentionally "leak" a mutex
 * until shutdown; in these cases, OffTheBooksMutex is for you.
 */
class OffTheBooksMutex : BlockingResourceBase
{
public:
  /**
   * @param aName A name which can reference this lock
   * @returns If failure, nullptr
   *          If success, a valid Mutex* which must be destroyed
   *          by Mutex::DestroyMutex()
   **/
  explicit OffTheBooksMutex(const char* aName)
    : BlockingResourceBase(aName, eMutex)
  {
    mLock = PR_NewLock();
    if (!mLock) {
      NS_RUNTIMEABORT("Can't allocate mozilla::Mutex");
    }
  }

  ~OffTheBooksMutex()
  {
    NS_ASSERTION(mLock,
                 "improperly constructed Lock or double free");
    // NSPR does consistency checks for us
    PR_DestroyLock(mLock);
    mLock = 0;
  }

#ifndef DEBUG
  /**
   * Lock
   * @see prlock.h
   **/
   * @see prlock.h
   **/
  

#else
# 90 "../../dist/include/mozilla/Mutex.h"
  void Lock();
  void Unlock();

  void AssertCurrentThreadOwns() const
  {
    PR_ASSERT_CURRENT_THREAD_OWNS_LOCK(mLock);
  }

  void AssertNotCurrentThreadOwns() const
  {
    // FIXME bug 476536
  }

#endif  // ifndef DEBUG
# 104 "../../dist/include/mozilla/Mutex.h"

private:
  ;
  ;
  ;

  PRLock* mLock;

  friend class CondVar;
};

/**
 * Mutex
 * When possible, use MutexAutoLock/MutexAutoUnlock to lock/unlock this
 * mutex within a scope, instead of calling Lock/Unlock directly.
 */
class Mutex : public OffTheBooksMutex
{
public:
  explicit Mutex(const char* aName)
    : OffTheBooksMutex(aName)
  {
    MOZ_COUNT_CTOR(Mutex);
  }

  ~Mutex()
  {
    MOZ_COUNT_DTOR(Mutex);
  }

private:
  ;
  ;
  ;
};

/**
 * MutexAutoLock
 * Acquires the Mutex when it enters scope, and releases it when it leaves
 * scope.
 *
 * MUCH PREFERRED to bare calls to Mutex.Lock and Unlock.
 */
template<typename T>
class MOZ_STACK_CLASS BaseAutoLock
{
public:
  /**
   * Constructor
   * The constructor aquires the given lock.  The destructor
   * releases the lock.
   *
   * @param aLock A valid mozilla::Mutex* returned by
   *              mozilla::Mutex::NewMutex.
   **/
  explicit BaseAutoLock(T& aLock MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
    : mLock(&aLock)
  {
    MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    NS_ASSERTION(mLock, "null mutex");
    mLock->Lock();
  }

  ~BaseAutoLock(void)
  {
    mLock->Unlock();
  }

private:
  ;
  ;
  ;
  static void* operator new(size_t) CPP_THROW_NEW;

  T* mLock;
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

typedef BaseAutoLock<Mutex> MutexAutoLock;
typedef BaseAutoLock<OffTheBooksMutex> OffTheBooksMutexAutoLock;

/**
 * MutexAutoUnlock
 * Releases the Mutex when it enters scope, and re-acquires it when it leaves
 * scope.
 *
 * MUCH PREFERRED to bare calls to Mutex.Unlock and Lock.
 */
template<typename T>
class MOZ_STACK_CLASS BaseAutoUnlock
{
public:
  

  

private:
  ;
  ;
  ;
  static void* operator new(size_t) CPP_THROW_NEW;

  T* mLock;
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

typedef BaseAutoUnlock<Mutex> MutexAutoUnlock;
typedef BaseAutoUnlock<OffTheBooksMutex> OffTheBooksMutexAutoUnlock;

} // namespace mozilla


#endif // ifndef mozilla_Mutex_h
# 226 "../../dist/include/mozilla/Mutex.h"
# 12 "../../dist/include/mozilla/dom/workers/Workers.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/workers/Workers.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/workers/Workers.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsILoadContext.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsILoadContext.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsILoadContext.idl
 */

#ifndef __gen_nsILoadContext_h__
#define __gen_nsILoadContext_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsILoadContext.h"
#endif
# 12 "../../dist/include/nsILoadContext.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsILoadContext.h"
class nsIDOMWindow; /* forward declaration */

class nsIDOMElement; /* forward declaration */


/* starting interface:    nsILoadContext */
#define NS_ILOADCONTEXT_IID_STR "6ec837fa-af93-4350-bbb8-0985d54c74ca"

#define NS_ILOADCONTEXT_IID \
  {0x6ec837fa, 0xaf93, 0x4350, \
    { 0xbb, 0xb8, 0x09, 0x85, 0xd5, 0x4c, 0x74, 0xca }}

class nsILoadContext : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILOADCONTEXT_IID)

  /* readonly attribute nsIDOMWindow associatedWindow; */
  NS_IMETHOD GetAssociatedWindow(nsIDOMWindow * *aAssociatedWindow) = 0;

  /* readonly attribute nsIDOMWindow topWindow; */
  NS_IMETHOD GetTopWindow(nsIDOMWindow * *aTopWindow) = 0;

  /* readonly attribute nsIDOMElement topFrameElement; */
  NS_IMETHOD GetTopFrameElement(nsIDOMElement * *aTopFrameElement) = 0;

  /* readonly attribute unsigned long long nestedFrameId; */
  NS_IMETHOD GetNestedFrameId(uint64_t *aNestedFrameId) = 0;

  /* boolean isAppOfType (in unsigned long appType); */
  NS_IMETHOD IsAppOfType(uint32_t appType, bool *_retval) = 0;

  /* readonly attribute boolean isContent; */
  NS_IMETHOD GetIsContent(bool *aIsContent) = 0;

  /* attribute boolean usePrivateBrowsing; */
  NS_IMETHOD GetUsePrivateBrowsing(bool *aUsePrivateBrowsing) = 0;
  NS_IMETHOD SetUsePrivateBrowsing(bool aUsePrivateBrowsing) = 0;
  /* [noscript] void SetRemoteTabs (in boolean aUseRemoteTabs); */
  NS_IMETHOD SetRemoteTabs(bool aUseRemoteTabs) = 0;

  /* readonly attribute boolean isInBrowserElement; */
  NS_IMETHOD GetIsInBrowserElement(bool *aIsInBrowserElement) = 0;

  /* readonly attribute unsigned long appId; */
  NS_IMETHOD GetAppId(uint32_t *aAppId) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsILoadContext, NS_ILOADCONTEXT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSILOADCONTEXT \
  NS_IMETHOD GetAssociatedWindow(nsIDOMWindow * *aAssociatedWindow) MOZ_OVERRIDE; \
  NS_IMETHOD GetTopWindow(nsIDOMWindow * *aTopWindow) MOZ_OVERRIDE; \
  NS_IMETHOD GetTopFrameElement(nsIDOMElement * *aTopFrameElement) MOZ_OVERRIDE; \
  NS_IMETHOD GetNestedFrameId(uint64_t *aNestedFrameId) MOZ_OVERRIDE; \
  NS_IMETHOD IsAppOfType(uint32_t appType, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetIsContent(bool *aIsContent) MOZ_OVERRIDE; \
  NS_IMETHOD GetUsePrivateBrowsing(bool *aUsePrivateBrowsing) MOZ_OVERRIDE; \
  NS_IMETHOD SetUsePrivateBrowsing(bool aUsePrivateBrowsing) MOZ_OVERRIDE; \
  NS_IMETHOD GetUseRemoteTabs(bool *aUseRemoteTabs) MOZ_OVERRIDE; \
  NS_IMETHOD SetPrivateBrowsing(bool aInPrivateBrowsing) MOZ_OVERRIDE; \
  NS_IMETHOD SetRemoteTabs(bool aUseRemoteTabs) MOZ_OVERRIDE; \
#define NS_IINTERFACEREQUESTOR_IID_STR "033a1470-8b2a-11d3-af88-00a024ffc08c"

#define NS_IINTERFACEREQUESTOR_IID \
  {0x033a1470, 0x8b2a, 0x11d3, \
    { 0xaf, 0x88, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}

class NS_NO_VTABLE nsIInterfaceRequestor : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IINTERFACEREQUESTOR_IID)

  /* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
  NS_IMETHOD GetInterface(const nsIID & uuid, void **result) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIInterfaceRequestor, NS_IINTERFACEREQUESTOR_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIINTERFACEREQUESTOR \
  NS_IMETHOD GetInterface(const nsIID & uuid, void **result) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIINTERFACEREQUESTOR(_to) \
  NS_IMETHOD GetInterface(const nsIID & uuid, void **result) MOZ_OVERRIDE { return _to GetInterface(uuid, result); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIINTERFACEREQUESTOR(_to) \
  NS_IMETHOD GetInterface(const nsIID & uuid, void **result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInterface(uuid, result); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsInterfaceRequestor : public nsIInterfaceRequestor
{
public:
  NS_DECL_ISUPPORTS
  /* member initializers and constructor code */
}

nsInterfaceRequestor::~nsInterfaceRequestor()
{
  /* destructor code */
}

/* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */
NS_IMETHODIMP nsInterfaceRequestor::GetInterface(const nsIID & uuid, void **result)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 89 "../../dist/include/nsIInterfaceRequestor.h"


#endif /* __gen_nsIInterfaceRequestor_h__ */
# 92 "../../dist/include/nsIInterfaceRequestor.h"
# 22 "../../dist/include/mozilla/dom/workers/Workers.h" 2

#define BEGIN_WORKERS_NAMESPACE \
  namespace mozilla { namespace dom { namespace workers {
#define END_WORKERS_NAMESPACE \
  } /* namespace workers */ } /* namespace dom */ } /* namespace mozilla */
#define USING_WORKERS_NAMESPACE \
  using namespace mozilla::dom::workers;

#define WORKERS_SHUTDOWN_TOPIC "web-workers-shutdown"

class nsIContentSecurityPolicy;
class nsIScriptContext;
class nsIGlobalObject;
class nsPIDOMWindow;
class nsIPrincipal;
class nsILoadGroup;
class nsITabChild;
class nsIChannel;
class nsIURI;

namespace mozilla {
namespace ipc {
class PrincipalInfo;
}

namespace dom {
// If you change this, the corresponding list in nsIWorkerDebugger.idl needs to
// be updated too.
enum WorkerType
{
  WorkerTypeDedicated,
  WorkerTypeShared,
  WorkerTypeService
};
}
}

BEGIN_WORKERS_NAMESPACE

class WorkerPrivate;

struct PrivatizableBase
{ };

#ifdef DEBUG
void
AssertIsOnMainThread();
#else
# 70 "../../dist/include/mozilla/dom/workers/Workers.h"

#endif
# 74 "../../dist/include/mozilla/dom/workers/Workers.h"

struct JSSettings
{
  enum {
    // All the GC parameters that we support.
    JSSettings_JSGC_MAX_BYTES = 0,
    JSSettings_JSGC_MAX_MALLOC_BYTES,
    JSSettings_JSGC_HIGH_FREQUENCY_TIME_LIMIT,
    JSSettings_JSGC_LOW_FREQUENCY_HEAP_GROWTH,
    JSSettings_JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MIN,
    JSSettings_JSGC_HIGH_FREQUENCY_HEAP_GROWTH_MAX,
    JSSettings_JSGC_HIGH_FREQUENCY_LOW_LIMIT,
    JSSettings_JSGC_HIGH_FREQUENCY_HIGH_LIMIT,
    JSSettings_JSGC_ALLOCATION_THRESHOLD,
    JSSettings_JSGC_SLICE_TIME_BUDGET,
    JSSettings_JSGC_DYNAMIC_HEAP_GROWTH,
    JSSettings_JSGC_DYNAMIC_MARK_SLICE,
    // JSGC_MODE not supported

    // This must be last so that we get an accurate count.
    kGCSettingsArraySize
  };

  struct JSGCSetting
  {
    JSGCParamKey key;
    uint32_t value;

    JSGCSetting()
    : key(static_cast<JSGCParamKey>(-1)), value(0)
    { }

    bool
    IsSet() const
    {
      return key != static_cast<JSGCParamKey>(-1);
    }

    void
    Unset()
    {
      key = static_cast<JSGCParamKey>(-1);
      value = 0;
    }
  };

  // There are several settings that we know we need so it makes sense to
  // preallocate here.
  typedef JSGCSetting JSGCSettingsArray[kGCSettingsArraySize];

  // Settings that change based on chrome/content context.
  struct JSContentChromeSettings
  {
    JS::CompartmentOptions compartmentOptions;
    int32_t maxScriptRuntime;

    JSContentChromeSettings()
    : compartmentOptions(), maxScriptRuntime(0)
    { }
  };

  JSContentChromeSettings chrome;
  JSContentChromeSettings content;
  JSGCSettingsArray gcSettings;
  JS::RuntimeOptions runtimeOptions;

#ifdef JS_GC_ZEAL
  uint8_t gcZeal;
  uint32_t gcZealFrequency;
#endif
# 144 "../../dist/include/mozilla/dom/workers/Workers.h"

  

  
};

enum WorkerPreference
{
  WORKERPREF_DUMP = 0, // browser.dom.window.dump.enabled
  WORKERPREF_DOM_CACHES, // dom.caches.enabled
  WORKERPREF_COUNT
};

// Implemented in WorkerPrivate.cpp

struct WorkerLoadInfo
{
  // All of these should be released in WorkerPrivateParent::ForgetMainThreadObjects.
  nsCOMPtr<nsIURI> mBaseURI;
  nsCOMPtr<nsIURI> mResolvedScriptURI;
  nsCOMPtr<nsIPrincipal> mPrincipal;
  nsCOMPtr<nsIScriptContext> mScriptContext;
  nsCOMPtr<nsPIDOMWindow> mWindow;
  nsCOMPtr<nsIContentSecurityPolicy> mCSP;
  nsCOMPtr<nsIChannel> mChannel;
  nsCOMPtr<nsILoadGroup> mLoadGroup;

  class InterfaceRequestor MOZ_FINAL : public nsIInterfaceRequestor
  {
    NS_DECL_ISUPPORTS

  public:
    ;
    ;
    NS_IMETHOD GetInterface(const nsIID& aIID, void** aSink) MOZ_OVERRIDE;

  private:
    

    ;

    nsCOMPtr<nsILoadContext> mLoadContext;

    // Array of weak references to nsITabChild.  We do not want to keep TabChild
    // actors alive for long after their ActorDestroy() methods are called.
    nsTArray<nsWeakPtr> mTabChildList;
  };
  bool mIndexedDBAllowed;

  ;
  ;

  ;
};

// All of these are implemented in RuntimeService.cpp

;

;

;

class WorkerTask
{
protected:
  

  virtual ~WorkerTask()
  { }

public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WorkerTask)

  ;
};

class WorkerCrossThreadDispatcher
{
   friend class WorkerPrivate;

  // Must be acquired *before* the WorkerPrivate's mutex, when they're both
  // held.
  Mutex mMutex;
  WorkerPrivate* mWorkerPrivate;

private:
  // Only created by WorkerPrivate.
  ;

  // Only called by WorkerPrivate.
  

  ~WorkerCrossThreadDispatcher() {}

;

} // namespace exceptions

;

;

;

// Throws the JSMSG_GETTER_ONLY exception.  This shouldn't be used going
// forward -- getter-only properties should just use JS_PSG for the setter
// (implying no setter at all), which will not throw when set in non-strict
// code but will in strict code.  Old code should use this only for temporary
// compatibility reasons.
;

END_WORKERS_NAMESPACE

#endif // mozilla_dom_workers_workers_h__
# 352 "../../dist/include/mozilla/dom/workers/Workers.h"
# 26 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Likely.h"
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 29 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CycleCollectedJSRuntime.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/CycleCollectedJSRuntime.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_CycleCollectedJSRuntime_h__
#define mozilla_CycleCollectedJSRuntime_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/CycleCollectedJSRuntime.h"
#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/CycleCollectedJSRuntime.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollector.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCycleCollector.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsCycleCollector_h__
#define nsCycleCollector_h__

class nsICycleCollectorListener;
class nsICycleCollectorLogSink;
class nsISupports;
template<class T> struct already_AddRefed;

#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
    /* Instantiate as SliceBudget(WorkBudget(n)). */
    ;

    
#endif /* js_SliceBudget_h */
# 81 "../../dist/include/js/SliceBudget.h"
# 19 "../../dist/include/nsCycleCollector.h" 2

namespace mozilla {

class CycleCollectedJSRuntime;

// Called back from DeferredFinalize.  Should add 'thing' to the array of smart
// pointers in 'pointers', creating the array if 'pointers' is null, and return
// the array.
typedef void* (*DeferredFinalizeAppendFunction)(void* aPointers, void* aThing);

// Called to finalize a number of objects. Slice is the number of objects
// to finalize, or if it's UINT32_MAX, all objects should be finalized.
// Return value indicates whether it finalized all objects in the buffer.
typedef bool (*DeferredFinalizeFunction)(uint32_t aSlice, void* aData);

}

;

;

typedef void (*CC_BeforeUnlinkCallback)(void);
;

typedef void (*CC_ForgetSkippableCallback)(void);
;

;

#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/CycleCollectedJSRuntime.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDataHashtable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsDataHashtable.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsDataHashtable_h__
#define nsDataHashtable_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsDataHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsBaseHashtable.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/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
 */
template<class KeyClass, class DataType>
class nsDataHashtable
  : public nsBaseHashtable<KeyClass, DataType, DataType>
{
public:
  
  explicit nsDataHashtable(uint32_t aInitLength)
    : nsBaseHashtable<KeyClass, DataType, DataType>(aInitLength)
  {
  }
};

#endif // nsDataHashtable_h__
# 34 "../../dist/include/nsDataHashtable.h"
# 16 "../../dist/include/mozilla/CycleCollectedJSRuntime.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/CycleCollectedJSRuntime.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/CycleCollectedJSRuntime.h"

class nsCycleCollectionNoteRootCallback;
class nsIException;
class nsIRunnable;

namespace js {
struct Class;
}

namespace mozilla {

class JSGCThingParticipant: public nsCycleCollectionParticipant
{
public:
  NS_IMETHOD_(void) Root(void*) MOZ_OVERRIDE
  {
    MOZ_ASSERT(false, "Don't call Root on GC things");
  }

  NS_IMETHOD_(void) Unlink(void*) MOZ_OVERRIDE
  {
    MOZ_ASSERT(false, "Don't call Unlink on GC things, as they may be dead");
  }

  NS_IMETHOD_(void) Unroot(void*) MOZ_OVERRIDE
  {
    MOZ_ASSERT(false, "Don't call Unroot on GC things, as they may be dead");
  }

  NS_IMETHOD_(void) DeleteCycleCollectable(void* aPtr) MOZ_OVERRIDE
  {
    MOZ_ASSERT(false, "Can't directly delete a cycle collectable GC thing");
  }

  NS_IMETHOD Traverse(void* aPtr, nsCycleCollectionTraversalCallback& aCb)
    MOZ_OVERRIDE;
};

class JSZoneParticipant : public nsCycleCollectionParticipant
{
public:
  MOZ_CONSTEXPR JSZoneParticipant(): nsCycleCollectionParticipant()
  {
  }

  NS_IMETHOD_(void) Root(void*) MOZ_OVERRIDE
  {
    MOZ_ASSERT(false, "Don't call Root on GC things");
  }

  NS_IMETHOD_(void) Unlink(void*) MOZ_OVERRIDE
  {
    MOZ_ASSERT(false, "Don't call Unlink on GC things, as they may be dead");
  }

  NS_IMETHOD_(void) Unroot(void*) MOZ_OVERRIDE
  {
    MOZ_ASSERT(false, "Don't call Unroot on GC things, as they may be dead");
  }

  NS_IMETHOD_(void) DeleteCycleCollectable(void*) MOZ_OVERRIDE
  {
    MOZ_ASSERT(false, "Can't directly delete a cycle collectable GC thing");
  }

  NS_IMETHOD Traverse(void* aPtr, nsCycleCollectionTraversalCallback& aCb)
    MOZ_OVERRIDE;
};

class IncrementalFinalizeRunnable;

// Contains various stats about the cycle collection.
struct CycleCollectorResults
{
  CycleCollectorResults()
  {
    // Initialize here so when we increment mNumSlices the first time we're
    // not using uninitialized memory.
    Init();
  }

  void Init()
  {
    mForcedGC = false;
    mMergedZones = false;
    mVisitedRefCounted = 0;
    mVisitedGCed = 0;
    mFreedRefCounted = 0;
    mFreedGCed = 0;
    mFreedJSZones = 0;
    mNumSlices = 1;
    // mNumSlices is initialized to one, because we call Init() after the
    // per-slice increment of mNumSlices has already occurred.
  }

  bool mForcedGC;
  bool mMergedZones;
  uint32_t mVisitedRefCounted;
  uint32_t mVisitedGCed;
  uint32_t mFreedRefCounted;
  uint32_t mFreedGCed;
  uint32_t mFreedJSZones;
  uint32_t mNumSlices;
};

class CycleCollectedJSRuntime
{
  friend class JSGCThingParticipant;
  friend class JSZoneParticipant;
  friend class IncrementalFinalizeRunnable;
protected:
  CycleCollectedJSRuntime(JSRuntime* aParentRuntime,
                          uint32_t aMaxBytes,
                          uint32_t aMaxNurseryBytes);
  virtual ~CycleCollectedJSRuntime();

  ;
  ;

  
  

public:
  // Two conditions, JSOutOfMemory and JSLargeAllocationFailure, are noted in
  // crash reports. Here are the values that can appear in the reports:
  enum class OOMState : uint32_t {
    // The condition has never happened. No entry appears in the crash report.
    OK,

    // We are currently reporting the given condition.
    // 
    // Suppose a crash report contains "JSLargeAllocationFailure:
    // Reporting". This means we crashed while executing memory-pressure
    // observers, trying to shake loose some memory. The large allocation in
    // question did not return null: it is still on the stack. Had we not
    // crashed, it would have been retried.
    Reporting,
  };

private:
  ;
  ;
  ;
  ;

public:
  ;
  ;
#ifdef DEBUG
  bool IsJSHolder(void* aHolder);
  void AssertNoObjectsToTrace(void* aPossibleJSHolder);
#endif
# 258 "../../dist/include/mozilla/CycleCollectedJSRuntime.h"

  ;
  static CycleCollectedJSRuntime* Get();

private:
  JSGCThingParticipant mGCThingCycleCollectorGlobal;

  JSZoneParticipant mJSZoneCycleCollectorGlobal;

  JSRuntime* mJSRuntime;

  nsDataHashtable<nsPtrHashKey<void>, nsScriptObjectTracer*> mJSHolders;

  nsTArray<nsISupports*> mDeferredSupports;
  typedef nsDataHashtable<nsFuncPtrHashKey<DeferredFinalizeFunction>, void*>
    DeferredFinalizerTable;
  DeferredFinalizerTable mDeferredFinalizerTable;

  nsRefPtr<IncrementalFinalizeRunnable> mFinalizeRunnable;

  nsCOMPtr<nsIException> mPendingException;

  nsTArray<nsRefPtr<nsIRunnable>> mPromiseMicroTaskQueue;

  OOMState mOutOfMemoryState;
  OOMState mLargeAllocationFailureState;
};

;

// Returns true if the JSGCTraceKind is one the cycle collector cares about.


} // namespace mozilla

#endif // mozilla_CycleCollectedJSRuntime_h__
# 330 "../../dist/include/mozilla/CycleCollectedJSRuntime.h"
# 30 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollector.h"
#endif /* expanded by -frewrite-includes */
# 31 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIGlobalObject.h"
#endif /* expanded by -frewrite-includes */
# 32 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIXPConnect.h"
 * invoked from the JavaScript code generated from IDL interfaces.
 * The goal of the utility functions is to cut down on the size of
 * the generated code itself.
 */

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/base/nsJSUtils.h"

#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/dom/base/nsJSUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "jsfriendapi.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/dom/base/nsJSUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Conversions.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/dom/base/nsJSUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/mozilla-central/dom/base/nsJSUtils.h"

class nsIScriptContext;
class nsIScriptGlobalObject;

namespace mozilla {
namespace dom {

#endif /* nsJSUtils_h__ */
# 226 "/Users/luser/build/mozilla-central/dom/base/nsJSUtils.h"
# 34 "../../dist/include/mozilla/dom/BindingUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 35 "../../dist/include/mozilla/dom/BindingUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "qsObjectHelper.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/js/xpconnect/src/qsObjectHelper.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=4 et sw=4 tw=99: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef qsObjectHelper_h
#define qsObjectHelper_h

#if 0 /* expanded by -frewrite-includes */
#include "xpcObjectHelper.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=4 et sw=4 tw=99: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef xpcObjectHelper_h
#define xpcObjectHelper_h

// Including 'windows.h' will #define GetClassInfo to something else.
#ifdef XP_WIN
#ifdef GetClassInfo
#undef GetClassInfo
#endif
# 15 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h"
#endif
# 16 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIClassInfo.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIClassInfo.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIClassInfo.idl
 */

#ifndef __gen_nsIClassInfo_h__
#define __gen_nsIClassInfo_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIClassInfo.h"
#endif
# 12 "../../dist/include/nsIClassInfo.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIClassInfo.h"

/* starting interface:    nsIClassInfo */
#define NS_ICLASSINFO_IID_STR "986c11d0-f340-11d4-9075-0010a4e73d9a"

#define NS_ICLASSINFO_IID \
  {0x986c11d0, 0xf340, 0x11d4, \
    { 0x90, 0x75, 0x00, 0x10, 0xa4, 0xe7, 0x3d, 0x9a }}

class NS_NO_VTABLE nsIClassInfo : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICLASSINFO_IID)

  /* [noscript] readonly attribute nsCID classIDNoAlloc; */
  NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIClassInfo, NS_ICLASSINFO_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICLASSINFO \
  NS_IMETHOD GetInterfaces(uint32_t *count, nsIID ***array) MOZ_OVERRIDE; \
  NS_IMETHOD GetHelperForLanguage(uint32_t language, nsISupports * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetContractID(char * *aContractID) MOZ_OVERRIDE; \
  NS_IMETHOD GetClassDescription(char * *aClassDescription) MOZ_OVERRIDE; \
  NS_IMETHOD GetClassID(nsCID **aClassID) MOZ_OVERRIDE; \
  NS_IMETHOD GetImplementationLanguage(uint32_t *aImplementationLanguage) MOZ_OVERRIDE; \
  NS_IMETHOD GetInterfaces(uint32_t *count, nsIID ***array) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInterfaces(count, array); } \
  NS_IMETHOD GetHelperForLanguage(uint32_t language, nsISupports * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHelperForLanguage(language, _retval); } \
  NS_IMETHOD GetContractID(char * *aContractID) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContractID(aContractID); } \
  NS_IMETHOD GetClassDescription(char * *aClassDescription) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetClassDescription(aClassDescription); } \
  NS_IMETHOD GetClassID(nsCID **aClassID) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetClassID(aClassID); } \
  NS_IMETHOD GetImplementationLanguage(uint32_t *aImplementationLanguage) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetImplementationLanguage(aImplementationLanguage); } \
  NS_IMETHOD GetFlags(uint32_t *aFlags) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFlags(aFlags); } \
  NS_IMETHOD GetClassIDNoAlloc(nsCID *aClassIDNoAlloc) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetClassIDNoAlloc(aClassIDNoAlloc); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsClassInfo : public nsIClassInfo
{
public:
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] readonly attribute nsCID classIDNoAlloc; */
NS_IMETHODIMP nsClassInfo::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 184 "../../dist/include/nsIClassInfo.h"


#endif /* __gen_nsIClassInfo_h__ */
# 187 "../../dist/include/nsIClassInfo.h"
# 22 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIXPCScriptable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIXPCScriptable.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIXPCScriptable.idl
 */

#ifndef __gen_nsIXPCScriptable_h__
#define __gen_nsIXPCScriptable_h__
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/nsIXPCScriptable.h"
struct JSFreeOp;
class nsIXPConnectWrappedNative; /* forward declaration */


/* starting interface:    nsIXPCScriptable */
#define NS_IXPCSCRIPTABLE_IID_STR "402bf112-6d3b-431f-bb0f-d05ec183ee7b"

#define NS_IXPCSCRIPTABLE_IID \
  {0x402bf112, 0x6d3b, 0x431f, \
    { 0xbb, 0x0f, 0xd0, 0x5e, 0xc1, 0x83, 0xee, 0x7b }}

class NS_NO_VTABLE nsIXPCScriptable : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXPCSCRIPTABLE_IID)
  /* boolean hasInstance (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in jsval val, out boolean bp); */
  NS_IMETHOD HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, JS::HandleValue val, bool *bp, bool *_retval) = 0;

  /* void postCreatePrototype (in JSContextPtr cx, in JSObjectPtr proto); */
  NS_IMETHOD PostCreatePrototype(JSContext *cx, JSObject *proto) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIXPCScriptable, NS_IXPCSCRIPTABLE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXPCSCRIPTABLE \
  NS_IMETHOD GetClassName(char * *aClassName) MOZ_OVERRIDE; \
#define NS_FORWARD_SAFE_NSIXPCSCRIPTABLE(_to) \
  NS_IMETHOD GetClassName(char * *aClassName) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetClassName(aClassName); } \
  virtual uint32_t GetScriptableFlags(void) MOZ_OVERRIDE; \
  NS_IMETHOD PreCreate(nsISupports *nativeObj, JSContext *cx, JSObject *globalObj, JSObject **parentObj) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->PreCreate(nativeObj, cx, globalObj, parentObj); } \
  NS_IMETHOD AddProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, jsid id, JS::Value *vp, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddProperty(wrapper, cx, obj, id, vp, _retval); } \
  NS_IMETHOD GetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, jsid id, JS::Value *vp, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProperty(wrapper, cx, obj, id, vp, _retval); } \
  NS_IMETHOD SetProperty(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, jsid id, JS::Value *vp, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetProperty(wrapper, cx, obj, id, vp, _retval); } \
  NS_IMETHOD Enumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Enumerate(wrapper, cx, obj, _retval); } \
  NS_IMETHOD NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, JS::AutoIdVector & properties, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->NewEnumerate(wrapper, cx, obj, properties, _retval); } \
  NS_IMETHOD Resolve(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, jsid id, bool *resolvedp, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Resolve(wrapper, cx, obj, id, resolvedp, _retval); } \
  NS_IMETHOD Finalize(nsIXPConnectWrappedNative *wrapper, JSFreeOp *fop, JSObject *obj) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Finalize(wrapper, fop, obj); } \
  NS_IMETHOD Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, const JS::CallArgs & args, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Call(wrapper, cx, obj, args, _retval); } \
  NS_IMETHOD Construct(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, const JS::CallArgs & args, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Construct(wrapper, cx, obj, args, _retval); } \
  NS_IMETHOD HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, JS::HandleValue val, bool *bp, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->HasInstance(wrapper, cx, obj, val, bp, _retval); } \
  NS_IMETHOD PostCreatePrototype(JSContext *cx, JSObject *proto) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->PostCreatePrototype(cx, proto); } 

#if 0
NS_IMETHODIMP nsXPCScriptable::Call(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, const JS::CallArgs & args, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean construct (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in JSCallArgsRef args); */
NS_IMETHODIMP nsXPCScriptable::Construct(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, const JS::CallArgs & args, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean hasInstance (in nsIXPConnectWrappedNative wrapper, in JSContextPtr cx, in JSObjectPtr obj, in jsval val, out boolean bp); */
NS_IMETHODIMP nsXPCScriptable::HasInstance(nsIXPConnectWrappedNative *wrapper, JSContext *cx, JSObject *obj, JS::HandleValue val, bool *bp, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void postCreatePrototype (in JSContextPtr cx, in JSObjectPtr proto); */
NS_IMETHODIMP nsXPCScriptable::PostCreatePrototype(JSContext *cx, JSObject *proto)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 283 "../../dist/include/nsIXPCScriptable.h"


#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 286 "../../dist/include/nsIXPCScriptable.h"
#define NS_XPCCLASSINFO_IID \
{ 0x43b67f01, 0xd4ce, 0x4b82, \
 { 0xb3, 0xf8, 0xeb, 0xf2, 0x13, 0x60, 0xfb, 0x7e } }
class NS_NO_VTABLE nsXPCClassInfo : public nsIClassInfo,
                                    public nsIXPCScriptable
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_XPCCLASSINFO_IID)
  NS_IMETHOD_(MozExternalRefCountType) AddRef() MOZ_OVERRIDE = 0;
  NS_IMETHOD_(MozExternalRefCountType) Release() MOZ_OVERRIDE = 0;
  ;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsXPCClassInfo, NS_XPCCLASSINFO_IID)
inline
nsresult
CallQueryInterface(nsISupports* aSourcePtr,
                   nsRefPtrGetterAddRefs<nsXPCClassInfo> aDestPtr)
{
  return CallQueryInterface(aSourcePtr,
                            static_cast<nsXPCClassInfo**>(aDestPtr));
}

#endif /* __gen_nsIXPCScriptable_h__ */
# 309 "../../dist/include/nsIXPCScriptable.h"
# 24 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 25 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h"

class xpcObjectHelper
{
public:
    

    

    nsISupports *GetCanonical()
    {
        if (!mCanonical) {
            mCanonicalStrong = do_QueryInterface(mObject);
            mCanonical = mCanonicalStrong;
        }
        return mCanonical;
    }

    

protected:
    xpcObjectHelper(nsISupports *aObject, nsISupports *aCanonical,
                    nsWrapperCache *aCache)
      : mCanonical(aCanonical)
      , mObject(aObject)
      , mCache(aCache)
    {
        if (!mCache && aObject)
            CallQueryInterface(aObject, &mCache);
    }

    nsCOMPtr<nsISupports>    mCanonicalStrong;
    nsISupports*             mCanonical;

private:
    xpcObjectHelper(xpcObjectHelper& aOther) = delete;

    nsISupports*             mObject;
    nsWrapperCache*          mCache;
    nsCOMPtr<nsIClassInfo>   mClassInfo;
    nsRefPtr<nsXPCClassInfo> mXPCClassInfo;
};

#endif
# 135 "/Users/luser/build/mozilla-central/js/xpconnect/src/xpcObjectHelper.h"
# 11 "/Users/luser/build/mozilla-central/js/xpconnect/src/qsObjectHelper.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/js/xpconnect/src/qsObjectHelper.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/js/xpconnect/src/qsObjectHelper.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/js/xpconnect/src/qsObjectHelper.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/js/xpconnect/src/qsObjectHelper.h"

class qsObjectHelper : public xpcObjectHelper
{
public:
    template <class T>
    inline
    qsObjectHelper(T *aObject, nsWrapperCache *aCache)
        : xpcObjectHelper(ToSupports(aObject), ToCanonicalSupports(aObject),
                          aCache)
    {}

    

    
};

# 10 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCacheInlines.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/GCAPI.h"
#endif /* expanded by -frewrite-includes */
inline bool
nsWrapperCache::IsBlack()
{
  JSObject* o = GetWrapperPreserveColor();
  return o && !JS::ObjectIsMarkedGray(o);
}

static void
SearchGray(JS::GCCellPtr aGCThing, const char* aName, void* aClosure)
{
  bool* hasGrayObjects = static_cast<bool*>(aClosure);
  if (!*hasGrayObjects && aGCThing && JS::GCThingIsMarkedGray(aGCThing)) {
    *hasGrayObjects = true;
  }
}

inline bool
nsWrapperCache::HasNothingToTrace(nsISupports* aThis)
{
  nsXPCOMCycleCollectionParticipant* participant = nullptr;
  CallQueryInterface(aThis, &participant);
  bool hasGrayObjects = false;
  participant->Trace(aThis, TraceCallbackFunc(SearchGray), &hasGrayObjects);
  return !hasGrayObjects;
}





#endif /* nsWrapperCache_h___ */
# 62 "/Users/luser/build/mozilla-central/dom/base/nsWrapperCacheInlines.h"
# 41 "../../dist/include/mozilla/dom/BindingUtils.h" 2

class nsIJSID;
class nsPIDOMWindow;

namespace mozilla {
namespace dom {
template<typename DataType> class MozMap;

struct SelfRef
ThrowInvalidThis(JSContext* aCx, const JS::CallArgs& aArgs,
                 const ErrNum aErrorNumber,
                 prototypes::ID aProtoId);

inline bool
ThrowMethodFailedWithDetails(JSContext* cx, ErrorResult& rv,
                             const char* ifaceName,
                             const char* memberName,
                             bool reportJSContentExceptions = false)
{
  if (rv.IsUncatchableException()) {
    // Nuke any existing exception on aCx, to make sure we're uncatchable.
    JS_ClearPendingException(cx);
    // Don't do any reporting.  Just return false, to create an
    // uncatchable exception.
    return false;
  }
  if (rv.IsErrorWithMessage()) {
    rv.ReportErrorWithMessage(cx);
    return false;
  }
  if (rv.IsJSException()) {
    if (reportJSContentExceptions) {
      rv.ReportJSExceptionFromJSImplementation(cx);
    } else {
      rv.ReportJSException(cx);
    }
    return false;
  }
  if (rv.IsNotEnoughArgsError()) {
    rv.ReportNotEnoughArgsError(cx, ifaceName, memberName);
    return false;
  }
  return Throw(cx, rv.ErrorCode());
}

// Returns true if the JSClass is used for DOM objects.
inline bool
IsDOMClass(const JSClass* clasp)
{
  return clasp->flags & JSCLASS_IS_DOMJSCLASS;
}

inline bool
IsDOMClass(const js::Class* clasp)
{
  return IsDOMClass(Jsvalify(clasp));
}

// Return true if the JSClass is used for non-proxy DOM objects.
inline bool
IsNonProxyDOMClass(const js::Class* clasp)
{
  return IsDOMClass(clasp) && !clasp->isProxy();
}

inline bool
IsNonProxyDOMClass(const JSClass* clasp)
{
  return IsNonProxyDOMClass(js::Valueify(clasp));
}

// Returns true if the JSClass is used for DOM interface and interface 
// prototype objects.
inline bool
IsDOMIfaceAndProtoClass(const JSClass* clasp)
{
  return clasp->flags & JSCLASS_IS_DOMIFACEANDPROTOJSCLASS;
}

inline bool
IsDOMIfaceAndProtoClass(const js::Class* clasp)
{
  return IsDOMIfaceAndProtoClass(Jsvalify(clasp));
}

static_assert(DOM_OBJECT_SLOT == 0,
              "DOM_OBJECT_SLOT doesn't match the proxy private slot.  "
              "Expect bad things");
template <class T>
inline T*
UnwrapDOMObject(JSObject* obj)
{
  MOZ_ASSERT(IsDOMClass(js::GetObjectClass(obj)),
             "Don't pass non-DOM objects to this function");

  JS::Value val = js::GetReservedOrProxyPrivateSlot(obj, DOM_OBJECT_SLOT);
  return static_cast<T*>(val.toPrivate());
}

template <class T>
inline T*
UnwrapPossiblyNotInitializedDOMObject(JSObject* obj)
{
  // This is used by the OjectMoved JSClass hook which can be called before
  // JS_NewObject has returned and so before we have a chance to set
  // DOM_OBJECT_SLOT to anything useful.

  MOZ_ASSERT(IsDOMClass(js::GetObjectClass(obj)),
             "Don't pass non-DOM objects to this function");

  JS::Value val = js::GetReservedOrProxyPrivateSlot(obj, DOM_OBJECT_SLOT);
  if (val.isUndefined()) {
    return nullptr;
  }
  return static_cast<T*>(val.toPrivate());
}

inline const DOMJSClass*
GetDOMClass(const js::Class* clasp)
{
  return IsDOMClass(clasp) ? DOMJSClass::FromJSClass(clasp) : nullptr;
}

inline const DOMJSClass*
GetDOMClass(JSObject* obj)
{
  return GetDOMClass(js::GetObjectClass(obj));
}

inline nsISupports*
UnwrapDOMObjectToISupports(JSObject* aObject)
{
  const DOMJSClass* clasp = GetDOMClass(aObject);
  if (!clasp || !clasp->mDOMObjectIsISupports) {
    return nullptr;
  }

  return UnwrapPossiblyNotInitializedDOMObject<nsISupports>(aObject);
}

inline bool
IsDOMObject(JSObject* obj)
{
  return IsDOMClass(js::GetObjectClass(obj));
}

#define UNWRAP_OBJECT(Interface, obj, value)                                 \
  mozilla::dom::UnwrapObject<mozilla::dom::prototypes::id::Interface,        \
    mozilla::dom::Interface##Binding::NativeType>(obj, value)

#define UNWRAP_WORKER_OBJECT(Interface, obj, value)                           \
  UnwrapObject<prototypes::id::Interface##_workers,                           \
    mozilla::dom::Interface##Binding_workers::NativeType>(obj, value)

// Some callers don't want to set an exception when unwrapping fails
// (for example, overload resolution uses unwrapping to tell what sort
// of thing it's looking at).
// U must be something that a T* can be assigned to (e.g. T* or an nsRefPtr<T>).
template <class T, typename U>
MOZ_ALWAYS_INLINE nsresult
UnwrapObject(JSObject* obj, U& value, prototypes::ID protoID,
             uint32_t protoDepth)
{
  /* First check to see whether we have a DOM object */
  const DOMJSClass* domClass = GetDOMClass(obj);
  if (!domClass) {
    /* Maybe we have a security wrapper or outer window? */
    if (!js::IsWrapper(obj)) {
      /* Not a DOM object, not a wrapper, just bail */
      return NS_ERROR_XPC_BAD_CONVERT_JS;
    }

    obj = js::CheckedUnwrap(obj, /* stopAtOuter = */ false);
    if (!obj) {
      return NS_ERROR_XPC_SECURITY_MANAGER_VETO;
    }
    MOZ_ASSERT(!js::IsWrapper(obj));
    domClass = GetDOMClass(obj);
    if (!domClass) {
      /* We don't have a DOM object */
      return NS_ERROR_XPC_BAD_CONVERT_JS;
    }
  }

  /* This object is a DOM object.  Double-check that it is safely
     castable to T by checking whether it claims to inherit from the
     class identified by protoID. */
  if (domClass->mInterfaceChain[protoDepth] == protoID) {
    value = UnwrapDOMObject<T>(obj);
    return NS_OK;
  }

  /* It's the wrong sort of DOM object */
  return NS_ERROR_XPC_BAD_CONVERT_JS;
}

template <prototypes::ID PrototypeID, class T, typename U>
MOZ_ALWAYS_INLINE nsresult
UnwrapObject(JSObject* obj, U& value)
{
  return UnwrapObject<T>(obj, value, PrototypeID,
                         PrototypeTraits<PrototypeID>::Depth);
}

inline bool
IsNotDateOrRegExp(JSContext* cx, JS::Handle<JSObject*> obj)
{
  MOZ_ASSERT(obj);
  return !JS_ObjectIsDate(cx, obj) && !JS_ObjectIsRegExp(cx, obj);
}

MOZ_ALWAYS_INLINE bool
IsObjectValueConvertibleToDictionary(JSContext* cx,
                                     JS::Handle<JS::Value> objVal)
{
  JS::Rooted<JSObject*> obj(cx, &objVal.toObject());
  return IsNotDateOrRegExp(cx, obj);
}

MOZ_ALWAYS_INLINE bool
IsConvertibleToDictionary(JSContext* cx, JS::Handle<JS::Value> val)
{
  return val.isNullOrUndefined() ||
    (val.isObject() && IsObjectValueConvertibleToDictionary(cx, val));
}

MOZ_ALWAYS_INLINE bool
IsConvertibleToCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj)
{
  return IsNotDateOrRegExp(cx, obj);
}

// The items in the protoAndIfaceCache are indexed by the prototypes::id::ID,
// constructors::id::ID and namedpropertiesobjects::id::ID enums, in that order.
// The end of the prototype objects should be the start of the interface
// objects, and the end of the interface objects should be the start of the
// named properties objects.
static_assert((size_t)constructors::id::_ID_Start ==
              (size_t)prototypes::id::_ID_Count &&
              (size_t)namedpropertiesobjects::id::_ID_Start ==
              (size_t)constructors::id::_ID_Count,
              "Overlapping or discontiguous indexes.");
const size_t kProtoAndIfaceCacheCount = namedpropertiesobjects::id::_ID_Count;

class ProtoAndIfaceCache
{
  // The caching strategy we use depends on what sort of global we're dealing
  // with.  For a window-like global, we want everything to be as fast as
  // possible, so we use a flat array, indexed by prototype/constructor ID.
  // For everything else (e.g. globals for JSMs), space is more important than
  // speed, so we use a two-level lookup table.

  class ArrayCache : public Array<JS::Heap<JSObject*>, kProtoAndIfaceCacheCount>
  {
  public:
    JSObject* EntrySlotIfExists(size_t i) {
      return (*this)[i];
    }

    

    

    

    
  };

  class PageTableCache
  {
  public:
    PageTableCache() {
      memset(&mPages, 0, sizeof(mPages));
    }

    ~PageTableCache() {
      for (size_t i = 0; i < ArrayLength(mPages); ++i) {
        delete mPages[i];
      }
    }

    JSObject* EntrySlotIfExists(size_t i) {
      MOZ_ASSERT(i < kProtoAndIfaceCacheCount);
      size_t pageIndex = i / kPageSize;
      size_t leafIndex = i % kPageSize;
      Page* p = mPages[pageIndex];
      if (!p) {
        return nullptr;
      }
      return (*p)[leafIndex];
    }

    

    

    

    

  private:
    static const size_t kPageSize = 16;
    typedef Array<JS::Heap<JSObject*>, kPageSize> Page;
    static const size_t kNPages = kProtoAndIfaceCacheCount / kPageSize +
      size_t(bool(kProtoAndIfaceCacheCount % kPageSize));
    Array<Page*, kNPages> mPages;
  };

public:
  enum Kind {
    WindowLike,
    NonWindowLike
  };

  explicit ProtoAndIfaceCache(Kind aKind) : mKind(aKind) {
    MOZ_COUNT_CTOR(ProtoAndIfaceCache);
    if (aKind == WindowLike) {
      mArrayCache = new ArrayCache();
    } else {
      mPageTableCache = new PageTableCache();
    }
  }

  

#define FORWARD_OPERATION(opName, args)              \
  do {                                               \
    if (mKind == WindowLike) {                       \
      return mArrayCache->opName args;               \
    } else {                                         \
      return mPageTableCache->opName args;           \
    }                                                \
  } while(0)

  // Return the JSObject stored in slot i, if that slot exists.  If

private:
  union {
    ArrayCache *mArrayCache;
    PageTableCache *mPageTableCache;
  };
  Kind mKind;
};

inline void
AllocateProtoAndIfaceCache(JSObject* obj, ProtoAndIfaceCache::Kind aKind)
{
  MOZ_ASSERT(js::GetObjectClass(obj)->flags & JSCLASS_DOM_GLOBAL);
  MOZ_ASSERT(js::GetReservedSlot(obj, DOM_PROTOTYPE_SLOT).isUndefined());

  ProtoAndIfaceCache* protoAndIfaceCache = new ProtoAndIfaceCache(aKind);

  js::SetReservedSlot(obj, DOM_PROTOTYPE_SLOT,
                      JS::PrivateValue(protoAndIfaceCache));
}

#ifdef DEBUG
void
VerifyTraceProtoAndIfaceCacheCalled(JSTracer *trc, void **thingp,
                                    JSGCTraceKind kind);

struct VerifyTraceProtoAndIfaceCacheCalledTracer : public JSTracer
{
    bool ok;

    explicit VerifyTraceProtoAndIfaceCacheCalledTracer(JSRuntime *rt)
      : JSTracer(rt, VerifyTraceProtoAndIfaceCacheCalled), ok(false)
    {}
};
#endif
# 541 "../../dist/include/mozilla/dom/BindingUtils.h"





/**
 * Add constants to an object.
 */
;

struct JSNativeHolder
{
  JSNative mNative;
  const NativePropertyHooks* mPropertyHooks;
};

struct NamedConstructor
{
  const char* mName;
  const JSNativeHolder mHolder;
  unsigned mNargs;
};

/*
 * Create a DOM interface object (if constructorClass is non-null) and/or a

/*
 * Define the unforgeable attributes on an object.
 */
;

;

;

#define HAS_MEMBER_TYPEDEFS                                               \
private:                                                                  \
  typedef char yes[1];                                                    \
  typedef char no[2]

#ifdef _MSC_VER
#define HAS_MEMBER_CHECK(_name)                                           \
  template<typename V> static yes& Check##_name(char (*)[(&V::_name == 0) + 1])
#else
# 698 "../../dist/include/mozilla/dom/BindingUtils.h"
#define HAS_MEMBER_CHECK(_name)                                           \
  template<typename V> static yes& Check##_name(char (*)[sizeof(&V::_name) + 1])
#endif
# 701 "../../dist/include/mozilla/dom/BindingUtils.h"

#define HAS_MEMBER(_memberName, _valueName)                               \
private:                                                                  \
  HAS_MEMBER_CHECK(_memberName);                                          \
  template<typename V> static no& Check##_memberName(...);                \
                                                                          \
public:                                                                   \
  static bool const _valueName =                                          \
    sizeof(Check##_memberName<T>(nullptr)) == sizeof(yes)

template<class T>
struct NativeHasMember
{
  HAS_MEMBER_TYPEDEFS;

  HAS_MEMBER(GetParentObject, GetParentObject);
  HAS_MEMBER(JSBindingFinalized, JSBindingFinalized);
  HAS_MEMBER(WrapObject, WrapObject);
};

template<class T>
struct IsSmartPtr
{
  HAS_MEMBER_TYPEDEFS;

  HAS_MEMBER(get, value);
};

template<class T>
struct IsRefcounted
{
  HAS_MEMBER_TYPEDEFS;

  HAS_MEMBER(AddRef, HasAddref);
  HAS_MEMBER(Release, HasRelease);

public:
  static bool const value = HasAddref && HasRelease;

private:
  // This struct only works if T is fully declared (not just forward declared).
  // The IsBaseOf check will ensure that, we don't really need it for any other
  // reason (the static assert will of course always be true).
  static_assert(!IsBaseOf<nsISupports, T>::value || IsRefcounted::value,
                "Classes derived from nsISupports are refcounted!");

};

#undef HAS_MEMBER
#undef HAS_MEMBER_CHECK
#undef HAS_MEMBER_TYPEDEFS

#ifdef DEBUG
template <class T, bool isISupports=IsBaseOf<nsISupports, T>::value>
struct
CheckWrapperCacheCast
{
  static bool Check()
  {
    return reinterpret_cast<uintptr_t>(
      static_cast<nsWrapperCache*>(
        reinterpret_cast<T*>(1))) == 1;
  }
};
template <class T>
struct
CheckWrapperCacheCast<T, true>
{
  static bool Check()
  {
    return true;
  }
};
#endif
# 775 "../../dist/include/mozilla/dom/BindingUtils.h"

MOZ_ALWAYS_INLINE bool
CouldBeDOMBinding(void*)
{
  return true;
}

MOZ_ALWAYS_INLINE bool
CouldBeDOMBinding(nsWrapperCache* aCache)
{
  return aCache->IsDOMBinding();
}

inline bool
TryToOuterize(JSContext* cx, JS::MutableHandle<JS::Value> rval)
{
  if (js::IsInnerObject(&rval.toObject())) {
    JS::Rooted<JSObject*> obj(cx, &rval.toObject());
    obj = JS_ObjectToOuterObject(cx, obj);
    if (!obj) {
      return false;
    }

    rval.set(JS::ObjectValue(*obj));
  }

  return true;
}

// Make sure to wrap the given string value into the right compartment, as
// needed.
MOZ_ALWAYS_INLINE
bool
MaybeWrapStringValue(JSContext* cx, JS::MutableHandle<JS::Value> rval)
{
  MOZ_ASSERT(rval.isString());
  JSString* str = rval.toString();
  if (JS::GetTenuredGCThingZone(str) != js::GetContextZone(cx)) {
    return JS_WrapValue(cx, rval);
  }
  return true;
}

// Make sure to wrap the given object value into the right compartment as
// needed.  This will work correctly, but possibly slowly, on all objects.
MOZ_ALWAYS_INLINE
bool
MaybeWrapObjectValue(JSContext* cx, JS::MutableHandle<JS::Value> rval)
{
  MOZ_ASSERT(rval.isObject());

  // Cross-compartment always requires wrapping.
  JSObject* obj = &rval.toObject();
  if (js::GetObjectCompartment(obj) != js::GetContextCompartment(cx)) {
    return JS_WrapValue(cx, rval);
  }

  // We're same-compartment, but even then we might need to wrap
  // objects specially.  Check for that.
  if (IsDOMObject(obj)) {
    return TryToOuterize(cx, rval);
  }

  // It's not a WebIDL object.  But it might be an XPConnect one, in which case
  // we may need to outerize here, so make sure to call JS_WrapValue.
  return JS_WrapValue(cx, rval);
}

// Like MaybeWrapObjectValue, but also allows null
MOZ_ALWAYS_INLINE
bool
MaybeWrapObjectOrNullValue(JSContext* cx, JS::MutableHandle<JS::Value> rval)
{
  MOZ_ASSERT(rval.isObjectOrNull());
  if (rval.isNull()) {
    return true;
  }
  return MaybeWrapObjectValue(cx, rval);
}

// Wrapping for objects that are known to not be DOM or XPConnect objects
MOZ_ALWAYS_INLINE
bool
MaybeWrapNonDOMObjectValue(JSContext* cx, JS::MutableHandle<JS::Value> rval)
{
  MOZ_ASSERT(rval.isObject());
  MOZ_ASSERT(!GetDOMClass(&rval.toObject()));
  MOZ_ASSERT(!(js::GetObjectClass(&rval.toObject())->flags &
               JSCLASS_PRIVATE_IS_NSISUPPORTS));

  JSObject* obj = &rval.toObject();
  if (js::GetObjectCompartment(obj) == js::GetContextCompartment(cx)) {
    return true;
  }
  return JS_WrapValue(cx, rval);
}
MOZ_ALWAYS_INLINE bool
MaybeWrapValue(JSContext* cx, JS::MutableHandle<JS::Value> rval)
{
  if (rval.isString()) {
    return MaybeWrapStringValue(cx, rval);
  }

  if (!rval.isObject()) {
    return true;
  }

  return MaybeWrapObjectValue(cx, rval);
}

namespace binding_detail {
enum GetOrCreateReflectorWrapBehavior {
  eWrapIntoContextCompartment,
  eDontWrapIntoContextCompartment
};

template <class T>
struct TypeNeedsOuterization
{
  // We only need to outerize Window objects, so anything inheriting from
  // nsGlobalWindow (which inherits from EventTarget itself).
  static const bool value =
    IsBaseOf<nsGlobalWindow, T>::value || IsSame<EventTarget, T>::value;
};

template <class T, GetOrCreateReflectorWrapBehavior wrapBehavior>
MOZ_ALWAYS_INLINE bool
DoGetOrCreateDOMReflector(JSContext* cx, T* value,
                          JS::MutableHandle<JS::Value> rval)
{
  MOZ_ASSERT(value);
  JSObject* obj = value->GetWrapperPreserveColor();
  // We can get rid of this when we remove support for hasXPConnectImpls.
  bool couldBeDOMBinding = CouldBeDOMBinding(value);
  if (obj) {
    JS::ExposeObjectToActiveJS(obj);
  } else {
    // Inline this here while we have non-dom objects in wrapper caches.
    if (!couldBeDOMBinding) {
      return false;
    }

    obj = value->WrapObject(cx);
    if (!obj) {
      // At this point, obj is null, so just return false.
      // Callers seem to be testing JS_IsExceptionPending(cx) to
      // figure out whether WrapObject() threw.
      return false;
    }
  }

#ifdef DEBUG
  const DOMJSClass* clasp = GetDOMClass(obj);
  // clasp can be null if the cache contained a non-DOM object.
  if (clasp) {
    // Some sanity asserts about our object.  Specifically:
    // 1)  If our class claims we're nsISupports, we better be nsISupports
    //     XXXbz ideally, we could assert that reinterpret_cast to nsISupports
    //     does the right thing, but I don't see a way to do it.  :(
    // 2)  If our class doesn't claim we're nsISupports we better be
    //     reinterpret_castable to nsWrapperCache.
    MOZ_ASSERT(clasp, "What happened here?");
    MOZ_ASSERT_IF(clasp->mDOMObjectIsISupports, (IsBaseOf<nsISupports, T>::value));
    MOZ_ASSERT(CheckWrapperCacheCast<T>::Check());
  }
#endif
# 957 "../../dist/include/mozilla/dom/BindingUtils.h"

  rval.set(JS::ObjectValue(*obj));

  bool sameCompartment =
    js::GetObjectCompartment(obj) == js::GetContextCompartment(cx);
  if (sameCompartment && couldBeDOMBinding) {
    return TypeNeedsOuterization<T>::value ? TryToOuterize(cx, rval) : true;
  }

  if (wrapBehavior == eDontWrapIntoContextCompartment) {
    if (TypeNeedsOuterization<T>::value) {
      JSAutoCompartment ac(cx, obj);
      return TryToOuterize(cx, rval);
    }

    return true;
  }

  return JS_WrapValue(cx, rval);
}
} // namespace binding_detail

// Create a JSObject wrapping "value", if there isn't one already, and store it
// in rval.  "value" must be a concrete class that implements a
// GetWrapperPreserveColor() which can return its existing wrapper, if any, and




// Given an object "p" that inherits from nsISupports, wrap it and return the
// result.  Null is returned on wrapping failure.  This is somewhat similar to
// WrapObject() above, but does NOT allow Xrays around the result, since we
// don't want those for our parent object.



// Fallback for when our parent is not a WebIDL binding object.
template<typename T, bool isISupports=IsBaseOf<nsISupports, T>::value>
struct WrapNativeParentFallback
{
  
};

MOZ_ALWAYS_INLINE
JSObject* GetJSObjectFromCallback(CallbackObject* callback)
{
  return callback->Callback();
}

MOZ_ALWAYS_INLINE
JSObject* GetJSObjectFromCallback(void* noncallback)
{
  return nullptr;
}



/*
 * This specialized function simply wraps a JS::Rooted<> since
 * WrapNativeParent() is not applicable for JS objects.
 */


// Helper for calling GetOrCreateDOMReflector with smart pointers
// (nsAutoPtr/nsRefPtr/nsCOMPtr) or references.
template <class T, bool isSmartPtr=IsSmartPtr<T>::value>
struct GetOrCreateDOMReflectorHelper
{
  
};

template <class T>
struct GetOrCreateDOMReflectorHelper<T, false>
{
  
};



// We need this version of GetOrCreateDOMReflector for codegen, so it'll have
// the same signature as WrapNewBindingNonWrapperCachedObject and
// WrapNewBindingNonWrapperCachedOwnedObject, which still need the scope.


// Helper for calling GetOrCreateDOMReflectorNoWrap with smart pointers
// (nsAutoPtr/nsRefPtr/nsCOMPtr) or references.
template <class T, bool isSmartPtr=IsSmartPtr<T>::value>
struct GetOrCreateDOMReflectorNoWrapHelper
{
  
};

template <class T>
struct GetOrCreateDOMReflectorNoWrapHelper<T, false>
{
  
};





// Helper for getting the callback JSObject* of a smart ptr around a
// CallbackObject or a reference to a CallbackObject or something like
// that.
// shadowPrototypeProperties is false then skip properties that are also
// present on the proto chain of proxy.  If shadowPrototypeProperties is true,
// then the "proxy" argument is ignored.
;

namespace binding_detail {

// A struct that has the same layout as an nsString but much faster
// constructor and destructor behavior. FakeString uses inline storage
// for small strings and a nsStringBuffer for longer strings.
struct FakeString {
  FakeString() :
    mFlags(nsString::F_TERMINATED)
  {
  }

  

  nsString::char_type* BeginWriting()
  {
    return mData;
  }

  nsString::size_type Length() const
  {
    return mLength;
  }

  // Reserve space to write aLength chars, not including null-terminator.
  bool SetLength(nsString::size_type aLength, mozilla::fallible_t const&) {
    // Use mInlineStorage for small strings.
    if (aLength < sInlineCapacity) {
      SetData(mInlineStorage);
    } else {
      nsStringBuffer *buf = nsStringBuffer::Alloc((aLength + 1) * sizeof(nsString::char_type)).take();
      if (MOZ_UNLIKELY(!buf)) {
        return false;
      }

      SetData(static_cast<nsString::char_type*>(buf->Data()));
      mFlags = nsString::F_SHARED | nsString::F_TERMINATED;
    }
    mLength = aLength;
    mData[mLength] = char16_t(0);
    return true;
  }

  // If this ever changes, change the corresponding code in the
  // Optional<nsAString> specialization as well.
  const nsAString* ToAStringPtr() const {
    return reinterpret_cast<const nsString*>(this);
  }

operator const nsAString& () const {
    return *reinterpret_cast<const nsString*>(this);
  }

private:
  nsAString* ToAStringPtr() {
    return reinterpret_cast<nsString*>(this);
  }

  nsString::char_type* mData;
  nsString::size_type mLength;
  uint32_t mFlags;

  static const size_t sInlineCapacity = 64;
  nsString::char_type mInlineStorage[sInlineCapacity];

  FakeString(const FakeString& other) = delete;
  void operator=(const FakeString& other) = delete;

  void SetData(nsString::char_type* aData) {
    MOZ_ASSERT(mFlags == nsString::F_TERMINATED);
    mData = const_cast<nsString::char_type*>(aData);
  }

  friend class NonNull<nsAString>;

  // A class to use for our static asserts to ensure our object layout
  // matches that of nsString.
  class StringAsserter;
  friend class StringAsserter;

  class StringAsserter : public nsString {
  public:
    static void StaticAsserts() {
      static_assert(offsetof(FakeString, mInlineStorage) ==
                      sizeof(nsString),
                    "FakeString should include all nsString members");
      static_assert(offsetof(FakeString, mData) ==
                      offsetof(StringAsserter, mData),
                    "Offset of mData should match");
      static_assert(offsetof(FakeString, mLength) ==
                      offsetof(StringAsserter, mLength),
                    "Offset of mLength should match");
      static_assert(offsetof(FakeString, mFlags) ==
                      offsetof(StringAsserter, mFlags),
                    "Offset of mFlags should match");
    }
  };
};

} // namespace binding_detail

enum StringificationBehavior {
  eStringify,
  eEmpty,
  eNull
};

template<typename T>
static inline bool
ConvertJSValueToString(JSContext* cx, JS::Handle<JS::Value> v,
                       StringificationBehavior nullBehavior,
                       StringificationBehavior undefinedBehavior,
                       T& result)
{
  JSString *s;
  if (v.isString()) {
    s = v.toString();
  } else {
    StringificationBehavior behavior;
    if (v.isNull()) {
      behavior = nullBehavior;
    } else if (v.isUndefined()) {
      behavior = undefinedBehavior;
    } else {
      behavior = eStringify;
    }

    if (behavior != eStringify) {
      if (behavior == eEmpty) {
        result.Truncate();
      } else {
        result.SetIsVoid(true);
      }
      return true;
    }

    s = JS::ToString(cx, v);
    if (!s) {
      return false;
    }
  }

  return AssignJSString(cx, result, s);
}

void
NormalizeUSVString(JSContext* aCx, nsAString& aString);

void
NormalizeUSVString(JSContext* aCx, binding_detail::FakeString& aString);

template<typename T>
inline bool
ConvertIdToString(JSContext* cx, JS::HandleId id, T& result, bool& isSymbol)
{
  if (MOZ_LIKELY(JSID_IS_STRING(id))) {
    if (!AssignJSString(cx, result, JSID_TO_STRING(id))) {
      return false;
    }
  } else if (JSID_IS_SYMBOL(id)) {
    isSymbol = true;
    return true;
  } else {
    JS::RootedValue nameVal(cx, js::IdToValue(id));
    if (!ConvertJSValueToString(cx, nameVal, eStringify, eStringify, result)) {
      return false;
    }
  }
  isSymbol = false;
  return true;
}

bool
ConvertJSValueToByteString(JSContext* cx, JS::Handle<JS::Value> v,
                           bool nullable, nsACString& result);

template<typename T>
void DoTraceSequence(JSTracer* trc, FallibleTArray<T>& seq);
template<typename T>
void DoTraceSequence(JSTracer* trc, InfallibleTArray<T>& seq);

// Class for simple sequence arguments, only used internally by codegen.
namespace binding_detail {

template<typename T>
class AutoSequence : public AutoFallibleTArray<T, 16>
{
public:
  AutoSequence() : AutoFallibleTArray<T, 16>()
  {}

  // Allow converting to const sequences as needed
  operator const Sequence<T>&() const {
    return *reinterpret_cast<const Sequence<T>*>(this);
  }
};

} // namespace binding_detail

// Class used to trace sequences, with specializations for various
// sequence types.
template<typename T,
         bool isDictionary=IsBaseOf<DictionaryBase, T>::value,
         bool isTypedArray=IsBaseOf<AllTypedArraysBase, T>::value,
         bool isOwningUnion=IsBaseOf<AllOwningUnionBase, T>::value>
class SequenceTracer
{

  

  

  

private:
  struct OwnedNative
  {
    // Make sure the native objects inherit from NonRefcountedDOMObject so
    // that we log their ctor and dtor.
    static_assert(IsBaseOf<NonRefcountedDOMObject, T>::value,
                  "Non-refcounted objects with DOM bindings should inherit "
                  "from NonRefcountedDOMObject.");

    

    // This signature sucks, but it's the only one that will make a nsRefPtr
    // just forget about its pointer without warning.
    
  };

  JS::Rooted<JSObject*> mReflector;
  typename Conditional<IsRefcounted<T>::value, nsRefPtr<T>, OwnedNative>::Type mNative;
};

template<class T,
         bool isISupports=IsBaseOf<nsISupports, T>::value>
class DeferredFinalizer
{
  typedef typename Conditional<IsRefcounted<T>::value,
                               nsRefPtr<T>, nsAutoPtr<T>>::Type SmartPtr;
  typedef nsTArray<SmartPtr> SmartPtrArray;

  template<class U>
  static inline void
  AppendAndTake(nsTArray<nsRefPtr<U>>& smartPtrArray, U* ptr)
  {
    smartPtrArray.AppendElement(dont_AddRef(ptr));
  }
  

  
  

public:
  
};

template<class T>
class DeferredFinalizer<T, true>
{
public:
  
};



// This returns T's CC participant if it participates in CC or null if it
// doesn't. This also returns null for classes that don't inherit from
// nsISupports (QI should be used to get the participant for those).
// The return value is whatever the ProtoHandleGetter we used
// returned.  This should be the DOM prototype for the global.


/*
 * Holds a jsid that is initialized to an interned string, with conversion to
 * Handle<jsid>.
 */
class InternedStringId
{
  jsid id;

 public:
  

  

  

  
};

;

template<class T>
struct StrongPtrForMember
{
  typedef typename Conditional<IsRefcounted<T>::value,
                               nsRefPtr<T>, nsAutoPtr<T>>::Type Type;
};



// Resolve an id on the given global object that wants to be included in
// Exposed=System webidl annotations.  False return value means exception
// thrown.
;

// Enumerate all ids on the given global object that wants to be included in
// Exposed=System webidl annotations.  False return value means exception
// thrown.
;


} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_BindingUtils_h__ */
# 3291 "../../dist/include/mozilla/dom/BindingUtils.h"
# 11 "../../dist/include/mozilla/dom/WindowBinding.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CallbackFunction.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/CallbackFunction.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * A common base class for representing WebIDL callback function types in C++.
 *
 * This class implements common functionality like lifetime
 * management, initialization with the callable, and setup of the call
 * environment.  Subclasses corresponding to particular callback
 * function types should provide a Call() method that actually does
 * the call.
 */

#ifndef mozilla_dom_CallbackFunction_h
#define mozilla_dom_CallbackFunction_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CallbackObject.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/dom/CallbackFunction.h"

namespace mozilla {
namespace dom {

class CallbackFunction : public CallbackObject
{
public:
  explicit CallbackFunction(JS::Handle<JSObject*> aCallable,
                            nsIGlobalObject* aIncumbentGlobal)
    : CallbackObject(aCallable, aIncumbentGlobal)
  {
  }

  

  

protected:
  explicit CallbackFunction(CallbackFunction* aCallbackFunction)
    : CallbackObject(aCallbackFunction)
  {
  }
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_CallbackFunction_h
# 56 "../../dist/include/mozilla/dom/CallbackFunction.h"
# 12 "../../dist/include/mozilla/dom/WindowBinding.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/WindowBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/UnionMember.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/UnionMember.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* A class for holding the members of a union. */

#ifndef mozilla_dom_UnionMember_h
#define mozilla_dom_UnionMember_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Alignment.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/UnionMember.h"

namespace mozilla {
namespace dom {

// The union type has an enum to keep track of which of its UnionMembers has
// been constructed.
template<class T>
class UnionMember
{
  AlignedStorage2<T> mStorage;

public:
  T& SetValue()
  {
    new (mStorage.addr()) T();
    return *mStorage.addr();
  }
  template <typename T1>
  T& SetValue(const T1& aValue)
  {
    new (mStorage.addr()) T(aValue);
    return *mStorage.addr();
  }
  
  T& Value()
  {
    return *mStorage.addr();
  }
  const T& Value() const
  {
    return *mStorage.addr();
  }
  void Destroy()
  {
    mStorage.addr()->~T();
  }
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_UnionMember_h
# 60 "../../dist/include/mozilla/dom/UnionMember.h"
# 14 "../../dist/include/mozilla/dom/WindowBinding.h" 2

class nsGlobalWindow;
struct nsGlobalWindowAtoms;
class nsIDOMWindow;

namespace mozilla {
namespace dom {

class ChromeWindow;
struct ChromeWindowAtoms;
class External;
class FrameRequestCallback;
struct NativePropertyHooks;
class OverfillCallback;
class OwningExternalOrWindowProxy;
class ProtoAndIfaceCache;
struct ScrollOptionsAtoms;
struct ScrollToOptionsAtoms;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

enum class ScrollBehavior : uint32_t {
  Auto,
  Instant,
  Smooth,
  EndGuard_
};

namespace ScrollBehaviorValues {
extern const EnumEntry strings[4];
} // namespace ScrollBehaviorValues


;


;


class ExternalOrWindowProxy
{
  friend class ExternalOrWindowProxyArgument;
  enum Type
  {
    eUninitialized,
    eExternal,
    eWindowProxy
  };

  union Value
  {
    UnionMember<NonNull<mozilla::dom::External> > mExternal;
    UnionMember<nsIDOMWindow* > mWindowProxy;

  };

  Type mType;
  Value mValue;

  ExternalOrWindowProxy(const ExternalOrWindowProxy&) = delete;
  void operator=(const ExternalOrWindowProxy) = delete;
public:
  explicit inline ExternalOrWindowProxy()
    : mType(eUninitialized)
  {
  }

  inline ~ExternalOrWindowProxy()
  {
    Uninit();
  }

  inline NonNull<mozilla::dom::External>&
  RawSetAsExternal()
  {
    if (mType == eExternal) {
      return mValue.mExternal.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eExternal;
    return mValue.mExternal.SetValue();
  }

  inline NonNull<mozilla::dom::External>&
  SetAsExternal()
  {
    if (mType == eExternal) {
      return mValue.mExternal.Value();
    }
    Uninit();
    mType = eExternal;
    return mValue.mExternal.SetValue();
  }

  inline bool
  IsExternal() const
  {
    return mType == eExternal;
  }

  inline NonNull<mozilla::dom::External>&
  GetAsExternal()
  {
    MOZ_ASSERT(IsExternal(), "Wrong type!");
    return mValue.mExternal.Value();
  }

  inline mozilla::dom::External&
  GetAsExternal() const
  {
    MOZ_ASSERT(IsExternal(), "Wrong type!");
    return mValue.mExternal.Value();
  }

  inline nsIDOMWindow*&
  RawSetAsWindowProxy()
  {
    if (mType == eWindowProxy) {
      return mValue.mWindowProxy.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eWindowProxy;
    return mValue.mWindowProxy.SetValue();
  }

  inline nsIDOMWindow*&
  SetAsWindowProxy()
  {
    if (mType == eWindowProxy) {
      return mValue.mWindowProxy.Value();
    }
    Uninit();
    mType = eWindowProxy;
    return mValue.mWindowProxy.SetValue();
  }

  inline bool
  IsWindowProxy() const
  {
    return mType == eWindowProxy;
  }

  inline nsIDOMWindow*&
  GetAsWindowProxy()
  {
    MOZ_ASSERT(IsWindowProxy(), "Wrong type!");
    return mValue.mWindowProxy.Value();
  }

  inline nsIDOMWindow*
  GetAsWindowProxy() const
  {
    MOZ_ASSERT(IsWindowProxy(), "Wrong type!");
    return mValue.mWindowProxy.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eExternal: {
        DestroyExternal();
        break;
      }
      case eWindowProxy: {
        DestroyWindowProxy();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyExternal()
  {
    MOZ_ASSERT(IsExternal(), "Wrong type!");
    mValue.mExternal.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyWindowProxy()

  ;

  ;

  void
  operator=(const OwningExternalOrWindowProxy& aOther);

private:
  ;

  ;
};


struct ScrollOptions : public DictionaryBase
{

  ;

  ;

  ;

private:
  ;
};

namespace binding_detail {
struct FastScrollOptions : public ScrollOptions
{
  
};
} // namespace binding_detail


struct ScrollToOptions : public ScrollOptions
{
  Optional<double> mLeft;
  Optional<double> mTop;

  ;

  

  

  ;

  ;

  ;

  ;

  ;

  ;

private:
  ;
};

namespace binding_detail {
struct FastScrollToOptions : public ScrollToOptions
{
  
};
} // namespace binding_detail


class OverfillCallback : public CallbackFunction
{
public:
  

  

  

  

  

  

private:
  ;
};


namespace ChromeWindowBinding {

  typedef mozilla::dom::ChromeWindow NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  ;

  ;

  

} // namespace WindowBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_WindowBinding_h
# 702 "../../dist/include/mozilla/dom/WindowBinding.h"
# 13 "../../dist/include/ScrollbarStyles.h" 2

// Forward declarations
struct nsStyleDisplay;

namespace mozilla {

struct ScrollbarStyles
{
  // Always one of NS_STYLE_OVERFLOW_SCROLL, NS_STYLE_OVERFLOW_HIDDEN,
  // or NS_STYLE_OVERFLOW_AUTO.
  uint8_t mHorizontal;
  uint8_t mVertical;
  // Always one of NS_STYLE_SCROLL_BEHAVIOR_AUTO or
  // NS_STYLE_SCROLL_BEHAVIOR_SMOOTH
  uint8_t mScrollBehavior;
  // Always one of NS_STYLE_SCROLL_SNAP_NONE, NS_STYLE_SCROLL_SNAP_MANDATORY,
  
};

}

#endif
# 83 "../../dist/include/ScrollbarStyles.h"
# 39 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIMessageManager.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIMessageManager.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIMessageManager.idl
 */

#ifndef __gen_nsIMessageManager_h__
#define __gen_nsIMessageManager_h__

#define NS_IMESSAGELISTENER_IID \
  {0x2b44eb57, 0xa9c6, 0x4773, \
    { 0x9a, 0x1e, 0xfe, 0x08, 0x18, 0x73, 0x9a, 0x4c }}

class NS_NO_VTABLE nsIMessageListener : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMESSAGELISTENER_IID)

  /* void receiveMessage (); */
  NS_IMETHOD ReceiveMessage(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMessageListener, NS_IMESSAGELISTENER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIMESSAGELISTENER \
  NS_IMETHOD ReceiveMessage(void) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIMESSAGELISTENER(_to) \
  NS_IMETHOD ReceiveMessage(void) MOZ_OVERRIDE { return _to ReceiveMessage(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIMESSAGELISTENER(_to) \
  NS_IMETHOD ReceiveMessage(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ReceiveMessage(); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */
NS_IMETHODIMP nsMessageListener::ReceiveMessage()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 99 "../../dist/include/nsIMessageManager.h"


/* starting interface:    nsIMessageListenerManager */
#define NS_IMESSAGELISTENERMANAGER_IID_STR "aae827bd-acf1-45fe-a556-ea545d4c0804"

#define NS_IMESSAGELISTENERMANAGER_IID \
  {0xaae827bd, 0xacf1, 0x45fe, \
    { 0xa5, 0x56, 0xea, 0x54, 0x5d, 0x4c, 0x08, 0x04 }}

class NS_NO_VTABLE nsIMessageListenerManager : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMESSAGELISTENERMANAGER_IID)

  /* void addMessageListener (in AString messageName, in nsIMessageListener listener); */
  NS_IMETHOD AddMessageListener(const nsAString & messageName, nsIMessageListener *listener) = 0;

  /* void removeMessageListener (in AString messageName, in nsIMessageListener listener); */
  NS_IMETHOD RemoveMessageListener(const nsAString & messageName, nsIMessageListener *listener) = 0;

  /* void addWeakMessageListener (in AString messageName, in nsIMessageListener listener); */
  NS_IMETHOD AddWeakMessageListener(const nsAString & messageName, nsIMessageListener *listener) = 0;

  /* void removeWeakMessageListener (in AString messageName, in nsIMessageListener listener); */
  NS_IMETHOD RemoveWeakMessageListener(const nsAString & messageName, nsIMessageListener *listener) = 0;

  /* [notxpcom] boolean markForCC (); */
  NS_IMETHOD_(bool) MarkForCC(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMessageListenerManager, NS_IMESSAGELISTENERMANAGER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIMESSAGELISTENERMANAGER \
  NS_IMETHOD AddMessageListener(const nsAString & messageName, nsIMessageListener *listener) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveMessageListener(const nsAString & messageName, nsIMessageListener *listener) MOZ_OVERRIDE; \
  NS_IMETHOD AddWeakMessageListener(const nsAString & messageName, nsIMessageListener *listener) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveWeakMessageListener(const nsAString & messageName, nsIMessageListener *listener) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) MarkForCC(void) MOZ_OVERRIDE; 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsMessageListenerManager : public nsIMessageListenerManager
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIMESSAGELISTENERMANAGER

  nsMessageListenerManager();

private:
  ~nsMessageListenerManager();

/* End of implementation class template. */
#endif
# 220 "../../dist/include/nsIMessageManager.h"


/* starting interface:    nsIMessageSender */
#define NS_IMESSAGESENDER_IID_STR "d6b0d851-43e6-426d-9f13-054bc0198175"

#define NS_IMESSAGESENDER_IID \
  {0xd6b0d851, 0x43e6, 0x426d, \
    { 0x9f, 0x13, 0x05, 0x4b, 0xc0, 0x19, 0x81, 0x75 }}

class NS_NO_VTABLE nsIMessageSender : public nsIMessageListenerManager {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMESSAGESENDER_IID)

  /* [implicit_jscontext,optional_argc] void sendAsyncMessage ([optional] in AString messageName, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsIPrincipal principal); */
  NS_IMETHOD SendAsyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMessageSender, NS_IMESSAGESENDER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIMESSAGESENDER \
  NS_IMETHOD SendAsyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIMESSAGESENDER(_to) \
  NS_IMETHOD SendAsyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc) MOZ_OVERRIDE { return _to SendAsyncMessage(messageName, obj, objects, principal, cx, _argc); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIMESSAGESENDER(_to) \
  NS_IMETHOD SendAsyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SendAsyncMessage(messageName, obj, objects, principal, cx, _argc); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsMessageSender : public nsIMessageSender
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIMESSAGESENDER

  nsMessageSender();
nsMessageSender::~nsMessageSender()
{
  /* destructor code */
}

/* [implicit_jscontext,optional_argc] void sendAsyncMessage ([optional] in AString messageName, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsIPrincipal principal); */
NS_IMETHODIMP nsMessageSender::SendAsyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 293 "../../dist/include/nsIMessageManager.h"


/* starting interface:    nsIMessageBroadcaster */
#define NS_IMESSAGEBROADCASTER_IID_STR "d36346b9-5d3b-497d-9c28-ffbc3e4f6d0d"

#define NS_IMESSAGEBROADCASTER_IID \
  {0xd36346b9, 0x5d3b, 0x497d, \
    { 0x9c, 0x28, 0xff, 0xbc, 0x3e, 0x4f, 0x6d, 0x0d }}

class NS_NO_VTABLE nsIMessageBroadcaster : public nsIMessageListenerManager {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMESSAGEBROADCASTER_IID)

  /* [implicit_jscontext,optional_argc] void broadcastAsyncMessage ([optional] in AString messageName, [optional] in jsval obj, [optional] in jsval objects); */
  NS_IMETHOD BroadcastAsyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, JSContext* cx, uint8_t _argc) = 0;

  /* readonly attribute unsigned long childCount; */
  NS_IMETHOD GetChildCount(uint32_t *aChildCount) = 0;

  /* nsIMessageListenerManager getChildAt (in unsigned long aIndex); */
  NS_IMETHOD GetChildAt(uint32_t aIndex, nsIMessageListenerManager * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMessageBroadcaster, NS_IMESSAGEBROADCASTER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIMESSAGEBROADCASTER \
  NS_IMETHOD BroadcastAsyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, JSContext* cx, uint8_t _argc) MOZ_OVERRIDE; \
  NS_IMETHOD GetChildCount(uint32_t *aChildCount) MOZ_OVERRIDE; \
  NS_IMETHOD GetChildAt(uint32_t aIndex, nsIMessageListenerManager * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIMESSAGEBROADCASTER(_to) \
  NS_IMETHOD BroadcastAsyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, JSContext* cx, uint8_t _argc) MOZ_OVERRIDE { return _to BroadcastAsyncMessage(messageName, obj, objects, cx, _argc); } \
  NS_IMETHOD GetChildCount(uint32_t *aChildCount) MOZ_OVERRIDE { return _to GetChildCount(aChildCount); } \
  NS_IMETHOD GetChildAt(uint32_t aIndex, nsIMessageListenerManager * *_retval) MOZ_OVERRIDE { return _to GetChildAt(aIndex, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIMESSAGEBROADCASTER(_to) \
  NS_IMETHOD BroadcastAsyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, JSContext* cx, uint8_t _argc) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->BroadcastAsyncMessage(messageName, obj, objects, cx, _argc); } \
  NS_IMETHOD GetChildCount(uint32_t *aChildCount) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChildCount(aChildCount); } \
  NS_IMETHOD GetChildAt(uint32_t aIndex, nsIMessageListenerManager * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChildAt(aIndex, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsMessageBroadcaster : public nsIMessageBroadcaster

/* readonly attribute unsigned long childCount; */
NS_IMETHODIMP nsMessageBroadcaster::GetChildCount(uint32_t *aChildCount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIMessageListenerManager getChildAt (in unsigned long aIndex); */
NS_IMETHODIMP nsMessageBroadcaster::GetChildAt(uint32_t aIndex, nsIMessageListenerManager * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 390 "../../dist/include/nsIMessageManager.h"


/* starting interface:    nsISyncMessageSender */
#define NS_ISYNCMESSAGESENDER_IID_STR "7fda0941-9dcc-448b-bd39-16373c5b4003"

#define NS_ISYNCMESSAGESENDER_IID \
  {0x7fda0941, 0x9dcc, 0x448b, \
    { 0xbd, 0x39, 0x16, 0x37, 0x3c, 0x5b, 0x40, 0x03 }}

class NS_NO_VTABLE nsISyncMessageSender : public nsIMessageSender {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISYNCMESSAGESENDER_IID)

  /* [implicit_jscontext,optional_argc] jsval sendSyncMessage ([optional] in AString messageName, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsIPrincipal principal); */
  NS_IMETHOD SendSyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc, JS::MutableHandleValue _retval) = 0;

  /* [implicit_jscontext,optional_argc] jsval sendRpcMessage ([optional] in AString messageName, [optional] in jsval obj, [optional] in jsval objects, [optional] in nsIPrincipal principal); */
  NS_IMETHOD SendRpcMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc, JS::MutableHandleValue _retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsISyncMessageSender, NS_ISYNCMESSAGESENDER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISYNCMESSAGESENDER \
  NS_IMETHOD SendSyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc, JS::MutableHandleValue _retval) MOZ_OVERRIDE; \
  NS_IMETHOD SendRpcMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc, JS::MutableHandleValue _retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISYNCMESSAGESENDER(_to) \
  NS_IMETHOD SendSyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc, JS::MutableHandleValue _retval) MOZ_OVERRIDE { return _to SendSyncMessage(messageName, obj, objects, principal, cx, _argc, _retval); } \
  NS_IMETHOD SendRpcMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc, JS::MutableHandleValue _retval) MOZ_OVERRIDE { return _to SendRpcMessage(messageName, obj, objects, principal, cx, _argc, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISYNCMESSAGESENDER(_to) \
  NS_IMETHOD SendSyncMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc, JS::MutableHandleValue _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SendSyncMessage(messageName, obj, objects, principal, cx, _argc, _retval); } \
  NS_IMETHOD SendRpcMessage(const nsAString & messageName, JS::HandleValue obj, JS::HandleValue objects, nsIPrincipal *principal, JSContext* cx, uint8_t _argc, JS::MutableHandleValue _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SendRpcMessage(messageName, obj, objects, principal, cx, _argc, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsSyncMessageSender : public nsISyncMessageSender
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISYNCMESSAGESENDER
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 475 "../../dist/include/nsIMessageManager.h"


/* starting interface:    nsIMessageManagerGlobal */
#define NS_IMESSAGEMANAGERGLOBAL_IID_STR "e04a7ade-c61a-46ec-9f13-efeabedd9d3d"

#define NS_IMESSAGEMANAGERGLOBAL_IID \
  {0xe04a7ade, 0xc61a, 0x46ec, \
    { 0x9f, 0x13, 0xef, 0xea, 0xbe, 0xdd, 0x9d, 0x3d }}

class NS_NO_VTABLE nsIMessageManagerGlobal : public nsISyncMessageSender {
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMessageManagerGlobal, NS_IMESSAGEMANAGERGLOBAL_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIMESSAGEMANAGERGLOBAL \
  NS_IMETHOD Dump(const nsAString & aStr) MOZ_OVERRIDE; \
  NS_IMETHOD PrivateNoteIntentionalCrash(void) MOZ_OVERRIDE; \
  NS_IMETHOD Atob(const nsAString & aAsciiString, nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD Btoa(const nsAString & aBase64Data, nsAString & _retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIMESSAGEMANAGERGLOBAL(_to) \
  NS_IMETHOD Dump(const nsAString & aStr) MOZ_OVERRIDE { return _to Dump(aStr); } \
  NS_IMETHOD PrivateNoteIntentionalCrash(void) MOZ_OVERRIDE { return _to PrivateNoteIntentionalCrash(); } \
  NS_IMETHOD Atob(const nsAString & aAsciiString, nsAString & _retval) MOZ_OVERRIDE { return _to Atob(aAsciiString, _retval); } \
  NS_IMETHOD Btoa(const nsAString & aBase64Data, nsAString & _retval) MOZ_OVERRIDE { return _to Btoa(aBase64Data, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIMESSAGEMANAGERGLOBAL(_to) \
  NS_IMETHOD Dump(const nsAString & aStr) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Dump(aStr); } \
  NS_IMETHOD PrivateNoteIntentionalCrash(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->PrivateNoteIntentionalCrash(); } \
  NS_IMETHOD Atob(const nsAString & aAsciiString, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Atob(aAsciiString, _retval); } \
  NS_IMETHOD Btoa(const nsAString & aBase64Data, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Btoa(aBase64Data, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsMessageManagerGlobal : public nsIMessageManagerGlobal
{
public:
{
  /* member initializers and constructor code */
}
#endif
# 584 "../../dist/include/nsIMessageManager.h"


/* starting interface:    nsIContentFrameMessageManager */
#define NS_ICONTENTFRAMEMESSAGEMANAGER_IID_STR "fff36099-9f84-4c7c-b69a-1cbf103d1708"

#define NS_ICONTENTFRAMEMESSAGEMANAGER_IID \
  {0xfff36099, 0x9f84, 0x4c7c, \
    { 0xb6, 0x9a, 0x1c, 0xbf, 0x10, 0x3d, 0x17, 0x08 }}

class NS_NO_VTABLE nsIContentFrameMessageManager : public nsIMessageManagerGlobal {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTFRAMEMESSAGEMANAGER_IID)

  /* readonly attribute nsIDOMWindow content; */
  NS_IMETHOD GetContent(nsIDOMWindow * *aContent) = 0;

  /* readonly attribute nsIDocShell docShell; */
  NS_IMETHOD GetDocShell(nsIDocShell * *aDocShell) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentFrameMessageManager, NS_ICONTENTFRAMEMESSAGEMANAGER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICONTENTFRAMEMESSAGEMANAGER \
  NS_IMETHOD GetContent(nsIDOMWindow * *aContent) MOZ_OVERRIDE; \
  NS_IMETHOD GetDocShell(nsIDocShell * *aDocShell) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICONTENTFRAMEMESSAGEMANAGER(_to) \
  NS_IMETHOD GetContent(nsIDOMWindow * *aContent) MOZ_OVERRIDE { return _to GetContent(aContent); } \
  NS_IMETHOD GetDocShell(nsIDocShell * *aDocShell) MOZ_OVERRIDE { return _to GetDocShell(aDocShell); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICONTENTFRAMEMESSAGEMANAGER(_to) \
  NS_IMETHOD GetContent(nsIDOMWindow * *aContent) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContent(aContent); } \
  NS_IMETHOD GetDocShell(nsIDocShell * *aDocShell) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDocShell(aDocShell); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
NS_IMPL_ISUPPORTS(nsContentFrameMessageManager, nsIContentFrameMessageManager)
{
  /* member initializers and constructor code */
}

nsContentProcessMessageManager::~nsContentProcessMessageManager()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 806 "../../dist/include/nsIMessageManager.h"


/* starting interface:    nsIFrameScriptLoader */
#define NS_IFRAMESCRIPTLOADER_IID_STR "6fb78110-45ae-11e3-8f96-0800200c9a66"

#define NS_IFRAMESCRIPTLOADER_IID \
  {0x6fb78110, 0x45ae, 0x11e3, \
    { 0x8f, 0x96, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }}

class NS_NO_VTABLE nsIFrameScriptLoader : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMESCRIPTLOADER_IID)

  /* void loadFrameScript (in AString aURL, in boolean aAllowDelayedLoad, [optional] in boolean aRunInGlobalScope); */
  NS_IMETHOD LoadFrameScript(const nsAString & aURL, bool aAllowDelayedLoad, bool aRunInGlobalScope) = 0;

  /* void removeDelayedFrameScript (in AString aURL); */
  NS_IMETHOD RemoveDelayedFrameScript(const nsAString & aURL) = 0;

  /* [implicit_jscontext] jsval getDelayedFrameScripts (); */
  NS_IMETHOD GetDelayedFrameScripts(JSContext* cx, JS::MutableHandleValue _retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameScriptLoader, NS_IFRAMESCRIPTLOADER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIFRAMESCRIPTLOADER \
  NS_IMETHOD LoadFrameScript(const nsAString & aURL, bool aAllowDelayedLoad, bool aRunInGlobalScope) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveDelayedFrameScript(const nsAString & aURL) MOZ_OVERRIDE; \
  NS_IMETHOD GetDelayedFrameScripts(JSContext* cx, JS::MutableHandleValue _retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIFRAMESCRIPTLOADER(_to) \
  NS_IMETHOD LoadFrameScript(const nsAString & aURL, bool aAllowDelayedLoad, bool aRunInGlobalScope) MOZ_OVERRIDE { return _to LoadFrameScript(aURL, aAllowDelayedLoad, aRunInGlobalScope); } \
  NS_IMETHOD RemoveDelayedFrameScript(const nsAString & aURL) MOZ_OVERRIDE { return _to RemoveDelayedFrameScript(aURL); } \
  NS_IMETHOD GetDelayedFrameScripts(JSContext* cx, JS::MutableHandleValue _retval) MOZ_OVERRIDE { return _to GetDelayedFrameScripts(cx, _retval); } 

/* starting interface:    nsIProcessScriptLoader */
#define NS_IPROCESSSCRIPTLOADER_IID_STR "7e1e1a20-b24f-11e4-ab27-0800200c9a66"

#define NS_IPROCESSSCRIPTLOADER_IID \
  {0x7e1e1a20, 0xb24f, 0x11e4, \
    { 0xab, 0x27, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }}

class NS_NO_VTABLE nsIProcessScriptLoader : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPROCESSSCRIPTLOADER_IID)

  /* void loadProcessScript (in AString aURL, in boolean aAllowDelayedLoad); */
  NS_IMETHOD LoadProcessScript(const nsAString & aURL, bool aAllowDelayedLoad) = 0;

  /* void removeDelayedProcessScript (in AString aURL); */
  NS_IMETHOD RemoveDelayedProcessScript(const nsAString & aURL) = 0;

  /* [implicit_jscontext] jsval getDelayedProcessScripts (); */
  NS_IMETHOD GetDelayedProcessScripts(JSContext* cx, JS::MutableHandleValue _retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIProcessScriptLoader, NS_IPROCESSSCRIPTLOADER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPROCESSSCRIPTLOADER \
  NS_IMETHOD LoadProcessScript(const nsAString & aURL, bool aAllowDelayedLoad) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveDelayedProcessScript(const nsAString & aURL) MOZ_OVERRIDE; \
  NS_IMETHOD GetDelayedProcessScripts(JSContext* cx, JS::MutableHandleValue _retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPROCESSSCRIPTLOADER(_to) \
  NS_IMETHOD LoadProcessScript(const nsAString & aURL, bool aAllowDelayedLoad) MOZ_OVERRIDE { return _to LoadProcessScript(aURL, aAllowDelayedLoad); } \
  NS_IMETHOD RemoveDelayedProcessScript(const nsAString & aURL) MOZ_OVERRIDE { return _to RemoveDelayedProcessScript(aURL); } \
  NS_IMETHOD GetDelayedProcessScripts(JSContext* cx, JS::MutableHandleValue _retval) MOZ_OVERRIDE { return _to GetDelayedProcessScripts(cx, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPROCESSSCRIPTLOADER(_to) \
  NS_IMETHOD LoadProcessScript(const nsAString & aURL, bool aAllowDelayedLoad) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->LoadProcessScript(aURL, aAllowDelayedLoad); } \
  NS_IMETHOD RemoveDelayedProcessScript(const nsAString & aURL) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveDelayedProcessScript(aURL); } \
  NS_IMETHOD GetDelayedProcessScripts(JSContext* cx, JS::MutableHandleValue _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDelayedProcessScripts(cx, _retval); } 

#if 0

/* End of implementation class template. */
#endif
# 1000 "../../dist/include/nsIMessageManager.h"


/* starting interface:    nsIProcessChecker */
#define NS_IPROCESSCHECKER_IID_STR "637e8538-4f8f-4a3d-8510-e74386233e19"

#define NS_IPROCESSCHECKER_IID \
  {0x637e8538, 0x4f8f, 0x4a3d, \
    { 0x85, 0x10, 0xe7, 0x43, 0x86, 0x23, 0x3e, 0x19 }}

class NS_NO_VTABLE nsIProcessChecker : public nsISupports {
 public: 


};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIProcessChecker, NS_IPROCESSCHECKER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPROCESSCHECKER \
  NS_IMETHOD KillChild(bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD AssertPermission(const nsAString & aPermission, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD AssertContainApp(const nsAString & aManifestURL, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD AssertAppHasPermission(const nsAString & aPermission, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD AssertAppHasStatus(uint16_t aStatus, bool *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPROCESSCHECKER(_to) \
  NS_IMETHOD KillChild(bool *_retval) MOZ_OVERRIDE { return _to KillChild(_retval); } \
  NS_IMETHOD AssertPermission(const nsAString & aPermission, bool *_retval) MOZ_OVERRIDE { return _to AssertPermission(aPermission, _retval); } \
  NS_IMETHOD AssertContainApp(const nsAString & aManifestURL, bool *_retval) MOZ_OVERRIDE { return _to AssertContainApp(aManifestURL, _retval); } \
  NS_IMETHOD AssertAppHasPermission(const nsAString & aPermission, bool *_retval) MOZ_OVERRIDE { return _to AssertAppHasPermission(aPermission, _retval); } \
  NS_IMETHOD AssertAppHasStatus(uint16_t aStatus, bool *_retval) MOZ_OVERRIDE { return _to AssertAppHasStatus(aStatus, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPROCESSCHECKER(_to) \
  NS_IMETHOD KillChild(bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->KillChild(_retval); } \
  NS_IMETHOD AssertPermission(const nsAString & aPermission, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AssertPermission(aPermission, _retval); } \
  NS_IMETHOD AssertContainApp(const nsAString & aManifestURL, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AssertContainApp(aManifestURL, _retval); } \
  NS_IMETHOD AssertAppHasPermission(const nsAString & aPermission, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AssertAppHasPermission(aPermission, _retval); } \
  NS_IMETHOD AssertAppHasStatus(uint16_t aStatus, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AssertAppHasStatus(aStatus, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* boolean assertAppHasPermission (in DOMString aPermission); */
NS_IMETHODIMP nsProcessChecker::AssertAppHasPermission(const nsAString & aPermission, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean assertAppHasStatus (in unsigned short aStatus); */
NS_IMETHODIMP nsProcessChecker::AssertAppHasStatus(uint16_t aStatus, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 1121 "../../dist/include/nsIMessageManager.h"


#endif /* __gen_nsIMessageManager_h__ */
# 1124 "../../dist/include/nsIMessageManager.h"
# 40 "../../dist/include/nsPresContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RestyleLogging.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/RestyleLogging.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * Macros used to log restyle events.
 */

#ifndef mozilla_RestyleLogging_h
#define mozilla_RestyleLogging_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/AutoRestore.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/AutoRestore.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* functions for restoring saved values at the end of a C++ scope */

#ifndef mozilla_AutoRestore_h_
#define mozilla_AutoRestore_h_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h" // MOZ_STACK_CLASS
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/AutoRestore.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/GuardObjects.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/AutoRestore.h"

namespace mozilla {

/**
 * Save the current value of a variable and restore it when the object
 * goes out of scope.  For example:
 *   {
 *     AutoRestore<bool> savePainting(mIsPainting);
 *     mIsPainting = true;
 *
 *     // ... your code here ...
 *
 *     // mIsPainting is reset to its old value at the end of this block
 *   }
 */
template<class T>
class MOZ_STACK_CLASS AutoRestore
{
private:
  T& mLocation;
  T mValue;
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
public:
  
  
};

} // namespace mozilla

#endif /* !defined(mozilla_AutoRestore_h_) */
# 52 "../../dist/include/mozilla/AutoRestore.h"
# 14 "../../dist/include/mozilla/RestyleLogging.h" 2

#ifdef DEBUG
#define RESTYLE_LOGGING
#endif
# 18 "../../dist/include/mozilla/RestyleLogging.h"

#ifdef RESTYLE_LOGGING
#define LOG_RESTYLE_VAR2(prefix_, suffix_) prefix_##suffix_
#define LOG_RESTYLE_VAR(prefix_, suffix_) LOG_RESTYLE_VAR2(prefix_, suffix_)
#define LOG_RESTYLE_DEPTH LOG_RESTYLE_VAR(restyle_depth_, __LINE__)
#define LOG_RESTYLE_IF(object_, cond_, message_, ...)                         \
  PR_BEGIN_MACRO                                                              \
    if (object_->ShouldLogRestyle() && (cond_)) {                             \
      nsCString line;                                                         \
      for (int32_t LOG_RESTYLE_VAR(rs_depth_, __LINE__) = 0;                  \
           LOG_RESTYLE_VAR(rs_depth_, __LINE__) < object_->LoggingDepth();    \
           LOG_RESTYLE_VAR(rs_depth_, __LINE__)++) {                          \
        line.AppendLiteral("  ");                                             \
      }                                                                       \
      line.AppendPrintf(message_, ##__VA_ARGS__);                             \
      printf_stderr("%s\n", line.get());                                      \
    }                                                                         \
  PR_END_MACRO
#define LOG_RESTYLE(message_, ...)                                            \
  LOG_RESTYLE_IF(this, true, message_, ##__VA_ARGS__)
// Beware that LOG_RESTYLE_INDENT is two statements not wrapped in a block.
#define LOG_RESTYLE_INDENT()                                                  \
  AutoRestore<int32_t> LOG_RESTYLE_VAR(ar_depth_, __LINE__)(LoggingDepth());  \
  ++LoggingDepth();
#else
# 43 "../../dist/include/mozilla/RestyleLogging.h"
#define LOG_RESTYLE_IF(cond_, message_, ...) /* nothing */
#define LOG_RESTYLE(message_, ...) /* nothing */
#define LOG_RESTYLE_INDENT() /* nothing */
#endif
# 47 "../../dist/include/mozilla/RestyleLogging.h"

#endif /* mozilla_RestyleLogging_h */
# 49 "../../dist/include/mozilla/RestyleLogging.h"
# 41 "../../dist/include/nsPresContext.h" 2

class nsBidiPresUtils;
class nsAString;
class nsIPrintSettings;
class nsDocShell;
class nsIDocShell;
class nsIDocument;
class nsILanguageAtomService;
class nsITheme;
class nsIContent;
class nsIFrame;
class nsFrameManager;
class nsILinkHandler;
class nsIAtom;
class nsICSSPseudoComparator;
struct nsStyleBackground;
struct nsStyleBorder;
class nsIRunnable;
class gfxUserFontEntry;
class gfxUserFontSet;
class gfxTextPerfMetrics;
struct nsFontFaceRuleContainer;
class nsPluginFrame;
class nsTransitionManager;
class nsAnimationManager;
class nsRefreshDriver;
class nsIWidget;
class nsDeviceContext;
class gfxMissingFontRecorder;

namespace mozilla {
class EventStateManager;
class RestyleManager;
class CounterStyleManager;
namespace dom {
class FontFaceSet;
}
namespace layers {
class ContainerLayer;
class LayerManager;
}
}

// supported values for cached bool types
enum nsPresContext_CachedBoolPrefType {
  kPresContext_UseDocumentFonts = 1,
  kPresContext_UnderlineLinks
};

// supported values for cached integer pref types
enum nsPresContext_CachedIntPrefType {
  kPresContext_ScrollbarSide = 1,
  kPresContext_BidiDirection
};

// IDs for the default variable and fixed fonts (not to be changed, see nsFont.h)
// To be used for Get/SetDefaultFont(). The other IDs in nsFont.h are also supported.
const uint8_t kPresContext_DefaultVariableFont_ID = 0x00; // kGenericFont_moz_variable
const uint8_t kPresContext_DefaultFixedFont_ID    = 0x01; // kGenericFont_moz_fixed

#ifdef DEBUG
struct nsAutoLayoutPhase;

enum nsLayoutPhase {
  eLayoutPhase_Paint,
  eLayoutPhase_Reflow,
  eLayoutPhase_FrameC,
  eLayoutPhase_COUNT
};
#endif
# 111 "../../dist/include/nsPresContext.h"

class nsInvalidateRequestList {
public:
  struct Request {
    nsRect   mRect;
    uint32_t mFlags;
  };

  
  

  nsTArray<Request> mRequests;
};

/* Used by nsPresContext::HasAuthorSpecifiedRules */
#define NS_AUTHOR_SPECIFIED_BACKGROUND      (1 << 0)
#define NS_AUTHOR_SPECIFIED_BORDER          (1 << 1)
#define NS_AUTHOR_SPECIFIED_PADDING         (1 << 2)
#define NS_AUTHOR_SPECIFIED_TEXT_SHADOW     (1 << 3)

class nsRootPresContext;

// An interface for presentation contexts. Presentation contexts are
// objects that provide an outer context for a presentation shell.

class nsPresContext : public nsIObserver {
public:
  typedef mozilla::FramePropertyTable FramePropertyTable;
  typedef mozilla::ScrollbarStyles ScrollbarStyles;

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_NSIOBSERVER
  NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
  NS_DECL_CYCLE_COLLECTION_CLASS(nsPresContext)

  enum nsPresContextType {
    eContext_Galley,       // unpaginated screen presentation
    eContext_PrintPreview, // paginated screen presentation
    eContext_Print,        // paginated printer presentation
    eContext_PageLayout    // paginated & editable.
  };

  ;

  /**
   * Initialize the presentation context from a particular device.
   */
  ;

  /**
   * Set the presentation shell that this context is bound to.
   * A presentation context may only be bound to a single shell.
   */
  ;


  

  /**
   * Get the PresentationShell that this context is bound to.
   */
  nsIPresShell* PresShell() const
  {
    NS_ASSERTION(mShell, "Null pres shell");
    return mShell;
  }

  nsIPresShell* GetPresShell() const { return mShell; }

  /**
   *                    expressed in appunits of this will be returned in
   *                    aOffset.
   */
  ;

  /**
   * Returns the root widget for this.
   * Note that the widget is a mediater with IME.
   */
  ;

  /**
   * Return the presentation context for the root of the view manager
   * hierarchy that contains this presentation context, or nullptr if it can't
   * be found (e.g. it's detached).
   */
  ;
  ;
  

  

#ifdef MOZILLA_INTERNAL_API
  nsStyleSet* StyleSet() { return GetPresShell()->StyleSet(); }

  nsFrameManager* FrameManager()
    { return PresShell()->FrameManager(); }

  nsCSSFrameConstructor* FrameConstructor()
    { return PresShell()->FrameConstructor(); }

  nsTransitionManager* TransitionManager() { return mTransitionManager; }
  nsAnimationManager* AnimationManager() { return mAnimationManager; }

  nsRefreshDriver* RefreshDriver() { return mRefreshDriver; }

  mozilla::RestyleManager* RestyleManager() { return mRestyleManager; }

  mozilla::CounterStyleManager* CounterStyleManager() {
    return mCounterStyleManager;
  }
#endif
# 248 "../../dist/include/nsPresContext.h"

  /**
   * Rebuilds all style data by throwing out the old rule tree and
   * building a new one, and additionally applying aExtraHint (which
  nsIDocShell* GetDocShell() const;

  // XXX this are going to be replaced with set/get container
  void SetLinkHandler(nsILinkHandler* aHandler) { mLinkHandler = aHandler; }
  nsILinkHandler* GetLinkHandler() { return mLinkHandler; }

  /**
   * Detach this pres context - i.e. cancel relevant timers,
   * SetLinkHandler(null), SetContainer(null) etc.
   * Only to be used by the DocumentViewer.
   */
  virtual void Detach();

  /**
   * Get the visible area associated with this presentation context.
   * This is the size of the visible area that is used for
   * presenting the document. The returned value is in the standard
  
  

  /**
  * Get/set the scaling facor to use when rendering the pages for print preview.
  * Only safe to get after print preview set up; safe to set anytime.
  * This is a scaling factor for the display of the print preview.  It
  * does not affect layout.  It only affects the size of the onscreen pages
  * in print preview.
  * XXX Temporary: see http://wiki.mozilla.org/Gecko:PrintPreview
  */
  
  

  nsDeviceContext* DeviceContext() { return mDeviceContext; }
  
  

  
  

  /**
   * Get the minimum font size for the specified language. If aLanguage
   * is nullptr, then the document's language is used.  This combines
   * the language-specific global preference with the per-presentation
   * base minimum font size.
   */
  

  /**
   * Get the per-presentation base minimum font size.  This size is
   * independent of the language-specific global preference.
   * inflation.
   *
   * If |aChanged| is non-null, then aChanged is filled in with whether
   * the return value has changed since either:
   *  a. the last time the function was called with non-null aChanged, or
   *  b. the first time the function was called.
   */
  ;

  static int32_t AppUnitsPerCSSPixel() { return mozilla::AppUnitsPerCSSPixel(); }
  int32_t AppUnitsPerDevPixel() const;
  

  

  

  static int32_t AppUnitsToIntCSSPixels(nscoord aAppUnits)
  { return NSAppUnitsToIntPixels(aAppUnits,
             float(AppUnitsPerCSSPixel())); }

  

  

  

  

  

  

  

  
  

  /**
   * Set and get methods for controlling the background drawing
  */
  
  

  
  

  /**
  ;

  /*
   * Notify the pres context that a system color has changed
   */
  ;

  /** Printing methods below should only be used for Medium() == print **/
  ;

  

  /* Accessor for table of frame properties */
  FramePropertyTable* PropertyTable() { return &mPropertyTable; }

  /* Helper function that ensures that this prescontext is shown in its
  /**
   * This table maps border-width enums 'thin', 'medium', 'thick'
   * to actual nscoord values.
   */
  

  gfxTextPerfMetrics *GetTextPerfMetrics() { return mTextPerf; }

  
  

  // Is this presentation in a chrome docshell?
  
  
  ;

  gfxUserFontSet* GetUserFontSetInternal();
#ifdef MOZILLA_INTERNAL_API
  gfxUserFontSet* GetUserFontSet() { return GetUserFontSetInternal(); }
#else
# 885 "../../dist/include/nsPresContext.h"
  gfxUserFontSet* GetUserFontSet() { return GetUserFontSetExternal(); }
#endif
# 887 "../../dist/include/nsPresContext.h"

  void FlushUserFontSet();
  void RebuildUserFontSet(); // asynchronously
  friend class InterruptPreventer;
  class MOZ_STACK_CLASS InterruptPreventer {
  public:
    
    

  private:
    nsPresContext* mCtx;
    bool mInterruptsEnabled;
    bool mHasPendingInterrupt;
  };

  /**
   * Check for interrupts. This may return true if a pending event is
   * detected. Once it has returned true, it will keep returning true
   * until ReflowStarted is called. In all cases where this returns true,
   * the passed-in frame (which should be the frame whose reflow will be
   * interrupted if true is returned) will be passed to
   * nsIPresShell::FrameNeedsToContinueReflow.
   */
  ;
  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
  

  ;
  ;

  

  

  

  

  

  

  

  ;

  ;

  // Allow nsAutoPtr<LangGroupFontPrefs> dtor to access this protected struct's
  // dtor:
  struct LangGroupFontPrefs;
  friend class nsAutoPtr<LangGroupFontPrefs>;
  struct LangGroupFontPrefs {
    // Font sizes default to zero; they will be set in GetFontPreferences
    

    

    nsCOMPtr<nsIAtom> mLangGroup;
    nscoord mMinimumFontSize;
    nsFont mDefaultVariableFont;
    nsFont mDefaultFixedFont;
    nsFont mDefaultSerifFont;
    nsFont mDefaultSansSerifFont;
    nsFont mDefaultMonospaceFont;
    nsFont mDefaultCursiveFont;
    nsFont mDefaultFantasyFont;
    nsAutoPtr<LangGroupFontPrefs> mNext;
  };

  /**
   * Fetch the user's font preferences for the given aLanguage's
   * langugage group.
   */
  ;
protected:
  // May be called multiple times (unlink, destructor)
  ;

  ;

  

  

  ;

  // Can't be inline because we can't include nsStyleSet.h.
  ;

  ;

  // IMPORTANT: The ownership implicit in the following member variables
  // has been explicitly checked.  If you add any members to this class,
  // please make the ownership explicit (pinkerton, scc).

  nsPresContextType     mType;
  nsIPresShell*         mShell;         // [WEAK]
  nsCOMPtr<nsIDocument> mDocument;
  nsRefPtr<nsDeviceContext> mDeviceContext; // [STRONG] could be weak, but
                                            // better safe than sorry.
                                            // Cannot reintroduce cycles
                                            // since there is no dependency
                                            // from gfx back to layout.
  nsRefPtr<mozilla::EventStateManager> mEventManager;
  nsRefPtr<nsRefreshDriver> mRefreshDriver;
  nsRefPtr<nsTransitionManager> mTransitionManager;
  nsRefPtr<nsAnimationManager> mAnimationManager;
  nsRefPtr<mozilla::RestyleManager> mRestyleManager;
  nsRefPtr<mozilla::CounterStyleManager> mCounterStyleManager;
  nsIAtom*              mMedium;        // initialized by subclass ctors;
                                        // weak pointer to static atom
  nsCOMPtr<nsIAtom> mMediaEmulated;

  nsILinkHandler*       mLinkHandler;   // [WEAK]

  // Formerly mLangGroup; moving from charset-oriented langGroup to
  // maintaining actual language settings everywhere (see bug 524107).
  // This may in fact hold a langGroup such as x-western rather than
  // a specific language, however (e.g, if it is inferred from the
  int32_t               mBaseMinFontSize;
  float                 mTextZoom;      // Text zoom, defaults to 1.0
  float                 mFullZoom;      // Page zoom, defaults to 1.0

  float                 mLastFontInflationScreenWidth;

  int32_t               mCurAppUnitsPerDevPixel;
  int32_t               mAutoQualityMinFontSizePixelsPref;

  nsCOMPtr<nsITheme> mTheme;
  nsCOMPtr<nsILanguageAtomService> mLangService;
  nsCOMPtr<nsIPrintSettings> mPrintSettings;
  nsCOMPtr<nsITimer>    mPrefChangedTimer;

  FramePropertyTable    mPropertyTable;

  nsInvalidateRequestList mInvalidateRequestsSinceLastPaint;
  nsInvalidateRequestList mUndeliveredInvalidateRequestsBeforeLastPaint;

  // container for per-context fonts (downloadable, SVG, etc.)
  nsRefPtr<mozilla::dom::FontFaceSet> mFontFaceSet;

  // text performance metrics
  nsAutoPtr<gfxTextPerfMetrics>   mTextPerf;

  nsAutoPtr<gfxMissingFontRecorder> mMissingFonts;

  nsRect                mVisibleArea;
  nsSize                mPageSize;
  float                 mPageScale;
  float                 mPPScale;

  unsigned              mFontFaceSetDirty : 1;
  // Has GetUserFontSet() been called?
  unsigned              mGetUserFontSetCalled : 1;
  // Do we currently have an event posted to call FlushUserFontSet?
  unsigned              mPostedFlushUserFontSet : 1;

  // Is the current mCounterStyleManager valid?
  unsigned              mCounterStylesDirty : 1;
  // Do we currently have an event posted to call FlushCounterStyles?
  unsigned              mPostedFlushCounterStyles: 1;

  // resize reflow is suppressed when the only change has been to zoom
  // the document rather than to change the document's dimensions
  unsigned              mSupressResizeReflow : 1;
  // these are private, use the list in nsFont.h if you want a public list
  enum {
    eDefaultFont_Variable,
    eDefaultFont_Fixed,
    eDefaultFont_Serif,
    eDefaultFont_SansSerif,
    eDefaultFont_Monospace,
    eDefaultFont_Cursive,
    eDefaultFont_Fantasy,
    eDefaultFont_COUNT
  };

  ;

  ;

#ifdef DEBUG
private:
  friend struct nsAutoLayoutPhase;
  uint32_t mLayoutPhaseCount[eLayoutPhase_COUNT];
public:
  uint32_t LayoutPhaseCount(nsLayoutPhase aPhase) {
    return mLayoutPhaseCount[aPhase];
  }
#endif
# 1437 "../../dist/include/nsPresContext.h"

};

class nsRootPresContext MOZ_FINAL : public nsPresContext {
public:
  ;
  ;
  virtual void Detach() MOZ_OVERRIDE;
  

  /**
   * Add a runnable that will get called before the next paint. They will get
   * run eventually even if painting doesn't happen. They might run well before
   * painting happens.
   */
  ;

  /**
   * Run all runnables that need to get called before the next paint.
   */
  void FlushWillPaintObservers();

  virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;

protected:
  /**
   * Start a timer to ensure we eventually run ApplyPluginGeometryUpdates.
   */
  ;
  /**
   * Cancel the timer that ensures we eventually run ApplyPluginGeometryUpdates.
   */
  ;

  class RunWillPaintObservers : public nsRunnable {
  public:
    
    
    NS_IMETHOD Run() MOZ_OVERRIDE
    {
      if (mPresContext) {
        mPresContext->FlushWillPaintObservers();
      }
      return NS_OK;
    }
    nsRootPresContext* mPresContext;
  };

  friend class nsPresContext;

  nsCOMPtr<nsITimer> mNotifyDidPaintTimer;
  nsCOMPtr<nsITimer> mApplyPluginGeometryTimer;
  nsTHashtable<nsRefPtrHashKey<nsIContent> > mRegisteredPlugins;
  nsTArray<nsCOMPtr<nsIRunnable> > mWillPaintObservers;
  nsRevocableEventPtr<RunWillPaintObservers> mWillPaintFallbackEvent;
  uint32_t mDOMGeneration;
};

#ifdef MOZ_REFLOW_PERF

#define DO_GLOBAL_REFLOW_COUNT(_name) \
  aPresContext->CountReflows((_name), (nsIFrame*)this);
#else
# 1574 "../../dist/include/nsPresContext.h"
#define DO_GLOBAL_REFLOW_COUNT(_name)
#endif // MOZ_REFLOW_PERF
# 1576 "../../dist/include/nsPresContext.h"

#endif /* nsPresContext_h___ */
# 1578 "../../dist/include/nsPresContext.h"
# 27 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CORSMode.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/CORSMode.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef CORSMode_h_
#define CORSMode_h_

namespace mozilla {

enum CORSMode {
  /**
   * The default of not using CORS to validate cross-origin loads.
   */
  CORS_NONE,

  /**
   * Validate cross-site loads using CORS, but do not send any credentials
   * (cookies, HTTP auth logins, etc) along with the request.
   */
  CORS_ANONYMOUS,

  /**
   * Validate cross-site loads using CORS, and send credentials such as cookies
   * and HTTP auth logins along with the request.
   */
  CORS_USE_CREDENTIALS
};

} // namespace mozilla

#endif /* CORSMode_h_ */
# 33 "../../dist/include/mozilla/CORSMode.h"
# 28 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 29 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIScrollableFrame.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/generic/nsIScrollableFrame.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * interface that provides scroll APIs implemented by scrollable frames
 */

#ifndef nsIScrollFrame_h___
#define nsIScrollFrame_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsCoord.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/layout/generic/nsIScrollableFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "ScrollbarStyles.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/layout/generic/nsIScrollableFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Point.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/layout/generic/nsIScrollableFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIScrollbarMediator.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/xul/nsIScrollbarMediator.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsIScrollbarMediator_h___
#define nsIScrollbarMediator_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsQueryFrame.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/layout/xul/nsIScrollbarMediator.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCoord.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/layout/xul/nsIScrollbarMediator.h"

class nsScrollbarFrame;
class nsIDOMEventTarget;
class nsIFrame;

class nsIScrollbarMediator : public nsQueryFrame
{
  ;

  /**
   * Obtain the frame for the horizontal or vertical scrollbar, or null
   * if there is no such box.
   */
  ;
  /**
   * Show or hide scrollbars on 2 fingers touch.
   * Subclasses should call their ScrollbarActivity's corresponding methods.
   */
  ;
  ;
};

#endif
#ifndef GFX_FRAMEMETRICS_H
#define GFX_FRAMEMETRICS_H

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>                     // for uint32_t, uint64_t
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/FrameMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include "Units.h"                      // for CSSRect, CSSPixel, etc
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/FrameMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/BasePoint.h"      // for BasePoint
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/FrameMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Rect.h"           // for RoundedIn
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/FrameMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/ScaleFactor.h"    // for ScaleFactor
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/FrameMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Logging.h"        // for Log
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/Logging.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_LOGGING_H_
#define MOZILLA_GFX_LOGGING_H_

#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/Logging.h"
#if 0 /* expanded by -frewrite-includes */
#include <sstream>
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/gfx/Logging.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/gfx/Logging.h"
#if 0 /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/gfx/Logging.h"
#endif
# 21 "../../dist/include/mozilla/gfx/Logging.h"
#if 0 /* expanded by -frewrite-includes */
#include "Point.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/mozilla/gfx/Logging.h"
#if 0 /* expanded by -frewrite-includes */
#include "BaseRect.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/mozilla/gfx/Logging.h"
#if 0 /* expanded by -frewrite-includes */
#include "Matrix.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/mozilla/gfx/Logging.h"

#ifdef WIN32
// This file gets included from nsGlobalWindow.cpp, which doesn't like
// having windows.h included in it. Since OutputDebugStringA is the only
// thing we need from windows.h, we just declare it here directly.
// Note: the function's documented signature is
//  WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR lpOutputString)
// but if we don't include windows.h, the macros WINBASEAPI, WINAPI, and 
// LPCSTR are not defined, so we need to replace them with their expansions.
extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString);
#endif
# 35 "../../dist/include/mozilla/gfx/Logging.h"

#if defined(PR_LOGGING)
extern GFX2D_API PRLogModuleInfo *GetGFX2DLog();
#endif
# 39 "../../dist/include/mozilla/gfx/Logging.h"

namespace mozilla {
namespace gfx {

// Attempting to be consistent with prlog values, but that isn't critical
// (and note that 5 has a special meaning - see the description
// with sGfxLogLevel)
const int LOG_CRITICAL = 1;
const int LOG_WARNING = 2;
const int LOG_DEBUG = 3;
const int LOG_DEBUG_PRLOG = 4;
const int LOG_EVERYTHING = 5; // This needs to be the highest value

#if defined(DEBUG)
const int LOG_DEFAULT = LOG_EVERYTHING;
#else
# 55 "../../dist/include/mozilla/gfx/Logging.h"
const int LOG_DEFAULT = LOG_CRITICAL;
#endif
# 57 "../../dist/include/mozilla/gfx/Logging.h"

#if defined(PR_LOGGING)

inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) {
  switch (aLevel) {
  case LOG_CRITICAL:
    return PR_LOG_ERROR;
  case LOG_WARNING:
    return PR_LOG_WARNING;
  case LOG_DEBUG:
    return PR_LOG_DEBUG;
  case LOG_DEBUG_PRLOG:
    return PR_LOG_DEBUG;
  case LOG_EVERYTHING:
    return PR_LOG_ALWAYS;
  }
  return PR_LOG_DEBUG;
}

#endif
# 77 "../../dist/include/mozilla/gfx/Logging.h"

class PreferenceAccess
{
public:
  ;

  // This should connect the variable aVar to be updated whenever a preference
  // support prlog (on other systems, 3 and 4 are the same.)  For prlog,
  // in addition to setting the value to 4, you will need to set an
  // environment variable NSPR_LOG_MODULES to gfx:4. See prlog.h for details.
  static int32_t sGfxLogLevel;

private:
  
  static PreferenceAccess* sAccess;
};

/// Graphics logging is available in both debug and release builds and is
/// controlled with a gfx.logging.level preference. If not set, the default
/// for the preference is 5 in the debug builds, 1 in the release builds.
///
/// gfxDebug only works in the debug builds, and is used for information
/// level messages, helping with debugging.  In addition to only working
///
/// On platforms that support PR_LOGGING, the story is slightly more involved.
/// In that case, unless gfx.logging.level is set to 4 or higher, the output
/// is further controlled by "gfx2d" PR logging module.  However, in the case
/// where such module would disable the output, in all but gfxDebug cases,
/// we will still send a printf.
struct BasicLogger
{
  // For efficiency, this method exists and copies the logic of the
  // OutputMessage below.  If making any changes here, also make it
  // in the appropriate places in that method.
  static bool ShouldOutputMessage(int aLevel) {
    if (PreferenceAccess::sGfxLogLevel >= aLevel) {
#if defined(WIN32) && !defined(PR_LOGGING)
      return true;
#elif defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID)
# 153 "../../dist/include/mozilla/gfx/Logging.h"
      return true;
#elif defined(PR_LOGGING)
# 155 "../../dist/include/mozilla/gfx/Logging.h"
      if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
        return true;
      } else if ((PreferenceAccess::sGfxLogLevel >= LOG_DEBUG_PRLOG) ||
                 (aLevel < LOG_DEBUG)) {
        return true;
      }
#else
# 162 "../../dist/include/mozilla/gfx/Logging.h"
      return true;
#endif
# 164 "../../dist/include/mozilla/gfx/Logging.h"
    }
    return false;
  }

  
};

struct CriticalLogger {
  ;
};

// Implement this interface and init the Factory with an instance to
// forward critical logs.
class LogForwarder {
public:
  
  ;

  // Provide a copy of the logs to the caller.  The int is the index
  // of the Log call, if the number of logs exceeds some preset capacity
  // we may not get all of them, so the indices help figure out which
  // ones we did save.
  ;
};

class NoLog
{
public:
  
  ~NoLog() {}

  template<typename T>
  NoLog &operator <<(const T &aLogText) { return *this; }
};

enum class LogOptions : int {
  NoNewline = 0x01,
  AutoPrefix = 0x02,
  AssertOnCall = 0x04
};

template<typename T>
struct Hexa {
  explicit Hexa(T aVal) : mVal(aVal) {}
  T mVal;
};


template<int L, typename Logger = BasicLogger>
class Log
{
public:
  // The default is to have the prefix, have the new line, and for critical
  // logs assert on each call.
  static int DefaultOptions(bool aWithAssert = true) {
    return (int(LogOptions::AutoPrefix) |
            (aWithAssert ? int(LogOptions::AssertOnCall) : 0));
  }

  // Note that we're calling BasicLogger::ShouldOutputMessage, rather than
  // Logger::ShouldOutputMessage.  Since we currently don't have a different
  // version of that method for different loggers, this is OK. Once we do,
  // change BasicLogger::ShouldOutputMessage to Logger::ShouldOutputMessage.
  explicit Log(int aOptions = Log::DefaultOptions(L == LOG_CRITICAL))
    : mOptions(aOptions)
    , mLogIt(BasicLogger::ShouldOutputMessage(L))
  {
    if (mLogIt && AutoPrefix()) {
      if (mOptions & int(LogOptions::AssertOnCall)) {
        mMessage << "[GFX" << L << "]: ";
      } else {
        mMessage << "[GFX" << L << "-]: ";
      }
    }
  }
  ~Log() {
    Flush();
  }

  void Flush() {
    if (MOZ_LIKELY(!LogIt())) return;

    std::string str = mMessage.str();
    if (!str.empty()) {
      WriteLog(str);
    }
    if (AutoPrefix()) {
      mMessage.str("[GFX");
      mMessage << L << "]: ";
    } else {
      mMessage.str("");
    }
    mMessage.clear();
  }

  Log &operator <<(char aChar) {
    if (MOZ_UNLIKELY(LogIt())) {
      mMessage << aChar;
    }
    return *this;
  }
  Log &operator <<(const std::string &aLogText) { 
    if (MOZ_UNLIKELY(LogIt())) {
      mMessage << aLogText;
    }
    return *this;
  }
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  

  

  

  inline bool LogIt() const { return mLogIt; }
  inline bool NoNewline() const { return mOptions & int(LogOptions::NoNewline); }
  inline bool AutoPrefix() const { return mOptions & int(LogOptions::AutoPrefix); }


private:
  void WriteLog(const std::string &aString) {
    if (MOZ_UNLIKELY(LogIt())) {
      Logger::OutputMessage(aString, L, NoNewline());
      if (mOptions & int(LogOptions::AssertOnCall)) {
        MOZ_ASSERT(false, "An assert from the graphics logger");
      }
    }
  }

  std::stringstream mMessage;
  int mOptions;
  bool mLogIt;
};

typedef Log<LOG_DEBUG> DebugLog;
typedef Log<LOG_WARNING> WarningLog;
typedef Log<LOG_CRITICAL, CriticalLogger> CriticalLog;

#ifdef GFX_LOG_DEBUG
#define gfxDebug mozilla::gfx::DebugLog
#else
# 504 "../../dist/include/mozilla/gfx/Logging.h"
#define gfxDebug if (1) ; else mozilla::gfx::NoLog
#endif
# 506 "../../dist/include/mozilla/gfx/Logging.h"
#ifdef GFX_LOG_WARNING
#define gfxWarning mozilla::gfx::WarningLog
#else
# 509 "../../dist/include/mozilla/gfx/Logging.h"
#define gfxWarning if (1) ; else mozilla::gfx::NoLog
#endif
# 511 "../../dist/include/mozilla/gfx/Logging.h"

// This log goes into crash reports, use with care.
#define gfxCriticalError mozilla::gfx::CriticalLog

// See nsDebug.h and the NS_WARN_IF macro

#ifdef __cplusplus
 // For now, have MOZ2D_ERROR_IF available in debug and non-debug builds

#define MOZ2D_ERROR_IF(condition) \
  MOZ2D_error_if_impl(condition, #condition, __FILE__, __LINE__)

#endif
# 545 "../../dist/include/mozilla/gfx/Logging.h"

const int INDENT_PER_LEVEL = 2;

class TreeLog
{
private:
  TreeLog& mTreeLog;
};

}
}

#endif /* MOZILLA_GFX_LOGGING_H_ */
# 628 "../../dist/include/mozilla/gfx/Logging.h"
# 15 "../../dist/include/FrameMetrics.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "gfxColor.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxColor.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_COLOR_H
#define GFX_COLOR_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
/* Functions for reading and writing integers in various endiannesses. */

/*
 * The classes LittleEndian and BigEndian expose static methods for
 * reading and writing 16-, 32-, and 64-bit signed and unsigned integers
 * in their respective endianness.  The naming scheme is:
 *
 * {Little,Big}Endian::{read,write}{Uint,Int}<bitsize>
 *
 * For instance, LittleEndian::readInt32 will read a 32-bit signed
 * integer from memory in little endian format.  Similarly,
 * BigEndian::writeUint16 will write a 16-bit unsigned integer to memory
 * in big-endian format.
 *
 * The class NativeEndian exposes methods for conversion of existing
 * data to and from the native endianness.  These methods are intended
 * for cases where data needs to be transferred, serialized, etc.
 * swap{To,From}{Little,Big}Endian byteswap a single value if necessary.
 * Bulk conversion functions are also provided which optimize the
 * no-conversion-needed case:
 *
 *   }
 *   ...
 * };
 */

#ifndef mozilla_Endian_h
#define mozilla_Endian_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 72 "../../dist/include/mozilla/Endian.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 74 "../../dist/include/mozilla/Endian.h"
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 75 "../../dist/include/mozilla/Endian.h"

#if defined(_MSC_VER)
#if 0 /* expanded by -frewrite-includes */
#  include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 78 "../../dist/include/mozilla/Endian.h"
#  pragma intrinsic(_byteswap_ushort)
#  pragma intrinsic(_byteswap_ulong)
#  pragma intrinsic(_byteswap_uint64)
#  define MOZ_BIG_ENDIAN 1
#elif defined(__i386) || defined(__i386__) || \
      defined(__x86_64) || defined(__x86_64__) || \
      defined(_MIPSEL) || defined(__ARMEL__) || \
      defined(__alpha__) || defined(__AARCH64EL__) || \
      (defined(__sh__) && defined(__BIG_ENDIAN__)) || \
      (defined(__ia64) && !defined(__BIG_ENDIAN__))
# 135 "../../dist/include/mozilla/Endian.h"
#  define MOZ_LITTLE_ENDIAN 1
#endif
# 137 "../../dist/include/mozilla/Endian.h"

#if MOZ_BIG_ENDIAN
# 151 "../../dist/include/mozilla/Endian.h"
#  if MOZ_GCC_VERSION_AT_LEAST(4, 8, 0)
#    define MOZ_HAVE_BUILTIN_BYTESWAP16 __builtin_bswap16
#  endif
# 154 "../../dist/include/mozilla/Endian.h"
#elif defined(_MSC_VER)
# 155 "../../dist/include/mozilla/Endian.h"
#    define MOZ_HAVE_BUILTIN_BYTESWAP16 _byteswap_ushort
#endif
# 157 "../../dist/include/mozilla/Endian.h"

namespace mozilla {

namespace detail {

/*
 * We need wrappers here because free functions with default template
 * arguments and/or partial specialization of function templates are not
 * supported by all the compilers we use.
 */
template<typename T, size_t Size = sizeof(T)>
struct Swapper;

template<typename T>
struct Swapper<T, 2>
{
  static T swap(T aValue)
  {
#if defined(MOZ_HAVE_BUILTIN_BYTESWAP16)
    return MOZ_HAVE_BUILTIN_BYTESWAP16(aValue);
#else
# 178 "../../dist/include/mozilla/Endian.h"
    return T(((aValue & 0x00ff) << 8) | ((aValue & 0xff00) >> 8));
#endif
# 180 "../../dist/include/mozilla/Endian.h"
  }
};

template<typename T>
struct Swapper<T, 4>
{
  static T swap(T aValue)
  {
#if defined(__clang__) || defined(__GNUC__)
    return T(__builtin_bswap32(aValue));
#elif defined(_MSC_VER)
# 191 "../../dist/include/mozilla/Endian.h"
    return T(_byteswap_ulong(aValue));
#else
# 193 "../../dist/include/mozilla/Endian.h"
    return T(((aValue & 0x000000ffU) << 24) |
             ((aValue & 0x0000ff00U) << 8) |
             ((aValue & 0x00ff0000U) >> 8) |
             ((aValue & 0xff000000U) >> 24));
#endif
# 198 "../../dist/include/mozilla/Endian.h"
  }
};

template<typename T>
struct Swapper<T, 8>
{
  static inline T swap(T aValue)
  {
# 220 "../../dist/include/mozilla/Endian.h"
  }
};

enum Endianness { Little, Big };

#if MOZ_BIG_ENDIAN
#  define MOZ_NATIVE_ENDIANNESS detail::Big
#else
# 228 "../../dist/include/mozilla/Endian.h"
#  define MOZ_NATIVE_ENDIANNESS detail::Little
#endif
# 230 "../../dist/include/mozilla/Endian.h"

class EndianUtils
{
  /**
   * Assert that the memory regions [aDest, aDest+aCount) and
   * [aSrc, aSrc+aCount] do not overlap.  aCount is given in bytes.
   */
  static void assertNoOverlap(const void* aDest, const void* aSrc,
                              size_t aCount)
  {
    DebugOnly<const uint8_t*> byteDestPtr = static_cast<const uint8_t*>(aDest);
    DebugOnly<const uint8_t*> byteSrcPtr = static_cast<const uint8_t*>(aSrc);
    MOZ_ASSERT((byteDestPtr <= byteSrcPtr &&
                byteDestPtr + aCount <= byteSrcPtr) ||
               (byteSrcPtr <= byteDestPtr &&
                byteSrcPtr + aCount <= byteDestPtr));
  }

  template<typename T>
  static void assertAligned(T* aPtr)
  {
    MOZ_ASSERT((uintptr_t(aPtr) % sizeof(T)) == 0, "Unaligned pointer!");
  }

protected:
  /**
   * Return |aValue| converted from SourceEndian encoding to DestEndian
   * encoding.
   */
  template<Endianness SourceEndian, Endianness DestEndian, typename T>
  static inline T maybeSwap(T aValue)
  {
    if (SourceEndian == DestEndian) {
      return aValue;
    }
    return Swapper<T>::swap(aValue);
  }

  /**
   * Convert |aCount| elements at |aPtr| from SourceEndian encoding to
   * DestEndian encoding.
   */
  template<Endianness SourceEndian, Endianness DestEndian, typename T>
  static inline void maybeSwapInPlace(T* aPtr, size_t aCount)
  {
    assertAligned(aPtr);

    if (SourceEndian == DestEndian) {
      return;
    }
    for (size_t i = 0; i < aCount; i++) {
      aPtr[i] = Swapper<T>::swap(aPtr[i]);
    }
  }

  /**
   * Write |aCount| elements to the unaligned address |aDest| in DestEndian
   * format, using elements found at |aSrc| in SourceEndian format.
   */
  template<Endianness SourceEndian, Endianness DestEndian, typename T>
  static void copyAndSwapTo(void* aDest, const T* aSrc, size_t aCount)
  {
    assertNoOverlap(aDest, aSrc, aCount * sizeof(T));
    assertAligned(aSrc);

    if (SourceEndian == DestEndian) {
      memcpy(aDest, aSrc, aCount * sizeof(T));
      return;
    }

    uint8_t* byteDestPtr = static_cast<uint8_t*>(aDest);
    for (size_t i = 0; i < aCount; ++i) {
      union
      {
        T mVal;
        uint8_t mBuffer[sizeof(T)];
      } u;
      u.mVal = maybeSwap<SourceEndian, DestEndian>(aSrc[i]);
      memcpy(byteDestPtr, u.mBuffer, sizeof(T));
      byteDestPtr += sizeof(T);
    }
  }

  /**
   * Write |aCount| elements to |aDest| in DestEndian format, using elements
   * found at the unaligned address |aSrc| in SourceEndian format.
   */
  template<Endianness SourceEndian, Endianness DestEndian, typename T>
  static void copyAndSwapFrom(T* aDest, const void* aSrc, size_t aCount)
  {
    assertNoOverlap(aDest, aSrc, aCount * sizeof(T));
    assertAligned(aDest);

    if (SourceEndian == DestEndian) {
      memcpy(aDest, aSrc, aCount * sizeof(T));
      return;
    }

    const uint8_t* byteSrcPtr = static_cast<const uint8_t*>(aSrc);
    for (size_t i = 0; i < aCount; ++i) {
      union
      {
        T mVal;
        uint8_t mBuffer[sizeof(T)];
      } u;
      memcpy(u.mBuffer, byteSrcPtr, sizeof(T));
      aDest[i] = maybeSwap<SourceEndian, DestEndian>(u.mVal);
      byteSrcPtr += sizeof(T);
    }
  }
};

template<Endianness ThisEndian>
class Endian : private EndianUtils
{
protected:
  /** Read a uint16_t in ThisEndian endianness from |aPtr| and return it. */
  static MOZ_WARN_UNUSED_RESULT uint16_t readUint16(const void* aPtr)
  {
    return read<uint16_t>(aPtr);
  }

  /** Read a uint32_t in ThisEndian endianness from |aPtr| and return it. */
  static MOZ_WARN_UNUSED_RESULT uint32_t readUint32(const void* aPtr)
  {
    return read<uint32_t>(aPtr);
  }

  /** Read a uint64_t in ThisEndian endianness from |aPtr| and return it. */
  static MOZ_WARN_UNUSED_RESULT uint64_t readUint64(const void* aPtr)
  {
    return read<uint64_t>(aPtr);
  }

  /** Read an int16_t in ThisEndian endianness from |aPtr| and return it. */
  static MOZ_WARN_UNUSED_RESULT int16_t readInt16(const void* aPtr)
  {
    return read<int16_t>(aPtr);
  }

  /** Read an int32_t in ThisEndian endianness from |aPtr| and return it. */
  static MOZ_WARN_UNUSED_RESULT int32_t readInt32(const void* aPtr)
  {
    return read<uint32_t>(aPtr);
  }

  /** Read an int64_t in ThisEndian endianness from |aPtr| and return it. */
  static MOZ_WARN_UNUSED_RESULT int64_t readInt64(const void* aPtr)
  {
    return read<int64_t>(aPtr);
  }

  /** Write |aValue| to |aPtr| using ThisEndian endianness. */
  static void writeUint16(void* aPtr, uint16_t aValue)
  {
    write(aPtr, aValue);
  }

  /** Write |aValue| to |aPtr| using ThisEndian endianness. */
  static void writeUint32(void* aPtr, uint32_t aValue)
  {
    write(aPtr, aValue);
  }

  /** Write |aValue| to |aPtr| using ThisEndian endianness. */
  static void writeUint64(void* aPtr, uint64_t aValue)
  {
    write(aPtr, aValue);
  }

  /** Write |aValue| to |aPtr| using ThisEndian endianness. */
  static void writeInt16(void* aPtr, int16_t aValue)
  {
    write(aPtr, aValue);
  }

  /** Write |aValue| to |aPtr| using ThisEndian endianness. */
  static void writeInt32(void* aPtr, int32_t aValue)
  {
    write(aPtr, aValue);
  }

  /** Write |aValue| to |aPtr| using ThisEndian endianness. */
  static void writeInt64(void* aPtr, int64_t aValue)
  {
    write(aPtr, aValue);
  }

  /*
   * Converts a value of type T to little-endian format.
   *
   * This function is intended for cases where you have data in your
   * native-endian format and you need it to appear in little-endian
   * format for transmission.
   */
  template<typename T>
  MOZ_WARN_UNUSED_RESULT static T swapToLittleEndian(T aValue)
  {
    return maybeSwap<ThisEndian, Little>(aValue);
  }

  /*
   * Copies |aCount| values of type T starting at |aSrc| to |aDest|, converting
   * them to little-endian format if ThisEndian is Big.
   * As with memcpy, |aDest| and |aSrc| must not overlap.
   */
  template<typename T>
  static void copyAndSwapToLittleEndian(void* aDest, const T* aSrc,
                                        size_t aCount)
  {
    copyAndSwapTo<ThisEndian, Little>(aDest, aSrc, aCount);
  }

  /*
   * Likewise, but converts values in place.
   */
  template<typename T>
  static void swapToLittleEndianInPlace(T* aPtr, size_t aCount)
  {
    maybeSwapInPlace<ThisEndian, Little>(aPtr, aCount);
  }

  /*
   * Converts a value of type T to big-endian format.
   */
  template<typename T>
  MOZ_WARN_UNUSED_RESULT static T swapToBigEndian(T aValue)
  {
    return maybeSwap<ThisEndian, Big>(aValue);
  }

  /*
   * Copies |aCount| values of type T starting at |aSrc| to |aDest|, converting
   * them to big-endian format if ThisEndian is Little.
   * As with memcpy, |aDest| and |aSrc| must not overlap.
   */
  template<typename T>
  static void copyAndSwapToBigEndian(void* aDest, const T* aSrc,
                                     size_t aCount)
  {
    copyAndSwapTo<ThisEndian, Big>(aDest, aSrc, aCount);
  }

  /*
   * Likewise, but converts values in place.
   */
  template<typename T>
  static void swapToBigEndianInPlace(T* aPtr, size_t aCount)
  {
    maybeSwapInPlace<ThisEndian, Big>(aPtr, aCount);
  }

  /*
   * Synonyms for the big-endian functions, for better readability
   * in network code.
   */

  template<typename T>
  MOZ_WARN_UNUSED_RESULT static T swapToNetworkOrder(T aValue)
  {
    return swapToBigEndian(aValue);
  }

  template<typename T>
  static void
  copyAndSwapToNetworkOrder(void* aDest, const T* aSrc, size_t aCount)
  {
    copyAndSwapToBigEndian(aDest, aSrc, aCount);
  }

  template<typename T>
  static void
  swapToNetworkOrderInPlace(T* aPtr, size_t aCount)
  {
    swapToBigEndianInPlace(aPtr, aCount);
  }

  /*
   * Converts a value of type T from little-endian format.
   */
  template<typename T>
  MOZ_WARN_UNUSED_RESULT static T swapFromLittleEndian(T aValue)
  {
    return maybeSwap<Little, ThisEndian>(aValue);
  }

  /*
   * Copies |aCount| values of type T starting at |aSrc| to |aDest|, converting
   * them to little-endian format if ThisEndian is Big.
   * As with memcpy, |aDest| and |aSrc| must not overlap.
   */
  template<typename T>
  static void copyAndSwapFromLittleEndian(T* aDest, const void* aSrc,
                                          size_t aCount)
  {
    copyAndSwapFrom<Little, ThisEndian>(aDest, aSrc, aCount);
  }

  /*
   * Likewise, but converts values in place.
   */
  template<typename T>
  static void swapFromLittleEndianInPlace(T* aPtr, size_t aCount)
  {
    maybeSwapInPlace<Little, ThisEndian>(aPtr, aCount);
  }

  /*
   * Converts a value of type T from big-endian format.
   */
  template<typename T>
  MOZ_WARN_UNUSED_RESULT static T swapFromBigEndian(T aValue)
  {
    return maybeSwap<Big, ThisEndian>(aValue);
  }

  /*
   * Copies |aCount| values of type T starting at |aSrc| to |aDest|, converting
   * them to big-endian format if ThisEndian is Little.
   * As with memcpy, |aDest| and |aSrc| must not overlap.
   */
  template<typename T>
  static void copyAndSwapFromBigEndian(T* aDest, const void* aSrc,
                                       size_t aCount)
  {
    copyAndSwapFrom<Big, ThisEndian>(aDest, aSrc, aCount);
  }

  /*
   * Likewise, but converts values in place.
   */
  template<typename T>
  static void swapFromBigEndianInPlace(T* aPtr, size_t aCount)
  {
    maybeSwapInPlace<Big, ThisEndian>(aPtr, aCount);
  }

  /*
   * Synonyms for the big-endian functions, for better readability
   * in network code.
   */
  template<typename T>
  MOZ_WARN_UNUSED_RESULT static T swapFromNetworkOrder(T aValue)
  {
    return swapFromBigEndian(aValue);
  }

  template<typename T>
  static void copyAndSwapFromNetworkOrder(T* aDest, const void* aSrc,
                                          size_t aCount)
  {
    copyAndSwapFromBigEndian(aDest, aSrc, aCount);
  }

  template<typename T>
  static void swapFromNetworkOrderInPlace(T* aPtr, size_t aCount)
  {
    swapFromBigEndianInPlace(aPtr, aCount);
  }

private:
  /**
   * Read a value of type T, encoded in endianness ThisEndian from |aPtr|.
   * Return that value encoded in native endianness.
   */
  template<typename T>
  static T read(const void* aPtr)
  {
    union
    {
      T mVal;
      uint8_t mBuffer[sizeof(T)];
    } u;
    memcpy(u.mBuffer, aPtr, sizeof(T));
    return maybeSwap<ThisEndian, MOZ_NATIVE_ENDIANNESS>(u.mVal);
  }

  /**
   * Write a value of type T, in native endianness, to |aPtr|, in ThisEndian
   * endianness.
   */
  template<typename T>
  static void write(void* aPtr, T aValue)
  {
    T tmp = maybeSwap<MOZ_NATIVE_ENDIANNESS, ThisEndian>(aValue);
    memcpy(aPtr, &tmp, sizeof(T));
  }

  Endian() = delete;
  Endian(const Endian& aTther) = delete;
  void operator=(const Endian& aOther) = delete;
};

template<Endianness ThisEndian>
class EndianReadWrite : public Endian<ThisEndian>
{
private:
  typedef Endian<ThisEndian> super;

public:
  using super::readUint16;
  using super::readUint32;
  using super::readUint64;
  using super::readInt16;
  using super::readInt32;
  using super::readInt64;
  using super::writeUint16;
  using super::writeUint32;
  using super::writeUint64;
  using super::writeInt16;
  using super::writeInt32;
  using super::writeInt64;
};

} /* namespace detail */

class LittleEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Little>
{};

class BigEndian MOZ_FINAL : public detail::EndianReadWrite<detail::Big>
{};

typedef BigEndian NetworkEndian;

class NativeEndian MOZ_FINAL : public detail::Endian<MOZ_NATIVE_ENDIANNESS>
{
private:
  typedef detail::Endian<MOZ_NATIVE_ENDIANNESS> super;

public:
  /*
   * These functions are intended for cases where you have data in your
   * native-endian format and you need the data to appear in the appropriate
   * endianness for transmission, serialization, etc.
   */
  using super::copyAndSwapFromLittleEndian;
  using super::swapFromLittleEndianInPlace;
  using super::swapFromBigEndian;
  using super::copyAndSwapFromBigEndian;
  using super::swapFromBigEndianInPlace;
  using super::swapFromNetworkOrder;
  using super::copyAndSwapFromNetworkOrder;
  using super::swapFromNetworkOrderInPlace;
};

#undef MOZ_NATIVE_ENDIANNESS

} /* namespace mozilla */

#endif /* mozilla_Endian_h */
# 696 "../../dist/include/mozilla/Endian.h"

#define GFX_0XFF_PPIXEL_FROM_BPTR(x) \
     ( GFX_0XFF_PPIXEL_FROM_UINT32(GFX_UINT32_FROM_BPTR((x),0)) )

/**
        return gfxPackedPixelNoPreMultiply(a, r, g, b);
    } else {
        return  ((a) << 24) |
                (gfxPreMultiply(r,a) << 16) |
                (gfxPreMultiply(g,a) << 8)  |
                (gfxPreMultiply(b,a));
    }
}

/**
 * A color value, storing red, green, blue and alpha components.
 * This class does not use premultiplied alpha.
 *
 * XXX should this use doubles (instead of gfxFloat), for consistency with
 * cairo?
 */
struct gfxRGBA {
    gfxFloat r, g, b, a;

    enum PackedColorType {
        PACKED_ABGR,
        PACKED_ABGR_PREMULTIPLIED,

        PACKED_ARGB,
        PACKED_ARGB_PREMULTIPLIED,

        PACKED_XRGB
    };

    gfxRGBA() { }
    /**
     * Intialize this color using explicit red, green, blue and alpha
     * values.
     */
    MOZ_CONSTEXPR gfxRGBA(gfxFloat _r, gfxFloat _g, gfxFloat _b, gfxFloat _a=1.0) : r(_r), g(_g), b(_b), a(_a) {}

    /**
     * Initialize this color from a packed 32-bit color.
     * The color value is interpreted based on colorType;
     * all values use the native platform endianness.
     *
     * Resulting gfxRGBA stores non-premultiplied data.
     *
     * @see gfxRGBA::Packed
     */
    MOZ_IMPLICIT gfxRGBA(uint32_t c, PackedColorType colorType = PACKED_ABGR) {
        if (colorType == PACKED_ABGR ||
            colorType == PACKED_ABGR_PREMULTIPLIED)
        {
            r = ((c >> 0) & 0xff) * (1.0 / 255.0);
            g = ((c >> 8) & 0xff) * (1.0 / 255.0);
            b = ((c >> 16) & 0xff) * (1.0 / 255.0);
            a = ((c >> 24) & 0xff) * (1.0 / 255.0);
        } else if (colorType == PACKED_ARGB ||
                   colorType == PACKED_XRGB ||
                   colorType == PACKED_ARGB_PREMULTIPLIED)
        {
            b = ((c >> 0) & 0xff) * (1.0 / 255.0);
            g = ((c >> 8) & 0xff) * (1.0 / 255.0);
            r = ((c >> 16) & 0xff) * (1.0 / 255.0);
            a = ((c >> 24) & 0xff) * (1.0 / 255.0);
        }

        if (colorType == PACKED_ABGR_PREMULTIPLIED ||
            colorType == PACKED_ARGB_PREMULTIPLIED)
        {
            if (a > 0.0) {
                r /= a;
                g /= a;
                b /= a;
            }
        } else if (colorType == PACKED_XRGB) {
            a = 1.0;
        }
    }

    bool operator==(const gfxRGBA& other) const
    {
        return r == other.r && g == other.g && b == other.b && a == other.a;
    }
    bool operator!=(const gfxRGBA& other) const
    {
        return !(*this == other);
    }

    /**
     * Returns this color value as a packed 32-bit integer. This reconstructs
     * the int32_t based on the given colorType, always in the native byte order.
     *
     * Note: gcc 4.2.3 on at least Ubuntu (x86) does something strange with
     * (uint8_t)(c * 255.0) << x, where the result is different than
     * double d = c * 255.0; v = ((uint8_t) d) << x. 
     */
    uint32_t Packed(PackedColorType colorType = PACKED_ABGR) const {
        gfxFloat rb = (r * 255.0);
        gfxFloat gb = (g * 255.0);
        gfxFloat bb = (b * 255.0);
        gfxFloat ab = (a * 255.0);

        if (colorType == PACKED_ABGR) {
            return (uint8_t(ab) << 24) |
                   (uint8_t(bb) << 16) |
                   (uint8_t(gb) << 8) |
                   (uint8_t(rb) << 0);
        }
        if (colorType == PACKED_ARGB || colorType == PACKED_XRGB) {
            return (uint8_t(ab) << 24) |
                   (uint8_t(rb) << 16) |
                   (uint8_t(gb) << 8) |
                   (uint8_t(bb) << 0);
        }

        rb *= a;
        gb *= a;
        bb *= a;

        if (colorType == PACKED_ABGR_PREMULTIPLIED) {
            return (((uint8_t)(ab) << 24) |
                    ((uint8_t)(bb) << 16) |
                    ((uint8_t)(gb) << 8) |
                    ((uint8_t)(rb) << 0));
        }
        if (colorType == PACKED_ARGB_PREMULTIPLIED) {
            return (((uint8_t)(ab) << 24) |
                    ((uint8_t)(rb) << 16) |
                    ((uint8_t)(gb) << 8) |
                    ((uint8_t)(bb) << 0));
        }

        return 0;
    }
};

#endif /* _GFX_COLOR_H */
# 228 "../../dist/include/gfxColor.h"
# 16 "../../dist/include/FrameMetrics.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/FrameMetrics.h"

namespace IPC {
template <typename T> struct ParamTraits;
} // namespace IPC

namespace mozilla {
namespace layers {

/**
 * The viewport and displayport metrics for the painted frame at the
 * time of a layer-tree transaction.  These metrics are especially
 * useful for shadow layers, because the metrics values are updated
 * atomically with new pixels.
 */
struct FrameMetrics {
  friend struct IPC::ParamTraits<mozilla::layers::FrameMetrics>;
public:
  // We use IDs to identify frames across processes.
  typedef uint64_t ViewID;
  static const ViewID NULL_SCROLL_ID;   // This container layer does not scroll.
  static const ViewID START_SCROLL_ID = 2;  // This is the ID that scrolling subframes
                                        // will begin at.
  static const FrameMetrics sNullMetrics;   // We often need an empty metrics

  FrameMetrics()
    : mCompositionBounds(0, 0, 0, 0)
    , mPresShellResolution(1)
    , mDisplayPort(0, 0, 0, 0)
    , mCriticalDisplayPort(0, 0, 0, 0)
    , mScrollableRect(0, 0, 0, 0)
    , mCumulativeResolution(1)
    , mDevPixelsPerCSSPixel(1)
    , mMayHaveTouchListeners(false)
    , mMayHaveTouchCaret(false)
    , mIsRoot(false)
    , mHasScrollgrab(false)
    , mScrollId(NULL_SCROLL_ID)
    , mScrollParentId(NULL_SCROLL_ID)
    , mScrollOffset(0, 0)
    , mZoom(1)
    , mUpdateScrollOffset(false)
    , mScrollGeneration(0)
    , mDoSmoothScroll(false)
    , mSmoothScrollOffset(0, 0)
    , mRootCompositionSize(0, 0)
    , mDisplayPortMargins(0, 0, 0, 0)
    , mUseDisplayPortMargins(false)
    , mPresShellId(-1)
    , mViewport(0, 0, 0, 0)
    , mExtraResolution(1)
    , mBackgroundColor(0, 0, 0, 0)
    , mLineScrollAmount(0, 0)
    , mAllowVerticalScrollWithWheel(false)
  {
  }

  // Default copy ctor and operator= are fine

  bool operator==(const FrameMetrics& aOther) const
  {
    return mCompositionBounds.IsEqualEdges(aOther.mCompositionBounds) &&
           mRootCompositionSize == aOther.mRootCompositionSize &&
           mDisplayPort.IsEqualEdges(aOther.mDisplayPort) &&
           mHasScrollgrab == aOther.mHasScrollgrab &&
           mUpdateScrollOffset == aOther.mUpdateScrollOffset &&
           mScrollGeneration == aOther.mScrollGeneration &&
           mExtraResolution == aOther.mExtraResolution &&
           mBackgroundColor == aOther.mBackgroundColor &&
           mDoSmoothScroll == aOther.mDoSmoothScroll &&
           mLineScrollAmount == aOther.mLineScrollAmount &&
           mAllowVerticalScrollWithWheel == aOther.mAllowVerticalScrollWithWheel;
  }
  bool operator!=(const FrameMetrics& aOther) const
  {
    return !operator==(aOther);
  }

  

  // same coordinate space as the reference frame for the scrolled frame.
  //
  // This is useful because, on mobile, the viewport and composition dimensions
  // are not always the same. In this case, we calculate the displayport using
  // an area bigger than the region we're compositing to. If we used the
  // viewport dimensions to calculate the displayport, we'd run into situations
  // where we're prerendering the wrong regions and the content may be clipped,
  // or too much of it prerendered. If the composition dimensions are the same as the
  // viewport dimensions, there is no need for this and we can just use the viewport
  // instead.
  //
  // This value is valid for nested scrollable layers as well, and is still
  // relative to the layer tree origin. This value is provided by Gecko at
  // layout/paint time.
  ParentLayerRect mCompositionBounds;

  

  

  

private:

  // The pres-shell resolution that has been induced on the document containing
  // this scroll frame as a result of zooming this scroll frame (whether via
  // user action, or choosing an initial zoom level on page load). This can
  // only be different from 1.0 for frames that are zoomable, which currently
  // is just the root content document's root scroll frame (mIsRoot = true).
  // This is a plain float rather than a ScaleFactor because in and of itself
  // it does not convert between any coordinate spaces for which we have names.
  float mPresShellResolution;

  // The area of a frame's contents that has been painted, relative to
  // mCompositionBounds.
  //
  // Note that this is structured in such a way that it doesn't depend on the
  // method layout uses to scroll content.
  //
  // May be larger or smaller than |mScrollableRect|.
  //
  // To pre-render a margin of 100 CSS pixels around the window,
  // { x = -100, y = - 100,
  //   width = window.innerWidth + 200, height = window.innerHeight + 200 }
  CSSRect mDisplayPort;

  // If non-empty, the area of a frame's contents that is considered critical
  // to paint. Area outside of this area (i.e. area inside mDisplayPort, but
  // outside of mCriticalDisplayPort) is considered low-priority, and may be
  // painted with lower precision, or not painted at all.
  //
  // The same restrictions for mDisplayPort apply here.
  CSSRect mCriticalDisplayPort;

  // The scrollable bounds of a frame. This is determined by reflow.
  // Ordinarily the x and y will be 0 and the width and height will be the
  // size of the element being scrolled. However for RTL pages or elements
  // the x value may be negative.
  //
  // This is relative to the document. It is in the same coordinate space as
  // |mScrollOffset|, but a different coordinate space than |mViewport| and
  // |mDisplayPort|. Note also that this coordinate system is understood by
  // window.scrollTo().
  //
  // This is valid on any layer unless it has no content.
  CSSRect mScrollableRect;

  // The cumulative resolution that the current frame has been painted at.
  // This is the product of the pres-shell resolutions of the document
  // containing this scroll frame and its ancestors, and any css-driven
  // resolution. This information is provided by Gecko at layout/paint time.
  LayoutDeviceToLayerScale mCumulativeResolution;

  // New fields from now on should be made private and old fields should
  // be refactored to be private.

  // The conversion factor between CSS pixels and device pixels for this frame.
  // This can vary based on a variety of things, such as reflowing-zoom. The
  // conversion factor for device pixels to layers pixels is just the
  // resolution.
  CSSToLayoutDeviceScale mDevPixelsPerCSSPixel;

  // Whether or not this frame may have touch or scroll wheel listeners.
  bool mMayHaveTouchListeners;

  // Whether or not this frame may have a touch caret.
  bool mMayHaveTouchCaret;

  // Whether or not this is the root scroll frame for the root content document.
  bool mIsRoot;

  // Whether or not this frame is for an element marked 'scrollgrab'.
  bool mHasScrollgrab;

  // A unique ID assigned to each scrollable frame.
  ViewID mScrollId;

  // The ViewID of the scrollable frame to which overscroll should be handed off.
  ViewID mScrollParentId;

  // The position of the top-left of the CSS viewport, relative to the document
  // (or the document relative to the viewport, if that helps understand it).
  //
  // Thus it is relative to the document. It is in the same coordinate space as
  // |mScrollableRect|, but a different coordinate space than |mViewport| and
  // |mDisplayPort|.
  //
  // It is required that the rect:
  // { x = mScrollOffset.x, y = mScrollOffset.y,
  //   width = mCompositionBounds.x / mResolution.scale,
  //   height = mCompositionBounds.y / mResolution.scale }
  // Be within |mScrollableRect|.
  //
  // This is valid for any layer, but is always relative to this frame and
  // not any parents, regardless of parent transforms.
  CSSPoint mScrollOffset;

  // The "user zoom". Content is painted by gecko at mResolution * mDevPixelsPerCSSPixel,
  // but will be drawn to the screen at mZoom. In the steady state, the
  // two will be the same, but during an async zoom action the two may
  // diverge. This information is initialized in Gecko but updated in the APZC.
  CSSToParentLayerScale mZoom;

  // Whether mScrollOffset was updated by something other than the APZ code, and
  // if the APZC receiving this metrics should update its local copy.
  bool mUpdateScrollOffset;
  // The scroll generation counter used to acknowledge the scroll offset update.
  uint32_t mScrollGeneration;

  // When mDoSmoothScroll, the scroll offset should be animated to
  // smoothly transition to mScrollOffset rather than be updated instantly.
  bool mDoSmoothScroll;
  CSSPoint mSmoothScrollOffset;

  // The size of the root scrollable's composition bounds, but in local CSS pixels.
  CSSSize mRootCompositionSize;

  // A display port expressed as layer margins that apply to the rect of what
  // is drawn of the scrollable element.
  ScreenMargin mDisplayPortMargins;

  // If this is true then we use the display port margins on this metrics,
  // otherwise use the display port rect.
  bool mUseDisplayPortMargins;

  uint32_t mPresShellId;

  // The CSS viewport, which is the dimensions we're using to constrain the
  // <html> element of this frame, relative to the top-left of the layer. Note
  // that its offset is structured in such a way that it doesn't depend on the
  // method layout uses to scroll content.
  //
  // This is mainly useful on the root layer, however nested iframes can have
  // their own viewport, which will just be the size of the window of the
  // iframe. For layers that don't correspond to a document, this metric is
  // meaningless and invalid.
  CSSRect mViewport;

  // The extra resolution at which content in this scroll frame is drawn beyond
  // that necessary to draw one Layer pixel per Screen pixel.
  ScreenToLayerScale mExtraResolution;

  // The background color to use when overscrolling.
  gfxRGBA mBackgroundColor;

  // A description of the content element corresponding to this frame.
  // This is empty unless this is a scrollable layer and the
  // apz.printtree pref is turned on.
  nsCString mContentDescription;

  // The value of GetLineScrollAmount(), for scroll frames.
  LayoutDeviceIntSize mLineScrollAmount;

  // Whether or not the frame can be vertically scrolled with a mouse wheel.
  bool mAllowVerticalScrollWithWheel;
};

/**
 * This class allows us to uniquely identify a scrollable layer. The
 * mLayersId identifies the layer tree (corresponding to a child process
 * and/or tab) that the scrollable layer belongs to. The mPresShellId
 * is a temporal identifier (corresponding to the document loaded that
 * contains the scrollable layer, which may change over time). The
 * mScrollId corresponds to the actual frame that is scrollable.
 */
struct ScrollableLayerGuid {
  uint64_t mLayersId;
  uint32_t mPresShellId;
  FrameMetrics::ViewID mScrollId;

  

  

  

  

  

  

  

  
};

template <int LogLevel>
gfx::Log<LogLevel>& operator<<(gfx::Log<LogLevel>& log, const ScrollableLayerGuid& aGuid) {
  return log << '(' << aGuid.mLayersId << ',' << aGuid.mPresShellId << ',' << aGuid.mScrollId << ')';
}

struct ZoomConstraints {
  bool mAllowZoom;
  bool mAllowDoubleTapZoom;
  CSSToParentLayerScale mMinZoom;
  CSSToParentLayerScale mMaxZoom;

  

  

  

  

  

  
};

}
}

#endif /* GFX_FRAMEMETRICS_H */
# 827 "../../dist/include/FrameMetrics.h"
# 19 "/Users/luser/build/mozilla-central/layout/generic/nsIScrollableFrame.h" 2

#define NS_DEFAULT_VERTICAL_SCROLL_DISTANCE   3
#define NS_DEFAULT_HORIZONTAL_SCROLL_DISTANCE 5

class nsBoxLayoutState;
class nsIScrollPositionListener;
class nsIFrame;
class nsPresContext;
class nsIContent;
class nsRenderingContext;
class nsIAtom;
class nsDisplayListBuilder;

namespace mozilla {
struct ContainerLayerParameters;
namespace layers {
class Layer;
}
}

/**
 * Interface for frames that are scrollable. This interface exposes
 * APIs for examining scroll state, observing changes to scroll state,
 * and triggering scrolling.
 */
class nsIScrollableFrame : public nsIScrollbarMediator {
public:
  typedef mozilla::CSSIntPoint CSSIntPoint;
  typedef mozilla::ContainerLayerParameters ContainerLayerParameters;
  typedef mozilla::layers::FrameMetrics FrameMetrics;

  NS_DECL_QUERYFRAME_TARGET(nsIScrollableFrame)

  /**
   * Get the frame for the content that we are scrolling within
  /**
   * Get the area that must contain the scroll position. Typically
   * (but not always, e.g. for RTL content) x and y will be 0, and
   * width or height will be nonzero if the content can be scrolled in
   * that direction. Since scroll positions must be a multiple of
   * device pixels, the range extrema will also be a multiple of
   * device pixels.
   */
  virtual nsRect GetScrollRange() const = 0;
  /**
   * Get the size of the scroll port to use when clamping the scroll
   * position.
   */
  ;
  /**
   * Get the element resolution.
  ;
  /**
   * aLayer's animated geometry root is this frame. If there needs to be a
   * FrameMetrics contributed by this frame, append it to aOutput.
   */
  ;

  /**
   * If this scroll frame is ignoring viewporting clipping
   */
  ;

  /**
   * Mark the scrollbar frames for reflow.
   */
  ;

  virtual void SetTransformingByAPZ(bool aTransforming) = 0;
  virtual bool IsTransformingByAPZ() const = 0;
};

#endif
# 443 "/Users/luser/build/mozilla-central/layout/generic/nsIScrollableFrame.h"
# 30 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Attr.h"
#endif /* expanded by -frewrite-includes */
# 31 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISMILAttr.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISMILAttr.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NS_ISMILATTR_H_
#define NS_ISMILATTR_H_

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsISMILAttr.h"

class nsSMILValue;
class nsISMILType;
class nsIContent;
class nsAString;

namespace mozilla {
namespace dom {
class SVGAnimationElement;
}
}

////////////////////////////////////////////////////////////////////////
// nsISMILAttr: A variable targeted by SMIL for animation and can therefore have
// an underlying (base) value and an animated value For example, an attribute of
// a particular SVG element.
//
// These objects only exist during the compositing phase of SMIL animation
// calculations. They have a single owner who is responsible for deleting the
// object.

class nsISMILAttr
{
public:
  /**
   * Creates a new nsSMILValue for this attribute from a string. The string is
   * parsed in the context of this attribute so that context-dependent values
   * such as em-based units can be resolved into a canonical form suitable for
   * animation (including interpolation etc.).
   *
   * @param aStr        A string defining the new value to be created.
   * @param aSrcElement The source animation element. This may be needed to
   *                    provided additional context data such as for
   *                    animateTransform where the 'type' attribute is needed to
   *                    parse the value.
   * @param[out] aValue Outparam for storing the parsed value.
   * @param[out] aPreventCachingOfSandwich
   *                    Outparam to indicate whether the attribute contains
   *                    dependencies on its context that should prevent the
   *                    result of the animation sandwich from being cached and
   *                    reused in future samples.
   * @return NS_OK on success or an error code if creation failed.
   */
  virtual nsresult ValueFromString(const nsAString& aStr,
                                   const mozilla::dom::SVGAnimationElement* aSrcElement,
                                   nsSMILValue& aValue,
                                   bool& aPreventCachingOfSandwich) const = 0;

  /**
   * Gets the underlying value of this attribute.
   *
   * @return an nsSMILValue object. returned_object.IsNull() will be true if an
   * error occurred.
   */
  virtual nsSMILValue GetBaseValue() const = 0;

  /**
   * Clears the animated value of this attribute.
   *
   * NOTE: The animation target is not guaranteed to be in a document when this
   * method is called. (See bug 523188)
   */
  virtual void ClearAnimValue() = 0;

  /**
   * Sets the presentation value of this attribute.
   *
   * @param aValue  The value to set.
   * @return NS_OK on success or an error code if setting failed.
   */
  virtual nsresult SetAnimValue(const nsSMILValue& aValue) = 0;

  /**
   * Returns the targeted content node, for any nsISMILAttr implementations
   * that want to expose that to the animation logic.  Otherwise, returns
   * null.
   *
   * @return the targeted content node, if this nsISMILAttr implementation
   * wishes to make it avaiable.  Otherwise, nullptr.
   */
  virtual const nsIContent* GetTargetNode() const { return nullptr; }

  /**
   * Virtual destructor, to make sure subclasses can clean themselves up.
   */
  virtual ~nsISMILAttr() {}
};

#endif // NS_ISMILATTR_H_
# 99 "../../dist/include/nsISMILAttr.h"
# 32 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMRect.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/DOMRect.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_DOMRECT_H_
#define MOZILLA_DOMRECT_H_

#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMClientRect.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMClientRect.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMClientRect.idl
 */

#ifndef __gen_nsIDOMClientRect_h__
#define __gen_nsIDOMClientRect_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMClientRect.h"
#endif
# 12 "../../dist/include/nsIDOMClientRect.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMClientRect.h"

/* starting interface:    nsIDOMClientRect */
#define NS_IDOMCLIENTRECT_IID_STR "b2f824c4-d9d3-499b-8d3b-45c8245497c6"

#define NS_IDOMCLIENTRECT_IID \
  {0xb2f824c4, 0xd9d3, 0x499b, \
    { 0x8d, 0x3b, 0x45, 0xc8, 0x24, 0x54, 0x97, 0xc6 }}

class NS_NO_VTABLE nsIDOMClientRect : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMCLIENTRECT_IID)

  /* readonly attribute float left; */
  NS_IMETHOD GetLeft(float *aLeft) = 0;

  /* readonly attribute float top; */
  NS_IMETHOD GetTop(float *aTop) = 0;

  /* readonly attribute float right; */
  NS_IMETHOD GetRight(float *aRight) = 0;

  /* readonly attribute float bottom; */
  NS_IMETHOD GetBottom(float *aBottom) = 0;

  /* readonly attribute float width; */
  NS_IMETHOD GetWidth(float *aWidth) = 0;

  /* readonly attribute float height; */
  NS_IMETHOD GetHeight(float *aHeight) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMClientRect, NS_IDOMCLIENTRECT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMCLIENTRECT \
  NS_IMETHOD GetLeft(float *aLeft) MOZ_OVERRIDE; \
  NS_IMETHOD GetTop(float *aTop) MOZ_OVERRIDE; \
  NS_IMETHOD GetRight(float *aRight) MOZ_OVERRIDE; \
  NS_IMETHOD GetBottom(float *aBottom) MOZ_OVERRIDE; \
  NS_IMETHOD GetWidth(float *aWidth) MOZ_OVERRIDE; \
  NS_IMETHOD GetHeight(float *aHeight) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMCLIENTRECT(_to) \
  NS_IMETHOD GetLeft(float *aLeft) MOZ_OVERRIDE { return _to GetLeft(aLeft); } \
  NS_IMETHOD GetTop(float *aTop) MOZ_OVERRIDE { return _to GetTop(aTop); } \
  NS_IMETHOD GetRight(float *aRight) MOZ_OVERRIDE { return _to GetRight(aRight); } \
  NS_IMETHOD GetBottom(float *aBottom) MOZ_OVERRIDE { return _to GetBottom(aBottom); } \
  NS_IMETHOD GetWidth(float *aWidth) MOZ_OVERRIDE { return _to GetWidth(aWidth); } \
  NS_IMETHOD GetHeight(float *aHeight) MOZ_OVERRIDE { return _to GetHeight(aHeight); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMCLIENTRECT(_to) \
  NS_IMETHOD GetLeft(float *aLeft) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLeft(aLeft); } \
  NS_IMETHOD GetTop(float *aTop) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTop(aTop); } \
  NS_IMETHOD GetRight(float *aRight) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRight(aRight); } \
  NS_IMETHOD GetBottom(float *aBottom) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBottom(aBottom); } \
  NS_IMETHOD GetWidth(float *aWidth) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWidth(aWidth); } \
  NS_IMETHOD GetHeight(float *aHeight) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHeight(aHeight); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMClientRect : public nsIDOMClientRect
{
#endif
# 17 "../../dist/include/nsIDOMClientRectList.h"

/* starting interface:    nsIDOMClientRectList */
#define NS_IDOMCLIENTRECTLIST_IID_STR "f474c567-cbcb-458f-abad-ae42363da287"

#define NS_IDOMCLIENTRECTLIST_IID \
  {0xf474c567, 0xcbcb, 0x458f, \
    { 0xab, 0xad, 0xae, 0x42, 0x36, 0x3d, 0xa2, 0x87 }}

class NS_NO_VTABLE nsIDOMClientRectList : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMCLIENTRECTLIST_IID)

  /* readonly attribute unsigned long length; */
  NS_IMETHOD GetLength(uint32_t *aLength) = 0;

  /* nsIDOMClientRect item (in unsigned long index); */
  NS_IMETHOD Item(uint32_t index, nsIDOMClientRect * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMClientRectList, NS_IDOMCLIENTRECTLIST_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMCLIENTRECTLIST \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE; \
  NS_IMETHOD Item(uint32_t index, nsIDOMClientRect * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMCLIENTRECTLIST(_to) \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return _to GetLength(aLength); } \
  NS_IMETHOD Item(uint32_t index, nsIDOMClientRect * *_retval) MOZ_OVERRIDE { return _to Item(index, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMCLIENTRECTLIST(_to) \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLength(aLength); } \
  NS_IMETHOD Item(uint32_t index, nsIDOMClientRect * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Item(index, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMClientRectList : public nsIDOMClientRectList
{
public:
  NS_DECL_ISUPPORTS
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 101 "../../dist/include/nsIDOMClientRectList.h"


#endif /* __gen_nsIDOMClientRectList_h__ */
# 104 "../../dist/include/nsIDOMClientRectList.h"
# 11 "../../dist/include/mozilla/dom/DOMRect.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/DOMRect.h"

struct nsRect;

namespace mozilla {
namespace dom {

class DOMRectReadOnly : public nsISupports
                      , public nsWrapperCache
{
protected:
  virtual ~DOMRectReadOnly() {}

public:
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectReadOnly)

  explicit DOMRectReadOnly(nsISupports* aParent)
    : mParent(aParent)
  {
  }

  nsISupports* GetParentObject() const
  {
    MOZ_ASSERT(mParent);
    return mParent;
  }
  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

  virtual double X() const = 0;
  virtual double Y() const = 0;
  virtual double Width() const = 0;
  virtual double Height() const = 0;

  double Left() const
  {
    double x = X(), w = Width();
    return std::min(x, x + w);
  }
  
  
  

protected:
  nsCOMPtr<nsISupports> mParent;
};

class DOMRect MOZ_FINAL : public DOMRectReadOnly
                        , public nsIDOMClientRect
{
public:
  
  
  NS_DECL_ISUPPORTS_INHERITED
  NS_DECL_NSIDOMCLIENTRECT

  ;
  ;

  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

  
  ;

  
  
  
  

  
  
  
  

protected:
  double mX, mY, mWidth, mHeight;

private:
  ;
};

class DOMRectList MOZ_FINAL : public nsIDOMClientRectList,
                              public nsWrapperCache
{
  

public:
  

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectList)

  NS_DECL_NSIDOMCLIENTRECTLIST
  
  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;

  

  

  

  
  
  

protected:
  nsTArray<nsRefPtr<DOMRect> > mArray;
  nsCOMPtr<nsISupports> mParent;
};

}

}

#endif /*MOZILLA_DOMRECT_H_*/
# 217 "../../dist/include/mozilla/dom/DOMRect.h"
# 33 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAttrValue.h"
#endif /* expanded by -frewrite-includes */
# 34 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"
#endif /* expanded by -frewrite-includes */
# 35 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 36 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/WindowBinding.h"
#endif /* expanded by -frewrite-includes */
# 37 "../../dist/include/mozilla/dom/Element.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ElementBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/ElementBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_ElementBinding_h
#define mozilla_dom_ElementBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "WindowBinding.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/ElementBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/ElementBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/VRDevice.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/VRDevice.h" 1
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_VRDevice_h_
/* vim: set ts=2 sw=2 et tw=79: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_TypedArray_h
#define mozilla_dom_TypedArray_h

#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/TypedArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "jsfriendapi.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/TypedArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/TypedArray.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/dom/TypedArray.h"

namespace mozilla {
namespace dom {

/*
 * Class that just handles the JSObject storage and tracing for typed arrays
 */
struct TypedArrayObjectStorage : AllTypedArraysBase {
protected:
  JSObject* mTypedObj;
  JSObject* mWrappedObj;

  TypedArrayObjectStorage()
    : mTypedObj(nullptr),
      mWrappedObj(nullptr)
  {
  }

  

public:
  inline void TraceSelf(JSTracer* trc)
  {
    if (mTypedObj) {
      JS_CallUnbarrieredObjectTracer(trc, &mTypedObj, "TypedArray.mTypedObj");
    }
    if (mWrappedObj) {
      JS_CallUnbarrieredObjectTracer(trc, &mTypedObj, "TypedArray.mWrappedObj");
    }
  }

private:
  TypedArrayObjectStorage(const TypedArrayObjectStorage&) = delete;
};

/*
 * Various typed array classes for argument conversion.  We have a base class
 * that has a way of initializing a TypedArray from an existing typed array, and
 * a subclass of the base class that supports creation of a relevant typed array
 * or array buffer object.
 */
template<typename T,
         JSObject* UnwrapArray(JSObject*),
         void GetLengthAndData(JSObject*, uint32_t*, T**)>
struct TypedArray_base : public TypedArrayObjectStorage {
  typedef T element_type;

  TypedArray_base()
    : mData(nullptr),
      mLength(0),
      mComputed(false)
  {
  }

  explicit TypedArray_base(TypedArray_base&& aOther)
    : TypedArrayObjectStorage(Move(aOther)),
      mData(aOther.mData),
      mLength(aOther.mLength),
      mComputed(aOther.mComputed)
  {
    aOther.mData = nullptr;
    aOther.mLength = 0;
    aOther.mComputed = false;
  }

private:
  mutable T* mData;
  mutable uint32_t mLength;
  mutable bool mComputed;

public:
  inline bool Init(JSObject* obj)
  {
    MOZ_ASSERT(!inited());
    mTypedObj = mWrappedObj = UnwrapArray(obj);
    return inited();
  }

  inline bool inited() const {
    return !!mTypedObj;
  }

  inline T *Data() const {
    MOZ_ASSERT(mComputed);
    return mData;
  }

  inline uint32_t Length() const {
    MOZ_ASSERT(mComputed);
    return mLength;
  }

  inline JSObject *Obj() const {
    MOZ_ASSERT(inited());
    return mWrappedObj;
  }

  inline bool WrapIntoNewCompartment(JSContext* cx)
  {
    return JS_WrapObject(cx,
      JS::MutableHandle<JSObject*>::fromMarkedLocation(&mWrappedObj));
  }

  inline void ComputeLengthAndData() const
  {
    MOZ_ASSERT(inited());
    MOZ_ASSERT(!mComputed);
    GetLengthAndData(mTypedObj, &mLength, &mData);
    mComputed = true;
  }

private:
  TypedArray_base(const TypedArray_base&) = delete;
};

template<typename T,
         JSObject* UnwrapArray(JSObject*),
         T* GetData(JSObject*, const JS::AutoCheckCannotGC&),
         void GetLengthAndData(JSObject*, uint32_t*, T**),
         JSObject* CreateNew(JSContext*, uint32_t)>
struct TypedArray : public TypedArray_base<T, UnwrapArray, GetLengthAndData> {
private:
  typedef TypedArray_base<T, UnwrapArray, GetLengthAndData> Base;

public:
  TypedArray()
    : Base()
  {}

  explicit TypedArray(TypedArray&& aOther)
    : Base(Move(aOther))
  {
  }

  static inline JSObject*
  Create(JSContext* cx, nsWrapperCache* creator, uint32_t length,
         const T* data = nullptr) {
    JS::Rooted<JSObject*> creatorWrapper(cx);
    Maybe<JSAutoCompartment> ac;
    if (creator && (creatorWrapper = creator->GetWrapperPreserveColor())) {
      ac.emplace(cx, creatorWrapper);
    }

    return CreateCommon(cx, length, data);
  }

  static inline JSObject*
  Create(JSContext* cx, uint32_t length, const T* data = nullptr) {
    return CreateCommon(cx, length, data);
  }

private:
  static inline JSObject*
  CreateCommon(JSContext* cx, uint32_t length, const T* data) {
    JSObject* obj = CreateNew(cx, length);
    if (!obj) {
      return nullptr;
    }
    if (data) {
      JS::AutoCheckCannotGC nogc;
      T* buf = static_cast<T*>(GetData(obj, nogc));
      memcpy(buf, data, length*sizeof(T));
    }
    return obj;
  }

  TypedArray(const TypedArray&) = delete;
};

typedef TypedArray<int8_t, js::UnwrapInt8Array, JS_GetInt8ArrayData,
                   js::GetInt8ArrayLengthAndData, JS_NewInt8Array>
        Int8Array;
typedef TypedArray<uint8_t, js::UnwrapUint8Array, JS_GetUint8ArrayData,
                   js::GetUint8ArrayLengthAndData, JS_NewUint8Array>
        Uint8Array;
typedef TypedArray<uint8_t, js::UnwrapUint8ClampedArray, JS_GetUint8ClampedArrayData,
                   js::GetUint8ClampedArrayLengthAndData, JS_NewUint8ClampedArray>
        Uint8ClampedArray;
typedef TypedArray<int16_t, js::UnwrapInt16Array, JS_GetInt16ArrayData,
                   js::GetInt16ArrayLengthAndData, JS_NewInt16Array>
        Int16Array;
typedef TypedArray<uint16_t, js::UnwrapUint16Array, JS_GetUint16ArrayData,
                   js::GetUint16ArrayLengthAndData, JS_NewUint16Array>
        Uint16Array;
typedef TypedArray<int32_t, js::UnwrapInt32Array, JS_GetInt32ArrayData,
                   js::GetInt32ArrayLengthAndData, JS_NewInt32Array>
        Int32Array;
typedef TypedArray<uint32_t, js::UnwrapUint32Array, JS_GetUint32ArrayData,
                   js::GetUint32ArrayLengthAndData, JS_NewUint32Array>
        Uint32Array;
typedef TypedArray<float, js::UnwrapFloat32Array, JS_GetFloat32ArrayData,
                   js::GetFloat32ArrayLengthAndData, JS_NewFloat32Array>
        Float32Array;
typedef TypedArray<double, js::UnwrapFloat64Array, JS_GetFloat64ArrayData,
                   js::GetFloat64ArrayLengthAndData, JS_NewFloat64Array>
        Float64Array;
typedef TypedArray_base<uint8_t, js::UnwrapArrayBufferView, js::GetArrayBufferViewLengthAndData>
        ArrayBufferView;
typedef TypedArray<uint8_t, js::UnwrapArrayBuffer, JS_GetArrayBufferData,
                   js::GetArrayBufferLengthAndData, JS_NewArrayBuffer>
        ArrayBuffer;

// A class for converting an nsTArray to a TypedArray
// Note: A TypedArrayCreator must not outlive the nsTArray it was created from.
//       So this is best used to pass from things that understand nsTArray to
//       things that understand TypedArray, as with Promise::ArgumentToJSValue.
template<typename TypedArrayType>
class TypedArrayCreator
{
  typedef nsTArray<typename TypedArrayType::element_type> ArrayType;

  public:
    explicit TypedArrayCreator(const ArrayType& aArray)
      : mArray(aArray)
    {}

    JSObject* Create(JSContext* aCx) const
    {
      return TypedArrayType::Create(aCx, mArray.Length(), mArray.Elements());
    }

  private:
    const ArrayType& mArray;
};

// A class for rooting an existing TypedArray struct
template<typename ArrayType>
class MOZ_STACK_CLASS TypedArrayRooter : private JS::CustomAutoRooter
{
public:
  TypedArrayRooter(JSContext* cx,
                   ArrayType* aArray MOZ_GUARD_OBJECT_NOTIFIER_PARAM) :
    JS::CustomAutoRooter(cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT),
    mArray(aArray)
  {
  }

  virtual void trace(JSTracer* trc) MOZ_OVERRIDE
  {
    mArray->TraceSelf(trc);
  }

private:
  TypedArrayObjectStorage* const mArray;
};

// And a specialization for dealing with nullable typed arrays
template<typename Inner> struct Nullable;
template<typename ArrayType>
class MOZ_STACK_CLASS TypedArrayRooter<Nullable<ArrayType> > :
    private JS::CustomAutoRooter
{
public:
  

  

private:
  Nullable<ArrayType>* const mArray;
};

// Class for easily setting up a rooted typed array object on the stack
template<typename ArrayType>
class MOZ_STACK_CLASS RootedTypedArray : public ArrayType,
                                         private TypedArrayRooter<ArrayType>
{
public:
  explicit RootedTypedArray(JSContext* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) :
    ArrayType(),
    TypedArrayRooter<ArrayType>(cx, this
                                MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)
  {
  }

  
};

} // namespace dom
} // namespace mozilla


namespace mozilla {
namespace dom {

class HMDVRDevice;
struct HMDVRDeviceAtoms;
struct NativePropertyHooks;
class PositionSensorVRDevice;
struct PositionSensorVRDeviceAtoms;
class ProtoAndIfaceCache;
class VRDevice;
struct VRDeviceAtoms;
class VRFieldOfView;
struct VRFieldOfViewAtoms;
struct VRFieldOfViewInitAtoms;
class VRFieldOfViewReadOnly;
namespace VREyeValues {
extern const EnumEntry strings[3];
} // namespace VREyeValues


struct VRFieldOfViewInit : public DictionaryBase
{
  double mDownDegrees;
  double mLeftDegrees;
  double mRightDegrees;
  double mUpDegrees;

  ;

  

  ;
};

namespace binding_detail {
struct FastVRFieldOfViewInit : public VRFieldOfViewInit
{
  
};
} // namespace binding_detail


namespace HMDVRDeviceBinding {
  ;

  

  ;

  ;

  ;

  ;

} // namespace VRPositionStateBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_VRDeviceBinding_h
# 367 "../../dist/include/mozilla/dom/VRDeviceBinding.h"
# 14 "../../dist/include/mozilla/dom/VRDevice.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMPoint.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/DOMPoint.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_DOMPOINT_H_
#define MOZILLA_DOMPOINT_H_

#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/DOMPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/DOMPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/DOMPoint.h"

namespace mozilla {
namespace dom {

class GlobalObject;
struct DOMPointInit;

class DOMPointReadOnly : public nsWrapperCache
{
public:
  

  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMPointReadOnly)
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMPointReadOnly)

  
  
  
  

protected:
  virtual ~DOMPointReadOnly() {}

  nsCOMPtr<nsISupports> mParent;
  double mX, mY, mZ, mW;
};

class DOMPoint MOZ_FINAL : public DOMPointReadOnly
{
public:
  

  ;
  ;

  
  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

  
  
  
  void SetW(double aW) { mW = aW; }
};

}
}

#endif /*MOZILLA_DOMPOINT_H_*/
# 79 "../../dist/include/mozilla/dom/DOMPoint.h"
# 15 "../../dist/include/mozilla/dom/VRDevice.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMRect.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/VRDevice.h"
# 21 "../../dist/include/mozilla/dom/VRDevice.h"

#if 0 /* expanded by -frewrite-includes */
#include "gfxVR.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxVR.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_VR_H
#define GFX_VR_H

#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxVR.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIScreen.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIScreen.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIScreen.idl
 */

#ifndef __gen_nsIScreen_h__
#define __gen_nsIScreen_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIScreen.h"
#endif
# 12 "../../dist/include/nsIScreen.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIScreen.h"

/* starting interface:    nsIScreen */
#define NS_ISCREEN_IID_STR "826e80c8-d70f-42e2-8aa9-82c05f2a370a"

#define NS_ISCREEN_IID \
  {0x826e80c8, 0xd70f, 0x42e2, \
    { 0x8a, 0xa9, 0x82, 0xc0, 0x5f, 0x2a, 0x37, 0x0a }}

class NS_NO_VTABLE nsIScreen : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCREEN_IID)

  enum {
    BRIGHTNESS_DIM = 0U,
    BRIGHTNESS_FULL = 1U,
    BRIGHTNESS_LEVELS = 2U,
    ROTATION_0_DEG = 0U,
    ROTATION_90_DEG = 1U,
    ROTATION_180_DEG = 2U,
    ROTATION_270_DEG = 3U
  };

  /* readonly attribute unsigned long id; */
  NS_IMETHOD GetId(uint32_t *aId) = 0;

  /* void GetRect (out long left, out long top, out long width, out long height); */
  NS_IMETHOD GetRect(int32_t *left, int32_t *top, int32_t *width, int32_t *height) = 0;

  /* void GetAvailRect (out long left, out long top, out long width, out long height); */
  NS_IMETHOD GetAvailRect(int32_t *left, int32_t *top, int32_t *width, int32_t *height) = 0;

  /* void GetRectDisplayPix (out long left, out long top, out long width, out long height); */
  NS_IMETHOD GetRectDisplayPix(int32_t *left, int32_t *top, int32_t *width, int32_t *height) = 0;

  /* void GetAvailRectDisplayPix (out long left, out long top, out long width, out long height); */
  NS_IMETHOD GetAvailRectDisplayPix(int32_t *left, int32_t *top, int32_t *width, int32_t *height) = 0;

  /* readonly attribute double contentsScaleFactor; */
  NS_IMETHOD GetContentsScaleFactor(double *aContentsScaleFactor) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIScreen, NS_ISCREEN_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISCREEN \
  NS_IMETHOD GetId(uint32_t *aId) MOZ_OVERRIDE; \
  NS_IMETHOD GetRect(int32_t *left, int32_t *top, int32_t *width, int32_t *height) MOZ_OVERRIDE; \
  NS_IMETHOD GetAvailRect(int32_t *left, int32_t *top, int32_t *width, int32_t *height) MOZ_OVERRIDE; \
  NS_IMETHOD GetRectDisplayPix(int32_t *left, int32_t *top, int32_t *width, int32_t *height) MOZ_OVERRIDE; \
  NS_IMETHOD GetAvailRectDisplayPix(int32_t *left, int32_t *top, int32_t *width, int32_t *height) MOZ_OVERRIDE; \
  NS_IMETHOD LockMinimumBrightness(uint32_t brightness) MOZ_OVERRIDE; \
  NS_IMETHOD UnlockMinimumBrightness(uint32_t brightness) MOZ_OVERRIDE; \
  NS_IMETHOD GetPixelDepth(int32_t *aPixelDepth) MOZ_OVERRIDE; \
  NS_IMETHOD GetColorDepth(int32_t *aColorDepth) MOZ_OVERRIDE; \
  NS_IMETHOD GetRotation(uint32_t *aRotation) MOZ_OVERRIDE; \
  NS_IMETHOD GetContentsScaleFactor(double *aContentsScaleFactor) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentsScaleFactor(aContentsScaleFactor); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsScreen : public nsIScreen
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISCREEN


nsScreen::~nsScreen()
{
NS_IMETHODIMP nsScreen::SetRotation(uint32_t aRotation)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute double contentsScaleFactor; */
NS_IMETHODIMP nsScreen::GetContentsScaleFactor(double *aContentsScaleFactor)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 227 "../../dist/include/nsIScreen.h"


#endif /* __gen_nsIScreen_h__ */
# 230 "../../dist/include/nsIScreen.h"
# 11 "../../dist/include/gfxVR.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/gfxVR.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRefPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxVR.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/gfxVR.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EnumeratedArray.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EnumeratedArray.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* EnumeratedArray is like Array, but indexed by a typed enum. */

#ifndef mozilla_EnumeratedArray_h
#define mozilla_EnumeratedArray_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Array.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/EnumeratedArray.h"

namespace mozilla {

/**
 * EnumeratedArray is a fixed-size array container for use when an
 * array is indexed by a specific enum class.
 *
 * This provides type safety by guarding at compile time against accidentally
 * indexing such arrays with unrelated values. This also removes the need
 * for manual casting when using a typed enum value to index arrays.
 */
template<typename IndexType,
         IndexType SizeAsEnumValue,
         typename ValueType>
class EnumeratedArray
{
public:
  static const size_t kSize = size_t(SizeAsEnumValue);

private:
  Array<ValueType, kSize> mArray;

public:
  EnumeratedArray() {}

  explicit EnumeratedArray(const EnumeratedArray& aOther)
  {
    for (size_t i = 0; i < kSize; i++) {
      mArray[i] = aOther.mArray[i];
    }
  }

  ValueType& operator[](IndexType aIndex)
  {
    return mArray[size_t(aIndex)];
  }

  const ValueType& operator[](IndexType aIndex) const
  {
    return mArray[size_t(aIndex)];
  }
};

} // namespace mozilla

#endif // mozilla_EnumeratedArray_h
# 75 "../../dist/include/mozilla/EnumeratedArray.h"
# 16 "../../dist/include/gfxVR.h" 2

namespace mozilla {
namespace gfx {

enum class VRHMDType : uint16_t {
  Oculus,
  NumHMDTypes
};

struct VRFieldOfView {
  static VRFieldOfView FromCSSPerspectiveInfo(double aPerspectiveDistance,
                                              const Point& aPerspectiveOrigin,
                                              const Point& aTransformOrigin,
                                              const Rect& aContentRectangle)
  {
    /**/
    return VRFieldOfView();
  }

  VRFieldOfView() {}
  

  bool operator==(const VRFieldOfView& other) const {
    return other.upDegrees == upDegrees &&
           other.downDegrees == downDegrees &&
           other.rightDegrees == rightDegrees &&
           other.leftDegrees == leftDegrees;
  }

  bool operator!=(const VRFieldOfView& other) const {
    return !(*this == other);
  }

  

  double upDegrees;
  double rightDegrees;
  double downDegrees;
  double leftDegrees;
};

// 12 floats per vertex. Position, tex coordinates
// for each channel, and 4 generic attributes
struct VRDistortionConstants {
  float eyeToSourceScaleAndOffset[4];
  float destinationScaleAndOffset[4];
};

struct VRDistortionVertex {
  float pos[2];
  float texR[2];
  float texG[2];
  float texB[2];
  float genericAttribs[4];
};

struct VRDistortionMesh {
  nsTArray<VRDistortionVertex> mVertices;
  nsTArray<uint16_t> mIndices;
};

struct VRHMDSensorState {
  double timestamp;
  uint32_t flags;
  float orientation[4];
  float position[3];
  float angularVelocity[3];
  float angularAcceleration[3];
  float linearVelocity[3];
  float linearAcceleration[3];

  
};

/* A pure data struct that can be used to see if
 * the configuration of one HMDInfo matches another; for rendering purposes,
 * really asking "can the rendering details of this one be used for the other"
 */
struct VRHMDConfiguration {
  

  

  

  

  VRHMDType hmdType;
  uint32_t value;
  VRFieldOfView fov[2];
};

class VRHMDInfo {
public:
  enum Eye {
    Eye_Left,
    Eye_Right,
    NumEyes
  };

  enum StateValidFlags {
    State_Position = 1 << 1,
    State_Orientation = 1 << 2
  };

public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VRHMDInfo)

  

  virtual const VRFieldOfView& GetRecommendedEyeFOV(uint32_t whichEye) { return mRecommendedEyeFOV[whichEye]; }
  virtual const VRFieldOfView& GetMaximumEyeFOV(uint32_t whichEye) { return mMaximumEyeFOV[whichEye]; }

  

  /* set the FOV for this HMD unit; this triggers a computation of all the remaining bits.  Returns false if it fails */
  ;
  

  /* Suggested resolution for rendering a single eye.
   * Assumption is that left/right rendering will be 2x of this size.
   * XXX fix this for vertical displays
   */
  
  
  

  virtual uint32_t GetSupportedSensorStateBits() { return mSupportedSensorBits; }
  ;
  ;
  ;

  ;

  ;

  virtual const VRDistortionMesh& GetDistortionMesh(uint32_t whichEye) const { return mDistortionMesh[whichEye]; }

  // The nsIScreen that represents this device
  virtual nsIScreen* GetScreen() { return mScreen; }

protected:
  
  virtual ~VRHMDInfo() { MOZ_COUNT_DTOR(VRHMDInfo); }

  VRHMDType mType;
  VRHMDConfiguration mConfiguration;

  VRFieldOfView mEyeFOV[NumEyes];
  IntSize mEyeResolution;
  Point3D mEyeTranslation[NumEyes];
  Matrix4x4 mEyeProjectionMatrix[NumEyes];
  VRDistortionMesh mDistortionMesh[NumEyes];
  uint32_t mSupportedSensorBits;

  VRFieldOfView mRecommendedEyeFOV[NumEyes];
  VRFieldOfView mMaximumEyeFOV[NumEyes];

  nsCOMPtr<nsIScreen> mScreen;
};

class VRHMDManagerOculusImpl;
class VRHMDManagerOculus {
  static VRHMDManagerOculusImpl *mImpl;
public:
  ;
  ;
  ;
  ;
};

} // namespace gfx
} // namespace mozilla

#endif /* GFX_VR_H */
# 218 "../../dist/include/gfxVR.h"
# 23 "../../dist/include/mozilla/dom/VRDevice.h" 2

namespace mozilla {
namespace dom {

class Element;

class VRFieldOfViewReadOnly : public NonRefcountedDOMObject
{
public:
public:
  

  ;

  ;

  ;

  
  
  
  
};

class VRPositionState MOZ_FINAL : public nsWrapperCache
{
  ~VRPositionState() {}
public:
  ;

  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(VRPositionState)
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(VRPositionState)

  

  
  

  
  

  nsRefPtr<DOMPoint> mLinearVelocity;
  nsRefPtr<DOMPoint> mLinearAcceleration;

  nsRefPtr<DOMPoint> mOrientation;
  nsRefPtr<DOMPoint> mAngularVelocity;
  nsRefPtr<DOMPoint> mAngularAcceleration;
};

class VRDevice : public nsISupports,
                 public nsWrapperCache
{
public:
  // create new VRDevice objects for all known underlying gfx::vr devices
  ;

public:
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(VRDevice)

  
  
  

  

  

  

  enum VRDeviceType {
    HMD,
    PositionSensor
  };

  

protected:
  
  

  

  nsRefPtr<gfx::VRHMDInfo> mHMD;
};

class PositionSensorVRDevice : public VRDevice
{
public:
  ;

  ;

  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

protected:
  

  
};

} // namespace dom
} // namespace mozilla

#endif

namespace mozilla {
namespace dom {

enum class ScrollLogicalPosition : uint32_t {
  Start,
  End,
  EndGuard_
};

namespace ScrollLogicalPositionValues {
extern const EnumEntry strings[3];
} // namespace ScrollLogicalPositionValues


struct RequestFullscreenOptions : public DictionaryBase
{
  nsRefPtr<mozilla::dom::HMDVRDevice> mVrDisplay;

  ;

  

  

  ;

  ;

  ;

  ;

  ;

  ;

private:
  ;
};

namespace binding_detail {
struct FastRequestFullscreenOptions : public RequestFullscreenOptions
{
  
};
} // namespace binding_detail


struct ScrollIntoViewOptions : public ScrollOptions
{
  ScrollLogicalPosition mBlock;

  ;

  

  

  ;

  ;

  ;

  ;

  ;

  ;

private:
  ;
};

namespace binding_detail {
struct FastScrollIntoViewOptions : public ScrollIntoViewOptions
{
  
};

  ;

} // namespace ElementBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_ElementBinding_h
# 197 "../../dist/include/mozilla/dom/ElementBinding.h"
# 38 "../../dist/include/mozilla/dom/Element.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "Units.h"
#endif /* expanded by -frewrite-includes */
# 39 "../../dist/include/mozilla/dom/Element.h"

class nsIDOMEventListener;
class nsIFrame;
class nsIDOMMozNamedAttrMap;
class nsIDOMCSSStyleDeclaration;
class nsIURI;
class nsIControllers;
class nsEventChainVisitor;
class nsIScrollableFrame;
class nsAttrValueOrString;
class ContentUnbinder;
class nsContentList;
class nsDOMSettableTokenList;
class nsDOMTokenList;
struct nsRect;
class nsFocusManager;
class nsGlobalWindow;
class nsICSSDeclaration;
class nsISMILAttr;
class nsDocument;

namespace mozilla {
namespace dom {
  struct ScrollIntoViewOptions;
  struct ScrollToOptions;
} // namespace dom
} // namespace mozilla


;

#define ELEMENT_FLAG_BIT(n_) NODE_FLAG_BIT(NODE_TYPE_SPECIFIC_BITS_OFFSET + (n_))

// Element-specific flags
enum {
  // Set if the element has a pending style change.
  ELEMENT_HAS_PENDING_RESTYLE =                 ELEMENT_FLAG_BIT(0),

  // Set if the element is a potential restyle root (that is, has a style
  // change pending _and_ that style change will attempt to restyle
  // descendants).
  ELEMENT_IS_POTENTIAL_RESTYLE_ROOT =           ELEMENT_FLAG_BIT(1),

  // Set if the element has a pending animation-only style change as
  // part of an animation-only style update (where we update styles from
  // animation to the current refresh tick, but leave everything else as
  // it was).

  // Remaining bits are for subclasses
  ELEMENT_TYPE_SPECIFIC_BITS_OFFSET = NODE_TYPE_SPECIFIC_BITS_OFFSET + 4
};

#undef ELEMENT_FLAG_BIT

// Make sure we have space for our bits
ASSERT_NODE_FLAGS_SPACE(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET);

namespace mozilla {
class EventChainPostVisitor;
class EventChainPreVisitor;
class EventChainVisitor;
class EventListenerManager;
class EventStateManager;

namespace dom {

class AnimationPlayer;
class Link;
class UndoManager;
class DOMRect;
class DOMRectList;
class DestinationInsertionPointList;

// IID for the dom::Element interface
#define NS_ELEMENT_IID \
{ 0x31d3f3fb, 0xcdf8, 0x4e40, \
 { 0xb7, 0x09, 0x1a, 0x11, 0x43, 0x93, 0x61, 0x71 } }

class Element : public FragmentOrElement
{
public:
#ifdef MOZILLA_INTERNAL_API
  explicit Element(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo) :
    FragmentOrElement(aNodeInfo),
    mState(NS_EVENT_STATE_MOZ_READONLY)
  {
    MOZ_ASSERT(mNodeInfo->NodeType() == nsIDOMNode::ELEMENT_NODE,
               "Bad NodeType in aNodeInfo");
    SetIsElement();
  }
#endif // MOZILLA_INTERNAL_API
# 149 "../../dist/include/mozilla/dom/Element.h"

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ELEMENT_IID)

  NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) MOZ_OVERRIDE;

  /**
   * Method to get the full state of this element.  See mozilla/EventStates.h
   * for the possible bits that could be set here.
   */
  

  /**
   * Ask this element to update its state.  If aNotify is false, then
   * state change notifications will not be dispatched; in that
   * situation it is the caller's responsibility to dispatch them.
   *
   * In general, aNotify should only be false if we're guaranteed that
   * the element can't have a frame no matter what its style is
   * (e.g. if we're in the middle of adding it to the document or
   * removing it from the document).
   */
  void UpdateState(bool aNotify);
  
  /**
   * Method to update mState with link state information.  This does not notify.
   */
  ;

  /**
   * Returns true if this element is either a full-screen element or an
   * ancestor of the full-screen element.
   */
  virtual css::StyleRule* GetInlineStyleRule();

  /**
   * Set the inline style rule for this element. This will send an appropriate
   * AttributeChanged notification if aNotify is true.
   */
  virtual nsresult SetInlineStyleRule(css::StyleRule* aStyleRule,
                                      const nsAString* aSerialized,
                                      bool aNotify);

  /**
   * Get the SMIL override style rule for this element. If the rule hasn't been
   * created, this method simply returns null.
   */
  virtual css::StyleRule* GetSMILOverrideStyleRule();

  /**
   * Set the SMIL override style rule for this element. If aNotify is true, this
   * method will notify the document's pres context, so that the style changes
  /**
   * Get the SMIL override style for this element. This is a style declaration
   * that is applied *after* the inline style, and it can be used e.g. to store
   * animated style values.
   *
   * Note: This method is analogous to the 'GetStyle' method in
   * nsGenericHTMLElement and nsStyledElement.
   */
  virtual nsICSSDeclaration* GetSMILOverrideStyle();

  /**
   * Returns if the element is labelable as per HTML specification.
   */
  virtual bool IsLabelable() const;

  /**
   * Returns if the element is interactive content as per HTML specification.
   */
  virtual bool IsInteractiveHTMLContent() const;

  /**
   * Is the attribute named stored in the mapped attributes?
   *
   * // XXXbz we use this method in HasAttributeDependentStyle, so svg
   *    returns true here even though it stores nothing in the mapped
   *    attributes.
   */
  NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const;

  /**
   * Get a hint that tells the style system what to do when
   * an attribute on this node changes, if something needs to happen
   * in response to the change *other* than the result of what is
   * mapped into style data via any type of style rule.
   */
  virtual nsChangeHint GetAttributeChangeHint(const nsIAtom* aAttribute,
                                              int32_t aModType) const;

  inline Directionality GetDirectionality() const {
    if (HasFlag(NODE_HAS_DIRECTION_RTL)) {
      return eDir_RTL;
    }

    if (HasFlag(NODE_HAS_DIRECTION_LTR)) {
      return eDir_LTR;
    }

    return eDir_NotSet;
  }

  inline void SetDirectionality(Directionality aDir, bool aNotify) {
    UnsetFlags(NODE_ALL_DIRECTION_FLAGS);
    if (!aNotify) {
      RemoveStatesSilently(DIRECTION_STATES);
    }

    switch (aDir) {
      case (eDir_RTL):
        SetFlags(NODE_HAS_DIRECTION_RTL);
        if (!aNotify) {
          AddStatesSilently(NS_EVENT_STATE_RTL);
        }
        break;

      case(eDir_LTR):
        SetFlags(NODE_HAS_DIRECTION_LTR);
        if (!aNotify) {
          AddStatesSilently(NS_EVENT_STATE_LTR);
        }
        break;

      default:
        break;
    }

    /* 
     * Only call UpdateState if we need to notify, because we call
     * SetDirectionality for every element, and UpdateState is very very slow
     * for some elements.
     */
    if (aNotify) {
      UpdateState(true);
    }
  }

  ;

  // The bdi element defaults to dir=auto if it has no dir attribute set.
  // Other elements will only have dir=auto if they have an explicit dir=auto,
  // which will mean that HasValidDir() returns true but HasFixedDir() returns
  // false
  

  ;

protected:
  /**
   * Method to get the _intrinsic_ content state of this element.  This is the
   * state that is independent of the element's presentation.  To get the full
   * content state, use State().  See mozilla/EventStates.h for
   * the possible bits that could be set here.
   */
  virtual EventStates IntrinsicState() const;

  /**
   * Method to add state bits.  This should be called from subclass
   * constructors to set up our event state correctly at construction
   * time and other places where we don't want to notify a state
   * change.
   */
  void AddStatesSilently(EventStates aStates)
  {
    mState |= aStates;
  }

  /**
   * Method to remove state bits.  This should be called from subclass
   * constructors to set up our event state correctly at construction
   * time and other places where we don't want to notify a state
   * change.
   */
  void RemoveStatesSilently(EventStates aStates)
  {
    mState &= ~aStates;
  }

private:
  // Need to allow the ESM, nsGlobalWindow, and the focus manager to
  // set our state
  friend class mozilla::EventStateManager;
  friend class ::nsGlobalWindow;
  friend class ::nsFocusManager;
  friend class ::nsDocument;

  // Also need to allow Link to call UpdateLinkState.
  friend class Link;

  void NotifyStateChange(EventStates aStates);

  ;

  // Style state computed from element's state and style locks.
  ;

protected:
  // Methods for the ESM to manage state bits.  These will handle
  // setting up script blockers when they notify, so no need to do it
  // in the callers unless desired.
  virtual void AddStates(EventStates aStates)
  {
    NS_PRECONDITION(!aStates.HasAtLeastOneOfStates(INTRINSIC_STATES),
                    "Should only be adding ESM-managed states here");
    AddStatesSilently(aStates);
    NotifyStateChange(aStates);
  }
  virtual void RemoveStates(EventStates aStates)
  {
    NS_PRECONDITION(!aStates.HasAtLeastOneOfStates(INTRINSIC_STATES),
                    "Should only be removing ESM-managed states here");
    RemoveStatesSilently(aStates);
    NotifyStateChange(aStates);
  }
public:
  virtual void UpdateEditableState(bool aNotify) MOZ_OVERRIDE;

  virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                              nsIContent* aBindingParent,
                              bool aCompileEventHandlers) MOZ_OVERRIDE;
  virtual void UnbindFromTree(bool aDeep = true,
                              bool aNullParent = true) MOZ_OVERRIDE;

  /**
   * Normalizes an attribute name and returns it as a nodeinfo if an attribute
   * with that name exists. This method is intended for character case
   * conversion if the content object is case insensitive (e.g. HTML). Returns
   * the nodeinfo of the attribute with the specified name if one exists or
   * null otherwise.
   *
   * @param aStr the unparsed attribute string
   * @return the node info. May be nullptr.
   */
  ;

  nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                   const nsAString& aValue, bool aNotify)
  {
    return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
  }

  /**
   * Helper for SetAttr/SetParsedAttr. This method will return true if aNotify
   * is true or there are mutation listeners that must be triggered, the
   * attribute is currently set, and the new value that is about to be set is
   * different to the current value. As a perf optimization the new and old
   * values will not actually be compared if we aren't notifying and we don't
   * have mutation listeners (in which case it's cheap to just return false
   * and let the caller go ahead and set the value).
   * @param aOldValue Set to the old value of the attribute, but only if there
   *   are event listeners. If set, the type of aOldValue will be either
   *   nsAttrValue::eString or nsAttrValue::eAtom.
   * @param aModType Set to nsIDOMMutationEvent::MODIFICATION or to
   *   nsIDOMMutationEvent::ADDITION, but only if this helper returns true
   * @param aHasListeners Set to true if there are mutation event listeners
   *   listening for NS_EVENT_BITS_MUTATION_ATTRMODIFIED
   */
  ;

  ;

  virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
                           const nsAString& aValue, bool aNotify) MOZ_OVERRIDE;
  nsresult SetParsedAttr(int32_t aNameSpaceID, nsIAtom* aName, nsIAtom* aPrefix,
                         nsAttrValue& aParsedValue, bool aNotify);
  // GetAttr is not inlined on purpose, to keep down codesize from all
  // the inlined nsAttrValue bits for C++ callers.
  bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
               nsAString& aResult) const;
  inline bool HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const;
  // aCaseSensitive == eIgnoreCaase means ASCII case-insensitive matching.
  inline bool AttrValueIs(int32_t aNameSpaceID, nsIAtom* aName,
                          const nsAString& aValue,
                          nsCaseTreatment aCaseSensitive) const;
  inline bool AttrValueIs(int32_t aNameSpaceID, nsIAtom* aName,
                          nsIAtom* aValue,
                          nsCaseTreatment aCaseSensitive) const;
  virtual int32_t FindAttrValueIn(int32_t aNameSpaceID,
                                  nsIAtom* aName,
                                  AttrValuesArray* aValues,
                                  nsCaseTreatment aCaseSensitive) const MOZ_OVERRIDE;
  virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
                             bool aNotify) MOZ_OVERRIDE;
  virtual const nsAttrName* GetAttrNameAt(uint32_t aIndex) const MOZ_OVERRIDE;
  virtual uint32_t GetAttrCount() const MOZ_OVERRIDE;
  virtual bool IsNodeOfType(uint32_t aFlags) const MOZ_OVERRIDE;

#ifdef DEBUG
  virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE
  {
    List(out, aIndent, EmptyCString());
  }
  virtual void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const MOZ_OVERRIDE;
  void List(FILE* out, int32_t aIndent, const nsCString& aPrefix) const;
  void ListAttributes(FILE* out) const;
#endif
# 517 "../../dist/include/mozilla/dom/Element.h"

  void Describe(nsAString& aOutDescription) const MOZ_OVERRIDE;

  /*
   * Attribute Mapping Helpers
   */
  struct MappedAttributeEntry {
    nsIAtom** attribute;
  };

  /**
   * A common method where you can just pass in a list of maps to check
   * for attribute dependence. Most implementations of
   * IsAttributeMapped should use this function as a default
   * handler.
   */
  template<size_t N>
  static bool
  FindAttributeDependence(const nsIAtom* aAttribute,
                          const MappedAttributeEntry* const (&aMaps)[N])
  {
    return FindAttributeDependence(aAttribute, aMaps, N);
  }

  static nsIAtom*** HTMLSVGPropertiesToTraverseAndUnlink();

private:
  void DescribeAttribute(uint32_t index, nsAString& aOutDescription) const;

  static bool
  FindAttributeDependence(const nsIAtom* aAttribute,
                          const MappedAttributeEntry* const aMaps[],
                          uint32_t aMapCount);

protected:
  inline bool GetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                      DOMString& aResult) const
  {
    NS_ASSERTION(nullptr != aName, "must have attribute name");
    NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown,
                 "must have a real namespace ID!");
    MOZ_ASSERT(aResult.HasStringBuffer() && aResult.StringBufferLength() == 0,
               "Should have empty string coming in");
    const nsAttrValue* val = mAttrsAndChildren.GetAttr(aName, aNameSpaceID);
    if (val) {
      val->ToString(aResult);
      return true;
    }
    // else DOMString comes pre-emptied.
    return false;
  }

public:
  bool HasAttrs() const { return mAttrsAndChildren.HasAttrs(); }

  inline bool GetAttr(const nsAString& aName, DOMString& aResult) const
  {
    MOZ_ASSERT(aResult.HasStringBuffer() && aResult.StringBufferLength() == 0,
               "Should have empty string coming in");
    const nsAttrValue* val = mAttrsAndChildren.GetAttr(aName);
    if (val) {
      val->ToString(aResult);
      return true;
    }
    // else DOMString comes pre-emptied.
    return false;
  }

  void GetTagName(nsAString& aTagName) const
  {
    aTagName = NodeName();
  }
  void GetId(nsAString& aId) const
  {
    GetAttr(kNameSpaceID_None, nsGkAtoms::id, aId);
  }
  void GetId(DOMString& aId) const
  {
    GetAttr(kNameSpaceID_None, nsGkAtoms::id, aId);
  }
  void SetId(const nsAString& aId)
  {
    SetAttr(kNameSpaceID_None, nsGkAtoms::id, aId, true);
  }
  void GetClassName(nsAString& aClassName)
  {
    GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aClassName);
  }
  void GetClassName(DOMString& aClassName)
  {
    GetAttr(kNameSpaceID_None, nsGkAtoms::_class, aClassName);
  }
  void SetClassName(const nsAString& aClassName)
  {
    SetAttr(kNameSpaceID_None, nsGkAtoms::_class, aClassName, true);
  }

  nsDOMTokenList* ClassList();
  nsDOMAttributeMap* Attributes()
  {
    nsDOMSlots* slots = DOMSlots();
    if (!slots->mAttributeMap) {
      slots->mAttributeMap = new nsDOMAttributeMap(this);
    }

    return slots->mAttributeMap;
  }
  

  void GetAttribute(const nsAString& aName, DOMString& aReturn);
  void GetAttributeNS(const nsAString& aNamespaceURI,
                      const nsAString& aLocalName,
                      nsAString& aReturn);
  void SetAttribute(const nsAString& aName, const nsAString& aValue,
                    ErrorResult& aError);
  void SetAttributeNS(const nsAString& aNamespaceURI,
                      const nsAString& aLocalName,
                      const nsAString& aValue,
                      ErrorResult& aError);
  void RemoveAttribute(const nsAString& aName,
                       ErrorResult& aError);
  void RemoveAttributeNS(const nsAString& aNamespaceURI,
                         const nsAString& aLocalName,
                         ErrorResult& aError);
  bool HasAttribute(const nsAString& aName) const
  {
    return InternalGetExistingAttrNameFromQName(aName) != nullptr;
  }
  bool HasAttributeNS(const nsAString& aNamespaceURI,
                      const nsAString& aLocalName) const;
  bool HasAttributes() const
  {
    return HasAttrs();
  }
  ;
  bool Matches(const nsAString& aSelector,
               ErrorResult& aError);
  ;
  ;
  ;
  bool MozMatchesSelector(const nsAString& aSelector,
                          ErrorResult& aError)
  {
    return Matches(aSelector, aError);
  }
  
  
  void SetCapture(bool aRetargetToElement)
  {
    // If there is already an active capture, ignore this request. This would
    // occur if a splitter, frame resizer, etc had already captured and we don't
    // want to override those.
    if (!nsIPresShell::GetCapturingContent()) {
      nsIPresShell::SetCapturingContent(this, CAPTURE_PREVENTDRAG |
        (aRetargetToElement ? CAPTURE_RETARGETTOELEMENT : 0));
    }
  }
  void ReleaseCapture()
  {
    if (nsIPresShell::GetCapturingContent() == this) {
      nsIPresShell::SetCapturingContent(nullptr, 0);
    }
  }

  // aCx == nullptr is allowed only if aOptions.isNullOrUndefined()
  void MozRequestFullScreen(JSContext* aCx, JS::Handle<JS::Value> aOptions,
                            ErrorResult& aError);
  void MozRequestPointerLock();
  Attr* GetAttributeNode(const nsAString& aName);
  already_AddRefed<Attr> SetAttributeNode(Attr& aNewAttr,
                                          ErrorResult& aError);
  already_AddRefed<Attr> RemoveAttributeNode(Attr& aOldAttr,
                                             ErrorResult& aError);
  Attr* GetAttributeNodeNS(const nsAString& aNamespaceURI,
                           const nsAString& aLocalName);
  already_AddRefed<Attr> SetAttributeNodeNS(Attr& aNewAttr,
                                            ErrorResult& aError);

  already_AddRefed<DOMRectList> GetClientRects();
  already_AddRefed<DOMRect> GetBoundingClientRect();

  ;
  ;

  ;
  void ScrollIntoView(bool aTop);
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  /* Scrolls without flushing the layout.
   * aDx is the x offset, aDy the y offset in CSS pixels.
   * Returns true if we actually scrolled.
   */
  ;
  int32_t ScrollTop();
  void SetScrollTop(int32_t aScrollTop);
  int32_t ScrollLeft();
  void SetScrollLeft(int32_t aScrollLeft);
  int32_t ScrollWidth();
  int32_t ScrollHeight();
  ;
  int32_t ClientTop()
  {
    return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().y);
  }
  int32_t ClientLeft()
  {
    return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().x);
  }
  int32_t ClientWidth()
  {
    return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().width);
  }
  int32_t ClientHeight()
  {
    return nsPresContext::AppUnitsToIntCSSPixels(GetClientAreaRect().height);
  }
  int32_t ScrollTopMax()
  {
    nsIScrollableFrame* sf = GetScrollFrame();
    return sf ?
           nsPresContext::AppUnitsToIntCSSPixels(sf->GetScrollRange().YMost()) :
           0;
  }
  int32_t ScrollLeftMax()
  {
    nsIScrollableFrame* sf = GetScrollFrame();
    return sf ?
           nsPresContext::AppUnitsToIntCSSPixels(sf->GetScrollRange().XMost()) :
           0;
  }

  virtual already_AddRefed<UndoManager> GetUndoManager()
  {
    return nullptr;
  }

  virtual bool UndoScope()
  {
    return false;
  }

  virtual void SetUndoScope(bool aUndoScope, ErrorResult& aError)
  {
  }

  ;
  ;

  /**
   * Do whatever needs to be done when the mouse leaves a link
   */
  ;

  ;

  /**

  /**
   * Struct that stores info on an attribute.  The name and value must
   * either both be null or both be non-null.
   */
  struct nsAttrInfo {
    
    

    const nsAttrName* mName;
    const nsAttrValue* mValue;
  };

  const nsAttrValue* GetParsedAttr(nsIAtom* aAttr) const
  {
    return mAttrsAndChildren.GetAttr(aAttr);
  }

  /**
   * Returns the attribute map, if there is one.
   *
   * @return existing attribute map or nullptr.
   */
  

  virtual void RecompileScriptEventListeners()
  {
  }

  /**
   * Get the attr info for the given namespace ID and attribute name.  The
   * namespace ID must not be kNameSpaceID_Unknown and the name must not be
   * null.  Note that this can only return info on attributes that actually
   * live on this element (and is only virtual to handle XUL prototypes).  That
   * is, this should only be called from methods that only care about attrs
   * that effectively live in mAttrsAndChildren.
   */
  virtual nsAttrInfo GetAttrInfo(int32_t aNamespaceID, nsIAtom* aName) const;
  
  /**
   * Return the CORS mode for a given nsAttrValue (which may be null,
   * but if not should have been parsed via ParseCORSValue).
   */
  ;

  // These are just used to implement nsIDOMElement using
  // NS_FORWARD_NSIDOMELEMENT_TO_GENERIC and for quickstubs.
  void
    GetElementsByTagName(const nsAString& aQualifiedName,
                         nsIDOMHTMLCollection** aResult);
  nsresult
    GetElementsByTagNameNS(const nsAString& aNamespaceURI,
                           const nsAString& aLocalName,
                           nsIDOMHTMLCollection** aResult);
  nsresult
    GetElementsByClassName(const nsAString& aClassNames,
                           nsIDOMHTMLCollection** aResult);
  void GetClassList(nsISupports** aClassList);

  virtual JSObject* WrapObject(JSContext *aCx) MOZ_FINAL MOZ_OVERRIDE;

  nsINode* GetScopeChainParent() const MOZ_OVERRIDE;

  /**
   * Locate an nsIEditor rooted at this content node, if there is one.
   */
  ;

  /**
   * Helper method for NS_IMPL_BOOL_ATTR macro.
   * Gets value of boolean attribute. Only works for attributes in null
   * namespace.
   *
   * @param aAttr    name of attribute.
   * @param aValue   Boolean value of attribute.
   */
  bool GetBoolAttr(nsIAtom* aAttr) const
  {
    return HasAttr(kNameSpaceID_None, aAttr);
  }

  /**
   * Helper method for NS_IMPL_BOOL_ATTR macro.
   * Sets value of boolean attribute by removing attribute or setting it to
   * the empty string. Only works for attributes in null namespace.
   *
   * @param aAttr    name of attribute.
   * @param aValue   Boolean value of attribute.
   */
  ;

  /**
   * Helper method for NS_IMPL_ENUM_ATTR_DEFAULT_VALUE.
   * Gets the enum value string of an attribute and using a default value if
   * the attribute is missing or the string is an invalid enum value.
   *
   * @param aType     the name of the attribute.
   * @param aDefault  the default value if the attribute is missing or invalid.
   * @param aResult   string corresponding to the value [out].
   */
  void GetEnumAttr(nsIAtom* aAttr,
                   const char* aDefault,
                   nsAString& aResult) const;

  /**
   * Helper method for NS_IMPL_ENUM_ATTR_DEFAULT_MISSING_INVALID_VALUES.
   * Gets the enum value string of an attribute and using the default missing
   * value if the attribute is missing or the default invalid value if the
   * string is an invalid enum value.
   *
   * @param aType            the name of the attribute.
   * @param aDefaultMissing  the default value if the attribute is missing.  If
                             null and the attribute is missing, aResult will be
                             set to the null DOMString; this only matters for
                             cases in which we're reflecting a nullable string.
   * @param aDefaultInvalid  the default value if the attribute is invalid.
   * @param aResult          string corresponding to the value [out].
   */
  ;

  /**
   * Unset an attribute.
   */
  void UnsetAttr(nsIAtom* aAttr, ErrorResult& aError)
  {
    aError = UnsetAttr(kNameSpaceID_None, aAttr, true);
  }

  /**
   * Set an attribute in the simplest way possible.
   */
  void SetAttr(nsIAtom* aAttr, const nsAString& aValue, ErrorResult& aError)
  {
    aError = SetAttr(kNameSpaceID_None, aAttr, aValue, true);
  }

  /**
   * Set a content attribute via a reflecting nullable string IDL
   * attribute (e.g. a CORS attribute).  If DOMStringIsNull(aValue),
   *
   * @param aScroll       Destination of scroll, in CSS pixels
   * @param aOptions      Dictionary of options to be evaluated
   */
  void Scroll(const CSSIntPoint& aScroll, const ScrollOptions& aOptions);

  /**
   * Convert an attribute string value to attribute type based on the type of
   * attribute.  Called by SetAttr().  Note that at the moment we only do this
   * for attributes in the null namespace (kNameSpaceID_None).
   *
   * @param aNamespaceID the namespace of the attribute to convert
   * @param aAttribute the attribute to convert
   * @param aValue the string value to convert
   * @param aResult the nsAttrValue [OUT]
   * @return true if the parsing was successful, false otherwise
   */
  virtual bool ParseAttribute(int32_t aNamespaceID,
                                nsIAtom* aAttribute,
                                const nsAString& aValue,
                                nsAttrValue& aResult);

  /**
   * Try to set the attribute as a mapped attribute, if applicable.  This will
   * only be called for attributes that are in the null namespace and only on
   * attributes that returned true when passed to IsAttributeMapped.  The
   * caller will not try to set the attr in any other way if this method
   * returns true (the value of aRetval does not matter for that purpose).
   *
   * @param aDocument the current document of this node (an optimization)
   * @param aName the name of the attribute
   * @param aValue the nsAttrValue to set
   * @param [out] aRetval the nsresult status of the operation, if any.
   * @return true if the setting was attempted, false otherwise.
   */
  virtual bool SetMappedAttribute(nsIDocument* aDocument,
                                    nsIAtom* aName,
                                    nsAttrValue& aValue,
                                    nsresult* aRetval);

  /**
   * Hook that is called by Element::SetAttr to allow subclasses to
   * deal with attribute sets.  This will only be called after we verify that
   * we're actually doing an attr set and will be called before
   * AttributeWillChange and before ParseAttribute and hence before we've set
   * the new value.
   *
   * @param aNamespaceID the namespace of the attr being set
   * @param aName the localname of the attribute being set
   * @param aValue the value it's being set to represented as either a string or
   *        a parsed nsAttrValue. Alternatively, if the attr is being removed it
   *        will be null.
   * @param aNotify Whether we plan to notify document observers.
   */
  // Note that this is inlined so that when subclasses call it it gets
  // inlined.  Those calls don't go through a vtable.
  virtual nsresult BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
                                 const nsAttrValueOrString* aValue,
                                 bool aNotify)
  {
    return NS_OK;
  }

  /**
   * Hook that is called by Element::SetAttr to allow subclasses to
   * deal with attribute sets.  This will only be called after we have called
   * SetAndTakeAttr and AttributeChanged (that is, after we have actually set
   * the attr).  It will always be called under a scriptblocker.
   *
   * @param aNamespaceID the namespace of the attr being set
   * @param aName the localname of the attribute being set
   * @param aValue the value it's being set to.  If null, the attr is being
   *        removed.
   * @param aNotify Whether we plan to notify document observers.
   */
  // Note that this is inlined so that when subclasses call it it gets
  // inlined.  Those calls don't go through a vtable.
  virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
                                const nsAttrValue* aValue, bool aNotify)
  {
    return NS_OK;
  }

  /**
   * Hook to allow subclasses to produce a different EventListenerManager if
   * needed for attachment of attribute-defined handlers
   */
  virtual EventListenerManager*
    GetEventListenerManagerForAttr(nsIAtom* aAttrName, bool* aDefer);

  /**
   * Internal hook for converting an attribute name-string to an atomized name
   */
  virtual const nsAttrName* InternalGetExistingAttrNameFromQName(const nsAString& aStr) const;

  nsIFrame* GetStyledFrame();

  virtual Element* GetNameSpaceElement() MOZ_OVERRIDE
  {
    return this;
  }

  Attr* GetAttributeNodeNSInternal(const nsAString& aNamespaceURI,
                                   const nsAString& aLocalName);

  inline void RegisterActivityObserver();
  inline void UnregisterActivityObserver();

  /**
   * Add/remove this element to the documents id cache
   */
  void AddToIdTable(nsIAtom* aId);
  ;

  /**
   * Functions to carry out event default actions for links of all types
   * (HTML links, XLinks, SVG "XLinks", etc.)
   */

  /**
   * Check that we meet the conditions to handle a link event
   * and that we are actually on a link.
   *
private:
  /**
   * Get this element's client area rect in app units.
   * @return the frame's client area
   */
  nsRect GetClientAreaRect();

  nsIScrollableFrame* GetScrollFrame(nsIFrame **aStyledFrame = nullptr,
                                     bool aFlushLayout = true);

  // Data members
  EventStates mState;
};

class RemoveFromBindingManagerRunnable : public nsRunnable
{
public:
  ;

  NS_IMETHOD Run() MOZ_OVERRIDE;
private:
  ;
  nsRefPtr<nsBindingManager> mManager;
  nsRefPtr<nsIContent> mContent;
  nsCOMPtr<nsIDocument> mDoc;
};

class DestinationInsertionPointList : public nsINodeList
{
public:
  ;

  nsCOMArray<nsIContent> mDestinationPoints;
};

NS_DEFINE_STATIC_IID_ACCESSOR(Element, NS_ELEMENT_IID)

inline bool
Element::HasAttr(int32_t aNameSpaceID, nsIAtom* aName) const
{
  NS_ASSERTION(nullptr != aName, "must have attribute name");
  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown,
               "must have a real namespace ID!");

  return mAttrsAndChildren.IndexOfAttr(aName, aNameSpaceID) >= 0;
}

inline bool
Element::AttrValueIs(int32_t aNameSpaceID,
                     nsIAtom* aName,
                     const nsAString& aValue,
                     nsCaseTreatment aCaseSensitive) const
{
  NS_ASSERTION(aName, "Must have attr name");
  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");

  const nsAttrValue* val = mAttrsAndChildren.GetAttr(aName, aNameSpaceID);
  return val && val->Equals(aValue, aCaseSensitive);
}

inline bool
Element::AttrValueIs(int32_t aNameSpaceID,
                     nsIAtom* aName,
                     nsIAtom* aValue,
                     nsCaseTreatment aCaseSensitive) const
{
  NS_ASSERTION(aName, "Must have attr name");
  NS_ASSERTION(aNameSpaceID != kNameSpaceID_Unknown, "Must have namespace");
  NS_ASSERTION(aValue, "Null value atom");

  const nsAttrValue* val = mAttrsAndChildren.GetAttr(aName, aNameSpaceID);
  return val && val->Equals(aValue, aCaseSensitive);
}

} // namespace dom
} // namespace mozilla

inline mozilla::dom::Element* nsINode::AsElement()
{
  MOZ_ASSERT(IsElement());
  return static_cast<mozilla::dom::Element*>(this);
}

inline const mozilla::dom::Element* nsINode::AsElement() const
{
  MOZ_ASSERT(IsElement());
  return static_cast<const mozilla::dom::Element*>(this);
}

/**
 * Macros to implement Clone(). _elementName is the class for which to implement
 * Clone.
 */
#define NS_IMPL_ELEMENT_CLONE(_elementName)                                 \
nsresult                                                                    \
_elementName::Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const \
  {                                                                   \
    return SetBoolAttr(nsGkAtoms::_atom, aValue);                     \
  }

#define NS_FORWARD_NSIDOMELEMENT_TO_GENERIC                                   \
typedef mozilla::dom::Element Element;                                        \
NS_IMETHOD GetTagName(nsAString& aTagName) MOZ_FINAL MOZ_OVERRIDE             \
{                                                                             \
  Element::GetTagName(aTagName);                                              \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetId(nsAString& aId) MOZ_FINAL MOZ_OVERRIDE                       \
{                                                                             \
  Element::GetId(aId);                                                        \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD SetId(const nsAString& aId) MOZ_FINAL MOZ_OVERRIDE                 \
{                                                                             \
  Element::SetId(aId);                                                        \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetClassName(nsAString& aClassName) MOZ_FINAL MOZ_OVERRIDE         \
{                                                                             \
  Element::GetClassName(aClassName);                                          \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD SetClassName(const nsAString& aClassName) MOZ_FINAL MOZ_OVERRIDE   \
{                                                                             \
  Element::SetClassName(aClassName);                                          \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetClassList(nsISupports** aClassList) MOZ_FINAL MOZ_OVERRIDE      \
{                                                                             \
  Element::GetClassList(aClassList);                                          \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetAttributes(nsIDOMMozNamedAttrMap** aAttributes) MOZ_FINAL       \
  MOZ_OVERRIDE                                                                \
{                                                                             \
  NS_ADDREF(*aAttributes = Attributes());                                     \
  return NS_OK;                                                               \
}                                                                             \
using Element::GetAttribute;                                                  \
NS_IMETHOD GetAttribute(const nsAString& name, nsAString& _retval) MOZ_FINAL  \
  MOZ_OVERRIDE                                                                \
{                                                                             \
  nsString attr;                                                              \
  GetAttribute(name, attr);                                                   \
}                                                                             \
NS_IMETHOD SetAttributeNS(const nsAString& namespaceURI,                      \
                          const nsAString& qualifiedName,                     \
                          const nsAString& value) MOZ_FINAL MOZ_OVERRIDE      \
{                                                                             \
  mozilla::ErrorResult rv;                                                    \
  Element::SetAttributeNS(namespaceURI, qualifiedName, value, rv);            \
  return rv.ErrorCode();                                                      \
}                                                                             \
using Element::RemoveAttribute;                                               \
NS_IMETHOD RemoveAttribute(const nsAString& name) MOZ_FINAL MOZ_OVERRIDE      \
{                                                                             \
  mozilla::ErrorResult rv;                                                    \
  RemoveAttribute(name, rv);                                                  \
  return rv.ErrorCode();                                                      \
}                                                                             \
NS_IMETHOD RemoveAttributeNS(const nsAString& namespaceURI,                   \
                             const nsAString& localName) MOZ_FINAL            \
  MOZ_OVERRIDE                                                                \
{                                                                             \
  mozilla::ErrorResult rv;                                                    \
  Element::RemoveAttributeNS(namespaceURI, localName, rv);                    \
  return rv.ErrorCode();                                                      \
}                                                                             \
using Element::HasAttribute;                                                  \
NS_IMETHOD HasAttribute(const nsAString& name,                                \
                           bool* _retval) MOZ_FINAL MOZ_OVERRIDE              \
{                                                                             \
  *_retval = HasAttribute(name);                                              \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD HasAttributeNS(const nsAString& namespaceURI,                      \
                          const nsAString& localName,                         \
                          bool* _retval) MOZ_FINAL MOZ_OVERRIDE               \
{                                                                             \
  *_retval = Element::HasAttributeNS(namespaceURI, localName);                \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD HasAttributes(bool* _retval) MOZ_FINAL MOZ_OVERRIDE                \
{                                                                             \
  *_retval = Element::HasAttributes();                                        \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetAttributeNode(const nsAString& name,                            \
                            nsIDOMAttr** _retval) MOZ_FINAL MOZ_OVERRIDE      \
{                                                                             \
  NS_IF_ADDREF(*_retval = Element::GetAttributeNode(name));                   \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD SetAttributeNode(nsIDOMAttr* newAttr,                              \
                            nsIDOMAttr** _retval) MOZ_FINAL MOZ_OVERRIDE      \
{                                                                             \
  if (!newAttr) {                                                             \
    return NS_ERROR_INVALID_POINTER;                                          \
  }                                                                           \
  mozilla::ErrorResult rv;                                                    \
  mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr);       \
  *_retval = Element::SetAttributeNode(*attr, rv).take();                     \
  return rv.ErrorCode();                                                      \
}                                                                             \
NS_IMETHOD RemoveAttributeNode(nsIDOMAttr* oldAttr,                           \
                               nsIDOMAttr** _retval) MOZ_FINAL MOZ_OVERRIDE   \
{                                                                             \
  if (!oldAttr) {                                                             \
    return NS_ERROR_INVALID_POINTER;                                          \
  }                                                                           \
  mozilla::ErrorResult rv;                                                    \
  mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(oldAttr);       \
  *_retval = Element::RemoveAttributeNode(*attr, rv).take();                  \
  return rv.ErrorCode();                                                      \
}                                                                             \
NS_IMETHOD GetAttributeNodeNS(const nsAString& namespaceURI,                  \
                              const nsAString& localName,                     \
                              nsIDOMAttr** _retval) MOZ_FINAL MOZ_OVERRIDE    \
{                                                                             \
  NS_IF_ADDREF(*_retval = Element::GetAttributeNodeNS(namespaceURI,           \
                                                      localName));            \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD SetAttributeNodeNS(nsIDOMAttr* newAttr,                            \
                              nsIDOMAttr** _retval) MOZ_FINAL MOZ_OVERRIDE    \
{                                                                             \
  mozilla::ErrorResult rv;                                                    \
  mozilla::dom::Attr* attr = static_cast<mozilla::dom::Attr*>(newAttr);       \
  *_retval = Element::SetAttributeNodeNS(*attr, rv).take();                   \
  return rv.ErrorCode();                                                      \
}                                                                             \
NS_IMETHOD GetElementsByTagName(const nsAString& name,                        \
                                nsIDOMHTMLCollection** _retval) MOZ_FINAL     \
                                                                MOZ_OVERRIDE  \
{                                                                             \
  Element::GetElementsByTagName(name, _retval);                               \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetElementsByTagNameNS(const nsAString& namespaceURI,              \
                                  const nsAString& localName,                 \
                                  nsIDOMHTMLCollection** _retval) MOZ_FINAL   \
                                                                  MOZ_OVERRIDE\
{                                                                             \
  return Element::GetElementsByTagNameNS(namespaceURI, localName,             \
                                         _retval);                            \
}                                                                             \
NS_IMETHOD GetElementsByClassName(const nsAString& classes,                   \
                                  nsIDOMHTMLCollection** _retval) MOZ_FINAL   \
                                                                  MOZ_OVERRIDE\
{                                                                             \
  return Element::GetElementsByClassName(classes, _retval);                   \
}                                                                             \
NS_IMETHOD GetChildElements(nsIDOMNodeList** aChildElements) MOZ_FINAL        \
  MOZ_OVERRIDE                                                                \
{                                                                             \
  nsIHTMLCollection* list = FragmentOrElement::Children();                    \
  return CallQueryInterface(list, aChildElements);                            \
}                                                                             \
NS_IMETHOD GetFirstElementChild(nsIDOMElement** aFirstElementChild) MOZ_FINAL \
  MOZ_OVERRIDE                                                                \
{                                                                             \
  Element* element = Element::GetFirstElementChild();                         \
  if (!element) {                                                             \
    *aFirstElementChild = nullptr;                                            \
    return NS_OK;                                                             \
  }                                                                           \
  return CallQueryInterface(element, aFirstElementChild);                     \
}                                                                             \
NS_IMETHOD GetLastElementChild(nsIDOMElement** aLastElementChild) MOZ_FINAL   \
  MOZ_OVERRIDE                                                                \
{                                                                             \
  Element* element = Element::GetLastElementChild();                          \
  if (!element) {                                                             \
    *aLastElementChild = nullptr;                                             \
    return NS_OK;                                                             \
  }                                                                           \
  return CallQueryInterface(element, aLastElementChild);                      \
}                                                                             \
NS_IMETHOD GetPreviousElementSibling(nsIDOMElement** aPreviousElementSibling) \
  MOZ_FINAL MOZ_OVERRIDE                                                      \
{                                                                             \
  Element* element = Element::GetPreviousElementSibling();                    \
  if (!element) {                                                             \
    *aPreviousElementSibling = nullptr;                                       \
    return NS_OK;                                                             \
  }                                                                           \
  return CallQueryInterface(element, aPreviousElementSibling);                \
}                                                                             \
NS_IMETHOD MozRemove() MOZ_FINAL MOZ_OVERRIDE                                 \
{                                                                             \
  nsINode::Remove();                                                          \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetClientRects(nsIDOMClientRectList** _retval) MOZ_FINAL           \
  MOZ_OVERRIDE                                                                \
{                                                                             \
  *_retval = Element::GetClientRects().take();                                \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetBoundingClientRect(nsIDOMClientRect** _retval) MOZ_FINAL        \
  MOZ_OVERRIDE                                                                \
{                                                                             \
  *_retval = Element::GetBoundingClientRect().take();                         \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetScrollTop(int32_t* aScrollTop) MOZ_FINAL MOZ_OVERRIDE           \
{                                                                             \
  *aScrollTop = Element::ScrollTop();                                         \
}                                                                             \
NS_IMETHOD GetClientLeft(int32_t* aClientLeft) MOZ_FINAL MOZ_OVERRIDE         \
{                                                                             \
  *aClientLeft = Element::ClientLeft();                                       \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetClientWidth(int32_t* aClientWidth) MOZ_FINAL MOZ_OVERRIDE       \
{                                                                             \
  *aClientWidth = Element::ClientWidth();                                     \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetClientHeight(int32_t* aClientHeight) MOZ_FINAL MOZ_OVERRIDE     \
{                                                                             \
  *aClientHeight = Element::ClientHeight();                                   \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetScrollLeftMax(int32_t* aScrollLeftMax) MOZ_FINAL MOZ_OVERRIDE   \
{                                                                             \
  *aScrollLeftMax = Element::ScrollLeftMax();                                 \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD GetScrollTopMax(int32_t* aScrollTopMax) MOZ_FINAL MOZ_OVERRIDE     \
{                                                                             \
  *aScrollTopMax = Element::ScrollTopMax();                                   \
  return NS_OK;                                                               \
}                                                                             \
NS_IMETHOD MozMatchesSelector(const nsAString& selector,                      \
                              bool* _retval) MOZ_FINAL MOZ_OVERRIDE           \
{                                                                             \
  mozilla::ErrorResult rv;                                                    \
  Element::MozRequestFullScreen(nullptr, JS::UndefinedHandleValue, rv);       \
  return rv.ErrorCode();                                                      \
}                                                                             \
NS_IMETHOD MozRequestPointerLock(void) MOZ_FINAL MOZ_OVERRIDE                 \
{                                                                             \
  Element::MozRequestPointerLock();                                           \
  return NS_OK;                                                               \
}                                                                             \
using nsINode::QuerySelector;                                                 \
NS_IMETHOD QuerySelector(const nsAString& aSelector,                          \
                         nsIDOMElement **aReturn) MOZ_FINAL MOZ_OVERRIDE      \
{                                                                             \
  return nsINode::QuerySelector(aSelector, aReturn);                          \
}                                                                             \
using nsINode::QuerySelectorAll;                                              \
NS_IMETHOD QuerySelectorAll(const nsAString& aSelector,                       \
                            nsIDOMNodeList **aReturn) MOZ_FINAL MOZ_OVERRIDE  \
{                                                                             \
  return nsINode::QuerySelectorAll(aSelector, aReturn);                       \
}

#endif // mozilla_dom_Element_h__
# 1807 "../../dist/include/mozilla/dom/Element.h"
# 19 "/Users/luser/build/mozilla-central/dom/base/nsStyledElement.h" 2

namespace mozilla {
namespace css {
class StyleRule;
}
}

typedef mozilla::dom::Element nsStyledElementBase;

class nsStyledElementNotElementCSSInlineStyle : public nsStyledElementBase
{

protected:

  inline explicit nsStyledElementNotElementCSSInlineStyle(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
    : nsStyledElementBase(aNodeInfo)
  {}

public:
  // nsIContent interface methods
  virtual mozilla::css::StyleRule* GetInlineStyleRule() MOZ_OVERRIDE;
  virtual nsresult SetInlineStyleRule(mozilla::css::StyleRule* aStyleRule,
                           bool aForceInDataDoc);

  virtual bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
                                const nsAString& aValue, nsAttrValue& aResult) MOZ_OVERRIDE;

  friend class mozilla::dom::Element;

  /**
   * Create the style struct from the style attr.  Used when an element is
   * first put into a document.  Only has an effect if the old value is a
   * string.  If aForceInDataDoc is true, will reparse even if we're in a data
   * document.
   */
  nsresult  ReparseStyleAttribute(bool aForceInDataDoc);
};

class nsStyledElement : public nsStyledElementNotElementCSSInlineStyle {
protected:
  inline explicit nsStyledElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
    : nsStyledElementNotElementCSSInlineStyle(aNodeInfo)
  {}
};

#endif // __NS_STYLEDELEMENT_H_
# 81 "/Users/luser/build/mozilla-central/dom/base/nsStyledElement.h"
# 17 "/Users/luser/build/mozilla-central/dom/base/nsMappedAttributeElement.h" 2

class nsMappedAttributes;
struct nsRuleData;

typedef void (*nsMapRuleToAttributesFunc)(const nsMappedAttributes* aAttributes, 
                                          nsRuleData* aData);

typedef nsStyledElement nsMappedAttributeElementBase;

class nsMappedAttributeElement : public nsMappedAttributeElementBase
{

protected:

  explicit nsMappedAttributeElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
    : nsMappedAttributeElementBase(aNodeInfo)
  {}

public:
  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const;

  static void MapNoAttributesInto(const nsMappedAttributes* aAttributes, 
                                  nsRuleData* aRuleData);

  NS_IMETHOD WalkContentStyleRules(nsRuleWalker* aRuleWalker) MOZ_OVERRIDE;
  virtual bool SetMappedAttribute(nsIDocument* aDocument,
                                    nsIAtom* aName,
                                    nsAttrValue& aValue,
                                    nsresult* aRetval) MOZ_OVERRIDE;
};

#endif // NS_MAPPEDATTRIBUTEELEMENT_H_
# 49 "/Users/luser/build/mozilla-central/dom/base/nsMappedAttributeElement.h"
# 11 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMHTMLElement.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsNameSpaceManager.h"  // for kNameSpaceID_None
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsNameSpaceManager.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsNameSpaceManager_h___
#define nsNameSpaceManager_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsDataHashtable.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsNameSpaceManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsNameSpaceManager.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/StaticPtr.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/StaticPtr.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_StaticPtr_h
#define mozilla_StaticPtr_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/StaticPtr.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/StaticPtr.h"

namespace mozilla {

/**
 * StaticAutoPtr and StaticRefPtr are like nsAutoPtr and nsRefPtr, except they
 * are suitable for use as global variables.
 */

template<class T>
class MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS StaticAutoPtr
{
public:
  // In debug builds, check that mRawPtr is initialized for us as we expect
  // by the compiler.  In non-debug builds, don't declare a constructor
  // so that the compiler can see that the constructor is trivial.
#ifdef DEBUG
  StaticAutoPtr()
  {
    MOZ_ASSERT(!mRawPtr);
  }
#endif
# 49 "../../dist/include/mozilla/StaticPtr.h"

  StaticAutoPtr<T>& operator=(T* aRhs)
  {
    Assign(aRhs);
    return *this;
  }

  T* get() const { return mRawPtr; }

  operator T*() const { return get(); }

  T* operator->() const
  {
    MOZ_ASSERT(mRawPtr);
    return get();
  }

  T& operator*() const { return *get(); }

private:
  // Disallow copy constructor, but only in debug mode.  We only define
  // a default constructor in debug mode (see above); if we declared
  // this constructor always, the compiler wouldn't generate a trivial
  // default constructor for us in non-debug mode.
#ifdef DEBUG
  StaticAutoPtr(StaticAutoPtr<T>& aOther);
#endif
# 76 "../../dist/include/mozilla/StaticPtr.h"

  void Assign(T* aNewPtr)
  {
    MOZ_ASSERT(!aNewPtr || mRawPtr != aNewPtr);
    T* oldPtr = mRawPtr;
    mRawPtr = aNewPtr;
    delete oldPtr;
  }

  T* mRawPtr;
};

template<class T>
class MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS StaticRefPtr
{
public:
  // In debug builds, check that mRawPtr is initialized for us as we expect
  // by the compiler.  In non-debug builds, don't declare a constructor
  // so that the compiler can see that the constructor is trivial.
#ifdef DEBUG
  StaticRefPtr()
  {
    MOZ_ASSERT(!mRawPtr);
  }
#endif
# 101 "../../dist/include/mozilla/StaticPtr.h"

  StaticRefPtr<T>& operator=(T* aRhs)
  {
    AssignWithAddref(aRhs);
    return *this;
  }

  StaticRefPtr<T>& operator=(const StaticRefPtr<T>& aRhs)
  {
    return (this = aRhs.mRawPtr);
  }

  T* get() const { return mRawPtr; }

  

  

  T& operator*() const { return *get(); }

private:
  void AssignWithAddref(T* aNewPtr)
  {
    if (aNewPtr) {
      aNewPtr->AddRef();
    }
    AssignAssumingAddRef(aNewPtr);
  }

  void AssignAssumingAddRef(T* aNewPtr)
  {
    T* oldPtr = mRawPtr;
    mRawPtr = aNewPtr;
    if (oldPtr) {
      oldPtr->Release();
    }
  }

  T* MOZ_OWNING_REF mRawPtr;
};

namespace StaticPtr_internal {
class Zero;
} // namespace StaticPtr_internal

#define REFLEXIVE_EQUALITY_OPERATORS(type1, type2, eq_fn, ...) \
  template<__VA_ARGS__>                                        \
  inline bool                                                  \
  operator==(type1 lhs, type2 rhs)                             \
  {                                                            \
    return eq_fn;                                              \
  }                                                            \
                                                               \
  template<__VA_ARGS__>                                        \
  inline bool                                                  \
  operator==(type2 lhs, type1 rhs)                             \
  {                                                            \
    return rhs == lhs;                                         \
  }                                                            \
                                                               \
  template<__VA_ARGS__>                                        \
  inline bool                                                  \
  operator!=(type1 lhs, type2 rhs)                             \
  {                                                            \
    return !(lhs == rhs);                                      \
  }                                                            \
                                                               \
  template<__VA_ARGS__>                                        \
  inline bool                                                  \
  operator!=(type2 lhs, type1 rhs)                             \
  {                                                            \
    return !(lhs == rhs);                                      \
  }

#undef REFLEXIVE_EQUALITY_OPERATORS

} // namespace mozilla

#endif
# 236 "../../dist/include/mozilla/StaticPtr.h"
# 13 "/Users/luser/build/mozilla-central/dom/base/nsNameSpaceManager.h" 2

class nsIAtom;
class nsAString;

class nsNameSpaceKey : public PLDHashEntryHdr
{
public:
  typedef const nsAString* KeyType;
  typedef const nsAString* KeyTypePointer;
};
 
/**
 * The Name Space Manager tracks the association between a NameSpace
 * URI and the int32_t runtime id. Mappings between NameSpaces and 
 * NameSpace prefixes are managed by nsINameSpaces.
 *
 * All NameSpace URIs are stored in a global table so that IDs are
 * consistent accross the app. NameSpace IDs are only consistent at runtime
 * ie: they are not guaranteed to be consistent accross app sessions.
 *
 * The nsNameSpaceManager needs to have a live reference for as long as
 * the NameSpace IDs are needed.
 *
 */

class nsNameSpaceManager MOZ_FINAL
{
public:
  

  ;

  virtual nsresult GetNameSpaceURI(int32_t aNameSpaceID, nsAString& aURI);
  virtual int32_t GetNameSpaceID(const nsAString& aURI);

  virtual bool HasElementCreator(int32_t aNameSpaceID);

  static nsNameSpaceManager* GetInstance();
private:
  bool Init();
  nsresult AddNameSpace(const nsAString& aURI, const int32_t aNameSpaceID);

  nsDataHashtable<nsNameSpaceKey,int32_t> mURIToIDTable;
  nsTArray< nsAutoPtr<nsString> > mURIArray;

  static mozilla::StaticAutoPtr<nsNameSpaceManager> sInstance;
};
 
#endif // nsNameSpaceManager_h___
# 94 "/Users/luser/build/mozilla-central/dom/base/nsNameSpaceManager.h"
# 13 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIFormControl.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/html/nsIFormControl.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsIFormControl_h___
#define nsIFormControl_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/dom/html/nsIFormControl.h"
class nsIDOMHTMLFormElement;
class nsPresState;
class nsString;
class nsIFormProcessor;
class nsFormSubmission;

namespace mozilla {
namespace dom {
class Element;
class HTMLFieldSetElement;
} // namespace dom
} // namespace mozilla

enum FormControlsTypes {
  NS_FORM_FIELDSET = 1,
  NS_FORM_LABEL,
  NS_FORM_OUTPUT,
  NS_FORM_SELECT,
  NS_FORM_TEXTAREA,
  NS_FORM_OBJECT,
  eFormControlsWithoutSubTypesMax,
  // After this, all types will have sub-types which introduce new enum lists.
  // eFormControlsWithoutSubTypesMax let us know if the previous types values
  // are not overlapping with sub-types/masks.

  // Elements with different types, the value is used as a mask.
  // When changing the order, adding or removing elements, be sure to update
  // the static_assert checks accordingly.
  NS_FORM_BUTTON_ELEMENT = 0x40, // 0b01000000
  NS_FORM_INPUT_ELEMENT  = 0x80  // 0b10000000
};

enum ButtonElementTypes {
  NS_FORM_BUTTON_BUTTON = NS_FORM_BUTTON_ELEMENT + 1,
  NS_FORM_BUTTON_RESET,
  NS_FORM_BUTTON_SUBMIT,
  eButtonElementTypesMax
};

enum InputElementTypes {
  NS_FORM_INPUT_BUTTON = NS_FORM_INPUT_ELEMENT + 1,
  NS_FORM_INPUT_CHECKBOX,
  NS_FORM_INPUT_COLOR,
  NS_FORM_INPUT_DATE,
  NS_FORM_INPUT_EMAIL,
  NS_FORM_INPUT_FILE,
  NS_FORM_INPUT_HIDDEN,
  NS_FORM_INPUT_RESET,
  NS_FORM_INPUT_IMAGE,
  NS_FORM_INPUT_NUMBER,
  NS_FORM_INPUT_PASSWORD,
  NS_FORM_INPUT_RADIO,
  NS_FORM_INPUT_SEARCH,
  NS_FORM_INPUT_SUBMIT,
  NS_FORM_INPUT_TEL,
  NS_FORM_INPUT_TEXT,
  NS_FORM_INPUT_TIME,
  NS_FORM_INPUT_URL,
  NS_FORM_INPUT_RANGE,
  eInputElementTypesMax
};

static_assert(static_cast<uint32_t>(eFormControlsWithoutSubTypesMax) <
              static_cast<uint32_t>(NS_FORM_BUTTON_ELEMENT),
              "Too many FormControlsTypes without sub-types");
static_assert(static_cast<uint32_t>(eButtonElementTypesMax) <
              static_cast<uint32_t>(NS_FORM_INPUT_ELEMENT),
              "Too many ButtonElementTypes");
static_assert(static_cast<uint32_t>(eInputElementTypesMax) < 1<<8,
              "Too many form control types");

#define NS_IFORMCONTROL_IID   \
{ 0x4b89980c, 0x4dcd, 0x428f, \
  { 0xb7, 0xad, 0x43, 0x5b, 0x93, 0x29, 0x79, 0xec } }

/**
 * Interface which all form controls (e.g. buttons, checkboxes, text,
 * radio buttons, select, etc) implement in addition to their dom specific
 * interface.
 */
class nsIFormControl : public nsISupports
{
public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFORMCONTROL_IID)

  /**
   * Get the fieldset for this form control.
   * @return the fieldset
   */
  virtual mozilla::dom::HTMLFieldSetElement *GetFieldSet() = 0;

  /**
   * Get the form for this form control.
   * @return the form
   */
  virtual mozilla::dom::Element *GetFormElement() = 0;

  /**
   * Set the form for this form control.
   * @param aForm the form.  This must not be null.
   *
   * @note that when setting the form the control is not added to the
   * form.  It adds itself when it gets bound to the tree thereafter,
   * so that it can be properly sorted with the other controls in the
   * form.
   */
  virtual void SetForm(nsIDOMHTMLFormElement* aForm) = 0;

  /**
   * Tell the control to forget about its form.
   *
   * @param aRemoveFromForm set false if you do not want this element removed
   *        from the form.  (Used by nsFormControlList::Clear())
   */
  virtual void ClearForm(bool aRemoveFromForm) = 0;

  /**
   * Get the type of this control as an int (see NS_FORM_* above)
   * @return the type of this control
   */
  NS_IMETHOD_(uint32_t) GetType() const = 0 ;

  /**
   * Reset this form control (as it should be when the user clicks the Reset
   * button)
   */
  NS_IMETHOD Reset() = 0;

  /**
   * Tells the form control to submit its names and values to the form
   * submission object
   * @param aFormSubmission the form submission to notify of names/values/files
   *                       to submit
   */
  NS_IMETHOD SubmitNamesValues(nsFormSubmission* aFormSubmission) = 0;

  /**
   * Save to presentation state.  The form control will determine whether it
   * has anything to save and if so, create an entry in the layout history for
   * its pres context.
   */
  NS_IMETHOD SaveState() = 0;

  /**
   * Restore from presentation state.  You pass in the presentation state for
   * this form control (generated with GenerateStateKey() + "-C") and the form
   * control will grab its state from there.
   *
   * @param aState the pres state to use to restore the control
   * @return true if the form control was a checkbox and its
   *         checked state was restored, false otherwise.
   */
  virtual bool RestoreState(nsPresState* aState) = 0;

  virtual bool AllowDrop() = 0;

  /**
   * Returns whether this is a control which submits the form when activated by
   * the user.
   * @return whether this is a submit control.
   */
  inline bool IsSubmitControl() const;

  /**
   * Returns whether this is a text control.
   * @param  aExcludePassword  to have NS_FORM_INPUT_PASSWORD returning false.
  ;

  /**
   * Returns whether this is a auto-focusable form control.
   * @return whether this is a auto-focusable form control.
   */
  ;
};

bool
nsIFormControl::IsSubmitControl() const
{
  uint32_t type = GetType();
  return type == NS_FORM_INPUT_SUBMIT ||
         type == NS_FORM_INPUT_IMAGE ||
         type == NS_FORM_BUTTON_SUBMIT;
}





/*static*/








NS_DEFINE_STATIC_IID_ACCESSOR(nsIFormControl, NS_IFORMCONTROL_IID)

#endif /* nsIFormControl_h___ */
# 294 "/Users/luser/build/mozilla-central/dom/html/nsIFormControl.h"
# 14 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsGkAtoms.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsContentCreatorFunctions.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsContentCreatorFunctions.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsContentCreatorFunctions_h__
#define nsContentCreatorFunctions_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsContentCreatorFunctions.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsContentCreatorFunctions.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/FromParser.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/FromParser.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_FromParser_h
#define mozilla_dom_FromParser_h

namespace mozilla {
namespace dom {

/**
 * Constants for passing as aFromParser
 */
enum FromParser {
  NOT_FROM_PARSER = 0,
  FROM_PARSER_NETWORK = 1,
  FROM_PARSER_DOCUMENT_WRITE = 1 << 1,
  FROM_PARSER_FRAGMENT = 1 << 2,
  FROM_PARSER_XSLT = 1 << 3
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_FromParser_h
# 26 "../../dist/include/mozilla/dom/FromParser.h"
# 12 "/Users/luser/build/mozilla-central/dom/base/nsContentCreatorFunctions.h" 2

/**
 * Functions to create content, to be used only inside Gecko
 * (mozilla/content and mozilla/layout).
 */

class nsAString;
class nsIContent;
class imgRequestProxy;
class nsNodeInfoManager;
class nsGenericHTMLElement;

namespace mozilla {
namespace dom {
class Element;
class NodeInfo;
} // namespace dom
} // namespace mozilla

;


;

;

#endif // nsContentCreatorFunctions_h__
# 77 "/Users/luser/build/mozilla-central/dom/base/nsContentCreatorFunctions.h"
# 16 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h" 2
#if 0 /* expanded by -frewrite-includes */
  NS_IMETHOD SetType(const nsAString & aType) MOZ_OVERRIDE; \
  NS_IMETHOD GetLabel(nsAString & aLabel) MOZ_OVERRIDE; \
  NS_IMETHOD SetLabel(const nsAString & aLabel) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMHTMLMENUELEMENT(_to) \
  NS_IMETHOD GetCompact(bool *aCompact) MOZ_OVERRIDE { return _to GetCompact(aCompact); } \
  NS_IMETHOD SetCompact(bool aCompact) MOZ_OVERRIDE { return _to SetCompact(aCompact); } \
  NS_IMETHOD GetType(nsAString & aType) MOZ_OVERRIDE { return _to GetType(aType); } \
  NS_IMETHOD SetType(const nsAString & aType) MOZ_OVERRIDE { return _to SetType(aType); } \
  NS_IMETHOD GetLabel(nsAString & aLabel) MOZ_OVERRIDE { return _to GetLabel(aLabel); } \
  NS_IMETHOD SetLabel(const nsAString & aLabel) MOZ_OVERRIDE { return _to SetLabel(aLabel); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMHTMLMENUELEMENT(_to) \
  NS_IMETHOD GetCompact(bool *aCompact) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCompact(aCompact); } \
  NS_IMETHOD SetCompact(bool aCompact) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCompact(aCompact); } \
  NS_IMETHOD GetType(nsAString & aType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
  NS_IMETHOD SetType(const nsAString & aType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetType(aType); } \
  NS_IMETHOD GetLabel(nsAString & aLabel) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLabel(aLabel); } \
  NS_IMETHOD SetLabel(const nsAString & aLabel) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetLabel(aLabel); } 

#if 0
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute DOMString label; */
NS_IMETHODIMP nsDOMHTMLMenuElement::GetLabel(nsAString & aLabel)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMHTMLMenuElement::SetLabel(const nsAString & aLabel)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 137 "../../dist/include/nsIDOMHTMLMenuElement.h"


#endif /* __gen_nsIDOMHTMLMenuElement_h__ */
# 140 "../../dist/include/nsIDOMHTMLMenuElement.h"
# 18 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMRect.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ValidityState.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/ValidityState.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_ValidityState_h
#define mozilla_dom_ValidityState_h

#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMValidityState.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMValidityState.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMValidityState.idl
 */

#ifndef __gen_nsIDOMValidityState_h__
#define __gen_nsIDOMValidityState_h__
/* starting interface:    nsIDOMValidityState */
#define NS_IDOMVALIDITYSTATE_IID_STR "00bed276-f1f7-492f-a039-dbd9b9efc10b"

#define NS_IDOMVALIDITYSTATE_IID \
  {0x00bed276, 0xf1f7, 0x492f, \
    { 0xa0, 0x39, 0xdb, 0xd9, 0xb9, 0xef, 0xc1, 0x0b }}

class NS_NO_VTABLE nsIDOMValidityState : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMVALIDITYSTATE_IID)

  /* readonly attribute boolean valueMissing; */
  NS_IMETHOD GetValueMissing(bool *aValueMissing) = 0;

  /* readonly attribute boolean typeMismatch; */
  NS_IMETHOD GetTypeMismatch(bool *aTypeMismatch) = 0;

  /* readonly attribute boolean patternMismatch; */
  NS_IMETHOD GetPatternMismatch(bool *aPatternMismatch) = 0;

  /* readonly attribute boolean tooLong; */
  NS_IMETHOD GetTooLong(bool *aTooLong) = 0;

  /* readonly attribute boolean rangeUnderflow; */
  NS_IMETHOD GetRangeUnderflow(bool *aRangeUnderflow) = 0;

  /* readonly attribute boolean rangeOverflow; */
  NS_IMETHOD GetRangeOverflow(bool *aRangeOverflow) = 0;

  /* readonly attribute boolean stepMismatch; */
  NS_IMETHOD GetStepMismatch(bool *aStepMismatch) = 0;

  /* readonly attribute boolean badInput; */
  NS_IMETHOD GetBadInput(bool *aBadInput) = 0;

  /* readonly attribute boolean customError; */
  NS_IMETHOD GetCustomError(bool *aCustomError) = 0;

  /* readonly attribute boolean valid; */
  NS_IMETHOD GetValid(bool *aValid) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMValidityState, NS_IDOMVALIDITYSTATE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMVALIDITYSTATE \
  NS_IMETHOD GetValueMissing(bool *aValueMissing) MOZ_OVERRIDE; \
  NS_IMETHOD GetTypeMismatch(bool *aTypeMismatch) MOZ_OVERRIDE; \
  NS_IMETHOD GetPatternMismatch(bool *aPatternMismatch) MOZ_OVERRIDE; \
  NS_IMETHOD GetTooLong(bool *aTooLong) MOZ_OVERRIDE; \
  NS_IMETHOD GetRangeUnderflow(bool *aRangeUnderflow) MOZ_OVERRIDE; \
  NS_IMETHOD GetRangeOverflow(bool *aRangeOverflow) MOZ_OVERRIDE; \
  NS_IMETHOD GetStepMismatch(bool *aStepMismatch) MOZ_OVERRIDE; \
  NS_IMETHOD GetBadInput(bool *aBadInput) MOZ_OVERRIDE; \
  NS_IMETHOD GetCustomError(bool *aCustomError) MOZ_OVERRIDE; \
  NS_IMETHOD GetValid(bool *aValid) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMVALIDITYSTATE(_to) \
  NS_IMETHOD GetValueMissing(bool *aValueMissing) MOZ_OVERRIDE { return _to GetValueMissing(aValueMissing); } \
  NS_IMETHOD GetTypeMismatch(bool *aTypeMismatch) MOZ_OVERRIDE { return _to GetTypeMismatch(aTypeMismatch); } \
  NS_IMETHOD GetPatternMismatch(bool *aPatternMismatch) MOZ_OVERRIDE { return _to GetPatternMismatch(aPatternMismatch); } \
  NS_IMETHOD GetStepMismatch(bool *aStepMismatch) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStepMismatch(aStepMismatch); } \
  NS_IMETHOD GetBadInput(bool *aBadInput) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBadInput(aBadInput); } \
  NS_IMETHOD GetCustomError(bool *aCustomError) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCustomError(aCustomError); } \
  NS_IMETHOD GetValid(bool *aValid) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValid(aValid); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMValidityState : public nsIDOMValidityState
{
public:
/* readonly attribute boolean stepMismatch; */
NS_IMETHODIMP nsDOMValidityState::GetStepMismatch(bool *aStepMismatch)
{
    return NS_ERROR_NOT_IMPLEMENTED;
{
    return NS_ERROR_NOT_IMPLEMENTED;
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/html/nsIConstraintValidation.h"

class nsIDOMValidityState;

namespace mozilla {
namespace dom {
class ValidityState;
}
}

#define NS_ICONSTRAINTVALIDATION_IID \
{ 0x983829da, 0x1aaf, 0x449c, \
 { 0xa3, 0x06, 0x85, 0xd4, 0xf0, 0x31, 0x1c, 0xf6 } }

/**
 * This interface is for form elements implementing the validity constraint API.
 * See: http://dev.w3.org/html5/spec/forms.html#the-constraint-validation-api
 *
 * This interface has to be implemented by all elements implementing the API
 * and only them.
 */
class nsIConstraintValidation : public nsISupports
{
public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONSTRAINTVALIDATION_IID);

  friend class mozilla::dom::ValidityState;
protected:
  /**
   * A pointer to the ValidityState object.
   */
  nsRefPtr<mozilla::dom::ValidityState>  mValidity;

private:

  /**
   * A bitfield representing the current validity state of the element.
   * Each bit represent an error. All bits to zero means the element is valid.
   */
  int16_t                       mValidityBitField;

  /**
   * Keeps track whether the element is barred from constraint validation.
   */
  bool                          mBarredFromConstraintValidation;

  /**
   * The string representing the custom error.
   */
  nsString                      mCustomValidity;
};

/**
 * Use these macro for class inheriting from nsIConstraintValidation to forward
 * functions to nsIConstraintValidation.
 */
#define NS_FORWARD_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY           \
  NS_IMETHOD GetValidity(nsIDOMValidityState** aValidity) {                   \
    return nsIConstraintValidation::GetValidity(aValidity);                   \
  }                                                                           \
  NS_IMETHOD GetWillValidate(bool* aWillValidate) {                           \
    *aWillValidate = WillValidate();                                          \
    return NS_OK;                                                             \
  }                                                                           \
  NS_IMETHOD GetValidationMessage(nsAString& aValidationMessage) {            \
    return nsIConstraintValidation::GetValidationMessage(aValidationMessage); \
  }                                                                           \
  using nsIConstraintValidation::CheckValidity;                               \
  NS_IMETHOD CheckValidity(bool* aValidity) {                                 \
    return nsIConstraintValidation::CheckValidity(aValidity);                 \
  }

#define NS_FORWARD_NSICONSTRAINTVALIDATION                                    \
  NS_FORWARD_NSICONSTRAINTVALIDATION_EXCEPT_SETCUSTOMVALIDITY                 \

#endif // nsIConstraintValidation_h___
# 176 "/Users/luser/build/mozilla-central/dom/html/nsIConstraintValidation.h"

# 11 "../../dist/include/mozilla/dom/ValidityState.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/ValidityState.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/ValidityState.h"

namespace mozilla {
namespace dom {

class ValidityState MOZ_FINAL : public nsIDOMValidityState,
                                public nsWrapperCache
{
  

public:
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ValidityState)
  NS_DECL_NSIDOMVALIDITYSTATE

  friend class ::nsIConstraintValidation;

  

  virtual JSObject* WrapObject(JSContext *aCx) MOZ_OVERRIDE;

  // Web IDL methods
  
  
  
  
  
  
  
  
  
  

protected:
  ;

  /**
   * Helper function to get a validity state from constraint validation instance.
   */
  

  nsCOMPtr<nsIConstraintValidation> mConstraintValidation;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_ValidityState_h
# 96 "../../dist/include/mozilla/dom/ValidityState.h"

# 20 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ElementInlines.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/ElementInlines.h" 1
/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */
/* vim: set sw=2 sts=2 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_ElementInlines_h
#define mozilla_dom_ElementInlines_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Element.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/ElementInlines.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDocument.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsIDocument_h___
#define nsIDocument_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozFlushType.h"                // for enum
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_DocumentBinding_h
# 90 "../../dist/include/mozilla/dom/DocumentBinding.h"
# 25 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/WeakPtr.h"
#endif /* expanded by -frewrite-includes */
# 26 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h"
#if 0 /* expanded by -frewrite-includes */
#include "Units.h"
#endif /* expanded by -frewrite-includes */
# 27 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsExpirationTracker.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsExpirationTracker.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSEXPIRATIONTRACKER_H_
#define NSEXPIRATIONTRACKER_H_

#if 0 /* expanded by -frewrite-includes */
#include "prlog.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsExpirationTracker.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsExpirationTracker.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsITimer.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsExpirationTracker.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsExpirationTracker.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsExpirationTracker.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsComponentManagerUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsComponentManagerUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsComponentManagerUtils_h__
#define nsComponentManagerUtils_h__

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsComponentManagerUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsComponentManagerUtils.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsIFactory.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIFactory.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIFactory.idl
 */

#ifndef __gen_nsIFactory_h__
#define __gen_nsIFactory_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIFactory.h"
#endif
# 12 "../../dist/include/nsIFactory.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIFactory.h"

/* starting interface:    nsIFactory */
#define NS_IFACTORY_IID_STR "00000001-0000-0000-c000-000000000046"

#define NS_IFACTORY_IID \
  {0x00000001, 0x0000, 0x0000, \
    { 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 }}

class NS_NO_VTABLE nsIFactory : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFACTORY_IID)

  /* void createInstance (in nsISupports aOuter, in nsIIDRef iid, [iid_is (iid), retval] out nsQIResult result); */
  NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void **result) = 0;

  /* void lockFactory (in boolean lock); */
  NS_IMETHOD LockFactory(bool lock) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIFactory, NS_IFACTORY_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIFACTORY \
  NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void **result) MOZ_OVERRIDE; \
  NS_IMETHOD LockFactory(bool lock) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIFACTORY(_to) \
  NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void **result) MOZ_OVERRIDE { return _to CreateInstance(aOuter, iid, result); } \
  NS_IMETHOD LockFactory(bool lock) MOZ_OVERRIDE { return _to LockFactory(lock); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIFACTORY(_to) \
  NS_IMETHOD CreateInstance(nsISupports *aOuter, const nsIID & iid, void **result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateInstance(aOuter, iid, result); } \
  NS_IMETHOD LockFactory(bool lock) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->LockFactory(lock); } 

#if 0
NS_IMETHODIMP nsFactory::CreateInstance(nsISupports *aOuter, const nsIID & iid, void **result)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void lockFactory (in boolean lock); */
NS_IMETHODIMP nsFactory::LockFactory(bool lock)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 101 "../../dist/include/nsIFactory.h"


#endif /* __gen_nsIFactory_h__ */
# 104 "../../dist/include/nsIFactory.h"
# 14 "../../dist/include/nsComponentManagerUtils.h" 2


;

;

;

;


class MOZ_STACK_CLASS nsCreateInstanceByCID : public nsCOMPtr_helper
{
public:
  

  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const
    MOZ_OVERRIDE;

private:
  const nsCID&    mCID;
  nsISupports* MOZ_NON_OWNING_REF mOuter;
  nsresult*       mErrorPtr;
};

class MOZ_STACK_CLASS nsCreateInstanceByContractID : public nsCOMPtr_helper
{
public:
  nsCreateInstanceByContractID(const char* aContractID, nsISupports* aOuter,
                               nsresult* aErrorPtr)
    : mContractID(aContractID)
    , mOuter(aOuter)
    , mErrorPtr(aErrorPtr)
  {
  }

  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const MOZ_OVERRIDE;

private:
  const char*   mContractID;
  nsISupports* MOZ_NON_OWNING_REF mOuter;
  nsresult*     mErrorPtr;
};

class MOZ_STACK_CLASS nsCreateInstanceFromFactory : public nsCOMPtr_helper
{
public:
  

  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const MOZ_OVERRIDE;

private:
  nsIFactory* MOZ_NON_OWNING_REF mFactory;
  nsISupports* MOZ_NON_OWNING_REF mOuter;
  nsresult*     mErrorPtr;
};






inline const nsCreateInstanceByContractID
do_CreateInstance(const char* aContractID, nsresult* aError = 0)
{
  nsresult*     mErrorPtr;
};

/**
 * do_GetClassObject can be used to improve performance of callers
 * that call |CreateInstance| many times.  They can cache the factory
 * and call do_CreateInstance or CallCreateInstance with the cached
 * factory rather than having the component manager retrieve it every
 * time.
 */





# 17 "../../dist/include/nsIObserverService.h"
class nsIObserver; /* forward declaration */

class nsISimpleEnumerator; /* forward declaration */


/* starting interface:    nsIObserverService */
#define NS_IOBSERVERSERVICE_IID_STR "d07f5192-e3d1-11d2-8acd-00105a1b8860"

#define NS_IOBSERVERSERVICE_IID \
  {0xd07f5192, 0xe3d1, 0x11d2, \
    { 0x8a, 0xcd, 0x00, 0x10, 0x5a, 0x1b, 0x88, 0x60 }}

class NS_NO_VTABLE nsIObserverService : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOBSERVERSERVICE_IID)

  /* void addObserver (in nsIObserver anObserver, in string aTopic, in boolean ownsWeak); */
  NS_IMETHOD AddObserver(nsIObserver *anObserver, const char * aTopic, bool ownsWeak) = 0;

  /* void removeObserver (in nsIObserver anObserver, in string aTopic); */
  NS_IMETHOD RemoveObserver(nsIObserver *anObserver, const char * aTopic) = 0;

  /* void notifyObservers (in nsISupports aSubject, in string aTopic, in wstring someData); */
  NS_IMETHOD NotifyObservers(nsISupports *aSubject, const char * aTopic, const char16_t * someData) = 0;

  /* nsISimpleEnumerator enumerateObservers (in string aTopic); */
  NS_IMETHOD EnumerateObservers(const char * aTopic, nsISimpleEnumerator * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIObserverService, NS_IOBSERVERSERVICE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIOBSERVERSERVICE \
  NS_IMETHOD AddObserver(nsIObserver *anObserver, const char * aTopic, bool ownsWeak) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveObserver(nsIObserver *anObserver, const char * aTopic) MOZ_OVERRIDE; \
  NS_IMETHOD NotifyObservers(nsISupports *aSubject, const char * aTopic, const char16_t * someData) MOZ_OVERRIDE; \
  NS_IMETHOD EnumerateObservers(const char * aTopic, nsISimpleEnumerator * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIOBSERVERSERVICE(_to) \
  NS_IMETHOD AddObserver(nsIObserver *anObserver, const char * aTopic, bool ownsWeak) MOZ_OVERRIDE { return _to AddObserver(anObserver, aTopic, ownsWeak); } \
  NS_IMETHOD RemoveObserver(nsIObserver *anObserver, const char * aTopic) MOZ_OVERRIDE { return _to RemoveObserver(anObserver, aTopic); } \
  NS_IMETHOD NotifyObservers(nsISupports *aSubject, const char * aTopic, const char16_t * someData) MOZ_OVERRIDE { return _to NotifyObservers(aSubject, aTopic, someData); } \
  NS_IMETHOD EnumerateObservers(const char * aTopic, nsISimpleEnumerator * *_retval) MOZ_OVERRIDE { return _to EnumerateObservers(aTopic, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIOBSERVERSERVICE(_to) \
  NS_IMETHOD AddObserver(nsIObserver *anObserver, const char * aTopic, bool ownsWeak) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddObserver(anObserver, aTopic, ownsWeak); } \
  NS_IMETHOD RemoveObserver(nsIObserver *anObserver, const char * aTopic) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(anObserver, aTopic); } \
  NS_IMETHOD NotifyObservers(nsISupports *aSubject, const char * aTopic, const char16_t * someData) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyObservers(aSubject, aTopic, someData); } \
  NS_IMETHOD EnumerateObservers(const char * aTopic, nsISimpleEnumerator * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->EnumerateObservers(aTopic, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsObserverService : public nsIObserverService
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 129 "../../dist/include/nsIObserverService.h"


#endif /* __gen_nsIObserverService_h__ */
# 132 "../../dist/include/nsIObserverService.h"
# 17 "../../dist/include/nsExpirationTracker.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsExpirationTracker.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Services.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Services.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_Services_h
#define mozilla_Services_h

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/Services.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/Services.h"

#define MOZ_USE_NAMESPACE
#define MOZ_SERVICE(NAME, TYPE, SERVICE_CID) class TYPE;

#if 0 /* expanded by -frewrite-includes */
#include "ServiceList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ServiceList.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "mozilla/Services.h"

#ifdef ACCESSIBILITY
MOZ_SERVICE(AccessibilityService, nsIAccessibilityService,
            "@mozilla.org/accessibilityService;1")
#endif
# 10 "../../dist/include/mozilla/ServiceList.h"
MOZ_SERVICE(ChromeRegistryService, nsIChromeRegistry,
            "@mozilla.org/chrome/chrome-registry;1")
MOZ_SERVICE(ToolkitChromeRegistryService, nsIToolkitChromeRegistry,
            "@mozilla.org/chrome/chrome-registry;1")
MOZ_SERVICE(XULChromeRegistryService, nsIXULChromeRegistry,
            "@mozilla.org/chrome/chrome-registry;1")
MOZ_SERVICE(XULOverlayProviderService, nsIXULOverlayProvider,
            "@mozilla.org/chrome/chrome-registry;1")
MOZ_SERVICE(IOService, nsIIOService,
            "@mozilla.org/network/io-service;1")
MOZ_SERVICE(ObserverService, nsIObserverService,
            "@mozilla.org/observer-service;1")
MOZ_SERVICE(StringBundleService, nsIStringBundleService,
            "@mozilla.org/intl/stringbundle;1")
MOZ_SERVICE(XPConnect, nsIXPConnect,
            "@mozilla.org/js/xpc/XPConnect;1")
MOZ_SERVICE(InDOMUtils, inIDOMUtils,
            "@mozilla.org/inspector/dom-utils;1")
MOZ_SERVICE(PermissionManager, nsIPermissionManager,
            "@mozilla.org/permissionmanager;1");
MOZ_SERVICE(ServiceWorkerManager, nsIServiceWorkerManager,
            "@mozilla.org/serviceworkers/manager;1");
MOZ_SERVICE(AsyncShutdown, nsIAsyncShutdownService,
            "@mozilla.org/async-shutdown-service;1")

#ifdef MOZ_USE_NAMESPACE
namespace mozilla {
#endif
# 38 "../../dist/include/mozilla/ServiceList.h"

MOZ_SERVICE(HistoryService, IHistory,
            "@mozilla.org/browser/history;1")

#ifdef MOZ_USE_NAMESPACE
}
#endif
# 45 "../../dist/include/mozilla/ServiceList.h"
# 16 "../../dist/include/mozilla/Services.h" 2
#undef MOZ_SERVICE
#undef MOZ_USE_NAMESPACE

namespace mozilla {
namespace services {

#ifdef MOZILLA_INTERNAL_API
#define MOZ_SERVICE(NAME, TYPE, SERVICE_CID)                        \
    already_AddRefed<TYPE> Get##NAME();                             \
    NS_EXPORT_(already_AddRefed<TYPE>) _external_Get##NAME();

#if 0 /* expanded by -frewrite-includes */
#include "ServiceList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ServiceList.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "mozilla/Services.h"

#ifdef ACCESSIBILITY
MOZ_SERVICE(AccessibilityService, nsIAccessibilityService,
            "@mozilla.org/accessibilityService;1")
#endif
# 10 "../../dist/include/mozilla/ServiceList.h"
MOZ_SERVICE(ChromeRegistryService, nsIChromeRegistry,
            "@mozilla.org/chrome/chrome-registry;1")
MOZ_SERVICE(ToolkitChromeRegistryService, nsIToolkitChromeRegistry,
            "@mozilla.org/chrome/chrome-registry;1")
MOZ_SERVICE(XULChromeRegistryService, nsIXULChromeRegistry,
            "@mozilla.org/chrome/chrome-registry;1")
MOZ_SERVICE(XULOverlayProviderService, nsIXULOverlayProvider,
            "@mozilla.org/chrome/chrome-registry;1")
MOZ_SERVICE(IOService, nsIIOService,
            "@mozilla.org/network/io-service;1")
MOZ_SERVICE(ObserverService, nsIObserverService,
            "@mozilla.org/observer-service;1")
# 38 "../../dist/include/mozilla/ServiceList.h"

MOZ_SERVICE(HistoryService, IHistory,
            "@mozilla.org/browser/history;1")

#ifdef MOZ_USE_NAMESPACE
}
#endif
# 45 "../../dist/include/mozilla/ServiceList.h"
# 28 "../../dist/include/mozilla/Services.h" 2
#undef MOZ_SERVICE
#else
# 30 "../../dist/include/mozilla/Services.h"
#define MOZ_SERVICE(NAME, TYPE, SERVICE_CID)                        \
    NS_IMPORT_(already_AddRefed<TYPE>) _external_Get##NAME();       \
    inline already_AddRefed<TYPE> Get##NAME()                       \
    {                                                               \
        return _external_Get##NAME();                               \
    }

#if 0 /* expanded by -frewrite-includes */
#include "ServiceList.h"
#endif /* expanded by -frewrite-includes */
# 38 "../../dist/include/mozilla/Services.h"
#undef MOZ_SERVICE
#endif
# 40 "../../dist/include/mozilla/Services.h"

} // namespace services
} // namespace mozilla

#endif
# 45 "../../dist/include/mozilla/Services.h"
# 19 "../../dist/include/nsExpirationTracker.h" 2

/**
 * 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.
 */
struct nsExpirationState
{
  enum
  {
    NOT_TRACKED = (1U << 4) - 1,
    MAX_INDEX_IN_GENERATION = (1U << 28) - 1
  };

  
  

  /**
   * The generation that this object belongs to, or NOT_TRACKED.
   */
  uint32_t mGeneration:4;
  uint32_t mIndexInGeneration:28;
};

/**
 * nsExpirationTracker can track the lifetimes and usage of a large number of
 * objects, and send a notification some window of time after a live object was
 * last used. This is very useful when you manage a large number of objects
 * and want to flush some after they haven't been used for a while.
 * nsExpirationTracker is designed to be very space and time efficient.
 * are stored in a cyclic array; when a timer interrupt fires, we advance
 * the current generation pointer to effectively age all objects very efficiently.
 * By storing information in each object about its generation and index within its
 * generation array, we make removal of objects from a generation very cheap.
 *
 * Future work:
 * -- Add a method to change the timer period?
 */
template<class T, uint32_t K>
class nsExpirationTracker
{
public:
  /**
   * Initialize the tracker.
   * @param aTimerPeriod the timer period in milliseconds. The guarantees
   * provided by the tracker are defined in terms of this period. If the
   * once here in the same timer tick.
   */
  virtual void NotifyExpired(T* aObj) = 0;

private:
  class ExpirationTrackerObserver;
  nsRefPtr<ExpirationTrackerObserver> mObserver;
  nsTArray<T*>       mGenerations[K];
  nsCOMPtr<nsITimer> mTimer;
  uint32_t           mTimerPeriod;
  uint32_t           mNewestGeneration;
  bool               mInAgeOneGeneration;

  /**
   * Whenever "memory-pressure" is observed, it calls AgeAllGenerations()
   * to minimize memory usage.
   */
  class ExpirationTrackerObserver MOZ_FINAL : public nsIObserver
  {
  public:
    
    
    NS_DECL_ISUPPORTS
    NS_DECL_NSIOBSERVER
  private:
    nsExpirationTracker<T, K>* mOwner;
  };

  

  
};

template<class T, uint32_t K>
NS_IMETHODIMP
nsExpirationTracker<T, K>::ExpirationTrackerObserver::Observe(
    nsISupports* aSubject, const char* aTopic, const char16_t* aData)
{
  return mRefCnt;
}

template<class T, uint32_t K>
NS_IMETHODIMP
nsExpirationTracker<T, K>::ExpirationTrackerObserver::QueryInterface(
    REFNSIID aIID, void** aInstancePtr)
{
  NS_ASSERTION(aInstancePtr,
               "QueryInterface requires a non-NULL destination!");
  nsresult rv = NS_ERROR_FAILURE;
  NS_INTERFACE_TABLE(ExpirationTrackerObserver, nsIObserver)
  return rv;
}

#endif /*NSEXPIRATIONTRACKER_H_*/
# 418 "../../dist/include/nsExpirationTracker.h"
# 28 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsClassHashtable.h"
#endif /* expanded by -frewrite-includes */
# 29 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h"
#if 0 /* expanded by -frewrite-includes */
#include "prclist.h"
#endif /* expanded by -frewrite-includes */
# 30 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxVR.h"
#endif /* expanded by -frewrite-includes */
# 31 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h"

class imgIRequest;
class nsAString;
class nsBindingManager;
class nsIDocShell;
class nsDocShell;
class nsDOMNavigationTiming;
class nsFrameLoader;
class nsHTMLCSSStyleSheet;
class nsHTMLDocument;
class nsHTMLStyleSheet;
class nsIAtom;
class nsIBFCacheEntry;
class nsIChannel;
class nsIContent;
class nsIContentSink;
class nsIDocShell;
class nsIDocumentEncoder;
class nsIDocumentObserver;
class nsIDOMDocument;
class nsIDOMDocumentFragment;
class nsIDOMDocumentType;
class nsIDOMElement;
class nsIDOMNodeFilter;
class nsIDOMNodeList;
class nsIHTMLCollection;
class nsILayoutHistoryState;
class nsILoadContext;
class nsIObjectLoadingContent;
class nsIObserver;
class nsIPresShell;
class nsIPrincipal;
class nsIRequest;
class nsIStreamListener;
class nsIStructuredCloneContainer;
class nsIStyleRule;
class nsIStyleSheet;
class nsIURI;
class nsIVariant;
class nsLocation;
class nsViewManager;
class nsPresContext;
class nsRange;
class nsScriptLoader;
class nsSMILAnimationController;
class nsStyleSet;
class nsTextNode;
class nsWindowSizes;
class nsSmallVoidArray;
class nsDOMCaretPosition;
class nsViewportInfo;
class nsIGlobalObject;
struct nsCSSSelectorList;

namespace mozilla {
class CSSStyleSheet;
class ErrorResult;
class EventStates;
class PendingPlayerTracker;
class SVGAttrAnimationRuleProcessor;

namespace css {
class Loader;
class ImageLoader;
} // namespace css

namespace dom {
class AnimationTimeline;
class AnonymousContent;
class Attr;
class BoxObject;
class CDATASection;
class Comment;
struct CustomElementDefinition;
class DocumentFragment;
class DocumentType;
class DOMImplementation;
class DOMStringList;
class Element;
struct ElementRegistrationOptions;
class Event;
class EventTarget;
class FontFaceSet;
class FrameRequestCallback;
class ImportManager;
class OverfillCallback;
class HTMLBodyElement;
struct LifecycleCallbackArgs;
class Link;
class MediaQueryList;
class GlobalObject;
class NodeFilter;
class NodeIterator;
class ProcessingInstruction;
class StyleSheetList;
class SVGDocument;
class Touch;
class TouchList;
class TreeWalker;
class UndoManager;
class XPathEvaluator;
class XPathExpression;
class XPathNSResolver;
class XPathResult;
template<typename> class OwningNonNull;
template<typename> class Sequence;

template<typename, typename> class CallbackObjectHolder;
typedef CallbackObjectHolder<NodeFilter, nsIDOMNodeFilter> NodeFilterHolder;

struct FullScreenOptions {
  
  nsRefPtr<gfx::VRHMDInfo> mVRHMDDevice;
};

} // namespace dom
} // namespace mozilla

#define NS_IDOCUMENT_IID \
{ 0x0b78eabe, 0x8b94, 0x4ea1, \
  { 0x93, 0x31, 0x5d, 0x48, 0xe8, 0x3a, 0xda, 0x95 } }

// Enum for requesting a particular type of document when creating a doc
enum DocumentFlavor {
  DocumentFlavorLegacyGuess, // compat with old code until made HTML5-compliant
  DocumentFlavorHTML, // HTMLDocument with HTMLness bit set to true
  DocumentFlavorSVG, // SVGDocument
  DocumentFlavorPlain, // Just a Document
};

// Document states

// RTL locale: specific to the XUL localedir attribute
#define NS_DOCUMENT_STATE_RTL_LOCALE              NS_DEFINE_EVENT_STATE_MACRO(0)
// Window activation status
#define NS_DOCUMENT_STATE_WINDOW_INACTIVE         NS_DEFINE_EVENT_STATE_MACRO(1)

// Some function forward-declarations
class nsContentList;

;

//----------------------------------------------------------------------

// Document interface.  This is implemented by all document objects in
// Gecko.
class nsIDocument : public nsINode
{
  typedef mozilla::dom::GlobalObject GlobalObject;
public:
  typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
  typedef mozilla::dom::Element Element;

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENT_IID)
  NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW

#ifdef MOZILLA_INTERNAL_API
  nsIDocument();
#endif
# 193 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h"

  /**
   * Let the document know that we're starting to load data into it.
   * @param aCommand The parser command. Must not be null.
   *                 XXXbz It's odd to have that here.
   * @param aChannel The channel the data will come from. The channel must be
   *                 able to report its Content-Type.
   * @param aLoadGroup The loadgroup this document should use from now on.
   *                   Note that the document might not be the only thing using
   *                   this loadgroup.
   * @param aContainer The container this document is in.  This may be null.
   *                   XXXbz maybe we should make it more explicit (eg make the

  /**
   * Return the URI for the document. May return null.
   *
   * The value returned corresponds to the "document's current address" in
   * HTML5.  As such, it may change over the lifetime of the document, for
   * instance as a result of a call to pushState() or replaceState().
   */
  nsIURI* GetDocumentURI() const
  {
    return mDocumentURI;
  }

  /**
  

  /**
   * Set the principal responsible for this document.
   */
  ;

  /**
   * Return the LoadGroup for the document. May return null.
   */
  

  /**
   * Return the base URI for relative URIs in the document (the document uri
   * unless it's overridden by SetBaseURI, HTML <base> tags, etc.).  The
   * returned URI could be null if there is no document URI.  If the document
   * is a srcdoc document, return the parent document's base URL.
   */
  nsIURI* GetDocBaseURI() const
  {
    if (mIsSrcdocDocument && mParentDocument) {
      return mParentDocument->GetDocBaseURI();
    }
    return mDocumentBaseURI ? mDocumentBaseURI : mDocumentURI;
  }
  virtual already_AddRefed<nsIURI> GetBaseURI(bool aTryUseXHRDocBaseURI = false) const MOZ_OVERRIDE;

  ;

  /**
   * Get/Set the base target of a link in a document.
   * Set the tracking content loaded flag for this document.
   */
  

  /**
   * Get the sandbox flags for this document.
   * @see nsSandboxFlags.h for the possible flags
   */
  

  /**
   * Set the sandbox flags for this document.
   * @see nsSandboxFlags.h for the possible flags
   */
  

  /**
   * Access HTTP header data (this may also get set from other
   * sources, like HTML META tags).
   */
  ;
  ;

  /**
   * Create a new presentation shell that will use aContext for its
   * presentation context (presentation contexts <b>must not</b> be
   * shared among multiple presentation shells). The caller of this
   * method is responsible for calling BeginObservingDocument() on the
   * presshell if the presshell should observe document mutations.
   */
  ;
  ;

  nsIPresShell* GetShell() const
  {
    return GetBFCacheEntry() ? nullptr : mPresShell;
  }

  

  

  

  nsIBFCacheEntry* GetBFCacheEntry() const
  {
    return mBFCacheEntry;
  }

  /**
   * Return the parent document of this document. Will return null
   * unless this document is within a compound document and has a
   * parent. Note that this parent chain may cross chrome boundaries.
   */
  

  /**
   * Set the parent document of this document.
   */
  
  
  /**
   * Get this document's CSSLoader.  This is guaranteed to not return null.
   */
  mozilla::css::Loader* CSSLoader() const {
    return mCSSLoader;
  }

  /**
   * Get this document's StyleImageLoader.  This is guaranteed to not return null.
   */
  

  /**
   * Get the channel that was passed to StartDocumentLoad or Reset for this
   * document.  Note that this may be null in some cases (eg if
   * StartDocumentLoad or Reset were never called)
   */
  ;

  /**
   * Get this document's attribute stylesheet.  May return null if
   * there isn't one.
   */
  

  /**
   * Get this document's inline style sheet.  May return null if there
   * isn't one
   */
  

  /**
   * the document's activity changes such as OnPageHide, visibility, activity.
   * The ActivityObserver objects can be nsIObjectLoadingContent or
   * nsIDocumentActivity or HTMLMEdiaElement.
   */
  void RegisterActivityObserver(nsISupports* aSupports);
  bool UnregisterActivityObserver(nsISupports* aSupports);
  /**
   * Decrement the number of external scripts being evaluated.
   */
  

  

  /**
   * Returns true if this document is allowed to contain XUL element and
   * use non-builtin XBL bindings.
   */
  

  

  /**
   * Returns the template content owner document that owns the content of
   * HTMLTemplateElement.
   */
  ;

  /**
   * true when this document is a static clone of a normal document.
   * For example print preview and printing use static documents.
   */
  ;

#define DEPRECATED_OPERATION(_op) e##_op,
  enum DeprecatedOperations {
#if 0 /* expanded by -frewrite-includes */
#include "nsDeprecatedOperationList.h"
#endif /* expanded by -frewrite-includes */
DEPRECATED_OPERATION(GetSetUserData)
DEPRECATED_OPERATION(MozGetAsFile)
DEPRECATED_OPERATION(UseOfCaptureEvents)
DEPRECATED_OPERATION(UseOfReleaseEvents)
DEPRECATED_OPERATION(UseOfDOM3LoadMethod)
DEPRECATED_OPERATION(ShowModalDialog)
DEPRECATED_OPERATION(Window_Content)
DEPRECATED_OPERATION(SyncXMLHttpRequest)
DEPRECATED_OPERATION(DataContainerEvent)
DEPRECATED_OPERATION(Window_Controllers)
DEPRECATED_OPERATION(ImportXULIntoContent)
# 2145 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h" 2
    eDeprecatedOperationCount
  };
#undef DEPRECATED_OPERATION
  ;
  void WarnOnceAbout(DeprecatedOperations aOperation, bool asError = false);

#define DOCUMENT_WARNING(_op) e##_op,
  enum DocumentWarnings {
#if 0 /* expanded by -frewrite-includes */
#include "nsDocumentWarningList.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsDocumentWarningList.h" 1

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// IWYU pragma: private, include "nsIDocument.h"

/*
 * This file contains the list of document DOM operations warnings.  It is
 * designed to be used as input to the C preprocessor *only*.
 */

DOCUMENT_WARNING(WillChangeBudget)
# 2154 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h" 2
    eDocumentWarningCount
  };
#undef DOCUMENT_WARNING
  ;
  ;

  ;
  
  

  void SetNeedLayoutFlush() {
    mNeedLayoutFlush = true;
    if (mDisplayDocument) {
      mDisplayDocument->SetNeedLayoutFlush();
    }
  }

  nsCOMPtr<nsIURI> mDocumentURI;
  nsCOMPtr<nsIURI> mOriginalURI;
  nsCOMPtr<nsIURI> mChromeXHRDocURI;
  nsCOMPtr<nsIURI> mDocumentBaseURI;
  nsCOMPtr<nsIURI> mChromeXHRDocBaseURI;

  nsWeakPtr mDocumentLoadGroup;

  bool mReferrerPolicySet;
  ReferrerPolicy mReferrerPolicy;

  mozilla::WeakPtr<nsDocShell> mDocumentContainer;

  nsCString mCharacterSet;
  int32_t mCharacterSetSource;

  // This is just a weak pointer; the parent document owns its children.
  nsIDocument* mParentDocument;

  // A reference to the element last returned from GetRootElement().
  mozilla::dom::Element* mCachedRootElement;

  // This is a weak reference, but we hold a strong reference to mNodeInfo,
  // which in turn holds a strong reference to this mNodeInfoManager.
  nsNodeInfoManager* mNodeInfoManager;
  nsRefPtr<mozilla::css::Loader> mCSSLoader;
  nsRefPtr<mozilla::css::ImageLoader> mStyleImageLoader;
  nsRefPtr<nsHTMLStyleSheet> mAttrStyleSheet;
  nsRefPtr<nsHTMLCSSStyleSheet> mStyleAttrStyleSheet;
  nsRefPtr<mozilla::SVGAttrAnimationRuleProcessor> mSVGAttrAnimationRuleProcessor;


  // True if this document has links whose state needs updating
  bool mHasLinksToUpdate;

  // True if a layout flush might not be a no-op
  bool mNeedLayoutFlush;

  // True if a style flush might not be a no-op
  bool mNeedStyleFlush;

  // True if a DOMMutationObserver is perhaps attached to a node in the document.
  // Whether the document was created by a srcdoc iframe.
  bool mIsSrcdocDocument;

  // Records whether we've done a document.open. If this is true, it's possible
  // for nodes from this document to have outdated wrappers in their wrapper
  // caches.
  bool mDidDocumentOpen;

#ifdef DEBUG
  /**
   * This is true while FlushPendingLinkUpdates executes.  Calls to
   * [Un]RegisterPendingLinkUpdate will assert when this is true.
   */
  bool mIsLinkUpdateRegistrationsForbidden;
#endif
# 2742 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h"

  enum Type {
    eUnknown, // should never be used
    eHTML,
    eXHTML,
    eGenericXML,
    eSVG,
    eXUL
  };

  uint8_t mType;

  uint8_t mDefaultElementType;

  enum {
    eTriUnset = 0,
    eTriFalse,
    eTriTrue
  };

  uint8_t mAllowXULXBL;

  // The document's script global object, the object from which the
  // document can get its script context and scope. This is the
  // *inner* window object.
  nsCOMPtr<nsIScriptGlobalObject> mScriptGlobalObject;

  // If mIsStaticDocument is true, mOriginalDocument points to the original
  // document.
  nsCOMPtr<nsIDocument> mOriginalDocument;

  // The bidi options for this document.  What this bitfield means is
  // The document's security info
  nsCOMPtr<nsISupports> mSecurityInfo;

  // The channel that failed to load and resulted in an error page.
  // This only applies to error pages. Might be null.
  nsCOMPtr<nsIChannel> mFailedChannel;

  // if this document is part of a multipart document,
  // the ID can be used to distinguish it from the other parts.
  uint32_t mPartID;
  
  // Cycle collector generation in which we're certain that this document
  // won't be collected
  uint32_t mMarkedCCGeneration;

  nsIPresShell* mPresShell;

  nsCOMArray<nsINode> mSubtreeModifiedTargets;
  uint32_t            mSubtreeModifiedDepth;

  // If we're an external resource document, this will be non-null and will
  // point to our "display document": the one that all resource lookups should
  // go to.
  nsCOMPtr<nsIDocument> mDisplayDocument;

  uint32_t mEventsSuppressed;

  uint32_t mAnimationsPaused;

  /**
   * The number number of external scripts (ones with the src attribute) that
   * have this document as their owner and that are being evaluated right now.
   */
  uint32_t mExternalScriptsBeingEvaluated;

  /**
   * The current frame request callback handle
   */
  int32_t mFrameRequestCallbackCounter;

  // Array of nodes that have been blocked to prevent user tracking.
  // They most likely have had their nsIChannel canceled by the URL
  // classifier. (Safebrowsing)
  //
  // Weak nsINode pointers are used to allow nodes to disappear.
  nsTArray<nsWeakPtr> mBlockedTrackingNodes;

  // Weak reference to mScriptGlobalObject QI:d to nsPIDOMWindow,
  // updated on every set of mSecriptGlobalObject.
  nsPIDOMWindow *mWindow;

  nsCOMPtr<nsIDocumentEncoder> mCachedEncoder;

  struct FrameRequest;

  nsTArray<FrameRequest> mFrameRequestCallbacks;

  // This object allows us to evict ourself from the back/forward cache.  The
  // pointer is non-null iff we're currently in the bfcache.
  nsIBFCacheEntry *mBFCacheEntry;

  // Our base target.
  nsString mBaseTarget;

  nsCOMPtr<nsIStructuredCloneContainer> mStateObjectContainer;
  nsCOMPtr<nsIVariant> mStateObjectCached;

  uint32_t mInSyncOperationCount;

  nsRefPtr<mozilla::dom::XPathEvaluator> mXPathEvaluator;

  nsTArray<nsRefPtr<mozilla::dom::AnonymousContent>> mAnonymousContents;

  uint32_t mBlockDOMContentLoaded;
  bool mDidFireDOMContentLoaded:1;

  // Our live MediaQueryLists
  PRCList mDOMMediaQueryLists;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocument, NS_IDOCUMENT_IID)

/**
 * mozAutoSubtreeModified batches DOM mutations so that a DOMSubtreeModified
 * event is dispatched, if necessary, when the outermost mozAutoSubtreeModified
 * object is deleted.
 */
class MOZ_STACK_CLASS mozAutoSubtreeModified
{
public:
  /**
   * @param aSubTreeOwner The document in which a subtree will be modified.
   * @param aTarget       The target of the possible DOMSubtreeModified event.
   *                      Can be nullptr, in which case mozAutoSubtreeModified
   *                      is just used to batch DOM mutations.
   */
private:
  nsCOMArray<nsIDocument> mDocuments;
  uint32_t                mMicroTaskLevel;
};

// XXX These belong somewhere else
;

;

;

;

;

// Note: it's the caller's responsibility to create or get aPrincipal as needed
// -- this method will not attempt to get a principal based on aDocumentURI.
// Also, both aDocumentURI and aBaseURI must not be null.
;

// This is used only for xbl documents created from the startup cache.
// Non-cached documents are created in the same manner as xml documents.
;

;



inline nsINode*
nsINode::OwnerDocAsNode() const
{
  return OwnerDoc();
}

inline mozilla::dom::ParentObject
nsINode::GetParentObject() const
{
  mozilla::dom::ParentObject p(OwnerDoc());
    // Note that mUseXBLScope is a no-op for chrome, and other places where we
    // don't use XBL scopes.
  p.mUseXBLScope = IsInAnonymousSubtree() && !IsAnonymousContentInSVGUseSubtree();
  return p;
}

#endif /* nsIDocument_h___ */
# 2992 "/Users/luser/build/mozilla-central/dom/base/nsIDocument.h"
# 12 "../../dist/include/mozilla/dom/ElementInlines.h" 2

namespace mozilla {
namespace dom {

inline void
Element::RegisterActivityObserver()
{
  OwnerDoc()->RegisterActivityObserver(this);
}

inline void
Element::UnregisterActivityObserver()
{
  OwnerDoc()->UnregisterActivityObserver(this);
}

}
}

#endif // mozilla_dom_ElementInlines_h
# 32 "../../dist/include/mozilla/dom/ElementInlines.h"
# 21 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h" 2

class nsDOMSettableTokenList;
class nsIDOMHTMLMenuElement;
class nsIEditor;
class nsIFormControlFrame;
class nsIFrame;
class nsILayoutHistoryState;
class nsIURI;
class nsPresState;
struct nsSize;

namespace mozilla {
class EventChainPostVisitor;
class EventChainPreVisitor;
class EventChainVisitor;
class EventListenerManager;
class EventStates;
namespace dom {
class HTMLFormElement;
class HTMLPropertiesCollection;
class HTMLMenuElement;
}
}

typedef nsMappedAttributeElement nsGenericHTMLElementBase;

/**
 * A common superclass for HTML elements
 */
class nsGenericHTMLElement : public nsGenericHTMLElementBase,
                             public nsIDOMHTMLElement
{
public:
  

  NS_DECL_ISUPPORTS_INHERITED

  NS_IMPL_FROMCONTENT(nsGenericHTMLElement, kNameSpaceID_XHTML)

  // From Element
  ;

  void GetTitle(mozilla::dom::DOMString& aTitle)
  {
    GetHTMLAttr(nsGkAtoms::title, aTitle);
  }
  NS_IMETHODIMP SetTitle(const nsAString& aTitle) MOZ_OVERRIDE
  {
    SetHTMLAttr(nsGkAtoms::title, aTitle);
    return NS_OK;
  }
  void GetLang(mozilla::dom::DOMString& aLang)
  {
    GetHTMLAttr(nsGkAtoms::lang, aLang);
  }
  NS_IMETHODIMP SetLang(const nsAString& aLang) MOZ_OVERRIDE
  {
    SetHTMLAttr(nsGkAtoms::lang, aLang);
    return NS_OK;
  }
  void GetDir(mozilla::dom::DOMString& aDir)
  {
    GetHTMLEnumAttr(nsGkAtoms::dir, aDir);
  }
  void SetDir(const nsAString& aDir, mozilla::ErrorResult& aError)
  {
    SetHTMLAttr(nsGkAtoms::dir, aDir, aError);
  }
  ;
  bool ItemScope() const
  {
    return GetBoolAttr(nsGkAtoms::itemscope);
  }
  void SetItemScope(bool aItemScope, mozilla::ErrorResult& aError)
  ;
  bool Hidden() const
  {
    return GetBoolAttr(nsGkAtoms::hidden);
  }
  void SetHidden(bool aHidden, mozilla::ErrorResult& aError)
  {
    SetHTMLBoolAttr(nsGkAtoms::hidden, aHidden, aError);
  }
  virtual void Click();
  virtual int32_t TabIndexDefault()
  {
    return -1;
  }
  int32_t TabIndex()
  {
    return GetIntAttr(nsGkAtoms::tabindex, TabIndexDefault());
  }
  void SetTabIndex(int32_t aTabIndex, mozilla::ErrorResult& aError)
  {
    SetHTMLIntAttr(nsGkAtoms::tabindex, aTabIndex, aError);
  }
  virtual void Focus(mozilla::ErrorResult& aError);
  virtual void Blur(mozilla::ErrorResult& aError);
  
  void SetAccessKey(const nsAString& aAccessKey, mozilla::ErrorResult& aError)
  {
    SetHTMLAttr(nsGkAtoms::accesskey, aAccessKey, aError);
  }
  ;
  virtual bool Draggable() const
  {
    return AttrValueIs(kNameSpaceID_None, nsGkAtoms::draggable,
                       nsGkAtoms::_true, eIgnoreCase);
  }
  void SetDraggable(bool aDraggable, mozilla::ErrorResult& aError)
  {
    SetHTMLAttr(nsGkAtoms::draggable,
                aDraggable ? NS_LITERAL_STRING("true")
                           : NS_LITERAL_STRING("false"),
                aError);
  }
  
  void SetContentEditable(const nsAString& aContentEditable,
                          mozilla::ErrorResult& aError)
  {
    if (aContentEditable.LowerCaseEqualsLiteral("inherit")) {
      UnsetHTMLAttr(nsGkAtoms::contenteditable, aError);
    } else if (aContentEditable.LowerCaseEqualsLiteral("true")) {
      SetHTMLAttr(nsGkAtoms::contenteditable, NS_LITERAL_STRING("true"), aError);
    } else if (aContentEditable.LowerCaseEqualsLiteral("false")) {
      SetHTMLAttr(nsGkAtoms::contenteditable, NS_LITERAL_STRING("false"), aError);
    } else {
      aError.Throw(NS_ERROR_DOM_SYNTAX_ERR);
    }
  }
  bool IsContentEditable()
  {
    for (nsIContent* node = this; node; node = node->GetParent()) {
      nsGenericHTMLElement* element = FromContent(node);
      if (element) {
        ContentEditableTristate value = element->GetContentEditableValue();
        if (value != eInherit) {
          return value == eTrue;
        }
      }
    }
    return false;
  }
  ;
  bool Spellcheck();
  void SetSpellcheck(bool aSpellcheck, mozilla::ErrorResult& aError)
  {
    SetHTMLAttr(nsGkAtoms::spellcheck,
                aSpellcheck ? NS_LITERAL_STRING("true")
                            : NS_LITERAL_STRING("false"),
                aError);
  }
  
  void SetScrollgrab(bool aValue)
  {
    mScrollgrab = aValue;
  }

  /**
   * Determine whether an attribute is an event (onclick, etc.)
   * @param aName the attribute
   * @return whether the name is an event handler name
   */
  virtual bool IsEventAttributeName(nsIAtom* aName) MOZ_OVERRIDE;

#define EVENT(name_, id_, type_, struct_) /* nothing; handled by nsINode */
// The using nsINode::Get/SetOn* are to avoid warnings about shadowing the XPCOM
// getter and setter on nsINode.
#define FORWARDED_EVENT(name_, id_, type_, struct_)                           \
  using nsINode::GetOn##name_;                                                \
  using nsINode::SetOn##name_;                                                \
  mozilla::dom::EventHandlerNonNull* GetOn##name_();                          \
  void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler);
#define ERROR_EVENT(name_, id_, type_, struct_)                               \
  using nsINode::GetOn##name_;                                                \
  using nsINode::SetOn##name_;                                                \
  already_AddRefed<mozilla::dom::EventHandlerNonNull> GetOn##name_();         \
  void SetOn##name_(mozilla::dom::EventHandlerNonNull* handler);
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventNameList.h" // IWYU pragma: keep
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EventNameList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef NON_IDL_EVENT
#define NON_IDL_EVENT(_name, _id, _type, _struct)
#define DEFINED_NON_IDL_EVENT
#endif /* NON_IDL_EVENT */
# 131 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_ERROR_EVENT
#error "Don't define DEFINED_ERROR_EVENT"
#endif /* DEFINED_ERROR_EVENT */
# 135 "../../dist/include/mozilla/EventNameList.h"

#ifndef ERROR_EVENT
#define ERROR_EVENT FORWARDED_EVENT
#define DEFINED_ERROR_EVENT
#endif /* ERROR_EVENT */
# 140 "../../dist/include/mozilla/EventNameList.h"
EVENT(contextmenu,
      NS_CONTEXTMENU,
      EventNameType_HTMLXUL,
      eMouseEventClass)
// Not supported yet
// EVENT(cuechange)
EVENT(dblclick,
      NS_MOUSE_DOUBLECLICK,
      EventNameType_HTMLXUL,
      eMouseEventClass)
EVENT(drag,
      NS_DRAGDROP_DRAG,
      EventNameType_HTMLXUL,
      eDragEventClass)
EVENT(dragend,
      NS_DRAGDROP_END,
      EventNameType_All,
      ePointerEventClass)
EVENT(pointermove,
      NS_POINTER_MOVE,
      EventNameType_All,
      ePointerEventClass)
EVENT(pointerup,
      NS_POINTER_UP,
      EventNameType_All,
      ePointerEventClass)
EVENT(pointercancel,
      NS_POINTER_CANCEL,
      EventNameType_All,
      ePointerEventClass)
#ifdef DEFINED_FORWARDED_EVENT
#undef DEFINED_FORWARDED_EVENT
#undef FORWARDED_EVENT
#endif /* DEFINED_FORWARDED_EVENT */
# 933 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_WINDOW_EVENT
#undef DEFINED_WINDOW_EVENT
#undef WINDOW_EVENT
#endif /* DEFINED_WINDOW_EVENT */
# 938 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_WINDOW_ONLY_EVENT
#undef DEFINED_WINDOW_ONLY_EVENT
#undef WINDOW_ONLY_EVENT
#endif /* DEFINED_WINDOW_ONLY_EVENT */
# 943 "../../dist/include/mozilla/EventNameList.h"

# 958 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_ERROR_EVENT
#undef DEFINED_ERROR_EVENT
#undef ERROR_EVENT
#endif /* DEFINED_ERROR_EVENT */
# 963 "../../dist/include/mozilla/EventNameList.h"

#ifdef DEFINED_BEFOREUNLOAD_EVENT
#undef DEFINED_BEFOREUNLOAD_EVENT
#undef BEFOREUNLOAD_EVENT
#endif /* BEFOREUNLOAD_EVENT */
# 968 "../../dist/include/mozilla/EventNameList.h"

#ifdef ID_TO_EVENT
#undef EVENT
#undef WINDOW_ONLY_EVENT
#undef TOUCH_EVENT
#undef DOCUMENT_ONLY_EVENT
#undef NON_IDL_EVENT
#endif /* ID_TO_EVENT */
# 976 "../../dist/include/mozilla/EventNameList.h"

# 257 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h" 2
#undef ERROR_EVENT
#undef FORWARDED_EVENT
#undef EVENT
  mozilla::dom::Element* GetOffsetParent()
  {
    mozilla::CSSIntRect rcFrame;
    return GetOffsetRect(rcFrame);
  }
  int32_t OffsetTop()
  {
    mozilla::CSSIntRect rcFrame;
    GetOffsetRect(rcFrame);

    return rcFrame.y;
  }
  int32_t OffsetLeft()
  {
    mozilla::CSSIntRect rcFrame;
    GetOffsetRect(rcFrame);

    return rcFrame.x;
  }
  int32_t OffsetWidth()
  {
    mozilla::CSSIntRect rcFrame;
    GetOffsetRect(rcFrame);

    return rcFrame.width;
  }
  int32_t OffsetHeight()
  {
    mozilla::CSSIntRect rcFrame;
    GetOffsetRect(rcFrame);

    return rcFrame.height;
  }

  // These methods are already implemented in nsIContent but we want something
  // faster for HTMLElements ignoring the namespace checking.
  // This is safe because we already know that we are in the HTML namespace.
protected:
  virtual ~nsGenericHTMLElement() {}

  // These methods are used to implement element-specific behavior of Get/SetItemValue
  // when an element has @itemprop but no @itemscope.
  virtual void GetItemValueText(mozilla::dom::DOMString& text);
  virtual void SetItemValueText(const nsAString& text);
public:
  virtual already_AddRefed<mozilla::dom::UndoManager> GetUndoManager() MOZ_OVERRIDE;
  virtual bool UndoScope() MOZ_OVERRIDE;
  virtual void SetUndoScope(bool aUndoScope, mozilla::ErrorResult& aError) MOZ_OVERRIDE;
  // Callback for destructor of of dataset to ensure to null out weak pointer.
  nsresult ClearDataset();

  /**
   * Get width and height, using given image request if attributes are unset.
                           bool aNotify) MOZ_OVERRIDE;
  virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                             bool aNotify) MOZ_OVERRIDE;
  
  /**
   * Returns true if a subclass is not allowed to override the value returned
   * in aIsFocusable.
   */
  virtual bool IsHTMLFocusable(bool aWithMouse,
                               bool *aIsFocusable,
                               int32_t *aTabIndex);
  virtual void PerformAccesskey(bool aKeyCausesActivation,
                                bool aIsTrustedEvent) MOZ_OVERRIDE;

  /**
   * Check if an event for an anchor can be handled

  /**
   * Returns the current disabled state of the element.
   */
  virtual bool IsDisabled() const {
    return false;
  }

  bool IsHidden() const
  {
    return HasAttr(kNameSpaceID_None, nsGkAtoms::hidden);
  }

  virtual bool IsLabelable() const MOZ_OVERRIDE;
  virtual bool IsInteractiveHTMLContent() const MOZ_OVERRIDE;

  static bool TouchEventsEnabled(JSContext* /* unused */, JSObject* /* unused */);

  static inline bool
  CanHaveName(nsIAtom* aTag)
  {
    return aTag == nsGkAtoms::img ||
           aTag == nsGkAtoms::form ||
           aTag == nsGkAtoms::applet ||
           aTag == nsGkAtoms::embed ||
           aTag == nsGkAtoms::object;
  }
  static inline bool
  ShouldExposeNameAsHTMLDocumentProperty(Element* aElement)
  {
    return aElement->IsHTMLElement() &&
           CanHaveName(aElement->NodeInfo()->NameAtom());
  }
  

  ;

protected:
  /**
   * Add/remove this element to the documents name cache
   */
  
  

  /**
   * Register or unregister an access key to this element based on the
   * accesskey attribute.
   */

  /**
   * Create a URI for the given aURISpec string.
   * Returns INVALID_STATE_ERR and nulls *aURI if aURISpec is empty
   * and the document's URI matches the element's base URI.
   */
  ;

  void GetHTMLAttr(nsIAtom* aName, nsAString& aResult) const
  {
    GetAttr(kNameSpaceID_None, aName, aResult);
  }
  void GetHTMLAttr(nsIAtom* aName, mozilla::dom::DOMString& aResult) const
  {
    GetAttr(kNameSpaceID_None, aName, aResult);
  }
  void GetHTMLEnumAttr(nsIAtom* aName, nsAString& aResult) const
  {
    GetEnumAttr(aName, nullptr, aResult);
  }
  

  void SetHTMLAttr(nsIAtom* aName, const nsAString& aValue)
  {
    SetAttr(kNameSpaceID_None, aName, aValue, true);
  }
  void SetHTMLAttr(nsIAtom* aName, const nsAString& aValue, mozilla::ErrorResult& aError)
  {
    mozilla::dom::Element::SetAttr(aName, aValue, aError);
  }
  void UnsetHTMLAttr(nsIAtom* aName, mozilla::ErrorResult& aError)
  {
    mozilla::dom::Element::UnsetAttr(aName, aError);
  }
  void SetHTMLBoolAttr(nsIAtom* aName, bool aValue, mozilla::ErrorResult& aError)
  {
    if (aValue) {
      SetHTMLAttr(aName, EmptyString(), aError);
    } else {
      UnsetHTMLAttr(aName, aError);
    }
  }
  void SetHTMLIntAttr(nsIAtom* aName, int32_t aValue, mozilla::ErrorResult& aError)
  {
    nsAutoString value;
    value.AppendInt(aValue);

    SetHTMLAttr(aName, value, aError);
  }

  /**
   * Helper method for NS_IMPL_STRING_ATTR macro.
   * Sets the value of an attribute, returns specified default value if the
   * attribute isn't set. Only works for attributes in null namespace.
   *
   * @param aAttr    name of attribute.
   * @param aDefault default-value to return if attribute isn't set.
   * @param aResult  result value [out]
   */
  ;

  /**
   * Helper method for NS_IMPL_INT_ATTR macro.
   * Gets the integer-value of an attribute, returns specified default value
   * if the attribute isn't set or isn't set to an integer. Only works for
   * attributes in null namespace.
   *
   * @param aAttr    name of attribute.
   * @param aDefault default-value to return if attribute isn't set.
   */
  int32_t GetIntAttr(nsIAtom* aAttr, int32_t aDefault) const;

  /**
   * Helper method for NS_IMPL_INT_ATTR macro.
   * Sets value of attribute to specified integer. Only works for attributes
   * in null namespace.
   *
   * @param aAttr    name of attribute.
   * @param aValue   Integer value of attribute.
   */
  ;
  /**
   * This method works like GetURIAttr, except that it supports multiple
   * URIs separated by whitespace (one or more U+0020 SPACE characters).
   *
   * Gets the absolute URI values of an attribute, by resolving any relative
   * URIs in the attribute against the baseuri of the element. If a substring
   * isn't a relative URI, the substring is returned as is. Only works for
   * attributes in null namespace.
   *
   * @param aAttr    name of attribute.
   * @param aResult  result value [out]
   */
  ;

  /**
   * Locates the nsIEditor associated with this node.  In general this is
   * equivalent to GetEditorInternal(), but for designmode or contenteditable,
   * this may need to get an editor that's not actually on this element's
   * associated TextControlFrame.  This is used by the spellchecking routines
   * to get the editor affected by changing the spellcheck attribute on this
   * node.
   */
  ;

  /**
   * Get the frame's offset information for offsetTop/Left/Width/Height.
   * Returns the parent the offset is relative to.
   * @note This method flushes pending notifications (Flush_Layout).
   * @param aRect the offset information [OUT]
   */
  mozilla::dom::Element* GetOffsetRect(mozilla::CSSIntRect& aRect);

  /**
   * Returns true if this is the current document's body element
   */
  ;

  /**
   * Ensures all editors associated with a subtree are synced, for purposes of
   * spellchecking.
   */
  ;

  enum ContentEditableTristate {
    eInherit = -1,
    eFalse = 0,
    eTrue = 1
  };

  /**
   * Returns eTrue if the element has a contentEditable attribute and its value
   * is "true" or an empty string. Returns eFalse if the element has a
   * contentEditable attribute and its value is "false". Otherwise returns
   * eInherit.
   */
  ContentEditableTristate GetContentEditableValue() const
  {
    static const nsIContent::AttrValuesArray values[] =
      { &nsGkAtoms::_false, &nsGkAtoms::_true, &nsGkAtoms::_empty, nullptr };

    if (!MayHaveContentEditableAttr())
      return eInherit;

    int32_t value = FindAttrValueIn(kNameSpaceID_None,
                                    nsGkAtoms::contenteditable, values,
                                    eIgnoreCase);

    return value > 0 ? eTrue : (value == 0 ? eFalse : eInherit);
  }

  // Used by A, AREA, LINK, and STYLE.
  ;

  /**
   * Returns whether this element is an editable root. There are two types of
   * editable roots:
   *   1) the documentElement if the whole document is editable (for example for
   *      desginMode=on)
   *   2) an element that is marked editable with contentEditable=true and that
   *      doesn't have a parent or whose parent is not editable.
   * Note that this doesn't return input and textarea elements that haven't been
   * made editable through contentEditable or designMode.
   */
  ;

  ;

private:
  ;

  bool mScrollgrab;
};

/**
 * A helper class for form elements that can contain children
 */
class nsGenericHTMLFormElement : public nsGenericHTMLElement,
                                 public nsIFormControl
{
public:
  ;

  NS_DECL_ISUPPORTS_INHERITED

  nsINode* GetScopeChainParent() const MOZ_OVERRIDE;

  virtual bool IsNodeOfType(uint32_t aFlags) const MOZ_OVERRIDE;
  virtual void SaveSubtreeState() MOZ_OVERRIDE;

  // nsIFormControl
  virtual mozilla::dom::HTMLFieldSetElement* GetFieldSet() MOZ_OVERRIDE;
  virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                              nsIContent* aBindingParent,
                              bool aCompileEventHandlers) MOZ_OVERRIDE;
  virtual void UnbindFromTree(bool aDeep = true,
                              bool aNullParent = true) MOZ_OVERRIDE;
  virtual IMEState GetDesiredIMEState() MOZ_OVERRIDE;
  virtual mozilla::EventStates IntrinsicState() const MOZ_OVERRIDE;

  virtual nsresult PreHandleEvent(
                     mozilla::EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;

  virtual bool IsDisabled() const MOZ_OVERRIDE;

  /**
   * This callback is called by a fieldest on all its elements whenever its
   * disabled attribute is changed so the element knows its disabled state

  /* Used to store the key to that element in the session. Is void until
     GenerateStateKey has been used */
  nsCString mStateKey;
};

//----------------------------------------------------------------------

/**
 * This macro is similar to NS_IMPL_STRING_ATTR except that the getter method
 * falls back to an alternative method if the content attribute isn't set.
 */
#define NS_IMPL_STRING_ATTR_WITH_FALLBACK(_class, _method, _atom, _fallback) \
  NS_IMETHODIMP                                                              \
  _class::Get##_method(nsAString& aValue)                                    \
  {                                                                          \
    if (!GetAttr(kNameSpaceID_None, nsGkAtoms::_atom, aValue)) {             \
      _fallback(aValue);                                                     \
    }                                                                        \
    return NS_OK;                                                            \
  }                                                                          \
  NS_IMETHODIMP                                                              \
  _class::Set##_method(const nsAString& aValue)                              \
  {                                                                          \
    return SetAttrHelper(nsGkAtoms::_atom, aValue);                          \
  }

/**
 * A macro to implement the getter and setter for a given integer
 * valued content property. The method uses the generic GetAttr and
 * SetAttr methods.

#define NS_INTERFACE_MAP_ENTRY_IF_TAG(_interface, _tag)                       \
  NS_INTERFACE_MAP_ENTRY_CONDITIONAL(_interface,                              \
                                     mNodeInfo->Equals(nsGkAtoms::_tag))


/**
 * A macro to declare the NS_NewHTMLXXXElement() functions.
 */
#define NS_DECLARE_NS_NEW_HTML_ELEMENT(_elementName)                       \
namespace mozilla {                                                        \
namespace dom {                                                            \
class HTML##_elementName##Element;                                         \
}                                                                          \
}                                                                          \
nsGenericHTMLElement*                                                      \
NS_NewHTML##_elementName##Element(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo, \
                                  mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER);

#define NS_DECLARE_NS_NEW_HTML_ELEMENT_AS_SHARED(_elementName)             \
inline nsGenericHTMLElement*                                               \
NS_NewHTML##_elementName##Element(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo, \
                                  mozilla::dom::FromParser aFromParser = mozilla::dom::NOT_FROM_PARSER) \
{                                                                          \
  return NS_NewHTMLSharedElement(mozilla::Move(aNodeInfo), aFromParser);   \
}

NS_DECLARE_NS_NEW_HTML_ELEMENT(BR)
NS_DECLARE_NS_NEW_HTML_ELEMENT(Body)
NS_DECLARE_NS_NEW_HTML_ELEMENT(Button)

#endif /* nsGenericHTMLElement_h___ */
# 1810 "/Users/luser/build/mozilla-central/dom/html/nsGenericHTMLElement.h"
# 12 "../../dist/include/mozilla/dom/HTMLCanvasElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsGkAtoms.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/HTMLCanvasElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/HTMLCanvasElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/HTMLCanvasElement.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Rect.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/HTMLCanvasElement.h"

class nsICanvasRenderingContextInternal;
class nsITimerCallback;

namespace mozilla {

namespace layers {
class CanvasLayer;
class LayerManager;
}
namespace gfx {
class SourceSurface;
}

namespace dom {

class File;
class FileCallback;
class HTMLCanvasPrintState;
class PrintCallback;

enum class CanvasContextType : uint8_t {
  Canvas2D,
  WebGL1,
  WebGL2
};

class HTMLCanvasElement MOZ_FINAL : public nsGenericHTMLElement,
                                    public nsIDOMHTMLCanvasElement
{
  enum {
    DEFAULT_CANVAS_WIDTH = 300,
    DEFAULT_CANVAS_HEIGHT = 150
  };

  typedef layers::CanvasLayer CanvasLayer;
  typedef layers::LayerManager LayerManager;

public:
  ;

  NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLCanvasElement, canvas)

  // nsISupports
  NS_DECL_ISUPPORTS_INHERITED

  
  
  ;
  
  
  ;
  ;

  /**
   * Get the size in pixels of this canvas element
   */
  nsIntSize GetSize();

  /**
   * Determine whether the canvas is write-only.
   */
  ;

  /**
   * Force the canvas to be write-only.
   */
  ;

  /**
   * Notify that some canvas content has changed and the window may
   * need to be updated. aDamageRect is in canvas coordinates.
   */
  void InvalidateCanvasContent(const mozilla::gfx::Rect* aDamageRect);
  /*
   * Notify that we need to repaint the entire canvas, including updating of
   * the layer tree.
   */
  void InvalidateCanvas();

  /*
   * Get the number of contexts in this canvas, and request a context at
   * an index.
   */
  ;
  ;

  CanvasContextType mCurrentContextType;
  nsRefPtr<HTMLCanvasElement> mOriginalCanvas;
  nsRefPtr<PrintCallback> mPrintCallback;
  nsCOMPtr<nsICanvasRenderingContextInternal> mCurrentContext;
  nsRefPtr<HTMLCanvasPrintState> mPrintState;

public:
  // Record whether this canvas should be write-only or not.
  // We set this when script paints an image from a different origin.
  // We also transitively set it when script paints a canvas which
  // is itself write-only.
  bool                     mWriteOnly;

  ;

  ;

  ;

  ;

  HTMLCanvasElement* GetOriginalCanvas();
};

class HTMLCanvasPrintState MOZ_FINAL : public nsWrapperCache
{
public:
  ;

  ;

  ;

  ;

  bool mIsDone;

  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(HTMLCanvasPrintState)
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(HTMLCanvasPrintState)

  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;

  

private:
  ~HTMLCanvasPrintState();
  bool mPendingNotify;

protected:
  nsRefPtr<HTMLCanvasElement> mCanvas;
  nsCOMPtr<nsICanvasRenderingContextInternal> mContext;
  nsCOMPtr<nsITimerCallback> mCallback;
};

} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_HTMLCanvasElement_h */
# 303 "../../dist/include/mozilla/dom/HTMLCanvasElement.h"
# 15 "/Users/luser/build/mozilla-central/dom/canvas/nsICanvasRenderingContextInternal.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GraphicsFilter.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/GraphicsFilter.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GraphicsFilter_h
#define GraphicsFilter_h

enum class GraphicsFilter : int {
  FILTER_FAST,
  FILTER_GOOD,
  FILTER_BEST,
  FILTER_NEAREST,
  FILTER_BILINEAR,
  FILTER_GAUSSIAN,
  FILTER_SENTINEL
};

#endif
# 20 "../../dist/include/GraphicsFilter.h"

# 16 "/Users/luser/build/mozilla-central/dom/canvas/nsICanvasRenderingContextInternal.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/canvas/nsICanvasRenderingContextInternal.h"

#define NS_ICANVASRENDERINGCONTEXTINTERNAL_IID \
{ 0x3cc9e801, 0x1806, 0x4ff6, \
  { 0x86, 0x14, 0xf9, 0xd0, 0xf4, 0xfb, 0x3b, 0x08 } }

class gfxContext;
class gfxASurface;
class nsDisplayListBuilder;

namespace mozilla {
namespace layers {
class CanvasLayer;
class LayerManager;
}
namespace gfx {
class SourceSurface;
}
}

class nsICanvasRenderingContextInternal :
  public nsISupports,
  public nsAPostRefreshObserver
{
public:
  typedef mozilla::layers::CanvasLayer CanvasLayer;
  typedef mozilla::layers::LayerManager LayerManager;

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICANVASRENDERINGCONTEXTINTERNAL_IID)

  void SetCanvasElement(mozilla::dom::HTMLCanvasElement* aParentCanvas)
  {
    RemovePostRefreshObserver();
    mCanvasElement = aParentCanvas;
    AddPostRefreshObserverIfNecessary();
  }

  virtual nsIPresShell *GetPresShell() {
    if (mCanvasElement) {
      return mCanvasElement->OwnerDoc()->GetShell();
    }
    return nullptr;
  }

  void RemovePostRefreshObserver()
  {
    if (mRefreshDriver) {
      mRefreshDriver->RemovePostRefreshObserver(this);
      mRefreshDriver = nullptr;
    }
  }

  void AddPostRefreshObserverIfNecessary()
  {
    if (!GetPresShell() ||
        !GetPresShell()->GetPresContext() ||
        !GetPresShell()->GetPresContext()->RefreshDriver()) {
      return;
    }
    mRefreshDriver = GetPresShell()->GetPresContext()->RefreshDriver();
    mRefreshDriver->AddPostRefreshObserver(this);
  }

  mozilla::dom::HTMLCanvasElement* GetParentObject() const
  {
    return mCanvasElement;
  }

#ifdef DEBUG
    // Useful for testing
    virtual int32_t GetWidth() const = 0;
    virtual int32_t GetHeight() const = 0;
#endif
# 89 "/Users/luser/build/mozilla-central/dom/canvas/nsICanvasRenderingContextInternal.h"

  // Sets the dimensions of the canvas, in pixels.  Called
  // whenever the size of the element changes.
  NS_IMETHOD SetDimensions(int32_t width, int32_t height) = 0;

  NS_IMETHOD InitializeWithSurface(nsIDocShell *docShell, gfxASurface *surface, int32_t width, int32_t height) = 0;

  // Creates an image buffer. Returns null on failure.
  virtual void GetImageBuffer(uint8_t** aImageBuffer, int32_t* aFormat) = 0;

  // Gives you a stream containing the image represented by this context.
  // The format is given in aMimeTime, for example "image/png".
  //
  // If the image format does not support transparency or aIncludeTransparency
  // is false, alpha will be discarded and the result will be the image
  // composited on black.
  NS_IMETHOD GetInputStream(const char *aMimeType,
                            const char16_t *aEncoderOptions,
                            nsIInputStream **aStream) = 0;
  
  // This gets an Azure SourceSurface for the canvas, this will be a snapshot
  // of the canvas at the time it was called.
  // If aPremultAlpha is provided, then it assumed the callee can handle
  // un-premultiplied surfaces, and *aPremultAlpha will be set to false
  // if one is returned.
  virtual mozilla::TemporaryRef<mozilla::gfx::SourceSurface> GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) = 0;

  // If this context is opaque, the backing store of the canvas should
  // be created as opaque; all compositing operators should assume the
  // dst alpha is always 1.0.  If this is never called, the context
  // defaults to false (not opaque).
  NS_IMETHOD SetIsOpaque(bool isOpaque) = 0;
  virtual bool GetIsOpaque() = 0;

  // Invalidate this context and release any held resources, in preperation
  // for possibly reinitializing with SetDimensions/InitializeWithSurface.
  NS_IMETHOD Reset() = 0;

  // Return the CanvasLayer for this context, creating
  // one for the given layer manager if not available.
  virtual already_AddRefed<CanvasLayer> GetCanvasLayer(nsDisplayListBuilder* aBuilder,
                                                       CanvasLayer *aOldLayer,
                                                       LayerManager *aManager) = 0;

  // Return true if the canvas should be forced to be "inactive" to ensure
  // it can be drawn to the screen even if it's too large to be blitted by
  // an accelerated CanvasLayer.
  virtual bool ShouldForceInactiveLayer(LayerManager *aManager) { return false; }

  virtual void MarkContextClean() = 0;

  // Redraw the dirty rectangle of this canvas.
  NS_IMETHOD Redraw(const gfxRect &dirty) = 0;

  NS_IMETHOD SetContextOptions(JSContext* aCx, JS::Handle<JS::Value> aOptions) { return NS_OK; }

  // return true and fills in the bounding rect if elementis a child and has a hit region.
  virtual bool GetHitRegionRect(mozilla::dom::Element* aElement, nsRect& aRect) { return false; }

  // Given a point, return hit region ID if it exists or an empty string if it doesn't
  virtual nsString GetHitRegion(const mozilla::gfx::Point& aPoint) { return nsString(); }

  //
  // shmem support
  //

  // If this context can be set to use Mozilla's Shmem segments as its backing
  // store, this will set it to that state. Note that if you have drawn
  // anything into this canvas before changing the shmem state, it will be
  // lost.
  NS_IMETHOD SetIsIPC(bool isIPC) = 0;

protected:
  nsRefPtr<mozilla::dom::HTMLCanvasElement> mCanvasElement;
  nsRefPtr<nsRefreshDriver> mRefreshDriver;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsICanvasRenderingContextInternal,
                              NS_ICANVASRENDERINGCONTEXTINTERNAL_IID)

#endif /* nsICanvasRenderingContextInternal_h___ */
# 170 "/Users/luser/build/mozilla-central/dom/canvas/nsICanvasRenderingContextInternal.h"
# 12 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsColor.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLCanvasElement.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLVideoElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/HTMLVideoElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_HTMLVideoElement_h
#define mozilla_dom_HTMLVideoElement_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/HTMLVideoElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLMediaElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/HTMLMediaElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_HTMLMediaElement_h
#define mozilla_dom_HTMLMediaElement_h

#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMHTMLMediaElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMHTMLMediaElement.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMHTMLMediaElement.idl
 */

#ifndef __gen_nsIDOMHTMLMediaElement_h__
#define __gen_nsIDOMHTMLMediaElement_h__


#ifndef __gen_nsIDOMHTMLElement_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMHTMLElement.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMHTMLMediaElement.h"
#endif
# 12 "../../dist/include/nsIDOMHTMLMediaElement.h"

#ifndef __gen_nsIDOMMediaError_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMMediaError.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMMediaError.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMMediaError.idl
 */

#ifndef __gen_nsIDOMMediaError_h__
#define __gen_nsIDOMMediaError_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMMediaError.h"
#endif
# 12 "../../dist/include/nsIDOMMediaError.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMMediaError.h"

/* starting interface:    nsIDOMMediaError */
#define NS_IDOMMEDIAERROR_IID_STR "7bd8c29f-8a76-453f-9373-79f820f2dc01"

#define NS_IDOMMEDIAERROR_IID \
  {0x7bd8c29f, 0x8a76, 0x453f, \
    { 0x93, 0x73, 0x79, 0xf8, 0x20, 0xf2, 0xdc, 0x01 }}

class NS_NO_VTABLE nsIDOMMediaError : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMMEDIAERROR_IID)

  enum {
    MEDIA_ERR_ABORTED = 1U,
    MEDIA_ERR_NETWORK = 2U,
    MEDIA_ERR_DECODE = 3U,
    MEDIA_ERR_SRC_NOT_SUPPORTED = 4U
  };

  /* readonly attribute unsigned short code; */
  NS_IMETHOD GetCode(uint16_t *aCode) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMMediaError, NS_IDOMMEDIAERROR_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMMEDIAERROR \
  NS_IMETHOD GetCode(uint16_t *aCode) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMMEDIAERROR(_to) \
  NS_IMETHOD GetCode(uint16_t *aCode) MOZ_OVERRIDE { return _to GetCode(aCode); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMMEDIAERROR(_to) \
  NS_IMETHOD GetCode(uint16_t *aCode) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCode(aCode); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 96 "../../dist/include/nsIDOMMediaError.h"


#endif /* __gen_nsIDOMMediaError_h__ */
# 99 "../../dist/include/nsIDOMMediaError.h"
# 15 "../../dist/include/nsIDOMHTMLMediaElement.h" 2
#endif
# 16 "../../dist/include/nsIDOMHTMLMediaElement.h"

#ifndef __gen_nsIDOMTimeRanges_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMTimeRanges.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMTimeRanges.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMTimeRanges.idl
 */

#ifndef __gen_nsIDOMTimeRanges_h__
#define __gen_nsIDOMTimeRanges_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMTimeRanges.h"
#endif
# 12 "../../dist/include/nsIDOMTimeRanges.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMTimeRanges.h"

/* starting interface:    nsIDOMTimeRanges */
#define NS_IDOMTIMERANGES_IID_STR "c43448db-0bab-461d-b648-1ca14a967f7e"

#define NS_IDOMTIMERANGES_IID \
  {0xc43448db, 0x0bab, 0x461d, \
    { 0xb6, 0x48, 0x1c, 0xa1, 0x4a, 0x96, 0x7f, 0x7e }}

class NS_NO_VTABLE nsIDOMTimeRanges : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMTIMERANGES_IID)

  /* readonly attribute unsigned long length; */
  NS_IMETHOD GetLength(uint32_t *aLength) = 0;

  /* double start (in unsigned long index); */
  NS_IMETHOD Start(uint32_t index, double *_retval) = 0;

  /* double end (in unsigned long index); */
  NS_IMETHOD End(uint32_t index, double *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMTimeRanges, NS_IDOMTIMERANGES_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMTIMERANGES \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE; \
  NS_IMETHOD Start(uint32_t index, double *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD End(uint32_t index, double *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMTIMERANGES(_to) \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return _to GetLength(aLength); } \
  NS_IMETHOD Start(uint32_t index, double *_retval) MOZ_OVERRIDE { return _to Start(index, _retval); } \
  NS_IMETHOD End(uint32_t index, double *_retval) MOZ_OVERRIDE { return _to End(index, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMTIMERANGES(_to) \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLength(aLength); } \
  NS_IMETHOD Start(uint32_t index, double *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Start(index, _retval); } \
  NS_IMETHOD End(uint32_t index, double *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->End(index, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */
NS_IMETHODIMP nsDOMTimeRanges::GetLength(uint32_t *aLength)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* double start (in unsigned long index); */
NS_IMETHODIMP nsDOMTimeRanges::Start(uint32_t index, double *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* double end (in unsigned long index); */
NS_IMETHODIMP nsDOMTimeRanges::End(uint32_t index, double *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 113 "../../dist/include/nsIDOMTimeRanges.h"


#endif /* __gen_nsIDOMTimeRanges_h__ */
# 116 "../../dist/include/nsIDOMTimeRanges.h"
# 19 "../../dist/include/nsIDOMHTMLMediaElement.h" 2
#endif

/* starting interface:    nsIDOMHTMLMediaElement */
#define NS_IDOMHTMLMEDIAELEMENT_IID_STR "c041d76c-15ce-47ad-b61d-e8755a6db638"

#define NS_IDOMHTMLMEDIAELEMENT_IID \
  {0xc041d76c, 0x15ce, 0x47ad, \
    { 0xb6, 0x1d, 0xe8, 0x75, 0x5a, 0x6d, 0xb6, 0x38 }}

class NS_NO_VTABLE nsIDOMHTMLMediaElement : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMHTMLMEDIAELEMENT_IID)

  /* readonly attribute nsIDOMMediaError error; */
  NS_IMETHOD GetError(nsIDOMMediaError * *aError) = 0;

  /* attribute DOMString src; */
  NS_IMETHOD GetSrc(nsAString & aSrc) = 0;
  NS_IMETHOD SetSrc(const nsAString & aSrc) = 0;

  /* readonly attribute DOMString currentSrc; */
  NS_IMETHOD GetCurrentSrc(nsAString & aCurrentSrc) = 0;

  enum {
    NETWORK_EMPTY = 0U,
    NETWORK_IDLE = 1U,
    NETWORK_LOADING = 2U,
    NETWORK_NO_SOURCE = 3U
  };

  /* readonly attribute unsigned short networkState; */
  NS_IMETHOD GetNetworkState(uint16_t *aNetworkState) = 0;

  /* attribute DOMString preload; */
  NS_IMETHOD GetPreload(nsAString & aPreload) = 0;
  NS_IMETHOD SetPreload(const nsAString & aPreload) = 0;

  /* readonly attribute nsIDOMTimeRanges buffered; */
  NS_IMETHOD GetBuffered(nsIDOMTimeRanges * *aBuffered) = 0;

  /* void load (); */
  NS_IMETHOD Load(void) = 0;

  /* DOMString canPlayType (in DOMString type); */
  NS_IMETHOD CanPlayType(const nsAString & type, nsAString & _retval) = 0;

  enum {
    HAVE_NOTHING = 0U,
    HAVE_METADATA = 1U,
    HAVE_CURRENT_DATA = 2U,
    HAVE_FUTURE_DATA = 3U,
    HAVE_ENOUGH_DATA = 4U
  };

  /* readonly attribute unsigned short readyState; */
  NS_IMETHOD GetReadyState(uint16_t *aReadyState) = 0;

  /* readonly attribute boolean seeking; */
  NS_IMETHOD GetSeeking(bool *aSeeking) = 0;

  /* attribute double currentTime; */
  NS_IMETHOD GetCurrentTime(double *aCurrentTime) = 0;
  NS_IMETHOD SetCurrentTime(double aCurrentTime) = 0;

  /* readonly attribute double duration; */
  NS_IMETHOD GetDuration(double *aDuration) = 0;

  /* readonly attribute boolean paused; */
  NS_IMETHOD GetPaused(bool *aPaused) = 0;

  /* attribute double defaultPlaybackRate; */
  NS_IMETHOD GetDefaultPlaybackRate(double *aDefaultPlaybackRate) = 0;
  NS_IMETHOD SetDefaultPlaybackRate(double aDefaultPlaybackRate) = 0;

  /* attribute double playbackRate; */
  NS_IMETHOD GetPlaybackRate(double *aPlaybackRate) = 0;
  NS_IMETHOD SetPlaybackRate(double aPlaybackRate) = 0;

  /* attribute boolean mozPreservesPitch; */
  NS_IMETHOD GetMozPreservesPitch(bool *aMozPreservesPitch) = 0;
  NS_IMETHOD SetMozPreservesPitch(bool aMozPreservesPitch) = 0;

  /* readonly attribute nsIDOMTimeRanges played; */
  NS_IMETHOD GetPlayed(nsIDOMTimeRanges * *aPlayed) = 0;

  /* readonly attribute nsIDOMTimeRanges seekable; */
  NS_IMETHOD GetSeekable(nsIDOMTimeRanges * *aSeekable) = 0;

  /* readonly attribute boolean ended; */
  NS_IMETHOD GetEnded(bool *aEnded) = 0;

  /* readonly attribute boolean mozAutoplayEnabled; */
  NS_IMETHOD GetMozAutoplayEnabled(bool *aMozAutoplayEnabled) = 0;

  /* attribute boolean autoplay; */
  NS_IMETHOD GetAutoplay(bool *aAutoplay) = 0;
  NS_IMETHOD SetAutoplay(bool aAutoplay) = 0;

  /* attribute boolean loop; */
  NS_IMETHOD GetLoop(bool *aLoop) = 0;
  NS_IMETHOD SetLoop(bool aLoop) = 0;

  /* void play (); */
  NS_IMETHOD Play(void) = 0;

  /* void pause (); */
  NS_IMETHOD Pause(void) = 0;

  /* attribute boolean controls; */
  NS_IMETHOD GetControls(bool *aControls) = 0;
  NS_IMETHOD SetControls(bool aControls) = 0;

  /* attribute double volume; */
  NS_IMETHOD GetVolume(double *aVolume) = 0;
  NS_IMETHOD SetVolume(double aVolume) = 0;

  /* attribute boolean muted; */
  NS_IMETHOD GetMuted(bool *aMuted) = 0;
  NS_IMETHOD SetMuted(bool aMuted) = 0;

  /* attribute boolean defaultMuted; */
  NS_IMETHOD GetDefaultMuted(bool *aDefaultMuted) = 0;
  NS_IMETHOD SetDefaultMuted(bool aDefaultMuted) = 0;

  /* readonly attribute boolean mozAudioCaptured; */
  NS_IMETHOD GetMozAudioCaptured(bool *aMozAudioCaptured) = 0;

  /* [implicit_jscontext] jsval mozGetMetadata (); */
  NS_IMETHOD MozGetMetadata(JSContext* cx, JS::MutableHandleValue _retval) = 0;

  /* readonly attribute double mozFragmentEnd; */
  NS_IMETHOD GetMozFragmentEnd(double *aMozFragmentEnd) = 0;

  /* attribute DOMString mozAudioChannelType; */
  NS_IMETHOD GetMozAudioChannelType(nsAString & aMozAudioChannelType) = 0;
  NS_IMETHOD SetMozAudioChannelType(const nsAString & aMozAudioChannelType) = 0;

  /* [notxpcom] boolean isVideo (); */
  NS_IMETHOD_(bool) IsVideo(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMHTMLMediaElement, NS_IDOMHTMLMEDIAELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMHTMLMEDIAELEMENT \
  NS_IMETHOD GetError(nsIDOMMediaError * *aError) MOZ_OVERRIDE; \
  NS_IMETHOD GetSrc(nsAString & aSrc) MOZ_OVERRIDE; \
  NS_IMETHOD SetSrc(const nsAString & aSrc) MOZ_OVERRIDE; \
  NS_IMETHOD GetCurrentSrc(nsAString & aCurrentSrc) MOZ_OVERRIDE; \
  NS_IMETHOD GetNetworkState(uint16_t *aNetworkState) MOZ_OVERRIDE; \
  NS_IMETHOD GetPreload(nsAString & aPreload) MOZ_OVERRIDE; \
  NS_IMETHOD SetPreload(const nsAString & aPreload) MOZ_OVERRIDE; \
  NS_IMETHOD GetBuffered(nsIDOMTimeRanges * *aBuffered) MOZ_OVERRIDE; \
  NS_IMETHOD Load(void) MOZ_OVERRIDE; \
  NS_IMETHOD CanPlayType(const nsAString & type, nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetReadyState(uint16_t *aReadyState) MOZ_OVERRIDE; \
  NS_IMETHOD GetSeeking(bool *aSeeking) MOZ_OVERRIDE; \
  NS_IMETHOD GetCurrentTime(double *aCurrentTime) MOZ_OVERRIDE; \
  NS_IMETHOD SetCurrentTime(double aCurrentTime) MOZ_OVERRIDE; \
  NS_IMETHOD GetDuration(double *aDuration) MOZ_OVERRIDE; \
  NS_IMETHOD GetPaused(bool *aPaused) MOZ_OVERRIDE; \
  NS_IMETHOD GetDefaultPlaybackRate(double *aDefaultPlaybackRate) MOZ_OVERRIDE; \
  NS_IMETHOD SetDefaultPlaybackRate(double aDefaultPlaybackRate) MOZ_OVERRIDE; \
  NS_IMETHOD GetPlaybackRate(double *aPlaybackRate) MOZ_OVERRIDE; \
  NS_IMETHOD SetPlaybackRate(double aPlaybackRate) MOZ_OVERRIDE; \
  NS_IMETHOD GetMozPreservesPitch(bool *aMozPreservesPitch) MOZ_OVERRIDE; \
  NS_IMETHOD SetMozPreservesPitch(bool aMozPreservesPitch) MOZ_OVERRIDE; \
  NS_IMETHOD GetPlayed(nsIDOMTimeRanges * *aPlayed) MOZ_OVERRIDE; \
  NS_IMETHOD GetSeekable(nsIDOMTimeRanges * *aSeekable) MOZ_OVERRIDE; \
  NS_IMETHOD GetEnded(bool *aEnded) MOZ_OVERRIDE; \
  NS_IMETHOD GetMozAutoplayEnabled(bool *aMozAutoplayEnabled) MOZ_OVERRIDE; \
  NS_IMETHOD GetAutoplay(bool *aAutoplay) MOZ_OVERRIDE; \
  NS_IMETHOD SetAutoplay(bool aAutoplay) MOZ_OVERRIDE; \
  NS_IMETHOD GetLoop(bool *aLoop) MOZ_OVERRIDE; \
  NS_IMETHOD SetLoop(bool aLoop) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMHTMLMEDIAELEMENT(_to) \
  NS_IMETHOD GetError(nsIDOMMediaError * *aError) MOZ_OVERRIDE { return _to GetError(aError); } \
  NS_IMETHOD GetSrc(nsAString & aSrc) MOZ_OVERRIDE { return _to GetSrc(aSrc); } \
  NS_IMETHOD SetSrc(const nsAString & aSrc) MOZ_OVERRIDE { return _to SetSrc(aSrc); } \
  NS_IMETHOD GetCurrentSrc(nsAString & aCurrentSrc) MOZ_OVERRIDE { return _to GetCurrentSrc(aCurrentSrc); } \
  NS_IMETHOD GetNetworkState(uint16_t *aNetworkState) MOZ_OVERRIDE { return _to GetNetworkState(aNetworkState); } \
  NS_IMETHOD GetPreload(nsAString & aPreload) MOZ_OVERRIDE { return _to GetPreload(aPreload); } \
  NS_IMETHOD SetPreload(const nsAString & aPreload) MOZ_OVERRIDE { return _to SetPreload(aPreload); } \
  NS_IMETHOD GetBuffered(nsIDOMTimeRanges * *aBuffered) MOZ_OVERRIDE { return _to GetBuffered(aBuffered); } \
  NS_IMETHOD Load(void) MOZ_OVERRIDE { return _to Load(); } \
  NS_IMETHOD CanPlayType(const nsAString & type, nsAString & _retval) MOZ_OVERRIDE { return _to CanPlayType(type, _retval); } \
  NS_IMETHOD GetReadyState(uint16_t *aReadyState) MOZ_OVERRIDE { return _to GetReadyState(aReadyState); } \
  NS_IMETHOD GetSeeking(bool *aSeeking) MOZ_OVERRIDE { return _to GetSeeking(aSeeking); } \
  NS_IMETHOD GetCurrentTime(double *aCurrentTime) MOZ_OVERRIDE { return _to GetCurrentTime(aCurrentTime); } \


#endif /* __gen_nsIDOMHTMLMediaElement_h__ */
# 608 "../../dist/include/nsIDOMHTMLMediaElement.h"
# 10 "../../dist/include/mozilla/dom/HTMLMediaElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsGenericHTMLElement.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/HTMLMediaElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "MediaDecoderOwner.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/MediaDecoderOwner.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MediaDecoderOwner_h_
#define MediaDecoderOwner_h_
#if 0 /* expanded by -frewrite-includes */
#include "AbstractMediaDecoder.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/AbstractMediaDecoder.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef AbstractMediaDecoder_h_
#define AbstractMediaDecoder_h_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/AbstractMediaDecoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "MediaInfo.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/MediaInfo.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#if !defined(MediaInfo_h)
#define MediaInfo_h

#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/MediaInfo.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRect.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/MediaInfo.h"
#if 0 /* expanded by -frewrite-includes */
#include "ImageTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/ImageTypes.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_IMAGETYPES_H
#define GFX_IMAGETYPES_H

namespace mozilla {

enum class ImageFormat {
  /**
   * The PLANAR_YCBCR format creates a PlanarYCbCrImage. All backends should
   * support this format, because the Ogg video decoder depends on it.
   * IDirect3DTexture9 in RGB32 layout.
   */
  D3D9_RGB32_TEXTURE,

  /**
   * An Image type carries an opaque handle once for each stream.
   * The opaque handle would be a platform specific identifier.
   */
  OVERLAY_IMAGE
};

enum class StereoMode {
  MONO,
  LEFT_RIGHT,
  RIGHT_LEFT,
  BOTTOM_TOP,
  TOP_BOTTOM
};

} // namespace

#endif
# 98 "../../dist/include/ImageTypes.h"
# 12 "../../dist/include/MediaInfo.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/MediaInfo.h"
#if 0 /* expanded by -frewrite-includes */
#include "StreamBuffer.h" // for TrackID
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/StreamBuffer.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_STREAMBUFFER_H_
#define MOZILLA_STREAMBUFFER_H_

#if 0 /* expanded by -frewrite-includes */
#include "MediaSegment.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/MediaSegment.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_MEDIASEGMENT_H_
#define MOZILLA_MEDIASEGMENT_H_

#if 0 /* expanded by -frewrite-includes */
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/Latency.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_LATENCY_H
#define MOZILLA_LATENCY_H

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TimeStamp.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/Latency.h"
#if 0 /* expanded by -frewrite-includes */
#include "prlog.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/Latency.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/Latency.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIThread.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/Latency.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Monitor.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Monitor.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_Monitor_h
#define mozilla_Monitor_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CondVar.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/CondVar.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_CondVar_h
#define mozilla_CondVar_h

#if 0 /* expanded by -frewrite-includes */
#include "prcvar.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcvar.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef prcvar_h___
#define prcvar_h___

#if 0 /* expanded by -frewrite-includes */
#include "prlock.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcvar.h"
#if 0 /* expanded by -frewrite-includes */
#include "prinrval.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcvar.h"

PR_BEGIN_EXTERN_C

typedef struct PRCondVar PRCondVar;

/*
** Create a new condition variable.
**
** 	"lock" is the lock used to protect the condition variable.
**
** Condition variables are synchronization objects that threads can use
** to wait for some condition to occur.
**
** This may fail if memory is tight or if some operating system resource
** is low. In such cases, a NULL will be returned.
*/
NSPR_API(PRCondVar*) PR_NewCondVar(PRLock *lock);

/*
** Destroy a condition variable. There must be no thread
** waiting on the condvar. The caller is responsible for guaranteeing
** that the condvar is no longer in use.
**
*/
NSPR_API(void) PR_DestroyCondVar(PRCondVar *cvar);

/*
** The thread that waits on a condition is blocked in a "waiting on
** that all threads waiting on a single condition have identical semantics,
** therefore which one gets notified is not significant. 
**
** The calling thead must hold the lock that protects the condition, as
** well as the invariants that are tightly bound to the condition, when
** notify is called.
**
** Returns PR_FAILURE if the caller has not locked the lock associated
** with the condition variable.
*/
NSPR_API(PRStatus) PR_NotifyCondVar(PRCondVar *cvar);

/*
** Notify all of the threads waiting on the condition variable. The order
** that the threads are notified is indeterminant. The lock that protects
** the condition must be held.
**
** Returns PR_FAILURE if the caller has not locked the lock associated
** with the condition variable.
*/
NSPR_API(PRStatus) PR_NotifyAllCondVar(PRCondVar *cvar);

PR_END_EXTERN_C

#endif /* prcvar_h___ */
# 95 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prcvar.h"
# 11 "../../dist/include/mozilla/CondVar.h" 2
# 18 "../../dist/include/mozilla/CondVar.h"

namespace mozilla {


/**
 * CondVar
 * Vanilla condition variable.  Please don't use this unless you have a
 * compelling reason --- Monitor provides a simpler API.
 */
class CondVar : BlockingResourceBase
{
public:
  /**
   * CondVar
   *
      NS_RUNTIMEABORT("Can't allocate mozilla::CondVar");
    }
  }

  /**
   * ~CondVar
   * Clean up after this CondVar, but NOT its associated Mutex.
   **/
  ~CondVar()
  {
    NS_ASSERTION(mCvar && mLock,
                 "improperly constructed CondVar or double free");
    PR_DestroyCondVar(mCvar);
    mCvar = 0;
    mLock = 0;
    MOZ_COUNT_DTOR(CondVar);
  }

#ifndef DEBUG
  /**
   * Wait
   * @see prcvar.h
   **/
  
#else
# 83 "../../dist/include/mozilla/CondVar.h"
  nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TIMEOUT);
#endif // ifndef DEBUG
# 85 "../../dist/include/mozilla/CondVar.h"

  /**
   * Notify
   * @see prcvar.h
   **/
  

  /**
   * NotifyAll
   * @see prcvar.h
   **/
  

#ifdef DEBUG
  /**
   * AssertCurrentThreadOwnsMutex
   * @see Mutex::AssertCurrentThreadOwns
   **/
  void AssertCurrentThreadOwnsMutex()
  {
    mLock->AssertCurrentThreadOwns();
  }

  /**
   * AssertNotCurrentThreadOwnsMutex
   * @see Mutex::AssertNotCurrentThreadOwns
   **/
  void AssertNotCurrentThreadOwnsMutex()
  {
    mLock->AssertNotCurrentThreadOwns();
  }

#else
# 126 "../../dist/include/mozilla/CondVar.h"
  
  

#endif  // ifdef DEBUG
# 130 "../../dist/include/mozilla/CondVar.h"

private:
  ;
  ;
  ;

  Mutex* mLock;
  PRCondVar* mCvar;
};


} // namespace mozilla


#endif  // ifndef mozilla_CondVar_h  
# 145 "../../dist/include/mozilla/CondVar.h"
# 11 "../../dist/include/mozilla/Monitor.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Mutex.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/Monitor.h"

namespace mozilla {

/**
 * Monitor provides a *non*-reentrant monitor: *not* a Java-style
 * monitor.  If your code needs support for reentrancy, use
 * ReentrantMonitor instead.  (Rarely should reentrancy be needed.)
 *
 * Instead of directly calling Monitor methods, it's safer and simpler
 * to instead use the RAII wrappers MonitorAutoLock and
 * MonitorAutoUnlock.
 */
class Monitor
{
public:
  

  

  
  

  

  
  

  void AssertCurrentThreadOwns() const
  {
    mMutex.AssertCurrentThreadOwns();
  }

  

private:
  ;
  ;
  ;

  Mutex mMutex;
  CondVar mCondVar;
};

/**
 * Lock the monitor for the lexical scope instances of this class are
 * bound to (except for MonitorAutoUnlock in nested scopes).
 *
 * The monitor must be unlocked when instances of this class are
 * created.
 */
class MOZ_STACK_CLASS MonitorAutoLock
{
public:

private:
  ;
  ;
  ;
  static void* operator new(size_t) CPP_THROW_NEW;

  Monitor* mMonitor;
};

} // namespace mozilla

#endif // mozilla_Monitor_h
# 136 "../../dist/include/mozilla/Monitor.h"
# 15 "../../dist/include/Latency.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/Latency.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIObserver.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/Latency.h"

class AsyncLatencyLogger;
class LogEvent;

;

// This class is a singleton. It is refcounted.
class AsyncLatencyLogger : public nsIObserver
{
  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSIOBSERVER

public:

  enum LatencyLogIndex {
    AudioMediaStreamTrack = 0,
    VideoMediaStreamTrack,
    Cubeb,
    AudioStream,
    NetEQ,
    AudioCaptureBase, // base time for capturing an audio stream
    AudioCapture, // records number of samples captured and the time
    AudioTrackInsertion, // # of samples inserted into a mediastreamtrack and the time
    MediaPipelineAudioInsertion, // Timestamp and time of timestamp
    AudioTransmit, // Timestamp and socket send time
    AudioReceive, // Timestamp and receive time
    MediaPipelineAudioPlayout, // Timestamp and playout into MST time
    MediaStreamCreate, // Source and TrackUnion streams
    AudioStreamCreate, // TrackUnion stream and AudioStream
    AudioSendRTP,
    AudioRecvRTP,
    _MAX_INDEX
  };
  // Log with a null timestamp
  ;
  // Log with a timestamp
  ;
  // Write a log message to NSPR
  ;
  // Get the base time used by the logger for delta calculations
  ;

  ;
  mozilla::TimeStamp mStart;
  // This monitor protects mStart and mMediaLatencyLog for the
  // initialization sequence. It is initialized at layout startup, and
  // destroyed at layout shutdown.
  mozilla::Mutex mMutex;
};

// need uint32_t versions for access from webrtc/trunk code
// Log without a time delta
;
;
// Log TimeStamp::Now() (as delta)
;
void LogTime(uint32_t index, uint64_t aID, int64_t aValue);
// Log the specified time (as delta)
void LogTime(AsyncLatencyLogger::LatencyLogIndex index, uint64_t aID, int64_t aValue,
             mozilla::TimeStamp &aTime);

// For generating unique-ish ids for logged sources
#define LATENCY_STREAM_ID(source, trackID) \
  ((((uint64_t) (source)) & ~0x0F) | (trackID))

#endif
# 101 "../../dist/include/Latency.h"
# 15 "../../dist/include/MediaSegment.h" 2

namespace mozilla {

/**
 * Track or graph rate in Hz. Maximum 1 << TRACK_RATE_MAX_BITS Hz. This
 * maximum avoids overflow in conversions between track rates and conversions
 * from seconds.
 */
typedef int32_t TrackRate;
const int64_t TRACK_RATE_MAX_BITS = 20;
const TrackRate TRACK_RATE_MAX = 1 << TRACK_RATE_MAX_BITS;

/**
 * A number of ticks at a rate determined by some underlying track (e.g.
 * audio sample rate). We want to make sure that multiplying TrackTicks by
 * a TrackRate doesn't overflow, so we set its max accordingly.
 * StreamTime should be used instead when we're working with MediaStreamGraph's
 * rate, but TrackTicks can be used outside MediaStreams when we have data
 * at a different rate.
 */
typedef int64_t TrackTicks;
const int64_t TRACK_TICKS_MAX = INT64_MAX >> TRACK_RATE_MAX_BITS;

/**
 * We represent media times in 64-bit audio frame counts or ticks.
 * All tracks in a MediaStreamGraph have the same rate.
 */
typedef int64_t MediaTime;
const int64_t MEDIA_TIME_MAX = TRACK_TICKS_MAX;

/**
 * Media time relative to the start of a StreamBuffer.
 */
typedef MediaTime StreamTime;
const StreamTime STREAM_TIME_MAX = MEDIA_TIME_MAX;

/**
 * A MediaSegment is a chunk of media data sequential in time. Different
 * types of data have different subclasses of MediaSegment, all inheriting
 * from MediaSegmentBase.
 * All MediaSegment data is timed using StreamTime. The actual tick rate
 * is defined on a per-track basis. For some track types, this can be
 * a fixed constant for all tracks of that type (e.g. 1MHz for video).
 *
 * Each media segment defines a concept of "null media data" (e.g. silence
 * for audio or "no video frame" for video), which can be efficiently
 * represented. This is used for padding.
 */
class MediaSegment {
public:
  virtual ~MediaSegment()
  {
    MOZ_COUNT_DTOR(MediaSegment);
  }

  enum Type {
    AUDIO,
    VIDEO,
    TYPE_COUNT
  };

  /**
   * Gets the total duration of the segment.
   */
  StreamTime GetDuration() const { return mDuration; }
  Type GetType() const { return mType; }

  /**
   * Create a MediaSegment of the same type.
   */
  virtual MediaSegment* CreateEmptyClone() const = 0;
  /**
   * Moves contents of aSource to the end of this segment.
   */
  virtual void AppendFrom(MediaSegment* aSource) = 0;
  /**
   * Append a slice of aSource to this segment.
   */
  virtual void AppendSlice(const MediaSegment& aSource,
                           StreamTime aStart, StreamTime aEnd) = 0;
  /**
   * Replace all contents up to aDuration with null data.
   */
  virtual void ForgetUpTo(StreamTime aDuration) = 0;
  /**
   * Forget all data buffered after a given point
   */
  virtual void FlushAfter(StreamTime aNewEnd) = 0;
  /**
   * Insert aDuration of null data at the start of the segment.
   */
  virtual void InsertNullDataAtStart(StreamTime aDuration) = 0;
  /**
   * Insert aDuration of null data at the end of the segment.
   */
  virtual void AppendNullData(StreamTime aDuration) = 0;
  /**
   * Replace contents with disabled data of the same duration
   */
  virtual void ReplaceWithDisabled() = 0;
  /**
   * Remove all contents, setting duration to 0.
   */
  virtual void Clear() = 0;

  virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
  {
    return 0;
  }

  virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
  {
    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
  }

protected:
  explicit MediaSegment(Type aType) : mDuration(0), mType(aType)
  {
    MOZ_COUNT_CTOR(MediaSegment);
  }

  StreamTime mDuration; // total of mDurations of all chunks
  Type mType;
};

/**
 * C is the implementation class subclassed from MediaSegmentBase.
 * C must contain a Chunk class.
 */
template <class C, class Chunk> class MediaSegmentBase : public MediaSegment {
public:
  virtual MediaSegment* CreateEmptyClone() const MOZ_OVERRIDE
  {
    return new C();
  }
  virtual void AppendFrom(MediaSegment* aSource) MOZ_OVERRIDE
  {
    NS_ASSERTION(aSource->GetType() == C::StaticType(), "Wrong type");
    AppendFromInternal(static_cast<C*>(aSource));
  }
  void AppendFrom(C* aSource)
  {
    AppendFromInternal(aSource);
  }
  virtual void AppendSlice(const MediaSegment& aSource,
                           StreamTime aStart, StreamTime aEnd) MOZ_OVERRIDE
  {
    NS_ASSERTION(aSource.GetType() == C::StaticType(), "Wrong type");
    AppendSliceInternal(static_cast<const C&>(aSource), aStart, aEnd);
  }
  
  /**
   * Replace the first aDuration ticks with null media data, because the data
   * will not be required again.
   */
  virtual void ForgetUpTo(StreamTime aDuration) MOZ_OVERRIDE
  {
    if (mChunks.IsEmpty() || aDuration <= 0) {
      return;
    }
    if (mChunks[0].IsNull()) {
      StreamTime extraToForget = std::min(aDuration, mDuration) - mChunks[0].GetDuration();
      if (extraToForget > 0) {
        RemoveLeading(extraToForget, 1);
        mChunks[0].mDuration += extraToForget;
        mDuration += extraToForget;
      }
      return;
    }
    RemoveLeading(aDuration, 0);
    mChunks.InsertElementAt(0)->SetNull(aDuration);
    mDuration += aDuration;
  }
  virtual void FlushAfter(StreamTime aNewEnd) MOZ_OVERRIDE
  {
    if (mChunks.IsEmpty()) {
      return;
    }

    if (mChunks[0].IsNull()) {
      StreamTime extraToKeep = aNewEnd - mChunks[0].GetDuration();
      if (extraToKeep < 0) {
        // reduce the size of the Null, get rid of everthing else
        mChunks[0].SetNull(aNewEnd);
        extraToKeep = 0;
      }
      RemoveTrailing(extraToKeep, 1);
    } else {
      if (aNewEnd > mDuration) {
        NS_ASSERTION(aNewEnd <= mDuration, "can't add data in FlushAfter");
        return;
      }
      RemoveTrailing(aNewEnd, 0);
    }
    mDuration = aNewEnd;
  }
  virtual void InsertNullDataAtStart(StreamTime aDuration) MOZ_OVERRIDE
  {
    if (aDuration <= 0) {
      return;
    }
    if (!mChunks.IsEmpty() && mChunks[0].IsNull()) {
      mChunks[0].mDuration += aDuration;
    } else {
      mChunks.InsertElementAt(0)->SetNull(aDuration);
    }
#ifdef MOZILLA_INTERNAL_API
    mChunks[0].mTimeStamp = mozilla::TimeStamp::Now();
#endif
# 227 "../../dist/include/MediaSegment.h"
    mDuration += aDuration;
  }
  virtual void AppendNullData(StreamTime aDuration) MOZ_OVERRIDE
  {
    if (aDuration <= 0) {
      return;
    }
    if (!mChunks.IsEmpty() && mChunks[mChunks.Length() - 1].IsNull()) {
      mChunks[mChunks.Length() - 1].mDuration += aDuration;
    } else {
      mChunks.AppendElement()->SetNull(aDuration);
    }
    mDuration += aDuration;
  }
  virtual void ReplaceWithDisabled() MOZ_OVERRIDE
  {
    if (GetType() != AUDIO) {
      MOZ_CRASH("Disabling unknown segment type");
    }
    StreamTime duration = GetDuration();
    Clear();
    AppendNullData(duration);
  }
  virtual void Clear() MOZ_OVERRIDE
  {
    mDuration = 0;
    mChunks.Clear();
  }

  class ChunkIterator {
  public:
    explicit ChunkIterator(MediaSegmentBase<C, Chunk>& aSegment)
      : mSegment(aSegment), mIndex(0) {}
    bool IsEnded() { return mIndex >= mSegment.mChunks.Length(); }
    void Next() { ++mIndex; }
    Chunk& operator*() { return mSegment.mChunks[mIndex]; }
    Chunk* operator->() { return &mSegment.mChunks[mIndex]; }
  private:
    MediaSegmentBase<C, Chunk>& mSegment;
    uint32_t mIndex;
  };

  

#ifdef MOZILLA_INTERNAL_API
  void GetStartTime(TimeStamp &aTime) {
    aTime = mChunks[0].mTimeStamp;
  }
#endif
# 279 "../../dist/include/MediaSegment.h"

  virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
  {
    size_t amount = mChunks.SizeOfExcludingThis(aMallocSizeOf);
    for (size_t i = 0; i < mChunks.Length(); i++) {
      amount += mChunks[i].SizeOfExcludingThisIfUnshared(aMallocSizeOf);
    }
    return amount;
  }

  virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
  {
    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
  }

protected:
  explicit MediaSegmentBase(Type aType) : MediaSegment(aType) {}

  /**
   * Appends the contents of aSource to this segment, clearing aSource.
   */
  void AppendFromInternal(MediaSegmentBase<C, Chunk>* aSource)
  {
    MOZ_ASSERT(aSource->mDuration >= 0);
    mDuration += aSource->mDuration;
    aSource->mDuration = 0;
    if (!mChunks.IsEmpty() && !aSource->mChunks.IsEmpty() &&
        mChunks[mChunks.Length() - 1].CanCombineWithFollowing(aSource->mChunks[0])) {
      mChunks[mChunks.Length() - 1].mDuration += aSource->mChunks[0].mDuration;
      aSource->mChunks.RemoveElementAt(0);
    }
    mChunks.MoveElementsFrom(aSource->mChunks);
  }

  void AppendSliceInternal(const MediaSegmentBase<C, Chunk>& aSource,
                           StreamTime aStart, StreamTime aEnd)
  {
    MOZ_ASSERT(aStart <= aEnd, "Endpoints inverted");
    NS_WARN_IF_FALSE(aStart >= 0 && aEnd <= aSource.mDuration, "Slice out of range");
    mDuration += aEnd - aStart;
    StreamTime offset = 0;
    for (uint32_t i = 0; i < aSource.mChunks.Length() && offset < aEnd; ++i) {
      const Chunk& c = aSource.mChunks[i];
      StreamTime start = std::max(aStart, offset);
      StreamTime nextOffset = offset + c.GetDuration();
      StreamTime end = std::min(aEnd, nextOffset);
      if (start < end) {
        mChunks.AppendElement(c)->SliceTo(start - offset, end - offset);
      }
      offset = nextOffset;
    }
  }

  Chunk* AppendChunk(StreamTime aDuration)
  {
    MOZ_ASSERT(aDuration >= 0);
    Chunk* c = mChunks.AppendElement();
    c->mDuration = aDuration;
    mDuration += aDuration;
    return c;
  }

  

  

  void RemoveLeading(StreamTime aDuration, uint32_t aStartIndex)
  {
    NS_ASSERTION(aDuration >= 0, "Can't remove negative duration");
    StreamTime t = aDuration;
    uint32_t chunksToRemove = 0;
    for (uint32_t i = aStartIndex; i < mChunks.Length() && t > 0; ++i) {
      Chunk* c = &mChunks[i];
      if (c->GetDuration() > t) {
        c->SliceTo(t, c->GetDuration());
        t = 0;
        break;
      }
      t -= c->GetDuration();
      chunksToRemove = i + 1 - aStartIndex;
    }
    mChunks.RemoveElementsAt(aStartIndex, chunksToRemove);
    mDuration -= aDuration - t;
  }

  void RemoveTrailing(StreamTime aKeep, uint32_t aStartIndex)
  {
    NS_ASSERTION(aKeep >= 0, "Can't keep negative duration");
    StreamTime t = aKeep;
    uint32_t i;
    for (i = aStartIndex; i < mChunks.Length(); ++i) {
      Chunk* c = &mChunks[i];
      if (c->GetDuration() > t) {
        c->SliceTo(0, t);
        break;
      }
      t -= c->GetDuration();
      if (t == 0) {
        break;
      }
    }
    if (i+1 < mChunks.Length()) {
      mChunks.RemoveElementsAt(i+1, mChunks.Length() - (i+1));
    }
    // Caller must adjust mDuration
  }

  nsTArray<Chunk> mChunks;
#ifdef MOZILLA_INTERNAL_API
  mozilla::TimeStamp mTimeStamp;
#endif
# 414 "../../dist/include/MediaSegment.h"
};

}

#endif /* MOZILLA_MEDIASEGMENT_H_ */
# 419 "../../dist/include/MediaSegment.h"
# 10 "../../dist/include/StreamBuffer.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/StreamBuffer.h"

namespace mozilla {

/**
 * Unique ID for track within a StreamBuffer. Tracks from different
 * StreamBuffers may have the same ID; this matters when appending StreamBuffers,
 * since tracks with the same ID are matched. Only IDs greater than 0 are allowed.
 */
typedef int32_t TrackID;
const TrackID TRACK_NONE = 0;
const TrackID TRACK_INVALID = -1;




/**
 * This object contains the decoded data for a stream's tracks.
 * A StreamBuffer can be appended to. Logically a StreamBuffer only gets longer,
 * but we also have the ability to "forget" data before a certain time that
 * we know won't be used again. (We prune a whole number of seconds internally.)
 *
 * StreamBuffers should only be used from one thread at a time.
 *
 * A StreamBuffer has a set of tracks that can be of arbitrary types ---
 * the data for each track is a MediaSegment. The set of tracks can vary
 * over the timeline of the StreamBuffer.
 */
class StreamBuffer {
public:
  /**
   * Every track has a start time --- when it started in the StreamBuffer.
   * It has an end flag; when false, no end point is known; when true,
   * the track ends when the data we have for the track runs out.
   * Tracks have a unique ID assigned at creation. This allows us to identify
   * the same track across StreamBuffers. A StreamBuffer should never have
   * two tracks with the same ID (even if they don't overlap in time).
   * TODO Tracks can also be enabled and disabled over time.
   * TODO Add TimeVarying<StreamTime,bool> mEnabled.
   * Takes ownership of aSegment.
   */
  class Track {
    
  public:
    ~Track()
    {
      MOZ_COUNT_DTOR(Track);
    }
    
    
    TrackID GetID() const { return mID; }
    
    
    
    MediaSegment::Type GetType() const { return mSegment->GetType(); }

    
    
    
    
    

    

  protected:
    friend class StreamBuffer;

    // Start offset is in ticks at rate mRate
    StreamTime mStart;
    // The segment data starts at the start of the owning StreamBuffer, i.e.,
    // there's mStart silence/no video at the beginning.
    nsAutoPtr<MediaSegment> mSegment;
    // Unique ID
    TrackID mID;
    // True when the track ends with the data in mSegment
    bool mEnded;
  };

  class CompareTracksByID {
  public:
    
    
  };

  
  ~StreamBuffer()
  {
    MOZ_COUNT_DTOR(StreamBuffer);
  }
  
  

  /**
   * The end time for the StreamBuffer is the latest time for which we have
   * data for all tracks that haven't ended by that time.
   */
  StreamTime GetEnd() const;

  /**
   * Returns the earliest time >= 0 at which all tracks have ended
   * and all their data has been played out and no new tracks can be added,
   * or STREAM_TIME_MAX if there is no such time.
   */
  ;

#ifdef DEBUG
  void DumpTrackInfo() const;
#endif
# 241 "../../dist/include/StreamBuffer.h"

  ;

  class TrackIter {
  public:
    /**
     * Iterate through the tracks of aBuffer in order of ID.
     */
    
    /**
     * Iterate through the tracks of aBuffer with type aType, in order of ID.
     */
    
    
    
    
    
    
  private:
    

    const nsTArray<nsAutoPtr<Track> >* mBuffer;
    uint32_t mIndex;
    MediaSegment::Type mType;
    bool mMatchType;
  };
  friend class TrackIter;

  // Any new tracks added will start at or after this time. In other words, the track
  // list is complete and correct for all times less than this time.
  StreamTime mTracksKnownTime;
  StreamTime mForgottenTime;
  // All known tracks for this StreamBuffer
  nsTArray<nsAutoPtr<Track> > mTracks;
#ifdef DEBUG
  bool mGraphRateIsSet;
#endif
# 308 "../../dist/include/StreamBuffer.h"
};

}

#endif /* MOZILLA_STREAMBUFFER_H_ */
# 313 "../../dist/include/StreamBuffer.h"

# 14 "../../dist/include/MediaInfo.h" 2

namespace mozilla {

struct TrackInfo {
  void Init(const nsAString& aId,
            const nsAString& aKind,
            const nsAString& aLabel,
            const nsAString& aLanguage,
            bool aEnabled,
            TrackID aOutputId = TRACK_INVALID)
  {
    mId = aId;
    mKind = aKind;
    mLabel = aLabel;
    mLanguage = aLanguage;
    mEnabled = aEnabled;
    mOutputId = aOutputId;
  }

  nsString mId;
  nsString mKind;
  nsString mLabel;
  nsString mLanguage;
  bool mEnabled;
  TrackID mOutputId;
};

// Stores info relevant to presenting media frames.
class VideoInfo {
private:
  void Init(int32_t aWidth, int32_t aHeight, bool aHasVideo)
  {
    mDisplay = nsIntSize(aWidth, aHeight);
    mStereoMode = StereoMode::MONO;
    mHasVideo = aHasVideo;

    // TODO: TrackInfo should be initialized by its specific codec decoder.
    // This following call should be removed once we have that implemented.
    mTrackInfo.Init(NS_LITERAL_STRING("2"), NS_LITERAL_STRING("main"),
                    EmptyString(), EmptyString(), true, 2);
  }

public:
  VideoInfo()
  {
    Init(0, 0, false);
  }

  VideoInfo(int32_t aWidth, int32_t aHeight)
  {
    Init(aWidth, aHeight, true);
  }

  // Size in pixels at which the video is rendered. This is after it has
  // been scaled by its aspect ratio.
  nsIntSize mDisplay;

  // Indicates the frame layout for single track stereo videos.
  StereoMode mStereoMode;

  // True if we have an active video bitstream.
  bool mHasVideo;

  TrackInfo mTrackInfo;
};

class AudioInfo {
public:
  AudioInfo()
    : mRate(44100)
    , mChannels(2)
    , mHasAudio(false)
  {
    // TODO: TrackInfo should be initialized by its specific codec decoder.
    // This following call should be removed once we have that implemented.
    mTrackInfo.Init(NS_LITERAL_STRING("1"), NS_LITERAL_STRING("main"),
                    EmptyString(), EmptyString(), true, 1);
  }

  // Sample rate.
  uint32_t mRate;

  // Number of audio channels.
  uint32_t mChannels;

  // True if we have an active audio bitstream.
  bool mHasAudio;

  TrackInfo mTrackInfo;
};

class MediaInfo {
public:
  MediaInfo() : mIsEncrypted(false) {}
  bool mIsEncrypted;

  // TODO: Store VideoInfo and AudioIndo in arrays to support multi-tracks.
  VideoInfo mVideo;
  AudioInfo mAudio;
};

} // namespace mozilla

#endif // MediaInfo_h
# 134 "../../dist/include/MediaInfo.h"
# 12 "../../dist/include/AbstractMediaDecoder.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/AbstractMediaDecoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDataHashtable.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/AbstractMediaDecoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsThreadUtils.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/AbstractMediaDecoder.h"

namespace mozilla
{

namespace layers
{
  class ImageContainer;
}
class MediaResource;
class ReentrantMonitor;
class VideoFrameContainer;
class TimedMetadata;
class MediaDecoderOwner;
#ifdef MOZ_EME
class CDMProxy;
#endif
# 31 "../../dist/include/AbstractMediaDecoder.h"

typedef nsDataHashtable<nsCStringHashKey, nsCString> MetadataTags;

static inline bool IsCurrentThread(nsIThread* aThread) {
  return NS_GetCurrentThread() == aThread;
}

enum class MediaDecoderEventVisibility : int8_t {
  Observable,
  Suppressed
};

/**
 * The AbstractMediaDecoder class describes the public interface for a media decoder
 * and is used by the MediaReader classes.
 */
class AbstractMediaDecoder : public nsISupports
{
public:
  // Returns the monitor for other threads to synchronise access to
  // state.
  virtual ReentrantMonitor& GetReentrantMonitor() = 0;

  // counts.
  // Can be called on any thread.
  virtual void NotifyDecodedFrames(uint32_t aParsed, uint32_t aDecoded,
                                   uint32_t aDropped) = 0;

  // Return the duration of the media in microseconds.
  virtual int64_t GetMediaDuration() = 0;

  // Set the duration of the media in microseconds.
  virtual void SetMediaDuration(int64_t aDuration) = 0;

  // Sets the duration of the media in microseconds. The MediaDecoder
  // fires a durationchange event to its owner (e.g., an HTML audio
  // tag).
  virtual void UpdateEstimatedMediaDuration(int64_t aDuration) = 0;

  // Set the media as being seekable or not.
  virtual void SetMediaSeekable(bool aMediaSeekable) = 0;

  virtual VideoFrameContainer* GetVideoFrameContainer() = 0;
  virtual mozilla::layers::ImageContainer* GetImageContainer() = 0;

  // Return true if the media layer supports seeking.
  virtual bool IsTransportSeekable() = 0;

  // Return true if the transport layer supports seeking.
  virtual bool IsMediaSeekable() = 0;

  virtual void MetadataLoaded(nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags, MediaDecoderEventVisibility aEventVisibility) = 0;
  virtual void QueueMetadata(int64_t aTime, nsAutoPtr<MediaInfo> aInfo, nsAutoPtr<MetadataTags> aTags) = 0;
  virtual void FirstFrameLoaded(nsAutoPtr<MediaInfo> aInfo, MediaDecoderEventVisibility aEventVisibility) = 0;

  virtual void RemoveMediaTracks() = 0;

  // Set the media end time in microseconds
  virtual void SetMediaEndTime(int64_t aTime) = 0;

  // May be called by the reader to notify this decoder that the metadata from
  // the media file has been read. Call on the decode thread only.
  virtual void OnReadMetadataCompleted() = 0;

  // Returns the owner of this media decoder. The owner should only be used
  // on the main thread.
  virtual MediaDecoderOwner* GetOwner() = 0;

  // May be called by the reader to notify the decoder that the resources
  // required to begin playback have been acquired. Can be called on any thread.
  virtual void NotifyWaitingForResourcesStatusChanged() = 0;
  virtual bool HasInitializationData() { return false; }

  // Stack based class to assist in notifying the frame statistics of
  // parsed and decoded frames. Use inside video demux & decode functions
  // to ensure all parsed and decoded frames are reported on all return paths.
  class AutoNotifyDecoded {
  public:
    explicit AutoNotifyDecoded(AbstractMediaDecoder* aDecoder)
      : mParsed(0), mDecoded(0), mDropped(0), mDecoder(aDecoder) {}
    ~AutoNotifyDecoded() {
      if (mDecoder) {
        mDecoder->NotifyDecodedFrames(mParsed, mDecoded, mDropped);
      }
    }
    uint32_t mParsed;
    uint32_t mDecoded;
    uint32_t mDropped;

  private:
    AbstractMediaDecoder* mDecoder;
  };

#ifdef MOZ_EME
  virtual nsresult SetCDMProxy(CDMProxy* aProxy) { return NS_ERROR_NOT_IMPLEMENTED; }
  virtual CDMProxy* GetCDMProxy() { return nullptr; }
#endif
# 160 "../../dist/include/AbstractMediaDecoder.h"
};

class MetadataContainer
{
protected:
  MetadataContainer(AbstractMediaDecoder* aDecoder,
                    nsAutoPtr<MediaInfo> aInfo,
                    nsAutoPtr<MetadataTags> aTags,
                    MediaDecoderEventVisibility aEventVisibility)
    : mDecoder(aDecoder),
      mInfo(aInfo),
      mTags(aTags),
      mEventVisibility(aEventVisibility)
  {}

  nsRefPtr<AbstractMediaDecoder> mDecoder;
  nsAutoPtr<MediaInfo>  mInfo;
  nsAutoPtr<MetadataTags> mTags;
  MediaDecoderEventVisibility mEventVisibility;
};

class MetadataEventRunner : public nsRunnable, private MetadataContainer
{
public:
  MetadataEventRunner(AbstractMediaDecoder* aDecoder,
                      nsAutoPtr<MediaInfo> aInfo,
                      nsAutoPtr<MetadataTags> aTags,
                      MediaDecoderEventVisibility aEventVisibility = MediaDecoderEventVisibility::Observable)
    : MetadataContainer(aDecoder, aInfo, aTags, aEventVisibility)
  {}

  NS_IMETHOD Run() MOZ_OVERRIDE
  {
    mDecoder->MetadataLoaded(mInfo, mTags, mEventVisibility);
    return NS_OK;
    nsAutoPtr<MediaInfo> info(new MediaInfo());
    *info = *mInfo;

    mDecoder->RemoveMediaTracks();
    return NS_OK;
  }

private:
  nsRefPtr<AbstractMediaDecoder> mDecoder;
};

}

#endif
# 256 "../../dist/include/AbstractMediaDecoder.h"

# 9 "../../dist/include/MediaDecoderOwner.h" 2

namespace mozilla {

class VideoFrameContainer;

namespace dom {
class HTMLMediaElement;
}

class MediaDecoderOwner
{
public:
  // Called by the media decoder to indicate that the download is progressing.
  virtual void DownloadProgressed() = 0;

  // Dispatch an asynchronous event to the decoder owner
  virtual nsresult DispatchAsyncEvent(const nsAString& aName) = 0;
  // Return true if decoding should be paused
  virtual bool GetPaused() = 0;

  // Called by the video decoder object, on the main thread,
  // when it has read the metadata containing video dimensions,
  // etc.
  // Must take ownership of MetadataTags aTags argument.
  virtual void MetadataLoaded(const MediaInfo* aInfo,
                              nsAutoPtr<const MetadataTags> aTags) = 0;

  // Called by the decoder object, on the main thread,
  // when it has read the first frame of the video or audio.
  virtual void FirstFrameLoaded() = 0;

  // Called by the video decoder object, on the main thread,
  // when the resource has a network error during loading.
  virtual void NetworkError() = 0;

  // Called by the video decoder object, on the main thread, when the
  // resource has a decode error during metadata loading or decoding.
  virtual void DecodeError() = 0;

  // Called by the video decoder object, on the main thread, when the
  // resource load has been cancelled.
  virtual void LoadAborted() = 0;

  // Called by the video decoder object, on the main thread,
  // when the video playback has ended.
  virtual void PlaybackEnded() = 0;

  // Called by the video decoder object, on the main thread,
  // when the resource has started seeking.
  // having downloaded the end, we need to notify the element a download in
  // ongoing.
  virtual void DownloadResumed(bool aForceNetworkLoading = false) = 0;

  // Called by the media decoder to indicate whether the media cache has
  // suspended the channel.
  virtual void NotifySuspendedByCache(bool aIsSuspended) = 0;

  // called to notify that the principal of the decoder's media resource has changed.
  virtual void NotifyDecoderPrincipalChanged() = 0;

  // The status of the next frame which might be available from the decoder
  enum NextFrameStatus {
    // The next frame of audio/video is available
    NEXT_FRAME_AVAILABLE,
    // The next frame of audio/video is unavailable because the decoder
    // is paused while it buffers up data
    NEXT_FRAME_UNAVAILABLE_BUFFERING,
    // The next frame of audio/video is unavailable for the decoder is seeking.
    NEXT_FRAME_UNAVAILABLE_SEEKING,
    // The next frame of audio/video is unavailable for some other reasons
    NEXT_FRAME_UNAVAILABLE,
    // Sentinel value
    NEXT_FRAME_UNINITIALIZED
  };

  // Called by the decoder when some data has been downloaded or
  // buffering/seeking has ended. aNextFrameAvailable is true when
  // the data for the next frame is available. This method will
  // decide whether to set the ready state to HAVE_CURRENT_DATA,
  // HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA.
  virtual void UpdateReadyStateForData(NextFrameStatus aNextFrame) = 0;

  // Check if the decoder owner is active.
  virtual bool IsActive() = 0;

  // Check if the decoder owner is hidden.
  virtual bool IsHidden() = 0;

  // Called by the media decoder and the video frame to get the
  // ImageContainer containing the video data.
  virtual VideoFrameContainer* GetVideoFrameContainer() = 0;

  // Called by the media decoder object, on the main thread,
  // when the connection between Rtsp server and client gets lost.
  virtual void ResetConnectionState() = 0;

#ifdef MOZ_EME
  // Dispatches a "encrypted" event to the HTMLMediaElement, with the
  // provided init data.
  // Main thread only.
  virtual void DispatchEncrypted(const nsTArray<uint8_t>& aInitData,
                                 const nsAString& aInitDataType) = 0;
#endif
# 144 "../../dist/include/MediaDecoderOwner.h"
};

}

#endif
# 149 "../../dist/include/MediaDecoderOwner.h"

# 12 "../../dist/include/mozilla/dom/HTMLMediaElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/HTMLMediaElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIObserver.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/HTMLMediaElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CORSMode.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/HTMLMediaElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "DOMMediaStream.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/DOMMediaStream.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSDOMMEDIASTREAM_H_
#define NSDOMMEDIASTREAM_H_

#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/DOMMediaStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/DOMMediaStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "StreamBuffer.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/DOMMediaStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMWindow.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/DOMMediaStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrincipal.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/DOMMediaStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/PeerIdentity.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/PeerIdentity.h" 1
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * vim: sw=2 ts=2 sts=2 expandtab
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef PeerIdentity_h
#define PeerIdentity_h

#ifdef MOZILLA_INTERNAL_API
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/PeerIdentity.h"
#else
# 13 "../../dist/include/mozilla/PeerIdentity.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringAPI.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/PeerIdentity.h"
#endif
# 15 "../../dist/include/mozilla/PeerIdentity.h"

template <class T> class nsCOMPtr;
class nsIIDNService;

namespace mozilla {

/**
 * This class implements the identifier used in WebRTC identity.  Peers are
 * identified using a string in the form [<user>@]<domain>, for instance,
 * "user@example.com'. The (optional) user portion is a site-controlled string
 * containing any character other than '@'.  The domain portion is a valid IDN
 * domain name and is compared accordingly.
 *
 * See: http://tools.ietf.org/html/draft-ietf-rtcweb-security-arch-09#section-5.6.5.3.3.1
 */
class PeerIdentity MOZ_FINAL
{
public:
  
  

  bool Equals(const PeerIdentity& aOther) const;
  bool Equals(const nsAString& aOtherString) const;
  

private:
  ;
  ;

  ;

  nsString mPeerIdentity;
};





inline bool
operator!=(const PeerIdentity& aOne, const PeerIdentity& aTwo)
{
  return !aOne.Equals(aTwo);
}

inline bool
operator!=(const PeerIdentity& aOne, const nsAString& aString)
{
  return !aOne.Equals(aString);
}


} /* namespace mozilla */

#endif /* PeerIdentity_h */
# 80 "../../dist/include/mozilla/PeerIdentity.h"
# 15 "../../dist/include/DOMMediaStream.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DOMEventTargetHelper.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/DOMEventTargetHelper.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_DOMEventTargetHelper_h_
#define mozilla_DOMEventTargetHelper_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/DOMEventTargetHelper.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsGkAtoms.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EventListenerManager.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_EventListenerManager_h_
#define mozilla_EventListenerManager_h_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/BasicEvents.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/BasicEvents.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_BasicEvents_h__
#define mozilla_BasicEvents_h__

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/BasicEvents.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/EventTarget.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/BasicEvents.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/BasicEvents.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIWidget.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIWidget.h" 1
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsIWidget_h__
#define nsIWidget_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsIWidget.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsIWidget.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWidgetInitData.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsWidgetInitData.h" 1
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsWidgetInitData_h__
#define nsWidgetInitData_h__

/**
 * Window types
 *
 * Don't alter previously encoded enum values - 3rd party apps may look at
 * these.
 */
enum nsWindowType {
  eWindowType_toplevel,           // default top level window
  eWindowType_dialog,             // top level window but usually handled differently
                                  // by the OS
  eWindowType_popup,              // used for combo boxes, etc
  eWindowType_child,              // child windows (contained inside a window on the
                                  // desktop (has no border))
  eWindowType_invisible,          // windows that are invisible or offscreen
  eWindowType_plugin,             // plugin window
  eWindowType_plugin_ipc_chrome,  // chrome side native widget for plugins (e10s)
  eWindowType_plugin_ipc_content, // content side puppet widget for plugins (e10s)
  eWindowType_sheet,              // MacOSX sheet (special dialog class)
};

/**
 * Popup types
 *
 * For eWindowType_popup
 */
enum nsPopupType {
  ePopupTypePanel,
  ePopupTypeMenu,
  ePopupTypeTooltip,
  ePopupTypeAny      = 0xF000 // used only to pass to
                              // nsXULPopupManager::GetTopPopup
};

/**
 * Popup levels specify the window ordering behaviour.
 */
enum nsPopupLevel {
  // the popup appears just above its parent and maintains its position
  // relative to the parent
  ePopupLevelParent,
  // the popup is a floating popup used for tool palettes. A parent window
  // must be specified, but a platform implementation need not use this.
  // On Windows, floating is generally equivalent to parent. On Mac, floating
  // puts the popup at toplevel, but it will hide when the application is deactivated
  ePopupLevelFloating,
  // the popup appears on top of other windows, including those of other applications
  ePopupLevelTop
};

/**
 * Border styles
 */
enum nsBorderStyle {
  eBorderStyle_none     = 0,      // no border, titlebar, etc.. opposite of
                                  // all
  eBorderStyle_all      = 1 << 0, // all window decorations
  eBorderStyle_border   = 1 << 1, // enables the border on the window. these
                                  // are only for decoration and are not
                                  // resize handles
  eBorderStyle_resizeh  = 1 << 2, // enables the resize handles for the
                                  // window. if this is set, border is
                                  // implied to also be set
  eBorderStyle_title    = 1 << 3, // enables the titlebar for the window
  eBorderStyle_menu     = 1 << 4, // enables the window menu button on the
                                  // title bar. this being on should force
                                  // the title bar to display
  eBorderStyle_minimize = 1 << 5, // enables the minimize button so the user
                                  // can minimize the window. turned off for
                                  // tranient windows since they can not be
                                  // minimized separate from their parent
  eBorderStyle_maximize = 1 << 6, // enables the maxmize button so the user
                                  // can maximize the window
  eBorderStyle_close    = 1 << 7, // show the close button
  eBorderStyle_default  = -1      // whatever the OS wants... i.e. don't do
                                  // anything
};

/**
 * Basic struct for widget initialization data.
 * @see Create member function of nsIWidget
 */

struct nsWidgetInitData {
  

  nsWindowType  mWindowType;
  nsBorderStyle mBorderStyle;
  nsPopupType   mPopupHint;
  nsPopupLevel  mPopupLevel;
  // when painting exclude area occupied by child windows and sibling windows
  bool          clipChildren, clipSiblings, mDropShadow;
  bool          mListenForResizes;
  bool          mUnicode;
  bool          mRTL;
  bool          mNoAutoHide; // true for noautohide panels
  bool          mIsDragPopup;  // true for drag feedback panels
  // true if window creation animation is suppressed, e.g. for session restore
  bool          mIsAnimationSuppressed;
  // true if the window should support an alpha channel, if available.
  bool          mSupportTranslucency;
  // true if the window should be transparent to mouse events. Currently this is
  // only valid for eWindowType_popup widgets
  bool          mMouseTransparent;
  // Windows with out-of-process tabs always require OMTC. This flag designates
  // such windows.
  bool          mRequireOffMainThreadCompositing;
};

#endif // nsWidgetInitData_h__
/* service providing platform-specific native rendering for widgets */

#ifndef nsITheme_h_
#define nsITheme_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsITheme.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsITheme.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsColor.h"
#endif /* expanded by -frewrite-includes */
// IID for the nsITheme interface
// {a21dd936-5960-46da-a724-7c114e421b41}
 #define NS_ITHEME_IID     \
{ 0xa21dd936, 0x5960, 0x46da, \
  { 0xa7, 0x24, 0x7c, 0x11, 0x4e, 0x42, 0x1b, 0x41 } }
// {0ae05515-cf7a-45a8-9e02-6556de7685b1}
#define NS_THEMERENDERER_CID \
{ 0x0ae05515, 0xcf7a, 0x45a8, \
  { 0x9e, 0x02, 0x65, 0x56, 0xde, 0x76, 0x85, 0xb1 } }

/**
 * nsITheme is a service that provides platform-specific native
 * rendering for widgets.  In other words, it provides the necessary
 * operations to draw a rendering object (an nsIFrame) as a native
 * widget.
 *
 * All the methods on nsITheme take a rendering context or device
 * context, a frame (the rendering object), and a widget type (one of
 * the constants in nsThemeConstants.h).
 */
class nsITheme: public nsISupports {
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITHEME_IID)

  /**
   * Draw the actual theme background.
   * @param aContext the context to draw into
   * @param aFrame the frame for the widget that we're drawing
   * @param aWidgetType the -moz-appearance value to draw
   * @param aRect the rectangle defining the area occupied by the widget
   * @param aDirtyRect the rectangle that needs to be drawn
   */
  NS_IMETHOD DrawWidgetBackground(nsRenderingContext* aContext,
                                  nsIFrame* aFrame,
                                  uint8_t aWidgetType,
                                  const nsRect& aRect,
                                  const nsRect& aDirtyRect) = 0;

  /**
   * Get the computed CSS border for the widget, in pixels.
   */
  NS_IMETHOD GetWidgetBorder(nsDeviceContext* aContext, 
                             nsIFrame* aFrame,
                             uint8_t aWidgetType,
                             nsIntMargin* aResult)=0;

  /**
   * This method can return false to indicate that the CSS padding
   * minimum size; if false, this size is the only valid size for the
   * widget.
   */
  NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext,
                                  nsIFrame* aFrame,
                                  uint8_t aWidgetType,
                                  nsIntSize* aResult,
                                  bool* aIsOverridable)=0;


  enum Transparency {
    eOpaque = 0,
    eTransparent,
    eUnknownTransparency
  };


  virtual bool WidgetProvidesFontSmoothingBackgroundColor(nsIFrame* aFrame,
                                      uint8_t aWidgetType, nscolor* aColor)
  { return false; }

  /**
   * ThemeGeometryType values are used for describing themed nsIFrames in
   * calls to nsIWidget::UpdateThemeGeometries. We don't simply pass the
   * -moz-appearance value ("widget type") of the frame because the widget may
   * want to treat different frames with the same -moz-appearance differently
   * based on other properties of the frame. So we give the theme a first look
   * at the frame in nsITheme::ThemeGeometryTypeForWidget and pass the
   * returned ThemeGeometryType along to the widget.
   * Each theme backend defines the ThemeGeometryType values it needs in its
   * own nsITheme subclass. eThemeGeometryTypeUnknown is the only value that's
   * shared between backends.
   */
  typedef uint8_t ThemeGeometryType;
  enum {
    eThemeGeometryTypeUnknown = 0
  };

  /**
   * Returns the theme geometry type that should be used in the ThemeGeometry
   * array that's passed to the widget using nsIWidget::UpdateThemeGeometries.
   * A return value of eThemeGeometryTypeUnknown means that this frame will
   * not be included in the ThemeGeometry array.
   */
  virtual ThemeGeometryType ThemeGeometryTypeForWidget(nsIFrame* aFrame,
                                                       uint8_t aWidgetType)
  { return eThemeGeometryTypeUnknown; }

  /**
   * Can the nsITheme implementation handle this widget?
   */
  virtual bool ThemeSupportsWidget(nsPresContext* aPresContext,
                                     nsIFrame* aFrame,
                                     uint8_t aWidgetType)=0;

  ;

  /**
   * Does the nsITheme implementation draw its own focus ring for this widget?
   */
  ;
  
  /**
    * Should we insert a dropmarker inside of combobox button?
   */
  ;

  /**
   * Should we hide scrollbars?
   */
  virtual bool ShouldHideScrollbars()
  { return false; }
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsITheme, NS_ITHEME_IID)

// Creator function
;

#endif
# 209 "../../dist/include/nsITheme.h"
# 19 "../../dist/include/nsIWidget.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsITimer.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsIWidget.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsXULAppAPI.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsXULAppAPI.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _nsXULAppAPI_h__
#define _nsXULAppAPI_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsID.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsXULAppAPI.h"
#if 0 /* expanded by -frewrite-includes */
#include "xrecore.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/xrecore.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef xrecore_h__
#define xrecore_h__

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/xrecore.h"

/**
 * Import/export macros for libXUL APIs.
 */
#ifdef XPCOM_GLUE
#define XRE_API(type, name, params) \
  typedef type (NS_FROZENCALL * name##Type) params; \
  extern name##Type name NS_HIDDEN;
#elif defined(IMPL_LIBXUL)
# 18 "../../dist/include/xrecore.h"
#define XRE_API(type, name, params) EXPORT_XPCOM_API(type) name params;
#else
# 20 "../../dist/include/xrecore.h"
#define XRE_API(type, name, params) IMPORT_XPCOM_API(type) name params;
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsXREAppData.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsXREAppData.h"

class nsIFile;

/**
 * Application-specific data needed to start the apprunner.
 *
 * @note When this structure is allocated and manipulated by XRE_CreateAppData,
 *       string fields will be allocated with NS_Alloc, and interface pointers
 *       are strong references.
 */
struct nsXREAppData
{
  /**
   * This should be set to sizeof(nsXREAppData). This structure may be
   * extended in future releases, and this ensures that binary compatibility
   * is maintained.
   */
  uint32_t size;

  /**
   * The directory of the application to be run. May be null if the
   * xulrunner and the app are installed into the same directory.
  /**
   * The application name to use in the User Agent string.
   */
  const char* UAName;
};

/**
 * Indicates whether or not the profile migrator service may be
 * invoked at startup when creating a profile.
 */
#define NS_XRE_ENABLE_PROFILE_MIGRATOR (1 << 1)

/**
 * Indicates whether or not to use Breakpad crash reporting.
 */
#define NS_XRE_ENABLE_CRASH_REPORTER (1 << 3)

#endif // nsXREAppData_h
# 144 "../../dist/include/nsXREAppData.h"
# 15 "../../dist/include/nsXULAppAPI.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsXULAppAPI.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ArrayUtils.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsXULAppAPI.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
XRE_API(void,
        XRE_FreeAppData, (nsXREAppData* aAppData))

enum GeckoProcessType
{
  GeckoProcessType_Default = 0,

  GeckoProcessType_Plugin,
  GeckoProcessType_Content,

  GeckoProcessType_IPDLUnitTest,

  GeckoProcessType_GMPlugin, // Gecko Media Plugin

  GeckoProcessType_End,
  GeckoProcessType_Invalid = GeckoProcessType_End
};

static const char* const kGeckoProcessTypeString[] = {
  "default",
  "plugin",
  "tab",
  "ipdlunittest",
  "geckomediaplugin"
};

static_assert(MOZ_ARRAY_LENGTH(kGeckoProcessTypeString) ==
              GeckoProcessType_End,
              "Array length mismatch");

XRE_API(const char*,
        XRE_ChildProcessTypeToString, (GeckoProcessType aProcessType))
namespace mozilla {
namespace gmp {
class GMPLoader;
} // namespace gmp
} // namepsace mozilla

XRE_API(nsresult,
        XRE_InitChildProcess, (int aArgc,
                               char* aArgv[],
                               mozilla::gmp::GMPLoader* aGMPLoader))

XRE_API(GeckoProcessType,
        XRE_GetProcessType, ())


XRE_API(bool,
        XRE_InitOmnijar, (nsIFile* aGreOmni,
                          nsIFile* aAppOmni))
XRE_API(void,
        XRE_StopLateWriteChecks, (void))

#ifdef XP_WIN
/**
 * Valid environment types for XRE_GetWindowsEnvironment.
 */
enum WindowsEnvironmentType
{
  WindowsEnvironmentType_Desktop = 0,
  WindowsEnvironmentType_Metro = 1
};

/**
 * Retrieve the Windows desktop environment libXUL is running
 * under. Valid after a call to XRE_main.
 */
XRE_API(WindowsEnvironmentType,
        XRE_GetWindowsEnvironment, ())
#endif // XP_WIN
# 481 "../../dist/include/nsXULAppAPI.h"

#ifdef MOZ_B2G_LOADER
XRE_API(int,
        XRE_ProcLoaderServiceRun, (pid_t, int, int argc, const char* argv[],
                                   mozilla::Vector<int>& aReservedFds));
XRE_API(void,
        XRE_ProcLoaderClientInit, (pid_t, int,
                                   mozilla::Vector<int>& aReservedFds));
XRE_API(void,
        XRE_ProcLoaderPreload, (const char* aProgramDir,
                                const nsXREAppData* aAppData));
#endif // MOZ_B2G_LOADER
# 493 "../../dist/include/nsXULAppAPI.h"

XRE_API(int,
        XRE_XPCShellMain, (int argc, char** argv, char** envp))

#endif // _nsXULAppAPI_h__
# 498 "../../dist/include/nsXULAppAPI.h"
# 21 "../../dist/include/nsIWidget.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsIWidget.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/layers/LayersTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/layers/LayersTypes.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_LAYERSTYPES_H
#define GFX_LAYERSTYPES_H

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>                     // for uint32_t
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/layers/LayersTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsPoint.h"                    // for nsIntPoint
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/layers/LayersTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRegion.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsRegion.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#ifndef nsRegion_h__
#define nsRegion_h__

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>                     // for size_t
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
#include "gfxCore.h"                    // for NS_GFX
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsRegion.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"               // for mozilla::Move
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsRegion.h"

class nsIntRegion;
class gfx3DMatrix;

#if 0 /* expanded by -frewrite-includes */
#include "pixman.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/pixman.h" 1
/***********************************************************

Copyright 1987, 1998  The Open Group
 */

#ifndef PIXMAN_H__
#define PIXMAN_H__

#ifdef MOZILLA_VERSION
#if 0 /* expanded by -frewrite-includes */
#include "cairo/pixman-rename.h"
#define pixman_transform_is_int_translate _moz_pixman_transform_is_int_translate
#define pixman_transform_is_inverse _moz_pixman_transform_is_inverse
#define pixman_transform_is_scale _moz_pixman_transform_is_scale
#define pixman_transform_multiply _moz_pixman_transform_multiply
#define pixman_transform_point _moz_pixman_transform_point
#define pixman_transform_rotate _moz_pixman_transform_rotate
#define pixman_transform_scale _moz_pixman_transform_scale
#define pixman_transform_translate _moz_pixman_transform_translate
#endif
# 129 "../../dist/include/cairo/pixman-rename.h"
# 74 "../../dist/include/pixman.h" 2
#endif
# 75 "../../dist/include/pixman.h"


#if 0 /* expanded by -frewrite-includes */
#include <pixman-version.h>
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/pixman-version.h" 1
/*
 * Copyright © 2008 Red Hat, Inc.
 *
 * Permission is hereby granted, free of charge, to any person
 * obtaining a copy of this software and associated documentation
 * SOFTWARE.
 *
 * Author: Carl D. Worth <cworth@cworth.org>
 */

#ifndef PIXMAN_VERSION_H__
# 83 "../../dist/include/pixman.h"
#define PIXMAN_BEGIN_DECLS
#define PIXMAN_END_DECLS
#endif
# 86 "../../dist/include/pixman.h"

PIXMAN_BEGIN_DECLS

/*
 * Standard integers
 */

#if !defined (PIXMAN_DONT_DEFINE_STDINT)

#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || defined (_sgi) || defined (__sun) || defined (sun) || defined (__digital__) || defined (__HP_cc)
#if 0 /* expanded by -frewrite-includes */
#  include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 97 "../../dist/include/pixman.h"
/* VS 2010 (_MSC_VER 1600) has stdint.h */
#elif defined (_MSC_VER) && _MSC_VER < 1600
# 99 "../../dist/include/pixman.h"
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
#endif
# 112 "../../dist/include/pixman.h"

#endif
# 114 "../../dist/include/pixman.h"

/*
 * Boolean
 */
typedef int pixman_bool_t;

/*
 * Fixpoint numbers
 */
typedef int64_t			pixman_fixed_32_32_t;
typedef pixman_fixed_32_32_t	pixman_fixed_48_16_t;
typedef uint32_t		pixman_fixed_1_31_t;
typedef uint32_t		pixman_fixed_1_16_t;
typedef int32_t			pixman_fixed_16_16_t;
typedef pixman_fixed_16_16_t	pixman_fixed_t;

#define pixman_fixed_e			((pixman_fixed_t) 1)
#define pixman_fixed_1			(pixman_int_to_fixed(1))
#define pixman_fixed_1_minus_e		(pixman_fixed_1 - pixman_fixed_e)
#define pixman_fixed_minus_1		(pixman_int_to_fixed(-1))
#define pixman_fixed_to_int(f)		((int) ((f) >> 16))
#define pixman_int_to_fixed(i)		((pixman_fixed_t) ((i) << 16))
#define pixman_fixed_to_double(f)	(double) ((f) / (double) pixman_fixed_1)
#define pixman_double_to_fixed(d)	((pixman_fixed_t) ((d) * 65536.0))
#define pixman_fixed_frac(f)		((f) & pixman_fixed_1_minus_e)
#define pixman_fixed_floor(f)		((f) & ~pixman_fixed_1_minus_e)
#define pixman_fixed_ceil(f)		pixman_fixed_floor ((f) + pixman_fixed_1_minus_e)
#define pixman_fixed_fraction(f)	((f) & pixman_fixed_1_minus_e)
#define pixman_fixed_mod_2(f)		((f) & (pixman_fixed1 | pixman_fixed_1_minus_e))
#define pixman_max_fixed_48_16		((pixman_fixed_48_16_t) 0x7fffffff)
#define pixman_min_fixed_48_16		(-((pixman_fixed_48_16_t) 1 << 31))

/*
 * Misc structs
 */
typedef struct pixman_color pixman_color_t;
typedef struct pixman_point_fixed pixman_point_fixed_t;
typedef struct pixman_line_fixed pixman_line_fixed_t;
typedef struct pixman_vector pixman_vector_t;
typedef struct pixman_transform pixman_transform_t;

struct pixman_color
{
    uint16_t	red;
    uint16_t    green;
    uint16_t    blue;
    uint16_t    alpha;
};

struct pixman_point_fixed
{
    pixman_fixed_t	x;
    pixman_fixed_t	y;
};

struct pixman_line_fixed
{
    pixman_point_fixed_t	p1, p2;
};
struct pixman_box16;
typedef  union pixman_image		pixman_image_t;

;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;

/*
 * Floating point matrices
 */
typedef struct pixman_f_transform pixman_f_transform_t;
typedef struct pixman_f_vector pixman_f_vector_t;

struct pixman_f_vector
{
    double  v[3];
};

struct pixman_f_transform
;
;

typedef enum
{
    PIXMAN_REPEAT_NONE,
    PIXMAN_REPEAT_NORMAL,
    PIXMAN_REPEAT_PAD,
    PIXMAN_REPEAT_REFLECT
} pixman_repeat_t;

typedef enum
{
    PIXMAN_OP_CONJOINT_DST		= 0x22,
    PIXMAN_OP_CONJOINT_OVER		= 0x23,
    PIXMAN_OP_CONJOINT_OVER_REVERSE	= 0x24,
    PIXMAN_OP_SOFT_LIGHT                = 0x38,
    PIXMAN_OP_DIFFERENCE                = 0x39,
    PIXMAN_OP_EXCLUSION                 = 0x3a,
    PIXMAN_OP_HSL_HUE			= 0x3b,
    PIXMAN_OP_HSL_SATURATION		= 0x3c,
    PIXMAN_OP_HSL_COLOR			= 0x3d,
    PIXMAN_OP_HSL_LUMINOSITY		= 0x3e

#ifdef PIXMAN_USE_INTERNAL_API
    ,
    PIXMAN_N_OPERATORS,
    PIXMAN_OP_NONE = PIXMAN_N_OPERATORS
#endif
# 388 "../../dist/include/pixman.h"
} pixman_op_t;
;
;
;
;
;
;
;
;
;
;
/*
 * 32 bit regions
 */
typedef struct pixman_region32_data	pixman_region32_data_t;
typedef struct pixman_box32		pixman_box32_t;
typedef struct pixman_rectangle32	pixman_rectangle32_t;
typedef struct pixman_region32		pixman_region32_t;

struct pixman_region32_data {
    long		size;
    long		numRects;
/*  pixman_box32_t	rects[size];   in memory but not explicitly declared */
};

struct pixman_rectangle32
{
    int32_t x, y;
    uint32_t width, height;
};

struct pixman_box32
{
    int32_t x1, y1, x2, y2;
};

struct pixman_region32
{
    pixman_box32_t          extents;
    pixman_region32_data_t  *data;
};

/* creation/destruction */
void                    pixman_region32_init               (pixman_region32_t *region);
void                    pixman_region32_init_rect          (pixman_region32_t *region,
							    int                x,
							    int                y,
							    unsigned int       width,
							    unsigned int       height);
;
;
;
void                    pixman_region32_fini               (pixman_region32_t *region);


/* manipulation */
void                    pixman_region32_translate          (pixman_region32_t *region,
							    int                x,
							    int                y);
pixman_bool_t           pixman_region32_copy               (pixman_region32_t *dest,
							    pixman_region32_t *source);
pixman_bool_t           pixman_region32_intersect          (pixman_region32_t *new_reg,
							    pixman_region32_t *reg1,
							    pixman_region32_t *reg2);
pixman_bool_t           pixman_region32_union              (pixman_region32_t *new_reg,
							    pixman_region32_t *reg1,
							    pixman_region32_t *reg2);
;
pixman_bool_t           pixman_region32_union_rect         (pixman_region32_t *dest,
							    pixman_region32_t *source,
							    int                x,
							    int                y,
							    unsigned int       width,
							    unsigned int       height);
pixman_bool_t           pixman_region32_subtract           (pixman_region32_t *reg_d,
							    pixman_region32_t *reg_m,
							    pixman_region32_t *reg_s);
;
;
;
pixman_bool_t           pixman_region32_not_empty          (pixman_region32_t *region);
;
int                     pixman_region32_n_rects            (pixman_region32_t *region);
pixman_box32_t *        pixman_region32_rectangles         (pixman_region32_t *region,
							    int               *n_rects);
pixman_bool_t           pixman_region32_equal              (pixman_region32_t *region1,
							    pixman_region32_t *region2);
;
void                    pixman_region32_reset              (pixman_region32_t *region,
							    pixman_box32_t    *box);
void			pixman_region32_clear		   (pixman_region32_t *region);


/* Copy / Fill / Misc */
;
;

;
;

/*
 * Images
 */
typedef struct pixman_indexed		pixman_indexed_t;
typedef struct pixman_gradient_stop	pixman_gradient_stop_t;

typedef uint32_t (* pixman_read_memory_func_t) (const void *src, int size);
typedef void     (* pixman_write_memory_func_t) (void *dst, uint32_t value, int size);

typedef void     (* pixman_image_destroy_func_t) (pixman_image_t *image, void *data);

struct pixman_gradient_stop {
    pixman_fixed_t x;
    pixman_color_t color;
};

#define PIXMAN_MAX_INDEXED  256 /* XXX depth must be <= 8 */

#if PIXMAN_MAX_INDEXED <= 256
typedef uint8_t pixman_index_type;
#endif
# 642 "../../dist/include/pixman.h"

struct pixman_indexed
{
    pixman_bool_t       color;
    uint32_t		rgba[PIXMAN_MAX_INDEXED];
    pixman_index_type	ent[32768];
};

/*
 * While the protocol is generous in format support, the
 * sample implementation allows only packed RGB and GBR
 * representations for data to simplify software rendering,
 */
#define PIXMAN_FORMAT(bpp,type,a,r,g,b)	(((bpp) << 24) |  \
					 ((type) << 16) | \
					 ((a) << 12) |	  \
					 ((r) << 8) |	  \
					 ((g) << 4) |	  \
					 ((b)))

#define PIXMAN_FORMAT_BPP(f)	(((f) >> 24)       )
#define PIXMAN_FORMAT_TYPE(f)	(((f) >> 16) & 0xff)
#define PIXMAN_FORMAT_A(f)	(((f) >> 12) & 0x0f)
#define PIXMAN_FORMAT_R(f)	(((f) >>  8) & 0x0f)
#define PIXMAN_FORMAT_G(f)	(((f) >>  4) & 0x0f)
#define PIXMAN_FORMAT_B(f)	(((f)      ) & 0x0f)
#define PIXMAN_FORMAT_RGB(f)	(((f)      ) & 0xfff)
#define PIXMAN_FORMAT_VIS(f)	(((f)      ) & 0xffff)
#define PIXMAN_FORMAT_DEPTH(f)	(PIXMAN_FORMAT_A(f) +	\
				 PIXMAN_FORMAT_R(f) +	\
				 PIXMAN_FORMAT_G(f) +	\
				 PIXMAN_FORMAT_B(f))

#define PIXMAN_TYPE_OTHER	0
#define PIXMAN_TYPE_A		1
#define PIXMAN_TYPE_ARGB	2
#define PIXMAN_TYPE_ABGR	3
#define PIXMAN_TYPE_COLOR	4
#define PIXMAN_TYPE_GRAY	5
#define PIXMAN_TYPE_YUY2	6
#define PIXMAN_TYPE_YV12	7
#define PIXMAN_TYPE_BGRA	8
#define PIXMAN_TYPE_RGBA	9
#define PIXMAN_TYPE_ARGB_SRGB	10

#define PIXMAN_FORMAT_COLOR(f)				\
	(PIXMAN_FORMAT_TYPE(f) == PIXMAN_TYPE_ARGB ||	\
	 PIXMAN_FORMAT_TYPE(f) == PIXMAN_TYPE_ABGR ||	\
	 PIXMAN_FORMAT_TYPE(f) == PIXMAN_TYPE_BGRA ||	\
	 PIXMAN_FORMAT_TYPE(f) == PIXMAN_TYPE_RGBA)

/* 32bpp formats */
typedef enum {
    PIXMAN_a8r8g8b8 =	 PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB,8,8,8,8),
    PIXMAN_x8r8g8b8 =	 PIXMAN_FORMAT(32,PIXMAN_TYPE_ARGB,0,8,8,8),
    PIXMAN_a8b8g8r8 =	 PIXMAN_FORMAT(32,PIXMAN_TYPE_ABGR,8,8,8,8),
    PIXMAN_yv12 =	 PIXMAN_FORMAT(12,PIXMAN_TYPE_YV12,0,0,0,0)
} pixman_format_code_t;

/* Querying supported format values. */
;
;

/* Constructors */
;
;
;
;
;
;
;
;

/*
 * Trapezoids
 */
typedef struct pixman_edge pixman_edge_t;
typedef struct pixman_trapezoid pixman_trapezoid_t;
typedef struct pixman_trap pixman_trap_t;
typedef struct pixman_span_fix pixman_span_fix_t;
typedef struct pixman_triangle pixman_triangle_t;

/*
 * An edge structure.  This represents a single polygon edge
 * and can be quickly stepped across small or large gaps in the
 * sample grid
 */
struct pixman_edge
{
    pixman_fixed_t	x;
    pixman_fixed_t	e;
    pixman_fixed_t	stepx;
    pixman_fixed_t	signdx;
    pixman_fixed_t	dy;
    pixman_fixed_t	dx;

    pixman_fixed_t	stepx_small;
    pixman_fixed_t	stepx_big;
    pixman_fixed_t	dx_small;
    pixman_fixed_t	dx_big;
};

struct pixman_trapezoid
{
    pixman_fixed_t	top, bottom;
    pixman_line_fixed_t	left, right;
};

struct pixman_triangle
{
    pixman_point_fixed_t p1, p2, p3;
};

/* whether 't' is a well defined not obviously empty trapezoid */
#define pixman_trapezoid_valid(t)				   \
    ((t)->left.p1.y != (t)->left.p2.y &&			   \
     (t)->right.p1.y != (t)->right.p2.y &&			   \
     (int) ((t)->bottom - (t)->top) > 0)

struct pixman_span_fix
;
;
;
;
;

PIXMAN_END_DECLS

#endif /* PIXMAN_H__ */
# 1117 "../../dist/include/pixman.h"
# 27 "../../dist/include/nsRegion.h" 2

/* For information on the internal representation look at pixman-region.c
 *
 * This replaces an older homebrew implementation of nsRegion. The
 * representation used here may use more rectangles than nsRegion however, the
 * representation is canonical.  This means that there's no need for an
 * Optimize() method because for a paticular region there is only one
 * representation. This means that nsIntRegion will have more predictable
 * performance characteristics than the old nsRegion and should not become
 * degenerate.
 *
 * The pixman region code originates from X11 which has spread to a variety of
 * projects including Qt, Gtk, Wine. It should perform reasonably well.
 */

enum class VisitSide {
	TOP,
	BOTTOM,
	LEFT,
	RIGHT
};

class nsRegionRectIterator;

class nsRegion
{

  friend class nsRegionRectIterator;

public:
  nsRegion () { pixman_region32_init(&mImpl); }
  MOZ_IMPLICIT nsRegion (const nsRect& aRect) { pixman_region32_init_rect(&mImpl,
                                                                          aRect.x,
                                                                          aRect.y,
                                                                          aRect.width,
                                                                          aRect.height); }
  nsRegion (const nsRegion& aRegion) { pixman_region32_init(&mImpl); pixman_region32_copy(&mImpl,aRegion.Impl()); }
  
  
  nsRegion& And(const nsRegion& aRgn1,   const nsRegion& aRgn2)
  {
    pixman_region32_intersect(&mImpl, aRgn1.Impl(), aRgn2.Impl());
    return *this;
  }
  
  
  

  
  
  nsRegion& Or(const nsRegion& aRgn1, const nsRegion& aRgn2)
  {
    pixman_region32_union(&mImpl, aRgn1.Impl(), aRgn2.Impl());
    return *this;
  }
  nsRegion& Or(const nsRegion& aRegion, const nsRect& aRect)
  {
    pixman_region32_union_rect(&mImpl, aRegion.Impl(), aRect.x, aRect.y, aRect.width, aRect.height);
    return *this;
  }
  
  nsRegion& Or(const nsRect& aRect1, const nsRect& aRect2)
  {
    Copy (aRect1);
    return Or (*this, aRect2);
  }

  
  

  ;

  
  
  nsRegion& Sub(const nsRegion& aRgn1, const nsRegion& aRgn2)
  {
    pixman_region32_subtract(&mImpl, aRgn1.Impl(), aRgn2.Impl());
    return *this;
  }
  
  
  

  /**
   * Returns true iff the given point is inside the region. A region
   * created from a rect (x=0, y=0, w=100, h=100) will NOT contain
   * the point x=100, y=100.
   */
  
  
  ;
  ;

  void MoveBy (int32_t aXOffset, int32_t aYOffset)
  {
    MoveBy (nsPoint (aXOffset, aYOffset));
  }
  void MoveBy (nsPoint aPt) { pixman_region32_translate(&mImpl, aPt.x, aPt.y); }
  void SetEmpty ()
  {
    pixman_region32_clear(&mImpl);
  }

  
  

  

  void Inflate(const nsMargin& aMargin);

  

  bool IsEmpty () const { return !pixman_region32_not_empty(Impl()); }
  
  bool IsEqual (const nsRegion& aRegion) const
  {
    return pixman_region32_equal(Impl(), aRegion.Impl());
  }
  uint32_t GetNumRects () const
  {
    // Work around pixman bug. Sometimes pixman creates regions with 1 rect
    // that's empty.
    uint32_t result = pixman_region32_n_rects(Impl());
    return (result == 1 && GetBounds().IsEmpty()) ? 0 : result;
  }
  const nsRect GetBounds () const { return BoxToRect(mImpl.extents); }
  ;
  // Converts this region from aFromAPP, an appunits per pixel ratio, to
  // aToAPP. This applies nsRect::ConvertAppUnitsRoundOut/In to each rect of
  // the region.
  ;
  ;
  ;
  ;
  nsRegion& Transform (const gfx3DMatrix &aTransform);
  ;
  ;
  ;
  ;
  ;

  /**
   * Gets the largest rectangle contained in the region.
   * @param aContainingRect if non-empty, we choose a rectangle that
   * maximizes the area intersecting with aContainingRect (and break ties by
   * then choosing the largest rectangle overall)
   */
  ;

  /**
   * Make sure the region has at most aMaxRects by adding area to it
   * if necessary. The simplified region will be a superset of the
   * original region. The simplified region's bounding box will be
   * the same as for the current region.
   */
  ;
  /**
   * Simplify the region by adding at most aThreshold area between spans of
   * rects.  The simplified region will be a superset of the original region.
   * The simplified region's bounding box will be the same as for the current
   * region.
   */
  ;
  /**
   * Make sure the region has at most aMaxRects by removing area from
   */
  typedef void (*visitFn)(void *closure, VisitSide side, int x1, int y1, int x2, int y2);
  ;

  nsCString ToString() const;
private:
  pixman_region32_t mImpl;

#ifndef MOZ_TREE_PIXMAN
  // For compatibility with pixman versions older than 0.25.2.
  static inline void
  pixman_region32_clear(pixman_region32_t *region)
  {
    pixman_region32_fini(region);
    pixman_region32_init(region);
  }
#endif
# 359 "../../dist/include/nsRegion.h"

  ;

  nsRegion& Copy (const nsRegion& aRegion)
  {
    pixman_region32_copy(&mImpl, aRegion.Impl());
    return *this;
  }

  nsRegion& Copy (const nsRect& aRect)
  {
    // pixman needs to distinguish between an empty region and a region
    // with one rect so that it can return a different number of rectangles.
    // Empty rect: data = empty_box
    //     1 rect: data = null
    //    >1 rect: data = rects
    if (aRect.IsEmpty()) {
      pixman_region32_clear(&mImpl);
    } else {
      pixman_box32_t box = RectToBox(aRect);
      pixman_region32_reset(&mImpl, &box);
    }
    return *this;
  }

  static inline pixman_box32_t RectToBox(const nsRect &aRect)
  {
    pixman_box32_t box = { aRect.x, aRect.y, aRect.XMost(), aRect.YMost() };
    return box;
  }

  


  static inline nsRect BoxToRect(const pixman_box32_t &aBox)
  {
    return nsRect(aBox.x1, aBox.y1,
                  aBox.x2 - aBox.x1,
                  aBox.y2 - aBox.y1);
  }

  pixman_region32_t* Impl() const
  {
    return const_cast<pixman_region32_t*>(&mImpl);
  }

};


class NS_GFX nsRegionRectIterator
{
  const nsRegion*  mRegion;
  int i;
  int n;
  nsRect rect;
  pixman_box32_t *boxes;

public:
  explicit nsRegionRectIterator (const nsRegion& aRegion)
  {
    mRegion = &aRegion;
    i = 0;
    boxes = pixman_region32_rectangles(aRegion.Impl(), &n);
    // Work around pixman bug. Sometimes pixman creates regions with 1 rect
    // that's empty.
    if (n == 1 && nsRegion::BoxToRect(boxes[0]).IsEmpty()) {
      n = 0;
    }
  }

  const nsRect* Next ()
  {
    if (i == n)
      return nullptr;
    rect = nsRegion::BoxToRect(boxes[i]);
    NS_ASSERTION(!rect.IsEmpty(), "Shouldn't return empty rect");
    i++;
    return &rect;
  }

  const nsRect* Prev ()
  {
    if (i == -1)
      return nullptr;
    rect = nsRegion::BoxToRect(boxes[i]);
    NS_ASSERTION(!rect.IsEmpty(), "Shouldn't return empty rect");
    i--;
    return &rect;
  }

  void Reset ()
  {
    i = 0;
  }
};

/**
 * nsIntRegions use int32_t coordinates and nsIntRects.
 */
class NS_GFX nsIntRegion
{
  friend class nsIntRegionRectIterator;
  friend class nsRegion;

public:
  nsIntRegion () {}
  MOZ_IMPLICIT nsIntRegion (const nsIntRect& aRect) : mImpl (ToRect(aRect)) {}
  nsIntRegion (const nsIntRegion& aRegion) : mImpl (aRegion.mImpl) {}
  nsIntRegion (nsIntRegion&& aRegion) : mImpl (mozilla::Move(aRegion.mImpl)) {}
  
  nsIntRegion& operator = (const nsIntRegion& aRegion) { mImpl = aRegion.mImpl; return *this; }
  

  bool operator==(const nsIntRegion& aRgn) const
  {
    return IsEqual(aRgn);
  }
  

  

  

  void AndWith(const nsIntRegion& aOther)
  {
    And(*this, aOther);
  }
  
  nsIntRegion& And  (const nsIntRegion& aRgn1,   const nsIntRegion& aRgn2)
  {
    mImpl.And (aRgn1.mImpl, aRgn2.mImpl);
    return *this;
  }
  
  
  

  nsIntRegion& OrWith(const nsIntRegion& aOther)
  {
    return Or(*this, aOther);
  }
  
  nsIntRegion& Or   (const nsIntRegion& aRgn1,   const nsIntRegion& aRgn2)
  {
    mImpl.Or (aRgn1.mImpl, aRgn2.mImpl);
    return *this;
  }
  nsIntRegion& Or   (const nsIntRegion& aRegion, const nsIntRect& aRect)
  {
    mImpl.Or (aRegion.mImpl, ToRect (aRect));
    return *this;
  }
  
  

  
  
  
  
  
  

  
  
  nsIntRegion& Sub  (const nsIntRegion& aRgn1,   const nsIntRegion& aRgn2)
  {
    mImpl.Sub (aRgn1.mImpl, aRgn2.mImpl);
    return *this;
  }
  
  
  

  /**
   * Returns true iff the given point is inside the region. A region
   * created from a rect (x=0, y=0, w=100, h=100) will NOT contain
   * the point x=100, y=100.
   */
  
  
  
  

  
  void MoveBy (nsIntPoint aPt)
  {
    mImpl.MoveBy (aPt.x, aPt.y);
  }
  
  

  

  
  

  void SetEmpty ()
  {
    mImpl.SetEmpty  ();
  }

  bool IsEmpty () const { return mImpl.IsEmpty (); }
  
  bool IsEqual (const nsIntRegion& aRegion) const
  {
    return mImpl.IsEqual (aRegion.mImpl);
  }
  
  nsIntRect GetBounds () const { return FromRect (mImpl.GetBounds ()); }
  
  ;
  

  

  nsIntRegion& Transform (const gfx3DMatrix &aTransform)
  {
    mImpl.Transform(aTransform);
    return *this;
  }

  /**
   * Make sure the region has at most aMaxRects by adding area to it
   * if necessary. The simplified region will be a superset of the
   * original region. The simplified region's bounding box will be
   * the same as for the current region.
   */
  
  
  /**
   * Make sure the region has at most aMaxRects by removing area from
   * it if necessary. The simplified region will be a subset of the
   * original region.
   */
  

  typedef void (*visitFn)(void *closure, VisitSide side, int x1, int y1, int x2, int y2);
  

  nsCString ToString() const { return mImpl.ToString(); }

private:
  nsRegion mImpl;

  static nsRect ToRect(const nsIntRect& aRect)
  {
    return nsRect (aRect.x, aRect.y, aRect.width, aRect.height);
  }
  static nsIntRect FromRect(const nsRect& aRect)
  {
    return nsIntRect (aRect.x, aRect.y, aRect.width, aRect.height);
  }
};

class NS_GFX nsIntRegionRectIterator
{
  nsRegionRectIterator mImpl;
  nsIntRect mTmp;

public:
  explicit nsIntRegionRectIterator (const nsIntRegion& aRegion) : mImpl (aRegion.mImpl) {}

  const nsIntRect* Next ()
  {
    const nsRect* r = mImpl.Next();
    if (!r)
      return nullptr;
    mTmp = nsIntRegion::FromRect (*r);
    return &mTmp;
  }

  const nsIntRect* Prev ()
  {
    const nsRect* r = mImpl.Prev();
    if (!r)
      return nullptr;
    mTmp = nsIntRegion::FromRect (*r);
    return &mTmp;
  }

  void Reset ()
  {
    mImpl.Reset ();
  }
};
#endif

#ifndef mozilla_TypedEnumBits_h
#define mozilla_TypedEnumBits_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/TypedEnumBits.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/IntegerTypeTraits.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/TypedEnumBits.h"

namespace mozilla {

/*
 *
 * But instead, we choose to preserve the original user syntax (1) as it
 * is inherently more readable, and to ease porting existing code to typed
 * enums. We achieve this by having operator& and other binary bitwise
 * operators have as return type a class, CastableTypedEnumResult,
 * that wraps a typed enum but adds bool convertibility.
 */
template<typename E>
class CastableTypedEnumResult
{
private:
  const E mValue;

public:
  explicit MOZ_CONSTEXPR CastableTypedEnumResult(E aValue)
    : mValue(aValue)
  {}

  MOZ_CONSTEXPR operator E() const { return mValue; }

  template<typename DestinationType>
  MOZ_EXPLICIT_CONVERSION MOZ_CONSTEXPR
  operator DestinationType() const { return DestinationType(mValue); }

  MOZ_CONSTEXPR bool operator !() const { return !bool(mValue); }
};

#define MOZ_CASTABLETYPEDENUMRESULT_BINOP(Op, OtherType, ReturnType) \
template<typename E> \
MOZ_CONSTEXPR ReturnType \
operator Op(const OtherType& aE, const CastableTypedEnumResult<E>& aR) \
{ \
  return ReturnType(aE Op OtherType(aR)); \
} \
template<typename E> \
MOZ_CONSTEXPR ReturnType \
operator Op(const CastableTypedEnumResult<E>& aR, const OtherType& aE) \
{ \
  return ReturnType(OtherType(aR) Op aE); \
} \
template<typename E> \
MOZ_CONSTEXPR ReturnType \
operator Op(const CastableTypedEnumResult<E>& aR1, \
            const CastableTypedEnumResult<E>& aR2) \
{ \
  return ReturnType(OtherType(aR1) Op OtherType(aR2)); \
}

MOZ_CASTABLETYPEDENUMRESULT_BINOP(|, E, CastableTypedEnumResult<E>)
MOZ_CASTABLETYPEDENUMRESULT_BINOP(&, E, CastableTypedEnumResult<E>)
MOZ_CASTABLETYPEDENUMRESULT_BINOP(^, E, CastableTypedEnumResult<E>)
MOZ_CASTABLETYPEDENUMRESULT_BINOP(==, E, bool)
MOZ_CASTABLETYPEDENUMRESULT_BINOP(!=, E, bool)
MOZ_CASTABLETYPEDENUMRESULT_BINOP(||, bool, bool)
MOZ_CASTABLETYPEDENUMRESULT_BINOP(&&, bool, bool)

template <typename E>
MOZ_CONSTEXPR CastableTypedEnumResult<E>
operator ~(const CastableTypedEnumResult<E>& aR)
{
  return CastableTypedEnumResult<E>(~(E(aR)));
}

#define MOZ_CASTABLETYPEDENUMRESULT_COMPOUND_ASSIGN_OP(Op) \
template<typename E> \
E& \
operator Op(E& aR1, \
            const CastableTypedEnumResult<E>& aR2) \
{ \
  return aR1 Op E(aR2); \
}

MOZ_CASTABLETYPEDENUMRESULT_COMPOUND_ASSIGN_OP(&=)
MOZ_CASTABLETYPEDENUMRESULT_COMPOUND_ASSIGN_OP(|=)
MOZ_CASTABLETYPEDENUMRESULT_COMPOUND_ASSIGN_OP(^=)

#undef MOZ_CASTABLETYPEDENUMRESULT_COMPOUND_ASSIGN_OP

#undef MOZ_CASTABLETYPEDENUMRESULT_BINOP

namespace detail {
template<typename E>
struct UnsignedIntegerTypeForEnum
  : UnsignedStdintTypeForSize<sizeof(E)>
{};
}

} // namespace mozilla

#define MOZ_MAKE_ENUM_CLASS_BINOP_IMPL(Name, Op) \
   inline MOZ_CONSTEXPR mozilla::CastableTypedEnumResult<Name> \
   operator Op(Name a, Name b) \
   { \
     typedef mozilla::CastableTypedEnumResult<Name> Result; \
     typedef mozilla::detail::UnsignedIntegerTypeForEnum<Name>::Type U; \
     return Result(Name(U(a) Op U(b))); \
   } \
 \
   inline Name& \
   operator Op##=(Name& a, Name b) \
   { \
     return a = a Op b; \
   }

/**
 * MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS generates standard bitwise operators
 * for the given enum type. Use this to enable using an enum type as bit-field.
 */
#define MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(Name) \
   MOZ_MAKE_ENUM_CLASS_BINOP_IMPL(Name, |) \
   MOZ_MAKE_ENUM_CLASS_BINOP_IMPL(Name, &) \
   MOZ_MAKE_ENUM_CLASS_BINOP_IMPL(Name, ^) \
   inline MOZ_CONSTEXPR mozilla::CastableTypedEnumResult<Name> \
   operator~(Name a) \
   { \
     typedef mozilla::CastableTypedEnumResult<Name> Result; \
     typedef mozilla::detail::UnsignedIntegerTypeForEnum<Name>::Type U; \
     return Result(Name(~(U(a)))); \
   }

#endif // mozilla_TypedEnumBits_h
# 157 "../../dist/include/mozilla/TypedEnumBits.h"
# 14 "../../dist/include/mozilla/layers/LayersTypes.h" 2

#ifdef MOZ_WIDGET_GONK
#if 0 /* expanded by -frewrite-includes */
#include <ui/GraphicBuffer.h>
#endif /* expanded by -frewrite-includes */
#  define MOZ_LAYERS_LOG(_args)                             \
  PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args)
#  define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args)         \
  do { if (layer->AsShadowableLayer()) { PR_LOG(LayerManager::GetLog(), PR_LOG_DEBUG, _args); } } while (0)
#else
# 29 "../../dist/include/mozilla/layers/LayersTypes.h"
struct PRLogModuleInfo;
#  define MOZ_LAYERS_LOG(_args)
#  define MOZ_LAYERS_LOG_IF_SHADOWABLE(layer, _args)
#endif  // if defined(DEBUG) || defined(PR_LOGGING)
# 33 "../../dist/include/mozilla/layers/LayersTypes.h"

#define INVALID_OVERLAY -1

namespace android {
class GraphicBuffer;
}

namespace mozilla {
namespace layers {

class TextureHost;

#undef NONE
#undef OPAQUE

enum class LayersBackend : int8_t {
  LAYERS_NONE = 0,
  LAYERS_BASIC,
  LAYERS_OPENGL,
  LAYERS_D3D9,
  LAYERS_D3D10,
  LAYERS_D3D11,
  LAYERS_CLIENT,
  LAYERS_LAST
};

enum class BufferMode : int8_t {
  BUFFER_NONE,
  BUFFERED
};

enum class DrawRegionClip : int8_t {
  DRAW,
  NONE
};

enum class SurfaceMode : int8_t {
  SURFACE_NONE = 0,
  SURFACE_OPAQUE,
  SURFACE_SINGLE_CHANNEL_ALPHA,
  SURFACE_COMPONENT_ALPHA
};

// LayerRenderState for Composer2D
// We currently only support Composer2D using gralloc. If we want to be backed
// by other surfaces we will need a more generic LayerRenderState.
enum class LayerRenderStateFlags : int8_t {
  LAYER_RENDER_STATE_DEFAULT = 0,
  ORIGIN_BOTTOM_LEFT = 1 << 0,
  BUFFER_ROTATION = 1 << 1,
  // Notify Composer2D to swap the RB pixels of gralloc buffer
  FORMAT_RB_SWAP = 1 << 2,
  // We record opaqueness here alongside the actual surface we're going to
  // render. This avoids confusion when a layer might return different kinds
  // of surfaces over time (e.g. video frames).
  OPAQUE = 1 << 3
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(LayerRenderStateFlags)

// The 'ifdef MOZ_WIDGET_GONK' sadness here is because we don't want to include
// android::sp unless we have to.
struct LayerRenderState {
  LayerRenderState()
#ifdef MOZ_WIDGET_GONK
    : mFlags(LayerRenderStateFlags::LAYER_RENDER_STATE_DEFAULT)
    , mHasOwnOffset(false)
    , mSurface(nullptr)
    , mOverlayId(INVALID_OVERLAY)
    , mTexture(nullptr)
#endif
# 103 "../../dist/include/mozilla/layers/LayersTypes.h"
  {}

#ifdef MOZ_WIDGET_GONK
  LayerRenderState(android::GraphicBuffer* aSurface,
                   const nsIntSize& aSize,
                   LayerRenderStateFlags aFlags,
                   TextureHost* aTexture)
    : mFlags(aFlags)
    , mHasOwnOffset(false)
    , mSurface(aSurface)
    , mOverlayId(INVALID_OVERLAY)
    , mSize(aSize)
    , mTexture(aTexture)
  {}

  bool OriginBottomLeft() const
  { return bool(mFlags & LayerRenderStateFlags::ORIGIN_BOTTOM_LEFT); }

  bool BufferRotated() const
  { return bool(mFlags & LayerRenderStateFlags::BUFFER_ROTATION); }

  bool FormatRBSwapped() const
  { return bool(mFlags & LayerRenderStateFlags::FORMAT_RB_SWAP); }

  void SetOverlayId(const int32_t& aId)
  { mOverlayId = aId; }
#endif
# 130 "../../dist/include/mozilla/layers/LayersTypes.h"

  void SetOffset(const nsIntPoint& aOffset)
  {
    mOffset = aOffset;
    mHasOwnOffset = true;
  }

  // see LayerRenderStateFlags
  LayerRenderStateFlags mFlags;
  // true if mOffset is applicable
  bool mHasOwnOffset;
  // the location of the layer's origin on mSurface
  nsIntPoint mOffset;
#ifdef MOZ_WIDGET_GONK
  // surface to render
  android::sp<android::GraphicBuffer> mSurface;
  int32_t mOverlayId;
  // size of mSurface
  nsIntSize mSize;
  TextureHost* mTexture;
#endif
# 151 "../../dist/include/mozilla/layers/LayersTypes.h"
};

enum class ScaleMode : int8_t {
  SCALE_NONE,
  STRETCH,
  SENTINEL
// Unimplemented - PRESERVE_ASPECT_RATIO_CONTAIN
};

struct EventRegions {
  nsIntRegion mHitRegion;
  nsIntRegion mDispatchToContentHitRegion;

  EventRegions()
  {
  }

  explicit EventRegions(nsIntRegion aHitRegion)
    : mHitRegion(aHitRegion)
  {
  }

  bool operator==(const EventRegions& aRegions) const
  {
    return mHitRegion == aRegions.mHitRegion &&
           mDispatchToContentHitRegion == aRegions.mDispatchToContentHitRegion;
  }
  bool operator!=(const EventRegions& aRegions) const
  {
    return !(*this == aRegions);
  }

  void OrWith(const EventRegions& aOther)
  {
    mHitRegion.OrWith(aOther.mHitRegion);
    mDispatchToContentHitRegion.OrWith(aOther.mDispatchToContentHitRegion);
  }

  void AndWith(const nsIntRegion& aRegion)
  {
    mHitRegion.AndWith(aRegion);
    mDispatchToContentHitRegion.AndWith(aRegion);
  }

  void Sub(const EventRegions& aMinuend, const nsIntRegion& aSubtrahend)
  {
    mHitRegion.Sub(aMinuend.mHitRegion, aSubtrahend);
    mDispatchToContentHitRegion.Sub(aMinuend.mDispatchToContentHitRegion, aSubtrahend);
  }

  void Transform(const gfx3DMatrix& aTransform)
  {
    mHitRegion.Transform(aTransform);
    mDispatchToContentHitRegion.Transform(aTransform);
  }

  bool IsEmpty() const
  {
    return mHitRegion.IsEmpty()
        && mDispatchToContentHitRegion.IsEmpty();
  }

  nsCString ToString() const
  {
    nsCString result = mHitRegion.ToString();
    result.AppendLiteral(";dispatchToContent=");
    result.Append(mDispatchToContentHitRegion.ToString());
    return result;
  }
};

// Bit flags that go on a ContainerLayer (or RefLayer) and override the
// event regions in the entire subtree below. This is needed for propagating
// various flags across processes since the child-process layout code doesn't
// know about parent-process listeners or CSS rules.
enum EventRegionsOverride {
  // The default, no flags set
  NoOverride             = 0,
  // Treat all hit regions in the subtree as dispatch-to-content
  ForceDispatchToContent = (1 << 0),
  // Treat all hit regions in the subtree as empty
  ForceEmptyHitRegion    = (1 << 1),
  // OR union of all valid bit flags, for use in BitFlagsEnumSerializer
  ALL_BITS               = (1 << 2) - 1
};

MOZ_ALWAYS_INLINE EventRegionsOverride
operator|(EventRegionsOverride a, EventRegionsOverride b)
{
  return (EventRegionsOverride)((int)a | (int)b);
}

MOZ_ALWAYS_INLINE EventRegionsOverride&
operator|=(EventRegionsOverride& a, EventRegionsOverride b)
{
  a = a | b;
  return a;
}

} // namespace
} // namespace

#endif /* GFX_LAYERSTYPES_H */
# 254 "../../dist/include/mozilla/layers/LayersTypes.h"
# 23 "../../dist/include/nsIWidget.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
class   nsIContent;
class   ViewWrapper;
class   nsIWidgetListener;
class   nsIntRegion;
class   nsIScreen;

namespace mozilla {
class CompositorVsyncDispatcher;
namespace dom {
class TabChild;
}
namespace plugins {
class PluginWidgetChild;
}
namespace layers {
class Composer2D;
class CompositorChild;
class LayerManager;
class LayerManagerComposite;
class PLayerTransactionChild;
}
namespace gfx {
class DrawTarget;
}
namespace widget {
class TextEventDispatcher;
}
}

/**
 * Callback function that processes events.
 *
 */
#define NS_NATIVE_WINDOW      0
#define NS_NATIVE_GRAPHIC     1
#define NS_NATIVE_TMP_WINDOW  2
#define NS_NATIVE_WIDGET      3
#define NS_NATIVE_DISPLAY     4
#define NS_NATIVE_REGION      5
#define NS_NATIVE_OFFSETX     6
#define NS_NATIVE_OFFSETY     7
#define NS_NATIVE_PLUGIN_PORT 8
#define NS_NATIVE_SCREEN      9
// The toplevel GtkWidget containing this nsIWidget:
#define NS_NATIVE_SHELLWIDGET 10
// Has to match to NPNVnetscapeWindow, and shareable across processes
// HWND on Windows and XID on X11
#define NS_NATIVE_SHAREABLE_WINDOW 11
#define NS_NATIVE_OPENGL_CONTEXT   12
#ifdef XP_MACOSX
#define NS_NATIVE_PLUGIN_PORT_QD    100
#define NS_NATIVE_PLUGIN_PORT_CG    101
#endif
# 102 "../../dist/include/nsIWidget.h"
#ifdef XP_WIN
#define NS_NATIVE_TSF_THREAD_MGR       100
#define NS_NATIVE_TSF_CATEGORY_MGR     101
#define NS_NATIVE_TSF_DISPLAY_ATTR_MGR 102
#define NS_NATIVE_ICOREWINDOW          103 // winrt specific
#endif
# 108 "../../dist/include/nsIWidget.h"
#if defined(MOZ_WIDGET_GTK)
// set/get nsPluginNativeWindowGtk, e10s specific
#define NS_NATIVE_PLUGIN_OBJECT_PTR    104
#endif
# 112 "../../dist/include/nsIWidget.h"
// See RegisterPluginWindowForRemoteUpdates
#define NS_NATIVE_PLUGIN_ID            105

#define NS_IWIDGET_IID \
{ 0x316E4600, 0x15DB, 0x47AE, \
  { 0xBF, 0xE4, 0x5B, 0xCD, 0xFF, 0x80, 0x80, 0x83 } };

/*
 * Window shadow styles
 * Also used for the -moz-window-shadow CSS property
 */

#define NS_STYLE_WINDOW_SHADOW_NONE             0
#define NS_STYLE_WINDOW_SHADOW_DEFAULT          1
#define NS_STYLE_WINDOW_SHADOW_MENU             2
#define NS_STYLE_WINDOW_SHADOW_TOOLTIP          3
#define NS_STYLE_WINDOW_SHADOW_SHEET            4

/**
 * Transparency modes
    // Changes are notified in following conditions if the instance is
    // just constructed.  If some platforms don't need change notifications
    // in some of following conditions, the platform should remove following
    // flags before returing the instance from nsIWidget::GetUpdatePreference().
    DEFAULT_CONDITIONS_OF_NOTIFYING_CHANGES =
      NOTIFY_CHANGES_CAUSED_BY_COMPOSITION
  };

  nsIMEUpdatePreference()
    : mWantUpdates(DEFAULT_CONDITIONS_OF_NOTIFYING_CHANGES)
 * Contains IMEStatus plus information about the current 
 * input context that the IME can use as hints if desired.
 */

namespace mozilla {
namespace widget {

struct IMEState {
  /**
   * IME enabled states, the mEnabled value of
   * SetInputContext()/GetInputContext() should be one value of following
   * values.
   *
   * WARNING: If you change these values, you also need to edit:
   *   nsIDOMWindowUtils.idl
   *   nsContentUtils::GetWidgetStatusFromIMEStatus
   */
  enum Enabled {
    /**
     * 'Disabled' means the user cannot use IME. So, the IME open state should
     * be 'closed' during 'disabled'.
     */
    DISABLED,
    /**
     * 'Enabled' means the user can use IME.
     */
    ENABLED,
    /**
     * 'Password' state is a special case for the password editors.
     * E.g., on mac, the password editors should disable the non-Roman
     * keyboard layouts at getting focus. Thus, the password editor may have
     * special rules on some platforms.
     */
    PASSWORD,
    /**
     * This state is used when a plugin is focused.
     * When a plug-in is focused content, we should send native events
     * directly. Because we don't process some native events, but they may
     * be needed by the plug-in.
     */
    PLUGIN
  };
  Enabled mEnabled;

  /**
   * IME open states the mOpen value of SetInputContext() should be one value of
   * OPEN, CLOSE or DONT_CHANGE_OPEN_STATE.  GetInputContext() should return
   * OPEN, CLOSE or OPEN_STATE_NOT_SUPPORTED.
   */
  enum Open {
    /**
     * 'Unsupported' means the platform cannot return actual IME open state.
     * This value is used only by GetInputContext().
     */
    OPEN_STATE_NOT_SUPPORTED,
    /**
     * 'Don't change' means the widget shouldn't change IME open state when
     * SetInputContext() is called.
     */
    DONT_CHANGE_OPEN_STATE = OPEN_STATE_NOT_SUPPORTED,
    /**
     * 'Open' means that IME should compose in its primary language (or latest
     * input mode except direct ASCII character input mode).  Even if IME is
     * opened by this value, users should be able to close IME by theirselves.
     * Web contents can specify this value by |ime-mode: active;|.
     */
    OPEN,
    /**
     * 'Closed' means that IME shouldn't handle key events (or should handle
     * as ASCII character inputs on mobile device).  Even if IME is closed by
     * this value, users should be able to open IME by theirselves.
     * Web contents can specify this value by |ime-mode: inactive;|.
     */
    CLOSED
  };
  Open mOpen;

  

  

  // Returns true if the user can input characters.
  // This means that a plain text editor, an HTML editor, a password editor or
  // a plain text editor whose ime-mode is "disabled".
  
  // Returns true if the user might be able to input characters.
  // This means that a plain text editor, an HTML editor, a password editor,
  // a plain text editor whose ime-mode is "disabled" or a windowless plugin
  // has focus.
  
};

struct InputContext {
  

  
  

  
};

struct InputContextAction {
  /**
   * mCause indicates what action causes calling nsIWidget::SetInputContext().
   * It must be one of following values.
   */
  enum Cause {
    // The cause is unknown but originated from content. Focus might have been
    // changed by content script.
    CAUSE_UNKNOWN,
    // The cause is unknown but originated from chrome. Focus might have been
    // changed by chrome script.
    CAUSE_UNKNOWN_CHROME,
    // The cause is user's keyboard operation.
    CAUSE_KEY,
    // The cause is user's mouse operation.
    CAUSE_MOUSE
  };
  Cause mCause;

  /**
   * mFocusChange indicates what happened for focus.
   */
  enum FocusChange {
    FOCUS_NOT_CHANGED,
    // A content got focus.
    GOT_FOCUS,
    // Focused content lost focus.
    LOST_FOCUS,
    // Menu got pseudo focus that means focused content isn't changed but
    // keyboard events will be handled by menu.
    MENU_GOT_PSEUDO_FOCUS,
    // Menu lost pseudo focus that means focused content will handle keyboard
    // events.
    MENU_LOST_PSEUDO_FOCUS
  };
  FocusChange mFocusChange;

  

  

  

  
};

/**
 * Size constraints for setting the minimum and maximum size of a widget.
 * Values are in device pixels.
 */
struct SizeConstraints {
  

  

  nsIntSize mMinSize;
  nsIntSize mMaxSize;
};

// IMEMessage is shared by IMEStateManager and TextComposition.
// Update values in GeckoEditable.java if you make changes here.
// XXX Negative values are used in Android...
typedef int8_t IMEMessageType;
enum IMEMessage : IMEMessageType
{
  // An editable content is getting focus
  NOTIFY_IME_OF_FOCUS = 1,
  // An editable content is losing focus
  NOTIFY_IME_OF_BLUR,
  // Selection in the focused editable content is changed
  NOTIFY_IME_OF_SELECTION_CHANGE,
  // Text in the focused editable content is changed
  NOTIFY_IME_OF_TEXT_CHANGE,
  // Composition string has been updated
  NOTIFY_IME_OF_COMPOSITION_UPDATE,
  // Position or size of focused element may be changed.
  NOTIFY_IME_OF_POSITION_CHANGE,
  // Mouse button event is fired on a character in focused editor
  NOTIFY_IME_OF_MOUSE_BUTTON_EVENT,
  // Request to commit current composition to IME
  // (some platforms may not support)
  REQUEST_TO_COMMIT_COMPOSITION,
  // Request to cancel current composition to IME
  // (some platforms may not support)
  REQUEST_TO_CANCEL_COMPOSITION
};

struct IMENotification
{
  

  MOZ_IMPLICIT 

  IMEMessage mMessage;

  union
  {
    // NOTIFY_IME_OF_SELECTION_CHANGE specific data
    struct
    {
      bool mCausedByComposition;
    } mSelectionChangeData;

    // NOTIFY_IME_OF_TEXT_CHANGE specific data
    struct
    {
      uint32_t mStartOffset;
      // Character offset from the start of the focused editor under the cursor
      uint32_t mOffset;
      // Cursor position in pixels relative to the widget
      struct
      {
        int32_t mX;
        int32_t mY;

        
        
      } mCursorPos;
      // Character rect in pixels under the cursor relative to the widget
      struct
      {
        int32_t mX;
        int32_t mY;
        int32_t mWidth;
        int32_t mHeight;

        
        
      } mCharRect;
      // The value of WidgetMouseEventBase::button and buttons
      int16_t mButton;
      int16_t mButtons;
      // The value of WidgetInputEvent::modifiers
      Modifiers mModifiers;
    } mMouseButtonEventData;
  };

  
};

} // namespace widget
} // namespace mozilla

/**
 * The base class for all the widgets. It provides the interface for
 * all basic and necessary functionality.
 */
class nsIWidget : public nsISupports {
  protected:
    typedef mozilla::dom::TabChild TabChild;

  public:
    typedef mozilla::layers::Composer2D Composer2D;
    typedef mozilla::layers::CompositorChild CompositorChild;
    typedef mozilla::layers::LayerManager LayerManager;
    typedef mozilla::layers::LayerManagerComposite LayerManagerComposite;
    typedef mozilla::layers::LayersBackend LayersBackend;
    typedef mozilla::layers::PLayerTransactionChild PLayerTransactionChild;
    typedef mozilla::widget::IMEMessage IMEMessage;
    typedef mozilla::widget::IMENotification IMENotification;
    typedef mozilla::widget::IMEState IMEState;
    typedef mozilla::widget::InputContext InputContext;
    typedef mozilla::widget::InputContextAction InputContextAction;
    typedef mozilla::widget::SizeConstraints SizeConstraints;
    typedef mozilla::widget::TextEventDispatcher TextEventDispatcher;
    typedef mozilla::CompositorVsyncDispatcher CompositorVsyncDispatcher;

    // Used in UpdateThemeGeometries.
    struct ThemeGeometry {
      // The ThemeGeometryType value for the themed widget, see
      // nsITheme::ThemeGeometryTypeForWidget.
      nsITheme::ThemeGeometryType mType;
      // The device-pixel rect within the window for the themed widget
      nsIntRect mRect;

      
    };

    NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWIDGET_IID)

    

        
    /**
     * Create and initialize a widget. 
     *
     * All the arguments can be null in which case a top level window
    

    /**
     * Get the natural bounds of this widget.  This method is only
     * meaningful for widgets for which Gecko implements screen
     * rotation natively.  When this is the case, GetBounds() returns
    NS_IMETHOD_(TextEventDispatcher*) GetTextEventDispatcher() = 0;

protected:
    /**
     * Like GetDefaultScale, but taking into account only the system settings
     * and ignoring Gecko preferences.
     */
    virtual double GetDefaultScaleInternal() { return 1.0; }

    // keep the list of children.  We also keep track of our siblings.
    // The ownership model is as follows: parent holds a strong ref to
    // the first element of the list, and each element holds a strong
    // ref to the next element in the list.  The prevsibling and
    // lastchild pointers are weak, which is fine as long as they are
    // maintained properly.
    nsCOMPtr<nsIWidget> mFirstChild;
    nsIWidget* MOZ_NON_OWNING_REF mLastChild;
    nsCOMPtr<nsIWidget> mNextSibling;
    nsIWidget* MOZ_NON_OWNING_REF mPrevSibling;
    // When Destroy() is called, the sub class should set this true.
    bool mOnDestroyCalled;
    nsWindowType mWindowType;
    int32_t mZIndex;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIWidget, NS_IWIDGET_IID)

#endif // nsIWidget_h__
# 2298 "../../dist/include/nsIWidget.h"
# 18 "../../dist/include/mozilla/BasicEvents.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/BasicEvents.h"
#if 0 /* expanded by -frewrite-includes */
#include "Units.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/BasicEvents.h"

/******************************************************************************
 * Messages
 *
 * TODO: Make them enum.
 ******************************************************************************/

#define NS_EVENT_NULL                   0

// This is a dummy event message for all event listener implementation in
// EventListenerManager.
#define NS_EVENT_ALL                    1
#define NS_FULLSCREENCHANGE          (NS_FULL_SCREEN_START)
#define NS_FULLSCREENERROR           (NS_FULL_SCREEN_START + 1)

#define NS_TOUCH_EVENT_START         5200
#define NS_TOUCH_START               (NS_TOUCH_EVENT_START)
#define NS_TOUCH_MOVE                (NS_TOUCH_EVENT_START+1)
#define NS_TOUCH_END                 (NS_TOUCH_EVENT_START+2)
#define NS_TOUCH_CANCEL              (NS_TOUCH_EVENT_START+3)
#define NS_NETWORK_UPLOAD_EVENT      (NS_NETWORK_EVENT_START + 1)
#define NS_NETWORK_DOWNLOAD_EVENT    (NS_NETWORK_EVENT_START + 2)

// MediaRecorder events.
#define NS_MEDIARECORDER_EVENT_START 5700
#define NS_MEDIARECORDER_DATAAVAILABLE  (NS_MEDIARECORDER_EVENT_START + 1)
#define NS_MEDIARECORDER_WARNING        (NS_MEDIARECORDER_EVENT_START + 2)
#define NS_MEDIARECORDER_STOP           (NS_MEDIARECORDER_EVENT_START + 3)

// SpeakerManager events
#define NS_SPEAKERMANAGER_EVENT_START 5800
#define NS_SPEAKERMANAGER_SPEAKERFORCEDCHANGE (NS_SPEAKERMANAGER_EVENT_START + 1)

#ifdef MOZ_GAMEPAD
// Gamepad input events
#define NS_GAMEPAD_START         6000
#define NS_GAMEPAD_BUTTONDOWN    (NS_GAMEPAD_START)
#define NS_GAMEPAD_BUTTONUP      (NS_GAMEPAD_START+1)
#define NS_GAMEPAD_AXISMOVE      (NS_GAMEPAD_START+2)
#define NS_GAMEPAD_CONNECTED     (NS_GAMEPAD_START+3)
#define NS_GAMEPAD_DISCONNECTED  (NS_GAMEPAD_START+4)
// Keep this defined to the same value as the event above
#define NS_GAMEPAD_END           (NS_GAMEPAD_START+4)
#endif
# 443 "../../dist/include/mozilla/BasicEvents.h"

// input and beforeinput events.
#define NS_EDITOR_EVENT_START    6100
#define NS_EDITOR_INPUT          (NS_EDITOR_EVENT_START)

namespace IPC {
template<typename T>
struct ParamTraits;
}

namespace mozilla {

/******************************************************************************
 * mozilla::BaseEventFlags
 *
 * BaseEventFlags must be a POD struct for safe to use memcpy (including
 * in ParamTraits<BaseEventFlags>).  So don't make virtual methods, constructor,
 * destructor and operators.
 * This is necessary for VC which is NOT C++0x compiler.
 ******************************************************************************/

struct BaseEventFlags
{
public:
  // If mIsTrusted is true, the event is a trusted event.  Otherwise, it's
  // an untrusted event.
  bool    mIsTrusted : 1;
  // If mInBubblingPhase is true, the event is in bubbling phase or target
  // phase.
  bool    mInBubblingPhase : 1;
  // If mInCapturePhase is true, the event is in capture phase or target phase.
  bool    mInCapturePhase : 1;
  // If mInSystemGroup is true, the event is being dispatched in system group.
  bool    mInSystemGroup: 1;
  // If mCancelable is true, the event can be consumed.  I.e., calling
  // dom::Event::PreventDefault() can prevent the default action.
  bool    mCancelable : 1;
  // If mBubbles is true, the event can bubble.  Otherwise, cannot be handled
  // in bubbling phase.
  bool    mBubbles : 1;
  // If mPropagationStopped is true, dom::Event::StopPropagation() or
  // dom::Event::StopImmediatePropagation() has been called.
  bool    mPropagationStopped : 1;
  // If mImmediatePropagationStopped is true,
  // dom::Event::StopImmediatePropagation() has been called.
  // Note that mPropagationStopped must be true when this is true.
  bool    mImmediatePropagationStopped : 1;
  // If mDefaultPrevented is true, the event has been consumed.
  // E.g., dom::Event::PreventDefault() has been called or
  // the default action has been performed.
  bool    mDefaultPrevented : 1;
  // If mDefaultPreventedByContent is true, the event has been
  // consumed by content.
  // Note that mDefaultPrevented must be true when this is true.
  bool    mDefaultPreventedByContent : 1;
  // If mDefaultPreventedByChrome is true, the event has been
  // window and document object sets it true.  Therefore, web applications
  // can handle the event if they add event listeners to the window or the
  // document.
  bool    mNoContentDispatch : 1;
  // If mOnlyChromeDispatch is true, the event is dispatched to only chrome.
  bool    mOnlyChromeDispatch : 1;
  // If mWantReplyFromContentProcess is true, the event will be redispatched
  // in the parent process after the content process has handled it. Useful
  // for when the parent process need the know first how the event was used
  // by content before handling it itself.
  bool mWantReplyFromContentProcess : 1;

  // If the event is being handled in target phase, returns true.
  inline bool InTargetPhase() const
  {
    return (mInBubblingPhase && mInCapturePhase);
  }

  inline void Clear()
  {
    SetRawFlags(0);
  }
  // Get if either the instance's bit or the aOther's bit is true, the
  // instance's bit becomes true.  In other words, this works like:
  // eventFlags |= aOther;
  inline void Union(const BaseEventFlags& aOther)
  {
    RawFlags rawFlags = GetRawFlags() | aOther.GetRawFlags();
    SetRawFlags(rawFlags);
  }

private:
  typedef uint32_t RawFlags;

  inline void SetRawFlags(RawFlags aRawFlags)
  {
    static_assert(sizeof(BaseEventFlags) <= sizeof(RawFlags),
      "mozilla::EventFlags must not be bigger than the RawFlags");
    memcpy(this, &aRawFlags, sizeof(BaseEventFlags));
  }
  inline RawFlags GetRawFlags() const
  {
    RawFlags result = 0;
    memcpy(&result, this, sizeof(BaseEventFlags));
    return result;
  }
};

class WidgetEvent
{
protected:
  WidgetEvent(bool aIsTrusted, uint32_t aMessage, EventClassID aEventClassID)
    : mClass(aEventClassID)
    , message(aMessage)
    , refPoint(0, 0)
    , lastRefPoint(0, 0)
    , time(0)
    , timeStamp(TimeStamp::Now())
    , userType(nullptr)
  {
    MOZ_COUNT_CTOR(WidgetEvent);
    mFlags.Clear();
    mFlags.mIsTrusted = aIsTrusted;
    mFlags.mCancelable = true;
    mFlags.mBubbles = true;
  }

  WidgetEvent()
  {
    MOZ_COUNT_CTOR(WidgetEvent);
  }

public:
  WidgetEvent(bool aIsTrusted, uint32_t aMessage)
    : mClass(eBasicEventClass)
    , message(aMessage)
    , refPoint(0, 0)
    , lastRefPoint(0, 0)
    , time(0)
    , timeStamp(TimeStamp::Now())
    , userType(nullptr)
  {
    MOZ_COUNT_CTOR(WidgetEvent);
    mFlags.Clear();
    mFlags.mIsTrusted = aIsTrusted;
    mFlags.mCancelable = true;
    mFlags.mBubbles = true;
  }

  virtual ~WidgetEvent()
  {
    MOZ_COUNT_DTOR(WidgetEvent);
  }

  WidgetEvent(const WidgetEvent& aOther)
  {
    MOZ_COUNT_CTOR(WidgetEvent);
    *this = aOther;
  }

  virtual WidgetEvent* Duplicate() const
  {
    MOZ_ASSERT(mClass == eBasicEventClass,
               "Duplicate() must be overridden by sub class");
    WidgetEvent* result = new WidgetEvent(false, message);
    result->AssignEventData(*this, true);
    result->mFlags = mFlags;
    return result;
  }

  EventClassID mClass;
  // See GUI MESSAGES,
  uint32_t message;
  // Relative to the widget of the event, or if there is no widget then it is
  // in screen coordinates. Not modified by layout code.
  LayoutDeviceIntPoint refPoint;
  // The previous refPoint, if known, used to calculate mouse movement deltas.
  LayoutDeviceIntPoint lastRefPoint;
  // Elapsed time, in milliseconds, from a platform-specific zero time
  // to the time the message was created
  uint64_t time;
  // Timestamp when the message was created. Set in parallel to 'time' until we
  // determine if it is safe to drop 'time' (see bug 77992).
  mozilla::TimeStamp timeStamp;
  // See BaseEventFlags definition for the detail.
  BaseEventFlags mFlags;

  // Additional type info for user defined events
  nsCOMPtr<nsIAtom> userType;

  nsString typeString; // always set on non-main-thread events

  // Event targets, needed by DOM Events
  nsCOMPtr<dom::EventTarget> target;
  nsCOMPtr<dom::EventTarget> currentTarget;
  nsCOMPtr<dom::EventTarget> originalTarget;

  void AssignEventData(const WidgetEvent& aEvent, bool aCopyTargets)
  {
    // mClass should be initialized with the constructor.
    // message should be initialized with the constructor.
    refPoint = aEvent.refPoint;
    // lastRefPoint doesn't need to be copied.
    time = aEvent.time;
    timeStamp = aEvent.timeStamp;
    // mFlags should be copied manually if it's necessary.
    userType = aEvent.userType;
    // typeString should be copied manually if it's necessary.
    target = aCopyTargets ? aEvent.target : nullptr;
    currentTarget = aCopyTargets ? aEvent.currentTarget : nullptr;
    originalTarget = aCopyTargets ? aEvent.originalTarget : nullptr;
  }

  /**
   * Utils for checking event types
   */

  /**
   * As*Event() returns the pointer of the instance only when the instance is
   * the class or one of its derived class.
   */
#define NS_ROOT_EVENT_CLASS(aPrefix, aName)
#define NS_EVENT_CLASS(aPrefix, aName) \
  virtual aPrefix##aName* As##aName(); \
  const aPrefix##aName* As##aName() const;

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventClassList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EventClassList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * This header file lists up all event classes and related structs.
 * Define NS_EVENT_CLASS(aPrefix, aName) and NS_ROOT_EVENT_CLASS(aPrefix, aName)
 * before including this.
 * If an event name is WidgetInputEvent, aPrefix is "Widget" and aName is
 * "InputEvent".  NS_ROOT_EVENT_CLASS() is only used for WidgetEvent for
 * allowing special handling for it.  If you don't need such special handling,
 * you can define it as:
 * #define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)
 */

// BasicEvents.h
NS_ROOT_EVENT_CLASS(Widget, Event)
NS_EVENT_CLASS(Widget, GUIEvent)
NS_EVENT_CLASS(Widget, InputEvent)
NS_EVENT_CLASS(Internal, UIEvent)

// TextEvents.h
NS_EVENT_CLASS(Widget, KeyboardEvent)
NS_EVENT_CLASS(Widget, CompositionEvent)
NS_EVENT_CLASS(Widget, QueryContentEvent)
NS_EVENT_CLASS(Widget, SelectionEvent)
NS_EVENT_CLASS(Internal, EditorInputEvent)
NS_EVENT_CLASS(Internal, BeforeAfterKeyboardEvent)

// MouseEvents.h

#undef NS_EVENT_CLASS
#undef NS_ROOT_EVENT_CLASS

  /**
   * Returns true if the event is a query content event.
   * Returns true if the event message is one of mouse events.
   */
  bool HasMouseEventMessage() const;
  /**
   * Returns true if the event message is one of drag events.
   */
  ;
  /**
   * Returns true if the event message is one of key events.
   */
  bool IsAllowedToDispatchDOMEvent() const;
};

/******************************************************************************
 * mozilla::WidgetGUIEvent
 ******************************************************************************/

class WidgetGUIEvent : public WidgetEvent
{
protected:
  WidgetGUIEvent(bool aIsTrusted, uint32_t aMessage, nsIWidget* aWidget,
                 EventClassID aEventClassID)
    : WidgetEvent(aIsTrusted, aMessage, aEventClassID)
    , widget(aWidget)
  {
  }

  WidgetGUIEvent()
  {
  }

public:
  virtual WidgetGUIEvent* AsGUIEvent() MOZ_OVERRIDE { return this; }

  WidgetGUIEvent(bool aIsTrusted, uint32_t aMessage, nsIWidget* aWidget) :
    WidgetEvent(aIsTrusted, aMessage, eGUIEventClass),
    widget(aWidget)
  {
  }

  virtual WidgetEvent* Duplicate() const MOZ_OVERRIDE
  {
    MOZ_ASSERT(mClass == eGUIEventClass,
               "Duplicate() must be overridden by sub class");
    // Not copying widget, it is a weak reference.
    WidgetGUIEvent* result = new WidgetGUIEvent(false, message, nullptr);
    result->AssignGUIEventData(*this, true);
    result->mFlags = mFlags;
    return result;
  }

  /// Originator of the event
  nsCOMPtr<nsIWidget> widget;

  /*
   * Explanation for this PluginEvent class:
   *
   * WidgetGUIEvent's mPluginEvent member used to be a void* pointer,
   * used to reference external, OS-specific data structures.
   *
   * That void* pointer wasn't serializable by itself, causing
   * certain plugin events not to function in e10s. See bug 586656.
   *
   * To make this serializable, we changed this void* pointer into
   * a proper buffer, and copy these external data structures into this
   * buffer.
   *
   * That buffer is PluginEvent::mBuffer below.
   *
   * We wrap this in that PluginEvent class providing operators to
   * be compatible with existing code that was written around
   * the old void* field.
   *
   * Ideally though, we wouldn't allow arbitrary reinterpret_cast'ing here;
   * instead, we would at least store type information here so that
   * this class can't be used to reinterpret one structure type into another.
   * We can also wonder if it would be possible to properly extend
   * WidgetGUIEvent and other Event classes to remove the need for this
   * mPluginEvent field.
   */
  class PluginEvent MOZ_FINAL
  {
    nsTArray<uint8_t> mBuffer;

    friend struct IPC::ParamTraits<mozilla::WidgetGUIEvent>;

  public:

    MOZ_EXPLICIT_CONVERSION operator bool() const
    {
      return !mBuffer.IsEmpty();
    }

    template<typename T>
    MOZ_EXPLICIT_CONVERSION operator const T*() const
    {
    }
  };

  /// Event for NPAPI plugin
  PluginEvent mPluginEvent;

  void AssignGUIEventData(const WidgetGUIEvent& aEvent, bool aCopyTargets)
  {
    AssignEventData(aEvent, aCopyTargets);

    // widget should be initialized with the constructor.

    mPluginEvent = aEvent.mPluginEvent;
  }
};

/******************************************************************************
 * mozilla::Modifier
 *
 * All modifier keys should be defined here.  This is used for managing
 * modifier states for DOM Level 3 or later.
  

  

  Modifiers modifiers;

  void AssignInputEventData(const WidgetInputEvent& aEvent, bool aCopyTargets)
  {
    AssignGUIEventData(aEvent, aCopyTargets);

    modifiers = aEvent.modifiers;
  }
};

/******************************************************************************
 * mozilla::InternalUIEvent
 *
 * XXX Why this inherits WidgetGUIEvent rather than WidgetEvent?
 ******************************************************************************/

class InternalUIEvent : public WidgetGUIEvent
{
protected:
  

  

  

public:
  virtual InternalUIEvent* AsUIEvent() MOZ_OVERRIDE { return this; }

  InternalUIEvent(bool aIsTrusted, uint32_t aMessage)
    : WidgetGUIEvent(aIsTrusted, aMessage, nullptr, eUIEventClass)
    , detail(0)
  {
  }

  virtual WidgetEvent* Duplicate() const MOZ_OVERRIDE
  {
    MOZ_ASSERT(mClass == eUIEventClass,
               "Duplicate() must be overridden by sub class");
    InternalUIEvent* result = new InternalUIEvent(false, message);
    result->AssignUIEventData(*this, true);
    result->mFlags = mFlags;
    return result;
  }

  int32_t detail;

  void AssignUIEventData(const InternalUIEvent& aEvent, bool aCopyTargets)
  {
    AssignGUIEventData(aEvent, aCopyTargets);

    detail = aEvent.detail;
  }
};

} // namespace mozilla
# 11 "../../dist/include/mozilla/dom/EventListenerBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CallbackInterface.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/CallbackInterface.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * A common base class for representing WebIDL callback interface types in C++.
 *
 * This class implements common functionality like lifetime management,
 * initialization with the callback object, and setup of the call environment.
 * Subclasses corresponding to particular callback interface types should
 * provide methods that actually do the various necessary calls.
 */

#ifndef mozilla_dom_CallbackInterface_h
#define mozilla_dom_CallbackInterface_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CallbackObject.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/dom/CallbackInterface.h"

namespace mozilla {
namespace dom {

class CallbackInterface : public CallbackObject
{
public:
  

protected:
  ;

};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_CallbackFunction_h
# 43 "../../dist/include/mozilla/dom/CallbackInterface.h"
# 12 "../../dist/include/mozilla/dom/EventListenerBinding.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/EventListenerBinding.h"

namespace mozilla {
namespace dom {

class Event;
class EventListener;
struct EventListenerAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

class EventListener : public CallbackInterface
{
public:
  

  

  

  

private:
  void HandleEvent(JSContext* cx, JS::Handle<JS::Value> aThisVal, Event& event, ErrorResult& aRv);

  ;
};


} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_EventListenerBinding_h
# 86 "../../dist/include/mozilla/dom/EventListenerBinding.h"
# 11 "../../dist/include/mozilla/EventListenerManager.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/JSEventHandler.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/JSEventHandler.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_JSEventHandler_h_
#define mozilla_JSEventHandler_h_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/JSEventHandler.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/JSEventHandler.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/EventHandlerBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/EventHandlerBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_EventHandlerBinding_h
#define mozilla_dom_EventHandlerBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/EventHandlerBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/EventHandlerBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/EventHandlerBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/UnionMember.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/EventHandlerBinding.h"

namespace mozilla {
namespace dom {

class Event;
class EventHandlerNonNull;
class EventOrString;
struct NativePropertyHooks;


class EventOrString
{
  friend class EventOrStringArgument;
  enum Type
  {
    eUninitialized,
    eEvent,
    eString
  };

  union Value
  {
    UnionMember<NonNull<mozilla::dom::Event> > mEvent;
    UnionMember<binding_detail::FakeString > mString;

  };

  Type mType;
  Value mValue;

  EventOrString(const EventOrString&) = delete;
  void operator=(const EventOrString) = delete;
public:
  explicit inline EventOrString()
    : mType(eUninitialized)
  {
  }

  inline ~EventOrString()
  {
    Uninit();
  }

  inline NonNull<mozilla::dom::Event>&
  RawSetAsEvent()
  {
    if (mType == eEvent) {
      return mValue.mEvent.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eEvent;
    return mValue.mEvent.SetValue();
  }

  inline NonNull<mozilla::dom::Event>&
  SetAsEvent()
  {
    if (mType == eEvent) {
      return mValue.mEvent.Value();
    }
    Uninit();
    mType = eEvent;
    return mValue.mEvent.SetValue();
  }

  inline bool
  IsEvent() const
  {
    return mType == eEvent;
  }

  inline NonNull<mozilla::dom::Event>&
  GetAsEvent()
  {
    MOZ_ASSERT(IsEvent(), "Wrong type!");
    return mValue.mEvent.Value();
  }

  inline mozilla::dom::Event&
  GetAsEvent() const
  {
    MOZ_ASSERT(IsEvent(), "Wrong type!");
    return mValue.mEvent.Value();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eEvent: {
        DestroyEvent();
        break;
      }
      case eString: {
        DestroyString();
        break;
      }
    }
  }

  ;

private:
  inline void
  DestroyEvent()
  {
    MOZ_ASSERT(IsEvent(), "Wrong type!");
    mValue.mEvent.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    mValue.mString.Destroy();
    mType = eUninitialized;
  }
};


class OwningEventOrString : public AllOwningUnionBase
{
};


class EventHandlerNonNull : public CallbackFunction
{
public:
  

  

  

  

  

private:
  ;
};


class OnBeforeUnloadEventHandlerNonNull : public CallbackFunction
{
public:
  

  

  

  

  

  

private:
  ;
};


} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_EventHandlerBinding_h
# 489 "../../dist/include/mozilla/dom/EventHandlerBinding.h"
# 12 "../../dist/include/mozilla/JSEventHandler.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/JSEventHandler.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/JSEventHandler.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIAtom.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/JSEventHandler.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMKeyEvent.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMKeyEvent.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMKeyEvent.idl
 */

#ifndef __gen_nsIDOMKeyEvent_h__
#define __gen_nsIDOMKeyEvent_h__


#ifndef __gen_nsIDOMUIEvent_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMUIEvent.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMUIEvent.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMUIEvent.idl
 */

#ifndef __gen_nsIDOMUIEvent_h__
#define __gen_nsIDOMUIEvent_h__


#ifndef __gen_nsIDOMEvent_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMEvent.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMEvent.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMEvent.idl
 */

#ifndef __gen_nsIDOMEvent_h__
#define __gen_nsIDOMEvent_h__

#ifdef ERROR
#undef ERROR
#endif
# 22 "../../dist/include/nsIDOMEvent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsIDOMEvent.h"
class nsPresContext;
class nsInvalidateRequestList;
namespace IPC {
class Message;
}
namespace mozilla {
namespace dom {
class Event;
class EventTarget;
} // namespace dom
} // namespace mozilla

/* starting interface:    nsIDOMEvent */
#define NS_IDOMEVENT_IID_STR "02d54f52-a1f5-4ad2-b560-36f14012935e"

#define NS_IDOMEVENT_IID \
  {0x02d54f52, 0xa1f5, 0x4ad2, \
    { 0xb5, 0x60, 0x36, 0xf1, 0x40, 0x12, 0x93, 0x5e }}

class NS_NO_VTABLE nsIDOMEvent : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMEVENT_IID)


  /* [notxpcom] boolean Deserialize (in ConstIPCMessagePtr aMsg, out voidPtr aIter); */
  NS_IMETHOD_(bool) Deserialize(const IPC::Message *aMsg, void **aIter) = 0;

  /* [noscript,notxpcom] void SetOwner (in EventTargetPtr aOwner); */
  NS_IMETHOD_(void) SetOwner(mozilla::dom::EventTarget *aOwner) = 0;

  /* [notxpcom] DOMEventPtr InternalDOMEvent (); */
  NS_IMETHOD_(mozilla::dom::Event *) InternalDOMEvent(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMEvent, NS_IDOMEVENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMEVENT \
  NS_IMETHOD_(void) SetOwner(mozilla::dom::EventTarget *aOwner) MOZ_OVERRIDE; \
  NS_IMETHOD_(mozilla::dom::Event *) InternalDOMEvent(void) MOZ_OVERRIDE; 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMEvent : public nsIDOMEvent
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMEVENT

}

/* [notxpcom] boolean Deserialize (in ConstIPCMessagePtr aMsg, out voidPtr aIter); */

/* End of implementation class template. */
#endif
# 408 "../../dist/include/nsIDOMEvent.h"


;
;
;
;
;
;
;
;
;
;
;
;
;
;
;

#endif /* __gen_nsIDOMEvent_h__ */
# 565 "../../dist/include/nsIDOMEvent.h"
# 11 "../../dist/include/nsIDOMUIEvent.h" 2
#endif
# 12 "../../dist/include/nsIDOMUIEvent.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMUIEvent.h"

/* starting interface:    nsIDOMUIEvent */
#define NS_IDOMUIEVENT_IID_STR "d73852f8-7bd6-477d-8233-117dbf83860b"

#define NS_IDOMUIEVENT_IID \
  {0xd73852f8, 0x7bd6, 0x477d, \
    { 0x82, 0x33, 0x11, 0x7d, 0xbf, 0x83, 0x86, 0x0b }}

class NS_NO_VTABLE nsIDOMUIEvent : public nsIDOMEvent {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMUIEVENT_IID)

  /* readonly attribute nsIDOMWindow view; */
  NS_IMETHOD GetView(nsIDOMWindow * *aView) = 0;

  /* attribute boolean cancelBubble; */
  NS_IMETHOD GetCancelBubble(bool *aCancelBubble) = 0;
  NS_IMETHOD SetCancelBubble(bool aCancelBubble) = 0;

  /* readonly attribute boolean isChar; */
  NS_IMETHOD GetIsChar(bool *aIsChar) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMUIEvent, NS_IDOMUIEVENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMUIEVENT \
  NS_IMETHOD GetView(nsIDOMWindow * *aView) MOZ_OVERRIDE; \
  NS_IMETHOD GetDetail(int32_t *aDetail) MOZ_OVERRIDE; \
  NS_IMETHOD InitUIEvent(const nsAString & typeArg, bool canBubbleArg, bool cancelableArg, nsIDOMWindow *viewArg, int32_t detailArg) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->InitUIEvent(typeArg, canBubbleArg, cancelableArg, viewArg, detailArg); } \
  NS_IMETHOD GetLayerX(int32_t *aLayerX) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLayerX(aLayerX); } \
  NS_IMETHOD GetLayerY(int32_t *aLayerY) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLayerY(aLayerY); } \
  NS_IMETHOD GetPageX(int32_t *aPageX) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPageX(aPageX); } \
  NS_IMETHOD GetPageY(int32_t *aPageY) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPageY(aPageY); } \
  NS_IMETHOD GetWhich(uint32_t *aWhich) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWhich(aWhich); } \
  NS_IMETHOD GetRangeParent(nsIDOMNode * *aRangeParent) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRangeParent(aRangeParent); } \
  NS_IMETHOD GetRangeOffset(int32_t *aRangeOffset) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRangeOffset(aRangeOffset); } \
  NS_IMETHOD GetCancelBubble(bool *aCancelBubble) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCancelBubble(aCancelBubble); } \
  NS_IMETHOD SetCancelBubble(bool aCancelBubble) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCancelBubble(aCancelBubble); } \
  NS_IMETHOD GetIsChar(bool *aIsChar) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsChar(aIsChar); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMUIEvent : public nsIDOMUIEvent
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMUIEVENT

  nsDOMUIEvent();
NS_IMETHODIMP nsDOMUIEvent::GetIsChar(bool *aIsChar)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 234 "../../dist/include/nsIDOMUIEvent.h"


#endif /* __gen_nsIDOMUIEvent_h__ */
# 237 "../../dist/include/nsIDOMUIEvent.h"
# 11 "../../dist/include/nsIDOMKeyEvent.h" 2
#endif
# 12 "../../dist/include/nsIDOMKeyEvent.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMKeyEvent.h"

/* starting interface:    nsIDOMKeyEvent */
#define NS_IDOMKEYEVENT_IID_STR "d2b3e35f-8627-4732-a92d-cda54c8f8054"

#define NS_IDOMKEYEVENT_IID \
  {0xd2b3e35f, 0x8627, 0x4732, \
    { 0xa9, 0x2d, 0xcd, 0xa5, 0x4c, 0x8f, 0x80, 0x54 }}

class NS_NO_VTABLE nsIDOMKeyEvent : public nsIDOMUIEvent {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMKEYEVENT_IID)

  enum {
    DOM_VK_CANCEL = 3U,
    DOM_VK_HELP = 6U,
    DOM_VK_BACK_SPACE = 8U,
    DOM_VK_TAB = 9U,
    DOM_VK_CLEAR = 12U,
    DOM_VK_RETURN = 13U,
    DOM_VK_MODECHANGE = 31U,
    DOM_VK_SPACE = 32U,
    DOM_VK_PAGE_UP = 33U,
    DOM_VK_PAGE_DOWN = 34U,
    DOM_VK_END = 35U,
    DOM_VK_EXSEL = 248U,
    DOM_VK_EREOF = 249U,
    DOM_VK_PLAY = 250U,
    DOM_VK_ZOOM = 251U,
    DOM_VK_PA1 = 253U,
    DOM_VK_WIN_OEM_CLEAR = 254U
  };

  /* readonly attribute unsigned long charCode; */
  NS_IMETHOD GetCharCode(uint32_t *aCharCode) = 0;

  NS_IMETHOD GetRepeat(bool *aRepeat) = 0;

  /* readonly attribute DOMString key; */
  NS_IMETHOD GetKey(nsAString & aKey) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMKeyEvent, NS_IDOMKEYEVENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMKEYEVENT \
  NS_IMETHOD GetCharCode(uint32_t *aCharCode) MOZ_OVERRIDE; \
  NS_IMETHOD GetKeyCode(uint32_t *aKeyCode) MOZ_OVERRIDE; \
  NS_IMETHOD GetAltKey(bool *aAltKey) MOZ_OVERRIDE; \
  NS_IMETHOD GetCtrlKey(bool *aCtrlKey) MOZ_OVERRIDE; \
  NS_IMETHOD GetShiftKey(bool *aShiftKey) MOZ_OVERRIDE; \
  NS_IMETHOD GetMetaKey(bool *aMetaKey) MOZ_OVERRIDE; \
  NS_IMETHOD InitKeyEvent(const nsAString & typeArg, bool canBubbleArg, bool cancelableArg, nsIDOMWindow *viewArg, bool ctrlKeyArg, bool altKeyArg, bool shiftKeyArg, bool metaKeyArg, uint32_t keyCodeArg, uint32_t charCodeArg) MOZ_OVERRIDE; \
  NS_IMETHOD GetModifierState(const nsAString & keyArg, bool *_retval) MOZ_OVERRIDE; \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMKeyEvent : public nsIDOMKeyEvent
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMKEYEVENT

  nsDOMKeyEvent();

{
  /* destructor code */
#endif
# 12 "../../dist/include/nsIDOMEventListener.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMEventListener.h"

/* starting interface:    nsIDOMEventListener */
#define NS_IDOMEVENTLISTENER_IID_STR "df31c120-ded6-11d1-bd85-00805f8ae3f4"

#define NS_IDOMEVENTLISTENER_IID \
  {0xdf31c120, 0xded6, 0x11d1, \
    { 0xbd, 0x85, 0x00, 0x80, 0x5f, 0x8a, 0xe3, 0xf4 }}

class NS_NO_VTABLE nsIDOMEventListener : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMEVENTLISTENER_IID)

  /* void handleEvent (in nsIDOMEvent event); */
  NS_IMETHOD HandleEvent(nsIDOMEvent *event) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMEventListener, NS_IDOMEVENTLISTENER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMEVENTLISTENER \
  NS_IMETHOD HandleEvent(nsIDOMEvent *event) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMEVENTLISTENER(_to) \
  NS_IMETHOD HandleEvent(nsIDOMEvent *event) MOZ_OVERRIDE { return _to HandleEvent(event); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMEVENTLISTENER(_to) \
  NS_IMETHOD HandleEvent(nsIDOMEvent *event) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->HandleEvent(event); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMEventListener : public nsIDOMEventListener
{
/* End of implementation class template. */
#endif
# 89 "../../dist/include/nsIDOMEventListener.h"


#endif /* __gen_nsIDOMEventListener_h__ */
# 92 "../../dist/include/nsIDOMEventListener.h"
# 17 "../../dist/include/mozilla/JSEventHandler.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIScriptContext.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/JSEventHandler.h"

namespace mozilla {

class TypedEventHandler
{
public:
  enum HandlerType
  {
    eUnset = 0,
    eNormal = 0x1,
    eOnError = 0x2,
    eOnBeforeUnload = 0x3,
    eTypeBits = 0x3
  };

  

  

  

  

  

  

  HandlerType Type() const
  {
    return HandlerType(mBits & eTypeBits);
  }

  bool HasEventHandler() const
  {
    return !!Ptr();
  }

  

  dom::OnErrorEventHandlerNonNull* OnErrorEventHandler() const
  {
    MOZ_ASSERT(Type() == eOnError);
    return reinterpret_cast<dom::OnErrorEventHandlerNonNull*>(Ptr());
  }

  

  dom::CallbackFunction* Ptr() const
  {
    // Have to cast eTypeBits so we don't have to worry about
    // promotion issues after the bitflip.
    return reinterpret_cast<dom::CallbackFunction*>(mBits &
                                                      ~uintptr_t(eTypeBits));
  }

  void ForgetHandler()
  {
    ReleaseHandler();
    mBits = 0;
  }

  

private:
  void operator=(const TypedEventHandler&) = delete;

  void ReleaseHandler()
  {
    nsISupports* ptr = Ptr();
    NS_IF_RELEASE(ptr);
  }

  void Assign(nsISupports* aHandler, HandlerType aType)
  {
    MOZ_ASSERT(aHandler, "Must have handler");
    NS_ADDREF(aHandler);
    mBits = uintptr_t(aHandler) | uintptr_t(aType);
  }

  uintptr_t mBits;
};

/**
 * Implemented by script event listeners. Used to retrieve the script object
 * corresponding to the event target and the handler itself.
 *
 * Note, mTarget is a raw pointer and the owner of the JSEventHandler object
 * is expected to call Disconnect()!
 */

#define NS_JSEVENTHANDLER_IID \
{ 0x4f486881, 0x1956, 0x4079, \
  { 0x8c, 0xa0, 0xf3, 0xbd, 0x60, 0x5c, 0xc2, 0x79 } }

class JSEventHandler : public nsIDOMEventListener
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_JSEVENTHANDLER_IID)

  ;

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS

  // nsIDOMEventListener interface
  NS_DECL_NSIDOMEVENTLISTENER

  

  

  

  

  

  ;

  nsISupports* mTarget;
  nsCOMPtr<nsIAtom> mEventName;
  TypedEventHandler mTypedHandler;
};

NS_DEFINE_STATIC_IID_ACCESSOR(JSEventHandler, NS_JSEVENTHANDLER_IID)

} // namespace mozilla

/**
 * Factory function.  aHandler must already be bound to aTarget.
 * aContext is allowed to be null if aHandler is already set up.
 */
;

#endif // mozilla_JSEventHandler_h_
# 277 "../../dist/include/mozilla/JSEventHandler.h"

# 12 "../../dist/include/mozilla/EventListenerManager.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/EventListenerManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/EventListenerManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
class nsIEventListenerInfo;
class nsIScriptContext;
class nsPIDOMWindow;
class JSTracer;

struct EventTypeData;

template<class T> class nsCOMArray;

namespace mozilla {

class ELMCreationDetector;
class EventListenerManager;

namespace dom {
class EventTarget;
class Element;
} // namespace dom

typedef dom::CallbackObjectHolder<dom::EventListener,
                                  nsIDOMEventListener> EventListenerHolder;

struct EventListenerFlags
{
  friend class EventListenerManager;
private:
  // If mListenerIsJSListener is true, the listener is implemented by JS.
  // Otherwise, it's implemented by native code or JS but it's wrapped.
  bool mListenerIsJSListener : 1;

public:
  // If mCapture is true, it means the listener captures the event.  Otherwise,
  // it's listening at bubbling phase.
  bool mCapture : 1;
  // If mInSystemGroup is true, the listener is listening to the events in the
  // system group.
  bool mInSystemGroup : 1;
  // If mAllowUntrustedEvents is true, the listener is listening to the
  // untrusted events too.
  bool mAllowUntrustedEvents : 1;

  

  

  

  
};

















/*
 * Event listener manager
 */

class EventListenerManager MOZ_FINAL
{
  ~EventListenerManager();

public:
  struct Listener
  {
    EventListenerHolder mListener;
    nsCOMPtr<nsIAtom> mTypeAtom; // for the main thread
    nsString mTypeString; // for non-main-threads
    EventListenerFlags mFlags;

    

    

    

    MOZ_ALWAYS_INLINE bool IsListening(const WidgetEvent* aEvent) const
    {
      if (mFlags.mInSystemGroup != aEvent->mFlags.mInSystemGroup) {
        return false;
      }
      // FIXME Should check !mFlags.mCapture when the event is in target
      //       phase because capture phase event listeners should not be fired.
      //       But it breaks at least <xul:dialog>'s buttons. Bug 235441.
      return ((mFlags.mCapture && aEvent->mFlags.mInCapturePhase) ||
              (!mFlags.mCapture && aEvent->mFlags.mInBubblingPhase));
    }
  };

  ;

  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(EventListenerManager)

  NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(EventListenerManager)

  
  
  
  

  uint32_t mIsMainThreadELM : 1;
  uint32_t mNoListenerForEvent : 23;

  nsAutoTObserverArray<Listener, 2> mListeners;
  dom::EventTarget* MOZ_NON_OWNING_REF mTarget;
  nsCOMPtr<nsIAtom> mNoListenerForEventAtom;

  friend class ELMCreationDetector;
  static uint32_t sMainThreadCreatedCount;
};

} // namespace mozilla

/**
 * NS_AddSystemEventListener() is a helper function for implementing
 * EventTarget::AddSystemEventListener().
 */


#endif // mozilla_EventListenerManager_h_
# 593 "../../dist/include/mozilla/EventListenerManager.h"
# 19 "../../dist/include/mozilla/DOMEventTargetHelper.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/EventTarget.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/DOMEventTargetHelper.h"

struct JSCompartment;

namespace mozilla {

class ErrorResult;

#define NS_DOMEVENTTARGETHELPER_IID \
{ 0xa28385c6, 0x9451, 0x4d7e, \
  { 0xa3, 0xdd, 0xf4, 0xb6, 0x87, 0x2f, 0xa4, 0x76 } }

class DOMEventTargetHelper : public dom::EventTarget
{
public:
  
  
  
  

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(DOMEventTargetHelper)

};

NS_DEFINE_STATIC_IID_ACCESSOR(DOMEventTargetHelper,
                              NS_DOMEVENTTARGETHELPER_IID)

} // namespace mozilla

// XPIDL event handlers
#define NS_IMPL_EVENT_HANDLER(_class, _event)                                 \
    NS_IMETHODIMP _class::GetOn##_event(JSContext* aCx,                       \
                                        JS::MutableHandle<JS::Value> aValue)  \
    {                                                                         \
      GetEventHandler(nsGkAtoms::on##_event, aCx, aValue.address());          \
      return NS_OK;                                                           \
    }                                                                         \
    NS_IMETHODIMP _class::SetOn##_event(JSContext* aCx,                       \
  } \
  virtual nsIScriptContext * GetContextForEventHandlers(nsresult *aRv) { \
    return _to GetContextForEventHandlers(aRv); \
  } \
  virtual JSContext * GetJSContextForEventHandlers(void) { \
    return _to GetJSContextForEventHandlers(); \
  }

#define NS_REALLY_FORWARD_NSIDOMEVENTTARGET(_class) \
  using _class::AddEventListener;                   \
  using _class::RemoveEventListener;                \
  NS_FORWARD_NSIDOMEVENTTARGET(_class::)            \
  virtual mozilla::EventListenerManager*            \
  GetOrCreateListenerManager() MOZ_OVERRIDE {       \
    return _class::GetOrCreateListenerManager();    \
  }                                                 \
  virtual mozilla::EventListenerManager*            \
  GetExistingListenerManager() const MOZ_OVERRIDE { \
    return _class::GetExistingListenerManager();    \
  }

#endif // mozilla_DOMEventTargetHelper_h_
# 293 "../../dist/include/mozilla/DOMEventTargetHelper.h"
# 16 "../../dist/include/DOMMediaStream.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CORSMode.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/DOMMediaStream.h"

class nsXPCClassInfo;

// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
// GetTickCount() and conflicts with NS_DECL_NSIDOMMEDIASTREAM, containing
// currentTime getter.
#ifdef GetCurrentTime
#undef GetCurrentTime
#endif
# 26 "../../dist/include/DOMMediaStream.h"
// X11 has a #define for CurrentTime. Unbelievable :-(.
// See dom/media/webaudio/AudioContext.h for more fun!
#ifdef CurrentTime
#undef CurrentTime
#endif
# 31 "../../dist/include/DOMMediaStream.h"

namespace mozilla {

class DOMLocalMediaStream;
class MediaStream;
class MediaEngineSource;

namespace dom {
class AudioNode;
class MediaStreamTrack;
class AudioStreamTrack;
class VideoStreamTrack;
class AudioTrack;
class VideoTrack;
class AudioTrackList;
class VideoTrackList;
class MediaTrackListListener;
}

class MediaStreamDirectListener;

#define NS_DOMMEDIASTREAM_IID \
{ 0x8cb65468, 0x66c0, 0x444e, \
  { 0x89, 0x9f, 0x89, 0x1d, 0x9e, 0xd2, 0xbe, 0x7c } }

/**
 * DOM wrapper for MediaStreams.
 */
class DOMMediaStream : public DOMEventTargetHelper
{
  friend class DOMLocalMediaStream;
  typedef dom::MediaStreamTrack MediaStreamTrack;
  typedef dom::AudioStreamTrack AudioStreamTrack;
  typedef dom::VideoStreamTrack VideoStreamTrack;
  typedef dom::AudioTrack AudioTrack;
  typedef dom::VideoTrack VideoTrack;
  typedef dom::AudioTrackList AudioTrackList;
  typedef dom::VideoTrackList VideoTrackList;
  typedef dom::MediaTrackListListener MediaTrackListListener;

public:
  typedef uint8_t TrackTypeHints;

  ;

  NS_DECL_ISUPPORTS_INHERITED
  NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMMediaStream,
                                           DOMEventTargetHelper)
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOMMEDIASTREAM_IID)

  
  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

  // WebIDL
  ;

  ;

  ;
  ;
  ;
  ;

  MediaStream* GetStream() const { return mStream; }

  /**
   * Overridden in DOMLocalMediaStreams to allow getUserMedia to pass
  /**
   * Used to learn about dynamic changes in principal occur.
   * Operations relating to these observers must be confined to the main thread.
   */
  class PrincipalChangeObserver
  {
  public:
    ;
  };
  ;
  ;
  ;
  ;

  class OnTracksAvailableCallback {
  public:
    
    ;
  };
  // When one track of the appropriate type has been added for each bit set
  // in aCallback->GetExpectedTracks(), run aCallback->NotifyTracksAvailable.
  // It is allowed to do anything, including run script.
  // aCallback may run immediately during this call if tracks are already
  // available!
  // We only care about track additions, we'll fire the notification even if
  // some of the tracks have been removed.
  // Takes ownership of aCallback.
  // If GetExpectedTracks() returns 0, the callback will be fired as soon as there are any tracks.
  ;

  /**
   * Add an nsISupports object that this stream will keep alive as long as
   * the stream is not finished.
   */
  

  /**
   * If loading and playing a MediaStream in a media element, for each
   * MediaStreamTrack in the MediaStream, create a corresponding AudioTrack or
   * VideoTrack during the phase of resource fetching.
   */
  ;

  /**
   * MUST call this before the AudioTrackList or VideoTrackList go away
   */
  ;

  ;

  ;

  class StreamListener;
  friend class StreamListener;

  // StreamTime at which the currentTime attribute would return 0.
  StreamTime mLogicalStreamStartTime;

  // We need this to track our parent object.
  nsCOMPtr<nsIDOMWindow> mWindow;

  // MediaStream is owned by the graph, but we tell it when to die, and it won't
  // die until we let it.
  MediaStream* mStream;
  // Send notifications to AudioTrackList or VideoTrackList, if this MediaStream
  // is consumed by a HTMLMediaElement.
  nsTArray<MediaTrackListListener> mMediaTrackListListeners;

private:
  ;

  // Principal identifying who may access the contents of this stream.
  // If null, this stream can be used by anyone because it has no content yet.
  nsCOMPtr<nsIPrincipal> mPrincipal;
  nsTArray<PrincipalChangeObserver*> mPrincipalChangeObservers;
  // this is used in gUM and WebRTC to identify peers that this stream
  // is allowed to be sent to
  nsAutoPtr<PeerIdentity> mPeerIdentity;
  CORSMode mCORSMode;
};

NS_DEFINE_STATIC_IID_ACCESSOR(DOMMediaStream,
                              NS_DOMMEDIASTREAM_IID)

#define NS_DOMLOCALMEDIASTREAM_IID \
{ 0xb1437260, 0xec61, 0x4dfa, \
  { 0x92, 0x54, 0x04, 0x44, 0xe2, 0xb5, 0x94, 0x9c } }

class DOMLocalMediaStream : public DOMMediaStream
{
public:
  

  NS_DECL_ISUPPORTS_INHERITED
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOMLOCALMEDIASTREAM_IID)

protected:
  ;
};

NS_DEFINE_STATIC_IID_ACCESSOR(DOMLocalMediaStream,
                              NS_DOMLOCALMEDIASTREAM_IID)

class DOMAudioNodeMediaStream : public DOMMediaStream
{
  typedef dom::AudioNode AudioNode;
public:
  ;

  NS_DECL_ISUPPORTS_INHERITED
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMAudioNodeMediaStream, DOMMediaStream)

  /**
   * Create a DOMAudioNodeMediaStream whose underlying stream is a TrackUnionStream.
   */
  ;

protected:
  ;

private:
  // If this object wraps a stream owned by an AudioNode, we need to ensure that
  // the node isn't cycle-collected too early.
  nsRefPtr<AudioNode> mStreamNode;
};

}

namespace mozilla {
namespace dom {

enum AudioChannelState {
  AUDIO_CHANNEL_STATE_NORMAL = 0,
  AUDIO_CHANNEL_STATE_MUTED,
  AUDIO_CHANNEL_STATE_FADED,
  AUDIO_CHANNEL_STATE_LAST
};

} // namespace dom
} // namespace mozilla

#endif
# 24 "../../dist/include/AudioChannelCommon.h"

# 17 "../../dist/include/mozilla/dom/HTMLMediaElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "DecoderTraits.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/DecoderTraits.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef DecoderTraits_h_
#define DecoderTraits_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/DecoderTraits.h"

class nsAString;
class nsACString;

namespace mozilla {

class AbstractMediaDecoder;
class MediaDecoder;
class MediaDecoderOwner;
class MediaDecoderReader;

enum CanPlayStatus {
  CANPLAY_NO,
  CANPLAY_MAYBE,
  CANPLAY_YES
};

class DecoderTraits {
public:
  // Returns the CanPlayStatus indicating if we can handle this
  // MIME type. The MIME type should not include the codecs parameter.
  // That parameter should be passed in aCodecs, and will only be
  // used if whether a given MIME type being handled depends on the
  // codec that will be used.  If the codecs parameter has not been
  // specified, pass false in aHaveRequestedCodecs.
  ;

  // Returns true if we should handle this MIME type when it appears
  // as an <object> or as a toplevel page. If, in practice, our support
  // for the type is more limited than appears in the wild, we should return
  // Returns true if we should not start decoder until we receive
  // OnConnected signal. (currently RTSP only)
  ;
};

}

#endif
# 69 "../../dist/include/DecoderTraits.h"

# 18 "../../dist/include/mozilla/dom/HTMLMediaElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIAudioChannelAgent.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIAudioChannelAgent.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIAudioChannelAgent.idl
 */

#ifndef __gen_nsIAudioChannelAgent_h__
#define __gen_nsIAudioChannelAgent_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIAudioChannelAgent.h"
#endif
# 12 "../../dist/include/nsIAudioChannelAgent.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIAudioChannelAgent.h"
class nsIDOMWindow; /* forward declaration */


/* starting interface:    nsIAudioChannelAgentCallback */
#define NS_IAUDIOCHANNELAGENTCALLBACK_IID_STR "194b55d9-39c0-45c6-b8ef-b8049f978ea5"

#define NS_IAUDIOCHANNELAGENTCALLBACK_IID \
  {0x194b55d9, 0x39c0, 0x45c6, \
    { 0xb8, 0xef, 0xb8, 0x04, 0x9f, 0x97, 0x8e, 0xa5 }}

class NS_NO_VTABLE nsIAudioChannelAgentCallback : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IAUDIOCHANNELAGENTCALLBACK_IID)

  /* void canPlayChanged (in long canPlay); */
  NS_IMETHOD CanPlayChanged(int32_t canPlay) = 0;

  /* void windowVolumeChanged (); */
  NS_IMETHOD WindowVolumeChanged(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIAudioChannelAgentCallback, NS_IAUDIOCHANNELAGENTCALLBACK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIAUDIOCHANNELAGENTCALLBACK \
  NS_IMETHOD CanPlayChanged(int32_t canPlay) MOZ_OVERRIDE; \
  NS_IMETHOD WindowVolumeChanged(void) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIAUDIOCHANNELAGENTCALLBACK(_to) \
  NS_IMETHOD CanPlayChanged(int32_t canPlay) MOZ_OVERRIDE { return _to CanPlayChanged(canPlay); } \
  NS_IMETHOD WindowVolumeChanged(void) MOZ_OVERRIDE { return _to WindowVolumeChanged(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIAUDIOCHANNELAGENTCALLBACK(_to) \
  NS_IMETHOD CanPlayChanged(int32_t canPlay) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->CanPlayChanged(canPlay); } \
  NS_IMETHOD WindowVolumeChanged(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->WindowVolumeChanged(); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void windowVolumeChanged (); */
NS_IMETHODIMP nsAudioChannelAgentCallback::WindowVolumeChanged()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 103 "../../dist/include/nsIAudioChannelAgent.h"


/* starting interface:    nsIAudioChannelAgent */
#define NS_IAUDIOCHANNELAGENT_IID_STR "2b0222a5-8f7b-49d2-9ab8-cd01b744b23e"

#define NS_IAUDIOCHANNELAGENT_IID \
  {0x2b0222a5, 0x8f7b, 0x49d2, \
    { 0x9a, 0xb8, 0xcd, 0x01, 0xb7, 0x44, 0xb2, 0x3e }}

class NS_NO_VTABLE nsIAudioChannelAgent : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IAUDIOCHANNELAGENT_IID)

  enum {
    AUDIO_AGENT_CHANNEL_NORMAL = 0,
    AUDIO_AGENT_CHANNEL_CONTENT = 1,
    AUDIO_AGENT_CHANNEL_NOTIFICATION = 2,
    AUDIO_AGENT_CHANNEL_ALARM = 3,
    AUDIO_AGENT_CHANNEL_TELEPHONY = 4,
    AUDIO_AGENT_CHANNEL_RINGER = 5,
    AUDIO_AGENT_CHANNEL_PUBLICNOTIFICATION = 6,
    AUDIO_AGENT_CHANNEL_ERROR = 1000,
    AUDIO_AGENT_STATE_NORMAL = 0,
    AUDIO_AGENT_STATE_MUTED = 1,
    AUDIO_AGENT_STATE_FADED = 2
  };

  /* readonly attribute long audioChannelType; */
  NS_IMETHOD GetAudioChannelType(int32_t *aAudioChannelType) = 0;

  /* void init (in nsIDOMWindow window, in long channelType, in nsIAudioChannelAgentCallback callback); */
  NS_IMETHOD Init(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback) = 0;

  /* void initWithWeakCallback (in nsIDOMWindow window, in long channelType, in nsIAudioChannelAgentCallback callback); */
  NS_IMETHOD InitWithWeakCallback(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback) = 0;
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIAudioChannelAgent, NS_IAUDIOCHANNELAGENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIAUDIOCHANNELAGENT \
  NS_IMETHOD GetAudioChannelType(int32_t *aAudioChannelType) MOZ_OVERRIDE; \
  NS_IMETHOD Init(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback) MOZ_OVERRIDE; \
  NS_IMETHOD InitWithWeakCallback(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback) MOZ_OVERRIDE; \
  NS_IMETHOD InitWithVideo(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback, bool weak) MOZ_OVERRIDE; \
  NS_IMETHOD StartPlaying(int32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD StopPlaying(void) MOZ_OVERRIDE; \
  NS_IMETHOD SetVisibilityState(bool visible) MOZ_OVERRIDE; \
  NS_IMETHOD GetWindowVolume(float *aWindowVolume) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIAUDIOCHANNELAGENT(_to) \
  NS_IMETHOD GetAudioChannelType(int32_t *aAudioChannelType) MOZ_OVERRIDE { return _to GetAudioChannelType(aAudioChannelType); } \
  NS_IMETHOD Init(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback) MOZ_OVERRIDE { return _to Init(window, channelType, callback); } \
  NS_IMETHOD InitWithWeakCallback(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback) MOZ_OVERRIDE { return _to InitWithWeakCallback(window, channelType, callback); } \
  NS_IMETHOD InitWithVideo(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback, bool weak) MOZ_OVERRIDE { return _to InitWithVideo(window, channelType, callback, weak); } \
  NS_IMETHOD StartPlaying(int32_t *_retval) MOZ_OVERRIDE { return _to StartPlaying(_retval); } \
  NS_IMETHOD StopPlaying(void) MOZ_OVERRIDE { return _to StopPlaying(); } \
  NS_IMETHOD SetVisibilityState(bool visible) MOZ_OVERRIDE { return _to SetVisibilityState(visible); } \
  NS_IMETHOD GetWindowVolume(float *aWindowVolume) MOZ_OVERRIDE { return _to GetWindowVolume(aWindowVolume); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIAUDIOCHANNELAGENT(_to) \
  NS_IMETHOD GetAudioChannelType(int32_t *aAudioChannelType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAudioChannelType(aAudioChannelType); } \
  NS_IMETHOD Init(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(window, channelType, callback); } \
  NS_IMETHOD InitWithWeakCallback(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithWeakCallback(window, channelType, callback); } \
  NS_IMETHOD InitWithVideo(nsIDOMWindow *window, int32_t channelType, nsIAudioChannelAgentCallback *callback, bool weak) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithVideo(window, channelType, callback, weak); } \
  NS_IMETHOD StartPlaying(int32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->StartPlaying(_retval); } \
  NS_IMETHOD StopPlaying(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->StopPlaying(); } \
  NS_IMETHOD SetVisibilityState(bool visible) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetVisibilityState(visible); } \
  NS_IMETHOD GetWindowVolume(float *aWindowVolume) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetWindowVolume(aWindowVolume); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsAudioChannelAgent : public nsIAudioChannelAgent
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIAUDIOCHANNELAGENT

  nsAudioChannelAgent();

#endif // mozilla_dom_PromiseBinding_h
# 194 "../../dist/include/mozilla/dom/PromiseBinding.h"
# 17 "../../dist/include/mozilla/dom/Promise.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ToJSValue.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/ToJSValue.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* vim: set ts=2 sw=2 et tw=79: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_ToJSValue_h
#define mozilla_dom_ToJSValue_h
# 18 "../../dist/include/mozilla/dom/ToJSValue.h"

namespace mozilla {
namespace dom {

// If ToJSValue returns false, it must set an exception on the
// JSContext.

// Accept strings.
MOZ_WARN_UNUSED_RESULT bool
ToJSValue(JSContext* aCx,
          const nsAString& aArgument,
          JS::MutableHandle<JS::Value> aValue);

// Accept booleans.
MOZ_WARN_UNUSED_RESULT inline bool
ToJSValue(JSContext* aCx,
          bool aArgument,
          JS::MutableHandle<JS::Value> aValue)
{
  // Make sure we're called in a compartment
  MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));

  aValue.setBoolean(aArgument);
  return true;
}

// Accept integer types


// The uint32_t version is disabled for now because on the super-old b2g
// compiler nsresult and uint32_t are the same type.  If someone needs this at
// some point we'll need to figure out how to make it work (e.g. by switching to
// traits structs and using the trick IPC's ParamTraits uses, where a traits
// struct templated on the type inherits from a base traits struct of some sort,
// templated on the same type, or something).  Maybe b2g will update to a modern
// compiler before that happens....
#if 0
inline bool
ToJSValue(JSContext* aCx,
          uint32_t aArgument,
          JS::MutableHandle<JS::Value> aValue)
{
  // Make sure we're called in a compartment
  MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));

  aValue.setNumber(aArgument);
  return true;
}
#endif
# 77 "../../dist/include/mozilla/dom/ToJSValue.h"




MOZ_WARN_UNUSED_RESULT inline bool
ToJSValue(JSContext* aCx, JS::Handle<JS::Value> aArgument,
          JS::MutableHandle<JS::Value> aValue)
{
  aValue.set(aArgument);
  return MaybeWrapValue(aCx, aValue);
}

// Accept existing JS values on the Heap (which may not be same-compartment with us
// Accept pointers to other things we accept
template <typename T>
MOZ_WARN_UNUSED_RESULT
typename EnableIf<IsPointer<T>::value, bool>::Type
ToJSValue(JSContext* aCx,
          T aArgument,
          JS::MutableHandle<JS::Value> aValue)
{
  return ToJSValue(aCx, *aArgument, aValue);
}

// Accept arrays of other things we accept
template <typename T>
MOZ_WARN_UNUSED_RESULT bool
ToJSValue(JSContext* aCx,
          T* aArguments,
          size_t aLength,
          JS::MutableHandle<JS::Value> aValue)
{
  // Make sure we're called in a compartment
  MOZ_ASSERT(JS::CurrentGlobalOrNull(aCx));

  JS::AutoValueVector v(aCx);
  if (!v.resize(aLength)) {
    return false;
  }
  for (size_t i = 0; i < aLength; ++i) {
    if (!ToJSValue(aCx, aArguments[i], v[i])) {
      return false;
    }
  }
  JSObject* arrayObj = JS_NewArrayObject(aCx, v);
  if (!arrayObj) {
    return false;
  }
  aValue.setObject(*arrayObj);
  return true;
}

template <typename T>
MOZ_WARN_UNUSED_RESULT bool
ToJSValue(JSContext* aCx,
          const nsTArray<T>& aArgument,
          JS::MutableHandle<JS::Value> aValue)
{
  return ToJSValue(aCx, aArgument.Elements(),
                   aArgument.Length(), aValue);
}

template <typename T>
MOZ_WARN_UNUSED_RESULT bool
ToJSValue(JSContext* aCx,
          const FallibleTArray<T>& aArgument,
          JS::MutableHandle<JS::Value> aValue)
{
  return ToJSValue(aCx, aArgument.Elements(),
                   aArgument.Length(), aValue);
}

template <typename T, int N>
MOZ_WARN_UNUSED_RESULT bool
ToJSValue(JSContext* aCx,
          const T(&aArgument)[N],
          JS::MutableHandle<JS::Value> aValue)
{
  return ToJSValue(aCx, aArgument, N, aValue);
}

} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_ToJSValue_h */
# 347 "../../dist/include/mozilla/dom/ToJSValue.h"
# 18 "../../dist/include/mozilla/dom/Promise.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/WeakPtr.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/dom/Promise.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#include "mozilla/dom/workers/bindings/WorkerFeature.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/workers/bindings/WorkerFeature.h" 1
/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_workers_workerfeature_h__
#define mozilla_dom_workers_workerfeature_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/workers/Workers.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/workers/bindings/WorkerFeature.h"

BEGIN_WORKERS_NAMESPACE

/**
 * Use this chart to help figure out behavior during each of the closing
 * statuses. Details below.
 *
 * +==============================================================+
 * |                       Closing Statuses                       |
 * +=============+=============+=================+================+
 * |    status   | clear queue | abort execution |  close handler |
 * +=============+=============+=================+================+
 * |   Closing   |     yes     |       no        |   no timeout   |
 * +-------------+-------------+-----------------+----------------+
 * | Terminating |     yes     |       yes       |   no timeout   |
 * +-------------+-------------+-----------------+----------------+
 * |  Canceling  |     yes     |       yes       | short duration |
 * +-------------+-------------+-----------------+----------------+
 * |   Killing   |     yes     |       yes       |   doesn't run  |
 * +-------------+-------------+-----------------+----------------+
 */

#ifdef Status
/* Xlib headers insist on this for some reason... Nuke it because
   it'll override our member name */
#undef Status
#endif
# 37 "../../dist/include/mozilla/dom/workers/bindings/WorkerFeature.h"
enum Status
{
  // Not yet scheduled.
  Pending = 0,

  // out of bfcache. Setting this status causes the worker to abort immediately
  // and schedules the close handler with a short expiration time. Since the
  // page has gone away the worker may not post any messages.
  Canceling,

  // The application is shutting down. Setting this status causes the worker to
  // abort immediately and the close handler is never scheduled.
  Killing,

  // The close handler has run and the worker is effectively dead.
  Dead
};

class WorkerFeature
{
public:
  

  virtual bool Suspend(JSContext* aCx) { return true; }
  virtual bool Resume(JSContext* aCx) { return true; }

  virtual bool Notify(JSContext* aCx, Status aStatus) = 0;
};

END_WORKERS_NAMESPACE

#endif /* mozilla_dom_workers_workerfeature_h__ */
# 85 "../../dist/include/mozilla/dom/workers/bindings/WorkerFeature.h"
# 25 "../../dist/include/mozilla/dom/Promise.h" 2

class nsIGlobalObject;

namespace mozilla {
namespace dom {

class AnyCallback;
class DOMError;
class MediaStreamError;
class PromiseCallback;
class PromiseInit;
class PromiseNativeHandler;
class PromiseDebugging;

class Promise;
class PromiseReportRejectFeature : public workers::WorkerFeature
{
  // The Promise that owns this feature.
  Promise* mPromise;

public:
  

  virtual bool
  Notify(JSContext* aCx, workers::Status aStatus) MOZ_OVERRIDE;
};

#define NS_PROMISE_IID \
  { 0x1b8d6215, 0x3e67, 0x43ba, \
    { 0x8a, 0xf9, 0x31, 0x5e, 0x8f, 0xce, 0x75, 0x65 } }

class Promise : public nsISupports,
                public nsWrapperCache,
                public SupportsWeakPtr<Promise>
{
  friend class NativePromiseCallback;
  friend class PromiseResolverTask;
  friend class PromiseTask;
  friend class PromiseReportRejectFeature;
  friend class PromiseWorkerProxy;
  friend class PromiseWorkerProxyRunnable;
  friend class RejectPromiseCallback;
  friend class ResolvePromiseCallback;
  friend class ThenableResolverTask;
  friend class WrapperPromiseCallback;

public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_PROMISE_IID)
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS

  ;
};

NS_DEFINE_STATIC_IID_ACCESSOR(Promise, NS_PROMISE_IID)

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_Promise_h
# 351 "../../dist/include/mozilla/dom/Promise.h"
# 21 "../../dist/include/mozilla/dom/HTMLMediaElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/TextTrackManager.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/TextTrackManager.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set tw=80 expandtab softtabstop=2 ts=2 sw=2: */

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_TextTrackManager_h
#define mozilla_dom_TextTrackManager_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/TextTrack.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/TextTrack.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 et tw=78: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_TextTrack_h
#define mozilla_dom_TextTrack_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DOMEventTargetHelper.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/TextTrack.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/TextTrackBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/TextTrackBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_TextTrackBinding_h
#define mozilla_dom_TextTrackBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/TextTrackBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/TextTrackBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/TextTrackBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/TextTrackBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/TextTrackBinding.h"

namespace mozilla {
namespace dom {

struct NativePropertyHooks;
class ProtoAndIfaceCache;
class TextTrack;
struct TextTrackAtoms;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

enum class TextTrackKind : uint32_t {
  Subtitles,
  Captions,
  Descriptions,
  Chapters,
  Metadata,
  EndGuard_
};

namespace TextTrackKindValues {
extern const EnumEntry strings[6];
  ;

  ;

  

  ;

  ;

  ;

  ;

} // namespace TextTrackBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_TextTrackBinding_h
# 104 "../../dist/include/mozilla/dom/TextTrackBinding.h"
# 12 "../../dist/include/mozilla/dom/TextTrack.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/TextTrack.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/TextTrack.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/TextTrack.h"

namespace mozilla {
namespace dom {

class TextTrackList;
class TextTrackCue;
class TextTrackCueList;
class TextTrackRegion;
class HTMLTrackElement;

enum TextTrackSource {
  Track,
  AddTextTrack,
  MediaResourceSpecific
};

// Constants for numeric readyState property values.
enum TextTrackReadyState {
  NotLoaded = 0U,
  Loading = 1U,
  Loaded = 2U,
  FailedToLoad = 3U
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_TextTrackCueList_h
# 71 "../../dist/include/mozilla/dom/TextTrackCueList.h"
# 14 "../../dist/include/mozilla/dom/TextTrackManager.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/StaticPtr.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/TextTrackManager.h"

class nsIWebVTTParserWrapper;

namespace mozilla {
namespace dom {

class HTMLMediaElement;

class CompareTextTracks {
private:
  HTMLMediaElement* mMediaElement;
public:
  ;
  ;
  ;
  ;
};

class TextTrack;
class TextTrackCue;

class TextTrackManager MOZ_FINAL : public nsIDOMEventListener
{
  ;

public:
  /**
   * Overview of WebVTT cuetext and anonymous content setup.
   *
   * WebVTT nodes are the parsed version of WebVTT cuetext. WebVTT cuetext is
   * the portion of a WebVTT cue that specifies what the caption will actually
   * show up as on screen.
   *
   * WebVTT cuetext can contain markup that loosely relates to HTML markup. It
   * can contain tags like <b>, <u>, <i>, <c>, <v>, <ruby>, <rt>, <lang>,
   * including timestamp tags.
   *
   * When the caption is ready to be displayed the WebVTT nodes are converted
   * over to anonymous DOM content. <i>, <u>, <b>, <ruby>, and <rt> all become
   * HTMLElements of their corresponding HTML markup tags. <c> and <v> are
   * converted to <span> tags. Timestamp tags are converted to XML processing
   * instructions. Additionally, all cuetext tags support specifying of classes.
   * This takes the form of <foo.class.subclass>. These classes are then parsed
   * and set as the anonymous content's class attribute.
   *
   * Rules on constructing DOM objects from WebVTT nodes can be found here
   * http://dev.w3.org/html5/webvtt/#webvtt-cue-text-dom-construction-rules.
   * Current rules are taken from revision on April 15, 2013.
   */

  /**
   * Converts the TextTrackCue's cuetext into a tree of DOM objects and attaches
   * it to a div on it's owning TrackElement's MediaElement's caption overlay.
   */
  ;

  ;

  // Runs the algorithm for performing automatic track selection.
  ;
  // Performs track selection for a single TextTrackKind.
  ;
  //Performs track selection for a set of TextTrackKinds, for example,
  // 'subtitles' and 'captions' should be selected together.
  ;
  ;
  ;
  ;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_TextTrackManager_h
# 128 "../../dist/include/mozilla/dom/TextTrackManager.h"
# 22 "../../dist/include/mozilla/dom/HTMLMediaElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "MediaDecoder.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/MediaDecoder.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
Each video element based on MediaDecoder has a state machine to manage
its play state and keep the current frame up to date. All state machines
share time in a single shared thread. Each decoder also has a MediaTaskQueue
running in a SharedThreadPool to decode audio and video data.
   file. It instantiates and schedules the MediaDecoderStateMachine. The
   high level LOADING state is entered, which results in the decode

*/
#if !defined(MediaDecoder_h_)
#define MediaDecoder_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 188 "../../dist/include/MediaDecoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 189 "../../dist/include/MediaDecoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIObserver.h"
#endif /* expanded by -frewrite-includes */
# 190 "../../dist/include/MediaDecoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 191 "../../dist/include/MediaDecoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsITimer.h"
#endif /* expanded by -frewrite-includes */
# 192 "../../dist/include/MediaDecoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "MediaPromise.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/MediaPromise.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#if !defined(MediaPromise_h_)
#define MediaPromise_h_

#if 0 /* expanded by -frewrite-includes */
#include "prlog.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/MediaPromise.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/MediaPromise.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsThreadUtils.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/MediaPromise.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/MediaPromise.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Maybe.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/MediaPromise.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Mutex.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/MediaPromise.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Monitor.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/MediaPromise.h"

/* Polyfill __func__ on MSVC for consumers to pass to the MediaPromise API. */
#ifdef _MSC_VER
#define __func__ __FUNCTION__
#endif
# 24 "../../dist/include/MediaPromise.h"

class nsIEventTarget;
namespace mozilla {

extern PRLogModuleInfo* gMediaPromiseLog;

#define PROMISE_LOG(x, ...) \
  MOZ_ASSERT(gMediaPromiseLog); \
  PR_LOG(gMediaPromiseLog, PR_LOG_DEBUG, (x, ##__VA_ARGS__))

class MediaTaskQueue;
class MediaDecoderStateMachineScheduler;
namespace detail {

nsresult DispatchMediaPromiseRunnable(MediaTaskQueue* aQueue, nsIRunnable* aRunnable);
;
;

#ifdef DEBUG
void AssertOnThread(MediaTaskQueue* aQueue);
void AssertOnThread(nsIEventTarget* aTarget);
void AssertOnThread(MediaDecoderStateMachineScheduler* aScheduler);
#endif
# 47 "../../dist/include/MediaPromise.h"

} // namespace detail

/*
 * A promise manages an asynchronous request that may or may not be able to be
 * fulfilled immediately. When an API returns a promise, the consumer may attach
 * callbacks to be invoked (asynchronously, on a specified thread) when the
 * request is either completed (resolved) or cannot be completed (rejected).
 *
 * When IsExclusive is true, the MediaPromise does a release-mode assertion that
 * there is at most one call to either Then(...) or ChainTo(...).
 */
template<typename T> class MediaPromiseHolder;
template<typename ResolveValueT, typename RejectValueT, bool IsExclusive>
class MediaPromise
{
public:
  typedef ResolveValueT ResolveValueType;
  typedef RejectValueT RejectValueType;

  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaPromise)

protected:
  // MediaPromise is the public type, and never constructed directly. Construct
  // a MediaPromise::Private, defined below.
  

public:
  // MediaPromise::Private allows us to separate the public interface (upon which
  // consumers of the promise may invoke methods like Then()) from the private
  // interface (upon which the creator of the promise may invoke Resolve() or
  // Reject()). APIs should create and store a MediaPromise::Private (usually
  // via a MediaPromiseHolder), and return a MediaPromise to consumers.
  //
  // NB: We can include the definition of this class inline once B2G ICS is gone.
  class Private;

  

  

  class Consumer
  {
  public:
    bool mComplete;
    bool mDisconnected;
  };

protected:

  /*
   * A ThenValue tracks a single consumer waiting on the promise. When a consumer
   * invokes promise->Then(...), a ThenValue is created. Once the Promise is
   * resolved or rejected, a {Resolve,Reject}Runnable is dispatched, which
   * invokes the resolve/reject method and then deletes the ThenValue.
   */
  class ThenValueBase : public Consumer
  {
  public:
    class ResolveRunnable : public nsRunnable
    {
    public:
      

      

      NS_IMETHODIMP Run()
      {
        PROMISE_LOG("ResolveRunnable::Run() [this=%p]", this);
        mThenValue->DoResolve(mResolveValue);
        mThenValue = nullptr;
        return NS_OK;
      }

    private:
      nsRefPtr<ThenValueBase> mThenValue;
      ResolveValueType mResolveValue;
    };

    class RejectRunnable : public nsRunnable
    {
    public:
      

      

      NS_IMETHODIMP Run()
      {
        PROMISE_LOG("RejectRunnable::Run() [this=%p]", this);
        mThenValue->DoReject(mRejectValue);
        mThenValue = nullptr;
        return NS_OK;
      }

    private:
      nsRefPtr<ThenValueBase> mThenValue;
      RejectValueType mRejectValue;
    };

    

    ;

  protected:
    ;
    ;

    const char* mCallSite;
  };

  /*
   * We create two overloads for invoking Resolve/Reject Methods so as to
   * make the resolve/reject value argument "optional".
   */

  // Avoid confusing the compiler when the callback accepts T* but the ValueType
  // is nsRefPtr<T>. See bug 1109954 comment 6.
  template <typename T>
  struct NonDeduced
  {
    typedef T type;
  };

  

  

  template<typename TargetType, typename ThisType,
           typename ResolveMethodType, typename RejectMethodType>
  class ThenValue : public ThenValueBase
  {
  public:
    

    

#ifdef DEBUG
  virtual void AssertOnDispatchThread() MOZ_OVERRIDE
  {
    detail::AssertOnThread(mResponseTarget);
  }
#endif
# 265 "../../dist/include/MediaPromise.h"

  protected:
    

    

  private:
    nsRefPtr<TargetType> mResponseTarget;
    nsRefPtr<ThisType> mThisVal;
    ResolveMethodType mResolveMethod;
    RejectMethodType mRejectMethod;
  };
public:

  

  

  

protected:
  bool IsPending() { return mResolveValue.isNothing() && mRejectValue.isNothing(); }
  void DispatchAll()
  {
    mMutex.AssertCurrentThreadOwns();
    for (size_t i = 0; i < mThenValues.Length(); ++i) {
      mThenValues[i]->Dispatch(this);
    }
    mThenValues.Clear();

    for (size_t i = 0; i < mChainedPromises.Length(); ++i) {
      ForwardTo(mChainedPromises[i]);
    }
    mChainedPromises.Clear();
  }

  void ForwardTo(Private* aOther)
  {
    MOZ_ASSERT(!IsPending());
    if (mResolveValue.isSome()) {
      aOther->Resolve(mResolveValue.ref(), "<chained promise>");
    } else {
      aOther->Reject(mRejectValue.ref(), "<chained promise>");
    }
  }

  ;

  const char* mCreationSite; // For logging
  Mutex mMutex;
  Maybe<ResolveValueType> mResolveValue;
  Maybe<RejectValueType> mRejectValue;
  nsTArray<nsRefPtr<ThenValueBase>> mThenValues;
  nsTArray<nsRefPtr<Private>> mChainedPromises;
  bool mHaveConsumer;
};

template<typename ResolveValueT, typename RejectValueT, bool IsExclusive>
class MediaPromise<ResolveValueT, RejectValueT, IsExclusive>::Private
  : public MediaPromise<ResolveValueT, RejectValueT, IsExclusive>
{
public:
  

  

  
};

/*
 * Class to encapsulate a promise for a particular role. Use this as the member
 * variable for a class whose method returns a promise.
 */
template<typename PromiseType>
class MediaPromiseHolder
{
public:
  

  // Move semantics.
  

  

  

  // Provide a Monitor that should always be held when accessing this instance.
  

  bool IsEmpty()
  {
    if (mMonitor) {
      mMonitor->AssertCurrentThreadOwns();
    }
    return !mPromise;
  }

  

  void Resolve(typename PromiseType::ResolveValueType aResolveValue,
               const char* aMethodName)
  {
    if (mMonitor) {
      mMonitor->AssertCurrentThreadOwns();
    }
    MOZ_ASSERT(mPromise);
    mPromise->Resolve(aResolveValue, aMethodName);
    mPromise = nullptr;
  }
private:
  Monitor* mMonitor;
  nsRefPtr<typename PromiseType::Private> mPromise;
};

/*
 * Class to encapsulate a MediaPromise::Consumer reference. Use this as the member
 * variable for a class waiting on a media promise.
 */
template<typename PromiseType>
class MediaPromiseConsumerHolder
{
public:
  
  

private:
  nsRefPtr<typename PromiseType::Consumer> mConsumer;
};

// Proxy Media Calls.
//
// This machinery allows callers to schedule a promise-returning method to be
// invoked asynchronously on a given thread, while at the same time receiving
// a promise upon which to invoke Then() immediately. ProxyMediaCall dispatches
// a task to invoke the method on the proper thread and also chain the resulting
// promise to the one that the caller received, so that resolve/reject values
// are forwarded through.

namespace detail {

template<typename PromiseType>
class MethodCallBase
{
public:
  
  ;
  ;
};

template<typename PromiseType, typename ThisType>
class MethodCallWithNoArgs : public MethodCallBase<PromiseType>
{
public:
  typedef nsRefPtr<PromiseType>(ThisType::*Type)();
  
  
protected:
  nsRefPtr<ThisType> mThisVal;
  Type mMethod;
};

template<typename PromiseType, typename ThisType, typename Arg1Type>
class MethodCallWithOneArg : public MethodCallBase<PromiseType>
{
public:
  typedef nsRefPtr<PromiseType>(ThisType::*Type)(Arg1Type);
  
  
protected:
  nsRefPtr<ThisType> mThisVal;
  Type mMethod;
  Arg1Type mArg1;
};

template<typename PromiseType, typename ThisType, typename Arg1Type, typename Arg2Type>
class MethodCallWithTwoArgs : public MethodCallBase<PromiseType>
{
public:
  typedef nsRefPtr<PromiseType>(ThisType::*Type)(Arg1Type, Arg2Type);
  
  
protected:
  nsRefPtr<ThisType> mThisVal;
  Type mMethod;
  Arg1Type mArg1;
  Arg2Type mArg2;
};

template<typename PromiseType>
class ProxyRunnable : public nsRunnable
{
public:
  

  NS_IMETHODIMP Run()
  {
    nsRefPtr<PromiseType> p = mMethodCall->Invoke();
    mMethodCall = nullptr;
    p->ChainTo(mProxyPromise.forget(), "<Proxy Promise>");
    return NS_OK;
  }

private:
  nsRefPtr<typename PromiseType::Private> mProxyPromise;
  nsAutoPtr<MethodCallBase<PromiseType>> mMethodCall;
};



} // namespace detail







#undef PROMISE_LOG

} // namespace mozilla

#endif
# 706 "../../dist/include/MediaPromise.h"
# 193 "../../dist/include/MediaDecoder.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "MediaResource.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/MediaResource.h" 1
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#if !defined(MediaResource_h_)
#define MediaResource_h_

#if 0 /* expanded by -frewrite-includes */
  NS_IMETHOD SetChannelCount(uint32_t aChannelCount) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetChannelCount(aChannelCount); } \
  NS_IMETHOD GetEsdsData(nsACString & aEsdsData) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEsdsData(aEsdsData); } \
  NS_IMETHOD SetEsdsData(const nsACString & aEsdsData) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetEsdsData(aEsdsData); } \
  NS_IMETHOD GetAvccData(nsACString & aAvccData) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAvccData(aAvccData); } \
  NS_IMETHOD SetAvccData(const nsACString & aAvccData) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAvccData(aAvccData); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsStreamingProtocolMetaData : public nsIStreamingProtocolMetaData
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISTREAMINGPROTOCOLMETADATA

NS_IMETHODIMP nsStreamingProtocolMetaData::GetAvccData(nsACString & aAvccData)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsStreamingProtocolMetaData::SetAvccData(const nsACString & aAvccData)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 302 "../../dist/include/nsIStreamingProtocolController.h"


/* starting interface:    nsIStreamingProtocolListener */
#define NS_ISTREAMINGPROTOCOLLISTENER_IID_STR "c4f6b660-892e-11e2-9e96-0800200c9a66"
  NS_IMETHOD OnConnected(uint8_t index, nsIStreamingProtocolMetaData *meta) MOZ_OVERRIDE { return _to OnConnected(index, meta); } \
  NS_IMETHOD OnDisconnected(uint8_t index, nsresult reason) MOZ_OVERRIDE { return _to OnDisconnected(index, reason); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISTREAMINGPROTOCOLLISTENER(_to) \
  NS_IMETHOD OnMediaDataAvailable(uint8_t index, const nsACString & data, uint32_t length, uint32_t offset, nsIStreamingProtocolMetaData *meta) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnMediaDataAvailable(index, data, length, offset, meta); } \
  NS_IMETHOD OnConnected(uint8_t index, nsIStreamingProtocolMetaData *meta) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnConnected(index, meta); } \
  NS_IMETHOD OnDisconnected(uint8_t index, nsresult reason) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnDisconnected(index, reason); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsStreamingProtocolListener : public nsIStreamingProtocolListener
}

/* void onConnected (in uint8_t index, in nsIStreamingProtocolMetaData meta); */
NS_IMETHODIMP nsStreamingProtocolListener::OnConnected(uint8_t index, nsIStreamingProtocolMetaData *meta)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onDisconnected (in uint8_t index, in nsresult reason); */
NS_IMETHODIMP nsStreamingProtocolListener::OnDisconnected(uint8_t index, nsresult reason)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 399 "../../dist/include/nsIStreamingProtocolController.h"

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIStreamListener.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIStreamListener.idl
 */

#ifndef __gen_nsIStreamListener_h__
#define __gen_nsIStreamListener_h__


#ifndef __gen_nsIRequestObserver_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIRequestObserver.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIRequestObserver.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIRequestObserver.idl
 */

#ifndef __gen_nsIRequestObserver_h__
#define __gen_nsIRequestObserver_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIRequestObserver.h"
#endif
# 12 "../../dist/include/nsIRequestObserver.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIRequestObserver.h"
class nsIRequest; /* forward declaration */


/* starting interface:    nsIRequestObserver */
#define NS_IREQUESTOBSERVER_IID_STR "fd91e2e0-1481-11d3-9333-00104ba0fd40"

#define NS_IREQUESTOBSERVER_IID \
  {0xfd91e2e0, 0x1481, 0x11d3, \
    { 0x93, 0x33, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }}

class NS_NO_VTABLE nsIRequestObserver : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IREQUESTOBSERVER_IID)

  /* void onStartRequest (in nsIRequest aRequest, in nsISupports aContext); */
  NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) = 0;

  /* void onStopRequest (in nsIRequest aRequest, in nsISupports aContext, in nsresult aStatusCode); */
  NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIRequestObserver, NS_IREQUESTOBSERVER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIREQUESTOBSERVER \
  NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) MOZ_OVERRIDE; \
  NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIREQUESTOBSERVER(_to) \
  NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) MOZ_OVERRIDE { return _to OnStartRequest(aRequest, aContext); } \
  NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) MOZ_OVERRIDE { return _to OnStopRequest(aRequest, aContext, aStatusCode); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIREQUESTOBSERVER(_to) \
  NS_IMETHOD OnStartRequest(nsIRequest *aRequest, nsISupports *aContext) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStartRequest(aRequest, aContext); } \
  NS_IMETHOD OnStopRequest(nsIRequest *aRequest, nsISupports *aContext, nsresult aStatusCode) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStopRequest(aRequest, aContext, aStatusCode); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsRequestObserver : public nsIRequestObserver
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIREQUESTOBSERVER

  nsRequestObserver();

private:
/* End of implementation class template. */
#endif
# 103 "../../dist/include/nsIRequestObserver.h"


#endif /* __gen_nsIRequestObserver_h__ */
# 106 "../../dist/include/nsIRequestObserver.h"
# 11 "../../dist/include/nsIStreamListener.h" 2
#endif
# 12 "../../dist/include/nsIStreamListener.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIStreamListener.h"
class nsIInputStream; /* forward declaration */


/* starting interface:    nsIStreamListener */
#define NS_ISTREAMLISTENER_IID_STR "3b4c8a77-76ba-4610-b316-678c73a3b88c"

#define NS_ISTREAMLISTENER_IID \
  {0x3b4c8a77, 0x76ba, 0x4610, \
    { 0xb3, 0x16, 0x67, 0x8c, 0x73, 0xa3, 0xb8, 0x8c }}

class NS_NO_VTABLE nsIStreamListener : public nsIRequestObserver {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTREAMLISTENER_IID)

  /* void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long long aOffset, in unsigned long aCount); */
  NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, uint64_t aOffset, uint32_t aCount) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIStreamListener, NS_ISTREAMLISTENER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISTREAMLISTENER \
  NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, uint64_t aOffset, uint32_t aCount) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISTREAMLISTENER(_to) \
  NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, uint64_t aOffset, uint32_t aCount) MOZ_OVERRIDE { return _to OnDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISTREAMLISTENER(_to) \
  NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, uint64_t aOffset, uint32_t aCount) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
}

/* End of implementation class template. */
#endif
# 91 "../../dist/include/nsIStreamListener.h"


#endif /* __gen_nsIStreamListener_h__ */
# 94 "../../dist/include/nsIStreamListener.h"
# 14 "../../dist/include/MediaResource.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIChannelEventSink.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIChannelEventSink.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIChannelEventSink.idl
 */

#ifndef __gen_nsIChannelEventSink_h__
#define __gen_nsIChannelEventSink_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIChannelEventSink.h"
#endif
# 12 "../../dist/include/nsIChannelEventSink.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIChannelEventSink.h"
class nsIChannel; /* forward declaration */

class nsIAsyncVerifyRedirectCallback; /* forward declaration */


/* starting interface:    nsIChannelEventSink */
#define NS_ICHANNELEVENTSINK_IID_STR "0197720d-37ed-4e75-8956-d0d296e4d8a6"

#define NS_ICHANNELEVENTSINK_IID \
  {0x0197720d, 0x37ed, 0x4e75, \
    { 0x89, 0x56, 0xd0, 0xd2, 0x96, 0xe4, 0xd8, 0xa6 }}

class NS_NO_VTABLE nsIChannelEventSink : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICHANNELEVENTSINK_IID)

  enum {
    REDIRECT_TEMPORARY = 1U,
    REDIRECT_PERMANENT = 2U,
    REDIRECT_INTERNAL = 4U,
    REDIRECT_STS_UPGRADE = 8U
  };

  /* void asyncOnChannelRedirect (in nsIChannel oldChannel, in nsIChannel newChannel, in unsigned long flags, in nsIAsyncVerifyRedirectCallback callback); */
  NS_IMETHOD AsyncOnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel, uint32_t flags, nsIAsyncVerifyRedirectCallback *callback) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIChannelEventSink, NS_ICHANNELEVENTSINK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICHANNELEVENTSINK \
  NS_IMETHOD AsyncOnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel, uint32_t flags, nsIAsyncVerifyRedirectCallback *callback) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSICHANNELEVENTSINK(_to) \
  NS_IMETHOD AsyncOnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel, uint32_t flags, nsIAsyncVerifyRedirectCallback *callback) MOZ_OVERRIDE { return _to AsyncOnChannelRedirect(oldChannel, newChannel, flags, callback); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICHANNELEVENTSINK(_to) \
  NS_IMETHOD AsyncOnChannelRedirect(nsIChannel *oldChannel, nsIChannel *newChannel, uint32_t flags, nsIAsyncVerifyRedirectCallback *callback) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncOnChannelRedirect(oldChannel, newChannel, flags, callback); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 100 "../../dist/include/nsIChannelEventSink.h"


#endif /* __gen_nsIChannelEventSink_h__ */
# 103 "../../dist/include/nsIChannelEventSink.h"
# 15 "../../dist/include/MediaResource.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIInterfaceRequestor.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/MediaResource.h"
#if 0 /* expanded by -frewrite-includes */
#include "MediaCache.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/MediaCache.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MediaCache_h_
#define MediaCache_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
namespace mozilla {
// defined in MediaResource.h
class ChannelMediaResource;
class MediaByteRange;
class MediaResource;
class ReentrantMonitorAutoEnter;

/**
 * Media applications want fast, "on demand" random access to media data,
 * for pausing, seeking, etc. But we are primarily interested
 * in transporting media data using HTTP over the Internet, which has
 * high latency to open a connection, requires a new connection for every
 * seek, may not even support seeking on some connections (especially
 * live streams), and uses a push model --- data comes from the server
 * and you don't have much control over the rate. Also, transferring data
 * over the Internet can be slow and/or unpredictable, so we want to read
 * each HTTP load can return data with a different principal. This
 * principal must be passed to NotifyDataReceived, and MediaCache
 * will detect when different principals are associated with data in the
 * same stream, and replace them with a null principal.
 */
class MediaCache;

/**
 * If the cache fails to initialize then Init will fail, so nonstatic
 * methods of this class can assume gMediaCache is non-null.
 *
 * This class can be directly embedded as a value.
 */
class MediaCacheStream {
public:
  enum {
    // This needs to be a power of two
    BLOCK_SIZE = 32768
  };
  enum ReadMode {
    MODE_METADATA,
    MODE_PLAYBACK
  };

  // aClient provides the underlying transport that cache will use to read
  // data for this stream.
  ;
  ;

  // Set up this stream with the cache. Can fail on OOM. One
  // of InitAsClone or Init must be called before any other method on
  // this class. Does nothing if already initialized.
  size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const;

private:
  friend class MediaCache;

  /**
   * A doubly-linked list of blocks. Add/Remove/Get methods are all
   * constant time. We declare this here so that a stream can contain a
   * BlockList of its read-ahead blocks. Blocks are referred to by index
   * into the MediaCache::mIndex array.
   *
   * Blocks can belong to more than one list at the same time, because
   * the next/prev pointers are not stored in the block.
   */
  class BlockList {
  private:
    struct Entry : public nsUint32HashKey {
      
      

      int32_t mNextBlock;
      int32_t mPrevBlock;
    };
    nsTHashtable<Entry> mEntries;

    // The index of the first block in the list, or -1 if the list is empty.
    int32_t mFirstBlock;
    // The number of blocks in the list.
    int32_t mCount;
  };

  // Returns the end of the bytes starting at the given offset
  // mChannelOffset%BLOCK_SIZE bytes have been filled in with good data,
  // the rest are garbage.
  // Use int64_t so that the data is well-aligned.
  // Heap allocate this buffer since the exact power-of-2 will cause allocation
  // slop when combined with the rest of the object members.
  nsAutoArrayPtr<int64_t> mPartialBlockBuffer;
};

} // namespace mozilla

#endif
# 519 "../../dist/include/MediaCache.h"
# 17 "../../dist/include/MediaResource.h" 2

namespace mozilla {

class MediaChannelStatistics {
public:
  

  

  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaChannelStatistics)

  
  
  
  
  
  
private:
  ~MediaChannelStatistics() {}
  int64_t      mAccumulatedBytes;
  TimeDuration mAccumulatedTime;
  TimeStamp    mLastStartTime;
  bool         mIsStarted;
};

// Forward declaration for use in MediaByteRange.
class TimestampedMediaByteRange;

// Represents a section of contiguous media, with a start and end offset.
// Used to denote ranges of data which are cached.
class MediaByteRange {
public:
  MediaByteRange() : mStart(0), mEnd(0) {}

  MediaByteRange(int64_t aStart, int64_t aEnd)
    : mStart(aStart), mEnd(aEnd)
  {
    NS_ASSERTION(mStart <= mEnd, "Range should end after start!");
  }

  ;

  bool IsNull() const {
    return mStart == 0 && mEnd == 0;
  }

  

  // Clears byte range values.
  void Clear() {
    mStart = 0;
    mEnd = 0;
  }

  bool Contains(const MediaByteRange& aByteRange) const {
    return aByteRange.mStart >= mStart && aByteRange.mEnd <= mEnd;
  }

  MediaByteRange Extents(const MediaByteRange& aByteRange) const
  {
    if (IsNull()) {
      return aByteRange;
    }
    return MediaByteRange(std::min(mStart, aByteRange.mStart),
                          std::max(mEnd, aByteRange.mEnd));
  }

  int64_t Length() { return mEnd - mStart; }

  int64_t mStart, mEnd;
};

// Represents a section of contiguous media, with a start and end offset, and
// a timestamp representing the start time.
class TimestampedMediaByteRange : public MediaByteRange {
public:
  TimestampedMediaByteRange() : MediaByteRange(), mStartTime(-1) {}

  TimestampedMediaByteRange(int64_t aStart, int64_t aEnd, int64_t aStartTime)
    : MediaByteRange(aStart, aEnd), mStartTime(aStartTime)
  {
    NS_ASSERTION(aStartTime >= 0, "Start time should not be negative!");
  }

  bool IsNull() const {
    return MediaByteRange::IsNull() && mStartTime == -1;
  }

  // Clears byte range values.
  void Clear() {
    MediaByteRange::Clear();
    mStartTime = -1;
  }

  // In usecs.
  int64_t mStartTime;
};



class RtspMediaResource;

/**
 * Provides a thread-safe, seek/read interface to resources
 * loaded from a URI. Uses MediaCache to cache data received over
 * Necko's async channel API, thus resolving the mismatch between clients
 * that need efficient random access to the data and protocols that do not
 * support efficient random access, such as HTTP.
 *
 * Instances of this class must be created on the main thread.
 * Most methods must be called on the main thread only. Read, Seek and
 * Tell must only be called on non-main threads. In the case of the Ogg
 * Decoder they are called on the Decode thread for example. You must
 * ensure that no threads are calling these methods once Close is called.
 *
 * Instances of this class are reference counted. Use nsRefPtr for
 * managing the lifetime of instances of this class.
 *
 * The generic implementation of this class is ChannelMediaResource, which can
 * handle any URI for which Necko supports AsyncOpen.
 * The 'file:' protocol can be implemented efficiently with direct random
 * access, so the FileMediaResource implementation class bypasses the cache.
 * MediaResource::Create automatically chooses the best implementation class.
 */
class MediaResource : public nsISupports
{
public:
  // Our refcounting is threadsafe, and when our refcount drops to zero
  // we dispatch an event to the main thread to delete the MediaResource.
  // Note that this means it's safe for references to this object to be
  // released on a non main thread, but the destructor will always run on
  // is fine for a no-op cancel.
  virtual nsresult Seek(int32_t aWhence, int64_t aOffset) = 0;
  // Report the current offset in bytes from the start of the stream.
  virtual int64_t Tell() = 0;
  // Moves any existing channel loads into or out of background. Background
  // loads don't block the load event. This also determines whether or not any
  // new loads initiated (for example to seek) will be in the background.
  virtual void SetLoadInBackground(bool aLoadInBackground) {}
  // Ensures that the value returned by IsSuspendedByCache below is up to date
  // (i.e. the cache has examined this stream at least once).
  virtual void EnsureCacheUpToDate() {}

  // These can be called on any thread.
  // Cached blocks associated with this stream will not be evicted
  // while the stream is pinned.
  virtual void Pin() = 0;
  virtual void Unpin() = 0;
  // Get the estimated download rate in bytes per second (assuming no
  // pausing of the channel is requested by Gecko).
  // *aIsReliable is set to true if we think the estimate is useful.
  virtual double GetDownloadRate(bool* aIsReliable) = 0;
  // Get the length of the stream in bytes. Returns -1 if not known.
  // This can change over time; after a seek operation, a misbehaving
  // server may give us a resource of a different length to what it had
  // reported previously --- or it may just lie in its Content-Length
  // header and give us more or less data than it reported. We will adjust
  // the result of GetLength to reflect the data that's actually arriving.
  virtual int64_t GetLength() = 0;
  // Returns the offset of the first byte of cached data at or after aOffset,
  // or -1 if there is no such cached data.
  virtual int64_t GetNextCachedData(int64_t aOffset) = 0;
  // Returns the end of the bytes starting at the given offset
  // which are in cache.
  virtual int64_t GetCachedDataEnd(int64_t aOffset) = 0;
  // Returns true if all the data from aOffset to the end of the stream
  // is in cache. If the end of the stream is not known, we return false.
  virtual bool IsDataCachedToEndOfResource(int64_t aOffset) = 0;
  // Returns true if this stream is suspended by the cache because the
  // cache is full. If true then the decoder should try to start consuming
  // data, otherwise we may not be able to make progress.
  // MediaDecoder::NotifySuspendedStatusChanged is called when this
  // changes.
  // For resources using the media cache, this returns true only when all
  // streams for the same resource are all suspended.
  virtual bool IsSuspendedByCache() = 0;
  // Returns true if this stream has been suspended.
  virtual bool IsSuspended() = 0;
  // Reads only data which is cached in the media cache. If you try to read
  // any data which overlaps uncached data, or if aCount bytes otherwise can't
  // be read, this function will return failure. This function be called from
  // any thread, and it is the only read operation which is safe to call on
  // the main thread, since it's guaranteed to be non blocking.
  virtual nsresult ReadFromCache(char* aBuffer,
                                 int64_t aOffset,
                                 uint32_t aCount) = 0;
  // Returns true if the resource can be seeked to unbuffered ranges, i.e.
  // for an HTTP network stream this returns true if HTTP1.1 Byte Range
  // requests are supported by the connection/server.
  virtual bool IsTransportSeekable() = 0;

  /**
   * Create a resource, reading data from the channel. Call on main thread only.
   * The caller must follow up by calling resource->Open().
   */
  static already_AddRefed<MediaResource> Create(MediaDecoder* aDecoder, nsIChannel* aChannel);

  /**
   * Open the stream. This creates a stream listener and returns it in
   * aStreamListener; this listener needs to be notified of incoming data.
   */
  virtual nsresult Open(nsIStreamListener** aStreamListener) = 0;

  /**
   * Fills aRanges with MediaByteRanges representing the data which is cached
   * in the media cache. Stream should be pinned during call and while
   * aRanges is being used.
   */
  virtual nsresult GetCachedRanges(nsTArray<MediaByteRange>& aRanges) = 0;

  // Ensure that the media cache writes any data held in its partial block.

  // Return true if the stream is a live stream
  virtual bool IsRealTime() {
    return false;
  }

  virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const {
    return 0;
  }

  virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const {
    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
  }

protected:
  ;

private:
  ;
};

class BaseMediaResource : public MediaResource {
public:
  
  virtual void SetLoadInBackground(bool aLoadInBackground) MOZ_OVERRIDE;

  virtual size_t SizeOfExcludingThis(
                  MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
  {
    // Might be useful to track in the future:
    // - mChannel
    // - mURI (possibly owned, looks like just a ref from mChannel)
    // Not owned:
    // - mDecoder
    size_t size = MediaResource::SizeOfExcludingThis(aMallocSizeOf);
    size += mContentType.SizeOfExcludingThisIfUnshared(aMallocSizeOf);

    return size;
  }

  

protected:
  
  

  

  nsCOMPtr<nsIChannel> mChannel;

  // URI in case the stream needs to be re-opened. Access from
  // main thread only.
  nsCOMPtr<nsIURI> mURI;

  // Content-Type of the channel. This is copied from the nsIChannel when the
  // MediaResource is created. This is constant, so accessing from any thread
  // is safe.
  const nsAutoCString mContentType;

  // True if SetLoadInBackground() has been called with
  // aLoadInBackground = true, i.e. when the document load event is not
  // blocked by this resource, and all channel loads will be in the
  // background.
  bool mLoadInBackground;
};

/**
 * This is the MediaResource implementation that wraps Necko channels.
 * Much of its functionality is actually delegated to MediaCache via
 * an underlying MediaCacheStream.
 *
 * All synchronization is performed by MediaCacheStream; all off-main-
 * thread operations are delegated directly to that object.
 */
class ChannelMediaResource : public BaseMediaResource
{
public:
  ;
  ;
  // Any thread
  virtual void    Pin() MOZ_OVERRIDE;
  virtual void    Unpin() MOZ_OVERRIDE;
  virtual double  GetDownloadRate(bool* aIsReliable) MOZ_OVERRIDE;
  virtual int64_t GetLength() MOZ_OVERRIDE;
  virtual int64_t GetNextCachedData(int64_t aOffset) MOZ_OVERRIDE;
  virtual int64_t GetCachedDataEnd(int64_t aOffset) MOZ_OVERRIDE;
  virtual bool    IsDataCachedToEndOfResource(int64_t aOffset) MOZ_OVERRIDE;
  virtual bool    IsSuspendedByCache() MOZ_OVERRIDE;
  virtual bool    IsSuspended() MOZ_OVERRIDE;
  virtual bool    IsTransportSeekable() MOZ_OVERRIDE;

  virtual size_t SizeOfExcludingThis(
                      MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE {
    // Might be useful to track in the future:
    //   - mListener (seems minor)
    //   - mChannelStatistics (seems minor)
    //     owned if RecordStatisticsTo is not called
    //   - mDataReceivedEvent (seems minor)
    size_t size = BaseMediaResource::SizeOfExcludingThis(aMallocSizeOf);
    size += mCacheStream.SizeOfExcludingThis(aMallocSizeOf);

    return size;
  }

  

  class Listener MOZ_FINAL : public nsIStreamListener,
                             public nsIInterfaceRequestor,
                             public nsIChannelEventSink
  {
    
  public:
    

    NS_DECL_ISUPPORTS
    NS_DECL_NSIREQUESTOBSERVER
    NS_DECL_NSISTREAMLISTENER
    NS_DECL_NSICHANNELEVENTSINK
    NS_DECL_NSIINTERFACEREQUESTOR

    

  private:
    nsRefPtr<ChannelMediaResource> mResource;
  };
  friend class Listener;

  virtual nsresult GetCachedRanges(nsTArray<MediaByteRange>& aRanges) MOZ_OVERRIDE;

  // Any thread access
  MediaCacheStream mCacheStream;

  // This lock protects mChannelStatistics
  Mutex               mLock;
  nsRefPtr<MediaChannelStatistics> mChannelStatistics;

  // True if we couldn't suspend the stream and we therefore don't want
  // to resume later. This is usually due to the channel not being in the
  // isPending state at the time of the suspend request.
  bool mIgnoreResume;

  // Start and end offset of the bytes to be requested.
  MediaByteRange mByteRange;

  // True if the stream can seek into unbuffered ranged, i.e. if the
  // connection supports byte range requests.
  bool mIsTransportSeekable;
};

/**
 * RAII class that handles pinning and unpinning for MediaResource and derived.
 * This should be used when making calculations that involve potentially-cached
 * MediaResource data, so that the state of the world can't change out from under
 * us.
 */
template<class T>
class MOZ_STACK_CLASS AutoPinned {
 public:
  

  

  
  

private:
  T* mResource;
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};

} // namespace mozilla

#endif
# 757 "../../dist/include/MediaResource.h"
# 194 "../../dist/include/MediaDecoder.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/AudioChannelBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/AudioChannelBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_AudioChannelBinding_h
#define mozilla_dom_AudioChannelBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/AudioChannelBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/AudioChannelBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/AudioChannelBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/AudioChannelBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/AudioChannelBinding.h"

namespace mozilla {
namespace dom {

struct NativePropertyHooks;
class ProtoAndIfaceCache;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

enum class AudioChannel : uint32_t {
  Normal,
  Content,
  Notification,
  Alarm,
  Telephony,
  Ringer,
  Publicnotification,
  EndGuard_
};

namespace AudioChannelValues {
extern const EnumEntry strings[8];
} // namespace AudioChannelValues


} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_AudioChannelBinding_h
# 44 "../../dist/include/mozilla/dom/AudioChannelBinding.h"
# 195 "../../dist/include/MediaDecoder.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Rect.h"
#endif /* expanded by -frewrite-includes */
# 196 "../../dist/include/MediaDecoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ReentrantMonitor.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ReentrantMonitor.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_ReentrantMonitor_h
#define mozilla_ReentrantMonitor_h

#if 0 /* expanded by -frewrite-includes */
#include "prmon.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prmon.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef prmon_h___
#define prmon_h___

#if 0 /* expanded by -frewrite-includes */
#include "prtypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prmon.h"
#if 0 /* expanded by -frewrite-includes */
#include "prinrval.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prmon.h"

PR_BEGIN_EXTERN_C

typedef struct PRMonitor PRMonitor;

/*
** Create a new monitor. Monitors are re-entrant locks with a single built-in
** condition variable.
**
** This may fail if memory is tight or if some operating system resource
** is low.
*/
NSPR_API(PRStatus) PR_Notify(PRMonitor *mon);

/*
** Notify all of the threads waiting on the monitor's condition variable.
** All of threads waiting on the condition are scheduled to reenter the
** monitor.
*/
NSPR_API(PRStatus) PR_NotifyAll(PRMonitor *mon);

/*
** PR_ASSERT_CURRENT_THREAD_IN_MONITOR
** If the current thread is in |mon|, this assertion is guaranteed to
** succeed.  Otherwise, the behavior of this function is undefined.
*/
#if defined(DEBUG) || defined(FORCE_PR_ASSERT)
#define PR_ASSERT_CURRENT_THREAD_IN_MONITOR(/* PRMonitor* */ mon) \
    PR_AssertCurrentThreadInMonitor(mon)
#else
# 88 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prmon.h"
#define PR_ASSERT_CURRENT_THREAD_IN_MONITOR(/* PRMonitor* */ mon)
#endif
# 90 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prmon.h"

/* Don't call this function directly. */
NSPR_API(void) PR_AssertCurrentThreadInMonitor(PRMonitor *mon);

PR_END_EXTERN_C

#endif /* prmon_h___ */
# 97 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prmon.h"
# 11 "../../dist/include/mozilla/ReentrantMonitor.h" 2

//  - ReentrantMonitor, a Java-like monitor
//  - ReentrantMonitorAutoEnter, an RAII class for ensuring that
//    ReentrantMonitors are properly entered and exited
//
// Using ReentrantMonitorAutoEnter is MUCH preferred to making bare calls to
// ReentrantMonitor.Enter and Exit.
//
namespace mozilla {


/**
 * ReentrantMonitor
 * Java-like monitor.
 * When possible, use ReentrantMonitorAutoEnter to hold this monitor within a
 * scope, instead of calling Enter/Exit directly.
 **/
class ReentrantMonitor : BlockingResourceBase
{
public:
  /**
   * ReentrantMonitor
   * @param aName A name which can reference this monitor
   */
  

  /**
   * ~ReentrantMonitor
   **/
  

#ifndef DEBUG
  /**
   * Enter
   * @see prmon.h
   **/
  void Enter() { PR_EnterMonitor(mReentrantMonitor); }

  /**
   * Exit
   * @see prmon.h
   **/
  void Exit() { PR_ExitMonitor(mReentrantMonitor); }

  /**
   * Wait
   * @see prmon.h
   **/
  

#else // ifndef DEBUG
# 96 "../../dist/include/mozilla/ReentrantMonitor.h"
  void Enter();
  void Exit();
  nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TIMEOUT);

#endif  // ifndef DEBUG
# 101 "../../dist/include/mozilla/ReentrantMonitor.h"

  /**
   * Notify
   * @see prmon.h
   **/
  nsresult Notify()
  {
    return PR_Notify(mReentrantMonitor) == PR_SUCCESS ? NS_OK :
                                                        NS_ERROR_FAILURE;
  }

  /**
   * NotifyAll
   * @see prmon.h
   **/
  nsresult NotifyAll()
  {
    return PR_NotifyAll(mReentrantMonitor) == PR_SUCCESS ? NS_OK :
                                                           NS_ERROR_FAILURE;
  }

#ifdef DEBUG
  /**
   * AssertCurrentThreadIn
   * @see prmon.h
   **/
  void AssertCurrentThreadIn()
  {
    PR_ASSERT_CURRENT_THREAD_IN_MONITOR(mReentrantMonitor);
  }

  /**
   * AssertNotCurrentThreadIn
   * @see prmon.h
   **/
  void AssertNotCurrentThreadIn()
  {
    // FIXME bug 476536
  }

#else
# 142 "../../dist/include/mozilla/ReentrantMonitor.h"
  
  

#endif  // ifdef DEBUG
# 146 "../../dist/include/mozilla/ReentrantMonitor.h"

private:
  ;
  ;
  ReentrantMonitor& operator=(const ReentrantMonitor&);

  PRMonitor* mReentrantMonitor;
#ifdef DEBUG
  int32_t mEntryCount;
#endif
# 156 "../../dist/include/mozilla/ReentrantMonitor.h"
};


/**
 * ReentrantMonitorAutoEnter
 * Enters the ReentrantMonitor when it enters scope, and exits it when
 * it leaves scope.
 *
 * MUCH PREFERRED to bare calls to ReentrantMonitor.Enter and Exit.
 */
class MOZ_STACK_CLASS ReentrantMonitorAutoEnter
{
public:
  /**
   * Constructor
   * The constructor aquires the given lock.  The destructor
   * releases the lock.
   *
   * @param aReentrantMonitor A valid mozilla::ReentrantMonitor*.
   **/
  explicit ReentrantMonitorAutoEnter(mozilla::ReentrantMonitor& aReentrantMonitor)
    : mReentrantMonitor(&aReentrantMonitor)
  {
    NS_ASSERTION(mReentrantMonitor, "null monitor");
    mReentrantMonitor->Enter();
  }

  ~ReentrantMonitorAutoEnter(void)
  {
    mReentrantMonitor->Exit();
  }

  nsresult Wait(PRIntervalTime aInterval = PR_INTERVAL_NO_TIMEOUT)
  {
    return mReentrantMonitor->Wait(aInterval);
  }

  nsresult Notify() { return mReentrantMonitor->Notify(); }
  nsresult NotifyAll() { return mReentrantMonitor->NotifyAll(); }

private:
  ReentrantMonitorAutoEnter();
  ;
  ;
  static void* operator new(size_t) CPP_THROW_NEW;

  mozilla::ReentrantMonitor* mReentrantMonitor;
};

/**
 * ReentrantMonitorAutoExit
 * Exit the ReentrantMonitor when it enters scope, and enters it when it leaves
 * scope.
 *
 * MUCH PREFERRED to bare calls to ReentrantMonitor.Exit and Enter.
 */
class MOZ_STACK_CLASS ReentrantMonitorAutoExit
{
public:
  /**
   * Constructor
   * The constructor releases the given lock.  The destructor
   * acquires the lock. The lock must be held before constructing
   * this object!
   *
   * @param aReentrantMonitor A valid mozilla::ReentrantMonitor*. It
   *                 must be already locked.
   **/
  

  

private:
  ;
  ;
  ;
  static void* operator new(size_t) CPP_THROW_NEW;

  ReentrantMonitor* mReentrantMonitor;
};

} // namespace mozilla


#endif // ifndef mozilla_ReentrantMonitor_h
# 250 "../../dist/include/mozilla/ReentrantMonitor.h"
# 197 "../../dist/include/MediaDecoder.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "MediaStreamGraph.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/MediaStreamGraph.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_MEDIASTREAMGRAPH_H_
#define MOZILLA_MEDIASTREAMGRAPH_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Mutex.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/MediaStreamGraph.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/LinkedList.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/MediaStreamGraph.h"
#if 0 /* expanded by -frewrite-includes */
#include "AudioStream.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/AudioStream.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#if !defined(AudioStream_h_)
#define AudioStream_h_

#if 0 /* expanded by -frewrite-includes */
#include "AudioSampleFormat.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/AudioSampleFormat.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef MOZILLA_AUDIOSAMPLEFORMAT_H_
#define MOZILLA_AUDIOSAMPLEFORMAT_H_

#if 0 /* expanded by -frewrite-includes */
#include "nsAlgorithm.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/AudioSampleFormat.h"
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/AudioSampleFormat.h"

namespace mozilla {

/**
 * Audio formats supported in MediaStreams and media elements.
 *
 * Only one of these is supported by AudioStream, and that is determined
 * at compile time (roughly, FLOAT32 on desktops, S16 on mobile). Media decoders
 * produce that format only; queued AudioData always uses that format.
 */
enum AudioSampleFormat
{
  // Native-endian signed 16-bit audio samples
  AUDIO_FORMAT_S16,
  // Signed 32-bit float samples
  AUDIO_FORMAT_FLOAT32,
  // Silence: format will be chosen later
  AUDIO_FORMAT_SILENCE,
  // The format used for output by AudioStream.
#ifdef MOZ_SAMPLE_TYPE_S16
  AUDIO_OUTPUT_FORMAT = AUDIO_FORMAT_S16
#else
# 33 "../../dist/include/AudioSampleFormat.h"
  AUDIO_OUTPUT_FORMAT = AUDIO_FORMAT_FLOAT32
#endif
# 35 "../../dist/include/AudioSampleFormat.h"
};

enum {
  MAX_AUDIO_SAMPLE_SIZE = sizeof(float)
};

template <AudioSampleFormat Format> class AudioSampleTraits;

template <> class AudioSampleTraits<AUDIO_FORMAT_FLOAT32> {
public:
  typedef float Type;
};
template <> class AudioSampleTraits<AUDIO_FORMAT_S16> {
public:
  typedef int16_t Type;
};

typedef AudioSampleTraits<AUDIO_OUTPUT_FORMAT>::Type AudioDataValue;

template<typename T> class AudioSampleTypeToFormat;

template <> class AudioSampleTypeToFormat<float> {
public:
  static const AudioSampleFormat Format = AUDIO_FORMAT_FLOAT32;
};

template <> class AudioSampleTypeToFormat<short> {
public:
  static const AudioSampleFormat Format = AUDIO_FORMAT_S16;
};

// Single-sample conversion
/*
 * Use "2^N" conversion since it's simple, fast, "bit transparent", used by
 * many other libraries and apparently behaves reasonably.
 * http://blog.bjornroche.com/2009/12/int-float-int-its-jungle-out-there.html
 * http://blog.bjornroche.com/2009/12/linearity-and-dynamic-range-in-int.html
 */



// In place audio sample scaling.




inline const void*
AddAudioSampleOffset(const void* aBase, AudioSampleFormat aFormat,
                     int32_t aOffset)
{
  static_assert(AUDIO_FORMAT_S16 == 0, "Bad constant");
  static_assert(AUDIO_FORMAT_FLOAT32 == 1, "Bad constant");
  NS_ASSERTION(aFormat == AUDIO_FORMAT_S16 || aFormat == AUDIO_FORMAT_FLOAT32,
               "Unknown format");

  return static_cast<const uint8_t*>(aBase) + (aFormat + 1)*2*aOffset;
}

} // namespace mozilla

#endif /* MOZILLA_AUDIOSAMPLEFORMAT_H_ */
# 184 "../../dist/include/AudioSampleFormat.h"
# 10 "../../dist/include/AudioStream.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/AudioStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/AudioStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/AudioStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "CubebUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/CubebUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#if !defined(CubebUtils_h_)
#define CubebUtils_h_

#if 0 /* expanded by -frewrite-includes */
#include "cubeb/cubeb.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/cubeb/cubeb.h" 1
/*
 * Copyright © 2011 Mozilla Foundation
 *
 * This program is made available under an ISC-style license.  See the
 * accompanying file LICENSE for details.
 */
#if !defined(CUBEB_c2f983e9_c96f_e71c_72c3_bbf62992a382)
#define CUBEB_c2f983e9_c96f_e71c_72c3_bbf62992a382

#if 0 /* expanded by -frewrite-includes */
#include <cubeb/cubeb-stdint.h>
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/cubeb/cubeb-stdint.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 6 "../../dist/include/cubeb/cubeb-stdint.h"
# 11 "../../dist/include/cubeb/cubeb.h" 2

#if defined(__cplusplus)
extern "C" {
#endif
# 15 "../../dist/include/cubeb/cubeb.h"

/** @mainpage

    @section intro Introduction

    This is the documentation for the <tt>libcubeb</tt> C API.
    <tt>libcubeb</tt> is a callback-based audio API library allowing the
    authoring of portable multiplatform audio playback.

    @section example Example code

      for (i = 0; i < nframes; ++i) {
        for (c = 0; c < params.channels; ++c) {
          buf[i][c] = 0;
        }
      }
      return nframes;
    }
    @endcode

    @code
    void state_cb(cubeb_stream * stm, void * user, cubeb_state state)
    {
      printf("state=%d\n", state);
    }
    @endcode
*/

/** @file
    The <tt>libcubeb</tt> C API. */

typedef struct cubeb cubeb;               /**< Opaque handle referencing the application state. */
typedef struct cubeb_stream cubeb_stream; /**< Opaque handle referencing the stream state. */

/** Sample format enumeration. */
typedef enum {
  /**< Little endian 16-bit signed PCM. */
  CUBEB_SAMPLE_S16LE,
  /**< Big endian 16-bit signed PCM. */
  CUBEB_SAMPLE_S16BE,
  /**< Little endian 32-bit IEEE floating point PCM. */
  CUBEB_SAMPLE_FLOAT32LE,
  /**< Big endian 32-bit IEEE floating point PCM. */
  CUBEB_SAMPLE_FLOAT32BE,
#if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__)
  /**< Native endian 16-bit signed PCM. */
  CUBEB_SAMPLE_S16NE = CUBEB_SAMPLE_S16BE,
  /**< Native endian 32-bit IEEE floating point PCM. */
  CUBEB_SAMPLE_FLOAT32NE = CUBEB_SAMPLE_FLOAT32BE
#else
# 96 "../../dist/include/cubeb/cubeb.h"
  /**< Native endian 16-bit signed PCM. */
  CUBEB_SAMPLE_S16NE = CUBEB_SAMPLE_S16LE,
  /**< Native endian 32-bit IEEE floating point PCM. */
  CUBEB_SAMPLE_FLOAT32NE = CUBEB_SAMPLE_FLOAT32LE
#endif
# 101 "../../dist/include/cubeb/cubeb.h"
} cubeb_sample_format;

#if defined(__ANDROID__)
typedef enum {
    CUBEB_STREAM_TYPE_VOICE_CALL = 0,
    CUBEB_STREAM_TYPE_SYSTEM = 1,
    CUBEB_STREAM_TYPE_RING = 2,
    CUBEB_STREAM_TYPE_MUSIC = 3,
    CUBEB_STREAM_TYPE_ALARM = 4,
    CUBEB_STREAM_TYPE_NOTIFICATION = 5,
    CUBEB_STREAM_TYPE_BLUETOOTH_SCO = 6,
    CUBEB_STREAM_TYPE_SYSTEM_ENFORCED = 7,
    CUBEB_STREAM_TYPE_DTMF = 8,
    CUBEB_STREAM_TYPE_TTS = 9,
    CUBEB_STREAM_TYPE_FM = 10,

    CUBEB_STREAM_TYPE_MAX
} cubeb_stream_type;
#endif
# 120 "../../dist/include/cubeb/cubeb.h"

/** Stream format initialization parameters. */
typedef struct {
  cubeb_sample_format format; /**< Requested sample format.  One of
                                   #cubeb_sample_format. */
  unsigned int rate;          /**< Requested sample rate.  Valid range is [1000, 192000]. */
  unsigned int channels;      /**< Requested channel count.  Valid range is [1, 8]. */
#if defined(__ANDROID__)
  cubeb_stream_type stream_type; /**< Used to map Android audio stream types */
#endif
# 130 "../../dist/include/cubeb/cubeb.h"
} cubeb_stream_params;

/** Output device description */
typedef struct {
  char * output_name; /**< The name of the output device */
  char * input_name; /**< The name of the input device */
} cubeb_device;

/** Stream states signaled via state_callback. */
typedef enum {
  CUBEB_STATE_STARTED, /**< Stream started. */
  CUBEB_STATE_STOPPED, /**< Stream stopped. */
  CUBEB_STATE_DRAINED, /**< Stream drained. */
  CUBEB_STATE_ERROR    /**< Stream disabled due to error. */
} cubeb_state;

/**
 * User supplied callback called when the underlying device changed.
 * @param user */
typedef void (* cubeb_device_changed_callback)(void * user_ptr);

/** Initialize an application context.  This will perform any library or
    application scoped initialization.
    @param context
    @param context_name
;

/** Get the minimal latency value, in milliseconds, that is guaranteed to work
    when creating a stream for the specified sample rate. This is platform and
    backend dependant.
    @param context
    @param user_ptr
    @retval CUBEB_OK
    @retval CUBEB_ERROR
    @retval CUBEB_ERROR_INVALID_FORMAT */
;

/** Destroy a stream.
    @param stream */
void cubeb_stream_destroy(cubeb_stream * stream);

/** Start playback.
    @param stream
    @retval CUBEB_OK
    @retval CUBEB_ERROR */
;

/** Stop playback.
    @param stream
    @retval CUBEB_OK
    @retval CUBEB_ERROR */
;

/** Get the current stream playback position.
    @param stream
    @param position Playback position in frames.
    @retval CUBEB_OK
    @retval CUBEB_ERROR */

#if defined(__cplusplus)
}
#endif
# 343 "../../dist/include/cubeb/cubeb.h"

#endif /* CUBEB_c2f983e9_c96f_e71c_72c3_bbf62992a382 */
# 345 "../../dist/include/cubeb/cubeb.h"
# 11 "../../dist/include/CubebUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/AudioChannelBinding.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/CubebUtils.h"

namespace mozilla {
namespace CubebUtils {

// Initialize Audio Library. Some Audio backends require initializing the
// library before using it.
;

// Shutdown Audio Library. Some Audio backends require shutting down the
// library after using it.
;

// Returns the maximum number of channels supported by the audio hardware.
;

// Queries the samplerate the hardware/mixer runs at, and stores it.
// Can be called on any thread. When this returns, it is safe to call
// PreferredSampleRate.

} // namespace CubebUtils
} // namespace mozilla

#endif // CubebUtils_h_
# 50 "../../dist/include/CubebUtils.h"
# 18 "../../dist/include/AudioStream.h" 2

namespace soundtouch {
class SoundTouch;
}

namespace mozilla {

struct CubebDestroyPolicy
{

  

  

private:
  nsAutoArrayPtr<uint8_t> mBuffer;
  uint32_t mCapacity;
  uint32_t mStart;
  uint32_t mCount;
};

class AudioInitTask;

// Access to a single instance of this class must be synchronized by
// callers, or made from a single thread.  One exception is that access to
// GetPosition, GetPositionInFrames, SetVolume, and Get{Rate,Channels},
// SetMicrophoneActive is thread-safe without external synchronization.
class AudioStream MOZ_FINAL
{
  virtual ~AudioStream();

public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AudioStream)
  ;

  enum LatencyRequest {
    HighLatency,
    LowLatency
  };

  // Initialize the audio stream. aNumChannels is the number of audio
  // channels (1 for mono, 2 for stereo, etc) and aRate is the sample rate
  // (22050Hz, 44100Hz, etc).
  ;

  // Closes the stream. All future use of the stream is an error.
  ;

  ;

  // pending AudioInitTask is finished.
  bool mPendingAudioInitTask;
  // The last good position returned by cubeb_stream_get_position(). Used to
  // check if the cubeb position is going backward.
  uint64_t mLastGoodPosition;
};

class AudioInitTask : public nsRunnable
{
public:
  

  

protected:
  ;

private:
  NS_IMETHOD Run() MOZ_OVERRIDE MOZ_FINAL;

  RefPtr<AudioStream> mAudioStream;
  AudioStream::LatencyRequest mLatencyRequest;
  cubeb_stream_params mParams;

  nsCOMPtr<nsIThread> mThread;
};

} // namespace mozilla

#endif
# 446 "../../dist/include/AudioStream.h"
# 12 "../../dist/include/MediaStreamGraph.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/MediaStreamGraph.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIRunnable.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/MediaStreamGraph.h"
#if 0 /* expanded by -frewrite-includes */
#include "StreamBuffer.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/MediaStreamGraph.h"
#if 0 /* expanded by -frewrite-includes */
#include "TimeVarying.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/TimeVarying.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_TIMEVARYING_H_
#define MOZILLA_TIMEVARYING_H_

#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/TimeVarying.h"

namespace mozilla {

/**
 * This is just for CTOR/DTOR tracking. We can't put this in
 * TimeVarying directly because the different template instances have
 * different sizes and that confuses things.
 */
class TimeVaryingBase {
protected:
  
  ~TimeVaryingBase()
  {
    MOZ_COUNT_DTOR(TimeVaryingBase);
  }
};

/**
 * Objects of this class represent values that can change over time ---
 * a mathematical function of time.
 * Time is the type of time values, T is the value that changes over time.
 * There are a finite set of "change times"; at each change time, the function
 * instantly changes to a new value. ReservedChanges should be set to the
 * expected number of change events that the object is likely to contain.
 * This value should be 0 for all consumers unless you know that a higher value
 * would be a benefit.
 * There is also a "current time" which must always advance (not go backward).
 * The function is constant for all times less than the current time.
 * When the current time is advanced, the value of the function at the new
 * current time replaces the values for all previous times.
 *
 * The implementation records a mCurrent (the value at the current time)
 * and an array of "change times" (greater than the current time) and the
 * new value for each change time. This is a simple but dumb implementation.
 * We maintain the invariant that each change entry in the array must have
 * a different value to the value in the previous change entry (or, for
 * the first change entry, mCurrent).
 */
template <typename Time, typename T, uint32_t ReservedChanges>
class TimeVarying : public TimeVaryingBase {
public:
  
  /**
   * Make all currently pending changes happen aDelta later than their
   * current change times.
   */
  

  /**
   * Replace the values of this function at aTimeOffset and later with the
   * values of aOther taken from zero, so if aOther is V at time T >= 0
   * then this function will be V at time T + aTimeOffset. aOther's current
   * time must be >= 0.
   */
  

  

private:
  struct Entry {
    Entry(Time aTime, const T& aValue) : mTime(aTime), mValue(aValue) {}

    // The time at which the value changes to mValue
    Time mTime;
    T mValue;
  };
  nsAutoTArray<Entry, ReservedChanges> mChanges;
  T mCurrent;
};

}

#endif /* MOZILLA_TIMEVARYING_H_ */
# 238 "../../dist/include/TimeVarying.h"
# 16 "../../dist/include/MediaStreamGraph.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "VideoFrameContainer.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/VideoFrameContainer.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef VIDEOFRAMECONTAINER_H_
#define VIDEOFRAMECONTAINER_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Mutex.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/VideoFrameContainer.h"

namespace mozilla {

namespace dom {
class HTMLMediaElement;
}

namespace layers {
class Image;
class ImageContainer;
}

/**
 * This object is used in the decoder backend threads and the main thread
 * to manage the "current video frame" state. This state includes timing data
 * and an intrinsic size (see below).
 * This has to be a thread-safe object since it's accessed by resource decoders
 * and other off-main-thread components. So we can't put this state in the media
 * element itself ... well, maybe we could, but it could be risky and/or
 * confusing.
 */
class VideoFrameContainer {
  ~VideoFrameContainer();

public:
  typedef layers::ImageContainer ImageContainer;
  typedef layers::Image Image;

  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoFrameContainer)

  ;
  // called. When set, the next call to Invalidate() will ensure that the
  // frame is fully invalidated instead of just invalidating for the image change
  // in the ImageLayer.
  bool mImageSizeChanged;
};

}

#endif /* VIDEOFRAMECONTAINER_H_ */
# 105 "../../dist/include/VideoFrameContainer.h"
# 17 "../../dist/include/MediaStreamGraph.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "VideoSegment.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/VideoSegment.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_VIDEOSEGMENT_H_
#define MOZILLA_VIDEOSEGMENT_H_

#if 0 /* expanded by -frewrite-includes */
#include "MediaSegment.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/VideoSegment.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/VideoSegment.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxPoint.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/VideoSegment.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/VideoSegment.h"
#if 0 /* expanded by -frewrite-includes */
#include "ImageContainer.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/ImageContainer.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_IMAGECONTAINER_H
#define GFX_IMAGECONTAINER_H

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>                     // for uint32_t, uint8_t, uint64_t
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/ImageContainer.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>                  // for int32_t
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/ImageContainer.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/ImageContainer.h"
#if 0 /* expanded by -frewrite-includes */
#include "ImageTypes.h"                 // for ImageFormat, etc
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/ImageContainer.h"
# 21 "../../dist/include/ImageContainer.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoRef.h"                  // for nsCountedRef
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsAutoRef.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsAutoRef_h_
#define nsAutoRef_h_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsAutoRef.h"

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h" // for nullptr, bool
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsAutoRef.h"

template <class T> class nsSimpleRef;
template <class T> class nsAutoRefBase;
template <class T> class nsReturnRef;
template <class T> class nsReturningRef;

/**
 * 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 ref-counted resources see also |nsCountedRef<T>|.
 * For function return values see |nsReturnRef<T>|.
 *
 * For each class |T|, |nsAutoRefTraits<T>| or |nsSimpleRef<T>| must be
 * specialized to use |nsAutoRef<T>| and |nsCountedRef<T>|.
 *     fd1.own(open("/proc/1/maps");
 *
 *     // On destruction, fd1 closes /proc/1/maps and fd2 closes /etc/hosts,
 *     // but /etc/passwd is not closed.
 * }
 *
 */


template <class T>
class nsAutoRef : public nsAutoRefBase<T>
{
protected:
  typedef nsAutoRef<T> ThisClass;
  typedef nsAutoRefBase<T> BaseClass;

private:
  // No copy constructor
  ;
};

/**
 * template <class T> class nsCountedRef
 *
 * A class that creates (adds) a new reference to a resource on construction
 * or assignment and releases on destruction.
 *
 * This class is similar to nsAutoRef<T> and inherits its methods, but also
 * provides copy construction and assignment operators that enable more than
 * one concurrent reference to the same resource.
 *
 * Specialize |nsAutoRefTraits<T>| or |nsSimpleRef<T>| to use this.  This
 * class assumes that the resource itself counts references and so can only be
 * used when |T| represents a reference-counting resource.
 */

template <class T>
class nsCountedRef : public nsAutoRef<T>
{
protected:
  typedef nsCountedRef<T> ThisClass;
  typedef nsAutoRef<T> BaseClass;
  typedef nsSimpleRef<T> SimpleRef;
  typedef typename BaseClass::RawRef RawRef;

public:
  

protected:
  // Increase the reference count if there is a resource.
  
};

/**
 * template <class T> class nsReturnRef
 *
 * A type for function return values that hold a reference to a resource that
 * must be released.  See also |nsAutoRef<T>::out()|.
 */

template <class T>
class nsReturnRef : public nsAutoRefBase<T>
{
protected:
  typedef nsAutoRefBase<T> BaseClass;
  typedef typename BaseClass::RawRefOnly RawRefOnly;

public:
  // For constructing a return value with no resource
  

  // For returning a smart reference from a raw reference that must be
  // released.  Explicit construction is required so as not to risk
  // unintentionally releasing the resource associated with a raw ref.
  MOZ_IMPLICIT 

  // Copy construction transfers ownership
  

  MOZ_IMPLICIT 

  // Conversion to a temporary (const) object referring to this object so
  // that the reference may be passed from a function return value
  // (temporary) to another smart reference.  There is no need to use this
  // explicitly.  Simply assign a nsReturnRef<T> function return value to a
  // smart reference.
  

  // No conversion to RawRef operator is provided on nsReturnRef, to ensure
  // that the return value is not carelessly assigned to a raw ptr (and the
  // resource then released).  If passing to a function that takes a raw
  // ptr, use get or disown as appropriate.
};


template <class T> class nsAutoRefTraits;

/**
 * template <class T> class nsPointerRefTraits
 *
 * A convenience class useful as a base class for specializations of
 * |nsAutoRefTraits<T>| where the handle to the resource is a pointer to |T|.
 * By inheriting from this class, definitions of only Release(RawRef) and
 * possibly AddRef(RawRef) need to be added.
 *
 * Examples of use:
 *
 * template <>
 * class nsAutoRefTraits<PRFileDesc> : public nsPointerRefTraits<PRFileDesc>
 * {
 * public:
 *     static void Release(PRFileDesc *ptr) { PR_Close(ptr); }
 * };
 *
 * template <>
 * class nsAutoRefTraits<FcPattern> : public nsPointerRefTraits<FcPattern>
 * {
 * public:
 *     static void Release(FcPattern *ptr) { FcPatternDestroy(ptr); }
 *     static void AddRef(FcPattern *ptr) { FcPatternReference(ptr); }
 * };
 */

template <class T>
class nsPointerRefTraits
{
public:
  // The handle is a pointer to T.
  typedef T* RawRef;
  // A nullptr does not have a resource.
  
};

/**
 * template <class T> class nsSimpleRef
 *
 * Constructs a non-smart reference, and provides methods to test whether
 * there is an associated resource and (if so) get its raw handle.
 *
 * A default implementation is suitable for resources with handles that have a
 * void value.  This is not intended for direct use but used by |nsAutoRef<T>|
 * and thus |nsCountedRef<T>|.
 *
 * Specialize this class if there is no particular void value for the resource
 * handle.  A specialized implementation must also provide Release(RawRef),
 * and, if |nsCountedRef<T>| is required, AddRef(RawRef), as described in
 * nsAutoRefTraits<T>.
 */

template <class T>
class nsSimpleRef : protected nsAutoRefTraits<T>
{
protected:
  // The default implementation uses nsAutoRefTrait<T>.
  // Specializations need not define this typedef.
  typedef nsAutoRefTraits<T> Traits;
  // The type of the handle to the resource.
  // A specialization must provide a typedef for RawRef.
  typedef typename Traits::RawRef RawRef;

  // Construct with no resource.
  //
  // If this constructor is not accessible then some limited nsAutoRef
  // functionality will still be available, but the default constructor,
  // |reset|, and most transfer of ownership methods will not be available.
  
  // Construct with a handle to a resource.
  // A specialization must provide this.
  

  // Test whether there is an associated resource.  A specialization must
  // provide this.  The function is permitted to always return true if the
  // default constructor is not accessible, or if Release (and AddRef) can
  // deal with void handles.
};


/**
 * template <class T> class nsAutoRefBase
 *
 * Internal base class for |nsAutoRef<T>| and |nsReturnRef<T>|.
 * Adds release on destruction to a |nsSimpleRef<T>|.
 */

template <class T>
class nsAutoRefBase : public nsSimpleRef<T>
{
protected:
  typedef nsAutoRefBase<T> ThisClass;
  typedef nsSimpleRef<T> SimpleRef;
  typedef typename SimpleRef::RawRef RawRef;

  

  // A type for parameters that should be passed a raw ref but should not
  // accept implicit conversions (from another smart ref).  (The only
  // conversion to this type is from a raw ref so only raw refs will be
  // accepted.)
  class RawRefOnly
  {
  public:
    MOZ_IMPLICIT 
    
  private:
    RawRef mRawRef;
  };

  // Construction from a raw ref assumes ownership
  

  // Constructors that steal ownership
  
  

  

  // An internal class providing access to protected nsSimpleRef<T>
  // constructors for construction of temporary simple references (that are
  // not ThisClass).
  class LocalSimpleRef : public SimpleRef
  {
  public:
    
    explicit LocalSimpleRef(RawRef aRawRef)
      : SimpleRef(aRawRef)
    {
    }
  };

private:
  ThisClass& operator=(const ThisClass& aSmartRef) = delete;

public:
  RawRef operator->() const
  {
    return this->get();
  }

  // Transfer ownership to a raw reference.
  //
  // THE CALLER MUST ENSURE THAT THE REFERENCE IS EXPLICITLY RELEASED.
  //
  // Is this really what you want to use?  Using this removes any guarantee
  // of release.  Use nsAutoRef<T>::out() for return values, or an
  // nsAutoRef<T> modifiable lvalue for an out parameter.  Use disown() when
  // the reference must be stored in a POD type object, such as may be
  // preferred for a namespace-scope object with static storage duration,
  // for example.
  RawRef disown()
  {
    RawRef temp = this->get();
    LocalSimpleRef empty;
    SimpleRef::operator=(empty);
    return temp;
  }

protected:
  // steal and own are protected because they make no sense on nsReturnRef,
  // but steal is implemented on this class for access to aOtherRef.disown()
  // when aOtherRef is an nsReturnRef;

  // Transfer ownership from another smart reference.
  void steal(ThisClass& aOtherRef)
  {
    own(aOtherRef.disown());
  }
  // Assume ownership of a raw ref.
  void own(RawRefOnly aRefToRelease)
  {
    SafeRelease();
    LocalSimpleRef ref(aRefToRelease);
    SimpleRef::operator=(ref);
  }

  // Release a resource if there is one.
  void SafeRelease()
  {
    if (this->HaveResource()) {
      this->Release(this->get());
    }
  }
};

#endif // !defined(nsAutoRef_h_)
# 673 "../../dist/include/nsAutoRef.h"
# 22 "../../dist/include/ImageContainer.h" 2

#ifndef XPCOM_GLUE_AVOID_NSPR
/**
 * We need to be able to hold a reference to a Moz2D SourceSurface from Image
 * subclasses. This is potentially a problem since Images can be addrefed
 * or released off the main thread. We can ensure that we never AddRef
 * a SourceSurface off the main thread, but we might want to Release due
 * to an Image being destroyed off the main thread.
 *
 * We use nsCountedRef<nsMainThreadSourceSurfaceRef> to reference the
 * SourceSurface. When AddRefing, we assert that we're on the main thread.
 * When Releasing, if we're not on the main thread, we post an event to
 * the main thread to do the actual release.
 */
class nsMainThreadSourceSurfaceRef;

template <>
class nsAutoRefTraits<nsMainThreadSourceSurfaceRef> {
public:
  typedef mozilla::gfx::SourceSurface* RawRef;

  /**
   * The XPCOM event that will do the actual release on the main thread.
   */
  class SurfaceReleaser : public nsRunnable {
  public:
    explicit SurfaceReleaser(RawRef aRef) : mRef(aRef) {}
    NS_IMETHOD Run() {
      mRef->Release();
      return NS_OK;
    }
    RawRef mRef;
  };

  static RawRef Void() { return nullptr; }
  static void Release(RawRef aRawRef)
  {
    if (NS_IsMainThread()) {
      aRawRef->Release();
      return;
    }
    nsCOMPtr<nsIRunnable> runnable = new SurfaceReleaser(aRawRef);
    NS_DispatchToMainThread(runnable);
  }
  static void AddRef(RawRef aRawRef)
  {
    NS_ASSERTION(NS_IsMainThread(),
                 "Can only add a reference on the main thread");
    aRawRef->AddRef();
  }
};

#endif
# 87 "../../dist/include/ImageContainer.h"

#ifdef XP_WIN
struct ID3D10Texture2D;
struct ID3D10Device;
struct ID3D10ShaderResourceView;
#endif
# 93 "../../dist/include/ImageContainer.h"

typedef void* HANDLE;

namespace mozilla {

class CrossProcessMutex;

namespace layers {

class ImageClient;
class SharedPlanarYCbCrImage;
class TextureClient;
class CompositableClient;
class CompositableForwarder;
class SurfaceDescriptor;
class GrallocImage;

struct ImageBackendData
{
  virtual ~ImageBackendData() {}

protected:
  ImageBackendData() {}
};

// sadly we'll need this until we get rid of Deprected image classes
class ISharedImage {
public:
    virtual uint8_t* GetBuffer() = 0;

    /**
     * For use with the CompositableClient only (so that the later can
     * synchronize the TextureClient with the TextureHost).
     */
    virtual TextureClient* GetTextureClient(CompositableClient* aClient) = 0;
};

/**
 * A class representing a buffer of pixel data. The data can be in one
 * of various formats including YCbCr.
 * 
 * Create an image using an ImageContainer. Fill the image with data, and
 * then call ImageContainer::SetImage to display it. An image must not be
 * modified after calling SetImage. Image implementations do not need to
 * perform locking; when filling an Image, the Image client is responsible
 * for ensuring only one thread accesses the Image at a time, and after
 * SetImage the image is immutable.
 * 
 * When resampling an Image, only pixels within the buffer should be
 * sampled. For example, cairo images should be sampled in EXTEND_PAD mode.
 */
class Image {
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(Image)

public:
  virtual ISharedImage* AsSharedImage() { return nullptr; }

  ImageFormat GetFormat() { return mFormat; }
  void* GetImplData() { return mImplData; }

  virtual gfx::IntSize GetSize() = 0;
  virtual nsIntRect GetPictureRect()
  {
    return nsIntRect(0, 0, GetSize().width, GetSize().height);
  }

  
  

  

  
  

  ;

  virtual GrallocImage* AsGrallocImage()
  {
    return nullptr;
  }

protected:
  

  // Protected destructor, to discourage deletion outside of Release():
  virtual ~Image() {}

  mozilla::EnumeratedArray<mozilla::layers::LayersBackend,
                           mozilla::layers::LayersBackend::LAYERS_LAST,
                           nsAutoPtr<ImageBackendData>>
    mBackendData;

  void* mImplData;
  int32_t mSerial;
  ImageFormat mFormat;
  static mozilla::Atomic<int32_t> sSerialCounter;
  bool mSent;
};

/**
 * A RecycleBin is owned by an ImageContainer. We store buffers in it that we
 * want to recycle from one image to the next.It's a separate object from 
 * ImageContainer because images need to store a strong ref to their RecycleBin
 * and we must avoid creating a reference loop between an ImageContainer and
 * its active image.
  
  virtual ~ImageFactory() {}

  ;

};
 
/**
 * A class that manages Images for an ImageLayer. The only reason
 * we need a separate class here is that ImageLayers aren't threadsafe
 * updates the shared state to point to the new image and the old image
 * is immediately released (not true in Normal or Asynchronous modes).
 */
class ImageContainer MOZ_FINAL : public SupportsWeakPtr<ImageContainer> {
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ImageContainer)
public:
  MOZ_DECLARE_REFCOUNTED_TYPENAME(ImageContainer)

  enum { DISABLE_ASYNC = 0x0, ENABLE_ASYNC = 0x01 };

  ;

  /**
   * Create an Image in one of the given formats.
   * Picks the "best" format from the list and creates an Image of that
   * format.
  /**
   * Increments mPaintCount if this is the first time aPainted has been
   * painted, and sets mPaintTime if the painted image is the current image.
   * current image.  Can be called from any thread.
   */
  

  

private:
  typedef mozilla::ReentrantMonitor ReentrantMonitor;

  // Private destructor, to discourage deletion outside of Release():
  ~ImageContainer();

  ;
  nsDataHashtable<nsUint32HashKey, RefPtr<TextureClient> >  mTextureClients;
};

#ifdef MOZ_WIDGET_GONK
class OverlayImage : public Image {
  /**
   * OverlayImage is a special Image type that does not hold any buffer.
   * It only hold an Id as identifier to the real content of the Image.
   * Therefore, OverlayImage must be handled by some specialized hardware(e.g. HWC) 
   * to show its content.
   */
public:
  struct Data {
    int32_t mOverlayId;
    gfx::IntSize mSize;
  };
  gfx::IntSize mSize;
};
#endif
# 865 "../../dist/include/ImageContainer.h"

} //namespace
} //namespace

#endif
# 870 "../../dist/include/ImageContainer.h"
# 14 "../../dist/include/VideoSegment.h" 2

namespace mozilla {

namespace layers {
class Image;
}

class VideoFrame {
public:
  typedef mozilla::layers::Image Image;

  ;
  ;
  ~VideoFrame();

  bool operator==(const VideoFrame& aFrame) const
  {
    return mIntrinsicSize == aFrame.mIntrinsicSize &&
           mForceBlack == aFrame.mForceBlack &&
           ((mForceBlack && aFrame.mForceBlack) || mImage == aFrame.mImage);
  }
  

  Image* GetImage() const { return mImage; }
  void SetForceBlack(bool aForceBlack) { mForceBlack = aForceBlack; }
  
  
  void SetNull();
  ;

  // Create a planar YCbCr black image.
  ;

protected:
  // mImage can be null to indicate "no video" (aka "empty frame"). It can
  // still have an intrinsic size in this case.
  nsRefPtr<Image> mImage;
  // The desired size to render the video frame at.
  gfxIntSize mIntrinsicSize;
  bool mForceBlack;
};

struct VideoChunk {
  ;
  ;
  

  // Segment-generic methods not in MediaSegmentBase
  

  
};

}

#endif /* MOZILLA_VIDEOSEGMENT_H_ */
# 146 "../../dist/include/VideoSegment.h"
# 18 "../../dist/include/MediaStreamGraph.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "MainThreadUtils.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/MediaStreamGraph.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoRef.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/MediaStreamGraph.h"
#if 0 /* expanded by -frewrite-includes */
#include "GraphDriver.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/GraphDriver.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GRAPHDRIVER_H_
#define GRAPHDRIVER_H_

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/GraphDriver.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoRef.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/GraphDriver.h"
#if 0 /* expanded by -frewrite-includes */
#include "AudioBufferUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/AudioBufferUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_SCRATCHBUFFER_H_
#define MOZILLA_SCRATCHBUFFER_H_
#if 0 /* expanded by -frewrite-includes */
#include <mozilla/PodOperations.h>
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/AudioBufferUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/AudioBufferUtils.h"

namespace mozilla {

/**
 * The classes in this file provide a interface that uses frames as a unit.
 * However, they store their offsets in samples (because it's handy for pointer
 * operations). Those functions can convert between the two units.
 */
static inline uint32_t FramesToSamples(uint32_t aChannels, uint32_t aFrames) {
  return aFrames * aChannels;
}



/**
 * Class that gets a buffer pointer from an audio callback and provides a safe
 * interface to manipulate this buffer, and to ensure we are not missing frames
 * by the end of the callback.
 */
template<typename T, uint32_t CHANNELS>
class AudioCallbackBufferWrapper
{
public:
  
  /**
   * Set the buffer in this wrapper. This is to be called at the beginning of
   * the callback.
   */
  

  /**
   * Write some frames to the internal buffer. Free space in the buffer should
   * be check prior to calling this.
   */
  

  /**
   * Number of frames that can be written to the buffer.
   */
  uint32_t Available() {
    return SamplesToFrames(CHANNELS, mSamples - mSampleWriteOffset);
  }

  /**
   * Check that the buffer is completly filled, and reset internal state so this
   * instance can be reused.
   */
  

private:
  /* This is not an owned pointer, but the pointer passed to use via the audio
   * callback. */
  T* mBuffer;
  /* The number of samples of this audio buffer. */
  uint32_t mSamples;
  /* The position at which new samples should be written. We want to return to
   * the audio callback iff this is equal to mSamples. */
  uint32_t mSampleWriteOffset;
};

/**
 * This is a class that interfaces with the AudioCallbackBufferWrapper, and is
 * responsible for storing the excess of data produced by the MediaStreamGraph
 * because of different rounding constraints, to be used the next time the audio
 * backend calls back.
 */
template<typename T, uint32_t BLOCK_SIZE, uint32_t CHANNELS>
class SpillBuffer
{
public:
  
  /* Empty the spill buffer into the buffer of the audio callback. This returns
   * the number of frames written. */
  
  /* Fill the spill buffer from aInput, containing aFrames frames, return the
   * number of frames written to the spill buffer */
  
private:
  /* The spilled data. */
  T mBuffer[BLOCK_SIZE * CHANNELS];
  /* The current write position, in samples, in the buffer when filling, or the
   * amount of buffer filled when emptying. */
  uint32_t mPosition;
};

}

#endif // MOZILLA_SCRATCHBUFFER_H_
# 166 "../../dist/include/AudioBufferUtils.h"
# 12 "../../dist/include/GraphDriver.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "AudioMixer.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/AudioMixer.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_AUDIOMIXER_H_
#define MOZILLA_AUDIOMIXER_H_

#if 0 /* expanded by -frewrite-includes */
#include "AudioSampleFormat.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/AudioMixer.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/AudioMixer.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/PodOperations.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/AudioMixer.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/LinkedList.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/AudioMixer.h"
#if 0 /* expanded by -frewrite-includes */
#include "AudioStream.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/AudioMixer.h"

namespace mozilla {

struct MixerCallbackReceiver {
  virtual void MixerCallback(AudioDataValue* aMixedBuffer,
                             AudioSampleFormat aFormat,
                             uint32_t aChannels,
                             uint32_t aFrames,
                             uint32_t aSampleRate) = 0;
};
/**
 * This class mixes multiple streams of audio together to output a single audio
 * stream.
 *
 * AudioMixer::Mix is to be called repeatedly with buffers that have the same
 * length, sample rate, sample format and channel count.
 *
 * When all the tracks have been mixed, calling FinishMixing will call back with
 * a buffer containing the mixed audio data.
 *
 * This class is not thread safe.
 */
class AudioMixer
{
public:
  

  

  

  /* Get the data from the mixer. This is supposed to be called when all the
   * tracks have been mixed in. The caller should not hold onto the data. */
  

  /* Add a buffer to the mix. aSamples is interleaved. */
  nsTArray<AudioDataValue> mMixedAudio;
};
}

#endif // MOZILLA_AUDIOMIXER_H_
# 151 "../../dist/include/AudioMixer.h"
# 13 "../../dist/include/GraphDriver.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "AudioSegment.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/AudioSegment.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_AUDIOSEGMENT_H_
#define MOZILLA_AUDIOSEGMENT_H_

#if 0 /* expanded by -frewrite-includes */
#include "MediaSegment.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/AudioSegment.h"
#if 0 /* expanded by -frewrite-includes */
#include "AudioSampleFormat.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/AudioSegment.h"
#if 0 /* expanded by -frewrite-includes */
#include "SharedBuffer.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/SharedBuffer.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_SHAREDBUFFER_H_
#define MOZILLA_SHAREDBUFFER_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CheckedInt.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/SharedBuffer.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/mozalloc.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/SharedBuffer.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/SharedBuffer.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/SharedBuffer.h"

namespace mozilla {

/**
 * Base class for objects with a thread-safe refcount and a virtual
 * destructor.
 */
class ThreadSharedObject {
public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ThreadSharedObject)

  bool IsShared() { return mRefCnt.get() > 1; }

  virtual size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
  {
    return 0;
  }

  virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const
  {
    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
  }
protected:
  // Protected destructor, to discourage deletion outside of Release():
  virtual ~ThreadSharedObject() {}
};

/**
 * Heap-allocated chunk of arbitrary data with threadsafe refcounting.
 * Typically you would allocate one of these, fill it in, and then treat it as
 * immutable while it's shared.
 * This only guarantees 4-byte alignment of the data. For alignment we
 * simply assume that the refcount is at least 4-byte aligned and its size
 * is divisible by 4.
 */
class SharedBuffer : public ThreadSharedObject {
public:
  

  

  virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
  {
    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
  }

private:
  
};

}

#endif /* MOZILLA_SHAREDBUFFER_H_ */
# 78 "../../dist/include/SharedBuffer.h"
# 12 "../../dist/include/AudioSegment.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "WebAudioUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/WebAudioUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef WebAudioUtils_h_
#define WebAudioUtils_h_

#if 0 /* expanded by -frewrite-includes */
#include <cmath>
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/WebAudioUtils.h"

// Forward declaration
typedef struct SpeexResamplerState_ SpeexResamplerState;

namespace mozilla {

class AudioNodeStream;

namespace dom {

class AudioParamTimeline;

namespace WebAudioUtils {
  // 32 is the minimum required by the spec for createBuffer() and
  // createScriptProcessor() and matches what is used by Blink.  The limit
  /**
   * Converts AudioParamTimeline floating point time values to tick values
   * with respect to a source and a destination AudioNodeStream.
   *
   * This needs to be called for each AudioParamTimeline that gets sent to an
   * AudioNodeEngine on the engine side where the AudioParamTimeline is
   *
   * ARM
   * ---
   *  inf -1
   *  -inf 0
   *  999999995904.000000 -1
   *  nan 0
   *
   * When compiled for int, this program generates the following results:
   *
   * it sees a NaN.
   */
  

  ;

  int
  SpeexResamplerProcess(SpeexResamplerState* aResampler,
                        uint32_t aChannel,
                        const float* aIn, uint32_t* aInLen,
                        float* aOut, uint32_t* aOutLen);

  ;

  ;
  }

}
}

#endif
# 231 "../../dist/include/WebAudioUtils.h"

# 13 "../../dist/include/AudioSegment.h" 2
#ifdef MOZILLA_INTERNAL_API
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TimeStamp.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/AudioSegment.h"
#endif
# 16 "../../dist/include/AudioSegment.h"

namespace mozilla {

template<typename T>
class SharedChannelArrayBuffer : public ThreadSharedObject {
public:
  

  

  

  nsTArray<nsTArray<T> > mBuffers;
};

class AudioStream;
class AudioMixer;

/**
 * For auto-arrays etc, guess this as the common number of channels.
 */
const int GUESS_AUDIO_CHANNELS = 2;

// We ensure that the graph advances in steps that are multiples of the Web
// Audio block size
const uint32_t WEBAUDIO_BLOCK_SIZE_BITS = 7;
const uint32_t WEBAUDIO_BLOCK_SIZE = 1 << WEBAUDIO_BLOCK_SIZE_BITS;

;

/**
 * Given an array of input channels (aChannelData), downmix to aOutputChannels,
 * interleave the channel data. A total of aOutputChannels*aDuration
 * interleaved samples will be copied to a channel buffer in aOutput.
 */
;

/**
 * An AudioChunk represents a multi-channel buffer of audio samples.
 * It references an underlying ThreadSharedObject which manages the lifetime
 * of the buffer. An AudioChunk maintains its own duration and channel data
 * pointers so it can represent a subinterval of a buffer without copying.
 * An AudioChunk can store its individual channels anywhere; it maintains
 * separate pointers to each channel's buffer.
 */
struct AudioChunk {
  typedef mozilla::AudioSampleFormat SampleFormat;

  // Generic methods
  void SliceTo(StreamTime aStart, StreamTime aEnd)
  {
    MOZ_ASSERT(aStart >= 0 && aStart < aEnd && aEnd <= mDuration,
               "Slice out of bounds");
    if (mBuffer) {
      MOZ_ASSERT(aStart < INT32_MAX, "Can't slice beyond 32-bit sample lengths");
      for (uint32_t channel = 0; channel < mChannelData.Length(); ++channel) {
        mChannelData[channel] = AddAudioSampleOffset(mChannelData[channel],
            mBufferFormat, int32_t(aStart));
      }
    }
    mDuration = aEnd - aStart;
  }
  StreamTime GetDuration() const { return mDuration; }
  bool CanCombineWithFollowing(const AudioChunk& aOther) const
  {
    if (aOther.mBuffer != mBuffer) {
      return false;
    }
    if (mBuffer) {
      NS_ASSERTION(aOther.mBufferFormat == mBufferFormat,
                   "Wrong metadata about buffer");
      NS_ASSERTION(aOther.mChannelData.Length() == mChannelData.Length(),
                   "Mismatched channel count");
      if (mDuration > INT32_MAX) {
        return false;
      }
      for (uint32_t channel = 0; channel < mChannelData.Length(); ++channel) {
        if (aOther.mChannelData[channel] != AddAudioSampleOffset(mChannelData[channel],
            mBufferFormat, int32_t(mDuration))) {
          return false;
        }
      }
    }
    return true;
  }
  bool IsNull() const { return mBuffer == nullptr; }
  void SetNull(StreamTime aDuration)
  {
    mBuffer = nullptr;
    mChannelData.Clear();
    mDuration = aDuration;
    mVolume = 1.0f;
    mBufferFormat = AUDIO_FORMAT_SILENCE;
  }
  int ChannelCount() const { return mChannelData.Length(); }

  

  size_t SizeOfExcludingThisIfUnshared(MallocSizeOf aMallocSizeOf) const
  {
    return SizeOfExcludingThis(aMallocSizeOf, true);
  }

  size_t SizeOfExcludingThis(MallocSizeOf aMallocSizeOf, bool aUnshared) const
  {
    size_t amount = 0;

    // Possibly owned:
    // - mBuffer - Can hold data that is also in the decoded audio queue. If it
    //             is not shared, or unshared == false it gets counted.
    if (mBuffer && (!aUnshared || !mBuffer->IsShared())) {
      amount += mBuffer->SizeOfIncludingThis(aMallocSizeOf);
    }

    // Memory in the array is owned by mBuffer.
    amount += mChannelData.SizeOfExcludingThis(aMallocSizeOf);
    return amount;
  }

  StreamTime mDuration; // in frames within the buffer
  nsRefPtr<ThreadSharedObject> mBuffer; // the buffer object whose lifetime is managed; null means data is all zeroes
  nsTArray<const void*> mChannelData; // one pointer per channel; empty if and only if mBuffer is null
  float mVolume; // volume multiplier to apply (1.0f if mBuffer is nonnull)
  SampleFormat mBufferFormat; // format of frames in mBuffer (only meaningful if mBuffer is nonnull)
#ifdef MOZILLA_INTERNAL_API
  mozilla::TimeStamp mTimeStamp;           // time at which this has been fetched from the MediaEngine
#endif
# 165 "../../dist/include/AudioSegment.h"
};


/**
 * A list of audio samples consisting of a sequence of slices of SharedBuffers.
 * The audio rate is determined by the track, not stored in this class.
 */
class AudioSegment : public MediaSegmentBase<AudioSegment, AudioChunk> {
public:
  typedef mozilla::AudioSampleFormat SampleFormat;

  AudioSegment() : MediaSegmentBase<AudioSegment, AudioChunk>(AUDIO) {}

  // Resample the whole segment in place.
  

  ;

  
  
  // Consumes aChunk, and returns a pointer to the persistent copy of aChunk
  // in the segment.
  
  ;
  ;

  

  bool IsNull() const {
    for (ChunkIterator ci(*const_cast<AudioSegment*>(this)); !ci.IsEnded();
         ci.Next()) {
      if (!ci->IsNull()) {
        return false;
      }
    }
    return true;
  }

  static Type StaticType() { return AUDIO; }

  virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE
  {
    return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
  }
};

}

#endif /* MOZILLA_AUDIOSEGMENT_H_ */
# 313 "../../dist/include/AudioSegment.h"
# 14 "../../dist/include/GraphDriver.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SelfRef.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/SelfRef.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef SELF_REF_H
#define SELF_REF_H

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/SelfRef.h"

namespace mozilla {

template<class T>
class SelfReference {
public:
  SelfReference() : mHeld(false) {}
  ~SelfReference()
  {
    NS_ASSERTION(!mHeld, "Forgot to drop the self reference?");
  }

  void Take(T* t)
  {
    if (!mHeld) {
      mHeld = true;
      t->AddRef();
    }
  }
  void Drop(T* t)
  {
    if (mHeld) {
      mHeld = false;
      t->Release();
    }
  }

  operator bool() const { return mHeld; }

  SelfReference(const SelfReference& aOther) = delete;
  void operator=(const SelfReference& aOther) = delete;
private:
  bool mHeld;
};
} // mozilla

#endif // SELF_REF_H
# 48 "../../dist/include/SelfRef.h"
# 15 "../../dist/include/GraphDriver.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Atomics.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/GraphDriver.h"

struct cubeb_stream;

template <>
class nsAutoRefTraits<cubeb_stream> : public nsPointerRefTraits<cubeb_stream>
{
public:
  static void Release(cubeb_stream* aStream) { cubeb_stream_destroy(aStream); }
};

namespace mozilla {

/**
 * Assume we can run an iteration of the MediaStreamGraph loop in this much time
 * or less.
 * We try to run the control loop at this rate.
 */
static const int MEDIA_GRAPH_TARGET_PERIOD_MS = 10;

/**
 * Assume that we might miss our scheduled wakeup of the MediaStreamGraph by
 * this much.
 */
static const int SCHEDULE_SAFETY_MARGIN_MS = 10;

/**
 * Try have this much audio buffered in streams and queued to the hardware.
 * The maximum delay to the end of the next control loop
 * is 2*MEDIA_GRAPH_TARGET_PERIOD_MS + SCHEDULE_SAFETY_MARGIN_MS.
 * There is no point in buffering more audio than this in a stream at any
 * given time (until we add processing).
 * This is not optimal yet.
 */
static const int AUDIO_TARGET_MS = 2*MEDIA_GRAPH_TARGET_PERIOD_MS +
    SCHEDULE_SAFETY_MARGIN_MS;

/**
 * Try have this much video buffered. Video frames are set
 * near the end of the iteration of the control loop. The maximum delay
 * to the setting of the next video frame is 2*MEDIA_GRAPH_TARGET_PERIOD_MS +
 * SCHEDULE_SAFETY_MARGIN_MS. This is not optimal yet.
 */
static const int VIDEO_TARGET_MS = 2*MEDIA_GRAPH_TARGET_PERIOD_MS +
    SCHEDULE_SAFETY_MARGIN_MS;

class MediaStreamGraphImpl;
class MessageBlock;

/**
 * Microseconds relative to the start of the graph timeline.
 */
typedef int64_t GraphTime;
const GraphTime GRAPH_TIME_MAX = MEDIA_TIME_MAX;

class AudioCallbackDriver;
class OfflineClockDriver;

/**
 * A driver is responsible for the scheduling of the processing, the thread
 * management, and give the different clocks to a MediaStreamGraph. This is an
 * abstract base class. A MediaStreamGraph can be driven by an
 * OfflineClockDriver, if the graph is offline, or a SystemClockDriver, if the
 * graph is real time.
 * A MediaStreamGraph holds an owning reference to its driver.
 */
class GraphDriver
{
public:
  explicit GraphDriver(MediaStreamGraphImpl* aGraphImpl);

  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(GraphDriver);
  /* When the graph wakes up to do an iteration, this returns the range of time
   * that will be processed. */
  virtual void GetIntervalForIteration(GraphTime& aFrom,
                                       GraphTime& aTo) = 0;
  /* Returns the current time for this graph. This is the end of the current
   * iteration. */
  virtual GraphTime GetCurrentTime() = 0;
  /* For real-time graphs, this waits until it's time to process more data. For
   * offline graphs, this is a no-op. */
  virtual void WaitForNextIteration() = 0;
  /* Wakes up the graph if it is waiting. */
  virtual void WakeUp() = 0;
  virtual void Destroy() {}
  /* Start the graph, init the driver, start the thread. */
  virtual void Start() = 0;
  /* Stop the graph, shutting down the thread. */
  virtual void Stop() = 0;
  /* Resume after a stop */
  virtual void Resume() = 0;
  /* Revive this driver, as more messages just arrived. */
  virtual void Revive() = 0;
  void Shutdown();
  /* Rate at which the GraphDriver runs, in ms. This can either be user
   * controlled (because we are using a {System,Offline}ClockDriver, and decide
   * how often we want to wakeup/how much we want to process per iteration), or
   * it can be indirectly set by the latency of the audio backend, and the
   * number of buffers of this audio backend: say we have four buffers, and 40ms
   * latency, we will get a callback approximately every 10ms. */
  virtual uint32_t IterationDuration() = 0;

  /* Return whether we are switching or not. */
  bool Switching() {
    return mNextDriver || mPreviousDriver;
  }

  /**
   * If we are running a real time graph, get the current time stamp to schedule
   * video frames. This has to be reimplemented by real time drivers.
   */
  virtual TimeStamp GetCurrentTimeStamp() {
    return mCurrentTimeStamp;
  }


  /**
   * Tell the driver it has to stop and return the current time of the graph, so
   * another driver can start from the right point in time.
   */
  ;

  /**
   * Set the time for a graph, on a driver. This is used so a new driver just
   * created can start at the right point in time.
   */
  ;

  /**
   * Whenever the graph has computed the time until it has all state
   * (mStateComputedState), it calls this to indicate the new time until which

  /**
   * Same thing, but not locked.
   */
  ;

  

  ;

protected:
  // Time of the start of this graph iteration.
  GraphTime mIterationStart;
  // Time of the end of this graph iteration.
  GraphTime mIterationEnd;
  // Time, in the future, for which blocking has been computed.
  GraphTime mStateComputedTime;
  GraphTime mNextStateComputedTime;
  // The MediaStreamGraphImpl that owns this driver. This has a lifetime longer
  // than the driver, and will never be null.
  MediaStreamGraphImpl* mGraphImpl;

  // This enum specifies the wait state of the driver.
  enum WaitState {
    // RunThread() is running normally
    WAITSTATE_RUNNING,
    // RunThread() is paused waiting for its next iteration, which will
    // happen soon
    WAITSTATE_WAITING_FOR_NEXT_ITERATION,
    // RunThread() is paused indefinitely waiting for something to change
    WAITSTATE_WAITING_INDEFINITELY,
    // Something has signaled RunThread() to wake up immediately,
    // but it hasn't done so yet
    WAITSTATE_WAKING_UP
  };
  WaitState mWaitState;

  TimeStamp mCurrentTimeStamp;
  // This is non-null only when this driver has recently switched from an other
  // driver, and has not cleaned it up yet (for example because the audio stream
  // is currently calling the callback during initialization).
  nsRefPtr<GraphDriver> mPreviousDriver;
  // This is non-null only when this driver is going to switch to an other
  // driver at the end of this iteration.
  nsRefPtr<GraphDriver> mNextDriver;
  virtual ~GraphDriver()
  { }
};

class MediaStreamGraphInitThreadRunnable;

/**
 * This class is a driver that manages its own thread.
 */
class ThreadedDriver : public GraphDriver
{
public:
  ;
  ;
  virtual void WakeUp() MOZ_OVERRIDE;


private:
  TimeStamp mInitialTimeStamp;
  TimeStamp mLastTimeStamp;
};

/**
 * An OfflineClockDriver runs the graph as fast as possible, without waiting
 * between iteration.
 */
class OfflineClockDriver : public ThreadedDriver
{
public:
  ;
  ;
  virtual void GetIntervalForIteration(GraphTime& aFrom,
                                       GraphTime& aTo) MOZ_OVERRIDE;
  virtual GraphTime GetCurrentTime() MOZ_OVERRIDE;
  virtual void WaitForNextIteration() MOZ_OVERRIDE;
  virtual void WakeUp() MOZ_OVERRIDE;
  virtual TimeStamp GetCurrentTimeStamp() MOZ_OVERRIDE;
  

private:
  // Time, in GraphTime, for each iteration
  GraphTime mSlice;
};

/**
 * This is a graph driver that is based on callback functions called by the
 * audio api. This ensures minimal audio latency, because it means there is no
 * buffering happening: the audio is generated inside the callback.
 *
 * This design is less flexible than running our own thread:
 * - We have no control over the thread:
 * - It cannot block, and it has to run for a shorter amount of time than the
 *   buffer it is going to fill, or an under-run is going to occur (short burst
 *   of silence in the final audio output).
 * - We can't know for sure when the callback function is going to be called
 *   (although we compute an estimation so we can schedule video frames)
 * - Creating and shutting the thread down is a blocking operation, that can
 *   take _seconds_ in some cases (because IPC has to be set up, and
 *   sometimes hardware components are involved and need to be warmed up)
 * - We have no control on how much audio we generate, we have to return exactly
 *   the number of frames asked for by the callback. Since for the Web Audio
 *   API, we have to do block processing at 128 frames per block, we need to
 *   keep a little spill buffer to store the extra frames.
 */
class AudioCallbackDriver : public GraphDriver,
                            public MixerCallbackReceiver
{
  bool mMicrophoneActive;

#ifdef XP_MACOSX
  /* Implements the workaround for the osx audio stack when changing output
   * devices. See comments in .cpp */
  bool OSXDeviceSwitchingWorkaround();
  /* Self-reference that keep this driver alive when switching output audio
   * device and making the graph running temporarily off a SystemClockDriver.  */
  SelfReference<AudioCallbackDriver> mSelfReference;
  /* While switching devices, we keep track of the number of callbacks received,
   * since OSX seems to still call us _sometimes_. */
  uint32_t mCallbackReceivedWhileSwitching;
#endif
# 496 "../../dist/include/GraphDriver.h"
};

class AsyncCubebTask : public nsRunnable
{
public:
  enum AsyncCubebOperation {
    INIT,
    SHUTDOWN,
    SLEEP
  };


  ;

  

protected:
  ;

private:
  NS_IMETHOD Run() MOZ_OVERRIDE MOZ_FINAL;
  nsCOMPtr<nsIThread> mThread;
  nsRefPtr<AudioCallbackDriver> mDriver;
  AsyncCubebOperation mOperation;
  nsRefPtr<MediaStreamGraphImpl> mShutdownGrip;
};

}

#endif // GRAPHDRIVER_H_
# 535 "../../dist/include/GraphDriver.h"
# 21 "../../dist/include/MediaStreamGraph.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <speex/speex_resampler.h>
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/speex/speex_resampler.h" 1
/* Copyright (C) 2007 Jean-Marc Valin
      
   File: speex_resampler.h
   Resampling code
      
   The design goals of this code are:
      - Very fast algorithm
      - Low memory requirement
      - Good *perceptual* quality (and not best SNR)

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are
   met:

   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.
*/


#ifndef SPEEX_RESAMPLER_H
#define SPEEX_RESAMPLER_H

#if 1 /* OUTSIDE_SPEEX */

/********* WARNING: MENTAL SANITY ENDS HERE *************/

/* If the resampler is defined outside of Speex, we change the symbol names so that 
#define speex_resampler_set_skip_frac_num CAT_PREFIX(RANDOM_PREFIX,_resampler_set_skip_frac_num)
#define speex_resampler_reset_mem CAT_PREFIX(RANDOM_PREFIX,_resampler_reset_mem)
#define speex_resampler_strerror CAT_PREFIX(RANDOM_PREFIX,_resampler_strerror)

#define spx_int16_t short
#define spx_int32_t int
#define spx_uint16_t unsigned short
#define spx_uint32_t unsigned int
      
#else /* OUTSIDE_SPEEX */
# 88 "../../dist/include/speex/speex_resampler.h"

#if 0 /* expanded by -frewrite-includes */
#include "speexdsp_types.h"
#endif /* expanded by -frewrite-includes */
# 90 "../../dist/include/speex/speex_resampler.h"

#endif /* OUTSIDE_SPEEX */
# 92 "../../dist/include/speex/speex_resampler.h"

#ifdef __cplusplus
extern "C" {
#endif
# 96 "../../dist/include/speex/speex_resampler.h"

#define SPEEX_RESAMPLER_QUALITY_MAX 10
#define SPEEX_RESAMPLER_QUALITY_MIN 0
#define SPEEX_RESAMPLER_QUALITY_DEFAULT 4
#define SPEEX_RESAMPLER_QUALITY_VOIP 3
#define SPEEX_RESAMPLER_QUALITY_DESKTOP 5

enum {
   RESAMPLER_ERR_SUCCESS         = 0,
   RESAMPLER_ERR_ALLOC_FAILED    = 1,
   RESAMPLER_ERR_BAD_STATE       = 2,
   RESAMPLER_ERR_INVALID_ARG     = 3,
   RESAMPLER_ERR_PTR_OVERLAP     = 4,
   
   RESAMPLER_ERR_MAX_ERROR
};

struct SpeexResamplerState_;
typedef struct SpeexResamplerState_ SpeexResamplerState;

/** Create a new resampler with integer input and output rates.
 * @param nb_channels Number of channels to be processed
 */
;

/** Returns the English meaning for an error code
 * @param err Error code
 * @return English string
 */
;

#ifdef __cplusplus
}
#endif
# 357 "../../dist/include/speex/speex_resampler.h"

#endif
# 359 "../../dist/include/speex/speex_resampler.h"
# 22 "../../dist/include/MediaStreamGraph.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/AudioChannelBinding.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/MediaStreamGraph.h"
#if 0 /* expanded by -frewrite-includes */
#include "DOMMediaStream.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/MediaStreamGraph.h"

class nsIRunnable;

template <>
class nsAutoRefTraits<SpeexResamplerState> : public nsPointerRefTraits<SpeexResamplerState>
{
  public:
  
};

namespace mozilla {

#ifdef PR_LOGGING
extern PRLogModuleInfo* gMediaStreamGraphLog;
#endif
# 39 "../../dist/include/MediaStreamGraph.h"

/*
 * MediaStreamGraph is a framework for synchronized audio/video processing
 * and playback. It is designed to be used by other browser components such as
 * HTML media elements, media capture APIs, real-time media streaming APIs,
 * multitrack media APIs, and advanced audio APIs.
 *
 * The MediaStreamGraph uses a dedicated thread to process media --- the media
 * graph thread. This ensures that we can process media through the graph
 * an event loop task. This time is returned by MediaStreamGraph::GetCurrentTime().
 *
 * Media decoding, audio processing and media playback use thread-safe APIs to
 * the media graph to ensure they can continue while the main thread is blocked.
 *
 * When the graph is changed, we may need to throw out buffered data and
 * reprocess it. This is triggered automatically by the MediaStreamGraph.
 */

class MediaStreamGraph;

/**
 * This is a base class for media graph thread listener callbacks.
 * Override methods to be notified of audio or video data or changes in stream
 * state.
 *
 * This can be used by stream recorders or network connections that receive
 * stream input. It could also be used for debugging.
 *
 * All notification methods are called from the media graph thread. Overriders
 * of these methods are responsible for all synchronization. Beware!
 * These methods are called without the media graph monitor held, so
 * reentry into media graph methods is possible, although very much discouraged!
 * You should do something non-blocking and non-reentrant (e.g. dispatch an
 * event to some thread) and return.
 * The listener is not allowed to add/remove any listeners from the stream.
 *
 * When a listener is first attached, we guarantee to send a NotifyBlockingChanged
 * callback to notify of the initial blocking state. Also, if a listener is
 * attached to a stream that has already finished, we'll call NotifyFinished.
 */
class MediaStreamListener {
protected:
  // Protected destructor, to discourage deletion outside of Release():
  virtual ~MediaStreamListener() {}

public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaStreamListener)

  enum Consumption {
    CONSUMED,
    NOT_CONSUMED
  };

  /**
   * Notify that the stream is hooked up and we'd like to start or stop receiving
   * data on it. Only fires on SourceMediaStreams.
   * always be true since we block stream time from progressing to times where
   * there isn't data in each track.
   */
  virtual void NotifyHasCurrentData(MediaStreamGraph* aGraph) {}

  /**
   * Notify that the stream output is advancing. aCurrentTime is the graph's
   * current time. MediaStream::GraphTimeToStreamTime can be used to get the
   * stream time.
   */
  virtual void NotifyOutput(MediaStreamGraph* aGraph, GraphTime aCurrentTime) {}

  enum MediaStreamGraphEvent {
    EVENT_FINISHED,
    EVENT_REMOVED,
    EVENT_HAS_DIRECT_LISTENERS, // transition from no direct listeners
    EVENT_HAS_NO_DIRECT_LISTENERS,  // transition to no direct listeners
  };

  /**
   * Notify that an event has occurred on the Stream
   */
  virtual void NotifyEvent(MediaStreamGraph* aGraph, MediaStreamGraphEvent aEvent) {}

  enum {
    TRACK_EVENT_CREATED = 0x01,
    TRACK_EVENT_ENDED = 0x02
  };
  /**
   * Notify that changes to one of the stream tracks have been queued.
   * aTrackEvents can be any combination of TRACK_EVENT_CREATED and
   * Note that NotifyQueuedTrackChanges() calls will also still occur.
   */
  
};

/**
 * This is a base class for main-thread listener callbacks.
 * This callback is invoked on the main thread when the main-thread-visible
 * state of a stream has changed.
 *
 * These methods are called with the media graph monitor held, so
 * reentry into general media graph methods is not possible.
 * You should do something non-blocking and non-reentrant (e.g. dispatch an
 * event) and return. DispatchFromMainThreadAfterNextStreamStateUpdate
 * would be a good choice.
 * The listener is allowed to synchronously remove itself from the stream, but
 * not add or remove any other listeners.
 */
class MainThreadMediaStreamListener {
public:
  ;
};

/**
 * Helper struct used to keep track of memory usage by AudioNodes.
 */
struct AudioNodeSizes
{
  
  size_t mDomNode;
  size_t mStream;
  size_t mEngine;
  nsCString mNodeType;
};

class MediaStreamGraphImpl;
class SourceMediaStream;
class ProcessedMediaStream;
class MediaInputPort;
class AudioNodeEngine;
class AudioNodeExternalInputStream;
class AudioNodeStream;
struct AudioChunk;
class CameraPreviewMediaStream;

/**
 * A stream of synchronized audio and video data. All (not blocked) streams
 * progress at the same rate --- "real time". Streams cannot seek. The only
 * operation readers can perform on a stream is to read the next data.
 *
 *
 * This could cause problems for media processing if a MediaStream is
 * destroyed while a downstream MediaStream is still using it. Therefore
 * the DOM wrappers must keep upstream MediaStreams alive as long as they
 * could be being used in the media graph.
 *
 * At any time, however, a set of MediaStream wrappers could be
 * collected via cycle collection. Destroy messages will be sent
 * for those objects in arbitrary order and the MediaStreamGraph has to be able
 * to handle this.
 */
class MediaStream : public mozilla::LinkedListElement<MediaStream> {
public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaStream)

  ;

protected:
  // Protected destructor, to discourage deletion outside of Release():
  virtual ~MediaStream()
  {
    MOZ_COUNT_DTOR(MediaStream);
    NS_ASSERTION(mMainThreadDestroyed, "Should have been destroyed already");
    NS_ASSERTION(mMainThreadListeners.IsEmpty(),
                 "All main thread listeners should have been removed");
  }

  // Signal that the client is done with this MediaStream. It will be deleted later.
  ;
  // Returns the main-thread's view of how much data has been processed by
  // this stream.
  
  // above, on the media graph thread.
  /**
   * Stop all stream activity and disconnect it from all inputs and outputs.
   * This must be idempotent.
   */
  virtual void DestroyImpl();
  StreamTime GetBufferEnd() { return mBuffer.GetEnd(); }
#ifdef DEBUG
  void DumpTrackInfo() { return mBuffer.DumpTrackInfo(); }
#endif
  StreamBuffer mBuffer;
  // The time when the buffered data could be considered to have started playing.
  // This increases over time to account for time the stream was blocked before
  // mCurrentTime.
  GraphTime mBufferStartTime;

  // Client-set volume of this stream
  struct AudioOutput {
    explicit AudioOutput(void* aKey) : mKey(aKey), mVolume(1.0f) {}
    void* mKey;
    float mVolume;
  };
  nsTArray<AudioOutput> mAudioOutputs;
  nsTArray<nsRefPtr<VideoFrameContainer> > mVideoOutputs;
  // We record the last played video frame to avoid redundant setting
  // of the current video frame.
  VideoFrame mLastPlayedVideoFrame;
  // The number of times this stream has been explicitly blocked by the control
  // API, minus the number of times it has been explicitly unblocked.
  TimeVarying<GraphTime,uint32_t,0> mExplicitBlockerCount;
  nsTArray<nsRefPtr<MediaStreamListener> > mListeners;
  nsTArray<MainThreadMediaStreamListener*> mMainThreadListeners;
  nsTArray<TrackID> mDisabledTrackIDs;

  // Precomputed blocking status (over GraphTime).
  // This is only valid between the graph's mCurrentTime and
  // mStateComputedTime. The stream is considered to have
  // not been blocked before mCurrentTime (its mBufferStartTime is increased
  // as necessary to account for that time instead) --- this avoids us having to
  // record the entire history of the stream's blocking-ness in mBlocked.
  TimeVarying<GraphTime,bool,5> mBlocked;
  // Maps graph time to the graph update that affected this stream at that time
  TimeVarying<GraphTime,int64_t,0> mGraphUpdateIndices;
  bool mMainThreadDestroyed;

  // Our media stream graph.  null if destroyed on the graph thread.
  MediaStreamGraphImpl* mGraph;

  dom::AudioChannel mAudioChannelType;
};

/**
 * This is a stream into which a decoder can write audio and video.
 *
 * Audio and video can be written on any thread, but you probably want to
 * always write from the same thread to avoid unexpected interleavings.
 */
class SourceMediaStream : public MediaStream {
public:
  

  

  // Media graph thread only

  friend class MediaStreamGraphImpl;

protected:
  struct ThreadAndRunnable {
    

    nsCOMPtr<nsIEventTarget> mTarget;
    nsCOMPtr<nsIRunnable> mRunnable;
  };
  enum TrackCommands {
    TRACK_CREATE = MediaStreamListener::TRACK_EVENT_CREATED,
    TRACK_END = MediaStreamListener::TRACK_EVENT_ENDED
  };
  /**
   * Data for each track that hasn't ended.
   */
  struct TrackData {
    TrackID mID;
    // Sample rate of the input data.
    TrackRate mInputRate;
    // Resampler if the rate of the input track does not match the
    // MediaStreamGraph's.
    nsAutoRef<SpeexResamplerState> mResampler;
#ifdef DEBUG
    int mResamplerChannelCount;
#endif
# 876 "../../dist/include/MediaStreamGraph.h"
    StreamTime mStart;
    // End-time of data already flushed to the track (excluding mData)
    StreamTime mEndOfFlushedData;
    // Each time the track updates are flushed to the media graph thread,
    // the segment buffer is emptied.
    nsAutoPtr<MediaSegment> mData;
    nsTArray<ThreadAndRunnable> mDispatchWhenNotEnough;
    // Each time the track updates are flushed to the media graph thread,
    // this is cleared.
    uint32_t mCommands;
    bool mHaveEnough;
  };

  ;

  ;

  ;

  
  StreamTime mUpdateKnownTracksTime;
  nsTArray<TrackData> mUpdateTracks;
  nsTArray<TrackData> mPendingTracks;
  nsTArray<nsRefPtr<MediaStreamDirectListener> > mDirectListeners;
  bool mPullEnabled;
  bool mUpdateFinished;
  bool mNeedsMixing;
};

/**
 * Represents a connection between a ProcessedMediaStream and one of its
 * input streams.
 * We make these refcounted so that stream-related messages with MediaInputPort*
 * pointers can be sent to the main thread safely.
 *
 * When a port's source or destination stream dies, the stream's DestroyImpl
 * calls MediaInputPort::Disconnect to disconnect the port from
 * the source and destination streams.
 *
 * The lifetimes of MediaInputPort are controlled from the main thread.
 * The media graph adds a reference to the port. When a MediaInputPort is no
 * longer needed, main-thread code sends a Destroy message for the port and
 * clears its reference (the last main-thread reference to the object). When
 * the Destroy message is processed on the graph manager thread we disconnect
 * the port and drop the graph's reference, destroying the object.
 */
class MediaInputPort MOZ_FINAL {
private:
  // Do not call this constructor directly. Instead call aDest->AllocateInputPort.
  

  // Private destructor, to discourage deletion outside of Release():
  /**
   * Sample rate at which this graph runs. For real time graphs, this is
   * the rate of the audio mixer. For offline graphs, this is the rate specified
   * at construction.
   */
  TrackRate mSampleRate;
};

}

#endif /* MOZILLA_MEDIASTREAMGRAPH_H_ */
# 1283 "../../dist/include/MediaStreamGraph.h"
# 198 "../../dist/include/MediaDecoder.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "AbstractMediaDecoder.h"
#endif /* expanded by -frewrite-includes */
# 199 "../../dist/include/MediaDecoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "necko-config.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/necko-config.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _NECKO_CONFIG_H_
#define _NECKO_CONFIG_H_

#define NECKO_COOKIES 1

/* #undef NECKO_WIFI */

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CDMProxy.h"
#endif /* expanded by -frewrite-includes */
# 202 "../../dist/include/MediaDecoder.h"
#endif
# 203 "../../dist/include/MediaDecoder.h"

class nsIStreamListener;
class nsIPrincipal;

namespace mozilla {
namespace dom {
class TimeRanges;
}
}

namespace mozilla {
namespace layers {
class Image;
} //namespace layers

class VideoFrameContainer;
class MediaDecoderStateMachine;
class MediaDecoderOwner;

// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
// GetTickCount() and conflicts with MediaDecoder::GetCurrentTime implementation.
#ifdef GetCurrentTime
#undef GetCurrentTime
#endif
# 227 "../../dist/include/MediaDecoder.h"

// Stores the seek target; the time to seek to, and whether an Accurate,
// or "Fast" (nearest keyframe) seek was requested.
struct SeekTarget {
  enum Type {
    Invalid,
    PrevSyncPoint,
    Accurate
  };
  
  
  
  
  
  // Seek target time in microseconds.
  int64_t mTime;
  // Whether we should seek "Fast", or "Accurate".
  // "Fast" seeks to the seek point preceeding mTime, whereas
  // "Accurate" seeks as close as possible to mTime.
  Type mType;
  MediaDecoderEventVisibility mEventVisibility;
};

class MediaDecoder : public nsIObserver,
                     public AbstractMediaDecoder
{
public:
  struct SeekResolveValue {
    
    bool mAtEnd;
    MediaDecoderEventVisibility mEventVisibility;
  };

  // not connected to streams created by captureStreamUntilEnded.

  struct DecodedStreamData {
    typedef gfx::IntSize IntSize;

    ;
    ;

    // microseconds
    int64_t mLastOutputTime; // microseconds
    // Protected by mMutex
    bool mStreamFinishedOnMainThread;
  };

  class OutputStreamListener;
#ifdef MOZ_WMF
  static bool IsWMFEnabled();
#endif
# 908 "../../dist/include/MediaDecoder.h"

#ifdef MOZ_APPLEMEDIA
  static bool IsAppleMP3Enabled();
#endif
# 912 "../../dist/include/MediaDecoder.h"

  // Schedules the state machine to run one cycle on the shared state
  // machine thread. Main thread only.
  ;

  struct Statistics {
    // Estimate of the current playback rate (bytes/second).
    double mPlaybackRate;
    uint32_t mDroppedFrames;
  };

  // Return the frame decode/paint related statistics.
  

  // Increments the parsed and decoded frame counters by the passed in counts.
  // Can be called on any thread.
  

protected:
  ;
  ;

  ;

  // Start a timer for heuristic dormant.
  ;

  // Cancel a timer for heuristic dormant.
  ;

  // Return true if the decoder has reached the end of playback
  ;

  /******
   * The following members should be accessed with the decoder lock held.
   ******/

};

} // namespace mozilla

#endif
# 1246 "../../dist/include/MediaDecoder.h"
# 23 "../../dist/include/mozilla/dom/HTMLMediaElement.h" 2
#ifdef MOZ_EME
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/MediaKeys.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/mozilla/dom/HTMLMediaElement.h"
#endif
# 26 "../../dist/include/mozilla/dom/HTMLMediaElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsGkAtoms.h"
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/mozilla/dom/HTMLMediaElement.h"

// X.h on Linux #defines CurrentTime as 0L, so we have to #undef it here.
#ifdef CurrentTime
#undef CurrentTime
#endif
# 32 "../../dist/include/mozilla/dom/HTMLMediaElement.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLMediaElementBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/HTMLMediaElementBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_HTMLMediaElementBinding_h
#define mozilla_dom_HTMLMediaElementBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/HTMLMediaElementBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/HTMLMediaElementBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/HTMLMediaElementBinding.h"

namespace mozilla {
namespace dom {

class HTMLMediaElement;
struct HTMLMediaElementAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

namespace HTMLMediaElementBinding {

  typedef mozilla::dom::HTMLMediaElement NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable

  ;

} // namespace HTMLMediaElementBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_HTMLMediaElementBinding_h
# 67 "../../dist/include/mozilla/dom/HTMLMediaElementBinding.h"
# 34 "../../dist/include/mozilla/dom/HTMLMediaElement.h" 2

// Define to output information on decoding and painting framerate
/* #define DEBUG_FRAME_RATE 1 */

class nsIChannel;
class nsIHttpChannel;
class nsILoadGroup;

typedef uint16_t nsMediaNetworkState;
typedef uint16_t nsMediaReadyState;

namespace mozilla {
class ErrorResult;
class MediaResource;
class MediaDecoder;
class VideoFrameContainer;
namespace dom {
class MediaKeys;
class TextTrack;
class TimeRanges;
class WakeLock;
class MediaTrack;
}
}

class nsITimer;
class nsRange;
class nsIRunnable;

namespace mozilla {
namespace dom {

// Number of milliseconds between timeupdate events as defined by spec
#define TIMEUPDATE_MS 250

class MediaError;
class MediaSource;
class TextTrackList;
class AudioTrackList;
class VideoTrackList;

class HTMLMediaElement : public nsGenericHTMLElement,
                         public nsIDOMHTMLMediaElement,
                         public nsIObserver,
                         public MediaDecoderOwner,
                         public nsIAudioChannelAgentCallback
{
public:
  typedef mozilla::TimeStamp TimeStamp;
  typedef mozilla::layers::ImageContainer ImageContainer;
  typedef mozilla::VideoFrameContainer VideoFrameContainer;
  typedef mozilla::MediaStream MediaStream;
  typedef mozilla::MediaResource MediaResource;
  typedef mozilla::MediaDecoderOwner MediaDecoderOwner;
  typedef mozilla::MetadataTags MetadataTags;

  CORSMode GetCORSMode() {
    return mCORSMode;
  }

  ;

  /**
   * This is used when the browser is constructing a video element to play
   * a channel that we've already started loading. The src attribute and
   * <source> children are ignored.
   * @param aChannel the channel to use
   * @param aListener returns a stream listener that should receive
   * notifications for the stream
   */
  ;

  // nsIDOMHTMLMediaElement
  NS_DECL_NSIDOMHTMLMEDIAELEMENT

  NS_DECL_NSIOBSERVER

  NS_DECL_NSIAUDIOCHANNELAGENTCALLBACK

  // nsISupports
  NS_DECL_ISUPPORTS_INHERITED
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLMediaElement,
                                           nsGenericHTMLElement)

  virtual bool ParseAttribute(int32_t aNamespaceID,
                              nsIAtom* aAttribute,
                              const nsAString& aValue,
                              nsAttrValue& aResult) MOZ_OVERRIDE;
  // SetAttr override.  C++ is stupid, so have to override both
  // overloaded methods.
  
  virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                           nsIAtom* aPrefix, const nsAString& aValue,
                           bool aNotify) MOZ_OVERRIDE;
  virtual nsresult UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttr,
                             bool aNotify) MOZ_OVERRIDE;

  virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                              nsIContent* aBindingParent,
                              bool aCompileEventHandlers) MOZ_OVERRIDE;
  virtual void UnbindFromTree(bool aDeep = true,
                              bool aNullParent = true) MOZ_OVERRIDE;
  virtual void DoneCreatingElement() MOZ_OVERRIDE;

  virtual bool IsHTMLFocusable(bool aWithMouse, bool *aIsFocusable,
                               int32_t *aTabIndex) MOZ_OVERRIDE;
  virtual int32_t TabIndexDefault() MOZ_OVERRIDE;

  /**
   * Call this to reevaluate whether we should start/stop due to our owner
   * document being active, inactive, visible or hidden.
   */
  virtual void NotifyOwnerDocumentActivityChanged();

  // Called by the video decoder object, on the main thread,

  /**
   * Returns the load group for this media element's owner document.
   * XXX XBL2 issue.
   */
  already_AddRefed<nsILoadGroup> GetDocumentLoadGroup();

  /**
   * Returns true if the media has played or completed a seek.
   * Used by video frame to determine whether to paint the poster.
   */
  bool GetPlayedOrSeeked() const { return mHasPlayedOrSeeked; }

  nsresult CopyInnerTo(Element* aDest);

  /**
  void RunInStableState(nsIRunnable* aRunnable);
  

  /**
   * A public wrapper for FinishDecoderSetup()
   */
  

  // Returns true if the media element is being destroyed. Used in
  // dormancy checks to prevent dormant processing for an element
  // that will soon be gone.
  ;

protected:
  ;

  class MediaLoadListener;
  class MediaStreamTracksAvailableCallback;
  class StreamListener;

  virtual void GetItemValueText(DOMString& text) MOZ_OVERRIDE;
  virtual void SetItemValueText(const nsAString& text) MOZ_OVERRIDE;

  class WakeLockBoolWrapper {
  public:
    

    ;

    
    ;

    

    ;

    

    ;

  private:
    ;

    bool mValue;
    bool mCanPlay;
    HTMLMediaElement* mOuter;
    nsCOMPtr<nsITimer> mTimer;
  };
  virtual void WakeLockCreate();
  virtual void WakeLockRelease();
  nsRefPtr<WakeLock> mWakeLock;

  /**
   * Logs a warning message to the web console to report various failures.
   * aMsg is the localized message identifier, aParams is the parameters to
   * be substituted into the localized message, and aParamCount is the number
   * of parameters in aParams.
   */

  /**
   * Selects the next <source> child from which to load a resource. Called
   * during the resource selection algorithm. Stores the return value in
   * mSourceLoadCandidate before returning.
   */
  ;

  /**
   * Changes mDelayingLoadEvent, and will call BlockOnLoad()/UnblockOnLoad()
   * on the owning document, so it can delay the load event firing.
   */
  ;

  /**
   * If we suspended downloading after the first frame, unsuspend now.
   */
  ;

  /**
   * Called when our channel is redirected to another channel.
   * Updates our mChannel reference to aNewChannel.
  enum PreloadAttrValue {
    PRELOAD_ATTR_EMPTY,    // set to ""
    PRELOAD_ATTR_NONE,     // set to "none"
    PRELOAD_ATTR_METADATA, // set to "metadata"
    PRELOAD_ATTR_AUTO      // set to "auto"
  };

  /**
   * The preloading action to perform. These dictate how we react to the
   * preload attribute. See mPreloadAction.
   */
  enum PreloadAction {
    PRELOAD_UNDEFINED = 0, // not determined - used only for initialization
    PRELOAD_NONE = 1,      // do not preload
    PRELOAD_METADATA = 2,  // preload only the metadata (and first frame)
    PRELOAD_ENOUGH = 3     // preload enough data to allow uninterrupted
                           // playback
  };

  /**
   * Suspends the load of mLoadingSrc, so that it can be resumed later
   * by ResumeLoad(). This is called when we have a media with a 'preload'
   * attribute value of 'none', during the resource selection algorithm.
   */
  ;

  /**
   * Resumes a previously suspended load (suspended by SuspendLoad(uri)).
   * Will continue running the resource selection algorithm.
   * Sets mPreloadAction to aAction.
   */
  ;
  /**
   * Process any media fragment entries in the URI
   */
  ;

  /**
   * Mute or unmute the audio and change the value that the |muted| map.
   */
  ;
  /**
   * Update the volume of the output audio stream to match the element's
   * current mMuted/mVolume/mAudioChannelFaded state.
   */
  ;

  /**
   * Suspend (if aPauseForInactiveDocument) or resume element playback and
   * resource download.  If aSuspendEvents is true, event delivery is
   * suspended (and events queued) until the element is resumed.
   */
  ;

  // Get the HTMLMediaElement object if the decoder is being used from an
  // HTML media element, and null otherwise.
  

  // Return true if decoding should be paused
  ;

  // The current decoder. Load() has been called on this decoder.
  // At most one of mDecoder and mSrcStream can be non-null.
  nsRefPtr<MediaDecoder> mDecoder;
  nsIntSize mMediaSize;

  // Time that the last timeupdate event was fired. Read/Write from the
  // main thread only.
  TimeStamp mTimeUpdateTime;

  // Time that the last progress event was fired. Read/Write from the
  // main thread only.
  // when the poster frame should be shown.
  bool mHasPlayedOrSeeked;

  // True if we've added a reference to ourselves to keep the element
  // alive while no-one is referencing it but the element may still fire
  // events of its own accord.
  bool mHasSelfReference;

  // True if we've received a notification that the engine is shutting
  // down.
  bool mShuttingDown;

  // True if we've suspended a load in the resource selection algorithm
  // due to loading a preload:none media. When true, the resource we'll
  // load when the user initiates either playback or an explicit load is
  // stored in mPreloadURI.
  bool mSuspendedForPreloadNone;

  // True if a same-origin check has been done for the media element and resource.
  bool mMediaSecurityVerified;

  // The CORS mode when loading the media element
  CORSMode mCORSMode;

  enum ElementInTreeState {
    // The MediaElement is not in the DOM tree now.
    ELEMENT_NOT_INTREE,
    // The MediaElement is in the DOM tree now.
    ELEMENT_INTREE,
    // The MediaElement is not in the DOM tree now but had been binded to the
    // tree before.
    ELEMENT_NOT_INTREE_HAD_INTREE
  };

  ElementInTreeState mElementInTreeState;

};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_HTMLMediaElement_h
# 1363 "../../dist/include/mozilla/dom/HTMLMediaElement.h"
# 12 "../../dist/include/mozilla/dom/HTMLVideoElement.h" 2

namespace mozilla {
namespace dom {

class WakeLock;
class VideoPlaybackQuality;

class HTMLVideoElement MOZ_FINAL : public HTMLMediaElement
{
public:
  typedef mozilla::dom::NodeInfo NodeInfo;

  ;

  NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLVideoElement, video)

  using HTMLMediaElement::GetPaused;

  

  

  uint32_t VideoWidth() const
  {
    return mMediaSize.width == -1 ? 0 : mMediaSize.width;
  }

  uint32_t VideoHeight() const

  ;

  void NotifyOwnerDocumentActivityChanged() MOZ_OVERRIDE;

  ;

protected:
  ;

  virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;

  virtual void WakeLockCreate() MOZ_OVERRIDE;
  virtual void WakeLockRelease() MOZ_OVERRIDE;
  ;

  nsRefPtr<WakeLock> mScreenWakeLock;

private:
  ;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_HTMLVideoElement_h
# 132 "../../dist/include/mozilla/dom/HTMLVideoElement.h"
# 16 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "CanvasUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/canvas/CanvasUtils.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _CANVASUTILS_H_
#define _CANVASUTILS_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CheckedInt.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/canvas/CanvasUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ToJSValue.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/canvas/CanvasUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/canvas/CanvasUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/FloatingPoint.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/canvas/CanvasUtils.h"

class nsIPrincipal;

namespace mozilla {

namespace gfx {
class Matrix;
}

namespace dom {
class HTMLCanvasElement;
}

namespace CanvasUtils {


// Check that the rectangle [x,y,w,h] is a subrectangle of [0,0,realWidth,realHeight]



// Flag aCanvasElement as write-only if drawing an image with aPrincipal
// onto it would make it such.

void DoDrawImageSecurityCheck(dom::HTMLCanvasElement *aCanvasElement,
                              nsIPrincipal *aPrincipal,
                              bool forceWriteOnly,
                              bool CORSUsed);

// Make a double out of |v|, treating undefined values as 0.0 (for
// the sake of sparse arrays).  Return true iff coercion
// succeeded.
bool CoerceDouble(JS::Value v, double* d);

    /* Float validation stuff */
#define VALIDATE(_f)  if (!IsFinite(_f)) return false

inline bool FloatValidate (double f1) {
    VALIDATE(f1);
    return true;
}











#undef VALIDATE

template<typename T>
nsresult
JSValToDashArray(JSContext* cx, const JS::Value& val,
                 FallibleTArray<T>& dashArray);

;

template<typename T>
nsresult
JSValToDashArray(JSContext* cx, const JS::Value& patternArray,
                 FallibleTArray<T>& dashes)
{
    // The cap is pretty arbitrary.  16k should be enough for
    // anybody...
    static const uint32_t MAX_NUM_DASHES = 1 << 14;

    if (!patternArray.isPrimitive()) {
        JS::Rooted<JSObject*> obj(cx, patternArray.toObjectOrNull());
        uint32_t length;
        if (!JS_GetArrayLength(cx, obj, &length)) {
            // Not an array-like thing
            return NS_ERROR_INVALID_ARG;
        } else if (length > MAX_NUM_DASHES) {
            // Too many dashes in the pattern
            return NS_ERROR_ILLEGAL_VALUE;
        }

        bool haveNonzeroElement = false;
        for (uint32_t i = 0; i < length; ++i) {
            JS::Rooted<JS::Value> elt(cx);
            double d;
            if (!JS_GetElement(cx, obj, i, &elt)) {
                return NS_ERROR_FAILURE;
            }
            if (!(CoerceDouble(elt, &d) &&
                  FloatValidate(d) &&
                  d >= 0.0)) {
                // Pattern elements must be finite "numbers" >= 0.
                return NS_ERROR_INVALID_ARG;
            } else if (d > 0.0) {
                haveNonzeroElement = true;
            }
            if (!dashes.AppendElement(d)) {
                return NS_ERROR_OUT_OF_MEMORY;
            }
        }

        if (dashes.Length() > 0 && !haveNonzeroElement) {
            // An all-zero pattern makes no sense.
            return NS_ERROR_ILLEGAL_VALUE;
        }
    } else if (!(patternArray.isUndefined() || patternArray.isNull())) {
        // undefined and null mean "reset to no dash".  Any other
        // random garbage is a type error.
        return NS_ERROR_INVALID_ARG;
    }

    return NS_OK;
}

template<typename T>
void
DashArrayToJSVal(FallibleTArray<T>& dashes,
                 JSContext* cx,
                 JS::MutableHandle<JS::Value> retval,
                 mozilla::ErrorResult& rv)
{
    if (dashes.IsEmpty()) {
        retval.setNull();
        return;
    }
    JS::Rooted<JS::Value> val(cx);
    if (!mozilla::dom::ToJSValue(cx, dashes, retval)) {
        rv.Throw(NS_ERROR_OUT_OF_MEMORY);
    }
}

}
}

#endif /* _CANVASUTILS_H_ */
# 175 "/Users/luser/build/mozilla-central/dom/canvas/CanvasUtils.h"
# 17 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "gfxTextRun.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxTextRun.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_TEXTRUN_H
#define GFX_TEXTRUN_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxTextRun.h"

#ifndef GFX_FONT_H
#define GFX_FONT_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxFont.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxFontEntry.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxFontEntry.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_FONTENTRY_H
#define GFX_FONTENTRY_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxFontEntry.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxFontEntry.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxFontFeatures.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/gfxFontEntry.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxFontUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxFontUtils.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_FONT_UTILS_H
#define GFX_FONT_UTILS_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxPlatform.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxPlatform.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_PLATFORM_H
#define GFX_PLATFORM_H

#if 0 /* expanded by -frewrite-includes */
#include "prlog.h"
#endif /* expanded by -frewrite-includes */
#ifndef GFX_PREFS_H
#define GFX_PREFS_H

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxPrefs.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxPrefs.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Constants.h"   // for M_PI
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Constants.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* mfbt math constants. */

#ifndef mozilla_Constants_h
#define mozilla_Constants_h

#ifndef M_PI
#  define M_PI 3.14159265358979323846
#endif
# 15 "../../dist/include/mozilla/Constants.h"

#endif /* mozilla_Constants_h */
# 17 "../../dist/include/mozilla/Constants.h"
# 12 "../../dist/include/gfxPrefs.h" 2

// First time gfxPrefs::GetSingleton() needs to be called on the main thread,
// before any of the methods accessing the values are used, but after
// keep working, and behave as if the user never changes the preference.
// Things are a bit more complicated and perhaps even dangerous when
// going from Once to Live, or indeed setting a preference to be Live
// in the first place, so be careful.  You need to be ready for the
// values changing mid execution, and if you're using those preferences
// in any setup and initialization, you may need to do extra work.

// Note 2: Prefs can be set by using the corresponding Set method. For
// example, if the accessor is Foo() then calling SetFoo(...) will update
// the preference and also change the return value of subsequent Foo() calls.
// This is true even for 'Once' prefs which otherwise do not change if the
// pref is updated after initialization.

#define DECL_GFX_PREF(Update, Pref, Name, Type, Default)                     \
public:                                                                       \
static Type Name() { MOZ_ASSERT(SingletonExists()); return GetSingleton().mPref##Name.mValue; } \
static void Set##Name(Type aVal) { MOZ_ASSERT(SingletonExists()); \
    GetSingleton().mPref##Name.Set(UpdatePolicy::Update, Get##Name##PrefName(), aVal); } \
private:                                                                      \
static const char* Get##Name##PrefName() { return Pref; }                     \
static Type Get##Name##PrefDefault() { return Default; }                      \
PrefTemplate<UpdatePolicy::Update, Type, Get##Name##PrefDefault, Get##Name##PrefName> mPref##Name

class PreferenceAccessImpl;
class gfxPrefs;
class gfxPrefs MOZ_FINAL
{
private:
  /// See Logging.h.  This lets Moz2D access preference values it owns.
  PreferenceAccessImpl* mMoz2DPrefAccess;

private:
  // Enums for the update policy.
  enum class UpdatePolicy {
    Skip, // Set the value to default, skip any Preferences calls
    Once, // Evaluate the preference once, unchanged during the session
    Live  // Evaluate the preference and set callback so it stays current/live
  };

  // Since we cannot use const char*, use a function that returns it.
  template <UpdatePolicy Update, class T, T Default(void), const char* Pref(void)>
  class PrefTemplate
  {
  public:
    PrefTemplate()
    : mValue(Default())
    {
      Register(Update, Pref());
    }
    void Register(UpdatePolicy aUpdate, const char* aPreference)
    {
      AssertMainThread();
      switch(aUpdate) {
        case UpdatePolicy::Skip:
          break;
        case UpdatePolicy::Once:
          mValue = PrefGet(aPreference, mValue);
          break;
        case UpdatePolicy::Live:
          PrefAddVarCache(&mValue,aPreference, mValue);
          break;
        default:
          MOZ_CRASH();
          break;
      }
    }
    void Set(UpdatePolicy aUpdate, const char* aPref, T aValue)
    {
      AssertMainThread();
      PrefSet(aPref, aValue);
      switch (aUpdate) {
        case UpdatePolicy::Skip:
        case UpdatePolicy::Live:
          break;
        case UpdatePolicy::Once:
          mValue = PrefGet(aPref, mValue);
          break;
        default:
          MOZ_CRASH();
          break;
      }
    }
    T mValue;
  };

  // This is where DECL_GFX_PREF for each of the preferences should go.
  DECL_GFX_PREF(Live, "apz.min_skate_speed",                   APZMinSkateSpeed, float, 1.0f);
  DECL_GFX_PREF(Live, "apz.num_paint_duration_samples",        APZNumPaintDurationSamples, int32_t, 3);
  DECL_GFX_PREF(Live, "apz.overscroll.enabled",                APZOverscrollEnabled, bool, false);
  DECL_GFX_PREF(Live, "apz.overscroll.min_pan_distance_ratio", APZMinPanDistanceRatio, float, 1.0f);
  DECL_GFX_PREF(Live, "apz.overscroll.stretch_factor",         APZOverscrollStretchFactor, float, 0.5f);
  DECL_GFX_PREF(Live, "apz.overscroll.spring_stiffness",       APZOverscrollSpringStiffness, float, 0.001f);
  DECL_GFX_PREF(Live, "apz.overscroll.spring_friction",        APZOverscrollSpringFriction, float, 0.015f);
  DECL_GFX_PREF(Live, "apz.overscroll.stop_distance_threshold", APZOverscrollStopDistanceThreshold, float, 5.0f);
  DECL_GFX_PREF(Live, "apz.overscroll.stop_velocity_threshold", APZOverscrollStopVelocityThreshold, float, 0.01f);
  DECL_GFX_PREF(Live, "apz.pan_repaint_interval",              APZPanRepaintInterval, int32_t, 250);
  DECL_GFX_PREF(Live, "apz.printtree",                         APZPrintTree, bool, false);
  DECL_GFX_PREF(Live, "apz.smooth_scroll_repaint_interval",    APZSmoothScrollRepaintInterval, int32_t, 75);
  DECL_GFX_PREF(Once, "apz.test.logging_enabled",              APZTestLoggingEnabled, bool, false);
  DECL_GFX_PREF(Live, "apz.touch_start_tolerance",             APZTouchStartTolerance, float, 1.0f/4.5f);
  DECL_GFX_PREF(Live, "apz.use_paint_duration",                APZUsePaintDuration, bool, true);
  DECL_GFX_PREF(Live, "apz.velocity_bias",                     APZVelocityBias, float, 1.0f);
  DECL_GFX_PREF(Live, "apz.velocity_relevance_time_ms",        APZVelocityRelevanceTime, uint32_t, 150);
  DECL_GFX_PREF(Live, "apz.x_skate_size_multiplier",           APZXSkateSizeMultiplier, float, 1.5f);
  DECL_GFX_PREF(Live, "apz.x_stationary_size_multiplier",      APZXStationarySizeMultiplier, float, 3.0f);
  DECL_GFX_PREF(Live, "apz.y_skate_size_multiplier",           APZYSkateSizeMultiplier, float, 2.5f);
  DECL_GFX_PREF(Live, "apz.y_stationary_size_multiplier",      APZYStationarySizeMultiplier, float, 3.5f);
  DECL_GFX_PREF(Live, "apz.zoom_animation_duration_ms",        APZZoomAnimationDuration, int32_t, 250);

  DECL_GFX_PREF(Once, "gfx.android.rgb16.force",               AndroidRGB16Force, bool, false);
#if defined(ANDROID)
  DECL_GFX_PREF(Once, "gfx.apitrace.enabled",                  UseApitrace, bool, false);
#endif
# 191 "../../dist/include/gfxPrefs.h"
  DECL_GFX_PREF(Live, "gfx.canvas.auto_accelerate.min_frames", CanvasAutoAccelerateMinFrames, int32_t, 30);
  DECL_GFX_PREF(Live, "gfx.canvas.auto_accelerate.min_seconds", CanvasAutoAccelerateMinSeconds, float, 5.0f);
  DECL_GFX_PREF(Live, "gfx.canvas.auto_accelerate.min_calls",  CanvasAutoAccelerateMinCalls, int32_t, 4);
public:
  // Manage the singleton:
  static gfxPrefs& GetSingleton()
  {
    MOZ_ASSERT(!sInstanceHasBeenDestroyed, "Should never recreate a gfxPrefs instance!");
    if (!sInstance) {
      sInstance = new gfxPrefs;
    }
    MOZ_ASSERT(SingletonExists());
    return *sInstance;
  }
  static void DestroySingleton();
  static bool SingletonExists();

private:
  static gfxPrefs* sInstance;
  static bool sInstanceHasBeenDestroyed;

private:
  // Creating these to avoid having to include Preferences.h in the .h
  static void PrefAddVarCache(bool*, const char*, bool);
  static void PrefAddVarCache(int32_t*, const char*, int32_t);
  static void PrefAddVarCache(uint32_t*, const char*, uint32_t);
  static void PrefAddVarCache(float*, const char*, float);
  static bool PrefGet(const char*, bool);
  static int32_t PrefGet(const char*, int32_t);
  static uint32_t PrefGet(const char*, uint32_t);
  static float PrefGet(const char*, float);
  static void PrefSet(const char* aPref, bool aValue);
  static void PrefSet(const char* aPref, int32_t aValue);
  static void PrefSet(const char* aPref, uint32_t aValue);
  static void PrefSet(const char* aPref, float aValue);

  static void AssertMainThread();

  gfxPrefs();
  ~gfxPrefs();
  gfxPrefs(const gfxPrefs&) = delete;
  gfxPrefs& operator=(const gfxPrefs&) = delete;
};

#undef DECL_GFX_PREF /* Don't need it outside of this file */

#endif /* GFX_PREFS_H */
# 389 "../../dist/include/gfxPrefs.h"
# 17 "../../dist/include/gfxPlatform.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/gfxPlatform.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxFontFamilyList.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/gfxPlatform.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxBlur.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxBlur.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_BLUR_H
#define GFX_BLUR_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxBlur.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxBlur.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/gfxBlur.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxPoint.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxBlur.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxBlur.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/gfxBlur.h"

class gfxContext;
struct gfxRect;
struct gfxRGBA;
class gfxMatrix;

namespace mozilla {
  namespace gfx {
    class AlphaBoxBlur;
    struct RectCornerRadii;
    class SourceSurface;
    class DrawTarget;
  }
}

/**
 * Implementation of a triple box blur approximation of a Gaussian blur.
 */
class gfxAlphaBoxBlur
{
    typedef mozilla::gfx::RectCornerRadii RectCornerRadii;

public:
    ;

    ;

    /**
     * Constructs a box blur and initializes the temporary surface.
     * @param aRect The coordinates of the surface to create in device units.
     *
     * @param aBlurRadius The blur radius in pixels.  This is the radius of
     *   the entire (triple) kernel function.  Each individual box blur has
      */
    mozilla::UniquePtr<mozilla::gfx::AlphaBoxBlur> mBlur;
};

#endif /* GFX_BLUR_H */
# 159 "../../dist/include/gfxBlur.h"
# 20 "../../dist/include/gfxPlatform.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsRect.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/gfxPlatform.h"

#if 0 /* expanded by -frewrite-includes */
#include "qcms.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/qcms.h" 1
#ifndef QCMS_H
#define QCMS_H

#ifdef  __cplusplus
extern "C" {
#endif
# 7 "../../dist/include/qcms.h"

/* if we've already got an ICC_H header we can ignore the following */
#ifndef ICC_H
/* icc34 defines */

/***************************************************************** 
 Copyright (c) 1994-1996 SunSoft, Inc.

 * don't use the same objects on different threads at the same time.
 */

/* 
 * Color Space Signatures
 * Note that only icSigXYZData and icSigLabData are valid
 * Profile Connection Spaces (PCSs)
 */ 
typedef enum {
    icSigXYZData                        = 0x58595A20L,  /* 'XYZ ' */
    icSigLabData                        = 0x4C616220L,  /* 'Lab ' */
    icSigLuvData                        = 0x4C757620L,  /* 'Luv ' */
    icSigYCbCrData                      = 0x59436272L,  /* 'YCbr' */
    icSigYxyData                        = 0x59787920L,  /* 'Yxy ' */
    icSigRgbData                        = 0x52474220L,  /* 'RGB ' */
    icSigGrayData                       = 0x47524159L,  /* 'GRAY' */
    icSigHsvData                        = 0x48535620L,  /* 'HSV ' */
    icSig15colorData                    = 0x46434C52L,  /* 'FCLR' */
    icMaxEnumData                       = 0xFFFFFFFFL   
} icColorSpaceSignature;
#endif
# 83 "../../dist/include/qcms.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 85 "../../dist/include/qcms.h"

typedef int qcms_bool;

struct _qcms_transform;
typedef struct _qcms_transform qcms_transform;

struct _qcms_profile;
typedef struct _qcms_profile qcms_profile;

;

;

;

;

;

#ifdef  __cplusplus
}
#endif
# 178 "../../dist/include/qcms.h"

#endif
# 180 "../../dist/include/qcms.h"
# 23 "../../dist/include/gfxPlatform.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/gfxPlatform.h"
#if 0 /* expanded by -frewrite-includes */
#include "GfxInfoCollector.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/GfxInfoCollector.h" 1
/* vim: se cin sw=2 ts=2 et : */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __mozilla_widget_GfxInfoCollector_h__
#define __mozilla_widget_GfxInfoCollector_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/GfxInfoCollector.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringFwd.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/GfxInfoCollector.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/GfxInfoCollector.h"

namespace mozilla {
namespace widget {


/* this is handy wrapper around JSAPI to make it more pleasant to use.
 * We collect the JSAPI errors and so that callers don't need to */
class MOZ_STACK_CLASS InfoObject
{
  friend class GfxInfoBase;

  public:
  ;
  ;
  ;

  private:
  // We need to ensure that this object lives on the stack so that GC sees it properly
  ;
  ;

  JSContext *mCx;
  JS::Rooted<JSObject*> mObj;
  bool mOk;
};

/*

   GfxInfo object. e.g.

       gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfo);
       info = gfxInfo.getInfo();
       if (info.awesome)
          alert(info.awesome);

*/

class GfxInfoCollectorBase
{
  public:
  ;
  ;
  ;
};

template<class T>
class GfxInfoCollector : public GfxInfoCollectorBase
{
  public:
  
  

  protected:
  T* mPointer;
  void (T::*mFunc)(InfoObject &obj);

};

}
}
# 13 "../../dist/include/mozilla/layers/CompositorTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Types.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/layers/CompositorTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EnumSet.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EnumSet.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* A set abstraction for enumeration values. */

#ifndef mozilla_EnumSet_h
#define mozilla_EnumSet_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/EnumSet.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/EnumSet.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/EnumSet.h"

namespace mozilla {

/**
 * EnumSet<T> is a set of values defined by an enumeration. It is implemented
 * using a 32 bit mask for each value so it will only work for enums with an int
 * representation less than 32. It works both for enum and enum class types.
 */
template<typename T>
class EnumSet
{
public:
  

  MOZ_IMPLICIT EnumSet(T aEnum)
    : mBitField(bitFor(aEnum))
  { }

  

  

  

  

  /**
   * Add an element
   */
  


  /**
   * Equality
   */
  bool operator==(const EnumSet<T> aEnumSet) const
  {
    return mBitField == aEnumSet.mBitField;
  }

  /**
   * Test is an element is contained in the set.
   */
  

  /**
   * Return the number of elements in the set.
   */
  

  

  

  

private:
  static uint32_t bitFor(T aEnum)
  {
    uint32_t bitNumber = (uint32_t)aEnum;
    MOZ_ASSERT(bitNumber < 32);
    return 1U << bitNumber;
  }

  uint32_t mBitField;
};

} // namespace mozilla

#endif /* mozilla_EnumSet_h_*/
# 207 "../../dist/include/mozilla/EnumSet.h"
# 15 "../../dist/include/mozilla/layers/CompositorTypes.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TypedEnumBits.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/layers/CompositorTypes.h"

namespace mozilla {
namespace layers {

/**
 * Flags used by texture clients and texture hosts. These are passed from client
 * side to host side when textures and compositables are created. Usually set
 * by the compositableCient, they may be modified by either the compositable or
 * texture clients.
 */
enum class TextureFlags : uint32_t {
  NO_FLAGS           = 0,
  // Use nearest-neighbour texture filtering (as opposed to linear filtering).
  USE_NEAREST_FILTER = 1 << 0,
  // The compositor assumes everything is origin-top-left by default.
  ORIGIN_BOTTOM_LEFT = 1 << 1,
  // Force the texture to be represented using a single tile (note that this means
  // tiled textures, not tiled layers).
  // deallocation.
  // The default behaviour is to deallocate on the host side.
  DEALLOCATE_CLIENT  = 1 << 6,
  // After being shared ith the compositor side, an immutable texture is never
  // modified, it can only be read. It is safe to not Lock/Unlock immutable
  // textures.
  IMMUTABLE          = 1 << 7,
  // The contents of the texture must be uploaded or copied immediately
  // during the transaction, because the producer may want to write
  // to it again.
  IMMEDIATE_UPLOAD   = 1 << 8,
  // The texture is part of a component-alpha pair
  COMPONENT_ALPHA    = 1 << 9,

  // OR union of all valid bits
  ALL_BITS           = (1 << 10) - 1,
  // the default flags
  DEFAULT = NO_FLAGS
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(TextureFlags)



/**
 * The type of debug diagnostic to enable.
 */
enum class DiagnosticTypes : uint8_t {
  NO_DIAGNOSTIC    = 0,
  TILE_BORDERS     = 1 << 0,
  LAYER_BORDERS    = 1 << 1,
  BIGIMAGE_BORDERS = 1 << 2,
  FLASH_BORDERS    = 1 << 3,
  ALL_BITS         = (1 << 4) - 1
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(DiagnosticTypes)

#define DIAGNOSTIC_FLASH_COUNTER_MAX 100

/**
 * Information about the object that is being diagnosed.
 */
enum class DiagnosticFlags : uint16_t {
  NO_DIAGNOSTIC   = 0,
  IMAGE           = 1 << 0,
  CONTENT         = 1 << 1,
  CANVAS          = 1 << 2,
  COLOR           = 1 << 3,
  CONTAINER       = 1 << 4,
  YCBCR,
  COMPONENT_ALPHA,
  SOLID_COLOR,
  RENDER_TARGET,
  VR_DISTORTION,
  MAX  //sentinel for the count of all effect types
};

/**
 * How the Compositable should manage textures.
 */
enum class CompositableType : uint8_t {
  UNKNOWN,
  CONTENT_TILED,   // tiled painted layer
  IMAGE,           // image with single buffering
  IMAGE_OVERLAY,   // image without buffer
  IMAGE_BRIDGE,    // ImageBridge protocol
  CONTENT_SINGLE,  // painted layer interface, single buffering
  CONTENT_DOUBLE,  // painted layer interface, double buffering
  COUNT
};

#ifdef XP_WIN
typedef void* SyncHandle;
#else
# 148 "../../dist/include/mozilla/layers/CompositorTypes.h"
typedef uintptr_t SyncHandle;
#endif // XP_WIN
# 150 "../../dist/include/mozilla/layers/CompositorTypes.h"

/**
 * Sent from the compositor to the content-side LayerManager, includes properties
/**
 * Information required by the compositor from the content-side for creating or
 * using compositables and textures.
 * XXX - TextureInfo is a bad name: this information is useful for the compositable,
 * not the Texture. And ith new Textures, only the compositable type is really
 * useful. This may (should) be removed in the near future.
 */
struct TextureInfo
{
  CompositableType mCompositableType;
  TextureFlags mTextureFlags;

  

  

  
};

/**
 * How a SurfaceDescriptor will be opened.
 *
 * See ShadowLayerForwarder::OpenDescriptor for example.
 */
enum class OpenMode : uint8_t {
  OPEN_NONE        = 0,
  OPEN_READ        = 0x1,
  OPEN_WRITE       = 0x2,
  OPEN_READ_WRITE  = OPEN_READ|OPEN_WRITE,
  OPEN_READ_ONLY   = OPEN_READ,
  OPEN_WRITE_ONLY  = OPEN_WRITE
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(OpenMode)

// The kinds of mask texture a shader can support
// We rely on the items in this enum being sequential
enum class MaskType : uint8_t {
  MaskNone = 0,   // no mask layer
  Mask2d,         // mask layer for layers with 2D transforms
  Mask3d,         // mask layer for layers with 3D transforms
  NumMaskTypes
};

} // namespace layers
} // namespace mozilla

#endif
# 240 "../../dist/include/mozilla/layers/CompositorTypes.h"
# 28 "../../dist/include/gfxPlatform.h" 2

class gfxASurface;
class gfxFont;
class gfxFontGroup;
struct gfxFontStyle;
class gfxUserFontSet;
class gfxFontEntry;
class gfxPlatformFontList;
class gfxTextRun;
class nsIURI;
class nsIAtom;
class nsIObserver;
class SRGBOverrideObserver;
struct gfxRGBA;

namespace mozilla {
namespace gl {
class GLContext;
class SkiaGLGlue;
}
namespace gfx {
class DrawTarget;
class SourceSurface;
class DataSourceSurface;
class ScaledFont;
class DrawEventRecorder;
class VsyncSource;


}
}

#define MOZ_PERFORMANCE_WARNING(module, ...) \
  do { \
    if (gfxPrefs::PerfWarnings()) { \
      printf_stderr("[" module "] " __VA_ARGS__); \
    } \
  } while (0)

extern cairo_user_data_key_t kDrawTarget;

// pref lang id's for font prefs
// !!! needs to match the list of pref font.default.xx entries listed in all.js !!!
// !!! don't use as bit mask, this may grow larger !!!

enum eFontPrefLang {
    eFontPrefLang_Western     =  0,
  OK = 0,
  HUNG,
  REMOVED,
  RESET,
  DRIVER_ERROR,
  INVALID_CALL
};

class gfxPlatform {
    friend class SRGBOverrideObserver;

public:
    typedef mozilla::gfx::Color Color;
    typedef mozilla::gfx::DataSourceSurface DataSourceSurface;
    typedef mozilla::gfx::DrawTarget DrawTarget;
    typedef mozilla::gfx::IntSize IntSize;
    typedef mozilla::gfx::SourceSurface SourceSurface;

    /**
     * Return a pointer to the current active platform.
     * This is a singleton; it contains mostly convenience
     * functions to obtain platform-specific objects.
     */
    static gfxPlatform *GetPlatform();


    /**
     * Shut down Thebes.
     * Init() arranges for this to be called at an appropriate time.
     */
    ;

    ;
    ;

    /**
     * Create an offscreen surface of the given dimensions
     * and image format.
     */
    ;

    /**
     * Beware that these methods may return DrawTargets which are not fully supported
     * on the current platform and might fail silently in subtle ways. This is a massive
     * potential footgun. You should only use these methods for canvas drawing really.
     * Use extreme caution if you use them for content where you are not 100% sure we
     * support the DrawTarget we get back.
     * See SupportsAzureContentForDrawTarget.
     */
    virtual mozilla::TemporaryRef<DrawTarget>
      CreateDrawTargetForSurface(gfxASurface *aSurface, const mozilla::gfx::IntSize& aSize);

    ;

    /*
     * Creates a SourceSurface for a gfxASurface. This function does no caching,
     * so the caller should cache the gfxASurface if it will be used frequently.
     * The returned surface keeps a reference to aTarget, so it is OK to keep the
     * surface, even if aTarget changes.
     * aTarget should not keep a reference to the returned surface because that
     * will cause a cycle.
     *
     * This function is static so that it can be accessed from
     * PluginInstanceChild (where we can't call gfxPlatform::GetPlatform()
     * because the prefs service can only be accessed from the main process).
     */
    ;

    ;

    ;

    virtual mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
      GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont);

    ;

    mozilla::TemporaryRef<DrawTarget>
      CreateOffscreenCanvasDrawTarget(const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat);

    ;

    /**
     * Returns true if rendering to data surfaces produces the same results as
     * rendering to offscreen surfaces on this platform, making it safe to
     * render content to data surfaces. This is generally false on platforms
     * which use different backends for each type of DrawTarget.
     */
    

    /**
     * Returns true if we should use Azure to render content with aTarget. For
     * example, it is possible that we are using Direct2D for rendering and thus
     * using Azure. But we want to render to a CairoDrawTarget, in which case
     * SupportsAzureContent will return true but SupportsAzureContentForDrawTarget
     * will return false.
     */
    ;

    

    /// This function lets us know if the current preferences/platform
    /// combination allows for both accelerated and not accelerated canvas
    /// implementations.  If it does, and other relevant preferences are
    virtual gfxFontGroup
    *CreateFontGroup(const mozilla::FontFamilyList& aFontFamilyList,
                     const gfxFontStyle *aStyle,
                     gfxUserFontSet *aUserFontSet) = 0;
                                          
                                          
    /**

    ;

    /**
     * Return the layer debugging options to use browser-wide.
     */
    ;

    

    mozilla::gl::SkiaGLGlue* GetSkiaGLGlue();
    ;

    

    ;

    bool HasEnoughTotalSystemMemoryForSkiaGL();

    /**
     * Get the hardware vsync source for each platform.
     * Should only exist and be valid on the parent process
     */
    

    /**
     * True if layout rendering should use ASAP mode, which means
     * the refresh driver and compositor should render ASAP.
     * Used for talos testing purposes
     */
    ;

protected:
};

#endif /* GFX_PLATFORM_H */
# 738 "../../dist/include/gfxPlatform.h"
# 10 "../../dist/include/gfxFontUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsComponentManagerUtils.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxFontUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/gfxFontUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxFontUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Likely.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxFontUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Endian.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/gfxFontUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/gfxFontUtils.h"

#if 0 /* expanded by -frewrite-includes */
#include "zlib.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/zlib.h" 1
/* zlib.h -- interface of the 'zlib' general purpose compression library
  version 1.2.8, April 28th, 2013

  Copyright (C) 1995-2013 Jean-loup Gailly and Mark Adler

  This software is provided 'as-is', without any express or implied
  warranty.  In no event will the authors be held liable for any damages
  arising from the use of this software.

  Permission is granted to anyone to use this software for any purpose,
  including commercial applications, and to alter it and redistribute it
  freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not
     claim that you wrote the original software. If you use this software
     in a product, an acknowledgment in the product documentation would be
     appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be
     misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

  Jean-loup Gailly        Mark Adler
  jloup@gzip.org          madler@alumni.caltech.edu


  The data format used by the zlib library is described by RFCs (Request for
  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
  (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
*/

#ifndef ZLIB_H
#define ZLIB_H

#if 0 /* expanded by -frewrite-includes */
#include "zconf.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/zconf.h" 1
/* zconf.h -- configuration of the zlib compression library
 * Copyright (C) 1995-2013 Jean-loup Gailly.
 * For conditions of distribution and use, see copyright notice in zlib.h
 */

/* @(#) $Id$ */

#ifndef ZCONF_H
#define ZCONF_H

/* This header does prefixing as below, but with an updated set of names. */
#if 0 /* expanded by -frewrite-includes */
#include "mozzconf.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozzconf.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZZCONF_H
#  define zError                z_zError
#  ifndef Z_SOLO
#    define zcalloc               z_zcalloc
#    define zcfree                z_zcfree
#  endif
# 127 "../../dist/include/zconf.h"
#  define zlibCompileFlags      z_zlibCompileFlags
#  define zlibVersion           z_zlibVersion

/* all zlib typedefs in zlib.h and zconf.h */
#  define Byte                  z_Byte
#  define Bytef                 z_Bytef
#  define alloc_func            z_alloc_func
#  define charf                 z_charf
#  define free_func             z_free_func
#  ifndef Z_SOLO
#    define gzFile                z_gzFile
#  endif
# 139 "../../dist/include/zconf.h"
#  define gz_header             z_gz_header
#  ifndef STDC
#    define STDC
#  endif
# 195 "../../dist/include/zconf.h"
#  if __STDC_VERSION__ >= 199901L
#    ifndef STDC99
#      define STDC99
#    endif
# 199 "../../dist/include/zconf.h"
#  endif
# 200 "../../dist/include/zconf.h"
#endif
# 201 "../../dist/include/zconf.h"
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
#  define STDC
#endif
# 204 "../../dist/include/zconf.h"
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
#  define STDC
#endif
# 207 "../../dist/include/zconf.h"
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
#  define STDC
#endif
# 210 "../../dist/include/zconf.h"
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
#  define STDC
#endif
# 213 "../../dist/include/zconf.h"

#if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
#  define STDC
#endif
# 217 "../../dist/include/zconf.h"

#ifndef STDC
#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
#    define const       /* note: need a more gentle solution here */
#  endif
# 222 "../../dist/include/zconf.h"
#endif
# 223 "../../dist/include/zconf.h"

#if defined(ZLIB_CONST) && !defined(z_const)
#  define z_const const
#else
# 227 "../../dist/include/zconf.h"
#  define z_const
#endif
# 229 "../../dist/include/zconf.h"

/* Some Mac compilers merge all .h files incorrectly: */
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
#  define NO_DUMMY_DECL
#endif
# 234 "../../dist/include/zconf.h"

/* Maximum value for memLevel in deflateInit2 */
#ifndef MAX_MEM_LEVEL
#  ifdef MAXSEG_64K
#    define MAX_MEM_LEVEL 8
#  else
# 240 "../../dist/include/zconf.h"
#    define MAX_MEM_LEVEL 9
#  endif
# 242 "../../dist/include/zconf.h"
#endif
# 243 "../../dist/include/zconf.h"

/* Maximum value for windowBits in deflateInit2 and inflateInit2.
 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
 * created by gzip. (Files created by minigzip can still be extracted by
 * gzip.)
 */
#ifndef MAX_WBITS
#  define MAX_WBITS   15 /* 32K LZ77 window */
#endif
# 252 "../../dist/include/zconf.h"

/* The memory requirements for deflate are (in bytes):
            (1 << (windowBits+2)) +  (1 << (memLevel+9))
 that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
 plus a few kilobytes for small objects. For example, if you want to reduce
 the default memory requirements from 256K to 128K, compile with
     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
 Of course this will generally degrade compression (there's no free lunch).

   The memory requirements for inflate are (in bytes) 1 << windowBits
 that is, 32K for windowBits=15 (default value) plus a few kilobytes
 for small objects.
*/

                        /* Type declarations */

#ifndef OF /* function prototypes */
#  ifdef STDC
#    define OF(args)  args
#  else
# 272 "../../dist/include/zconf.h"
#    define OF(args)  ()
#  endif
# 274 "../../dist/include/zconf.h"
#endif
# 275 "../../dist/include/zconf.h"

#ifndef Z_ARG /* function prototypes for stdarg */
#  if defined(STDC) || defined(Z_HAVE_STDARG_H)
#    define Z_ARG(args)  args
#  else
# 280 "../../dist/include/zconf.h"
#    define Z_ARG(args)  ()
#  endif
# 282 "../../dist/include/zconf.h"
#endif
# 283 "../../dist/include/zconf.h"

/* The following definitions for FAR are needed only for MSDOS mixed
 * model programming (small or medium model with some far allocations).
 * This was tested only with MSC; for other MSDOS compilers you may have
 * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
 * just define FAR to be empty.
 */
#ifdef SYS16BIT
#  if defined(M_I86SM) || defined(M_I86MM)
#    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
#      ifdef ZLIB_INTERNAL
#        define ZEXTERN extern __declspec(dllexport)
#      else
# 320 "../../dist/include/zconf.h"
#        define ZEXTERN extern __declspec(dllimport)
#      endif
# 322 "../../dist/include/zconf.h"
#    endif
# 323 "../../dist/include/zconf.h"
#  endif  /* ZLIB_DLL */
# 324 "../../dist/include/zconf.h"
   /* If building or using zlib with the WINAPI/WINAPIV calling convention,
    * define ZLIB_WINAPI.
    * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
    */
#  ifdef ZLIB_WINAPI
#    ifdef FAR
#      undef FAR
#    endif
# 332 "../../dist/include/zconf.h"
#if 0 /* expanded by -frewrite-includes */
#    include <windows.h>
#endif /* expanded by -frewrite-includes */
# 333 "../../dist/include/zconf.h"
     /* No need for _export, use ZLIB.DEF instead. */
     /* For complete Windows compatibility, use WINAPI, not __stdcall. */
#    define ZEXPORT WINAPI
#    ifdef WIN32
#      define ZEXPORTVA WINAPIV
#    else
# 339 "../../dist/include/zconf.h"
#      define ZEXPORTVA FAR CDECL
#    endif
# 341 "../../dist/include/zconf.h"
#  endif
# 354 "../../dist/include/zconf.h"
#endif
# 355 "../../dist/include/zconf.h"

#ifndef ZEXTERN
#  define ZEXTERN extern
#endif
# 359 "../../dist/include/zconf.h"
#ifndef ZEXPORT
#  define ZEXPORT
#endif
# 362 "../../dist/include/zconf.h"
#ifndef ZEXPORTVA
#  define ZEXPORTVA
#endif
# 365 "../../dist/include/zconf.h"

#ifndef FAR
#  define FAR
#endif
# 369 "../../dist/include/zconf.h"

#if !defined(__MACTYPES__)
typedef unsigned char  Byte;  /* 8 bits */
#endif
# 373 "../../dist/include/zconf.h"
typedef unsigned int   uInt;  /* 16 bits or more */
typedef unsigned long  uLong; /* 32 bits or more */

#ifdef SMALL_MEDIUM
   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
#  define Bytef Byte FAR
#else
# 380 "../../dist/include/zconf.h"
   typedef Byte  FAR Bytef;
#endif
# 382 "../../dist/include/zconf.h"
typedef char  FAR charf;
typedef int   FAR intf;
typedef uInt  FAR uIntf;
typedef uLong FAR uLongf;

#ifdef STDC
   typedef void const *voidpc;
   typedef void FAR   *voidpf;
   typedef void       *voidp;
#else
# 392 "../../dist/include/zconf.h"
   typedef Byte const *voidpc;
   typedef Byte FAR   *voidpf;
   typedef Byte       *voidp;
#endif
# 396 "../../dist/include/zconf.h"

#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)
#if 0 /* expanded by -frewrite-includes */
#  include <limits.h>
#endif /* expanded by -frewrite-includes */
# 399 "../../dist/include/zconf.h"
#  if (UINT_MAX == 0xffffffffUL)
#    define Z_U4 unsigned
#  elif (ULONG_MAX == 0xffffffffUL)
# 402 "../../dist/include/zconf.h"
#    define Z_U4 unsigned long
#  elif (USHRT_MAX == 0xffffffffUL)
# 404 "../../dist/include/zconf.h"
#    define Z_U4 unsigned short
#  endif
# 406 "../../dist/include/zconf.h"
#endif
# 407 "../../dist/include/zconf.h"

#ifdef Z_U4
   typedef Z_U4 z_crc_t;
#else
# 411 "../../dist/include/zconf.h"
   typedef unsigned long z_crc_t;
#endif
# 413 "../../dist/include/zconf.h"

#ifdef HAVE_UNISTD_H    /* may be set to #if 1 by ./configure */
#  define Z_HAVE_UNISTD_H
#endif
# 417 "../../dist/include/zconf.h"

#ifdef HAVE_STDARG_H    /* may be set to #if 1 by ./configure */
#  define Z_HAVE_STDARG_H
#endif
# 421 "../../dist/include/zconf.h"

#ifdef STDC
#  ifndef Z_SOLO
#if 0 /* expanded by -frewrite-includes */
#    include <sys/types.h>      /* for off_t */
#endif /* expanded by -frewrite-includes */
# 425 "../../dist/include/zconf.h"
#  endif
# 426 "../../dist/include/zconf.h"
#endif
# 427 "../../dist/include/zconf.h"

#if defined(STDC) || defined(Z_HAVE_STDARG_H)
#  ifndef Z_SOLO
#if 0 /* expanded by -frewrite-includes */
#    include <stdarg.h>         /* for va_list */
#endif /* expanded by -frewrite-includes */
# 431 "../../dist/include/zconf.h"
#  endif
# 432 "../../dist/include/zconf.h"
#endif
# 433 "../../dist/include/zconf.h"

#ifdef _WIN32
#  ifndef Z_SOLO
#if 0 /* expanded by -frewrite-includes */
#    include <stddef.h>         /* for wchar_t */
#endif /* expanded by -frewrite-includes */
# 437 "../../dist/include/zconf.h"
#  endif
# 438 "../../dist/include/zconf.h"
#endif
# 439 "../../dist/include/zconf.h"

/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
 * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
 * though the former does not conform to the LFS document), but considering
 * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
 * equivalently requesting no 64-bit operations
 */
#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1
#  undef _LARGEFILE64_SOURCE
#endif
# 449 "../../dist/include/zconf.h"

#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
#  define Z_HAVE_UNISTD_H
#endif
# 453 "../../dist/include/zconf.h"
#ifndef Z_SOLO
#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
#if 0 /* expanded by -frewrite-includes */
#    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 1 3 4
        3/26/98 CHW at Apple added real interface to searchfs call
  	3/5/98  CHW at Apple added hfs semantic system calls headers
*/

#ifndef _UNISTD_H_
#define	_UNISTD_H_

#if 0 /* expanded by -frewrite-includes */
#include <_types.h>
#endif /* expanded by -frewrite-includes */
# 72 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/unistd.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/unistd.h" 1 3 4
/*
 * 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.
 *
 *	@(#)unistd.h	8.2 (Berkeley) 1/7/94
 */

#ifndef _SYS_UNISTD_H_
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/unistd.h" 3 4

#define	_POSIX_VERSION		200112L
#define	_POSIX2_VERSION		200112L

/* execution-time symbolic constants */
				/* may disable terminal special characters */
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_posix_vdisable.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_posix_vdisable.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
	int ad_pad[2];
};
#define ACCESSX_MAX_DESCRIPTORS	100
#define ACCESSX_MAX_TABLESIZE	(16 * 1024)
#endif
#define	_PC_SYMLINK_MAX		24	/* Max # of bytes in symlink name */
#define	_PC_SYNC_IO		25	/* Sync I/O [SIO] supported? */
#define _PC_XATTR_SIZE_BITS 	26	/* # of bits to represent maximum xattr size */

/* configurable system strings */
#define	_CS_PATH		 1

#if __DARWIN_C_LEVEL >= __DARWIN_C_FULL

#if 0 /* expanded by -frewrite-includes */
#include <machine/_types.h>
#endif /* expanded by -frewrite-includes */
# 179 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/unistd.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_size_t.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 1 3 4
/*
 * Copyright (c) 2003-2012 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
typedef __darwin_size_t        size_t; 
#endif  /* _SIZE_T */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_types/_size_t.h" 3 4
# 195 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/unistd.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_ssize_t.h>
#endif /* expanded by -frewrite-includes */
# 196 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/unistd.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 197 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/unistd.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_uid_t.h>
#endif /* expanded by -frewrite-includes */
# 198 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/unistd.h" 3 4
 __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
 __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);

__END_DECLS

#endif /* __DARWIN_C_LEVEL >= 200809L */
# 214 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/unistd.h" 3 4
#define	_POSIX2_LOCALEDEF		200112L		/* localedef command */
#define	_POSIX2_PBS			(-1)
#define	_POSIX2_PBS_ACCOUNTING		(-1)
#define	_POSIX2_PBS_CHECKPOINT		(-1)
#define	_POSIX2_PBS_LOCATE		(-1)
#define	_POSIX2_PBS_MESSAGE		(-1)
#define	_POSIX2_PBS_TRACK		(-1)
#define	_POSIX2_SW_DEV			200112L
#define	_POSIX2_UPE			200112L	/* XXXX no fc, newgrp, tabs */
#endif /* __DARWIN_C_LEVEL */
# 165 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4

#define	__ILP32_OFF32          (-1)
#define	__ILP32_OFFBIG         (1)
#define	__LP64_OFF64           (1)
#define	__LPBIG_OFFBIG         (1)

#if __DARWIN_C_LEVEL >= 200112L
#define	_POSIX_V6_ILP32_OFF32		__ILP32_OFF32
#define	_POSIX_V6_ILP32_OFFBIG		__ILP32_OFFBIG
#define	_POSIX_V6_LP64_OFF64		__LP64_OFF64
#define	_POSIX_V6_LPBIG_OFFBIG		__LPBIG_OFFBIG
#endif /* __DARWIN_C_LEVEL >= 200112L */
# 177 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4

#if (__DARWIN_C_LEVEL >= 199506L && __DARWIN_C_LEVEL < 200809L) || __DARWIN_C_LEVEL >= __DARWIN_C_FULL
/* Removed in Issue 7 */
#define	_XBS5_ILP32_OFF32		    __ILP32_OFF32
#define	_XBS5_ILP32_OFFBIG		    __ILP32_OFFBIG
#define	_XBS5_LP64_OFF64		    __LP64_OFF64
#define	_XBS5_LPBIG_OFFBIG		    __LPBIG_OFFBIG
#endif /* __DARWIN_C_LEVEL < 200809L */
# 199 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4

#if __DARWIN_C_LEVEL >= 199506L /* This really should be XSI */ 
#define	_XOPEN_CRYPT			(1)
#define	_XOPEN_ENH_I18N			(1)		/* XXX required */
#define	_XOPEN_LEGACY			(-1)	/* no ftime gcvt, wcswcs */
#define	_XOPEN_REALTIME			(-1)	/* no q'ed signals, mq_* */
#define	_XOPEN_REALTIME_THREADS		(-1)	/* no posix_spawn, et. al. */
#define	_XOPEN_SHM			(1)
 *
 *	@(#)select.h	8.2 (Berkeley) 1/4/94
 */

#ifndef _SYS_SELECT_H_
#define	_SYS_SELECT_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/appleapiopts.h>
#endif /* expanded by -frewrite-includes */
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_fd_set.h>
#endif /* expanded by -frewrite-includes */
# 102 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/select.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_fd_clr.h>
#endif	/* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 109 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/select.h" 3 4


__BEGIN_DECLS

#ifndef  __MWERKS__
int	 pselect(int, fd_set * __restrict, fd_set * __restrict,
		fd_set * __restrict, const struct timespec * __restrict,
		const sigset_t * __restrict)
#if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT)
		__DARWIN_EXTSN_C(pselect)
#else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */
# 120 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/select.h" 3 4
#  if defined(__LP64__) && !__DARWIN_NON_CANCELABLE
		__DARWIN_1050(pselect)
#  else /* !__LP64__ || __DARWIN_NON_CANCELABLE */
# 123 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/select.h" 3 4
		__DARWIN_ALIAS_C(pselect)
#  endif /* __LP64__ && !__DARWIN_NON_CANCELABLE */
# 125 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/select.h" 3 4
#endif /* _DARWIN_C_SOURCE || _DARWIN_UNLIMITED_SELECT */
# 126 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/select.h" 3 4
		;
#endif /* __MWERKS__ */
# 128 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/select.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/_select.h>	/* select() prototype */
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_select.h" 1 3 4
/*
 * FD_SETSIZE will return an error of EINVAL.
 */
#ifndef _SYS__SELECT_H_
#define	_SYS__SELECT_H_

int	 select(int, fd_set * __restrict, fd_set * __restrict,
		fd_set * __restrict, struct timeval * __restrict)
#if defined(_DARWIN_C_SOURCE) || defined(_DARWIN_UNLIMITED_SELECT)
		__DARWIN_EXTSN_C(select)
#else /* !_DARWIN_C_SOURCE && !_DARWIN_UNLIMITED_SELECT */
# 44 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_select.h" 3 4
#  if defined(__LP64__) && !__DARWIN_NON_CANCELABLE
		__DARWIN_1050(select)
#  else /* !__LP64__ || __DARWIN_NON_CANCELABLE */
# 47 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_select.h" 3 4
		__DARWIN_ALIAS_C(select)
#  endif /* __LP64__ && !__DARWIN_NON_CANCELABLE */
# 49 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_select.h" 3 4
#endif /* _DARWIN_C_SOURCE || _DARWIN_UNLIMITED_SELECT */
# 50 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_select.h" 3 4
		;

#endif /* !_SYS__SELECT_H_ */
# 53 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/_select.h" 3 4
# 130 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/select.h" 2 3 4

__END_DECLS


#endif /* !_SYS_SELECT_H_ */
# 135 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/select.h" 3 4
# 634 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 2 3 4
void	 _Exit(int) __dead2;
;
;
;
;
;
;
;
;
#if defined(__has_include)
#if (0)/*__has_include(<gethostuuid_private.h>)*/
#if 0 /* expanded by -frewrite-includes */
#include <gethostuuid_private.h>
#endif /* expanded by -frewrite-includes */
# 652 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4
#else

#ifndef __GETHOSTUUID_H
#define __GETHOSTUUID_H

#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_timespec.h>
#endif /* expanded by -frewrite-includes */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/gethostuuid.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types/_uuid_t.h>
#endif /* expanded by -frewrite-includes */
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/gethostuuid.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/gethostuuid.h" 3 4

#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0)
int gethostuuid(uuid_t, const struct timespec *) __OSX_AVAILABLE_BUT_DEPRECATED_MSG(__MAC_NA, __MAC_NA, __IPHONE_2_0, __IPHONE_5_0, "gethostuuid() is no longer supported");
#else
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/gethostuuid.h" 3 4
 __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA);
#endif
# 41 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/gethostuuid.h" 3 4

#endif /* __GETHOSTUUID_H */
# 43 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/gethostuuid.h" 3 4
# 654 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 2 3 4
#endif
# 655 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4
#else
# 656 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <gethostuuid.h>
#endif /* expanded by -frewrite-includes */
# 657 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4
#endif
# 658 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
void	*valloc(size_t);			

extern char *suboptarg;			/* getsubopt(3) external variable */
;

/*  HFS & HFS Plus semantics system calls go here */
#ifdef __LP64__
 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
 __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
int    getattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(getattrlist);
int    setattrlist(const char*,void*,void*,size_t,unsigned int) __DARWIN_ALIAS(setattrlist);
;
;

#else /* __LP64__ */
# 722 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4
int	fgetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
int	fsetattrlist(int,void*,void*,size_t,unsigned long) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
int	getattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(getattrlist);
int	setattrlist(const char*,void*,void*,size_t,unsigned long) __DARWIN_ALIAS(setattrlist);
int exchangedata(const char*,const char*,unsigned long);
int	getdirentriesattr(int,void*,void*,size_t,unsigned long*,unsigned long*,unsigned long*,unsigned long);

#endif /* __LP64__ */

__END_DECLS
#endif /* __DARWIN_C_LEVEL >= __DARWIN_C_FULL */
# 748 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4

#endif /* _UNISTD_H_ */
# 750 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/unistd.h" 3 4
# 456 "../../dist/include/zconf.h" 2
#    ifdef VMS
#if 0 /* expanded by -frewrite-includes */
#      include <unixio.h>       /* for off_t */
#endif /* expanded by -frewrite-includes */
# 458 "../../dist/include/zconf.h"
#    endif
# 459 "../../dist/include/zconf.h"
#    ifndef z_off_t
#      define z_off_t off_t
#    endif
# 462 "../../dist/include/zconf.h"
#  endif
# 463 "../../dist/include/zconf.h"
#endif
# 464 "../../dist/include/zconf.h"

#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
#  define Z_LFS64
#endif
# 468 "../../dist/include/zconf.h"

#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64)
#  define Z_LARGE64
#endif
# 472 "../../dist/include/zconf.h"

#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64)
#  define Z_WANT64
#endif
# 476 "../../dist/include/zconf.h"

#if !defined(SEEK_SET) && !defined(Z_SOLO)
#  define SEEK_SET        0       /* Seek from beginning of file.  */
#  define SEEK_CUR        1       /* Seek from current position.  */
#  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
#endif
# 482 "../../dist/include/zconf.h"

#ifndef z_off_t
#  define z_off_t long
#endif
# 486 "../../dist/include/zconf.h"

#if !defined(_WIN32) && defined(Z_LARGE64)
#  define z_off64_t off64_t
#else
# 490 "../../dist/include/zconf.h"
#  if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO)
#    define z_off64_t __int64
#  else
# 493 "../../dist/include/zconf.h"
#    define z_off64_t z_off_t
#  endif
# 495 "../../dist/include/zconf.h"
#endif
# 496 "../../dist/include/zconf.h"

/* MVS linker does not support external names larger than 8 bytes */
#if defined(__MVS__)
  #pragma map(deflateInit_,"DEIN")
  #pragma map(deflateInit2_,"DEIN2")
  #pragma map(deflateEnd,"DEEND")
  #pragma map(deflateBound,"DEBND")
  #pragma map(inflateInit_,"ININ")
  #pragma map(inflateInit2_,"ININ2")
  #pragma map(inflateEnd,"INEND")
  #pragma map(inflateSync,"INSY")
  #pragma map(inflateSetDictionary,"INSEDI")
  #pragma map(compressBound,"CMBND")
  #pragma map(inflate_table,"INTABL")
  #pragma map(inflate_fast,"INFA")
  #pragma map(inflate_copyright,"INCOPY")
#endif
# 513 "../../dist/include/zconf.h"

#endif /* ZCONF_H */
# 515 "../../dist/include/zconf.h"
# 35 "../../dist/include/zlib.h" 2

#ifdef __cplusplus
extern "C" {
#endif
# 39 "../../dist/include/zlib.h"

#define ZLIB_VERSION "1.2.8"
#define ZLIB_VERNUM 0x1280
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2
#define ZLIB_VER_REVISION 8
#define ZLIB_VER_SUBREVISION 0

/*
    The 'zlib' compression library provides in-memory compression and
  decompression functions, including integrity checks of the uncompressed data.
  This version of the library supports only one compression method (deflation)
  but other algorithms will be added later and will have the same stream
  interface.

    Compression can be done in a single step if the buffers are large enough,
  or can be done by repeated calls of the compression function.  In the latter
  case, the application must provide more input and/or consume the output
  (providing more output space) before each call.

    The compressed data format used by default by the in-memory functions is
  the consistency of the compressed data, so the library should never crash
  even in case of corrupted input.
*/

typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
typedef void   (*free_func)  OF((voidpf opaque, voidpf address));

struct internal_state;

typedef struct z_stream_s {
    z_const Bytef *next_in;     /* next input byte */
    uInt     avail_in;  /* number of bytes available at next_in */
    uLong    total_in;  /* total number of input bytes read so far */

    Bytef    *next_out; /* next output byte should be put there */
    uInt     avail_out; /* remaining free space at next_out */
    uLong    total_out; /* total number of bytes output so far */

    z_const char *msg;  /* last error message, NULL if no error */
    struct internal_state FAR *state; /* not visible by applications */

    alloc_func zalloc;  /* used to allocate the internal state */
    free_func  zfree;   /* used to free the internal state */
    voidpf     opaque;  /* private data object passed to zalloc and zfree */

    int     data_type;  /* best guess about the data type: binary or text */
    uLong   adler;      /* adler32 value of the uncompressed data */
    uLong   reserved;   /* reserved for future use */
} z_stream;

typedef z_stream FAR *z_streamp;

/*
     gzip header information passed to and from zlib routines.  See RFC 1952
  for more details on the meanings of these fields.
*/
typedef struct gz_header_s {
    int     text;       /* true if compressed data believed to be text */
    uLong   time;       /* modification time */
    int     xflags;     /* extra flags (not used when writing a gzip file) */
    int     os;         /* operating system */
    Bytef   *extra;     /* pointer to extra field or Z_NULL if none */
    uInt    extra_len;  /* extra field length (valid if extra != Z_NULL) */
    uInt    extra_max;  /* space at extra (only when reading header) */
    Bytef   *name;      /* pointer to zero-terminated file name or Z_NULL */
    uInt    name_max;   /* space at name (only when reading header) */
    Bytef   *comment;   /* pointer to zero-terminated comment or Z_NULL */
    uInt    comm_max;   /* space at comment (only when reading header) */
    int     hcrc;       /* true if there was or will be a header crc */
    int     done;       /* true when done reading gzip header (not used
                           when writing a gzip file) */
} gz_header;

typedef gz_header FAR *gz_headerp;

/*
     The application must update next_in and avail_in when avail_in has dropped
#define Z_NO_FLUSH      0
/*
ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
                                     int  windowBits));

     This is another version of inflateInit with an extra parameter.  The
   fields next_in, avail_in, zalloc, zfree and opaque must be initialized
   before by the caller.

     The windowBits parameter is the base two logarithm of the maximum window
     26: 0 = returns value, 1 = void -- 1 means inferred string length returned

    Remainder:
     27-31: 0 (reserved)
 */

#ifndef Z_SOLO

                        /* utility functions */

/*
     The following utility functions are implemented on top of the basic
   stream-oriented functions.  To simplify the interface, some default options
     This library supports reading and writing files in gzip (.gz) format with
   an interface similar to that of stdio, using the functions that start with
   "gz".  The gzip format is different from the zlib format.  gzip is a gzip
   wrapper, documented in RFC 1952, wrapped around a deflate stream.
*/

typedef struct gzFile_s *gzFile;    /* semi-opaque gzip file descriptor */

/*
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));

     Opens a gzip (.gz) file for reading or writing.  The mode parameter is as
   in fopen ("rb" or "wb") but can also include a compression level ("wb9") or
   a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only
   compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or 'F'
   for fixed code compression as in "wb9F".  (See the description of
# 1726 "../../dist/include/zlib.h"
   ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *));
   ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int));
   ZEXTERN z_off_t ZEXPORT gztell OF((gzFile));
   ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile));
   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));
#endif
# 1733 "../../dist/include/zlib.h"

#else /* Z_SOLO */
# 1735 "../../dist/include/zlib.h"

   ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t));
   ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t));

#endif /* !Z_SOLO */
# 1740 "../../dist/include/zlib.h"

/* hack for buggy compilers */
#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL)
    struct internal_state {int dummy;};
#endif
# 1745 "../../dist/include/zlib.h"

/* undocumented functions */
ZEXTERN const char   * ZEXPORT zError           OF((int));
ZEXTERN int            ZEXPORT inflateSyncPoint OF((z_streamp));
ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table    OF((void));
ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
ZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));
ZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));
#if defined(_WIN32) && !defined(Z_SOLO)
ZEXTERN gzFile         ZEXPORT gzopen_w OF((const wchar_t *path,
                                            const char *mode));
#endif
# 1757 "../../dist/include/zlib.h"
#if defined(STDC) || defined(Z_HAVE_STDARG_H)
#  ifndef Z_SOLO
ZEXTERN int            ZEXPORTVA gzvprintf Z_ARG((gzFile file,
                                                  const char *format,
                                                  va_list va));
#  endif
# 1763 "../../dist/include/zlib.h"
#endif
# 1764 "../../dist/include/zlib.h"

#ifdef __cplusplus
}
#endif
# 1768 "../../dist/include/zlib.h"

#endif /* ZLIB_H */
# 1770 "../../dist/include/zlib.h"
# 18 "../../dist/include/gfxFontUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/gfxFontUtils.h"

/* Bug 341128 - w32api defines min/max which causes problems with <bitset> */
#ifdef __MINGW32__
#undef min
#undef max
#endif
# 25 "../../dist/include/gfxFontUtils.h"

typedef struct hb_blob_t hb_blob_t;

class gfxSparseBitSet {
private:
    enum { BLOCK_SIZE = 32 };   // ==> 256 codepoints per block
    enum { BLOCK_SIZE_BITS = BLOCK_SIZE * 8 };
    enum { BLOCK_INDEX_SHIFT = 8 };

    struct Block {
        
        
        uint8_t mBits[BLOCK_SIZE];
    };
    

    // set this bitset to the union of its current contents and another
    

    

    

private:
    nsTArray< nsAutoPtr<Block> > mBlocks;
};

#define TRUETYPE_TAG(a, b, c, d) ((a) << 24 | (b) << 16 | (c) << 8 | (d))

namespace mozilla {

// Byte-swapping types and name table structure definitions moved from
// gfxFontUtils.cpp to .h file so that gfxFont.cpp can also refer to them
#pragma pack(1)

struct AutoSwap_PRUint16 {
#ifdef __SUNPRO_CC
    AutoSwap_PRUint16& operator = (const uint16_t aValue)
    {
        this->value = mozilla::NativeEndian::swapToBigEndian(aValue);
        return *this;
    }
#else
# 339 "../../dist/include/gfxFontUtils.h"
    MOZ_IMPLICIT 
#endif
# 344 "../../dist/include/gfxFontUtils.h"
    

    

    

private:
    uint16_t value;
};

struct AutoSwap_PRInt16 {
#ifdef __SUNPRO_CC
    AutoSwap_PRInt16& operator = (const int16_t aValue)
    {
        this->value = mozilla::NativeEndian::swapToBigEndian(aValue);
        return *this;
    }
#else
# 371 "../../dist/include/gfxFontUtils.h"
    MOZ_IMPLICIT 
#endif
# 376 "../../dist/include/gfxFontUtils.h"
    

    

private:
    int16_t  value;
};

struct AutoSwap_PRUint32 {
#ifdef __SUNPRO_CC
    AutoSwap_PRUint32& operator = (const uint32_t aValue)
    {
        this->value = mozilla::NativeEndian::swapToBigEndian(aValue);
        return *this;
    }
#else
# 398 "../../dist/include/gfxFontUtils.h"
    MOZ_IMPLICIT 
#endif
# 403 "../../dist/include/gfxFontUtils.h"
    

private:
    uint32_t  value;
};

struct AutoSwap_PRInt32 {
#ifdef __SUNPRO_CC
    AutoSwap_PRInt32& operator = (const int32_t aValue)
    {
        this->value = mozilla::NativeEndian::swapToBigEndian(aValue);
        return *this;
    }
#else
# 420 "../../dist/include/gfxFontUtils.h"
    MOZ_IMPLICIT 
#endif
# 425 "../../dist/include/gfxFontUtils.h"
    

private:
};

struct KernTableSubtableHeaderVersion1 {
    AutoSwap_PRUint32    length;
    AutoSwap_PRUint16    coverage;
    AutoSwap_PRUint16    tupleIndex;
};

struct COLRHeader {
    AutoSwap_PRUint16    version;
    AutoSwap_PRUint16    numBaseGlyphRecord;
    AutoSwap_PRUint32    offsetBaseGlyphRecord;
    AutoSwap_PRUint32    offsetLayerRecord;
    AutoSwap_PRUint16    numLayerRecords;
};

struct CPALHeaderVersion0 {
    AutoSwap_PRUint16    version;
    AutoSwap_PRUint16    numPaletteEntries;
    AutoSwap_PRUint16    numPalettes;
    AutoSwap_PRUint16    numColorRecords;
    AutoSwap_PRUint32    offsetFirstColorRecord;
};

#pragma pack()

// Return just the highest bit of the given value, i.e., the highest
// power of 2 that is <= value, or zero if the input value is zero.


} // namespace mozilla


extern const uint8_t sCJKCompatSVSTable[];

class gfxFontUtils {

public:
    // these are public because gfxFont.cpp also looks into the name table
    enum {
        NAME_ID_FAMILY = 1,
        NAME_ID_STYLE = 2,
        NAME_ID_UNIQUE = 3,
        NAME_ID_FULL = 4,
        NAME_ID_VERSION = 5,

        LANG_ALL = -1,
        LANG_ID_MAC_ENGLISH = 0,      // many others are defined, but most don't affect
        kUnicodeBidiScriptsStart = 0x0590,
        kUnicodeBidiScriptsEnd = 0x08FF,
        kUnicodeBidiPresentationStart = 0xFB1D,
        kUnicodeBidiPresentationEnd = 0xFEFC,
        kUnicodeFirstHighSurrogateBlock = 0xD800,
        kUnicodeRLM = 0x200F,
        kUnicodeRLE = 0x202B,
        kUnicodeRLO = 0x202E
    };

    

    // parse a simple list of font family names into
    // an array of strings
    ;

};


#endif /* GFX_FONT_UTILS_H */
# 1003 "../../dist/include/gfxFontUtils.h"
# 13 "../../dist/include/gfxFontEntry.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxFontEntry.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTHashtable.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/gfxFontEntry.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/HashFunctions.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/gfxFontEntry.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/gfxFontEntry.h"
#if 0 /* expanded by -frewrite-includes */
#include "DrawMode.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/DrawMode.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef DrawMode_h
#define DrawMode_h

// Options for how the text should be drawn
enum class DrawMode : int {
  // GLYPH_FILL and GLYPH_STROKE draw into the current context
  //  and may be used together with bitwise OR.
  GLYPH_FILL = 1,
  // Note: using GLYPH_STROKE will destroy the current path.
  GLYPH_STROKE = 2,
  // Appends glyphs to the current path. Can NOT be used with
  //  GLYPH_FILL or GLYPH_STROKE.
  GLYPH_PATH = 4,
  // When GLYPH_FILL and GLYPH_STROKE are both set, draws the
  //  stroke underneath the fill.
  GLYPH_STROKE_UNDERNEATH = 8
};

#endif
# 25 "../../dist/include/DrawMode.h"

# 18 "../../dist/include/gfxFontEntry.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsUnicodeScriptCodes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsUnicodeScriptCodes.h" 1

/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
# Date: 2014-09-03, 17:30:00 GMT [EM, KI, LI]

 *
 * * * * * This file contains MACHINE-GENERATED DATA, do not edit! * * * * *
 */

#ifndef NS_UNICODE_SCRIPT_CODES
#define NS_UNICODE_SCRIPT_CODES

#pragma pack(1)


struct nsCharProps1 {
  unsigned char mMirrorOffsetIndex:5;
  unsigned char mHangulType:3;
  unsigned char mCombiningClass:8;
};



struct nsCharProps2 {
  unsigned char mScriptCode:8;
  unsigned char mEAW:3;
  unsigned char mCategory:5;
  unsigned char mBidiCategory:5;
  unsigned char mXidmod:4;
  signed char   mNumericValue:5;
  unsigned char mVertOrient:2;
};


#pragma pack()

enum {
  MOZ_SCRIPT_COMMON = 0,
  MOZ_SCRIPT_INHERITED = 1,
  MOZ_SCRIPT_ARABIC = 2,
  MOZ_SCRIPT_WARANG_CITI = 125,
  MOZ_SCRIPT_MATHEMATICAL_NOTATION = 126,

  MOZ_NUM_SCRIPT_CODES = 127,

  MOZ_SCRIPT_INVALID = -1
};

#endif
# 224 "../../dist/include/nsUnicodeScriptCodes.h"
/*
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 */

#ifndef HB_H
#define HB_H
#define HB_H_IN

#if 0 /* expanded by -frewrite-includes */
#include "hb-blob.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-blob.h" 1
/*
 * Copyright © 2009  Red Hat, Inc.
 *
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 30 "../../dist/include/harfbuzz/hb-blob.h"

#ifndef HB_BLOB_H
#define HB_BLOB_H

#if 0 /* expanded by -frewrite-includes */
#include "hb-common.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-common.h" 1
# 32 "../../dist/include/harfbuzz/hb-common.h"

#ifndef HB_COMMON_H
#define HB_COMMON_H

#ifndef HB_BEGIN_DECLS
# ifdef __cplusplus
#  define HB_BEGIN_DECLS	extern "C" {
#  define HB_END_DECLS		}
# else /* !__cplusplus */
# 41 "../../dist/include/harfbuzz/hb-common.h"
#  define HB_BEGIN_DECLS
#  define HB_END_DECLS
# endif /* !__cplusplus */
# 44 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 45 "../../dist/include/harfbuzz/hb-common.h"

#if !defined (HB_DONT_DEFINE_STDINT)

#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
    defined (_sgi) || defined (__sun) || defined (sun) || \
    defined (__digital__) || defined (__HP_cc)
#if 0 /* expanded by -frewrite-includes */
#  include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 52 "../../dist/include/harfbuzz/hb-common.h"
#elif defined (_AIX)
# 53 "../../dist/include/harfbuzz/hb-common.h"
# 65 "../../dist/include/harfbuzz/hb-common.h"
#if 0 /* expanded by -frewrite-includes */
#  include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 66 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 67 "../../dist/include/harfbuzz/hb-common.h"

#endif
# 69 "../../dist/include/harfbuzz/hb-common.h"

HB_BEGIN_DECLS


typedef int hb_bool_t;

typedef uint32_t hb_codepoint_t;
typedef int32_t hb_position_t;
typedef uint32_t hb_mask_t;

typedef union _hb_var_int_t {
  uint32_t u32;
  int32_t i32;
  uint16_t u16[2];
  int16_t i16[2];
  uint8_t u8[4];
  int8_t i8[4];
} hb_var_int_t;


/* hb_tag_t */

typedef uint32_t hb_tag_t;

#define HB_TAG(c1,c2,c3,c4) ((hb_tag_t)((((uint8_t)(c1))<<24)|(((uint8_t)(c2))<<16)|(((uint8_t)(c3))<<8)|((uint8_t)(c4))))
#define HB_UNTAG(tag)   ((uint8_t)((tag)>>24)), ((uint8_t)((tag)>>16)), ((uint8_t)((tag)>>8)), ((uint8_t)(tag))

#define HB_TAG_NONE HB_TAG(0,0,0,0)
#define HB_TAG_MAX HB_TAG(0xff,0xff,0xff,0xff)
#define HB_TAG_MAX_SIGNED HB_TAG(0x7f,0xff,0xff,0xff)

/* len=-1 means str is NUL-terminated. */
;

/* buf should have 4 bytes. */
;


;

#define HB_LANGUAGE_INVALID ((hb_language_t) NULL)

;


/* hb_script_t */

/* http://unicode.org/iso15924/ */
/* http://goo.gl/x9ilM */
/* Unicode Character Database property: Script (sc) */
typedef enum
{
  /*1.1*/ HB_SCRIPT_COMMON			= HB_TAG ('Z','y','y','y'),
  /*1.1*/ HB_SCRIPT_INHERITED			= HB_TAG ('Z','i','n','h'),
  HB_SCRIPT_INVALID				= HB_TAG_NONE,

  /* Dummy values to ensure any hb_tag_t value can be passed/stored as hb_script_t
   * without risking undefined behavior.  Include both a signed and unsigned max,
   * since technically enums are int, and indeed, hb_script_t ends up being signed.
   * See this thread for technicalities:
   *
   *   http://lists.freedesktop.org/archives/harfbuzz/2014-March/004150.html
   */
  _HB_SCRIPT_MAX_VALUE				= HB_TAG_MAX, /*< skip >*/
  _HB_SCRIPT_MAX_VALUE_SIGNED			= HB_TAG_MAX_SIGNED /*< skip >*/

} hb_script_t;


/* Script functions */

;

/* sugar for tag_from_string() then script_from_iso15924_tag */
/* len=-1 means s is NUL-terminated */
;

;

;


/* User data */

typedef struct hb_user_data_key_t {
  /*< private >*/
  char unused;
} hb_user_data_key_t;

typedef void (*hb_destroy_func_t) (void *user_data);


HB_END_DECLS

#endif /* HB_COMMON_H */
# 345 "../../dist/include/harfbuzz/hb-common.h"
# 35 "../../dist/include/harfbuzz/hb-blob.h" 2

HB_BEGIN_DECLS


/*
 * modify the parent data as that data may be
 * shared among multiple sub-blobs.
 */
;

;

;

void
hb_blob_destroy (hb_blob_t *blob);

;


;


;

;


;

;

;


HB_END_DECLS

#endif /* HB_BLOB_H */
# 127 "../../dist/include/harfbuzz/hb-blob.h"
# 32 "../../dist/include/harfbuzz/hb.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "hb-buffer.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-buffer.h" 1
/*
 * Copyright © 1998-2004  David Turner and Werner Lemberg
 * Copyright © 2004,2007,2009  Red Hat, Inc.
 * Copyright © 2011,2012  Google, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * Red Hat Author(s): Owen Taylor, Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 33 "../../dist/include/harfbuzz/hb-buffer.h"

#ifndef HB_BUFFER_H
#define HB_BUFFER_H

#if 0 /* expanded by -frewrite-includes */
#include "hb-common.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-common.h" 1
/*
 * Copyright © 2007,2008,2009  Red Hat, Inc.
 * Copyright © 2011,2012  Google, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 32 "../../dist/include/harfbuzz/hb-common.h"

#ifndef HB_COMMON_H
#define HB_COMMON_H

#ifndef HB_BEGIN_DECLS
# ifdef __cplusplus
#  define HB_BEGIN_DECLS	extern "C" {
#  define HB_END_DECLS		}
# else /* !__cplusplus */
# 41 "../../dist/include/harfbuzz/hb-common.h"
#  define HB_BEGIN_DECLS
#  define HB_END_DECLS
# endif /* !__cplusplus */
# 44 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 45 "../../dist/include/harfbuzz/hb-common.h"

#if !defined (HB_DONT_DEFINE_STDINT)

#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
    defined (_sgi) || defined (__sun) || defined (sun) || \
    defined (__digital__) || defined (__HP_cc)
#if 0 /* expanded by -frewrite-includes */
#  include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 52 "../../dist/include/harfbuzz/hb-common.h"
#elif defined (_AIX)
# 53 "../../dist/include/harfbuzz/hb-common.h"
#if 0 /* expanded by -frewrite-includes */
#  include <sys/inttypes.h>
#endif /* expanded by -frewrite-includes */
# 54 "../../dist/include/harfbuzz/hb-common.h"
# 66 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 67 "../../dist/include/harfbuzz/hb-common.h"

#endif
  _HB_SCRIPT_MAX_VALUE_SIGNED			= HB_TAG_MAX_SIGNED /*< skip >*/


#endif /* HB_COMMON_H */
# 345 "../../dist/include/harfbuzz/hb-common.h"
# 38 "../../dist/include/harfbuzz/hb-buffer.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "hb-unicode.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-unicode.h" 1
/*
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Codethink Author(s): Ryan Lortie
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 34 "../../dist/include/harfbuzz/hb-unicode.h"

#ifndef HB_UNICODE_H
#define HB_UNICODE_H

#if 0 /* expanded by -frewrite-includes */
#include "hb-common.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-common.h" 1
/*
 * Copyright © 2007,2008,2009  Red Hat, Inc.
 * Copyright © 2011,2012  Google, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 32 "../../dist/include/harfbuzz/hb-common.h"

#ifndef HB_COMMON_H
#define HB_COMMON_H

#ifndef HB_BEGIN_DECLS
# ifdef __cplusplus
#  define HB_BEGIN_DECLS	extern "C" {
#  define HB_END_DECLS		}
# else /* !__cplusplus */
# 41 "../../dist/include/harfbuzz/hb-common.h"
#  define HB_BEGIN_DECLS
#  define HB_END_DECLS
# endif /* !__cplusplus */
# 44 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 45 "../../dist/include/harfbuzz/hb-common.h"

#if !defined (HB_DONT_DEFINE_STDINT)

#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
    defined (_sgi) || defined (__sun) || defined (sun) || \
    defined (__digital__) || defined (__HP_cc)
#if 0 /* expanded by -frewrite-includes */
#  include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 52 "../../dist/include/harfbuzz/hb-common.h"
#elif defined (_AIX)
# 53 "../../dist/include/harfbuzz/hb-common.h"
#if 0 /* expanded by -frewrite-includes */
#  include <sys/inttypes.h>
#endif /* expanded by -frewrite-includes */
# 54 "../../dist/include/harfbuzz/hb-common.h"
/* VS 2010 (_MSC_VER 1600) has stdint.h */
#elif defined (_MSC_VER) && _MSC_VER < 1600
# 56 "../../dist/include/harfbuzz/hb-common.h"
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
# 65 "../../dist/include/harfbuzz/hb-common.h"
#if 0 /* expanded by -frewrite-includes */
#  include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 66 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 67 "../../dist/include/harfbuzz/hb-common.h"

#endif
# 69 "../../dist/include/harfbuzz/hb-common.h"

} hb_var_int_t;

/* User data */

typedef struct hb_user_data_key_t {
  /*< private >*/
  char unused;
} hb_user_data_key_t;

typedef void (*hb_destroy_func_t) (void *user_data);


HB_END_DECLS

#endif /* HB_COMMON_H */
# 345 "../../dist/include/harfbuzz/hb-common.h"
# 39 "../../dist/include/harfbuzz/hb-unicode.h" 2

HB_BEGIN_DECLS


/* hb_unicode_general_category_t */

/* Unicode Character Database property: General_Category (gc) */
typedef enum
{
  HB_UNICODE_GENERAL_CATEGORY_CONTROL,			/* Cc */
  HB_UNICODE_GENERAL_CATEGORY_FORMAT,			/* Cf */
  HB_UNICODE_GENERAL_CATEGORY_UNASSIGNED,		/* Cn */
  HB_UNICODE_GENERAL_CATEGORY_PRIVATE_USE,		/* Co */
  HB_UNICODE_GENERAL_CATEGORY_SURROGATE,		/* Cs */
  HB_UNICODE_GENERAL_CATEGORY_LOWERCASE_LETTER,		/* Ll */
  HB_UNICODE_GENERAL_CATEGORY_OPEN_PUNCTUATION,		/* Ps */
  HB_UNICODE_GENERAL_CATEGORY_CURRENCY_SYMBOL,		/* Sc */
  HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL,		/* Sk */
  HB_UNICODE_GENERAL_CATEGORY_MATH_SYMBOL,		/* Sm */
  HB_UNICODE_GENERAL_CATEGORY_OTHER_SYMBOL,		/* So */
  HB_UNICODE_GENERAL_CATEGORY_LINE_SEPARATOR,		/* Zl */
  HB_UNICODE_GENERAL_CATEGORY_PARAGRAPH_SEPARATOR,	/* Zp */
  HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR		/* Zs */
} hb_unicode_general_category_t;

/* hb_unicode_combining_class_t */

/* Note: newer versions of Unicode may add new values.  Clients should be ready to handle
 * any value in the 0..254 range being returned from hb_unicode_combining_class().
 */

/* Unicode Character Database property: Canonical_Combining_Class (ccc) */
typedef enum
{
  HB_UNICODE_COMBINING_CLASS_NOT_REORDERED	= 0,
  HB_UNICODE_COMBINING_CLASS_OVERLAY		= 1,
  HB_UNICODE_COMBINING_CLASS_NUKTA		= 7,
  HB_UNICODE_COMBINING_CLASS_KANA_VOICING	= 8,
  HB_UNICODE_COMBINING_CLASS_VIRAMA		= 9,

  /* Hebrew */
  HB_UNICODE_COMBINING_CLASS_CCC10	=  10,
  HB_UNICODE_COMBINING_CLASS_CCC11	=  11,
  HB_UNICODE_COMBINING_CLASS_CCC12	=  12,
  HB_UNICODE_COMBINING_CLASS_CCC13	=  13,
  HB_UNICODE_COMBINING_CLASS_CCC14	=  14,

  HB_UNICODE_COMBINING_CLASS_INVALID	= 255
} hb_unicode_combining_class_t;


/*
 * hb_unicode_funcs_t
 */

typedef struct hb_unicode_funcs_t hb_unicode_funcs_t;


/*
 * just give me the best implementation you've got there.
 */
;


;

;


/*
 * funcs
 */

/* typedefs */

typedef hb_unicode_combining_class_t	(*hb_unicode_combining_class_func_t)	(hb_unicode_funcs_t *ufuncs,
										 hb_codepoint_t      unicode,
										 void               *user_data);
typedef unsigned int			(*hb_unicode_eastasian_width_func_t)	(hb_unicode_funcs_t *ufuncs,
										 hb_codepoint_t      unicode,
										 void               *user_data);
typedef hb_unicode_general_category_t	(*hb_unicode_general_category_func_t)	(hb_unicode_funcs_t *ufuncs,
										 hb_codepoint_t      unicode,
										 void               *user_data);
typedef hb_codepoint_t			(*hb_unicode_mirroring_func_t)		(hb_unicode_funcs_t *ufuncs,
										 hb_codepoint_t      unicode,
										 void               *user_data);
typedef hb_script_t			(*hb_unicode_script_func_t)		(hb_unicode_funcs_t *ufuncs,
										 hb_codepoint_t      unicode,
										 void               *user_data);

typedef hb_bool_t			(*hb_unicode_compose_func_t)		(hb_unicode_funcs_t *ufuncs,
										 hb_codepoint_t      a,
										 hb_codepoint_t      b,
										 hb_codepoint_t     *ab,
										 void               *user_data);
typedef hb_bool_t			(*hb_unicode_decompose_func_t)		(hb_unicode_funcs_t *ufuncs,
										 hb_codepoint_t      ab,
										 hb_codepoint_t     *a,
										 hb_codepoint_t     *b,
										 void               *user_data);

/**
 * hb_unicode_decompose_compatibility_func_t:
 * @ufuncs: a Unicode function structure
 * @u: codepoint to decompose
 * @decomposed: address of codepoint array (of length %HB_UNICODE_MAX_DECOMPOSITION_LEN) to write decomposition into
 * @user_data: user data pointer as passed to hb_unicode_funcs_set_decompose_compatibility_func()
 *
 * Fully decompose @u to its Unicode compatibility decomposition. The codepoints of the decomposition will be written to @decomposed.
 * The complete length of the decomposition will be returned.
 *
 * If @u has no compatibility decomposition, zero should be returned.
 *
 * The Unicode standard guarantees that a buffer of length %HB_UNICODE_MAX_DECOMPOSITION_LEN codepoints will always be sufficient for any
 * compatibility decomposition plus an terminating value of 0.  Consequently, @decompose must be allocated by the caller to be at least this length.  Implementations
 * of this function type must ensure that they do not write past the provided array.
 *
 * Return value: number of codepoints in the full compatibility decomposition of @u, or 0 if no decomposition available.
 */
typedef unsigned int			(*hb_unicode_decompose_compatibility_func_t)	(hb_unicode_funcs_t *ufuncs,
											 hb_codepoint_t      u,
											 hb_codepoint_t     *decomposed,
											 void               *user_data);

/* See Unicode 6.1 for details on the maximum decomposition length. */
#define HB_UNICODE_MAX_DECOMPOSITION_LEN (18+1) /* codepoints */
HB_END_DECLS

#endif /* HB_UNICODE_H */
# 446 "../../dist/include/harfbuzz/hb-unicode.h"
# 39 "../../dist/include/harfbuzz/hb-buffer.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "hb-font.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-font.h" 1
/*
 * Copyright © 2009  Red Hat, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * Red Hat Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 30 "../../dist/include/harfbuzz/hb-font.h"

#ifndef HB_FONT_H
#define HB_FONT_H

#if 0 /* expanded by -frewrite-includes */
#include "hb-common.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-common.h" 1
/*
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 32 "../../dist/include/harfbuzz/hb-common.h"

#ifndef HB_COMMON_H
#define HB_COMMON_H

#ifndef HB_BEGIN_DECLS
# ifdef __cplusplus
#  define HB_BEGIN_DECLS	extern "C" {
#  define HB_END_DECLS		}
# else /* !__cplusplus */
# 41 "../../dist/include/harfbuzz/hb-common.h"
#  define HB_BEGIN_DECLS
#  define HB_END_DECLS
# endif /* !__cplusplus */
# 44 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 45 "../../dist/include/harfbuzz/hb-common.h"

#if !defined (HB_DONT_DEFINE_STDINT)

#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
    defined (_sgi) || defined (__sun) || defined (sun) || \
    defined (__digital__) || defined (__HP_cc)
#if 0 /* expanded by -frewrite-includes */
#  include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 52 "../../dist/include/harfbuzz/hb-common.h"
#elif defined (_AIX)
# 53 "../../dist/include/harfbuzz/hb-common.h"
#if 0 /* expanded by -frewrite-includes */
#  include <sys/inttypes.h>
#endif /* expanded by -frewrite-includes */
# 54 "../../dist/include/harfbuzz/hb-common.h"
/* VS 2010 (_MSC_VER 1600) has stdint.h */
#endif
# 67 "../../dist/include/harfbuzz/hb-common.h"

#endif
# 69 "../../dist/include/harfbuzz/hb-common.h"

HB_BEGIN_DECLS


typedef int hb_bool_t;

typedef uint32_t hb_codepoint_t;
typedef int32_t hb_position_t;
typedef uint32_t hb_mask_t;

typedef union _hb_var_int_t {
typedef void (*hb_destroy_func_t) (void *user_data);


HB_END_DECLS

#endif /* HB_COMMON_H */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 30 "../../dist/include/harfbuzz/hb-face.h"

#ifndef HB_FACE_H
#define HB_FACE_H

#if 0 /* expanded by -frewrite-includes */
#include "hb-common.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-common.h" 1
/*
 * Copyright © 2007,2008,2009  Red Hat, Inc.
 * Copyright © 2011,2012  Google, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 32 "../../dist/include/harfbuzz/hb-common.h"

#ifndef HB_COMMON_H
#define HB_COMMON_H

#ifndef HB_BEGIN_DECLS
# ifdef __cplusplus
#  define HB_BEGIN_DECLS	extern "C" {
#  define HB_END_DECLS		}
# else /* !__cplusplus */
# 41 "../../dist/include/harfbuzz/hb-common.h"
#  define HB_BEGIN_DECLS
#  define HB_END_DECLS
# endif /* !__cplusplus */
# 44 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 45 "../../dist/include/harfbuzz/hb-common.h"

#if !defined (HB_DONT_DEFINE_STDINT)

#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
    defined (_sgi) || defined (__sun) || defined (sun) || \
    defined (__digital__) || defined (__HP_cc)
#if 0 /* expanded by -frewrite-includes */
#  include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 52 "../../dist/include/harfbuzz/hb-common.h"
#elif defined (_AIX)
# 53 "../../dist/include/harfbuzz/hb-common.h"
#if 0 /* expanded by -frewrite-includes */
#  include <sys/inttypes.h>
#endif /* expanded by -frewrite-includes */
# 54 "../../dist/include/harfbuzz/hb-common.h"
/* VS 2010 (_MSC_VER 1600) has stdint.h */
#elif defined (_MSC_VER) && _MSC_VER < 1600
# 56 "../../dist/include/harfbuzz/hb-common.h"
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
# 65 "../../dist/include/harfbuzz/hb-common.h"
#if 0 /* expanded by -frewrite-includes */
#  include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 66 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 67 "../../dist/include/harfbuzz/hb-common.h"

#endif
# 69 "../../dist/include/harfbuzz/hb-common.h"

 */
hb_blob_t *
hb_blob_create_sub_blob (hb_blob_t    *parent,
			 unsigned int  offset,
			 unsigned int  length);

const char *
hb_blob_get_data (hb_blob_t *blob, unsigned int *length);

char *
hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length);


HB_END_DECLS

#endif /* HB_BLOB_H */
# 127 "../../dist/include/harfbuzz/hb-blob.h"
# 36 "../../dist/include/harfbuzz/hb-face.h" 2

HB_BEGIN_DECLS



;

;

;

;

;

;


HB_END_DECLS

#endif /* HB_FACE_H */
# 118 "../../dist/include/harfbuzz/hb-face.h"
# 36 "../../dist/include/harfbuzz/hb-font.h" 2

HB_BEGIN_DECLS


typedef struct hb_font_t hb_font_t;


/*
 * hb_font_funcs_t
 */

typedef struct hb_font_funcs_t hb_font_funcs_t;

#define HB_SCRIPT_CANADIAN_ABORIGINAL		HB_SCRIPT_CANADIAN_SYLLABICS

#define HB_BUFFER_FLAGS_DEFAULT			HB_BUFFER_FLAG_DEFAULT
#define HB_BUFFER_SERIALIZE_FLAGS_DEFAULT	HB_BUFFER_SERIALIZE_FLAG_DEFAULT

#endif
# 48 "../../dist/include/harfbuzz/hb-deprecated.h"

HB_END_DECLS

#endif /* HB_DEPRECATED_H */
# 52 "../../dist/include/harfbuzz/hb-deprecated.h"
# 35 "../../dist/include/harfbuzz/hb.h" 2
#if 0 /* expanded by -frewrite-includes */
		  unsigned int y_ppem);

void
hb_font_get_ppem (hb_font_t *font,
		  unsigned int *x_ppem,
		  unsigned int *y_ppem);


HB_END_DECLS

#endif /* HB_FONT_H */
# 508 "../../dist/include/harfbuzz/hb-font.h"
# 37 "../../dist/include/harfbuzz/hb.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "hb-set.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-set.h" 1
/*
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 30 "../../dist/include/harfbuzz/hb-set.h"

#ifndef HB_SET_H
#define HB_SET_H

#if 0 /* expanded by -frewrite-includes */
#include "hb-common.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-common.h" 1
/*
 * Copyright © 2007,2008,2009  Red Hat, Inc.
 * Copyright © 2011,2012  Google, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 32 "../../dist/include/harfbuzz/hb-common.h"

#ifndef HB_COMMON_H
#define HB_COMMON_H

  /*5.2*/ HB_SCRIPT_TAI_VIET			= HB_TAG ('T','a','v','t'),

hb_tag_t
hb_script_to_iso15924_tag (hb_script_t script);

hb_direction_t
hb_script_get_horizontal_direction (hb_script_t script);


/* User data */

typedef struct hb_user_data_key_t {
  /*< private >*/
  char unused;
} hb_user_data_key_t;

typedef void (*hb_destroy_func_t) (void *user_data);


HB_END_DECLS

#endif /* HB_COMMON_H */
# 345 "../../dist/include/harfbuzz/hb-common.h"
# 35 "../../dist/include/harfbuzz/hb-set.h" 2

HB_BEGIN_DECLS


#define HB_SET_VALUE_INVALID ((hb_codepoint_t) -1)

typedef struct hb_set_t hb_set_t;


HB_END_DECLS

#endif /* HB_SET_H */
# 155 "../../dist/include/harfbuzz/hb-set.h"
# 38 "../../dist/include/harfbuzz/hb.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "hb-shape.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-shape.h" 1
/*
 * Copyright © 2009  Red Hat, Inc.
 * Copyright © 2012  Google, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 32 "../../dist/include/harfbuzz/hb-common.h"

#ifndef HB_COMMON_H
#define HB_COMMON_H

#ifndef HB_BEGIN_DECLS
# ifdef __cplusplus
#  define HB_BEGIN_DECLS	extern "C" {
#  define HB_END_DECLS		}
# else /* !__cplusplus */
# 41 "../../dist/include/harfbuzz/hb-common.h"
#  define HB_BEGIN_DECLS
#  define HB_END_DECLS
# endif /* !__cplusplus */
# 44 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 45 "../../dist/include/harfbuzz/hb-common.h"

#if !defined (HB_DONT_DEFINE_STDINT)

#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
    defined (_sgi) || defined (__sun) || defined (sun) || \
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else
# 65 "../../dist/include/harfbuzz/hb-common.h"
#if 0 /* expanded by -frewrite-includes */
#  include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 66 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 67 "../../dist/include/harfbuzz/hb-common.h"

#endif
  uint8_t u8[4];
  int8_t i8[4];
} hb_var_int_t;


hb_font_get_ppem (hb_font_t *font,
		  unsigned int *x_ppem,
		  unsigned int *y_ppem);


HB_END_DECLS

#endif /* HB_FONT_H */
# 508 "../../dist/include/harfbuzz/hb-font.h"
# 36 "../../dist/include/harfbuzz/hb-shape-plan.h" 2


hb_unicode_combining_class_t
hb_unicode_combining_class (hb_unicode_funcs_t *ufuncs,
				    hb_codepoint_t      u,
				    hb_codepoint_t     *decomposed);

HB_END_DECLS

#endif /* HB_UNICODE_H */
# 446 "../../dist/include/harfbuzz/hb-unicode.h"
# 41 "../../dist/include/harfbuzz/hb.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "hb-version.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-version.h" 1
/*
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 30 "../../dist/include/harfbuzz/hb-version.h"

#ifndef HB_VERSION_H
#define HB_VERSION_H

#if 0 /* expanded by -frewrite-includes */
#include "hb-common.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/harfbuzz/hb-common.h" 1
/*
 * Copyright © 2007,2008,2009  Red Hat, Inc.
 * Copyright © 2011,2012  Google, Inc.
 *
 *  This is part of HarfBuzz, a text shaping library.
 *
 * Permission is hereby granted, without written agreement and without
 * license or royalty fees, to use, copy, modify, and distribute this
 * software and its documentation for any purpose, provided that the
 * above copyright notice and the following two paragraphs appear in
 * all copies of this software.
 *
 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 *
 * Red Hat Author(s): Behdad Esfahbod
 * Google Author(s): Behdad Esfahbod
 */

#ifndef HB_H_IN
#error "Include <hb.h> instead."
#endif
# 32 "../../dist/include/harfbuzz/hb-common.h"

#ifndef HB_COMMON_H
#define HB_COMMON_H

#ifndef HB_BEGIN_DECLS
# ifdef __cplusplus
#  define HB_BEGIN_DECLS	extern "C" {
#  define HB_END_DECLS		}
# else /* !__cplusplus */
# 41 "../../dist/include/harfbuzz/hb-common.h"
#  define HB_BEGIN_DECLS
#  define HB_END_DECLS
# endif /* !__cplusplus */
# 44 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 45 "../../dist/include/harfbuzz/hb-common.h"

#if !defined (HB_DONT_DEFINE_STDINT)

#if defined (_SVR4) || defined (SVR4) || defined (__OpenBSD__) || \
    defined (_sgi) || defined (__sun) || defined (sun) || \
    defined (__digital__) || defined (__HP_cc)
#if 0 /* expanded by -frewrite-includes */
#  include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 52 "../../dist/include/harfbuzz/hb-common.h"
#elif defined (_AIX)
#else
# 65 "../../dist/include/harfbuzz/hb-common.h"
#if 0 /* expanded by -frewrite-includes */
#  include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 66 "../../dist/include/harfbuzz/hb-common.h"
#endif
# 67 "../../dist/include/harfbuzz/hb-common.h"

#endif
# 69 "../../dist/include/harfbuzz/hb-common.h"

HB_BEGIN_DECLS


/* Script functions */
/* User data */

typedef struct hb_user_data_key_t {
  /*< private >*/
  char unused;
} hb_user_data_key_t;

typedef void (*hb_destroy_func_t) (void *user_data);


HB_END_DECLS

#endif /* HB_COMMON_H */
# 345 "../../dist/include/harfbuzz/hb-common.h"
# 35 "../../dist/include/harfbuzz/hb-version.h" 2

HB_BEGIN_DECLS


#define HB_VERSION_MAJOR 0
#define HB_VERSION_MINOR 9
#define HB_VERSION_MICRO 37

#define HB_VERSION_STRING "0.9.37"

#define HB_VERSION_ATLEAST(major,minor,micro) \
	((major)*10000+(minor)*100+(micro) <= \
	 HB_VERSION_MAJOR*10000+HB_VERSION_MINOR*100+HB_VERSION_MICRO)


;

;

;


HB_END_DECLS

#endif /* HB_VERSION_H */
# 67 "../../dist/include/harfbuzz/hb-version.h"
# 42 "../../dist/include/harfbuzz/hb.h" 2

HB_BEGIN_DECLS
HB_END_DECLS

#undef HB_H_IN
#endif /* HB_H */
# 48 "../../dist/include/harfbuzz/hb.h"
# 21 "../../dist/include/gfxFontEntry.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/gfxFontEntry.h"

typedef struct gr_face gr_face;

#ifdef DEBUG
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/gfxFontEntry.h"
#endif
# 28 "../../dist/include/gfxFontEntry.h"

struct gfxFontStyle;
class gfxContext;
class gfxFont;
class gfxFontFamily;
class gfxUserFontData;
class gfxSVGGlyphs;
class gfxMathTable;
class gfxTextContextPaint;
class FontInfoData;
struct FontListSizes;
class nsIAtom;

class gfxCharacterMap : public gfxSparseBitSet {
public:
    

    // cmap is shared globally
    bool mShared;

protected:
    ;

    nsAutoRefCnt mRefCnt;

private:
    ;
    ;
};

class gfxFontEntry {
public:
    ;
    ;
    // Call this when glyph geometry or rendering has changed
    // (e.g. animated SVG glyphs)
    ;

    enum MathConstant {
        // The order of the constants must match the order of the fields
        // defined in the MATH table.
        StretchStackGapBelowMin,
        FractionNumeratorShiftUp,
        FractionNumeratorDisplayStyleShiftUp,
        FractionDenominatorShiftDown,
        FractionDenominatorDisplayStyleShiftDown,
        FractionNumeratorGapMin,
        FractionNumDisplayStyleGapMin,
        RadicalKernAfterDegree,
        RadicalDegreeBottomRaisePercent
    };

    // Call TryGetMathTable to try to load the Open Type MATH table. The other
    // functions forward the call to the gfxMathTable class. The GetMath...()
    // functions MUST NOT be called unless TryGetMathTable() has returned true.
    ;
    nsTArray<gfxFont*> mFontsUsingSVGGlyphs;
    nsAutoPtr<gfxMathTable> mMathTable;
    nsTArray<gfxFontFeature> mFeatureSettings;
    nsAutoPtr<nsDataHashtable<nsUint32HashKey,bool>> mSupportedFeatures;
    nsAutoPtr<nsDataHashtable<nsUint32HashKey,hb_set_t*>> mFeatureInputs;
    uint32_t         mLanguageOverride;

    // Color Layer font support

    // hashtable to map raw table data ptr back to its owning blob, for use by
    // graphite table-release callback
    nsDataHashtable<nsPtrHashKey<const void>,void*>* mGrTableMap;

    // number of current users of this entry's mGrFace
    nsrefcnt mGrFaceRefCnt;

    ;
    ;

private:
    /**
     * Font table hashtable, to support GetFontTable for harfbuzz.
     *
     * The harfbuzz shaper (and potentially other clients) needs access to raw
     * the last blob reference is removed, the FontTableBlobData user data
     * will remove the blob from the hashtable if still registered.
     */

    class FontTableBlobData;

    /**
     * FontTableHashEntry manages the entries of hb_blob_t's containing font
     * table data.
     *
     * This is used to share font tables across fonts with the same
     * font entry (but different sizes) for use by HarfBuzz.  The hashtable
     * does not own a strong reference to the blob, but keeps a weak pointer,
     * managed by FontTableBlobData.  Similarly FontTableBlobData keeps only a
     * weak pointer to the hashtable, managed by FontTableHashEntry.
     */
    bool mIsBadUnderlineFamily : 1;
    bool mFamilyCharacterMapInitialized : 1;
    bool mSkipDefaultFeatureSpaceCheck : 1;

    enum {
        // for "simple" families, the faces are stored in mAvailableFonts
        // with fixed positions:
        kRegularFaceIndex    = 0,
        kBoldFaceIndex       = 1,
        kItalicFaceIndex     = 2,
        kBoldItalicFaceIndex = 3,
        // mask values for selecting face with bold and/or italic attributes
        kBoldMask   = 0x01,
        kItalicMask = 0x02
    };
};

#endif
# 831 "../../dist/include/gfxFontEntry.h"
# 11 "../../dist/include/gfxFont.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/gfxFont.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxPoint.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxFont.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxFont.h"
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIMemoryReporter.idl
 */

#ifndef __gen_nsIMemoryReporter_h__
#define __gen_nsIMemoryReporter_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIMemoryReporter.h"
#endif
# 12 "../../dist/include/nsIMemoryReporter.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsIMemoryReporter.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsIMemoryReporter.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 20 "../../dist/include/nsIMemoryReporter.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsIMemoryReporter.h"
class nsIDOMWindow; /* forward declaration */

class nsIRunnable; /* forward declaration */

class nsISimpleEnumerator; /* forward declaration */


/* starting interface:    nsIMemoryReporterCallback */
#define NS_IMEMORYREPORTERCALLBACK_IID_STR "62ef0e1c-dbd6-11e3-aa75-3c970e9f4238"

#define NS_IMEMORYREPORTERCALLBACK_IID \
  {0x62ef0e1c, 0xdbd6, 0x11e3, \
    { 0xaa, 0x75, 0x3c, 0x97, 0x0e, 0x9f, 0x42, 0x38 }}

class NS_NO_VTABLE nsIMemoryReporterCallback : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMEMORYREPORTERCALLBACK_IID)

  /* void callback (in ACString process, in AUTF8String path, in int32_t kind, in int32_t units, in int64_t amount, in AUTF8String description, in nsISupports data); */
  NS_IMETHOD Callback(const nsACString & process, const nsACString & path, int32_t kind, int32_t units, int64_t amount, const nsACString & description, nsISupports *data) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMemoryReporterCallback, NS_IMEMORYREPORTERCALLBACK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIMEMORYREPORTERCALLBACK \
  NS_IMETHOD Callback(const nsACString & process, const nsACString & path, int32_t kind, int32_t units, int64_t amount, const nsACString & description, nsISupports *data) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIMEMORYREPORTERCALLBACK(_to) \
  NS_IMETHOD Callback(const nsACString & process, const nsACString & path, int32_t kind, int32_t units, int64_t amount, const nsACString & description, nsISupports *data) MOZ_OVERRIDE { return _to Callback(process, path, kind, units, amount, description, data); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIMEMORYREPORTERCALLBACK(_to) \
  NS_IMETHOD Callback(const nsACString & process, const nsACString & path, int32_t kind, int32_t units, int64_t amount, const nsACString & description, nsISupports *data) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Callback(process, path, kind, units, amount, description, data); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsMemoryReporterCallback : public nsIMemoryReporterCallback
{
public:
/* End of implementation class template. */
#endif
# 99 "../../dist/include/nsIMemoryReporter.h"


/* starting interface:    nsIMemoryReporter */
#define NS_IMEMORYREPORTER_IID_STR "92a36db1-46bd-4fe6-988e-47db47236d8b"

#define NS_IMEMORYREPORTER_IID \
  {0x92a36db1, 0x46bd, 0x4fe6, \
    { 0x98, 0x8e, 0x47, 0xdb, 0x47, 0x23, 0x6d, 0x8b }}

class NS_NO_VTABLE nsIMemoryReporter : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMEMORYREPORTER_IID)

  /* void collectReports (in nsIMemoryReporterCallback callback, in nsISupports data, in boolean anonymize); */
  NS_IMETHOD CollectReports(nsIMemoryReporterCallback *callback, nsISupports *data, bool anonymize) = 0;

  enum {
    KIND_NONHEAP = 0,
    KIND_HEAP = 1,
    KIND_OTHER = 2,
    UNITS_BYTES = 0,
    UNITS_COUNT = 1,
    UNITS_COUNT_CUMULATIVE = 2,
    UNITS_PERCENTAGE = 3
  };

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMemoryReporter, NS_IMEMORYREPORTER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIMEMORYREPORTER \
  NS_IMETHOD CollectReports(nsIMemoryReporterCallback *callback, nsISupports *data, bool anonymize) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIMEMORYREPORTER(_to) \
  NS_IMETHOD CollectReports(nsIMemoryReporterCallback *callback, nsISupports *data, bool anonymize) MOZ_OVERRIDE { return _to CollectReports(callback, data, anonymize); } \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIMEMORYREPORTER(_to) \
  NS_IMETHOD CollectReports(nsIMemoryReporterCallback *callback, nsISupports *data, bool anonymize) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->CollectReports(callback, data, anonymize); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

#endif /* expanded by -frewrite-includes */
# 766 "../../dist/include/nsIMemoryReporter.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 767 "../../dist/include/nsIMemoryReporter.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 768 "../../dist/include/nsIMemoryReporter.h"
class nsPIDOMWindow;
// nsIHandleReportCallback is a better name, but keep nsIMemoryReporterCallback
// around for backwards compatibility.
typedef nsIMemoryReporterCallback nsIHandleReportCallback;
namespace mozilla {
// Register a memory reporter.  The manager service will hold a strong
// reference to this reporter.
XPCOM_API(nsresult) RegisterStrongMemoryReporter(nsIMemoryReporter* aReporter);
// Register a memory reporter.  The manager service will hold a weak reference
// to this reporter.
XPCOM_API(nsresult) RegisterWeakMemoryReporter(nsIMemoryReporter* aReporter);
// Unregister a weak memory reporter.
XPCOM_API(nsresult) UnregisterWeakMemoryReporter(nsIMemoryReporter* aReporter);
// The memory reporter manager provides access to several distinguished
// amounts via attributes.  Some of these amounts are provided by Gecko
// components that cannot be accessed directly from XPCOM code.  So we provide
// the following functions for those components to be registered with the
// manager.
typedef int64_t (*InfallibleAmountFn)();
typedef nsresult (*FallibleAmountFn)(int64_t* aAmount);
#define DECL_REGISTER_DISTINGUISHED_AMOUNT(kind, name) \
    nsresult Register##name##DistinguishedAmount(kind##AmountFn aAmountFn);
#define DECL_UNREGISTER_DISTINGUISHED_AMOUNT(name) \
    nsresult Unregister##name##DistinguishedAmount();
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeGCHeap)
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeTemporaryPeak)
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeCompartmentsSystem)
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, JSMainRuntimeCompartmentsUser)
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, ImagesContentUsedUncompressed)
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, StorageSQLite)
DECL_UNREGISTER_DISTINGUISHED_AMOUNT(StorageSQLite)
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, LowMemoryEventsVirtual)
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, LowMemoryEventsPhysical)
DECL_REGISTER_DISTINGUISHED_AMOUNT(Infallible, GhostWindows)
#undef DECL_REGISTER_DISTINGUISHED_AMOUNT
#undef DECL_UNREGISTER_DISTINGUISHED_AMOUNT
// Likewise for per-tab measurement.
typedef nsresult (*JSSizeOfTabFn)(JSObject* aObj,
                                  size_t* aJsObjectsSize,
                                  size_t* aJsStringSize,
                                  size_t* aJsPrivateSize,
                                  size_t* aJsOtherSize);
typedef nsresult (*NonJSSizeOfTabFn)(nsPIDOMWindow* aWindow,
                                     size_t* aDomSize,
                                     size_t* aStyleSize,
                                     size_t* aOtherSize);
;
;
}
#if defined(MOZ_DMD)
namespace mozilla {
namespace dmd {
// This runs all the memory reporters in the current process but does nothing
// with the results;  i.e. it does the minimal amount of work possible for DMD
#define MOZ_REPORT(ptr)
#define MOZ_REPORT_ON_ALLOC(ptr)
#endif  // defined(MOZ_DMD)
# 836 "../../dist/include/nsIMemoryReporter.h"
// Functions generated via this macro should be used by all traversal-based
// memory reporters.  Such functions return |moz_malloc_size_of(ptr)|;  this
// will always be zero on some obscure platforms.
//
// You might be wondering why we have a macro that creates multiple functions
// that differ only in their name, instead of a single MallocSizeOf function.
// It's mostly to help with DMD integration, though it sometimes also helps
// with debugging and temporary ad hoc profiling.  The function name chosen
// doesn't matter greatly, but it's best to make it similar to the path used by
// the relevant memory reporter(s).
#define MOZ_DEFINE_MALLOC_SIZE_OF(fn)                                         \
  static size_t fn(const void* aPtr)                                          \
  static size_t fn(const void* aPtr)                                          \
  {                                                                           \
      return moz_malloc_size_of(aPtr);                                        \
  }
// This macro assumes the presence of appropriate |aHandleReport| and |aData|
// variables.
#define MOZ_COLLECT_REPORT(path, kind, units, amount, description)            \
  aHandleReport->Callback(EmptyCString(), NS_LITERAL_CSTRING(path),           \
                          kind, units, amount,                                \
                          NS_LITERAL_CSTRING(description), aData)

#endif /* __gen_nsIMemoryReporter_h__ */
# 876 "../../dist/include/nsIMemoryReporter.h"
# 22 "../../dist/include/gfxFont.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIObserver.h"
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/gfxFont.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDataHashtable.h"
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/gfxFont.h"
#if 0 /* expanded by -frewrite-includes */
#include "harfbuzz/hb.h"
#endif /* expanded by -frewrite-includes */
# 29 "../../dist/include/gfxFont.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 30 "../../dist/include/gfxFont.h"

typedef struct _cairo_scaled_font cairo_scaled_font_t;
//typedef struct gr_face            gr_face;

#ifdef DEBUG
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 36 "../../dist/include/gfxFont.h"
#endif
# 37 "../../dist/include/gfxFont.h"

class gfxContext;
class gfxTextRun;
class gfxFont;
class gfxGlyphExtents;
class gfxShapedText;
class gfxShapedWord;
class gfxSkipChars;
class gfxTextContextPaint;

#define FONT_MAX_SIZE                  2000.0

#define NO_FONT_LANGUAGE_OVERRIDE      0

#define SMALL_CAPS_SCALE_FACTOR        0.8

// The skew factor used for synthetic-italic [oblique] fonts;
// we use a platform-dependent value to harmonize with the platform's own APIs.
#ifdef XP_WIN
#define OBLIQUE_SKEW_FACTOR  0.3
#else
# 58 "../../dist/include/gfxFont.h"
#define OBLIQUE_SKEW_FACTOR  0.25
#endif
# 60 "../../dist/include/gfxFont.h"

struct gfxTextRunDrawCallbacks;

namespace mozilla {
namespace gfx {
class GlyphRenderingOptions;
}
}

struct gfxFontStyle {
    gfxFontStyle();
    ;
    ;

    // -- list of value tags for specific alternate features
    nsTArray<gfxAlternateValue> alternateValues;

    // -- object used to look these up once the font is matched
    nsRefPtr<gfxFontFeatureValueSet> featureValueLookup;

    // The logical size of the font, in pixels
    gfxFloat size;

    // The aspect-value (ie., the ratio actualsize:actualxheight) that any
    // actual physical font created from this font structure must have when
    // rendering or measuring a string. A value of 0 means no adjustment
    // needs to be done.
    float sizeAdjust;

    // baseline offset, used when simulating sub/superscript glyphs
    ;

    

    ;

    ;
};

struct gfxTextRange {
    enum {
        // flags for recording the kind of font-matching that was used
        kFontGroup      = 0x0001,
        kPrefsFallback  = 0x0002,
        kSystemFallback = 0x0004
    };
    
    
    uint32_t start, end;
    nsRefPtr<gfxFont> font;
    uint8_t matchType;
    uint16_t orientation;
};


/**
 * Font cache design:
 * 
 * The mFonts hashtable contains most fonts, indexed by (gfxFontEntry*, style).
 * It does not add a reference to the fonts it contains.
 * When a font's refcount decreases to zero, instead of deleting it we
 * add it to our expiration tracker.
 * individually. That only happens with longer-lived fonts.
 */
struct FontCacheSizes {
    

    size_t mFontInstances; // memory used by instances of gfxFont subclasses
    size_t mShapedWords; // memory used by the per-font shapedWord caches
};

class gfxFontCache MOZ_FINAL : public nsExpirationTracker<gfxFont,3> {
public:
    enum {
        FONT_TIMEOUT_SECONDS = 10,
        SHAPED_WORD_TIMEOUT_SECONDS = 60
    };

    virtual void NotifyExpired(gfxFont *aFont) MOZ_OVERRIDE;

    // Cleans out the hashtable and removes expired fonts waiting for cleanup.
    // Other gfxFont objects may be still in use but they will be pushed
    // into the expiration queues and removed.
    

    

    ;
    ;

protected:
    class MemoryReporter MOZ_FINAL : public nsIMemoryReporter
    {
        
    public:
        NS_DECL_ISUPPORTS
        NS_DECL_NSIMEMORYREPORTER
    };

    // Observer for notifications that the font cache cares about
    class Observer MOZ_FINAL
        : public nsIObserver
    {
        
    public:
        NS_DECL_ISUPPORTS
        NS_DECL_NSIOBSERVER
    };

    ;

    static gfxFontCache *gGlobalCache;

    struct Key {
        const gfxFontEntry* mFontEntry;
        const gfxFontStyle* mStyle;
        const gfxCharacterMap* mUnicodeRangeMap;
        
    };

    class HashEntry : public PLDHashEntryHdr {
    public:
        typedef const Key& KeyType;
        typedef const Key* KeyTypePointer;

        // When constructing a new entry in the hashtable, we'll leave this
        // blank. The caller of Put() will fill this in.
        
        
        

        ;
        
        
        enum { ALLOW_MEMMOVE = true };

        gfxFont* mFont;
    };

    ;

    nsTHashtable<HashEntry> mFonts;

    ;
    ;
    ;
    nsCOMPtr<nsITimer>      mWordCacheExpirationTimer;
};

class gfxTextPerfMetrics {
public:

    struct TextCounts {
        uint32_t    numContentTextRuns;
        uint32_t    numChromeTextRuns;
        uint32_t    numChars;
        uint32_t    maxTextRunLen;
        uint32_t    wordCacheSpaceRules;
        uint32_t    wordCacheLong;
        uint32_t    wordCacheHit;
        uint32_t    wordCacheMiss;
        uint32_t    fallbackPrefs;
        uint32_t    fallbackSystem;
        uint32_t    textrunConst;
        uint32_t    textrunDestr;
    };

    uint32_t reflowCount;

    // counts per reflow operation
    TextCounts current;

    // totals for the lifetime of a document
    TextCounts cumulative;

    

    // add current totals to cumulative ones
    
};

class gfxTextRunFactory {
    NS_INLINE_DECL_REFCOUNTING(gfxTextRunFactory)

public:
    // Flags in the mask 0xFFFF0000 are reserved for textrun clients
    // Flags in the mask 0x0000F000 are reserved for per-platform fonts
    // Flags in the mask 0x00000FFF are set by the textrun creator.
    enum {
        CACHE_TEXT_FLAGS    = 0xF0000000,
        TEXT_IS_RTL                  = 0x0004,
        /**
         * When set, spacing is enabled and the textrun needs to call GetSpacing
         * on the spacing provider.
         */
        TEXT_ENABLE_SPACING          = 0x0008,
        /**
         * When set, GetHyphenationBreaks may return true for some character
         * positions, otherwise it will always return false for all characters.
         */
        TEXT_ENABLE_HYPHEN_BREAKS    = 0x0010,
        /**
         * When set, the text has no characters above 255 and it is stored
         * in the textrun in 8-bit format.
         */
        TEXT_IS_8BIT                 = 0x0020,
        /**
         * When set, the RunMetrics::mBoundingBox field will be initialized
         * properly based on glyph extents, in particular, glyph extents that
         * overflow the standard font-box (the box defined by the ascent, descent
         * and advance width of the glyph). When not set, it may just be the
         * standard font-box even if glyphs overflow.
         */
        TEXT_NEED_BOUNDING_BOX       = 0x0040,
        /**
         * When set, optional ligatures are disabled. Ligatures that are
         * required for legible text should still be enabled.
         */
        TEXT_DISABLE_OPTIONAL_LIGATURES = 0x0080,
        /**
         * When set, the textrun should favour speed of construction over
         * quality. This may involve disabling ligatures and/or kerning or
         * characters, and separate glyphRuns created for the resulting
         * glyph orientations.
         */
        TEXT_ORIENT_MASK                    = 0xF000,
        TEXT_ORIENT_HORIZONTAL              = 0x0000,
        TEXT_ORIENT_VERTICAL_UPRIGHT        = 0x1000,
        TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT = 0x2000,
        TEXT_ORIENT_VERTICAL_SIDEWAYS_LEFT  = 0x4000,
        TEXT_ORIENT_VERTICAL_MIXED          = 0x8000,

        /**
         * nsTextFrameThebes sets these, but they're defined here rather than
         * in nsTextFrameUtils.h because ShapedWord creation/caching also needs
         * to check the _INCOMING flag
         */
        TEXT_TRAILING_ARABICCHAR = 0x20000000,
        /**
         * When set, the previous character for this textrun was an Arabic
         * character.  This is used for the context detection necessary for
         * bidi.numeral implementation.
         */
        TEXT_INCOMING_ARABICCHAR = 0x40000000,

        // Set if the textrun should use the OpenType 'math' script.
        TEXT_USE_MATH_SCRIPT = 0x80000000,

        TEXT_UNUSED_FLAGS = 0x10000000
    };

    /**
     * This record contains all the parameters needed to initialize a textrun.
     */
    struct Parameters {
        // A reference context suggesting where the textrun will be rendered
        gfxContext   *mContext;
        // Pointer to arbitrary user data (which should outlive the textrun)
        void         *mUserData;
        // A description of which characters have been stripped from the original
        // DOM string to produce the characters in the textrun. May be null
        // if that information is not relevant.
        gfxSkipChars *mSkipChars;
        // A list of where linebreaks are currently placed in the textrun. May
        // be null if mInitialBreakCount is zero.
        uint32_t     *mInitialBreaks;
        uint32_t      mInitialBreakCount;
        // The ratio to use to convert device pixels to application layout units
        int32_t       mAppUnitsPerDevUnit;
    };

protected:
    // Protected destructor, to discourage deletion outside of Release():
    virtual ~gfxTextRunFactory() {}
};

/**
 * gfxFontShaper
 *
 * This class implements text shaping (character to glyph mapping and
 * glyph layout). There is a gfxFontShaper subclass for each text layout
 * technology (uniscribe, core text, harfbuzz,....) we support.
 *
 * The shaper is responsible for setting up glyph data in gfxTextRuns.
 *
 * A generic, platform-independent shaper relies only on the standard
 * gfxFont interface and can work with any concrete subclass of gfxFont.
 *
 * Platform-specific implementations designed to interface to platform
 * shaping APIs such as Uniscribe or CoreText may rely on features of a
 * specific font subclass to access native font references
 * (such as CTFont, HFONT, DWriteFont, etc).
 */

class gfxFontShaper {
public:
    

    virtual ~gfxFontShaper() { }

    // Shape a piece of text and store the resulting glyph data into
    // aShapedText. Parameters aOffset/aLength indicate the range of
    // the font this shaper is working with
    gfxFont * mFont;
};


/*
 * gfxShapedText is an abstract superclass for gfxShapedWord and gfxTextRun.
 * These are objects that store a list of zero or more glyphs for each character.
 * For each glyph we store the glyph ID, the advance, and possibly x/y-offsets.
 * The idea is that a string is rendered by a loop that draws each glyph
 * at its designated offset from the current point, then advances the current
 * point by the glyph's advance in the direction of the textrun (LTR or RTL).
 * Each glyph advance is always rounded to the nearest appunit; this ensures
 * consistent results when dividing the text in a textrun into multiple text
 * frames (frame boundaries are always aligned to appunits). We optimize
 * for the case where a character has a single glyph and zero xoffset and yoffset,
 * and the glyph ID and advance are in a reasonable range so we can pack all
 * necessary data into 32 bits.
 *
 * gfxFontShaper can shape text into either a gfxShapedWord (cached by a gfxFont)
 * or directly into a gfxTextRun (for cases where we want to shape textruns in
 * their entirety rather than using cached words, because there may be layout
 * features that depend on the inter-word spaces).
 */
class gfxShapedText
{
public:
    gfxShapedText(uint32_t aLength, uint32_t aFlags,
                  int32_t aAppUnitsPerDevUnit)
        : mLength(aLength)
        , mFlags(aFlags)
        , mAppUnitsPerDevUnit(aAppUnitsPerDevUnit)
    { }

    virtual ~gfxShapedText() { }

    /**
     * This class records the information associated with a character in the
     * input string. It's optimized for the case where there is one glyph
     * representing that character alone.
     * 
     * A character can have zero or more associated glyphs. Each glyph
     * has an advance width and an x and y offset.
     * A character may be the start of a cluster.
     * A character may be the start of a ligature group.
     * A character can be "missing", indicating that the system is unable
     * to render the character.
     * 
     * All characters in a ligature group conceptually share all the glyphs
     * associated with the characters in a group.
     */
    class CompressedGlyph {
    public:
        CompressedGlyph() { mValue = 0; }

        enum {
            // Indicates that a cluster and ligature group starts at this
            // character; this character has a single glyph with a reasonable
            // advance and zero offsets. A "reasonable" advance
            // is one that fits in the available bits (currently 12) (specified
            // in appunits).
            FLAG_IS_SIMPLE_GLYPH  = 0x80000000U,

            // Indicates whether a linebreak is allowed before this character;
            // this is a two-bit field that holds a FLAG_BREAK_TYPE_xxx value
            // indicating the kind of linebreak (if any) allowed here.
            FLAGS_CAN_BREAK_BEFORE = 0x60000000U,

            FLAGS_CAN_BREAK_SHIFT = 29,
            FLAG_BREAK_TYPE_NONE   = 0,
            FLAG_BREAK_TYPE_NORMAL = 1,
            FLAG_BREAK_TYPE_HYPHEN = 2,

            FLAG_CHAR_IS_SPACE     = 0x10000000U,

            // The advance is stored in appunits
            ADVANCE_MASK  = 0x0FFF0000U,
            ADVANCE_SHIFT = 16,

            GLYPH_MASK = 0x0000FFFFU,

            // Non-simple glyphs may or may not have glyph data in the
            // corresponding mDetailedGlyphs entry. They have the following
            // flag bits:

            // When NOT set, indicates that this character corresponds to a
            // missing glyph and should be skipped (or possibly, render the character
            // Unicode value in some special way). If there are glyphs,
            // the mGlyphID is actually the UTF16 character code. The bit is
            // inverted so we can memset the array to zero to indicate all missing.
            FLAG_NOT_MISSING              = 0x01,
            FLAG_NOT_CLUSTER_START        = 0x02,
            FLAG_NOT_LIGATURE_GROUP_START = 0x04,

            FLAG_CHAR_IS_TAB              = 0x08,
            FLAG_CHAR_IS_NEWLINE          = 0x10,
            FLAG_CHAR_IS_LOW_SURROGATE    = 0x20,
            CHAR_IDENTITY_FLAGS_MASK      = 0x38,

            GLYPH_COUNT_MASK = 0x00FFFF00U,
            GLYPH_COUNT_SHIFT = 8
        };

        // "Simple glyphs" have a simple glyph ID, simple advance and their
        // x and y offsets are zero. Also the glyph extents do not overflow
        // the font-box defined by the font ascent, descent and glyph advance width.
        // These case is optimized to avoid storing DetailedGlyphs.

        // Returns true if the glyph ID aGlyph fits into the compressed representation
        static bool IsSimpleGlyphID(uint32_t aGlyph) {
            return (aGlyph & GLYPH_MASK) == aGlyph;
        }
        // Returns true if the advance aAdvance fits into the compressed representation.
        // aAdvance is in appunits.
        static bool IsSimpleAdvance(uint32_t aAdvance) {
            return (aAdvance & (ADVANCE_MASK >> ADVANCE_SHIFT)) == aAdvance;
        }

        bool IsSimpleGlyph() const { return (mValue & FLAG_IS_SIMPLE_GLYPH) != 0; }
        uint32_t GetSimpleAdvance() const { return (mValue & ADVANCE_MASK) >> ADVANCE_SHIFT; }
        uint32_t GetSimpleGlyph() const { return mValue & GLYPH_MASK; }

        bool IsMissing() const { return (mValue & (FLAG_NOT_MISSING|FLAG_IS_SIMPLE_GLYPH)) == 0; }
        bool IsClusterStart() const {
            return (mValue & FLAG_IS_SIMPLE_GLYPH) || !(mValue & FLAG_NOT_CLUSTER_START);
        }
        bool IsLigatureGroupStart() const {
            return (mValue & FLAG_IS_SIMPLE_GLYPH) || !(mValue & FLAG_NOT_LIGATURE_GROUP_START);
        }
        

        // Return true if the original character was a normal (breakable,
        // trimmable) space (U+0020). Not true for other characters that
        // may happen to map to the space glyph (U+00A0).
        

        
        
        

        uint32_t CharIdentityFlags() const {
            return IsSimpleGlyph() ? 0 : (mValue & CHAR_IDENTITY_FLAGS_MASK);
        }

        

        
        // Returns FLAGS_CAN_BREAK_BEFORE if the setting changed, 0 otherwise
        

        CompressedGlyph& SetSimpleGlyph(uint32_t aAdvanceAppUnits, uint32_t aGlyph) {
            NS_ASSERTION(IsSimpleAdvance(aAdvanceAppUnits), "Advance overflow");
            NS_ASSERTION(IsSimpleGlyphID(aGlyph), "Glyph overflow");
            NS_ASSERTION(!CharIdentityFlags(), "Char identity flags lost");
            mValue = (mValue & (FLAGS_CAN_BREAK_BEFORE | FLAG_CHAR_IS_SPACE)) |
                FLAG_IS_SIMPLE_GLYPH |
                (aAdvanceAppUnits << ADVANCE_SHIFT) | aGlyph;
            return *this;
        }
        CompressedGlyph& SetComplex(bool aClusterStart, bool aLigatureStart,
                uint32_t aGlyphCount) {
            mValue = (mValue & (FLAGS_CAN_BREAK_BEFORE | FLAG_CHAR_IS_SPACE)) |
                FLAG_NOT_MISSING |
                CharIdentityFlags() |
                (aClusterStart ? 0 : FLAG_NOT_CLUSTER_START) |
                (aLigatureStart ? 0 : FLAG_NOT_LIGATURE_GROUP_START) |
                (aGlyphCount << GLYPH_COUNT_SHIFT);
            return *this;
        }
        /**
         * Missing glyphs are treated as ligature group starts; don't mess with
         * the cluster-start flag (see bugs 618870 and 619286).
         */
        CompressedGlyph& SetMissing(uint32_t aGlyphCount) {
            mValue = (mValue & (FLAGS_CAN_BREAK_BEFORE | FLAG_NOT_CLUSTER_START |
                                FLAG_CHAR_IS_SPACE)) |
                CharIdentityFlags() |
                (aGlyphCount << GLYPH_COUNT_SHIFT);
            return *this;
        }
        uint32_t GetGlyphCount() const {
            NS_ASSERTION(!IsSimpleGlyph(), "Expected non-simple-glyph");
            return (mValue & GLYPH_COUNT_MASK) >> GLYPH_COUNT_SHIFT;
        }

        void SetIsSpace() {
            mValue |= FLAG_CHAR_IS_SPACE;
        }
        void SetIsTab() {
            NS_ASSERTION(!IsSimpleGlyph(), "Expected non-simple-glyph");
            mValue |= FLAG_CHAR_IS_TAB;
        }
        void SetIsNewline() {
            NS_ASSERTION(!IsSimpleGlyph(), "Expected non-simple-glyph");
            mValue |= FLAG_CHAR_IS_NEWLINE;
        }
        void SetIsLowSurrogate() {
            NS_ASSERTION(!IsSimpleGlyph(), "Expected non-simple-glyph");
            mValue |= FLAG_CHAR_IS_LOW_SURROGATE;
        }

    private:
        uint32_t mValue;
    };

    // Accessor for the array of CompressedGlyph records, which will be in
    // a different place in gfxShapedWord vs gfxTextRun
    virtual CompressedGlyph *GetCharacterGlyphs() = 0;

    /**
     * When the glyphs for a character don't fit into a CompressedGlyph record
     * in SimpleGlyph format, we use an array of DetailedGlyphs instead.
     */
    struct DetailedGlyph {
        /** The glyphID, or the Unicode character
         * if this is a missing glyph */
        uint32_t mGlyphID;
        /** The advance, x-offset and y-offset of the glyph, in appunits
         *  mAdvance is in the text direction (RTL or LTR)
         *  mXOffset is always from left to right
         *  mYOffset is always from top to bottom */   
        int32_t  mAdvance;
        float    mXOffset, mYOffset;
    };

    void SetGlyphs(uint32_t aCharIndex, CompressedGlyph aGlyph,
                   const DetailedGlyph *aGlyphs);

    void SetMissingGlyph(uint32_t aIndex, uint32_t aChar, gfxFont *aFont);

    void SetIsSpace(uint32_t aIndex) {
        GetCharacterGlyphs()[aIndex].SetIsSpace();
    }

    void SetIsLowSurrogate(uint32_t aIndex) {
        SetGlyphs(aIndex, CompressedGlyph().SetComplex(false, false, 0), nullptr);
        GetCharacterGlyphs()[aIndex].SetIsLowSurrogate();
    }

    bool HasDetailedGlyphs() const {
        return mDetailedGlyphs != nullptr;
    }

    bool IsLigatureGroupStart(uint32_t aPos) {
        NS_ASSERTION(aPos < GetLength(), "aPos out of range");
        return GetCharacterGlyphs()[aPos].IsLigatureGroupStart();
    }

    // NOTE that this must not be called for a character offset that does
    // not have any DetailedGlyph records; callers must have verified that
    // GetCharacterGlyphs()[aCharIndex].GetGlyphCount() is greater than zero.
    DetailedGlyph *GetDetailedGlyphs(uint32_t aCharIndex) {
        NS_ASSERTION(GetCharacterGlyphs() && HasDetailedGlyphs() &&
                     !GetCharacterGlyphs()[aCharIndex].IsSimpleGlyph() &&
                     GetCharacterGlyphs()[aCharIndex].GetGlyphCount() > 0,
                     "invalid use of GetDetailedGlyphs; check the caller!");
        return mDetailedGlyphs->Get(aCharIndex);
    }

    void AdjustAdvancesForSyntheticBold(float aSynBoldOffset,
                                        uint32_t aOffset, uint32_t aLength);

    // Mark clusters in the CompressedGlyph records, starting at aOffset,
    // based on the Unicode properties of the text in aString.
    // This is also responsible to set the IsSpace flag for space characters.
    void SetupClusterBoundaries(uint32_t         aOffset,
                                const char16_t *aString,
                                uint32_t         aLength);
    // In 8-bit text, there won't actually be any clusters, but we still need
    // the space-marking functionality.
    void SetupClusterBoundaries(uint32_t       aOffset,
                                const uint8_t *aString,
                                uint32_t       aLength);

    uint32_t GetFlags() const {
        return mFlags;
    }

    bool IsVertical() const {
        return (GetFlags() & gfxTextRunFactory::TEXT_ORIENT_MASK) !=
                gfxTextRunFactory::TEXT_ORIENT_HORIZONTAL;
    }

    bool UseCenterBaseline() const {
        uint32_t orient = GetFlags() & gfxTextRunFactory::TEXT_ORIENT_MASK;
        return orient == gfxTextRunFactory::TEXT_ORIENT_VERTICAL_MIXED ||
               orient == gfxTextRunFactory::TEXT_ORIENT_VERTICAL_UPRIGHT;
    }

    bool IsRightToLeft() const {
        return (GetFlags() & gfxTextRunFactory::TEXT_IS_RTL) != 0;
    }

    

    

    bool TextIs8Bit() const {
        return (GetFlags() & gfxTextRunFactory::TEXT_IS_8BIT) != 0;
    }

    

    uint32_t GetLength() const {
        return mLength;
    }

    ;

protected:
    // Allocate aCount DetailedGlyphs for the given index
    ;

    // For characters whose glyph data does not fit the "simple" glyph criteria
    // in CompressedGlyph, we use a sorted array to store the association
    // between the source character offset and an index into an array 
    // DetailedGlyphs. The CompressedGlyph record includes a count of
    // the number of DetailedGlyph records that belong to the character,
    // starting at the given index.
    class DetailedGlyphStore {
    public:
        

        // This is optimized for the most common calling patterns:
        // we rarely need random access to the records, access is most commonly
        // sequential through the textRun, so we record the last-used index
        // and check whether the caller wants the same record again, or the
        // next; if not, it's most likely we're starting over from the start
        // of the run, so we check the first entry before resorting to binary
        // search as a last resort.
        // NOTE that this must not be called for a character offset that does
        // not have any DetailedGlyph records; callers must have verified that
        // mCharacterGlyphs[aOffset].GetGlyphCount() is greater than zero
        // before calling this, otherwise the assertions here will fire (in a
        // debug build), and we'll probably crash.
        DetailedGlyph* Get(uint32_t aOffset) {
            NS_ASSERTION(mOffsetToIndex.Length() > 0,
                         "no detailed glyph records!");
            DetailedGlyph* details = mDetails.Elements();
            // check common cases (fwd iteration, initial entry, etc) first
            if (mLastUsed < mOffsetToIndex.Length() - 1 &&
                aOffset == mOffsetToIndex[mLastUsed + 1].mOffset) {
                ++mLastUsed;
            } else if (aOffset == mOffsetToIndex[0].mOffset) {
                mLastUsed = 0;
            } else if (aOffset == mOffsetToIndex[mLastUsed].mOffset) {
                // do nothing
            } else if (mLastUsed > 0 &&
                       aOffset == mOffsetToIndex[mLastUsed - 1].mOffset) {
                --mLastUsed;
            } else {
                mLastUsed =
                    mOffsetToIndex.BinaryIndexOf(aOffset, CompareToOffset());
            }
            NS_ASSERTION(mLastUsed != nsTArray<DGRec>::NoIndex,
                         "detailed glyph record missing!");
            return details + mOffsetToIndex[mLastUsed].mIndex;
        }

        

        

    private:
        struct DGRec {
            
            uint32_t mOffset; // source character offset in the textrun
            uint32_t mIndex;  // index where this char's DetailedGlyphs begin
        };

        struct CompareToOffset {
            bool Equals(const DGRec& a, const uint32_t& b) const {
                return a.mOffset == b;
            }
            bool LessThan(const DGRec& a, const uint32_t& b) const {
                return a.mOffset < b;
            }
        };

        struct CompareRecordOffsets {
            
            
        };

        // Concatenated array of all the DetailedGlyph records needed for the
        // textRun; individual character offsets are associated with indexes
        // into this array via the mOffsetToIndex table.
        nsTArray<DetailedGlyph>     mDetails;

        // For each character offset that needs DetailedGlyphs, we record the
        // index in mDetails where the list of glyphs begins. This array is
        // sorted by mOffset.
        nsTArray<DGRec>             mOffsetToIndex;

        // Records the most recently used index into mOffsetToIndex, so that
        // we can support sequential access more quickly than just doing
        // a binary search each time.
        nsTArray<DGRec>::index_type mLastUsed;
    };

    nsAutoPtr<DetailedGlyphStore>   mDetailedGlyphs;

    // Number of char16_t characters and CompressedGlyph glyph records
    uint32_t                        mLength;

    // Shaping flags (direction, ligature-suppression)
    uint32_t                        mFlags;

    int32_t                         mAppUnitsPerDevUnit;
};

/*
 * gfxShapedWord: an individual (space-delimited) run of text shaped with a
 * particular font, without regard to external context.
 *
 * The glyph data is copied into gfxTextRuns as needed from the cache of
 * ShapedWords associated with each gfxFont instance.
 */
class gfxShapedWord : public gfxShapedText
{
public:
    // Create a ShapedWord that can hold glyphs for aLength characters,
    // with mCharacterGlyphs sized appropriately.
    //
    // Returns null on allocation failure (does NOT use infallible alloc)
    // so caller must check for success.
    //
    // This does NOT perform shaping, so the returned word contains no
    // glyph data; the caller must call gfxFont::ShapeText() with appropriate
    // parameters to set up the glyphs.
    

    

    // Override operator delete to properly free the object that was
    // allocated via moz_malloc.
    

    

    
    CompressedGlyph  mCharGlyphsStorage[1];
};

class GlyphBufferAzure;
struct TextRunDrawParams;
struct FontDrawParams;

class gfxFont {

    friend class gfxHarfBuzzShaper;
    friend class gfxGraphiteShaper;

protected:
    typedef mozilla::gfx::DrawTarget DrawTarget;

public:
    
    

    

    // options to specify the kind of AA to be used when creating a font
    typedef enum {
        kAntialiasDefault,
        kAntialiasNone,
        kAntialiasGrayscale,
        kAntialiasSubpixel
    } AntialiasOption;

protected:
    nsAutoRefCnt mRefCnt;
    cairo_scaled_font_t *mScaledFont;

    

    ;

public:
    ;

    

    // options for the kind of bounding box to return from measurement
    typedef enum {
        LOOSE_INK_EXTENTS,
            // A box that encloses all the painted pixels, and may
            // include sidebearings and/or additional ascent/descent
            // within the glyph cell even if the ink is smaller.
        TIGHT_INK_EXTENTS,
            // A box that tightly encloses all the painted pixels
            // (although actually on Windows, at least, it may be
            // slightly larger than strictly necessary because
            // we can't get precise extents with ClearType).
        TIGHT_HINTED_OUTLINE_EXTENTS
            // A box that tightly encloses the glyph outline,
            // ignoring possible antialiasing pixels that extend
            // beyond this.
            // NOTE: The default implementation of gfxFont::Measure(),
            // which works with the glyph extents cache, does not
            // differentiate between this and TIGHT_INK_EXTENTS.
            // Whether the distinction is important depends on the
            // antialiasing behavior of the platform; currently the
            // distinction is only implemented in the gfxWindowsFont
            // subclass, because of ClearType's tendency to paint
            // outside the hinted outline.
            // Also NOTE: it is relatively expensive to request this,
            // as it does not use cached glyph extents in the font.
    } BoundingBoxType;

    
    

    ;

    // Subclasses may choose to look up glyph ids for characters.
    // If they do not override this, gfxHarfBuzzShaper will fetch the cmap
    // table and use that.
    
    // Map unicode character to glyph ID.
    // Only used if ProvidesGetGlyph() returns true.
    
    // Return the horizontal advance of a glyph.
    ;

    // Return Azure GlyphRenderingOptions for drawing this font.
    virtual mozilla::TemporaryRef<mozilla::gfx::GlyphRenderingOptions>
      GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams = nullptr)
    { return nullptr; }

    ;

    // Font metrics
    struct Metrics {
        gfxFloat xHeight;
        gfxFloat strikeoutSize;
        gfxFloat strikeoutOffset;
        gfxFloat underlineSize;
        gfxFloat underlineOffset;

        gfxFloat internalLeading;
        gfxFloat externalLeading;

        gfxFloat emHeight;
        gfxFloat emAscent;
        gfxFloat emDescent;
        gfxFloat maxHeight;
        gfxFloat maxAscent;
        gfxFloat maxDescent;
        gfxFloat maxAdvance;

        gfxFloat aveCharWidth;
        gfxFloat spaceWidth;
        gfxFloat zeroOrAveCharWidth;  // width of '0', or if there is
                                      // no '0' glyph in this font,
                                      // equal to .aveCharWidth
    };

    enum Orientation {
        eHorizontal,
        eVertical
    };

    const Metrics& GetMetrics(Orientation aOrientation)
    {
        if (aOrientation == eHorizontal) {
            return GetHorizontalMetrics();
        }
        if (!mVerticalMetrics) {
            mVerticalMetrics = CreateVerticalMetrics();
        }
        return *mVerticalMetrics;
    }

    /**
     * We let layout specify spacing on either side of any
     * character. We need to specify both before and after
     * spacing so that substring measurement can do the right things.
     * These values are in appunits. They're always an integral number of
     * appunits, but we specify them in floats in case very large spacing
     * values are required.
     */
    struct Spacing {
        gfxFloat mBefore;
        gfxFloat mAfter;
    };
    /**
     * Metrics for a particular string
     */
    struct RunMetrics {
        

        ;

        // can be negative (partly due to negative spacing).
        // Advance widths should be additive: the advance width of the
        // (offset1, length1) plus the advance width of (offset1 + length1,
        // length2) should be the advance width of (offset1, length1 + length2)
        gfxFloat mAdvanceWidth;
        
        // For zero-width substrings, these must be zero!
        gfxFloat mAscent;  // always non-negative
        gfxFloat mDescent; // always non-negative
        
        // Bounding box that is guaranteed to include everything drawn.
        // If a tight boundingBox was requested when these metrics were
        // generated, this will tightly wrap the glyphs, otherwise it is
        // "loose" and may be larger than the true bounding box.
        // Coordinates are relative to the baseline left origin, so typically
        // mBoundingBox.y == -mAscent
        gfxRect  mBoundingBox;
    };

    /**
        FONT_TYPE_FT2,
        FONT_TYPE_MAC,
        FONT_TYPE_OS2,
        FONT_TYPE_CAIRO
    } FontType;

    ;

    

    

    /**
     * Subclass this object to be notified of glyph changes. Delete the object
     * when no longer needed.
     */
    class GlyphChangeObserver {
    public:
        
        // This gets called when the gfxFont dies.
        
        ;
    protected:
        
        gfxFont* mFont;
    };
    // return a cloned font resized and offset to simulate sub/superscript glyphs
    ;

protected:
    virtual const Metrics& GetHorizontalMetrics() = 0;

    const Metrics* CreateVerticalMetrics();

    // Output a single glyph at *aPt, which is updated by the glyph's advance.
    // Normal glyphs are simply accumulated in aBuffer until it is full and
    // gets flushed, but SVG or color-font glyphs will instead be rendered
    // directly to the destination (found from the buffer's parameters).
    ;

    // Output a run of glyphs at *aPt, which is updated to follow the last glyph
    // in the run. This method also takes account of any letter-spacing provided

    mozilla::RefPtr<mozilla::gfx::ScaledFont> mAzureScaledFont;

    // For vertical metrics, created on demand.
    nsAutoPtr<const Metrics> mVerticalMetrics;

    // Helper for subclasses that want to initialize standard metrics from the
    // tables of sfnt (TrueType/OpenType) fonts.
    // This will use mFUnitsConvFactor if it is already set, else compute it
    // from mAdjustedSize and the unitsPerEm in the font's 'head' table.
    // Returns TRUE and sets mIsValid=TRUE if successful;
    // Returns TRUE but leaves mIsValid=FALSE if the font seems to be broken.
    // Returns FALSE if the font does not appear to be an sfnt at all,
    // and should be handled (if possible) using other APIs.
    ;

    gfxTextContextPaint      *contextPaint;
    mozilla::gfx::Matrix     *passedInvMatrix;
    mozilla::gfx::Matrix      matInv;
    double                    synBoldOnePixelOffset;
    int32_t                   extraStrikes;
    mozilla::gfx::DrawOptions drawOptions;
    bool                      isVerticalFont;
    bool                      haveSVGGlyphs;
    bool                      haveColorGlyphs;
};

#endif
# 2144 "../../dist/include/gfxFont.h"
# 13 "../../dist/include/gfxTextRun.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxTextRun.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxSkipChars.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxSkipChars.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_SKIP_CHARS_H
#define GFX_SKIP_CHARS_H

#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxSkipChars.h"

/*
 * gfxSkipChars is a data structure representing a list of characters that
 * have been skipped. The initial string is called the "original string"
 * and after skipping some characters, the result is called the "skipped string".
 * gfxSkipChars provides efficient ways to translate between offsets in the
 * original string and the skipped string. It is used by textrun code to keep
 * track of offsets before and after text transformations such as whitespace
 * compression and control code deletion.
 */

/**
 * The gfxSkipChars is represented as a sorted array of skipped ranges.
 *
 * A freshly-created gfxSkipChars means "all chars kept".
 */
class gfxSkipChars
{
    friend struct SkippedRangeStartComparator;
    friend struct SkippedRangeOffsetComparator;

private:
    class SkippedRange
    {
    public:
        

        

        

        

        

        

        

        

    private:
        uint32_t mOffset; // original-string offset at which we want to skip
        uint32_t mLength; // number of skipped chars at this offset
        uint32_t mDelta;  // sum of lengths of preceding skipped-ranges
    };

public:
    

    

    
    int32_t mOriginalStringToSkipCharsOffset;
};

#endif /*GFX_SKIP_CHARS_H*/
# 306 "../../dist/include/gfxSkipChars.h"
# 15 "../../dist/include/gfxTextRun.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "gfxPlatform.h"
#endif /* expanded by -frewrite-includes */
class nsILanguageAtomService;
class gfxMissingFontRecorder;

/**
 * Callback for Draw() to use when drawing text with mode
 * DrawMode::GLYPH_PATH.
 */
struct gfxTextRunDrawCallbacks {

    /**
     * Constructs a new DrawCallbacks object.
     *
     * @param aShouldPaintSVGGlyphs If true, SVG glyphs will be painted.  If
     *   false, SVG glyphs will not be painted; fallback plain glyphs are not
     *   emitted either.
     */
    

    /**
     * Called when a path has been emitted to the gfxContext when
     * painting a text run.  This can be called any number of times,
     * due to partial ligatures and intervening SVG glyphs.
     */
    ;

    bool mShouldPaintSVGGlyphs;
};

/**
 * gfxTextRun is an abstraction for drawing and measuring substrings of a run
 * of text. It stores runs of positioned glyph data, each run having a single
 * gfxFont. The glyphs are associated with a string of source text, and the
 * gfxTextRun APIs take parameters that are offsets into that source text.
 * 
 * gfxTextRuns are not refcounted. They should be deleted when no longer required.
 * 
 * gfxTextRuns are mostly immutable. The only things that can change are
 * inter-cluster spacing and line break placement. Spacing is always obtained
 * lazily by methods that need it, it is not cached. Line breaks are stored
 * persistently (insofar as they affect the shaping of glyphs; gfxTextRun does
 * not actually do anything to explicitly account for line breaks). Initially
 * there are no line breaks. The textrun can record line breaks before or after
 * any given cluster. (Line breaks specified inside clusters are ignored.)
 * 
 * It is important that zero-length substrings are handled correctly. This will
 * be on the test!
 */
class gfxTextRun : public gfxShapedText {
public:

    // Override operator delete to properly free the object that was
    // allocated via moz_malloc.
    void operator delete(void* p) {
        moz_free(p);
    }

    virtual ~gfxTextRun();

    typedef gfxFont::RunMetrics Metrics;

    // Public textrun API for general use

    
    
    /**
     * Layout provides PropertyProvider objects. These allow detection of
     * potential line break points and computation of spacing. We pass the data
     * this way to allow lazy data acquisition; for example BreakAndMeasureText
     * will want to only ask for properties of text it's actually looking at.
     * 
     * NOTE that requested spacing may not actually be applied, if the textrun
     * is unable to apply it in some context. Exception: spacing around a
     * whitespace character MUST always be applied.
     */
    class PropertyProvider {
    public:
        // Detect hyphenation break opportunities in the given range; breaks
        // not at cluster boundaries will be ignored.
        ;

        // Returns the provider's hyphenation setting, so callers can decide
        // whether it is necessary to call GetHyphenationBreaks.
        // Result is an NS_STYLE_HYPHENS_* value.
        ;

        // Returns the extra width that will be consumed by a hyphen. This should
        // be constant for a given textrun.
        ;

        typedef gfxFont::Spacing Spacing;

        /**
         * Get the spacing around the indicated characters. Spacing must be zero
         * inside clusters. In other words, if character i is not
         * CLUSTER_START, then character i-1 must have zero after-spacing and
         * character i must have zero before-spacing.
         */
        ;

        // Returns a gfxContext that can be used to measure the hyphen glyph.
        // Only called if the hyphen width is requested.
        ;

        // Return the appUnitsPerDevUnit value to be used when measuring.
        // Only called if the hyphen width is requested.
        ;
    };

    class ClusterIterator {
    public:
        ;

        ;

        ;

        

        ;

        ;

    private:
        gfxTextRun *mTextRun;
        uint32_t    mCurrentChar;
    };

    /**
     * 
     * Glyphs should be drawn in logical content order, which can be significant
     * if they overlap (perhaps due to negative spacing).
     */
    ;

    /**
     * Computes the ReflowMetrics for a substring.
     * Uses GetSpacing from aBreakProvider.
     * @param aBoundingBoxType which kind of bounding box (loose/tight)
     */
    Metrics MeasureText(uint32_t aStart, uint32_t aLength,
                        gfxFont::BoundingBoxType aBoundingBoxType,
                        gfxContext *aRefContextForTightBoundingBox,
                        PropertyProvider *aProvider);

    

    // Utility getters

    
    

    
    
    
    gfxFontGroup *GetFontGroup() const { return mFontGroup; }


    // Call this, don't call "new gfxTextRun" directly. This does custom
    // allocation and initialization
    ;

    // The text is divided into GlyphRuns as necessary
    struct GlyphRun {
        nsRefPtr<gfxFont> mFont;   // never null
        uint32_t          mCharacterOffset; // into original UTF16 string
        uint8_t           mMatchType;
        uint16_t          mOrientation; // gfxTextRunFactory::TEXT_ORIENT_* value
    };

    class GlyphRunIterator {
    public:
        
        ;
        
        
        
    private:
        gfxTextRun *mTextRun;
        GlyphRun   *mGlyphRun;
        uint32_t    mStringStart;
        uint32_t    mStringEnd;
        uint32_t    mNextIndex;
        uint32_t    mStartOffset;
        uint32_t    mEndOffset;
    };

    class GlyphRunOffsetComparator {
    public:
        

        
    };
    ;

    // Record the positions of specific characters that layout may need to
    // detect in the textrun, even though it doesn't have an explicit copy
    // of the original text. These are recorded using flag bits in the
    // CompressedGlyph record; if necessary, we convert "simple" glyph records
    // to "complex" ones as the Tab and Newline flags are not present in
    // simple CompressedGlyph records.
    
    
    

    /**
     * Prefetch all the glyph extents needed to ensure that Measure calls
     * on this textrun not requesting tight boundingBoxes will succeed. Note
     * that some glyph extents might not be fetched due to OOM or other
     * errors.
     */
    ;

    ;
    const GlyphRun *GetGlyphRuns(uint32_t *aNumGlyphRuns) {
        *aNumGlyphRuns = mGlyphRuns.Length();
        return mGlyphRuns.Elements();
    }
    // Returns the index of the GlyphRun containing the given offset.
    // Returns mGlyphRuns.Length() when aOffset is mCharacterCount.
    ;

    // Copy glyph data from a ShapedWord into this textrun.
    ;

    // Copy glyph data for a range of characters from aSource to this
    // textrun.
    ;

    

    // Tell the textrun to release its reference to its creating gfxFontGroup
    // immediately, rather than on destruction. This is used for textruns
    // that are actually owned by a gfxFontGroup, so that they don't keep it
    // permanently alive due to a circular reference. (The caller of this is
    // taking responsibility for ensuring the textrun will not outlive its
    // mFontGroup.)
    ;

    struct LigatureData {
        // textrun offsets of the start and end of the containing ligature
        uint32_t mLigatureStart;
        uint32_t mLigatureEnd;
        // appunits advance to the start of the ligature part within the ligature;
        // never includes any spacing
        gfxFloat mPartAdvance;
        // appunits width of the ligature part; includes before-spacing
        // when the part is at the start of the ligature, and after-spacing
        // when the part is as the end of the ligature
        gfxFloat mPartWidth;
        
        bool mClipBeforePart;
        bool mClipAfterPart;
    };
    
    // return storage used by this run, for memory reporter;
    // nsTransformedTextRun needs to override this as it holds additional data
    
      MOZ_MUST_OVERRIDE;
    
      MOZ_MUST_OVERRIDE;

    // Get the size, if it hasn't already been gotten, marking as it goes.
    
    

    // shaping state - for some font features, fallback is required that
    // affects the entire run. for example, fallback for one script/font
    // portion of a textrun requires fallback to be applied to the entire run

    enum ShapingState {
        eShapingState_Normal,                 // default state
        eShapingState_ShapingWithFeature,     // have shaped with feature
        eShapingState_ShapingWithFallback,    // have shaped with fallback
        eShapingState_Aborted,                // abort initial iteration
        eShapingState_ForceFallbackFeature    // redo with fallback forced on
    };

    
    

#ifdef DEBUG
    void Dump(FILE* aOutput);
#endif
# 632 "../../dist/include/gfxTextRun.h"

protected:
    /**
     * Create a textrun, and set its mCharacterGlyphs to point immediately
     * after the base object; this is ONLY used in conjunction with placement
     * new, after allocating a block large enough for the glyph records to
     * follow the base textrun object.
     */
    ;

    /**
     * Helper for the Create() factory method to allocate the required
     * glyph storage for a textrun object with the basic size aSize,
     * plus room for aLength glyph records.
     */
    ;

    // **** measurement helper ****
    ;

    // **** drawing helper ****
    ;

    // XXX this should be changed to a GlyphRun plus a maybe-null GlyphRun*,
    // for smaller size especially in the super-common one-glyphrun case
    nsAutoTArray<GlyphRun,1>        mGlyphRuns;

    void             *mUserData;
    gfxFontGroup     *mFontGroup; // addrefed on creation, but our reference
                                  // may be released by ReleaseFontGroup()
    gfxSkipChars      mSkipChars;
    nsExpirationState mExpirationState;

    bool              mSkipDrawing; // true if the font group we used had a user font
                                    // download that's in progress, so we should hide text
                                    // until the download completes (or timeout fires)
    bool              mReleasedFontGroup; // we already called NS_RELEASE on
                                          // mFontGroup, so don't do it again

    // shaping state for handling variant fallback features
    // such as subscript/superscript variant glyphs
    ShapingState      mShapingState;
};

class gfxFontGroup : public gfxTextRunFactory {
public:
    ; // platform must call this to release the languageAtomService

    ;

    ;

    // Returns first valid font in the fontlist or default font.
    // Initiates userfont loads if userfont not loaded
    virtual gfxFont* GetFirstValidFont(uint32_t aCh = 0x20);

    // Returns the first font in the font-group that has an OpenType MATH table,
    // or null if no such font is available. The GetMathConstant methods may be
    // called on the returned font.
    ;

    

    ;

    /**
     * The listed characters should be treated as invisible and zero-width
     * when creating textruns.
     */
    ;
    ;

    /**
     * Make a textrun for a given string.
     * If aText is not persistent (aFlags & TEXT_IS_PERSISTENT), the
     * textrun will copy it.
     * This calls FetchGlyphExtents on the textrun.
     */
    virtual gfxTextRun *MakeTextRun(const char16_t *aString, uint32_t aLength,
                                    const Parameters *aParams, uint32_t aFlags,
                                    gfxMissingFontRecorder *aMFR);
    /**
     * Make a textrun for a given string.
     * If aText is not persistent (aFlags & TEXT_IS_PERSISTENT), the
     * textrun will copy it.
     * This calls FetchGlyphExtents on the textrun.
     */
    ;

    /**
     * Textrun creation helper for clients that don't want to pass
     * a full Parameters record.
     */
    template<typename T>
    gfxTextRun *MakeTextRun(const T *aString, uint32_t aLength,
                            gfxContext *aRefContext,
                            int32_t aAppUnitsPerDevUnit,
                            uint32_t aFlags,
                            gfxMissingFontRecorder *aMFR)
    {
        gfxTextRunFactory::Parameters params = {
            aRefContext, nullptr, nullptr, nullptr, 0, aAppUnitsPerDevUnit
        };
        return MakeTextRun(aString, aLength, &params, aFlags, aMFR);
    }

    /**
     * Get the (possibly-cached) width of the hyphen character.
     * The aCtx and aAppUnitsPerDevUnit parameters will be used only if
     * needed to initialize the cached hyphen width; otherwise they are
     * ignored.
     */
    ;

    /**
     * Make a text run representing a single hyphen character.
     * This will use U+2010 HYPHEN if available in the first font,
     * otherwise fall back to U+002D HYPHEN-MINUS.
     * The caller is responsible for deleting the returned text run
     * when no longer required.
     */
    ;

    /**
     * Check whether a given font (specified by its gfxFontEntry)
     * is already in the fontgroup's list of actual fonts
     */
    ;

    // This returns the preferred underline for this font group.
    // Some CJK fonts have wrong underline offset in its metrics.
    // If this group has such "bad" font, each platform's gfxFontGroup

    // With downloadable fonts, the composition of the font group can change as fonts are downloaded
    // for each change in state of the user font set, the generation value is bumped to avoid picking up
    // previously created text runs in the text run word cache.  For font groups based on stylesheets
    // with no @font-face rule, this always returns 0.
    ;

    // generation of the latest fontset rebuild, 0 when no fontset present
    ;

    // used when logging text performance
    
    void SetTextPerfMetrics(gfxTextPerfMetrics *aTextPerf) { mTextPerf = aTextPerf; }

    // This will call UpdateUserFonts() if the user font set is changed.
    ;

    // If there is a user font set, check to see whether the font list or any
    // caches need updating.
    virtual void UpdateUserFonts();

    // search for a specific userfont in the list of fonts
    ;

    

    class LazyReferenceContextGetter {
    public:
      ;
    };
    // The gfxFontGroup keeps ownership of this textrun.
    // It is only guaranteed to exist until the next call to GetEllipsisTextRun
    // (which might use a different appUnitsPerDev value) for the font group,
    // or until UpdateUserFonts is called, or the fontgroup is destroyed.
    // Get it/use it/forget it :) - don't keep a reference that might go stale.
    ;

    // helper method for resolving generic font families
    ;

protected:
    class FamilyFace {
    public:
        

        

        
        bool                    mFontCreated : 1;
        bool                    mLoading     : 1;
        bool                    mInvalid     : 1;
    };

    // List of font families, either named or generic.
    // Generic names map to system pref fonts based on language.
    mozilla::FontFamilyList mFamilyList;

    // Fontlist containing a font entry for each family found. gfxFont objects
    // are created as needed and userfont loads are initiated when needed.
    // Code should be careful about addressing this array directly.
    nsTArray<FamilyFace> mFonts;

    nsRefPtr<gfxFont> mDefaultFont;
    gfxFontStyle mStyle;

    gfxFloat mUnderlineOffset;
    gfxFloat mHyphenWidth;

    nsRefPtr<gfxUserFontSet> mUserFontSet;
    uint64_t mCurrGeneration;  // track the current user font set generation, rebuild font list if needed

    gfxTextPerfMetrics *mTextPerf;

    // Cache a textrun representing an ellipsis (useful for CSS text-overflow)
    // at a specific appUnitsPerDevPixel size
    nsAutoPtr<gfxTextRun>   mCachedEllipsisTextRun;

    // cache the most recent pref font to avoid general pref font lookup
    nsRefPtr<gfxFontFamily> mLastPrefFamily;
    nsRefPtr<gfxFont>       mLastPrefFont;
    // Return null if regular face doesn't support aCh
    ;

    // helper methods for looking up fonts

    // iterate over the fontlist, lookup names and expand generics
    ;

    // expand a generic to a list of specific names based on prefs
    ;

    // lookup and add a font with a given name (i.e. *not* a generic!)
    ;

    static nsILanguageAtomService* gLangService;
};

// A "missing font recorder" is to be used during text-run creation to keep
// a record of any scripts encountered for which font coverage was lacking;
// when Flush() is called, it sends a notification that front-end code can use
// to download fonts on demand (or whatever else it wants to do).

#define GFX_MISSING_FONTS_NOTIFY_PREF "gfx.missing_fonts.notify"

class gfxMissingFontRecorder {
public:
    gfxMissingFontRecorder()
    {
        MOZ_COUNT_CTOR(gfxMissingFontRecorder);
        memset(&mMissingFonts, 0, sizeof(mMissingFonts));
    }

    // recorded, and clear the mMissingFonts set for re-use
    void Flush();

    // forget any missing-scripts that have been recorded up to now;
    // called before discarding a recorder we no longer care about
    

private:
    // Number of 32-bit words needed for the missing-script flags
    static const uint32_t kNumScriptBitsWords =
        ((MOZ_NUM_SCRIPT_CODES + 31) / 32);
    uint32_t mMissingFonts[kNumScriptBitsWords];
};

#endif
# 1185 "../../dist/include/gfxTextRun.h"
# 18 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CanvasGradient.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/CanvasGradient.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_CanvasGradient_h
#define mozilla_dom_CanvasGradient_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/CanvasGradient.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/CanvasGradient.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/CanvasGradient.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CanvasRenderingContext2DBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/CanvasRenderingContext2DBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_CanvasRenderingContext2DBinding_h
#define mozilla_dom_CanvasRenderingContext2DBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/CanvasRenderingContext2DBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/CanvasRenderingContext2DBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/CanvasRenderingContext2DBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/UnionMember.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/CanvasRenderingContext2DBinding.h"

namespace mozilla {
namespace dom {

class CanvasGradient;
struct CanvasGradientAtoms;
class CanvasPath;
struct CanvasPathAtoms;
class CanvasPattern;
struct CanvasPatternAtoms;
class CanvasRenderingContext2D;
struct CanvasRenderingContext2DAtoms;
struct ContextAttributes2DAtoms;
class Element;
class HTMLCanvasElement;
class HTMLImageElement;
class HTMLVideoElement;
struct HitRegionOptionsAtoms;
struct NativePropertyHooks;
class OwningHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement;
class OwningStringOrCanvasGradientOrCanvasPattern;
class ProtoAndIfaceCache;
class TextMetrics;
struct TextMetricsAtoms;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

enum class CanvasWindingRule : uint32_t {
  Nonzero,
  Evenodd,
  EndGuard_
};

namespace CanvasWindingRuleValues {
extern const EnumEntry strings[3];
} // namespace CanvasWindingRuleValues


;


;


;


;


struct ContextAttributes2D : public DictionaryBase
{
  bool mAlpha;
  bool mWillReadFrequently;

  ContextAttributes2D();

  explicit inline ContextAttributes2D(const FastDictionaryInitializer& )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

  

  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  ;

  ;

  ;

  ;

  ;

private:
  ;
};

namespace binding_detail {
struct FastContextAttributes2D : public ContextAttributes2D
{
  inline FastContextAttributes2D()
    : ContextAttributes2D(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


class HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement
{
  friend class HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElementArgument;
  enum Type
  {
    eUninitialized,
    eHTMLImageElement,
    eHTMLCanvasElement,
    eHTMLVideoElement
  };

  union Value
  {
    UnionMember<NonNull<mozilla::dom::HTMLImageElement> > mHTMLImageElement;
    UnionMember<NonNull<mozilla::dom::HTMLCanvasElement> > mHTMLCanvasElement;
    UnionMember<NonNull<mozilla::dom::HTMLVideoElement> > mHTMLVideoElement;

  };

  Type mType;
  Value mValue;

  HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement(const HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement&) = delete;
  void operator=(const HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement) = delete;
public:
  explicit inline HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement()
    : mType(eUninitialized)
  {
  }

  inline ~HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement()
  {
    Uninit();
  }

  

  

  inline bool
  IsHTMLImageElement() const
  {
    return mType == eHTMLImageElement;
  }

  

  inline mozilla::dom::HTMLImageElement&
  GetAsHTMLImageElement() const
  {
    MOZ_ASSERT(IsHTMLImageElement(), "Wrong type!");
    return mValue.mHTMLImageElement.Value();
  }

  

  

  inline bool
  IsHTMLCanvasElement() const
  {
    return mType == eHTMLCanvasElement;
  }

  

  inline mozilla::dom::HTMLCanvasElement&
  GetAsHTMLCanvasElement() const
  {
    MOZ_ASSERT(IsHTMLCanvasElement(), "Wrong type!");
    return mValue.mHTMLCanvasElement.Value();
  }

  

  

  inline bool
  IsHTMLVideoElement() const
  {
    return mType == eHTMLVideoElement;
  }

  

  inline mozilla::dom::HTMLVideoElement&
  GetAsHTMLVideoElement() const
  {
    MOZ_ASSERT(IsHTMLVideoElement(), "Wrong type!");
    return mValue.mHTMLVideoElement.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eHTMLImageElement: {
        DestroyHTMLImageElement();
        break;
      }
      case eHTMLCanvasElement: {
        DestroyHTMLCanvasElement();
        break;
      }
      case eHTMLVideoElement: {
        DestroyHTMLVideoElement();
        break;
      }
    }
  }

  ;

private:
  inline void
  DestroyHTMLImageElement()
  {
    MOZ_ASSERT(IsHTMLImageElement(), "Wrong type!");
    mValue.mHTMLImageElement.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyHTMLCanvasElement()
  {
    MOZ_ASSERT(IsHTMLCanvasElement(), "Wrong type!");
    mValue.mHTMLCanvasElement.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyHTMLVideoElement()
  {
    MOZ_ASSERT(IsHTMLVideoElement(), "Wrong type!");
    mValue.mHTMLVideoElement.Destroy();
    mType = eUninitialized;
  }
};


class OwningHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement : public AllOwningUnionBase
{
  ;
  enum Type
  {
    eUninitialized,
    eHTMLImageElement,
    eHTMLCanvasElement,
    eHTMLVideoElement
  };

  ;

  ;

  ;
};


struct HitRegionOptions : public DictionaryBase
{
  nsRefPtr<mozilla::dom::Element> mControl;
  nsString mId;

  ;

  explicit inline HitRegionOptions(const FastDictionaryInitializer& )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }
};


class OwningStringOrCanvasGradientOrCanvasPattern : public AllOwningUnionBase
{
  ;
  enum Type
  {
    eUninitialized,
    eString,
    eCanvasGradient,
    eCanvasPattern
  };

  ;

  ;

  ;

  ;
};


namespace CanvasGradientBinding {

  typedef mozilla::dom::CanvasGradient NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  extern const NativePropertyHooks sNativePropertyHooks[];

  ;

  ;

  bool
  Wrap(JSContext* aCx, mozilla::dom::CanvasGradient* aObject, nsWrapperCache* aCache, JS::MutableHandle<JSObject*> aReflector);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, T* aObject)
  {
    JS::Rooted<JSObject*> reflector(aCx);
    return Wrap(aCx, aObject, aObject, &reflector) ? reflector.get() : nullptr;
  }

  ;

  ;

  ;

  ;

} // namespace CanvasGradientBinding



namespace CanvasPatternBinding {

  typedef mozilla::dom::CanvasPattern NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  extern const NativePropertyHooks sNativePropertyHooks[];

  ;

  ;

  bool
  Wrap(JSContext* aCx, mozilla::dom::CanvasPattern* aObject, nsWrapperCache* aCache, JS::MutableHandle<JSObject*> aReflector);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, T* aObject)
  {
    JS::Rooted<JSObject*> reflector(aCx);
    return Wrap(aCx, aObject, aObject, &reflector) ? reflector.get() : nullptr;
  }

  ;

  ;

  ;

  ;

} // namespace CanvasPatternBinding



namespace CanvasRenderingContext2DBinding {

  typedef mozilla::dom::CanvasRenderingContext2D NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  extern const NativePropertyHooks sNativePropertyHooks[];

  ;

  ;

  bool
  Wrap(JSContext* aCx, mozilla::dom::CanvasRenderingContext2D* aObject, nsWrapperCache* aCache, JS::MutableHandle<JSObject*> aReflector);

  template <class T>
  inline JSObject* Wrap(JSContext* aCx, T* aObject)
  {
    JS::Rooted<JSObject*> reflector(aCx);
    return Wrap(aCx, aObject, aObject, &reflector) ? reflector.get() : nullptr;
  }

  ;

  ;

  ;

  ;

} // namespace CanvasRenderingContext2DBinding



namespace Path2DBinding {

  typedef mozilla::dom::CanvasPath NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  extern const NativePropertyHooks sNativePropertyHooks[];

  ;

  ;

  ;

  ;

} // namespace Path2DBinding



namespace TextMetricsBinding {

  typedef mozilla::dom::TextMetrics NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  extern const NativePropertyHooks sNativePropertyHooks[];

  ;

  ;

  bool
  Wrap(JSContext* aCx, mozilla::dom::TextMetrics* aObject, JS::MutableHandle<JSObject*> aReflector);

  ;

  ;

  ;

  ;

} // namespace TextMetricsBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_CanvasRenderingContext2DBinding_h
# 1133 "../../dist/include/mozilla/dom/CanvasRenderingContext2DBinding.h"
# 12 "../../dist/include/mozilla/dom/CanvasGradient.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CanvasRenderingContext2D.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef CanvasRenderingContext2D_h
#define CanvasRenderingContext2D_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include <vector>
#endif /* expanded by -frewrite-includes */
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/CanvasGradient.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/CanvasGradient.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxGradientCache.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxGradientCache.h" 1

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_GRADIENT_CACHE_H
#define GFX_GRADIENT_CACHE_H

#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxGradientCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxPattern.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxPattern.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_PATTERN_H
#define GFX_PATTERN_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxPattern.h"

#if 0 /* expanded by -frewrite-includes */
#include "gfxMatrix.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxMatrix.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_MATRIX_H
#define GFX_MATRIX_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxPoint.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxMatrix.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxMatrix.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxRect.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/gfxMatrix.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxMatrix.h"

// XX - I don't think this class should use gfxFloat at all,
// but should use 'double' and be called gfxDoubleMatrix;
// we can then typedef that to gfxMatrix where we typedef
// double to be gfxFloat.

/**
 * A matrix that represents an affine transformation. Projective
 * transformations are not supported. This matrix looks like:
 *
 * / a  b  0 \
 * | c  d  0 |
 * \ tx ty 1 /
 *
 * So, transforming a point (x, y) results in:
 *
 *           / a  b  0 \   / a * x + c * y + tx \ T
 * (x y 1) * | c  d  0 | = | b * x + d * y + ty |
 *           \ tx ty 1 /   \         1          /
 *
 */
class gfxMatrix {
public:
    double _11; double _12;
    double _21; double _22;
    double _31; double _32;

    /**
     * Initializes this matrix as the identity matrix.
     */
    gfxMatrix() { Reset(); }

    /**
     * Initializes the matrix from individual components. See the class
     * description for the layout of the matrix.
     */
    gfxMatrix(gfxFloat a, gfxFloat b, gfxFloat c, gfxFloat d, gfxFloat tx, gfxFloat ty) :
        _11(a),  _12(b),
        _21(c),  _22(d),
        _31(tx), _32(ty) { }

    MOZ_ALWAYS_INLINE gfxMatrix Copy() const {
        return gfxMatrix(*this);
    }

    

    /**
     * Post-multiplies m onto the matrix.
     */
    ;

    /**
     * Multiplies *this with m and returns the result.
     */
    

    /* Returns true if the other matrix is fuzzy-equal to this matrix.
     * Note that this isn't a cheap comparison!
     */
    

    

    // matrix operations
    /**
     * Resets this matrix to the identity matrix.
     */
    const gfxMatrix& Reset();

    

    /**
     * Inverts this matrix, if possible. Otherwise, the matrix is left
     * unchanged.
     *
     * XXX should this do something with the return value of
     * cairo_matrix_invert?
     */
    ;

    /**
     * Check if matrix is singular (no inverse exists).
     */
    

    /**
     * Scales this matrix. The scale is pre-multiplied onto this matrix,
     * i.e. the scaling takes place before the other transformations.
     */
    gfxMatrix& Scale(gfxFloat x, gfxFloat y);

    /**
     * Translates this matrix. The translation is pre-multiplied onto this matrix,
     * i.e. the translation takes place before the other transformations.
     */
    gfxMatrix& Translate(const gfxPoint& pt);

    gfxMatrix& Translate(gfxFloat x, gfxFloat y) {
      return Translate(gfxPoint(x, y));
    }

    /**
     * Rotates this matrix. The rotation is pre-multiplied onto this matrix,
     * i.e. the translation takes place after the other transformations.
     *
     * @param radians Angle in radians.
    

    /**
     * Transforms a point according to this matrix.
     */
    ;


    /**
     * Transform a distance according to this matrix. This does not apply
     * any translation components.
     */
    gfxSize Transform(const gfxSize& size) const;

    /**
     * Transforms both the point and distance according to this matrix.

    /**
     * Returns true if the matrix has any transform other
     * than a translation or scale; this is, if there is
     * no rotation.
     */
    

    /**
     * Computes the determinant of this matrix.
     */
    double Determinant() const {
        return _11*_22 - _12*_21;
    }

    /* Computes the scale factors of this matrix; that is,
     * the amounts each basis vector is scaled by.
     * The xMajor parameter indicates if the larger scale is
     * to be assumed to be in the X direction or not.
     */
    gfxSize ScaleFactors(bool xMajor) const {
        double det = Determinant();

        if (det == 0.0)
            return gfxSize(0.0, 0.0);

        gfxSize sz = xMajor ? gfxSize(1.0, 0.0) : gfxSize(0.0, 1.0);
        sz = Transform(sz);

        double major = sqrt(sz.width * sz.width + sz.height * sz.height);
        double minor = 0.0;

        // ignore mirroring
        if (det < 0.0)
            det = - det;

        if (major)
            minor = det / major;

        if (xMajor)
            return gfxSize(major, minor);

        return gfxSize(minor, major);
    }

    /**
     * Snap matrix components that are close to integers
     * to integers. In particular, components that are integral when
     * converted to single precision are set to those integers.
     */
    ;

    /**
     * Returns true if matrix is multiple of 90 degrees rotation with flipping,
     * scaling and translation.
     */
    

private:
    static bool FuzzyEqual(gfxFloat aV1, gfxFloat aV2) {
        return fabs(aV2 - aV1) < 1e-6;
    }
};

#endif /* GFX_MATRIX_H */
# 305 "../../dist/include/gfxMatrix.h"
# 12 "../../dist/include/gfxPattern.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Alignment.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxPattern.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxPattern.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/PatternHelpers.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/PatternHelpers.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _MOZILLA_GFX_PATTERNHELPERS_H
#define _MOZILLA_GFX_PATTERNHELPERS_H

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Alignment.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/PatternHelpers.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/gfx/PatternHelpers.h"

namespace mozilla {
namespace gfx {

/**
 * This class is used to allow general pattern creation functions to return
 * any type of pattern via an out-paramater without allocating a pattern
 * instance on the free-store (an instance of this class being created on the
 * stack before passing it in to the creation function). Without this class
 * writing pattern creation functions would be a pain since Pattern objects are
 * not reference counted, making lifetime management of instances created on
 * the free-store and returned from a creation function hazardous. Besides
 * that, in the case that ColorPattern's are expected to be common, it is
 * particularly desirable to avoid the overhead of allocating on the
 * free-store.
 */
class GeneralPattern
{
public:
  explicit GeneralPattern()
    : mPattern(nullptr)
  {}

  

  ~GeneralPattern() {
    if (mPattern) {
      mPattern->~Pattern();
    }
  }

  

  ColorPattern* InitColorPattern(const Color &aColor) {
    MOZ_ASSERT(!mPattern);
    mPattern = new (mColorPattern.addr()) ColorPattern(aColor);
    return mColorPattern.addr();
  }

  LinearGradientPattern* InitLinearGradientPattern(const Point &aBegin,
                                                   const Point &aEnd,
                                                   GradientStops *aStops,
                                                   const Matrix &aMatrix = Matrix()) {
    MOZ_ASSERT(!mPattern);
    mPattern = new (mLinearGradientPattern.addr())
      LinearGradientPattern(aBegin, aEnd, aStops, aMatrix);
    return mLinearGradientPattern.addr();
  }

  RadialGradientPattern* InitRadialGradientPattern(const Point &aCenter1,
                                                   const Point &aCenter2,
                                                   Float aRadius1,
                                                   Float aRadius2,
                                                   GradientStops *aStops,
                                                   const Matrix &aMatrix = Matrix()) {
    MOZ_ASSERT(!mPattern);
    mPattern = new (mRadialGradientPattern.addr())
      RadialGradientPattern(aCenter1, aCenter2, aRadius1, aRadius2, aStops, aMatrix);
    return mRadialGradientPattern.addr();
  }

  SurfacePattern* InitSurfacePattern(SourceSurface *aSourceSurface,
                                     ExtendMode aExtendMode,
                                     const Matrix &aMatrix = Matrix(),
                                     Filter aFilter = Filter::GOOD,
                                     const IntRect &aSamplingRect = IntRect()) {
    MOZ_ASSERT(!mPattern);
    mPattern = new (mSurfacePattern.addr())
      SurfacePattern(aSourceSurface, aExtendMode, aMatrix, aFilter, aSamplingRect);
    return mSurfacePattern.addr();
  }

  Pattern* GetPattern() {
    return mPattern;
  }

  

  

private:
  union {
    AlignedStorage2<ColorPattern> mColorPattern;
    AlignedStorage2<LinearGradientPattern> mLinearGradientPattern;
    AlignedStorage2<RadialGradientPattern> mRadialGradientPattern;
    AlignedStorage2<SurfacePattern> mSurfacePattern;
  };
  Pattern *mPattern;
};

} // namespace gfx
} // namespace mozilla

#endif //  _MOZILLA_GFX_PATTERNHELPERS_H
# 137 "../../dist/include/mozilla/gfx/PatternHelpers.h"

# 15 "../../dist/include/gfxPattern.h" 2

class gfxContext;
class gfxASurface;
struct gfxRGBA;
typedef struct _cairo_pattern cairo_pattern_t;


class gfxPattern MOZ_FINAL{
    NS_INLINE_DECL_REFCOUNTING(gfxPattern)

public:
    ;
    // linear
    ; // linear
    ; // radial
    ;

    ;
    ;

    // This should only be called on a cairo pattern that we want to use with
    // Azure. We will read back the color stops from cairo and try to look
    // them up in the cache.
    ;

    ;
    ;
    ;

    /* Get an Azure Pattern for the current Cairo pattern. aPattern transform
     * specifies the transform that was set on the DrawTarget when the pattern
     * was set. When this is nullptr it is assumed the transform is identical
     * to the current transform.
     */
    ;
    ;

    enum GraphicsExtend {
        EXTEND_NONE,
        EXTEND_REPEAT,
        EXTEND_REFLECT,
        EXTEND_PAD,

        // Our own private flag for setting either NONE or PAD,
        // depending on what the platform does for NONE.  This is only
        // relevant for surface patterns; for all other patterns, it
        // behaves identical to PAD.  On MacOS X, this becomes "NONE",
        // because Quartz does the thing that we want at image edges;
        // similarily on the win32 printing surface, since
        // everything's done with GDI there.  On other platforms, it
        // usually becomes PAD.
        EXTEND_PAD_EDGE = 1000
    };

    // none, repeat, reflect
    ;
    GraphicsExtend Extend() const;

    enum GraphicsPatternType {
        PATTERN_SOLID,
        PATTERN_SURFACE,
        PATTERN_LINEAR,
        PATTERN_RADIAL
    };

    GraphicsPatternType GetType() const;

    int CairoStatus();

    void SetFilter(GraphicsFilter filter);
    GraphicsFilter Filter() const;

    /* returns TRUE if it succeeded */
    bool GetSolidColor(gfxRGBA& aColor);

private:
    // Private destructor, to discourage deletion outside of Release():
    ~gfxPattern() {}

    mozilla::gfx::GeneralPattern mGfxPattern;
    mozilla::RefPtr<mozilla::gfx::SourceSurface> mSourceSurface;
    mozilla::gfx::Matrix mPatternToUserSpace;
    mozilla::RefPtr<mozilla::gfx::GradientStops> mStops;
    nsTArray<mozilla::gfx::GradientStop> mStopsList;
    GraphicsExtend mExtend;
};

#endif /* GFX_PATTERN_H */
# 110 "../../dist/include/gfxPattern.h"
# 12 "../../dist/include/gfxGradientCache.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxGradientCache.h"

namespace mozilla {
namespace gfx {

class gfxGradientCache {
public:
    static gfx::GradientStops*
    GetGradientStops(const gfx::DrawTarget *aDT,
                     nsTArray<gfx::GradientStop>& aStops,
                     gfx::ExtendMode aExtend);

    static gfx::GradientStops*
    GetOrCreateGradientStops(const gfx::DrawTarget *aDT,
                             nsTArray<gfx::GradientStop>& aStops,
                             gfx::ExtendMode aExtend);

    static void PurgeAllCaches();
    static void Shutdown();
};

}
}

#endif
# 37 "../../dist/include/gfxGradientCache.h"
# 16 "../../dist/include/mozilla/dom/CanvasGradient.h" 2

namespace mozilla {
namespace dom {

class CanvasGradient : public nsWrapperCache
{
public:
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasGradient)
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasGradient)

  enum class Type : uint8_t {
    LINEAR = 0,
    RADIAL
  };

  Type GetType()
  {
    return mType;
  }

  mozilla::gfx::GradientStops *
  GetGradientStopsForTarget(mozilla::gfx::DrawTarget *aRT)
  {
    if (mStops && mStops->GetBackendType() == aRT->GetBackendType()) {
      return mStops;
    }

    mStops =
      gfx::gfxGradientCache::GetOrCreateGradientStops(aRT,
                                                      mRawStops,
                                                      gfx::ExtendMode::CLAMP);

    return mStops;
  }

  // WebIDL
  ;

  JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
  {
    return CanvasGradientBinding::Wrap(aCx, this);
  }

  

protected:
  

  nsRefPtr<CanvasRenderingContext2D> mContext;
  nsTArray<mozilla::gfx::GradientStop> mRawStops;
  mozilla::RefPtr<mozilla::gfx::GradientStops> mStops;
  Type mType;
  virtual ~CanvasGradient() {}
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_CanvasGradient_h
# 82 "../../dist/include/mozilla/dom/CanvasGradient.h"
# 20 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CanvasRenderingContext2DBinding.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CanvasPattern.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/CanvasPattern.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_CanvasPattern_h
#define mozilla_dom_CanvasPattern_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/CanvasPattern.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CanvasRenderingContext2DBinding.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/CanvasPattern.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CanvasRenderingContext2D.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef CanvasRenderingContext2D_h
#define CanvasRenderingContext2D_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include <vector>
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLCanvasElement.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLVideoElement.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
    cssPixel = pc->AppUnitsPerCSSPixel();

  FINISH:
    if (perDevPixel)
      *perDevPixel = devPixel;
    if (perCSSPixel)
      *perCSSPixel = cssPixel;
  }

#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/CanvasPattern.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/CanvasPattern.h"

class nsIPrincipal;

namespace mozilla {
namespace gfx {
class SourceSurface;
}

namespace dom {
class SVGMatrix;

class CanvasPattern MOZ_FINAL : public nsWrapperCache
{
  ~CanvasPattern() {}
public:
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPattern)
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPattern)

  enum class RepeatMode : uint8_t {
    REPEAT,
    REPEATX,
    REPEATY,
    NOREPEAT
  };

  

  JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
  {
    return CanvasPatternBinding::Wrap(aCx, this);
  }

  

  // WebIDL
  ;

  nsRefPtr<CanvasRenderingContext2D> mContext;
  RefPtr<gfx::SourceSurface> mSurface;
  nsCOMPtr<nsIPrincipal> mPrincipal;
  mozilla::gfx::Matrix mTransform;
  const bool mForceWriteOnly;
  const bool mCORSUsed;
  const RepeatMode mRepeat;
};

}
}

#endif // mozilla_dom_CanvasPattern_h
# 81 "../../dist/include/mozilla/dom/CanvasPattern.h"
# 22 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Rect.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 24 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfx2DGlue.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfx2DGlue.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_2D_GLUE_H
#define GFX_2D_GLUE_H


#if 0 /* expanded by -frewrite-includes */
#include "gfxPlatform.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfx2DGlue.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxRect.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfx2DGlue.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxMatrix.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/gfx2DGlue.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfx3DMatrix.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfx3DMatrix.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_3DMATRIX_H
#define GFX_3DMATRIX_H

#if 0 /* expanded by -frewrite-includes */
#include <gfxTypes.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfx3DMatrix.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Point.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfx3DMatrix.h"
#if 0 /* expanded by -frewrite-includes */
#include <gfxQuad.h>
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxQuad.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_QUAD_H
#define GFX_QUAD_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxQuad.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxRect.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxQuad.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxLineSegment.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxLineSegment.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_LINESEGMENT_H
#define GFX_LINESEGMENT_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxLineSegment.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxPoint.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxLineSegment.h"

struct gfxLineSegment {
  gfxLineSegment(const gfxPoint &aStart, const gfxPoint &aEnd) 
    : mStart(aStart)
    , mEnd(aEnd)
  {}

  bool PointsOnSameSide(const gfxPoint& aOne, const gfxPoint& aTwo)
  {
    // Solve the equation y - mStart.y - ((mEnd.y - mStart.y)/(mEnd.x - mStart.x))(x - mStart.x) for both points 
  
    gfxFloat deltaY = (mEnd.y - mStart.y);
    gfxFloat deltaX = (mEnd.x - mStart.x);
  
    gfxFloat one = deltaX * (aOne.y - mStart.y) - deltaY * (aOne.x - mStart.x);
    gfxFloat two = deltaX * (aTwo.y - mStart.y) - deltaY * (aTwo.x - mStart.x);

    // If both results have the same sign, then we're on the correct side of the line.
    // 0 (on the line) is always considered in.

    if ((one >= 0 && two >= 0) || (one <= 0 && two <= 0))
      return true;
    return false;
  }

  /**
   * Determines if two line segments intersect, and returns the intersection
   * point in aIntersection if they do.
   *
   * Coincident lines are considered not intersecting as they don't have an
   * intersection point.
   */
  

  gfxPoint mStart;
  gfxPoint mEnd;
};

#endif /* GFX_LINESEGMENT_H */
# 78 "../../dist/include/gfxLineSegment.h"
# 12 "../../dist/include/gfxQuad.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxQuad.h"

struct gfxQuad {
    

    bool Contains(const gfxPoint& aPoint)
    {
        return (gfxLineSegment(mPoints[0], mPoints[1]).PointsOnSameSide(aPoint, mPoints[2]) &&
                gfxLineSegment(mPoints[1], mPoints[2]).PointsOnSameSide(aPoint, mPoints[3]) &&
                gfxLineSegment(mPoints[2], mPoints[3]).PointsOnSameSide(aPoint, mPoints[0]) &&
                gfxLineSegment(mPoints[3], mPoints[0]).PointsOnSameSide(aPoint, mPoints[1]));
    }

    gfxRect GetBounds()
    {
        gfxFloat min_x, max_x;
        gfxFloat min_y, max_y;

        min_x = max_x = mPoints[0].x;
        min_y = max_y = mPoints[0].y;

        for (int i=1; i<4; i++) {
          min_x = std::min(mPoints[i].x, min_x);
          max_x = std::max(mPoints[i].x, max_x);
          min_y = std::min(mPoints[i].y, min_y);
          max_y = std::max(mPoints[i].y, max_y);
        }
        return gfxRect(min_x, min_y, max_x - min_x, max_y - min_y);
    }

    gfxPoint mPoints[4];
};

#endif /* GFX_QUAD_H */
# 52 "../../dist/include/gfxQuad.h"
# 12 "../../dist/include/gfx3DMatrix.h" 2

class gfxMatrix;

/**
 * This class represents a 3D transformation. The matrix is laid
 * out as follows:
 *
 * _11 _12 _13 _14
 * _21 _22 _23 _24
 * _31 _32 _33 _34
 * _41 _42 _43 _44
 *
 * This matrix is treated as row-major. Assuming we consider our vectors row
 * vectors, this matrix type will be identical in memory to the OpenGL and D3D
 * matrices. OpenGL matrices are column-major, however OpenGL also treats
 * vectors as column vectors, the double transposition makes everything work
 * out nicely.
 */
class gfx3DMatrix
{
  typedef mozilla::gfx::Point3D Point3D;
  typedef mozilla::gfx::Point4D Point4D;
public:
  /**
   * Pre-multiplication transformation functions:
  ;
  ;
  ;

private:

  ;
  ;

  ;

public:

  /** Matrix elements */
  float _11, _12, _13, _14;
  float _21, _22, _23, _24;
  float _31, _32, _33, _34;
  float _41, _42, _43, _44;
};

#endif /* GFX_3DMATRIX_H */
# 358 "../../dist/include/gfx3DMatrix.h"
# 13 "../../dist/include/gfx2DGlue.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "gfxContext.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxContext.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_CONTEXT_H
#ifndef GFX_ASURFACE_H
#define GFX_ASURFACE_H

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxASurface.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxASurface.h"

#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxASurface.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxASurface.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/gfxASurface.h"

#ifdef MOZILLA_INTERNAL_API
#if 0 /* expanded by -frewrite-includes */
#include "nsStringFwd.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/gfxASurface.h"
#else
# 19 "../../dist/include/gfxASurface.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringAPI.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/gfxASurface.h"
#endif
# 21 "../../dist/include/gfxASurface.h"

class gfxImageSurface;
struct nsIntPoint;
struct nsIntRect;
struct gfxRect;
struct gfxPoint;

template <typename T>
struct already_AddRefed;

/**
 * A surface is something you can draw on. Instantiate a subclass of this
 * abstract class, and use gfxContext to draw on this surface.
 */
class gfxASurface {
public:
#ifdef MOZILLA_INTERNAL_API
    nsrefcnt AddRef(void);
    nsrefcnt Release(void);

    // These functions exist so that browsercomps can refcount a gfxASurface
    virtual nsrefcnt AddRefExternal(void);
    virtual nsrefcnt ReleaseExternal(void);
#else
# 45 "../../dist/include/gfxASurface.h"
    ;
    virtual nsrefcnt Release(void);
#endif
# 48 "../../dist/include/gfxASurface.h"

public:

    /** Wrap the given cairo surface and return a gfxASurface for it.
     * This adds a reference to csurf (owned by the returned gfxASurface).
     */
    ;

    /*** this DOES NOT addref the surface */
    

    ;

    ;

    ;
    ;

    ;

    /**
     * Create an offscreen surface that can be efficiently copied into
     * this surface (at least if tiling is not involved).
     * Returns null on error.
     */
    virtual already_AddRefed<gfxASurface> CreateSimilarSurface(gfxContentType aType,
                                                               const nsIntSize& aSize);

    /**
     * Returns an image surface for this surface, or nullptr if not supported.
     * This will not copy image data, just wraps an image surface around
     * pixel data already available in memory.
     */
    virtual already_AddRefed<gfxImageSurface> GetAsImageSurface();

    /**
     * Returns a read-only ARGB32 image surface for this surface. If this is an
     * for allocations and negative bytes for deallocations.
     */
    ;

    /**
     * Same as above, but use current surface type as returned by GetType().
     * The bytes will be accumulated until RecordMemoryFreed is called,
     * in which case the value that was recorded for this surface will
     * be freed.
     */
    ;
    ;

    

    virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
    virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
    // gfxASurface has many sub-classes.  This method indicates if a sub-class
    // is capable of measuring its own size accurately.  If not, the caller
    // must fall back to a computed size.  (Note that gfxASurface can actually
    // measure itself, but we must |return false| here because it serves as the
    // (conservative) default for all the sub-classes.  Therefore, this
    // function should only be called on a |gfxASurface*| that actually points
    // to a sub-class of gfxASurface.)
    virtual bool SizeOfIsMeasured() const { return false; }

    /**
     * Where does this surface's memory live?  By default, we say it's in this
     * process's heap.
     */
    virtual gfxMemoryLocation GetMemoryLocation() const;

    ;

    cairo_surface_t *mSurface;
    mozilla::UniquePtr<gfxRect> mOpaqueRect;

private:
    ;

    

private:
    nsIntSize mSize;
};

#endif /* GFX_ASURFACE_H */
# 239 "../../dist/include/gfxASurface.h"
# 12 "../../dist/include/gfxContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "gfxPoint.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/gfxContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxRect.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/gfxContext.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/gfxContext.h"

typedef struct _cairo cairo_t;
class GlyphBufferAzure;
template <typename T> class FallibleTArray;

namespace mozilla {
namespace gfx {
struct RectCornerRadii;
}
}

/**
 * This is the main class for doing actual drawing. It is initialized using
 * a surface and can be drawn on. It manages various state information like
 * a current transformation matrix (CTM), a current path, current color,
 * etc.
 *
 * All drawing happens by creating a path and then stroking or filling it.
 * The functions like Rectangle and Arc do not do any drawing themselves.
 * When a path is drawn (stroked or filled), it is filled/stroked with a
 * pattern set by SetPattern, SetColor or SetSource.
 *
 * Note that the gfxContext takes coordinates in device pixels,
 * as opposed to app units.
 */
class gfxContext MOZ_FINAL {
    typedef mozilla::gfx::CapStyle CapStyle;
    typedef mozilla::gfx::JoinStyle JoinStyle;
    typedef mozilla::gfx::FillRule FillRule;
    typedef mozilla::gfx::Path Path;
    typedef mozilla::gfx::Pattern Pattern;
    typedef mozilla::gfx::Rect Rect;
    typedef mozilla::gfx::RectCornerRadii RectCornerRadii;

    NS_INLINE_DECL_REFCOUNTING(gfxContext)

public:

    /**
     * Initialize this context from a DrawTarget.
     * Strips any transform from aTarget.
     * aTarget will be flushed in the gfxContext's destructor.
     */
    explicit gfxContext(mozilla::gfx::DrawTarget *aTarget,
                        const mozilla::gfx::Point& aDeviceOffset = mozilla::gfx::Point());

    /**
     * Create a new gfxContext wrapping aTarget and preserving aTarget's
     * transform. Note that the transform is moved from aTarget to the resulting
     * gfxContext, aTarget will no longer have its transform.
     */
    ;

    /**
     * Return the current transparency group target, if any, along
     * with its device offsets from the top.  If no group is
     * active, returns the surface the gfxContext was created with,
     * and 0,0 in dx,dy.
    /**
     * Draws a line from the current point to pt.
     */
    void SetMatrix(const gfxMatrix& matrix);

    /**
     * Returns the current transformation matrix.
     */
    ;

    /**
     * Converts a point from device to user coordinates using the inverse
     * transformation matrix.
     */
    ;


    // define enum for operators (clear, src, dst, etc)
    enum GraphicsOperator {
        OPERATOR_SOURCE,

        OPERATOR_OVER,
        OPERATOR_IN,
        OPERATOR_OUT,
        OPERATOR_ATOP,

        OPERATOR_DEST,
        OPERATOR_DEST_OVER,
        OPERATOR_DEST_IN,
        OPERATOR_DEST_OUT,
        OPERATOR_DEST_ATOP,

        OPERATOR_XOR,
        OPERATOR_ADD,
        OPERATOR_SATURATE,

        OPERATOR_MULTIPLY,
        OPERATOR_SCREEN,
        OPERATOR_OVERLAY,
        OPERATOR_DARKEN,
        OPERATOR_LIGHTEN,
        OPERATOR_COLOR_DODGE,
        OPERATOR_COLOR_BURN,
        OPERATOR_HARD_LIGHT,
        OPERATOR_SOFT_LIGHT,
        OPERATOR_DIFFERENCE,
        OPERATOR_EXCLUSION,
        OPERATOR_HUE,
        OPERATOR_SATURATION,
        OPERATOR_COLOR,
        OPERATOR_LUMINOSITY
    };
    /**
     * Sets the operator used for all further drawing. The operator affects
     * how drawing something will modify the destination. For example, the
     * OVER operator will do alpha blending of source and destination, while
     * SOURCE will replace the destination with the source.
     */
    ;
    ;

    ;
    ;

    ;
    ;
    ;

    ;

    ;

    // Work out whether cairo will snap inter-glyph spacing to pixels.
    ;

#ifdef MOZ_DUMP_PAINTING
    /**
     * Debug functions to encode the current surface as a PNG and export it.
     */

    /**
     * Writes a binary PNG file.
     */
    ;

    /**
     * Write as a PNG encoded Data URL to stdout.
     */
    ;

    /**
     * Copy a PNG encoded Data URL to the clipboard.
     */
    ;
#endif
# 502 "../../dist/include/gfxContext.h"

    static mozilla::gfx::UserDataKey sDontUseAsSourceKey;

private:
    ~gfxContext();

  friend class PatternFromState;
  friend class GlyphBufferAzure;

  typedef mozilla::gfx::Matrix Matrix;
  typedef mozilla::gfx::DrawTarget DrawTarget;
  typedef mozilla::gfx::Color Color;
  typedef mozilla::gfx::StrokeOptions StrokeOptions;
  typedef mozilla::gfx::Float Float;
  typedef mozilla::gfx::CompositionOp CompositionOp;
  typedef mozilla::gfx::PathBuilder PathBuilder;
  typedef mozilla::gfx::SourceSurface SourceSurface;
  
  struct AzureState {
    

    mozilla::gfx::CompositionOp op;
    Color color;
    nsRefPtr<gfxPattern> pattern;
    nsRefPtr<gfxASurface> sourceSurfCairo;
    mozilla::RefPtr<SourceSurface> sourceSurface;
    mozilla::gfx::Point sourceSurfaceDeviceOffset;
    Matrix surfTransform;
    Matrix transform;
    struct PushedClip {
      mozilla::RefPtr<Path> path;
      Rect rect;
      Matrix transform;
    };
    nsTArray<PushedClip> pushedClips;
    nsTArray<Float> dashPattern;
    bool clipWasReset;
    mozilla::gfx::FillRule fillRule;
    StrokeOptions strokeOptions;
    mozilla::RefPtr<DrawTarget> drawTarget;
    mozilla::RefPtr<DrawTarget> parentTarget;
    mozilla::gfx::AntialiasMode aaMode;
    bool patternTransformChanged;
    Matrix patternTransform;
    Color fontSmoothingBackgroundColor;
    // This is used solely for using minimal intermediate surface size.
    mozilla::gfx::Point deviceOffset;
  };
  Matrix mPathTransform;
  Rect mRect;
  mozilla::RefPtr<PathBuilder> mPathBuilder;
  mozilla::RefPtr<Path> mPath;
  Matrix mTransform;
  nsTArray<AzureState> mStateStack;

  
  

  cairo_t *mRefCairo;

  mozilla::RefPtr<DrawTarget> mDT;
  mozilla::RefPtr<DrawTarget> mOriginalDT;
};

/**
 * Sentry helper class for functions with multiple return points that need to
 * call Save() on a gfxContext and have Restore() called automatically on the
 * gfxContext before they return.
 */
class gfxContextAutoSaveRestore
{
public:
  

  

  

  

  

  

private:
  gfxContext *mContext;
};

/**
    mozilla::RefPtr<mozilla::gfx::DrawTarget> mDT;
    bool mSubpixelAntialiasingEnabled;
};

/* This class lives on the stack and allows gfxContext users to easily, and
 * performantly get a gfx::Pattern to use for drawing in their current context.
 */
class PatternFromState
{
public:
  
  

  ;

private:
  union {
    mozilla::AlignedStorage2<mozilla::gfx::ColorPattern> mColorPattern;
    mozilla::AlignedStorage2<mozilla::gfx::SurfacePattern> mSurfacePattern;
  };

  gfxContext *mContext;
  mozilla::gfx::Pattern *mPattern;
};

#endif /* GFX_CONTEXT_H */
# 727 "../../dist/include/gfxContext.h"
# 14 "../../dist/include/gfx2DGlue.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Matrix.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/gfx2DGlue.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Rect.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/gfx2DGlue.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/gfx2DGlue.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxColor.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/gfx2DGlue.h"

namespace mozilla {
namespace gfx {
class DrawTarget;
class SourceSurface;
class ScaledFont;
}
}

namespace mozilla {
namespace gfx {

inline Rect ToRect(const gfxRect &aRect)
{
  return Rect(Float(aRect.x), Float(aRect.y),
              Float(aRect.width), Float(aRect.height));
}



inline IntRect ToIntRect(const nsIntRect &aRect)
{
  return IntRect(aRect.x, aRect.y, aRect.width, aRect.height);
}















inline IntSize ToIntSize(const gfxIntSize &aSize)
{
  return IntSize(aSize.width, aSize.height);
}















inline gfxIntSize ThebesIntSize(const IntSize &aSize)
{
  return gfxIntSize(aSize.width, aSize.height);
}



inline nsIntRect ThebesIntRect(const IntRect &aRect)
{
  return nsIntRect(aRect.x, aRect.y, aRect.width, aRect.height);
}









inline CompositionOp CompositionOpForOp(gfxContext::GraphicsOperator aOp)
{
  switch (aOp) {
  case gfxContext::OPERATOR_ADD:
    return CompositionOp::OP_ADD;
  case gfxContext::OPERATOR_ATOP:
    return CompositionOp::OP_ATOP;
  case gfxContext::OPERATOR_IN:
    return CompositionOp::OP_IN;
  case gfxContext::OPERATOR_OUT:
    return CompositionOp::OP_OUT;
  case gfxContext::OPERATOR_SOURCE:
    return CompositionOp::OP_SOURCE;
  case gfxContext::OPERATOR_SATURATION:
    return CompositionOp::OP_SATURATION;
  case gfxContext::OPERATOR_COLOR:
    return CompositionOp::OP_COLOR;
  case gfxContext::OPERATOR_LUMINOSITY:
    return CompositionOp::OP_LUMINOSITY;
  default:
    return CompositionOp::OP_OVER;
  }
}







}
}

#endif
# 391 "../../dist/include/gfx2DGlue.h"
# 25 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "imgIEncoder.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/imgIEncoder.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/imgIEncoder.idl
 */

#ifndef __gen_imgIEncoder_h__
#define __gen_imgIEncoder_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/imgIEncoder.h"
#endif
# 12 "../../dist/include/imgIEncoder.h"

#ifndef __gen_nsIAsyncInputStream_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIAsyncInputStream.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIAsyncInputStream.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIAsyncInputStream.idl
 */

#ifndef __gen_nsIAsyncInputStream_h__
#define __gen_nsIAsyncInputStream_h__


#ifndef __gen_nsIInputStream_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIInputStream.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIAsyncInputStream.h"
#endif
# 12 "../../dist/include/nsIAsyncInputStream.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIAsyncInputStream.h"
class nsIInputStreamCallback; /* forward declaration */

class nsIEventTarget; /* forward declaration */


/* starting interface:    nsIAsyncInputStream */
#define NS_IASYNCINPUTSTREAM_IID_STR "a5f255ab-4801-4161-8816-277ac92f6ad1"

#define NS_IASYNCINPUTSTREAM_IID \
  {0xa5f255ab, 0x4801, 0x4161, \
    { 0x88, 0x16, 0x27, 0x7a, 0xc9, 0x2f, 0x6a, 0xd1 }}

class NS_NO_VTABLE nsIAsyncInputStream : public nsIInputStream {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IASYNCINPUTSTREAM_IID)

  /* void closeWithStatus (in nsresult aStatus); */
  NS_IMETHOD CloseWithStatus(nsresult aStatus) = 0;

  /* void asyncWait (in nsIInputStreamCallback aCallback, in unsigned long aFlags, in unsigned long aRequestedCount, in nsIEventTarget aEventTarget); */
  NS_IMETHOD AsyncWait(nsIInputStreamCallback *aCallback, uint32_t aFlags, uint32_t aRequestedCount, nsIEventTarget *aEventTarget) = 0;

  enum {
    WAIT_CLOSURE_ONLY = 1U
  };

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIAsyncInputStream, NS_IASYNCINPUTSTREAM_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIASYNCINPUTSTREAM \
  NS_IMETHOD CloseWithStatus(nsresult aStatus) MOZ_OVERRIDE; \
  NS_IMETHOD AsyncWait(nsIInputStreamCallback *aCallback, uint32_t aFlags, uint32_t aRequestedCount, nsIEventTarget *aEventTarget) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIASYNCINPUTSTREAM(_to) \
  NS_IMETHOD CloseWithStatus(nsresult aStatus) MOZ_OVERRIDE { return _to CloseWithStatus(aStatus); } \
  NS_IMETHOD AsyncWait(nsIInputStreamCallback *aCallback, uint32_t aFlags, uint32_t aRequestedCount, nsIEventTarget *aEventTarget) MOZ_OVERRIDE { return _to AsyncWait(aCallback, aFlags, aRequestedCount, aEventTarget); } \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIASYNCINPUTSTREAM(_to) \
  NS_IMETHOD CloseWithStatus(nsresult aStatus) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->CloseWithStatus(aStatus); } \
  NS_IMETHOD AsyncWait(nsIInputStreamCallback *aCallback, uint32_t aFlags, uint32_t aRequestedCount, nsIEventTarget *aEventTarget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncWait(aCallback, aFlags, aRequestedCount, aEventTarget); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsAsyncInputStream : public nsIAsyncInputStream
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIASYNCINPUTSTREAM

  nsAsyncInputStream();

private:

nsInputStreamCallback::~nsInputStreamCallback()
{
  /* destructor code */
}

/* void onInputStreamReady (in nsIAsyncInputStream aStream); */
NS_IMETHODIMP nsInputStreamCallback::OnInputStreamReady(nsIAsyncInputStream *aStream)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 182 "../../dist/include/nsIAsyncInputStream.h"


#endif /* __gen_nsIAsyncInputStream_h__ */
# 185 "../../dist/include/nsIAsyncInputStream.h"
# 15 "../../dist/include/imgIEncoder.h" 2
#endif
# 16 "../../dist/include/imgIEncoder.h"

#ifndef __gen_nsIEventTarget_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIEventTarget.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/imgIEncoder.h"
#endif
# 20 "../../dist/include/imgIEncoder.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 25 "../../dist/include/imgIEncoder.h"

/* starting interface:    imgIEncoder */
#define IMGIENCODER_IID_STR "4baa2d6e-fee7-42df-ae3f-5fbebc0c267c"

#define IMGIENCODER_IID \
  {0x4baa2d6e, 0xfee7, 0x42df, \
    { 0xae, 0x3f, 0x5f, 0xbe, 0xbc, 0x0c, 0x26, 0x7c }}

class NS_NO_VTABLE imgIEncoder : public nsIAsyncInputStream {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(IMGIENCODER_IID)

  enum {
    INPUT_FORMAT_RGB = 0U,
    INPUT_FORMAT_RGBA = 1U,
    INPUT_FORMAT_HOSTARGB = 2U
  };

  /* void initFromData ([array, size_is (length), const] in uint8_t data, in unsigned long length, in uint32_t width, in uint32_t height, in uint32_t stride, in uint32_t inputFormat, in AString outputOptions); */
  NS_IMETHOD InitFromData(const uint8_t *data, uint32_t length, uint32_t width, uint32_t height, uint32_t stride, uint32_t inputFormat, const nsAString & outputOptions) = 0;

  /* void startImageEncode (in uint32_t width, in uint32_t height, in uint32_t inputFormat, in AString outputOptions); */
  NS_IMETHOD StartImageEncode(uint32_t width, uint32_t height, uint32_t inputFormat, const nsAString & outputOptions) = 0;

  /* void addImageFrame ([array, size_is (length), const] in uint8_t data, in unsigned long length, in uint32_t width, in uint32_t height, in uint32_t stride, in uint32_t frameFormat, in AString frameOptions); */
  NS_IMETHOD AddImageFrame(const uint8_t *data, uint32_t length, uint32_t width, uint32_t height, uint32_t stride, uint32_t frameFormat, const nsAString & frameOptions) = 0;

  /* void endImageEncode (); */
  NS_IMETHOD EndImageEncode(void) = 0;

  /* [noscript] unsigned long getImageBufferUsed (); */
  NS_IMETHOD GetImageBufferUsed(uint32_t *_retval) = 0;

  /* [noscript] charPtr getImageBuffer (); */
  NS_IMETHOD GetImageBuffer(char **_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(imgIEncoder, IMGIENCODER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_IMGIENCODER \
  NS_IMETHOD InitFromData(const uint8_t *data, uint32_t length, uint32_t width, uint32_t height, uint32_t stride, uint32_t inputFormat, const nsAString & outputOptions) MOZ_OVERRIDE; \
#define nsLayoutUtils_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ArrayUtils.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsBoundingMetrics.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsBoundingMetrics.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __nsBoundingMetrics_h
#define __nsBoundingMetrics_h

#if 0 /* expanded by -frewrite-includes */
#include "nsCoord.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsBoundingMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsBoundingMetrics.h"

/* Struct used for accurate measurements of a string, in order to
 * allow precise positioning when processing MathML.  This is in its
 * own header file because some very-widely-included headers need it
 * but not the rest of nsFontMetrics, or vice versa.
 */

struct nsBoundingMetrics {

    ///////////
    // Metrics that _exactly_ enclose the text:
    nscoord descent;
    /* The vertical distance from the origin of the drawing
       operation to the bottom-most part of the drawn string.
       The _exact_ height of the string is therefore:
       ascent + descent */

    nscoord width;
    /* The horizontal distance from the origin of the drawing
       operation to the correct origin for drawing another string
       to follow the current one. Depending on the font, this
       could be greater than or less than the right bearing. */

    

    
};

#endif // __nsBoundingMetrics_h
# 88 "../../dist/include/nsBoundingMetrics.h"
# 12 "../../dist/include/nsLayoutUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsChangeHint.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsFrameList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsFrameList_h___
#define nsFrameList_h___

#if 0 /* expanded by -frewrite-includes */
#include <stdio.h> /* for FILE* */
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsFrameList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsFrameList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArrayForwardDeclare.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsFrameList.h"

#if defined(DEBUG) || defined(MOZ_DUMP_PAINTING)
// DEBUG_FRAME_DUMP enables nsIFrame::List and related methods.
// You can also define this in a non-DEBUG build if you need frame dumps.
#define DEBUG_FRAME_DUMP 1
#endif
# 18 "../../dist/include/nsFrameList.h"

class nsContainerFrame;
class nsIFrame;
class nsIPresShell;
class nsPresContext;

namespace mozilla {
namespace layout {
  class FrameChildList;
  enum FrameChildListID {
      // The individual concrete child lists.
      kPrincipalList                = 0x1,
      kPopupList                    = 0x2,
      kCaptionList                  = 0x4,
      kColGroupList                 = 0x8,
      kSelectPopupList              = 0x10,
      kAbsoluteList                 = 0x20,
      kFixedList                    = 0x40,
      kOverflowList                 = 0x80,
      kOverflowContainersList       = 0x100,
      kExcessOverflowContainersList = 0x200,
      kOverflowOutOfFlowList        = 0x400,
      kFloatList                    = 0x800,
      kBulletList                   = 0x1000,
      kPushedFloatsList             = 0x2000,
      // A special alias for kPrincipalList that suppress the reflow request that
      // is normally done when manipulating child lists.
      kNoReflowPrincipalList        = 0x4000
  };
}
}

// Uncomment this to enable expensive frame-list integrity checking
// #define DEBUG_FRAME_LIST

/**
 * A class for managing a list of frames.
 */
class nsFrameList {
public:
  
  /**
   * Take the frames after aAfterFrame out of the frame list.  If
   * aAfterFrame is null, removes the entire list.

  class FrameLinkEnumerator;

  /**
   * Split this frame list such that all the frames before the link pointed to
   * by aLink end up in the returned list, while the remaining frames stay in
   * this list.  After this call, aLink points to the beginning of this list.
   */
  ;

  /**
   * Split this frame list such that all the frames coming after the link
   * pointed to by aLink end up in the returned list, while the frames before
   * that link stay in this list.  After this call, aLink is at end.
   */
  ;

  nsIFrame* FirstChild() const {
    return mFirstChild;
  }

  nsIFrame* LastChild() const {
    return mLastChild;
  }

  ;
  ;

  bool IsEmpty() const {
    return nullptr == mFirstChild;
  }

  ;

  /**
   * If this frame list is non-empty then append it to aLists as the
   * aListID child list.
   * (this method is implemented in FrameChildList.h for dependency reasons)
   */
  ;

  /**
   * Return the frame before this frame in visual order (after Bidi reordering).
   * If aFrame is null, return the last frame in visual order.
   */
  ;

  /**
   * Return the frame after this frame in visual order (after Bidi reordering).
   * If aFrame is null, return the first frame in visual order.
   */
  ;

#ifdef DEBUG_FRAME_DUMP
  ;
#endif
# 288 "../../dist/include/nsFrameList.h"

  ;

  class Enumerator;

  /**
   * A class representing a slice of a frame list.
   */
  class Slice {
    friend class Enumerator;

  public:
    // Implicit on purpose, so that we can easily create enumerators from
    // nsFrameList via this impicit constructor.
    MOZ_IMPLICIT Slice(const nsFrameList& aList) :
#ifdef DEBUG
      mList(aList),
#endif
# 306 "../../dist/include/nsFrameList.h"
      mStart(aList.FirstChild()),
      mEnd(nullptr)
    {}

    

    

  private:
#ifdef DEBUG
    const nsFrameList& mList;
#endif
# 330 "../../dist/include/nsFrameList.h"
    nsIFrame* const mStart; // our starting frame
    const nsIFrame* const mEnd; // The first frame that is NOT in the slice.
                                // May be null.
  };

  class Enumerator {
  public:
    explicit Enumerator(const Slice& aSlice) :
#ifdef DEBUG
      mSlice(aSlice),
#endif
# 341 "../../dist/include/nsFrameList.h"
      mFrame(aSlice.mStart),
      mEnd(aSlice.mEnd)
    {}

    

    bool AtEnd() const {
      // Can't just check mEnd, because some table code goes and destroys the
      // tail of the frame list (including mEnd!) while iterating over the
      // frame list.
      return !mFrame || mFrame == mEnd;
    }

    /* Next() needs to know about nsIFrame, and nsIFrame will need to
       know about nsFrameList methods, so in order to inline this put
       the implementation in nsIFrame.h */
    inline void Next();

    /**
     * Get the current frame we're pointing to.  Do not call this on an
     * iterator that is at end!
     */
    nsIFrame* get() const {
      NS_PRECONDITION(!AtEnd(), "Enumerator is at end");
      return mFrame;
    }

    /**
     * Get an enumerator that is just like this one, but not limited in terms of
     * the part of the list it will traverse.
     */
    

#ifdef DEBUG
    const nsFrameList& List() const { return mSlice.mList; }
#endif
# 385 "../../dist/include/nsFrameList.h"

  protected:
    

#ifdef DEBUG
    /* Has to be an object, not a reference, since the slice could
       well be a temporary constructed from an nsFrameList */
    const Slice mSlice;
#endif
# 400 "../../dist/include/nsFrameList.h"
    nsIFrame* mFrame; // our current frame.
    const nsIFrame* const mEnd; // The first frame we should NOT enumerate.
                                // May be null.
  };

  /**
   * A class that can be used to enumerate links between frames.  When created
   * from an nsFrameList, it points to the "link" immediately before the first
   * frame.  It can then be advanced until it points to the "link" immediately
   * after the last frame.  At any position, PrevFrame() and NextFrame() are
   * the frames before and after the given link.  This means PrevFrame() is

#ifdef DEBUG_FRAME_LIST
  void VerifyList() const;
#else
# 456 "../../dist/include/nsFrameList.h"
  void VerifyList() const {}
#endif
# 458 "../../dist/include/nsFrameList.h"

protected:
  /**
   * Disconnect aFrame from its siblings.  This must only be called if aFrame
   * is NOT the first or last sibling, because otherwise its nsFrameList will
   * have a stale mFirst/LastChild pointer.  This precondition is asserted.
   * This function is O(1).
   */
  static void UnhookFrameFromSiblings(nsIFrame* aFrame);

  nsIFrame* mFirstChild;
  nsIFrame* mLastChild;
};

namespace mozilla {
namespace layout {

/**
 * Simple "auto_ptr" for nsFrameLists allocated from the shell arena.
 * The frame list given to the constructor will be deallocated (if non-null)
 * in the destructor.  The frame list must then be empty.
 */
class AutoFrameListPtr {
public:
  AutoFrameListPtr(nsPresContext* aPresContext, nsFrameList* aFrameList)
    : mPresContext(aPresContext), mFrameList(aFrameList) {}
  ~AutoFrameListPtr();
  operator nsFrameList*() const { return mFrameList; }
  nsFrameList* operator->() const { return mFrameList; }
private:
  nsPresContext* mPresContext;
  nsFrameList* mFrameList;
};

namespace detail {
union AlignedFrameListBytes {
  void* ptr;
  char bytes[sizeof(nsFrameList)];
};
extern const AlignedFrameListBytes gEmptyFrameListBytes;
}
}
}

/* static */ 

#endif /* nsFrameList_h___ */
# 509 "../../dist/include/nsFrameList.h"
# 15 "../../dist/include/nsLayoutUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/layout/FrameChildList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/layout/FrameChildList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef FrameChildList_h_
#define FrameChildList_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsFrameList.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/layout/FrameChildList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/layout/FrameChildList.h"

class nsIFrame;

namespace mozilla {
namespace layout {

// enum FrameChildListID lives in nsFrameList.h to solve circular dependencies.

#ifdef DEBUG_FRAME_DUMP
extern const char* ChildListName(FrameChildListID aListID);
#endif
# 23 "../../dist/include/mozilla/layout/FrameChildList.h"

class FrameChildListIDs {
friend class FrameChildListIterator;
 public:
  
  
  MOZ_IMPLICIT 

  
  
  
  
  

 protected:
  
  uint32_t mIDs;
};

class FrameChildList {
 public:
  
  nsFrameList mList;
  FrameChildListID mID;
};

/**
 * A class to iterate frame child lists.
 */
class MOZ_STACK_CLASS FrameChildListArrayIterator {
 public:
  
  
  
  
  

protected:
  const nsTArray<FrameChildList>& mLists;
  uint32_t mCurrentIndex;
};

/**
 * A class for retrieving a frame's child lists and iterate them.
 */
class MOZ_STACK_CLASS FrameChildListIterator
  : public FrameChildListArrayIterator {
 public:
  ;

protected:
  nsAutoTArray<FrameChildList,4> mLists;
};





} // namespace layout
} // namespace mozilla



#endif /* !defined(FrameChildList_h_) */
# 127 "../../dist/include/mozilla/layout/FrameChildList.h"
# 16 "../../dist/include/nsLayoutUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsThreadUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrincipal.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "GraphicsFilter.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSPseudoElements.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSPseudoElements.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* atom list for CSS pseudo-elements */

#ifndef nsCSSPseudoElements_h___
#define nsCSSPseudoElements_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsIAtom.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsCSSPseudoElements.h"

// Is this pseudo-element a CSS2 pseudo-element that can be specified
// with the single colon syntax (in addition to the double-colon syntax,
// which can be used for all pseudo-elements)?
#define CSS_PSEUDO_ELEMENT_IS_CSS2                     (1<<0)
// Is this pseudo-element a pseudo-element that can contain other
// elements?
// Is content prevented from parsing selectors containing this pseudo-element?
#define CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY               (1<<4)

// Empty class derived from nsIAtom so that function signatures can
// require an atom from this atom list.
class nsICSSPseudoElement : public nsIAtom {};

class nsCSSPseudoElements {
public:

  ;

  ;

  ;

#define CSS_PSEUDO_ELEMENT(_name, _value, _flags) \
  static nsICSSPseudoElement* _name;
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSPseudoElementList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSPseudoElementList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* atom list for CSS pseudo-elements */

/*
 * This file contains the list of nsIAtoms and their values for CSS
 * pseudo-elements.  It is designed to be used as inline input to
 * nsCSSPseudoElements.cpp *only* through the magic of C preprocessing.  All
 * entries must be enclosed either in the macro CSS_PSEUDO_ELEMENT;
 * these macros will have cruel and unusual things done to them.  The
 * entries should be kept in some sort of logical order.
 *
 * Code including this file MUST define CSS_PSEUDO_ELEMENT, which takes
 * three parameters:
 * name_  : The C++ identifier used for the atom (which will be a member
 *          of nsCSSPseudoElements)
 * value_ : The pseudo-element as a string, with single-colon syntax,
 *          used as the string value of the atom.
 * flags_ : A bitfield containing flags defined in nsCSSPseudoElements.h
 */

// OUTPUT_CLASS=nsCSSPseudoElements
// MACRO_NAME=CSS_PSEUDO_ELEMENT
CSS_PSEUDO_ELEMENT(mozFocusInner, ":-moz-focus-inner", 0)
CSS_PSEUDO_ELEMENT(mozFocusOuter, ":-moz-focus-outer", 0)

// XXXbz should we really allow random content to style these?  Maybe
// use our flags to prevent that?
CSS_PSEUDO_ELEMENT(mozListBullet, ":-moz-list-bullet", 0)
CSS_PSEUDO_ELEMENT(mozListNumber, ":-moz-list-number", 0)

CSS_PSEUDO_ELEMENT(mozMathAnonymous, ":-moz-math-anonymous", 0)

// HTML5 Forms pseudo elements
CSS_PSEUDO_ELEMENT(mozNumberWrapper, ":-moz-number-wrapper",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE |
                   CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY)
CSS_PSEUDO_ELEMENT(mozNumberText, ":-moz-number-text",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE |
                   CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY)
CSS_PSEUDO_ELEMENT(mozNumberSpinBox, ":-moz-number-spin-box",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE |
                   CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY)
CSS_PSEUDO_ELEMENT(mozNumberSpinUp, ":-moz-number-spin-up",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE |
                   CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY)
CSS_PSEUDO_ELEMENT(mozNumberSpinDown, ":-moz-number-spin-down",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE |
                   CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY)
CSS_PSEUDO_ELEMENT(mozProgressBar, ":-moz-progress-bar",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozRangeTrack, ":-moz-range-track",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozRangeProgress, ":-moz-range-progress",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozRangeThumb, ":-moz-range-thumb",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozMeterBar, ":-moz-meter-bar",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozPlaceholder, ":-moz-placeholder",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozColorSwatch, ":-moz-color-swatch",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_STYLE_ATTRIBUTE |
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
# 54 "../../dist/include/nsCSSPseudoElements.h" 2
#undef CSS_PSEUDO_ELEMENT

  enum Type {
    // If the actual pseudo-elements stop being first here, change
    // GetPseudoType.
#define CSS_PSEUDO_ELEMENT(_name, _value_, _flags) \
    ePseudo_##_name,
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSPseudoElementList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSPseudoElementList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* atom list for CSS pseudo-elements */

/*
 * This file contains the list of nsIAtoms and their values for CSS
 * pseudo-elements.  It is designed to be used as inline input to
 * nsCSSPseudoElements.cpp *only* through the magic of C preprocessing.  All
 * entries must be enclosed either in the macro CSS_PSEUDO_ELEMENT;
 * these macros will have cruel and unusual things done to them.  The
 * entries should be kept in some sort of logical order.
 *
 * Code including this file MUST define CSS_PSEUDO_ELEMENT, which takes
 * three parameters:
 * name_  : The C++ identifier used for the atom (which will be a member
 *          of nsCSSPseudoElements)
 * value_ : The pseudo-element as a string, with single-colon syntax,
 *          used as the string value of the atom.
 * flags_ : A bitfield containing flags defined in nsCSSPseudoElements.h
 */

// OUTPUT_CLASS=nsCSSPseudoElements
// MACRO_NAME=CSS_PSEUDO_ELEMENT

CSS_PSEUDO_ELEMENT(mozNumberSpinBox, ":-moz-number-spin-box",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE |
                   CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY)
CSS_PSEUDO_ELEMENT(mozNumberSpinUp, ":-moz-number-spin-up",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE |
                   CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY)
CSS_PSEUDO_ELEMENT(mozNumberSpinDown, ":-moz-number-spin-down",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE |
                   CSS_PSEUDO_ELEMENT_UA_SHEET_ONLY)
CSS_PSEUDO_ELEMENT(mozProgressBar, ":-moz-progress-bar",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozRangeTrack, ":-moz-range-track",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozRangeProgress, ":-moz-range-progress",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozRangeThumb, ":-moz-range-thumb",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozMeterBar, ":-moz-meter-bar",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozPlaceholder, ":-moz-placeholder",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
CSS_PSEUDO_ELEMENT(mozColorSwatch, ":-moz-color-swatch",
                   CSS_PSEUDO_ELEMENT_SUPPORTS_STYLE_ATTRIBUTE |
                   CSS_PSEUDO_ELEMENT_SUPPORTS_USER_ACTION_STATE)
# 62 "../../dist/include/nsCSSPseudoElements.h" 2
#undef CSS_PSEUDO_ELEMENT
    ePseudo_PseudoElementCount,
    ePseudo_AnonBox = ePseudo_PseudoElementCount,
#ifdef MOZ_XUL
    ePseudo_XULTree,
#endif
# 68 "../../dist/include/nsCSSPseudoElements.h"
    ePseudo_NotPseudoElement,
    ePseudo_MAX
  };

  ;

  // Get the atom for a given Type.  aType must be < ePseudo_PseudoElementCount
  ;

  

  

  ;

  

private:
  ;

  // Does the given pseudo-element have all of the flags given?
  
};

#endif /* nsCSSPseudoElements_h___ */
# 104 "../../dist/include/nsCSSPseudoElements.h"
# 20 "../../dist/include/nsLayoutUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "FrameMetrics.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfx3DMatrix.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIWidget.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSProperty.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSProperty.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* enum types for CSS properties and their values */
 
#ifndef nsCSSProperty_h___
#define nsCSSProperty_h___

/*
   Declare the enum list using the magic of preprocessing
   enum values are "eCSSProperty_foo" (where foo is the property)

   To change the list of properties, see nsCSSPropList.h

 */
enum nsCSSProperty {
  eCSSProperty_UNKNOWN = -1,

  #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, \
                   kwtable_, stylestruct_, stylestructoffset_, animtype_) \
    eCSSProperty_##id_,
  #define CSS_PROP_LIST_INCLUDE_LOGICAL
  #if 0 /* expanded by -frewrite-includes */
#include "nsCSSPropList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSPropList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * a list of all CSS properties with considerable data about them, for
 * preprocessing

  CSS_PROP_SHORTHAND only takes 1-5.

  CSS_PROP_LOGICAL should be used instead of CSS_PROP_struct when
  defining logical properties (which also must be defined with the
  CSS_PROPERTY_LOGICAL flag).  Logical shorthand properties should still
  be defined with CSS_PROP_SHORTHAND.

 ******/


/*************************************************************************/


// All includers must explicitly define CSS_PROP_SHORTHAND if they
// want it.
#ifndef CSS_PROP_SHORTHAND
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) /* nothing */
#define DEFINED_CSS_PROP_SHORTHAND
#endif
# 91 "../../dist/include/nsCSSPropList.h"

#define CSS_PROP_DOMPROP_PREFIXED(name_) \
  CSS_PROP_PUBLIC_OR_PRIVATE(Moz ## name_, name_)

#define CSS_PROP_NO_OFFSET (-1)

// Callers may define CSS_PROP_LIST_EXCLUDE_INTERNAL if they want to
// exclude internal properties that are not represented in the DOM (only
// the DOM style code defines this).

#ifdef CSS_PROP

#define USED_CSS_PROP
#define CSS_PROP_FONT(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Font, stylestructoffset_, animtype_)
#define CSS_PROP_COLOR(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Color, stylestructoffset_, animtype_)
#define CSS_PROP_BACKGROUND(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Background, stylestructoffset_, animtype_)
#define CSS_PROP_LIST(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, List, stylestructoffset_, animtype_)
#define CSS_PROP_POSITION(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Position, stylestructoffset_, animtype_)
#define CSS_PROP_TEXT(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Text, stylestructoffset_, animtype_)
#define CSS_PROP_TEXTRESET(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, TextReset, stylestructoffset_, animtype_)
#define CSS_PROP_DISPLAY(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Display, stylestructoffset_, animtype_)
#define CSS_PROP_VISIBILITY(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Visibility, stylestructoffset_, animtype_)
#define CSS_PROP_CONTENT(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Content, stylestructoffset_, animtype_)
#define CSS_PROP_QUOTES(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Quotes, stylestructoffset_, animtype_)
#define CSS_PROP_USERINTERFACE(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, UserInterface, stylestructoffset_, animtype_)
#define CSS_PROP_UIRESET(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, UIReset, stylestructoffset_, animtype_)
#define CSS_PROP_TABLE(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Table, stylestructoffset_, animtype_)
#define CSS_PROP_TABLEBORDER(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, TableBorder, stylestructoffset_, animtype_)
#define CSS_PROP_MARGIN(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Margin, stylestructoffset_, animtype_)
#define CSS_PROP_PADDING(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Padding, stylestructoffset_, animtype_)
#define CSS_PROP_BORDER(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Border, stylestructoffset_, animtype_)
#define CSS_PROP_OUTLINE(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Outline, stylestructoffset_, animtype_)
#define CSS_PROP_XUL(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, XUL, stylestructoffset_, animtype_)
#define CSS_PROP_COLUMN(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Column, stylestructoffset_, animtype_)
#define CSS_PROP_SVG(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, SVG, stylestructoffset_, animtype_)
#define CSS_PROP_SVGRESET(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, SVGReset, stylestructoffset_, animtype_)
#define CSS_PROP_VARIABLES(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Variables, stylestructoffset_, animtype_)

// For properties that are stored in the CSS backend but are not
// computed.  An includer may define this in addition to CSS_PROP, but
// otherwise we treat it as the same.
#ifndef CSS_PROP_BACKENDONLY
#define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, BackendOnly, CSS_PROP_NO_OFFSET, eStyleAnimType_None)
#define DEFINED_CSS_PROP_BACKENDONLY
#endif
# 167 "../../dist/include/nsCSSPropList.h"

// And similarly for logical properties.  An includer can define
// CSS_PROP_LOGICAL to capture all logical properties, but otherwise they
// are included in CSS_PROP (as long as CSS_PROP_LIST_INCLUDE_LOGICAL is
// defined).
#if defined(CSS_PROP_LOGICAL) && defined(CSS_PROP_LIST_EXCLUDE_LOGICAL) || defined(CSS_PROP_LOGICAL) && defined(CSS_PROP_LIST_INCLUDE_LOGICAL) || defined(CSS_PROP_LIST_EXCLUDE_LOGICAL) && defined(CSS_PROP_LIST_INCLUDE_LOGICAL)
#error Do not define more than one of CSS_PROP_LOGICAL, CSS_PROP_LIST_EXCLUDE_LOGICAL and CSS_PROP_LIST_INCLUDE_LOGICAL when capturing properties using CSS_PROP.
#endif
# 175 "../../dist/include/nsCSSPropList.h"

#ifndef CSS_PROP_LOGICAL
#ifdef CSS_PROP_LIST_INCLUDE_LOGICAL
#define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, group_, struct_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, struct_, stylestructoffset_, animtype_)
#else
# 180 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_LIST_EXCLUDE_LOGICAL
#error Must define exactly one of CSS_PROP_LOGICAL, CSS_PROP_LIST_EXCLUDE_LOGICAL and CSS_PROP_LIST_INCLUDE_LOGICAL when capturing properties using CSS_PROP.
#endif
# 183 "../../dist/include/nsCSSPropList.h"
#define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, group_, struct_, stylestructoffset_, animtype_) /* nothing */
#endif
# 185 "../../dist/include/nsCSSPropList.h"
#define DEFINED_CSS_PROP_LOGICAL
#endif
# 187 "../../dist/include/nsCSSPropList.h"

#ifndef CSS_PROP_QUOTES
#define CSS_PROP_QUOTES(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_QUOTES
#endif
#ifndef CSS_PROP_TABLEBORDER
#define CSS_PROP_TABLEBORDER(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_TABLEBORDER
#endif
# 258 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_MARGIN
#define CSS_PROP_MARGIN(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_MARGIN
#endif
# 262 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_PADDING
#define DEFINED_CSS_PROP_SVGRESET
#endif
# 290 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_VARIABLES
#define CSS_PROP_VARIABLES(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_VARIABLES
#endif
# 294 "../../dist/include/nsCSSPropList.h"

#ifndef CSS_PROP_BACKENDONLY
#define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_) /* nothing */
#define DEFINED_CSS_PROP_BACKENDONLY
#endif
# 299 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_LOGICAL
#define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, group_, struct_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_LOGICAL
#endif
# 303 "../../dist/include/nsCSSPropList.h"

#endif /* !defined(CSS_PROP) */
CSS_PROP_DISPLAY(
    -moz-appearance,
    appearance,
    CSS_PROP_DOMPROP_PREFIXED(Appearance),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kAppearanceKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    -moz-outline-radius,
    _moz_outline_radius,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadius),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_OUTLINE(
    -moz-outline-radius-topleft,
    _moz_outline_radius_topLeft,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusTopleft),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_TopLeft)
CSS_PROP_OUTLINE(
    -moz-outline-radius-topright,
    _moz_outline_radius_topRight,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusTopright),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_TopRight)
CSS_PROP_OUTLINE(
    -moz-outline-radius-bottomright,
    _moz_outline_radius_bottomRight,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusBottomright),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_BottomRight)
CSS_PROP_OUTLINE(
    -moz-outline-radius-bottomleft,
    _moz_outline_radius_bottomLeft,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusBottomleft),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_BottomLeft)
CSS_PROP_TEXT(
    -moz-tab-size,
    _moz_tab_size,
    CSS_PROP_DOMPROP_PREFIXED(TabSize),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HI,
    nullptr,
    offsetof(nsStyleText, mTabSize),
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_FONT(
    -x-system-font,
    _x_system_font,
    CSS_PROP_DOMPROP_PREFIXED(SystemFont),
    CSS_PROPERTY_PARSE_INACCESSIBLE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_EXCLUDE_INTERNAL)
# 429 "../../dist/include/nsCSSPropList.h"
CSS_PROP_SHORTHAND(
    all,
    all,
    All,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.all-shorthand.enabled")
CSS_PROP_SHORTHAND(
    animation,
    animation,
    Animation,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_DISPLAY(
    animation-delay,
    animation_delay,
    AnimationDelay,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-direction,
    animation_direction,
    AnimationDirection,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kAnimationDirectionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-duration,
    animation_duration,
    AnimationDuration,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME | VARIANT_NONNEGATIVE_DIMENSION, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-fill-mode,
    animation_fill_mode,
    AnimationFillMode,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kAnimationFillModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-iteration-count,
    animation_iteration_count,
    AnimationIterationCount,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        // nonnegative per
        // http://lists.w3.org/Archives/Public/www-style/2011Mar/0355.html
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD | VARIANT_NUMBER, // used by list parsing
    kAnimationIterationCountKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-name,
    animation_name,
    AnimationName,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    // FIXME: The spec should say something about 'inherit' and 'initial'
    // not being allowed.
    VARIANT_NONE | VARIANT_IDENTIFIER_NO_INHERIT, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-play-state,
    animation_play_state,
    AnimationPlayState,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kAnimationPlayStateKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-timing-function,
    animation_timing_function,
    AnimationTimingFunction,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD | VARIANT_TIMING_FUNCTION, // used by list parsing
    kTransitionTimingFunctionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    background,
    background,
    Background,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BACKGROUND(
    background-attachment,
    background_attachment,
    BackgroundAttachment,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kBackgroundAttachmentKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-clip,
    background_clip,
    BackgroundClip,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kBackgroundOriginKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-color,
    background_color,
    BackgroundColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "",
    VARIANT_HC,
    nullptr,
    offsetof(nsStyleBackground, mBackgroundColor),
    eStyleAnimType_Color)
CSS_PROP_BACKGROUND(
    background-image,
    background_image,
    BackgroundImage,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
        CSS_PROPERTY_START_IMAGE_LOADS,
    "",
    VARIANT_IMAGE, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-blend-mode,
    background_blend_mode,
    BackgroundBlendMode,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "layout.css.background-blend-mode.enabled",
    VARIANT_KEYWORD, // used by list parsing
    kBlendModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-origin,
    background_origin,
    BackgroundOrigin,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kBackgroundOriginKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-position,
    background_position,
    BackgroundPosition,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_STORES_CALC,
    "",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BACKGROUND(
    background-repeat,
    background_repeat,
    BackgroundRepeat,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kBackgroundRepeatKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-size,
    background_size,
    BackgroundSize,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC,
    "",
    0,
    kBackgroundSizeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_DISPLAY(
    -moz-binding,
    binding,
    CSS_PROP_DOMPROP_PREFIXED(Binding),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_LOGICAL(
    block-size,
    block_size,
    BlockSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    Size,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    border,
    border,
    Border,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_SHORTHAND(
    border-block-end,
    border_block_end,
    BorderBlockEnd,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled")
CSS_PROP_SHORTHAND(
    border-block-start,
    border_block_start,
    BorderBlockStart,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled")
CSS_PROP_LOGICAL(
    border-block-end-color,
    border_block_end_color,
    BorderBlockEndColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_HCK,
    kBorderColorKTable,
    BorderColor,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    border-block-end-style,
    border_block_end_style,
    BorderBlockEndStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_HK,
    kBorderStyleKTable,
    BorderStyle,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    border-block-end-width,
    border_block_end_width,
    BorderBlockEndWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    BorderWidth,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    border-block-start-color,
    border_block_start_color,
    BorderBlockStartColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HCK,
    kBorderColorKTable,
    BorderColor,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    border-block-start-style,
    border_block_start_style,
    BorderBlockStartStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HK,
    kBorderStyleKTable,
    BorderStyle,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    border-block-start-width,
    border_block_start_width,
    BorderBlockStartWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    BorderWidth,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    border-bottom,
    border_bottom,
    BorderBottom,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-bottom-color,
    border_bottom_color,
    BorderBottomColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BORDER(
    -moz-border-bottom-colors,
    border_bottom_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderBottomColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-bottom-style,
    border_bottom_style,
    BorderBottomStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)  // on/off will need reflow
CSS_PROP_BORDER(
    border-bottom-width,
    border_bottom_width,
    BorderBottomWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TABLEBORDER(
    border-collapse,
    border_collapse,
    BorderCollapse,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBorderCollapseKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    border-color,
    border_color,
    BorderColor,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "")
CSS_PROP_SHORTHAND(
    border-image,
    border_image,
    BorderImage,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-image-source,
    border_image_source,
    BorderImageSource,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_START_IMAGE_LOADS,
    "",
    VARIANT_IMAGE | VARIANT_INHERIT,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-slice,
    border_image_slice,
    BorderImageSlice,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    kBorderImageSliceKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-width,
    border_image_width,
    BorderImageWidth,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-outset,
    border_image_outset,
    BorderImageOutset,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-repeat,
    border_image_repeat,
    BorderImageRepeat,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    kBorderImageRepeatKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    -moz-border-end,
    border_end,
    CSS_PROP_DOMPROP_PREFIXED(BorderEnd),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_LOGICAL(
    -moz-border-end-color,
    border_end_color,
    CSS_PROP_DOMPROP_PREFIXED(BorderEndColor),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    BorderColor,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    -moz-border-end-style,
    border_end_style,
    CSS_PROP_DOMPROP_PREFIXED(BorderEndStyle),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    BorderStyle,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    -moz-border-end-width,
    border_end_width,
    CSS_PROP_DOMPROP_PREFIXED(BorderEndWidth),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    BorderWidth,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    -moz-border-start,
    border_start,
    CSS_PROP_DOMPROP_PREFIXED(BorderStart),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_LOGICAL(
    -moz-border-start-color,
    border_start_color,
    CSS_PROP_DOMPROP_PREFIXED(BorderStartColor),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_LOGICAL,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    BorderColor,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    -moz-border-start-style,
    border_start_style,
    CSS_PROP_DOMPROP_PREFIXED(BorderStartStyle),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_LOGICAL,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    BorderStyle,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    -moz-border-start-width,
    border_start_width,
    CSS_PROP_DOMPROP_PREFIXED(BorderStartWidth),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_LOGICAL,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    BorderWidth,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    border-left,
    border_left,
    BorderLeft,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-left-color,
    border_left_color,
    BorderLeftColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BORDER(
    -moz-border-left-colors,
    border_left_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderLeftColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-left-style,
    border_left_style,
    BorderLeftStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-left-width,
    border_left_width,
    BorderLeftWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_SHORTHAND(
    border-right,
    border_right,
    BorderRight,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-right-color,
    border_right_color,
    BorderRightColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BORDER(
    -moz-border-right-colors,
    border_right_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderRightColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-right-style,
    border_right_style,
    BorderRightStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-right-width,
    border_right_width,
    BorderRightWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TABLEBORDER(
    border-spacing,
    border_spacing,
    BorderSpacing,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_SHORTHAND(
    border-style,
    border_style,
    BorderStyle,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")  // on/off will need reflow
CSS_PROP_SHORTHAND(
    border-top,
    border_top,
    BorderTop,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-top-color,
    border_top_color,
    BorderTopColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BORDER(
    -moz-border-top-colors,
    border_top_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderTopColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-top-style,
    border_top_style,
    BorderTopStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)  // on/off will need reflow
CSS_PROP_BORDER(
    border-top-width,
    border_top_width,
    BorderTopWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_SHORTHAND(
    border-width,
    border_width,
    BorderWidth,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "")
CSS_PROP_SHORTHAND(
    border-radius,
    border_radius,
    BorderRadius,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-top-left-radius,
    border_top_left_radius,
    BorderTopLeftRadius,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleBorder, mBorderRadius),
    eStyleAnimType_Corner_TopLeft)
CSS_PROP_BORDER(
    border-top-right-radius,
    border_top_right_radius,
    BorderTopRightRadius,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleBorder, mBorderRadius),
    eStyleAnimType_Corner_TopRight)
CSS_PROP_BORDER(
    border-bottom-right-radius,
    border_bottom_right_radius,
    BorderBottomRightRadius,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleBorder, mBorderRadius),
    eStyleAnimType_Corner_BottomRight)
CSS_PROP_BORDER(
    border-bottom-left-radius,
    border_bottom_left_radius,
    BorderBottomLeftRadius,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleBorder, mBorderRadius),
    eStyleAnimType_Corner_BottomLeft)
CSS_PROP_POSITION(
    bottom,
    bottom,
    Bottom,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mOffset),
    eStyleAnimType_Sides_Bottom)
CSS_PROP_BORDER(
    box-decoration-break,
    box_decoration_break,
    BoxDecorationBreak,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.box-decoration-break.enabled",
    VARIANT_HK,
    kBoxDecorationBreakKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    box-shadow,
    box_shadow,
    BoxShadow,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
        // NOTE: some components must be nonnegative
    "",
    0,
    kBoxShadowTypeKTable,
    offsetof(nsStyleBorder, mBoxShadow),
    eStyleAnimType_Shadow)
CSS_PROP_POSITION(
    box-sizing,
    box_sizing,
    BoxSizing,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBoxSizingKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TABLEBORDER(
    caption-side,
    caption_side,
    CaptionSide,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kCaptionSideKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    clear,
    clear,
    Clear,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kClearKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    clip,
    clip,
    Clip,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "",
    0,
    nullptr,
    offsetof(nsStylePosition, mClip),
    eStyleAnimType_Custom)
CSS_PROP_COLOR(
    color,
    color,
    Color,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "",
    VARIANT_HC,
    nullptr,
    offsetof(nsStyleColor, mColor),
    eStyleAnimType_Color)
CSS_PROP_SHORTHAND(
    -moz-columns,
    _moz_columns,
    CSS_PROP_DOMPROP_PREFIXED(Columns),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_COLUMN(
    -moz-column-count,
    _moz_column_count,
    CSS_PROP_DOMPROP_PREFIXED(ColumnCount),
    CSS_PROPERTY_PARSE_VALUE |
        // Need to reject 0 in addition to negatives.  If we accept 0, we
        // need to change NS_STYLE_COLUMN_COUNT_AUTO to something else.
        CSS_PROPERTY_VALUE_AT_LEAST_ONE,
    "",
    VARIANT_AHI,
    nullptr,
    offsetof(nsStyleColumn, mColumnCount),
    eStyleAnimType_Custom)
CSS_PROP_COLUMN(
    -moz-column-fill,
    _moz_column_fill,
    CSS_PROP_DOMPROP_PREFIXED(ColumnFill),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kColumnFillKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_COLUMN(
    -moz-column-width,
    _moz_column_width,
    CSS_PROP_DOMPROP_PREFIXED(ColumnWidth),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_AHL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleColumn, mColumnWidth),
    eStyleAnimType_Coord)
CSS_PROP_COLUMN(
    -moz-column-gap,
    _moz_column_gap,
    CSS_PROP_DOMPROP_PREFIXED(ColumnGap),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleColumn, mColumnGap),
    eStyleAnimType_Coord)
CSS_PROP_SHORTHAND(
    -moz-column-rule,
    _moz_column_rule,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRule),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_COLUMN(
    -moz-column-rule-color,
    _moz_column_rule_color,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRuleColor),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_COLUMN(
    -moz-column-rule-style,
    _moz_column_rule_style,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRuleStyle),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_COLUMN(
    -moz-column-rule-width,
    _moz_column_rule_width,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRuleWidth),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_CONTENT(
    content,
    content,
    Content,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_START_IMAGE_LOADS,
    "",
    0,
    kContentKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_TEXT(
    -moz-control-character-visibility,
    _moz_control_character_visibility,
    CSS_PROP_DOMPROP_PREFIXED(ControlCharacterVisibility),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kControlCharacterVisibilityKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif
# 1513 "../../dist/include/nsCSSPropList.h"
CSS_PROP_CONTENT(
    counter-increment,
    counter_increment,
    CounterIncrement,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 137285
CSS_PROP_CONTENT(
    counter-reset,
    counter_reset,
    CounterReset,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 137285
CSS_PROP_USERINTERFACE(
    cursor,
    cursor,
    Cursor,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_START_IMAGE_LOADS |
        CSS_PROPERTY_IMAGE_IS_IN_ARRAY_0,
    "",
    0,
    kCursorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
CSS_PROP_VISIBILITY(
    direction,
    direction,
    Direction,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kDirectionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND)
# 1558 "../../dist/include/nsCSSPropList.h"
CSS_PROP_DISPLAY(
    display,
    display,
    Display,
    CSS_PROPERTY_PARSE_VALUE |
        // This is allowed because we need to make the placeholder
        // pseudo-element an inline-block in the UA stylesheet. It is a block
        // by default.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kDisplayKTable,
    offsetof(nsStyleDisplay, mDisplay),
    eStyleAnimType_EnumU8)
CSS_PROP_TABLEBORDER(
    empty-cells,
    empty_cells,
    EmptyCells,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kEmptyCellsKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    align-content,
    align_content,
    AlignContent,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kAlignContentKTable,
    offsetof(nsStylePosition, mAlignContent),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    align-items,
    align_items,
    AlignItems,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kAlignItemsKTable,
    offsetof(nsStylePosition, mAlignItems),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    align-self,
    align_self,
    AlignSelf,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kAlignSelfKTable,
    offsetof(nsStylePosition, mAlignSelf),
    eStyleAnimType_EnumU8)
CSS_PROP_SHORTHAND(
    flex,
    flex,
    Flex,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_POSITION(
    flex-basis,
    flex_basis,
    FlexBasis,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC,
    "",
    // NOTE: The parsing implementation for the 'flex' shorthand property has
    // its own code to parse each subproperty. It does not depend on the
    // longhand parsing defined here.
    flex_flow,
    FlexFlow,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_POSITION(
    flex-grow,
    flex_grow,
    FlexGrow,
    CSS_PROPERTY_PARSE_VALUE |
      CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    // NOTE: The parsing implementation for the 'flex' shorthand property has
    // its own code to parse each subproperty. It does not depend on the
    // longhand parsing defined here.
    VARIANT_HN,
    nullptr,
    offsetof(nsStylePosition, mFlexGrow),
    eStyleAnimType_float)
CSS_PROP_POSITION(
    flex-shrink,
    flex_shrink,
    FlexShrink,
    CSS_PROPERTY_PARSE_VALUE |
      CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    // NOTE: The parsing implementation for the 'flex' shorthand property has
    // its own code to parse each subproperty. It does not depend on the
    // longhand parsing defined here.
    VARIANT_HN,
    nullptr,
    offsetof(nsStylePosition, mFlexShrink),
    eStyleAnimType_float)
CSS_PROP_POSITION(
    flex-wrap,
    flex_wrap,
    FlexWrap,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kFlexWrapKTable,
    offsetof(nsStylePosition, mFlexWrap),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    order,
    order,
    Order,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HI,
    nullptr,
    offsetof(nsStylePosition, mOrder),
    eStyleAnimType_Custom) // <integer>
CSS_PROP_POSITION(
    justify-content,
    justify_content,
    JustifyContent,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kJustifyContentKTable,
    offsetof(nsStylePosition, mJustifyContent),
    eStyleAnimType_EnumU8)
CSS_PROP_DISPLAY(
    float,
    float,
    CSS_PROP_PUBLIC_OR_PRIVATE(CssFloat, Float),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kFloatKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    -moz-float-edge,
    float_edge,
    CSS_PROP_DOMPROP_PREFIXED(FloatEdge),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kFloatEdgeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_SHORTHAND(
    font,
    font,
    Font,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_FONT(
    font-family,
    font_family,
    FontFamily,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-feature-settings,
    font_feature_settings,
    FontFeatureSettings,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-kerning,
    font_kerning,
    FontKerning,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kFontKerningKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-language-override,
    font_language_override,
    FontLanguageOverride,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_NORMAL | VARIANT_INHERIT | VARIANT_STRING,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-size,
    font_size,
    FontSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HON | VARIANT_SYSFONT,
    nullptr,
    offsetof(nsStyleFont, mFont.sizeAdjust),
    eStyleAnimType_float)
CSS_PROP_FONT(
    -moz-osx-font-smoothing,
    osx_font_smoothing,
    CSS_PROP_DOMPROP_PREFIXED(OsxFontSmoothing),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "layout.css.osx-font-smoothing.enabled",
    VARIANT_HK,
    kFontSmoothingKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-stretch,
    font_stretch,
    FontStretch,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK | VARIANT_SYSFONT,
    kFontStretchKTable,
    offsetof(nsStyleFont, mFont.stretch),
    eStyleAnimType_Custom)
CSS_PROP_FONT(
    font-style,
    font_style,
    FontStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK | VARIANT_SYSFONT,
    kFontStyleKTable,
    offsetof(nsStyleFont, mFont.style),
    eStyleAnimType_EnumU8)
CSS_PROP_FONT(
    font-synthesis,
    font_synthesis,
    FontSynthesis,
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontVariantEastAsianKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-variant-ligatures,
    font_variant_ligatures,
    FontVariantLigatures,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontVariantLigaturesKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-variant-numeric,
    font_variant_numeric,
    FontVariantNumeric,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontVariantNumericKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-variant-position,
    font_variant_position,
    FontVariantPosition,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HMK,
    kFontVariantPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-weight,
    font_weight,
    FontWeight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
        // NOTE: This property has range restrictions on interpolation!
    "",
    0,
    kFontWeightKTable,
    offsetof(nsStyleFont, mFont.weight),
    eStyleAnimType_Custom)
CSS_PROP_UIRESET(
    -moz-force-broken-image-icon,
    force_broken_image_icon,
    CSS_PROP_DOMPROP_PREFIXED(ForceBrokenImageIcon),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HI,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // bug 58646
CSS_PROP_POSITION(
    grid-auto-flow,
    grid_auto_flow,
    GridAutoFlow,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    kGridAutoFlowKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-auto-columns,
    grid_auto_columns,
    GridAutoColumns,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-auto-rows,
    grid_auto_rows,
    GridAutoRows,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-template-areas,
    grid_template_areas,
    GridTemplateAreas,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-template-columns,
    grid_template_columns,
    GridTemplateColumns,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-template-rows,
    grid_template_rows,
    GridTemplateRows,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    grid-template,
    grid_template,
    GridTemplate,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_SHORTHAND(
    grid,
    grid,
    Grid,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_POSITION(
    grid-column-start,
    grid_column_start,
    GridColumnStart,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-column-end,
    grid_column_end,
    GridColumnEnd,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-row-start,
    grid_row_start,
    GridRowStart,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-row-end,
    grid_row_end,
    GridRowEnd,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    grid-column,
    grid_column,
    GridColumn,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_SHORTHAND(
    grid-row,
    grid_row,
    GridRow,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_SHORTHAND(
    grid-area,
    grid_area,
    GridArea,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_POSITION(
    height,
    height,
    Height,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mHeight),
    eStyleAnimType_Coord)
CSS_PROP_VISIBILITY(
    image-orientation,
    image_orientation,
    ImageOrientation,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "layout.css.image-orientation.enabled",
    0,
    kImageOrientationKTable,
    offsetof(nsStyleVisibility, mImageOrientation),
    eStyleAnimType_None)
CSS_PROP_LIST(
    -moz-image-region,
    image_region,
    CSS_PROP_DOMPROP_PREFIXED(ImageRegion),
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    offsetof(nsStyleList, mImageRegion),
    eStyleAnimType_Custom)
CSS_PROP_UIRESET(
    ime-mode,
    ime_mode,
    ImeMode,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kIMEModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    inline-size,
    inline_size,
    InlineSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    Size,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    left,
    left,
    Left,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mOffset),
    eStyleAnimType_Sides_Left)
CSS_PROP_TEXT(
    letter-spacing,
    letter_spacing,
    LetterSpacing,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "",
    VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleText, mLetterSpacing),
    eStyleAnimType_Coord)
CSS_PROP_TEXT(
    line-height,
    line_height,
    LineHeight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLPN | VARIANT_KEYWORD | VARIANT_NORMAL | VARIANT_SYSFONT,
    kLineHeightKTable,
    offsetof(nsStyleText, mLineHeight),
    eStyleAnimType_Coord)
CSS_PROP_SHORTHAND(
    list-style,
    list_style,
    ListStyle,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_LIST(
    list-style-image,
    list_style_image,
    ListStyleImage,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_START_IMAGE_LOADS,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LIST(
    list-style-position,
    list_style_position,
    ListStylePosition,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kListStylePositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LIST(
    list-style-type,
    list_style_type,
    ListStyleType,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    margin,
    margin,
    Margin,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE,
    "")
CSS_PROP_LOGICAL(
    margin-block-end,
    margin_block_end,
    MarginBlockEnd,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Margin,
    Margin,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    margin-block-start,
    margin_block_start,
    MarginBlockStart,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Margin,
    Margin,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_MARGIN(
    margin-bottom,
    margin_bottom,
    MarginBottom,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleMargin, mMargin),
    eStyleAnimType_Sides_Bottom)
CSS_PROP_LOGICAL(
    -moz-margin-end,
    margin_end,
    CSS_PROP_DOMPROP_PREFIXED(MarginEnd),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_LOGICAL,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Margin,
    Margin,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_MARGIN(
    margin-left,
    margin_left,
    MarginLeft,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleMargin, mMargin),
    eStyleAnimType_Sides_Top)
CSS_PROP_CONTENT(
    marker-offset,
    marker_offset,
    MarkerOffset,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_AHL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleContent, mMarkerOffset),
    eStyleAnimType_Coord)
CSS_PROP_BACKENDONLY(
    marks,
    marks,
    Marks,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "",
    0,
    kPageMarksKTable)
CSS_PROP_LOGICAL(
    max-block-size,
    max_block_size,
    MaxBlockSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HKLPO | VARIANT_CALC,
    kWidthKTable,
    MaxSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    max-height,
    max_height,
    MaxHeight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLPO | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mMaxHeight),
    eStyleAnimType_Coord)
CSS_PROP_LOGICAL(
    max-inline-size,
    max_inline_size,
    MaxInlineSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HKLPO | VARIANT_CALC,
    kWidthKTable,
    MaxSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    max-width,
    max_width,
    MaxWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HKLPO | VARIANT_CALC,
    kWidthKTable,
    offsetof(nsStylePosition, mMaxWidth),
    eStyleAnimType_Coord)
CSS_PROP_POSITION(
    min-height,
    min_height,
    MinHeight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mMinHeight),
    eStyleAnimType_Coord)
CSS_PROP_LOGICAL(
    min-block-size,
    min_block_size,
    MinBlockSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    MinSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    min-inline-size,
    min_inline_size,
    MinInlineSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    MinSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    min-width,
    min_width,
    MinWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    offsetof(nsStylePosition, mMinWidth),
    eStyleAnimType_Coord)
CSS_PROP_DISPLAY(
    mix-blend-mode,
    mix_blend_mode,
    MixBlendMode,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "layout.css.mix-blend-mode.enabled",
    VARIANT_HK,
    kBlendModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    isolation,
    isolation,
    Isolation,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "layout.css.isolation.enabled",
    VARIANT_HK,
    kIsolationKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    object-fit,
    object_fit,
    ObjectFit,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.object-fit-and-position.enabled",
    VARIANT_HK,
    kObjectFitKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    object-position,
    object_position,
    ObjectPosition,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.object-fit-and-position.enabled",
    0,
    kBackgroundPositionKTable,
    offsetof(nsStylePosition, mObjectPosition),
    eStyleAnimType_Custom)
CSS_PROP_LOGICAL(
    offset-block-end,
    offset_block_end,
    OffsetBlockEnd,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Offset,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    offset-block-start,
    offset_block_start,
    OffsetBlockStart,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Offset,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    offset-inline-end,
    offset_inline_end,
    OffsetInlineEnd,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Offset,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    offset-inline-start,
    offset_inline_start,
    OffsetInlineStart,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Offset,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    opacity,
    opacity,
    Opacity,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HN,
    nullptr,
    offsetof(nsStyleDisplay, mOpacity),
    eStyleAnimType_float)
CSS_PROP_DISPLAY(
    -moz-orient,
    orient,
    CSS_PROP_DOMPROP_PREFIXED(Orient),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kOrientKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKENDONLY(
    orphans,
    orphans,
    Orphans,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_AT_LEAST_ONE,
    "",
    VARIANT_HI,
    nullptr)
CSS_PROP_SHORTHAND(
    outline,
    outline,
    Outline,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_OUTLINE(
    outline-color,
    outline_color,
    OutlineColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kOutlineColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_OUTLINE(
    outline-style,
    outline_style,
    OutlineStyle,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kOutlineStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_OUTLINE(
    outline-width,
    outline_width,
    OutlineWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    offsetof(nsStyleOutline, mOutlineWidth),
    eStyleAnimType_Coord)
CSS_PROP_OUTLINE(
    outline-offset,
    outline_offset,
    OutlineOffset,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleOutline, mOutlineOffset),
    eStyleAnimType_nscoord)
CSS_PROP_SHORTHAND(
    overflow,
    overflow,
    Overflow,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_DISPLAY(
    overflow-clip-box,
    overflow_clip_box,
    OverflowClipBox,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "layout.css.overflow-clip-box.enabled",
    VARIANT_HK,
    kOverflowClipBoxKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    overflow-x,
    overflow_x,
    OverflowX,
    CSS_PROPERTY_PARSE_VALUE |
        // This is required by the UA stylesheet and can't be overridden.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kOverflowSubKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    overflow-y,
    overflow_y,
    OverflowY,
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePadding, mPadding),
    eStyleAnimType_Sides_Left)
CSS_PROP_PADDING(
    padding-right,
    padding_right,
    PaddingRight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        // This is required by the UA stylesheet and can't be overridden.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePadding, mPadding),
    eStyleAnimType_Sides_Right)
CSS_PROP_PADDING(
    padding-top,
    padding_top,
    PaddingTop,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        // This is required by the UA stylesheet and can't be overridden.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePadding, mPadding),
    eStyleAnimType_Sides_Top)
CSS_PROP_BACKENDONLY(
    page,
    page,
    Page,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_AUTO | VARIANT_IDENTIFIER,
    nullptr)
CSS_PROP_DISPLAY(
    page-break-after,
    page_break_after,
    PageBreakAfter,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kPageBreakKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // temp fix for bug 24000
CSS_PROP_DISPLAY(
    page-break-before,
    page_break_before,
    PageBreakBefore,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kPageBreakKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // temp fix for bug 24000
CSS_PROP_DISPLAY(
    page-break-inside,
    page_break_inside,
    PageBreakInside,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kPageBreakInsideKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    paint-order,
    paint_order,
    PaintOrder,
    CSS_PROPERTY_PARSE_FUNCTION,
    "svg.paint-order.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_VISIBILITY(
    pointer-events,
    pointer_events,
    PointerEvents,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kPointerEventsKTable,
    offsetof(nsStyleVisibility, mPointerEvents),
    eStyleAnimType_EnumU8)
CSS_PROP_DISPLAY(
    position,
    position,
    Position,
    CSS_PROPERTY_PARSE_VALUE |
        // For position: sticky
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_HK,
    kPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_QUOTES(
    quotes,
    quotes,
    Quotes,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    resize,
    resize,
    Resize,
    CSS_PROPERTY_PARSE_VALUE |
        // This is allowed because the UA stylesheet sets 'resize: both;' on
        // textarea and we need to disable this for the placeholder
        // pseudo-element.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kResizeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    right,
    right,
    Right,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mOffset),
    eStyleAnimType_Sides_Right)
CSS_PROP_TEXT(
    ruby-align,
    ruby_align,
    RubyAlign,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.ruby.enabled",
    VARIANT_HK,
    kRubyAlignKTable,
    offsetof(nsStyleText, mRubyAlign),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXT(
    ruby-position,
    ruby_position,
    RubyPosition,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.ruby.enabled",
    VARIANT_HK,
    kRubyPositionKTable,
    offsetof(nsStyleText, mRubyPosition),
    eStyleAnimType_EnumU8)
CSS_PROP_DISPLAY(
    scroll-behavior,
    scroll_behavior,
    ScrollBehavior,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.scroll-behavior.property-enabled",
    VARIANT_HK,
    kScrollBehaviorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-type-x,
    scroll_snap_type_x,
    ScrollSnapTypeX,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.scroll-snap.enabled",
    VARIANT_HK,
    kScrollSnapTypeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-type-y,
    scroll_snap_type_y,
    ScrollSnapTypeY,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.scroll-snap.enabled",
    VARIANT_HK,
    kScrollSnapTypeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    scroll-snap-type,
    scroll_snap_type,
    ScrollSnapType,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.scroll-snap.enabled")
CSS_PROP_DISPLAY(
    scroll-snap-points-x,
    scroll_snap_points_x,
    ScrollSnapPointsX,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.scroll-snap.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-points-y,
    scroll_snap_points_y,
    ScrollSnapPointsY,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.scroll-snap.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-destination,
    scroll_snap_destination,
    ScrollSnapDestination,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.scroll-snap.enabled",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-coordinate,
    scroll_snap_coordinate,
    ScrollSnapCoordinate,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.scroll-snap.enabled",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKENDONLY(
    size,
    size,
    Size,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    kPageSizeKTable)
CSS_PROP_TABLE(
    table-layout,
    table_layout,
    TableLayout,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kTableLayoutKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    text-align,
    text_align,
    TextAlign,
    CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_VALUE_PARSER_FUNCTION |
      CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    // When we support aligning on a string, we can parse text-align
    // as a string....
    VARIANT_HK /* | VARIANT_STRING */,
    kTextAlignKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    -moz-text-align-last,
    text_align_last,
    CSS_PROP_DOMPROP_PREFIXED(TextAlignLast),
    CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "",
    VARIANT_HK,
    kTextAlignLastKTable,
    offsetof(nsStyleText, mTextAlignLast),
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    text-decoration,
    text_decoration,
    TextDecoration,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_TEXT(
    text-combine-upright,
    text_combine_upright,
    TextCombineUpright,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled",
    0,
    kTextCombineUprightKTable,
    offsetof(nsStyleText, mTextCombineUpright),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXTRESET(
    text-decoration-color,
    text_decoration_color,
    TextDecorationColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TEXTRESET(
    text-decoration-line,
    text_decoration_line,
    TextDecorationLine,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kTextDecorationLineKTable,
    offsetof(nsStyleTextReset, mTextDecorationLine),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXTRESET(
    text-decoration-style,
    text_decoration_style,
    TextDecorationStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kTextDecorationStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TEXT(
    text-indent,
    text_indent,
    TextIndent,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleText, mTextIndent),
    eStyleAnimType_Coord)
CSS_PROP_VISIBILITY(
    text-orientation,
    text_orientation,
    TextOrientation,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled",
    VARIANT_HK,
    kTextOrientationKTable,
    offsetof(nsStyleVisibility, mTextOrientation),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXTRESET(
    text-overflow,
    text_overflow,
    TextOverflow,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kTextOverflowKTable,
    offsetof(nsStyleTextReset, mTextOverflow),
    eStyleAnimType_None)
CSS_PROP_TEXT(
    text-shadow,
    text_shadow,
    TextShadow,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
        // NOTE: some components must be nonnegative
    "",
    0,
    nullptr,
    offsetof(nsStyleText, mTextShadow),
    eStyleAnimType_Shadow)
CSS_PROP_TEXT(
    -moz-text-size-adjust,
    text_size_adjust,
    CSS_PROP_DOMPROP_PREFIXED(TextSizeAdjust),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_AUTO | VARIANT_NONE | VARIANT_INHERIT,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    text-transform,
    text_transform,
    TextTransform,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kTextTransformKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    transform,
    transform,
    Transform,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    0,
    nullptr,
    offsetof(nsStylePosition, mSpecifiedTransform),
    eStyleAnimType_Custom)
CSS_PROP_POSITION(
    transform-origin,
    transform_origin,
    TransformOrigin,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_POSITION(
    perspective-origin,
    perspective_origin,
    PerspectiveOrigin,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_POSITION(
    perspective,
    perspective,
    Perspective,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_NONE | VARIANT_INHERIT | VARIANT_LENGTH | VARIANT_POSITIVE_DIMENSION,
    nullptr,
    offsetof(nsStylePosition, mChildPerspective),
    eStyleAnimType_Coord)
CSS_PROP_POSITION(
    transform-style,
    transform_style,
    TransformStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_HK,
    kTransformStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    backface-visibility,
    backface_visibility,
    BackfaceVisibility,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBackfaceVisibilityKTable,
    offsetof(nsStylePosition, mBackfaceVisibility),
    eStyleAnimType_None)
CSS_PROP_POSITION(
    top,
    top,
    Top,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mOffset),
    eStyleAnimType_Sides_Top)
 CSS_PROP_DISPLAY(
    touch-action,
    touch_action,
    TouchAction,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "layout.css.touch_action.enabled",
    VARIANT_HK,
    kTouchActionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    transition,
    transition,
    Transition,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_DISPLAY(
    transition-delay,
    transition_delay,
    TransitionDelay,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    transition-duration,
    transition_duration,
    TransitionDuration,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME | VARIANT_NONNEGATIVE_DIMENSION, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    transition-property,
    transition_property,
    TransitionProperty,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_IDENTIFIER | VARIANT_NONE | VARIANT_ALL, // used only in shorthand
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    transition-timing-function,
    transition_timing_function,
    TransitionTimingFunction,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD | VARIANT_TIMING_FUNCTION, // used by list parsing
    kTransitionTimingFunctionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
CSS_PROP_TEXTRESET(
    unicode-bidi,
    unicode_bidi,
    UnicodeBidi,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kUnicodeBidiKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND)
# 3462 "../../dist/include/nsCSSPropList.h"
CSS_PROP_USERINTERFACE(
    -moz-user-focus,
    user_focus,
    CSS_PROP_DOMPROP_PREFIXED(UserFocus),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kUserFocusKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_USERINTERFACE(
    -moz-user-input,
    user_input,
    CSS_PROP_DOMPROP_PREFIXED(UserInput),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kUserInputKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX ??? // XXX bug 3935
CSS_PROP_USERINTERFACE(
    -moz-user-modify,
    user_modify,
    CSS_PROP_DOMPROP_PREFIXED(UserModify),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kUserModifyKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_UIRESET(
    -moz-user-select,
    user_select,
    CSS_PROP_DOMPROP_PREFIXED(UserSelect),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kUserSelectKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
// NOTE: vertical-align is only supposed to apply to :first-letter when
// 'float' is 'none', but we don't worry about that since it has no
// effect otherwise
CSS_PROP_TEXTRESET(
    vertical-align,
    vertical_align,
    VerticalAlign,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HKLP | VARIANT_CALC,
    kVerticalAlignKTable,
    offsetof(nsStyleTextReset, mVerticalAlign),
    eStyleAnimType_Coord)
CSS_PROP_VISIBILITY(
    visibility,
    visibility,
    Visibility,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kVisibilityKTable,
    offsetof(nsStyleVisibility, mVisible),
    eStyleAnimType_EnumU8)  // reflow for collapse
CSS_PROP_TEXT(
    white-space,
    white_space,
    WhiteSpace,
    CSS_PROPERTY_PARSE_VALUE |
        // This is required by the UA stylesheet and can't be overridden.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kWhitespaceKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKENDONLY(
    widows,
    widows,
    Widows,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_AT_LEAST_ONE,
    "",
    VARIANT_HI,
    nullptr)
CSS_PROP_POSITION(
    width,
    width,
    Width,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    offsetof(nsStylePosition, mWidth),
    eStyleAnimType_Coord)
CSS_PROP_USERINTERFACE(
    -moz-window-dragging,
    _moz_window_dragging,
    CSS_PROP_DOMPROP_PREFIXED(WindowDragging),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kWindowDraggingKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_UIRESET(
    -moz-window-shadow,
    _moz_window_shadow,
    CSS_PROP_DOMPROP_PREFIXED(WindowShadow),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kWindowShadowKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    word-break,
    word_break,
    WordBreak,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kWordBreakKTable,
    offsetof(nsStyleText, mWordBreak),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXT(
    word-spacing,
    word_spacing,
    WordSpacing,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "",
    VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleText, mWordSpacing),
    eStyleAnimType_nscoord)
CSS_PROP_TEXT(
    word-wrap,
    word_wrap,
    WordWrap,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kWordWrapKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    -moz-hyphens,
    hyphens,
    CSS_PROP_DOMPROP_PREFIXED(Hyphens),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kHyphensKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_VISIBILITY(
    writing-mode,
    writing_mode,
    WritingMode,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled",
    VARIANT_HK,
    kWritingModeKTable,
    offsetof(nsStyleVisibility, mWritingMode),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    z-index,
    z_index,
    ZIndex,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_AHI,
    nullptr,
    offsetof(nsStylePosition, mZIndex),
    eStyleAnimType_Coord)
CSS_PROP_XUL(
    -moz-box-align,
    box_align,
    CSS_PROP_DOMPROP_PREFIXED(BoxAlign),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBoxAlignKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_XUL(
    -moz-box-direction,
    box_direction,
    CSS_PROP_DOMPROP_PREFIXED(BoxDirection),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBoxDirectionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_XUL(
    -moz-box-flex,
    box_flex,
    CSS_PROP_DOMPROP_PREFIXED(BoxFlex),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HN,
    nullptr,
    offsetof(nsStyleXUL, mBoxFlex),
    eStyleAnimType_float) // XXX bug 3935
CSS_PROP_XUL(
    -moz-box-orient,
    box_orient,
    CSS_PROP_DOMPROP_PREFIXED(BoxOrient),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBoxOrientKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_XUL(
    -moz-box-pack,
    box_pack,
    CSS_PROP_DOMPROP_PREFIXED(BoxPack),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBoxPackKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_XUL(
    -moz-box-ordinal-group,
    box_ordinal_group,
    CSS_PROP_DOMPROP_PREFIXED(BoxOrdinalGroup),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HI,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_XUL(
    -moz-stack-sizing,
    stack_sizing,
    CSS_PROP_DOMPROP_PREFIXED(StackSizing),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kStackSizingKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)

#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_FONT(
    -moz-script-level,
    script_level,
    ScriptLevel,
    // REVIEW: no range restriction?
    // NOTE: CSSParserImpl::ParseSingleValueProperty only accepts this
    // property when mUnsafeRulesEnabled is set.
    CSS_PROPERTY_PARSE_VALUE,
    "",
    // script-level can take Auto, Integer and Number values, but only Auto
    // ("increment if parent is not in displaystyle") and Integer
    // ("relative") values can be specified in a style sheet.
    VARIANT_AHI,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    -moz-script-size-multiplier,
    script_size_multiplier,
    ScriptSizeMultiplier,
    // REVIEW: no range restriction?
    CSS_PROPERTY_PARSE_INACCESSIBLE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    -moz-script-min-size,
    script_min_size,
    ScriptMinSize,
    // REVIEW: no range restriction?
    CSS_PROPERTY_PARSE_INACCESSIBLE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    -moz-math-variant,
    math_variant,
    MathVariant,
    CSS_PROPERTY_PARSE_INACCESSIBLE,
    "",
    VARIANT_HK,
    kMathVariantKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    -moz-math-display,
    math_display,
    MathDisplay,
    // NOTE: CSSParserImpl::ParseSingleValueProperty only accepts this
    // property when mUnsafeRulesEnabled is set.
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kMathDisplayKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_EXCLUDE_INTERNAL)
# 3786 "../../dist/include/nsCSSPropList.h"
#endif // !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND)
# 3787 "../../dist/include/nsCSSPropList.h"

CSS_PROP_SVGRESET(
    clip-path,
    clip_path,
    ClipPath,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    clip-rule,
    clip_rule,
    ClipRule,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kFillRuleKTable,
    offsetof(nsStyleSVG, mClipRule),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    color-interpolation,
    color_interpolation,
    ColorInterpolation,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kColorInterpolationKTable,
    offsetof(nsStyleSVG, mColorInterpolation),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    color-interpolation-filters,
    color_interpolation_filters,
    ColorInterpolationFilters,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kColorInterpolationKTable,
    offsetof(nsStyleSVG, mColorInterpolationFilters),
    eStyleAnimType_EnumU8)
CSS_PROP_SVGRESET(
    dominant-baseline,
    dominant_baseline,
    DominantBaseline,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kDominantBaselineKTable,
    offsetof(nsStyleSVGReset, mDominantBaseline),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    fill,
    fill,
    Fill,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    kContextPatternKTable,
    offsetof(nsStyleSVG, mFill),
    eStyleAnimType_PaintServer)
CSS_PROP_SVG(
    fill-opacity,
    fill_opacity,
    FillOpacity,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HN | VARIANT_OPENTYPE_SVG_KEYWORD,
    kContextOpacityKTable,
    offsetof(nsStyleSVG, mFillOpacity),
    eStyleAnimType_float)
CSS_PROP_SVG(
    fill-rule,
    fill_rule,
    FillRule,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kFillRuleKTable,
    offsetof(nsStyleSVG, mFillRule),
    eStyleAnimType_EnumU8)
CSS_PROP_SVGRESET(
    filter,
    filter,
    Filter,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_SVGRESET(
    flood-color,
    flood_color,
    FloodColor,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HC,
    nullptr,
    offsetof(nsStyleSVGReset, mFloodColor),
    eStyleAnimType_Color)
CSS_PROP_SVGRESET(
    flood-opacity,
    flood_opacity,
    FloodOpacity,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HN,
    nullptr,
    offsetof(nsStyleSVGReset, mFloodOpacity),
    eStyleAnimType_float)
CSS_PROP_SVG(
    image-rendering,
    image_rendering,
    ImageRendering,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kImageRenderingKTable,
    offsetof(nsStyleSVG, mImageRendering),
    eStyleAnimType_EnumU8)
CSS_PROP_SVGRESET(
    lighting-color,
    lighting_color,
    LightingColor,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HC,
    nullptr,
    offsetof(nsStyleSVGReset, mLightingColor),
    eStyleAnimType_Color)
CSS_PROP_SHORTHAND(
    marker,
    marker,
    Marker,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_SVG(
    marker-end,
    marker_end,
    MarkerEnd,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    marker-mid,
    marker_mid,
    MarkerMid,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    marker-start,
    marker_start,
    MarkerStart,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVGRESET(
    mask,
    mask,
    Mask,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVGRESET(
    mask-type,
    mask_type,
    MaskType,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.masking.enabled",
    VARIANT_HK,
    kMaskTypeKTable,
    offsetof(nsStyleSVGReset, mMaskType),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    shape-rendering,
    shape_rendering,
    ShapeRendering,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kShapeRenderingKTable,
    offsetof(nsStyleSVG, mShapeRendering),
    eStyleAnimType_EnumU8)
CSS_PROP_SVGRESET(
    stop-color,
    stop_color,
    StopColor,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HC,
    nullptr,
    offsetof(nsStyleSVGReset, mStopColor),
    eStyleAnimType_Color)
CSS_PROP_SVGRESET(
    stop-opacity,
    stop_opacity,
    StopOpacity,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HN,
    nullptr,
    offsetof(nsStyleSVGReset, mStopOpacity),
    eStyleAnimType_float)
CSS_PROP_SVG(
    stroke,
    stroke,
    Stroke,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    kContextPatternKTable,
    offsetof(nsStyleSVG, mStroke),
    eStyleAnimType_PaintServer)
CSS_PROP_SVG(
    stroke-dasharray,
    stroke_dasharray,
    StrokeDasharray,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_NUMBERS_ARE_PIXELS,
        // NOTE: Internal values have range restrictions.
    "",
    0,
    kStrokeContextValueKTable,
    CSS_PROP_NO_OFFSET, /* property stored in 2 separate members */
    eStyleAnimType_Custom)
CSS_PROP_SVG(
    stroke-dashoffset,
    stroke_dashoffset,
    StrokeDashoffset,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_NUMBERS_ARE_PIXELS,
    "",
    VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
    kStrokeContextValueKTable,
    offsetof(nsStyleSVG, mStrokeDashoffset),
    eStyleAnimType_Coord)
CSS_PROP_SVG(
    stroke-linecap,
    stroke_linecap,
    StrokeLinecap,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kStrokeLinecapKTable,
    offsetof(nsStyleSVG, mStrokeLinecap),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    stroke-linejoin,
    stroke_linejoin,
    StrokeLinejoin,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kStrokeLinejoinKTable,
    offsetof(nsStyleSVG, mStrokeLinejoin),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    stroke-miterlimit,
    stroke_miterlimit,
    StrokeMiterlimit,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_AT_LEAST_ONE,
    "",
    VARIANT_HN,
    nullptr,
    offsetof(nsStyleSVG, mStrokeMiterlimit),
    eStyleAnimType_float)
CSS_PROP_SVG(
    stroke-opacity,
    stroke_opacity,
    StrokeOpacity,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HN | VARIANT_OPENTYPE_SVG_KEYWORD,
    kContextOpacityKTable,
    offsetof(nsStyleSVG, mStrokeOpacity),
    eStyleAnimType_float)
CSS_PROP_SVG(
    stroke-width,
    stroke_width,
    StrokeWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_NUMBERS_ARE_PIXELS,
    "",
    VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
    kStrokeContextValueKTable,
    offsetof(nsStyleSVG, mStrokeWidth),
    eStyleAnimType_Coord)
CSS_PROP_SVG(
    text-anchor,
    text_anchor,
    TextAnchor,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kTextAnchorKTable,
    offsetof(nsStyleSVG, mTextAnchor),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    text-rendering,
    text_rendering,
    TextRendering,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kTextRenderingKTable,
    offsetof(nsStyleSVG, mTextRendering),
    eStyleAnimType_EnumU8)
CSS_PROP_SVGRESET(
    vector-effect,
    vector_effect,
    VectorEffect,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kVectorEffectKTable,
    offsetof(nsStyleSVGReset, mVectorEffect),
    eStyleAnimType_EnumU8)

CSS_PROP_POSITION(
    will-change,
    will_change,
    WillChange,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_CHROME_OR_CERTIFIED_APP,
    "layout.css.will-change.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)

// The shorthands below are essentially aliases, but they require different
// parsing rules, and are therefore implemented as shorthands.
CSS_PROP_SHORTHAND(
    -moz-transform,
    _moz_transform,
    MozTransform,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_IS_ALIAS,
    "layout.css.prefixes.transforms")

#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
// We have a few properties that are in style structs but are not stored
// in style sheets (or nsCSS* structs).  Some fields in these property
// definitions are bogus (e.g., they work for nsRuleData* offsets but
// not nsCSS* offsets).  Callers that care about these bogus fields can
// define CSS_PROP_STUB_NOT_CSS to define a replacement for these
// entries.
#ifdef CSS_PROP_STUB_NOT_CSS
CSS_PROP_STUB_NOT_CSS
CSS_PROP_STUB_NOT_CSS
#else
# 4160 "../../dist/include/nsCSSPropList.h"
CSS_PROP_FONT(
    -x-lang,
    _x_lang,
    Lang,
    CSS_PROPERTY_PARSE_INACCESSIBLE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TABLE(
    -x-span,
    _x_span,
    Span,
    CSS_PROPERTY_PARSE_INACCESSIBLE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    -x-text-zoom,
    _x_text_zoom,
    TextZoom,
    CSS_PROPERTY_PARSE_INACCESSIBLE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif /* !defined(CSS_PROP_STUB_NOT_CSS) */
# 4191 "../../dist/include/nsCSSPropList.h"
#endif /* !defined(CSS_PROP_LIST_EXCLUDE_INTERNAL) */
# 4192 "../../dist/include/nsCSSPropList.h"
#endif /* !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND) */
# 4193 "../../dist/include/nsCSSPropList.h"

#ifdef USED_CSS_PROP

#undef USED_CSS_PROP
#undef CSS_PROP_FONT
#undef CSS_PROP_COLOR
#undef CSS_PROP_BACKGROUND
#undef CSS_PROP_LIST
#undef CSS_PROP_POSITION
#undef CSS_PROP_TEXT
#undef CSS_PROP_TEXTRESET
#undef CSS_PROP_DISPLAY
#undef CSS_PROP_VISIBILITY
#undef CSS_PROP_CONTENT
#undef CSS_PROP_QUOTES
#undef CSS_PROP_USERINTERFACE
#undef CSS_PROP_UIRESET
#undef CSS_PROP_TABLE
#undef CSS_PROP_TABLEBORDER
#undef CSS_PROP_MARGIN
#undef CSS_PROP_PADDING
#undef CSS_PROP_BORDER
#undef CSS_PROP_OUTLINE
#undef CSS_PROP_XUL
#undef CSS_PROP_COLUMN
#undef CSS_PROP_SVG
#undef CSS_PROP_SVGRESET
#undef CSS_PROP_VARIABLES
#ifdef DEFINED_CSS_PROP_BACKENDONLY
#undef CSS_PROP_BACKENDONLY
#undef DEFINED_CSS_PROP_BACKENDONLY
#endif
# 4225 "../../dist/include/nsCSSPropList.h"

#else /* !defined(USED_CSS_PROP) */
# 4227 "../../dist/include/nsCSSPropList.h"

#ifdef DEFINED_CSS_PROP_FONT
#undef CSS_PROP_FONT
#undef DEFINED_CSS_PROP_FONT
#endif
# 4232 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_COLOR
#undef CSS_PROP_COLOR
#undef DEFINED_CSS_PROP_COLOR
#endif
# 4236 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_BACKGROUND
#undef CSS_PROP_BACKGROUND
#undef DEFINED_CSS_PROP_BACKGROUND
#endif
# 4240 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_LIST
#undef CSS_PROP_LIST
#undef DEFINED_CSS_PROP_LIST
#endif
# 4244 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_POSITION
#undef CSS_PROP_POSITION
#undef DEFINED_CSS_PROP_POSITION
#endif
# 4248 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_TEXT
#undef CSS_PROP_TEXT
#undef DEFINED_CSS_PROP_TETEXTRESETT
#endif
# 4252 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_TEXTRESET
#undef CSS_PROP_TEXTRESET
#undef DEFINED_CSS_PROP_TEDISPLAYTRESET
#endif
# 4256 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_DISPLAY
#undef CSS_PROP_DISPLAY
#undef DEFINED_CSS_PROP_DISPLAY
#endif
# 4260 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_VISIBILITY
#endif
#ifdef DEFINED_CSS_PROP_BACKENDONLY
#undef CSS_PROP_BACKENDONLY
#undef DEFINED_CSS_PROP_BACKENDONLY
#endif
# 4328 "../../dist/include/nsCSSPropList.h"

#endif /* !defined(USED_CSS_PROP) */
# 4330 "../../dist/include/nsCSSPropList.h"

#ifdef DEFINED_CSS_PROP_SHORTHAND
#undef CSS_PROP_SHORTHAND
#undef DEFINED_CSS_PROP_SHORTHAND
#endif
# 4335 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_LOGICAL
#undef CSS_PROP_LOGICAL
#undef DEFINED_CSS_PROP_LOGICAL
#endif
# 4339 "../../dist/include/nsCSSPropList.h"

#undef CSS_PROP_DOMPROP_PREFIXED
# 26 "../../dist/include/nsCSSProperty.h" 2
  #undef CSS_PROP_LIST_INCLUDE_LOGICAL
  #undef CSS_PROP

  eCSSProperty_COUNT_no_shorthands,
  // Make the count continue where it left off:
  eCSSProperty_COUNT_DUMMY = eCSSProperty_COUNT_no_shorthands - 1,

  #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \
    eCSSProperty_##id_,
  #if 0 /* expanded by -frewrite-includes */
#include "nsCSSPropList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSPropList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * a list of all CSS properties with considerable data about them, for
 * preprocessing
 */

/******

  This file contains the list of all parsed CSS properties.  It is
  be defined with CSS_PROP_SHORTHAND.

 ******/


/*************************************************************************/


// All includers must explicitly define CSS_PROP_SHORTHAND if they
// want it.
#ifndef CSS_PROP_SHORTHAND
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) /* nothing */
#define DEFINED_CSS_PROP_SHORTHAND
#endif
# 91 "../../dist/include/nsCSSPropList.h"

// as required by the CSS Cascading and Inheritance specification, and any
// internal properties that cannot be changed by using CSS syntax.  For example,
// the internal '-moz-system-font' property is not excluded, as it is set by the
// 'font' shorthand, while '-x-lang' is excluded as there is no way to set this
// internal property from a style sheet.

// A caller who wants all the properties can define the |CSS_PROP|
// macro.
#ifdef CSS_PROP

#define USED_CSS_PROP
#define CSS_PROP_FONT(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Font, stylestructoffset_, animtype_)
#define CSS_PROP_COLOR(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Color, stylestructoffset_, animtype_)
#define CSS_PROP_BACKGROUND(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Background, stylestructoffset_, animtype_)
#define CSS_PROP_LIST(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, List, stylestructoffset_, animtype_)
#define CSS_PROP_POSITION(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Position, stylestructoffset_, animtype_)
// defined).
#if defined(CSS_PROP_LOGICAL) && defined(CSS_PROP_LIST_EXCLUDE_LOGICAL) || defined(CSS_PROP_LOGICAL) && defined(CSS_PROP_LIST_INCLUDE_LOGICAL) || defined(CSS_PROP_LIST_EXCLUDE_LOGICAL) && defined(CSS_PROP_LIST_INCLUDE_LOGICAL)
#error Do not define more than one of CSS_PROP_LOGICAL, CSS_PROP_LIST_EXCLUDE_LOGICAL and CSS_PROP_LIST_INCLUDE_LOGICAL when capturing properties using CSS_PROP.
#endif
# 175 "../../dist/include/nsCSSPropList.h"

#ifndef CSS_PROP_LOGICAL
#ifdef CSS_PROP_LIST_INCLUDE_LOGICAL
#define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, group_, struct_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, struct_, stylestructoffset_, animtype_)
#else
# 180 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_LIST_EXCLUDE_LOGICAL
#error Must define exactly one of CSS_PROP_LOGICAL, CSS_PROP_LIST_EXCLUDE_LOGICAL and CSS_PROP_LIST_INCLUDE_LOGICAL when capturing properties using CSS_PROP.
#endif
# 183 "../../dist/include/nsCSSPropList.h"
#define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, group_, struct_, stylestructoffset_, animtype_) /* nothing */
#endif
# 185 "../../dist/include/nsCSSPropList.h"
#define DEFINED_CSS_PROP_LOGICAL
#endif
# 187 "../../dist/include/nsCSSPropList.h"

#else /* !defined(CSS_PROP) */
# 189 "../../dist/include/nsCSSPropList.h"

// An includer who does not define CSS_PROP can define any or all of the
// per-struct macros that are equivalent to it, and the rest will be
// ignored.

#if defined(CSS_PROP_LIST_EXCLUDE_LOGICAL) || defined(CSS_PROP_LIST_INCLUDE_LOGICAL)
#error Do not define CSS_PROP_LIST_EXCLUDE_LOGICAL or CSS_PROP_LIST_INCLUDE_LOGICAL when not capturing properties using CSS_PROP.
#endif
# 197 "../../dist/include/nsCSSPropList.h"

#ifndef CSS_PROP_FONT
#define CSS_PROP_FONT(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_FONT
#endif
# 202 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_COLOR
#define CSS_PROP_COLOR(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_COLOR
#endif
# 206 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_BACKGROUND
#define CSS_PROP_BACKGROUND(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_BACKGROUND
#endif
# 210 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_LIST
#define CSS_PROP_LIST(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_LIST
#endif
# 214 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_POSITION
#define CSS_PROP_POSITION(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_POSITION
#endif
# 218 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_TEXT
#define CSS_PROP_TEXT(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_TEXT
#endif
# 222 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_TEXTRESET
#define CSS_PROP_TEXTRESET(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_TEXTRESET
#endif
# 226 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_DISPLAY
#define CSS_PROP_DISPLAY(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_DISPLAY
#endif
# 230 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_VISIBILITY
#define CSS_PROP_VISIBILITY(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_VISIBILITY
#endif
# 234 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_CONTENT
#define CSS_PROP_CONTENT(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_CONTENT
#endif
# 238 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_QUOTES
#define CSS_PROP_QUOTES(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_QUOTES
#endif
# 242 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_USERINTERFACE
#define CSS_PROP_USERINTERFACE(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_USERINTERFACE
#endif
# 246 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_UIRESET
#define CSS_PROP_UIRESET(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_UIRESET
#endif
# 250 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_TABLE
#define CSS_PROP_TABLE(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_TABLE
#endif
# 254 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_TABLEBORDER
#define CSS_PROP_TABLEBORDER(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_TABLEBORDER
#endif
# 258 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_MARGIN
#define CSS_PROP_MARGIN(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_MARGIN
#endif
# 262 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_PADDING
#define CSS_PROP_PADDING(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_PADDING
#endif
# 266 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_BORDER
#define CSS_PROP_BORDER(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_BORDER
#endif
# 270 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_OUTLINE
#define CSS_PROP_OUTLINE(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_OUTLINE
#endif
# 274 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_XUL
#define CSS_PROP_XUL(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_XUL
#endif
# 278 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_COLUMN
#define CSS_PROP_COLUMN(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_COLUMN
#endif
# 282 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_SVG
#define CSS_PROP_SVG(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_SVG
#endif
# 286 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_SVGRESET
#define CSS_PROP_SVGRESET(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_SVGRESET
#endif
# 290 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_VARIABLES
#define CSS_PROP_VARIABLES(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_VARIABLES
#endif
# 294 "../../dist/include/nsCSSPropList.h"

#ifndef CSS_PROP_BACKENDONLY
#define CSS_PROP_BACKENDONLY(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_) /* nothing */
#define DEFINED_CSS_PROP_BACKENDONLY
#endif
# 299 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_LOGICAL
#define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, group_, struct_, stylestructoffset_, animtype_) /* nothing */
#define DEFINED_CSS_PROP_LOGICAL
#endif
# 303 "../../dist/include/nsCSSPropList.h"

#endif /* !defined(CSS_PROP) */
# 305 "../../dist/include/nsCSSPropList.h"

/*************************************************************************/

// For notes XXX bug 3935 below, the names being parsed do not correspond
// to the constants used internally.  It would be nice to bring the
// constants into line sometime.

// The parser will refuse to parse properties marked with -x-.
// 'text-transform', 'letter-spacing', 'word-spacing' (when
// appropriate), 'line-height', 'float', 'vertical-align' (only if
// 'float' is 'none'), margin properties, padding properties, border
// properties, 'color', and background properties.  We also allow
// 'text-shadow' (see above) and 'box-shadow' (which is like the
// border properties).

CSS_PROP_DISPLAY(
    -moz-appearance,
    appearance,
    CSS_PROP_DOMPROP_PREFIXED(Appearance),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kAppearanceKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    -moz-outline-radius,
    _moz_outline_radius,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadius),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_OUTLINE(
    -moz-outline-radius-topleft,
    _moz_outline_radius_topLeft,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusTopleft),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_TopLeft)
CSS_PROP_OUTLINE(
    -moz-outline-radius-topright,
    _moz_outline_radius_topRight,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusTopright),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_TopRight)
CSS_PROP_OUTLINE(
    -moz-outline-radius-bottomright,
    _moz_outline_radius_bottomRight,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusBottomright),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_BottomRight)
CSS_PROP_OUTLINE(
    -moz-outline-radius-bottomleft,
    _moz_outline_radius_bottomLeft,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusBottomleft),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_BottomLeft)
CSS_PROP_TEXT(
    -moz-tab-size,
    _moz_tab_size,
    CSS_PROP_DOMPROP_PREFIXED(TabSize),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HI,
    nullptr,
    offsetof(nsStyleText, mTabSize),
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_FONT(
    -x-system-font,
    _x_system_font,
    CSS_PROP_DOMPROP_PREFIXED(SystemFont),
    CSS_PROPERTY_PARSE_INACCESSIBLE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_EXCLUDE_INTERNAL)
# 429 "../../dist/include/nsCSSPropList.h"
CSS_PROP_SHORTHAND(
    all,
    all,
    All,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.all-shorthand.enabled")
CSS_PROP_SHORTHAND(
    animation,
    animation,
    Animation,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_DISPLAY(
    animation-delay,
    animation_delay,
    AnimationDelay,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-direction,
    animation_direction,
    AnimationDirection,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kAnimationDirectionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-duration,
    animation_duration,
    AnimationDuration,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME | VARIANT_NONNEGATIVE_DIMENSION, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-fill-mode,
    animation_fill_mode,
    AnimationFillMode,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kAnimationFillModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-iteration-count,
    animation_iteration_count,
    AnimationIterationCount,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        // nonnegative per
        // http://lists.w3.org/Archives/Public/www-style/2011Mar/0355.html
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD | VARIANT_NUMBER, // used by list parsing
    kAnimationIterationCountKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-name,
    animation_name,
    AnimationName,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    // FIXME: The spec should say something about 'inherit' and 'initial'
    // not being allowed.
    VARIANT_NONE | VARIANT_IDENTIFIER_NO_INHERIT, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-play-state,
    animation_play_state,
    AnimationPlayState,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kAnimationPlayStateKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-timing-function,
    animation_timing_function,
    AnimationTimingFunction,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD | VARIANT_TIMING_FUNCTION, // used by list parsing
    kTransitionTimingFunctionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    background,
    background,
    Background,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BACKGROUND(
    background-attachment,
    background_attachment,
    BackgroundAttachment,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kBackgroundAttachmentKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-clip,
    background_clip,
    BackgroundClip,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kBackgroundOriginKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-color,
    background_color,
    BackgroundColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "",
    VARIANT_HC,
    nullptr,
    offsetof(nsStyleBackground, mBackgroundColor),
    eStyleAnimType_Color)
CSS_PROP_BACKGROUND(
    background-image,
    background_image,
    BackgroundImage,
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "layout.css.background-blend-mode.enabled",
    VARIANT_KEYWORD, // used by list parsing
    kBlendModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-origin,
    background_origin,
    BackgroundOrigin,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kBackgroundOriginKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-position,
    background_position,
    BackgroundPosition,
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    Size,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    border,
    border,
    Border,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_SHORTHAND(
    border-block-end,
    border_block_end,
    BorderBlockEnd,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled")
CSS_PROP_SHORTHAND(
    border-block-start,
    border_block_start,
    BorderBlockStart,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled")
CSS_PROP_LOGICAL(
    border-block-end-color,
    border_block_end_color,
    BorderBlockEndColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_HCK,
    kBorderColorKTable,
    BorderColor,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    border-block-end-style,
    border_block_end_style,
    BorderBlockEndStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_HK,
    kBorderStyleKTable,
    BorderStyle,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    border-block-end-width,
    border_block_end_width,
    BorderBlockEndWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    BorderWidth,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    border-bottom,
    border_bottom,
    BorderBottom,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-bottom-color,
    border_bottom_color,
    BorderBottomColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BORDER(
    -moz-border-bottom-colors,
    border_bottom_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderBottomColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-bottom-style,
    border_bottom_style,
    BorderBottomStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)  // on/off will need reflow
CSS_PROP_BORDER(
    border-bottom-width,
    border_bottom_width,
    BorderBottomWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TABLEBORDER(
    border-collapse,
    border_collapse,
    BorderCollapse,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBorderCollapseKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    border-color,
    border_color,
    BorderColor,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "")
CSS_PROP_SHORTHAND(
    border-image,
    border_image,
    BorderImage,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-image-source,
    border_image_source,
    BorderImageSource,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_START_IMAGE_LOADS,
    "",
    VARIANT_IMAGE | VARIANT_INHERIT,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-slice,
    border_image_slice,
    BorderImageSlice,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    kBorderImageSliceKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-width,
    border_image_width,
    BorderImageWidth,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-outset,
    border_image_outset,
    BorderImageOutset,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-repeat,
    border_image_repeat,
    BorderImageRepeat,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    kBorderImageRepeatKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    -moz-border-end,
    border_end,
    CSS_PROP_DOMPROP_PREFIXED(BorderEnd),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_LOGICAL(
    -moz-border-end-color,
    border_end_color,
    CSS_PROP_DOMPROP_PREFIXED(BorderEndColor),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    BorderColor,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    -moz-border-end-style,
    border_end_style,
    CSS_PROP_DOMPROP_PREFIXED(BorderEndStyle),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    BorderStyle,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    -moz-border-end-width,
    border_end_width,
    CSS_PROP_DOMPROP_PREFIXED(BorderEndWidth),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    BorderWidth,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    -moz-border-start,
    border_start,
    CSS_PROP_DOMPROP_PREFIXED(BorderStart),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_LOGICAL(
    -moz-border-start-color,
    border_start_color,
    CSS_PROP_DOMPROP_PREFIXED(BorderStartColor),
    border_left_color,
    BorderLeftColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BORDER(
    -moz-border-left-colors,
    border_left_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderLeftColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-left-style,
    border_left_style,
    BorderLeftStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-left-width,
    border_left_width,
    BorderLeftWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_SHORTHAND(
    border-right,
    border_right,
    BorderRight,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-right-color,
    border_right_color,
    BorderRightColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BORDER(
    -moz-border-right-colors,
    border_right_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderRightColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-right-style,
    border_right_style,
    BorderRightStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-right-width,
    border_right_width,
    BorderRightWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TABLEBORDER(
    border-spacing,
    border_spacing,
    BorderSpacing,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_SHORTHAND(
    border-style,
    border_style,
    BorderStyle,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")  // on/off will need reflow
CSS_PROP_SHORTHAND(
    border-top,
    border_top,
    BorderTop,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-top-color,
    border_top_color,
    BorderTopColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BORDER(
    -moz-border-top-colors,
    border_top_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderTopColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-top-style,
    border_top_style,
    BorderTopStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)  // on/off will need reflow
CSS_PROP_BORDER(
    border-top-width,
    border_top_width,
    BorderTopWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_SHORTHAND(
    border-width,
    border_width,
    BorderWidth,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "")
CSS_PROP_SHORTHAND(
    border-radius,
    border_radius,
    BorderRadius,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-top-left-radius,
    border_top_left_radius,
    BorderTopLeftRadius,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleBorder, mBorderRadius),
    eStyleAnimType_Corner_TopLeft)
CSS_PROP_BORDER(
    border-top-right-radius,
    border_top_right_radius,
    BorderTopRightRadius,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleBorder, mBorderRadius),
    eStyleAnimType_Corner_TopRight)
CSS_PROP_BORDER(
    border-bottom-right-radius,
    border_bottom_right_radius,
    BorderBottomRightRadius,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleBorder, mBorderRadius),
    eStyleAnimType_Corner_BottomLeft)
CSS_PROP_POSITION(
    bottom,
    bottom,
    Bottom,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mOffset),
    eStyleAnimType_Sides_Bottom)
CSS_PROP_BORDER(
    box-decoration-break,
    box_decoration_break,
    BoxDecorationBreak,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.box-decoration-break.enabled",
    VARIANT_HK,
    kBoxDecorationBreakKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    box-shadow,
    box_shadow,
    BoxShadow,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
        // NOTE: some components must be nonnegative
    "",
    0,
    kBoxShadowTypeKTable,
    offsetof(nsStyleBorder, mBoxShadow),
    eStyleAnimType_Shadow)
CSS_PROP_POSITION(
    box-sizing,
    box_sizing,
    BoxSizing,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBoxSizingKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TABLEBORDER(
    caption-side,
    caption_side,
    CaptionSide,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kCaptionSideKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    clear,
    clear,
    Clear,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kClearKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    clip,
    clip,
    Clip,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "",
    0,
    nullptr,
    offsetof(nsStylePosition, mClip),
    eStyleAnimType_Custom)
CSS_PROP_COLOR(
    color,
    color,
    Color,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "",
    VARIANT_HC,
    nullptr,
    offsetof(nsStyleColor, mColor),
    eStyleAnimType_Color)
CSS_PROP_SHORTHAND(
    -moz-columns,
    _moz_columns,
    CSS_PROP_DOMPROP_PREFIXED(Columns),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_COLUMN(
    -moz-column-count,
    _moz_column_count,
    CSS_PROP_DOMPROP_PREFIXED(ColumnCount),
    CSS_PROPERTY_PARSE_VALUE |
        // Need to reject 0 in addition to negatives.  If we accept 0, we
        // need to change NS_STYLE_COLUMN_COUNT_AUTO to something else.
        CSS_PROPERTY_VALUE_AT_LEAST_ONE,
    "",
    VARIANT_AHI,
    nullptr,
    offsetof(nsStyleColumn, mColumnCount),
    eStyleAnimType_Custom)
CSS_PROP_COLUMN(
    -moz-column-fill,
    _moz_column_fill,
    CSS_PROP_DOMPROP_PREFIXED(ColumnFill),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kColumnFillKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_COLUMN(
    -moz-column-width,
    _moz_column_width,
    CSS_PROP_DOMPROP_PREFIXED(ColumnWidth),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_AHL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleColumn, mColumnWidth),
    eStyleAnimType_Coord)
CSS_PROP_COLUMN(
    -moz-column-gap,
    _moz_column_gap,
    CSS_PROP_DOMPROP_PREFIXED(ColumnGap),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleColumn, mColumnGap),
    eStyleAnimType_Coord)
CSS_PROP_SHORTHAND(
    -moz-column-rule,
    _moz_column_rule,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRule),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_COLUMN(
    -moz-column-rule-color,
    _moz_column_rule_color,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRuleColor),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_COLUMN(
    -moz-column-rule-style,
    _moz_column_rule_style,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRuleStyle),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_COLUMN(
    -moz-column-rule-width,
    _moz_column_rule_width,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRuleWidth),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_CONTENT(
    content,
    content,
    Content,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_START_IMAGE_LOADS,
    "",
    0,
    kContentKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_TEXT(
    -moz-control-character-visibility,
    _moz_control_character_visibility,
    CSS_PROP_DOMPROP_PREFIXED(ControlCharacterVisibility),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kControlCharacterVisibilityKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif
# 1513 "../../dist/include/nsCSSPropList.h"
CSS_PROP_CONTENT(
    counter-increment,
    counter_increment,
    CounterIncrement,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 137285
CSS_PROP_CONTENT(
    counter-reset,
    counter_reset,
    CounterReset,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 137285
CSS_PROP_USERINTERFACE(
    cursor,
    cursor,
    Cursor,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_START_IMAGE_LOADS |
        CSS_PROPERTY_IMAGE_IS_IN_ARRAY_0,
    "",
    0,
    kCursorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
CSS_PROP_VISIBILITY(
    direction,
    direction,
    Direction,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kDirectionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND)
# 1558 "../../dist/include/nsCSSPropList.h"
CSS_PROP_DISPLAY(
    display,
    display,
    Display,
    CSS_PROPERTY_PARSE_VALUE |
        // This is allowed because we need to make the placeholder
        // pseudo-element an inline-block in the UA stylesheet. It is a block
        // by default.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kDisplayKTable,
    offsetof(nsStyleDisplay, mDisplay),
    eStyleAnimType_EnumU8)
CSS_PROP_TABLEBORDER(
    empty-cells,
    empty_cells,
    EmptyCells,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kEmptyCellsKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    align-content,
    align_content,
    AlignContent,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kAlignContentKTable,
    offsetof(nsStylePosition, mAlignContent),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    align-items,
    align_items,
    AlignItems,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kAlignItemsKTable,
    offsetof(nsStylePosition, mAlignItems),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    align-self,
    flex_basis,
    FlexBasis,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC,
    "",
    // NOTE: The parsing implementation for the 'flex' shorthand property has
    // its own code to parse each subproperty. It does not depend on the
    // longhand parsing defined here.
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    offsetof(nsStylePosition, mFlexBasis),
    eStyleAnimType_Coord)
CSS_PROP_POSITION(
    flex-direction,
    flex_direction,
    FlexGrow,
    CSS_PROPERTY_PARSE_VALUE |
      CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    // NOTE: The parsing implementation for the 'flex' shorthand property has
    // its own code to parse each subproperty. It does not depend on the
    // longhand parsing defined here.
    VARIANT_HN,
    nullptr,
    offsetof(nsStylePosition, mFlexGrow),
    eStyleAnimType_float)
CSS_PROP_POSITION(
    flex-shrink,
    flex_shrink,
    FlexShrink,
    CSS_PROPERTY_PARSE_VALUE |
      CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    // NOTE: The parsing implementation for the 'flex' shorthand property has
    // its own code to parse each subproperty. It does not depend on the
    // longhand parsing defined here.
    VARIANT_HN,
    nullptr,
    offsetof(nsStylePosition, mFlexShrink),
    eStyleAnimType_float)
CSS_PROP_POSITION(
    flex-wrap,
    flex_wrap,
    FlexWrap,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kFlexWrapKTable,
    offsetof(nsStylePosition, mFlexWrap),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    order,
    order,
    Order,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HI,
    nullptr,
    offsetof(nsStylePosition, mOrder),
    eStyleAnimType_Custom) // <integer>
CSS_PROP_POSITION(
    justify-content,
    justify_content,
    JustifyContent,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kJustifyContentKTable,
    offsetof(nsStylePosition, mJustifyContent),
    eStyleAnimType_EnumU8)
CSS_PROP_DISPLAY(
    float,
    float,
    CSS_PROP_PUBLIC_OR_PRIVATE(CssFloat, Float),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kFloatKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    -moz-float-edge,
    float_edge,
    CSS_PROP_DOMPROP_PREFIXED(FloatEdge),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kFloatEdgeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_SHORTHAND(
    font,
    font,
    Font,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_FONT(
    font-family,
    font_family,
    FontFamily,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-feature-settings,
    font_feature_settings,
    FontFeatureSettings,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-kerning,
    font_kerning,
    FontKerning,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kFontKerningKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-language-override,
    font_language_override,
    FontLanguageOverride,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_NORMAL | VARIANT_INHERIT | VARIANT_STRING,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-size,
    font_size,
    FontSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "",
    VARIANT_HKLP | VARIANT_SYSFONT | VARIANT_CALC,
    kFontSizeKTable,
    // Note that mSize is the correct place for *reading* the computed value,
    // but setting it requires setting mFont.size as well.
    offsetof(nsStyleFont, mSize),
    eStyleAnimType_nscoord)
CSS_PROP_FONT(
    font-size-adjust,
    font_size_adjust,
    FontSizeAdjust,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HON | VARIANT_SYSFONT,
    nullptr,
    offsetof(nsStyleFont, mFont.sizeAdjust),
    eStyleAnimType_float)
CSS_PROP_FONT(
    -moz-osx-font-smoothing,
    osx_font_smoothing,
    CSS_PROP_DOMPROP_PREFIXED(OsxFontSmoothing),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "layout.css.osx-font-smoothing.enabled",
    VARIANT_HK,
    kFontSmoothingKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-stretch,
    font_stretch,
    FontStretch,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    font-variant,
    font_variant,
    FontVariant,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_FONT(
    font-variant-alternates,
    font_variant_alternates,
    FontVariantAlternates,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontVariantAlternatesKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-variant-caps,
    font_variant_caps,
    FontVariantCaps,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HMK,
    kFontVariantCapsKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-variant-east-asian,
    font_variant_east_asian,
    FontVariantEastAsian,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontVariantEastAsianKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-variant-ligatures,
    font_variant_ligatures,
    FontVariantLigatures,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontVariantLigaturesKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-variant-numeric,
    font_variant_numeric,
    FontVariantNumeric,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontVariantNumericKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-variant-position,
    font_variant_position,
    FontVariantPosition,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HMK,
    kFontVariantPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-weight,
    font_weight,
    FontWeight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
        // NOTE: This property has range restrictions on interpolation!
    "",
    0,
    kFontWeightKTable,
    offsetof(nsStyleFont, mFont.weight),
    eStyleAnimType_Custom)
CSS_PROP_UIRESET(
    -moz-force-broken-image-icon,
    force_broken_image_icon,
    CSS_PROP_DOMPROP_PREFIXED(ForceBrokenImageIcon),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HI,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // bug 58646
CSS_PROP_POSITION(
    grid-auto-flow,
    grid_auto_flow,
    GridAutoFlow,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    kGridAutoFlowKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-auto-columns,
    grid_auto_columns,
    GridAutoColumns,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-auto-rows,
    grid_auto_rows,
    GridAutoRows,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-template-areas,
    grid_template_areas,
    GridTemplateAreas,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-template-columns,
    grid_template_columns,
    GridTemplateColumns,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-template-rows,
    grid_template_rows,
    GridTemplateRows,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    grid-template,
    grid_template,
    GridTemplate,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_SHORTHAND(
    grid,
    grid,
    Grid,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_POSITION(
    grid-column-start,
    grid_column_start,
    GridColumnStart,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-column-end,
    grid_column_end,
    GridColumnEnd,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-row-start,
    grid_row_start,
    GridRowStart,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-row-end,
    grid_row_end,
    GridRowEnd,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    grid-column,
    grid_column,
    GridColumn,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_SHORTHAND(
    grid-row,
    grid_row,
    GridRow,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_SHORTHAND(
    grid-area,
    grid_area,
    GridArea,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_POSITION(
    height,
    height,
    Height,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mHeight),
    eStyleAnimType_Coord)
CSS_PROP_VISIBILITY(
    image-orientation,
    image_orientation,
    ImageOrientation,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "layout.css.image-orientation.enabled",
    0,
    kImageOrientationKTable,
    offsetof(nsStyleVisibility, mImageOrientation),
    eStyleAnimType_None)
CSS_PROP_LIST(
    -moz-image-region,
    image_region,
    CSS_PROP_DOMPROP_PREFIXED(ImageRegion),
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    offsetof(nsStyleList, mImageRegion),
    eStyleAnimType_Custom)
CSS_PROP_UIRESET(
    ime-mode,
    ime_mode,
    ImeMode,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kIMEModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    inline-size,
    inline_size,
    InlineSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    Size,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    left,
    left,
    Left,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mOffset),
    eStyleAnimType_Sides_Left)
CSS_PROP_TEXT(
    letter-spacing,
    letter_spacing,
    LetterSpacing,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "",
    VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleText, mLetterSpacing),
    eStyleAnimType_Coord)
CSS_PROP_TEXT(
    line-height,
    line_height,
    LineHeight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLPN | VARIANT_KEYWORD | VARIANT_NORMAL | VARIANT_SYSFONT,
    kLineHeightKTable,
    offsetof(nsStyleText, mLineHeight),
    eStyleAnimType_Coord)
CSS_PROP_SHORTHAND(
    list-style,
    list_style,
    ListStyle,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_LIST(
    list-style-image,
    list_style_image,
    ListStyleImage,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_START_IMAGE_LOADS,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LIST(
    list-style-position,
    list_style_position,
    ListStylePosition,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kListStylePositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LIST(
    list-style-type,
    list_style_type,
    ListStyleType,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    margin,
    margin,
    Margin,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE,
    "")
CSS_PROP_LOGICAL(
    margin-block-end,
    margin_block_end,
    MarginBlockEnd,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Margin,
    Margin,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    margin-block-start,
    margin_block_start,
    MarginBlockStart,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Margin,
    Margin,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_MARGIN(
    margin-bottom,
    margin_bottom,
    MarginBottom,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleMargin, mMargin),
    eStyleAnimType_Sides_Bottom)
CSS_PROP_LOGICAL(
    -moz-margin-end,
    margin_end,
    CSS_PROP_DOMPROP_PREFIXED(MarginEnd),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Margin,
    Margin,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_MARGIN(
    margin-left,
    margin_left,
    MarginLeft,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleMargin, mMargin),
    eStyleAnimType_Sides_Left)
CSS_PROP_MARGIN(
    margin-right,
    margin_right,
    MarginRight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleMargin, mMargin),
    eStyleAnimType_Sides_Right)
CSS_PROP_MARGIN(
    margin-top,
    margin_top,
    MarginTop,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleMargin, mMargin),
    eStyleAnimType_Sides_Top)
CSS_PROP_CONTENT(
    marker-offset,
    marker_offset,
    MarkerOffset,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_AHL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleContent, mMarkerOffset),
    eStyleAnimType_Coord)
CSS_PROP_BACKENDONLY(
    marks,
    marks,
    Marks,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "",
    0,
    kPageMarksKTable)
CSS_PROP_LOGICAL(
    max-block-size,
    max_block_size,
    MaxBlockSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HKLPO | VARIANT_CALC,
    kWidthKTable,
    MaxSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    max-height,
    max_height,
    MaxHeight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLPO | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mMaxHeight),
    eStyleAnimType_Coord)
CSS_PROP_LOGICAL(
    max-inline-size,
    max_inline_size,
    MaxInlineSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HKLPO | VARIANT_CALC,
    kWidthKTable,
    MaxSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    max-width,
    max_width,
    MaxWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HKLPO | VARIANT_CALC,
    kWidthKTable,
    offsetof(nsStylePosition, mMaxWidth),
    eStyleAnimType_Coord)
CSS_PROP_POSITION(
    min-height,
    min_height,
    MinHeight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mMinHeight),
    eStyleAnimType_Coord)
CSS_PROP_LOGICAL(
    min-block-size,
    min_block_size,
    MinBlockSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    MinSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    min-inline-size,
    min_inline_size,
    MinInlineSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    MinSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    min-width,
    min_width,
    MinWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    offsetof(nsStylePosition, mMinWidth),
    eStyleAnimType_Coord)
CSS_PROP_DISPLAY(
    mix-blend-mode,
    mix_blend_mode,
    MixBlendMode,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "layout.css.mix-blend-mode.enabled",
    VARIANT_HK,
    kBlendModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    isolation,
    isolation,
    Isolation,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "layout.css.isolation.enabled",
    VARIANT_HK,
    kIsolationKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    object-fit,
    object_fit,
    ObjectFit,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.object-fit-and-position.enabled",
    VARIANT_HK,
    kObjectFitKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    object-position,
    object_position,
    ObjectPosition,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.object-fit-and-position.enabled",
    0,
    kBackgroundPositionKTable,
    offsetof(nsStylePosition, mObjectPosition),
    eStyleAnimType_Custom)
CSS_PROP_LOGICAL(
    offset-block-end,
    offset_block_end,
    OffsetBlockEnd,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Offset,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    offset-block-start,
    offset_block_start,
    OffsetBlockStart,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Offset,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    opacity,
    opacity,
    Opacity,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HN,
    nullptr,
    offsetof(nsStyleDisplay, mOpacity),
    eStyleAnimType_float)
CSS_PROP_DISPLAY(
    -moz-orient,
    orient,
    CSS_PROP_DOMPROP_PREFIXED(Orient),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kOrientKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKENDONLY(
    orphans,
    orphans,
    Orphans,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_AT_LEAST_ONE,
    "",
    VARIANT_HI,
    nullptr)
CSS_PROP_SHORTHAND(
    outline,
    outline,
    Outline,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_OUTLINE(
    outline-color,
    outline_color,
    OutlineColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kOutlineColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_OUTLINE(
    outline-style,
    outline_style,
    OutlineStyle,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kOutlineStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_OUTLINE(
    outline-width,
    outline_width,
    OutlineWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    offsetof(nsStyleOutline, mOutlineWidth),
    eStyleAnimType_Coord)
CSS_PROP_OUTLINE(
    outline-offset,
    outline_offset,
    OutlineOffset,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleOutline, mOutlineOffset),
    eStyleAnimType_nscoord)
CSS_PROP_SHORTHAND(
    overflow,
    overflow,
    Overflow,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_DISPLAY(
    overflow-clip-box,
    overflow_clip_box,
    OverflowClipBox,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "layout.css.overflow-clip-box.enabled",
    VARIANT_HK,
    kOverflowClipBoxKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    overflow-x,
    overflow_x,
    OverflowX,
    CSS_PROPERTY_PARSE_VALUE |
        // This is required by the UA stylesheet and can't be overridden.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kOverflowSubKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    overflow-y,
    overflow_y,
    OverflowY,
    CSS_PROPERTY_PARSE_VALUE |
        // This is required by the UA stylesheet and can't be overridden.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kOverflowSubKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    padding,
    padding,
    Padding,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "")
CSS_PROP_LOGICAL(
    padding-block-end,
    padding_block_end,
    PaddingBlockEnd,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        // This is required by the UA stylesheet and can't be overridden.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        // This is required by the UA stylesheet and can't be overridden.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HLP | VARIANT_CALC,
    nullptr,
    Padding,
    Padding,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_PADDING(
    padding-bottom,
    padding_bottom,
    PaddingBottom,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kPointerEventsKTable,
    offsetof(nsStyleVisibility, mPointerEvents),
    eStyleAnimType_EnumU8)
CSS_PROP_DISPLAY(
    position,
    position,
    Position,
    CSS_PROPERTY_PARSE_VALUE |
        // For position: sticky
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_HK,
    kPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_QUOTES(
    quotes,
    quotes,
    Quotes,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    resize,
    resize,
    Resize,
    CSS_PROPERTY_PARSE_VALUE |
        // This is allowed because the UA stylesheet sets 'resize: both;' on
        // textarea and we need to disable this for the placeholder
        // pseudo-element.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kResizeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    right,
    right,
    Right,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mOffset),
    eStyleAnimType_Sides_Right)
CSS_PROP_TEXT(
    ruby-align,
    ruby_align,
    RubyAlign,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.ruby.enabled",
    VARIANT_HK,
    kRubyAlignKTable,
    offsetof(nsStyleText, mRubyAlign),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXT(
    ruby-position,
    ruby_position,
    RubyPosition,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.ruby.enabled",
    VARIANT_HK,
    kRubyPositionKTable,
    offsetof(nsStyleText, mRubyPosition),
    eStyleAnimType_EnumU8)
CSS_PROP_DISPLAY(
    scroll-behavior,
    scroll_behavior,
    ScrollBehavior,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.scroll-behavior.property-enabled",
    VARIANT_HK,
    kScrollBehaviorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-type-x,
    scroll_snap_type_x,
    ScrollSnapTypeX,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.scroll-snap.enabled",
    VARIANT_HK,
    kScrollSnapTypeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-type-y,
    scroll_snap_type_y,
    ScrollSnapTypeY,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.scroll-snap.enabled",
    VARIANT_HK,
    kScrollSnapTypeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    scroll-snap-type,
    scroll_snap_type,
    ScrollSnapType,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.scroll-snap.enabled")
CSS_PROP_DISPLAY(
    scroll-snap-points-x,
    scroll_snap_points_x,
    ScrollSnapPointsX,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.scroll-snap.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-points-y,
    scroll_snap_points_y,
    ScrollSnapPointsY,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.scroll-snap.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-destination,
    scroll_snap_destination,
    ScrollSnapDestination,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.scroll-snap.enabled",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-coordinate,
    scroll_snap_coordinate,
    ScrollSnapCoordinate,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.scroll-snap.enabled",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKENDONLY(
    size,
    size,
    Size,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    kPageSizeKTable)
CSS_PROP_TABLE(
    table-layout,
    table_layout,
    TableLayout,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kTableLayoutKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    text-align,
    text_align,
    TextAlign,
    CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_VALUE_PARSER_FUNCTION |
      CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    // When we support aligning on a string, we can parse text-align
    // as a string....
    VARIANT_HK /* | VARIANT_STRING */,
    kTextAlignKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    -moz-text-align-last,
    text_align_last,
    CSS_PROP_DOMPROP_PREFIXED(TextAlignLast),
    CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "",
    VARIANT_HK,
    kTextAlignLastKTable,
    offsetof(nsStyleText, mTextAlignLast),
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    text-decoration,
    text_decoration,
    TextDecoration,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_TEXT(
    text-combine-upright,
    text_combine_upright,
    TextCombineUpright,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled",
    0,
    kTextCombineUprightKTable,
    offsetof(nsStyleText, mTextCombineUpright),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXTRESET(
    text-decoration-color,
    text_decoration_color,
    TextDecorationColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TEXTRESET(
    text-decoration-line,
    text_decoration_line,
    TextDecorationLine,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kTextDecorationLineKTable,
    offsetof(nsStyleTextReset, mTextDecorationLine),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXTRESET(
    text-decoration-style,
    text_decoration_style,
    TextDecorationStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kTextDecorationStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TEXT(
    text-indent,
    text_indent,
    TextIndent,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleText, mTextIndent),
    eStyleAnimType_Coord)
CSS_PROP_VISIBILITY(
    text-orientation,
    text_orientation,
    TextOrientation,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled",
    VARIANT_HK,
    kTextOrientationKTable,
    offsetof(nsStyleVisibility, mTextOrientation),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXTRESET(
    text-overflow,
    text_overflow,
    TextOverflow,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kTextOverflowKTable,
    offsetof(nsStyleTextReset, mTextOverflow),
    eStyleAnimType_None)
CSS_PROP_TEXT(
    text-shadow,
    text_shadow,
    TextShadow,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
        // NOTE: some components must be nonnegative
    "",
    0,
    nullptr,
    offsetof(nsStyleText, mTextShadow),
    eStyleAnimType_Shadow)
CSS_PROP_TEXT(
    -moz-text-size-adjust,
    text_size_adjust,
    CSS_PROP_DOMPROP_PREFIXED(TextSizeAdjust),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_AUTO | VARIANT_NONE | VARIANT_INHERIT,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    text-transform,
    text_transform,
    TextTransform,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kTextTransformKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    transform,
    transform,
    Transform,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    0,
    nullptr,
    offsetof(nsStylePosition, mSpecifiedTransform),
    eStyleAnimType_Custom)
CSS_PROP_POSITION(
    transform-origin,
    transform_origin,
    TransformOrigin,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_POSITION(
    perspective-origin,
    perspective_origin,
    PerspectiveOrigin,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_POSITION(
    perspective,
    perspective,
    Perspective,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_NONE | VARIANT_INHERIT | VARIANT_LENGTH | VARIANT_POSITIVE_DIMENSION,
    nullptr,
    offsetof(nsStylePosition, mChildPerspective),
    eStyleAnimType_Coord)
CSS_PROP_POSITION(
    transform-style,
    transform_style,
    TransformStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_HK,
    kTransformStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    backface-visibility,
    backface_visibility,
    BackfaceVisibility,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBackfaceVisibilityKTable,
    offsetof(nsStylePosition, mBackfaceVisibility),
    eStyleAnimType_None)
CSS_PROP_POSITION(
    top,
    top,
    Top,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mOffset),
    eStyleAnimType_Sides_Top)
 CSS_PROP_DISPLAY(
    touch-action,
    touch_action,
    TouchAction,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "layout.css.touch_action.enabled",
    VARIANT_HK,
    kTouchActionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    transition,
    transition,
    Transition,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_DISPLAY(
    transition-delay,
    transition_delay,
    TransitionDelay,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    transition-duration,
    transition_duration,
    TransitionDuration,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME | VARIANT_NONNEGATIVE_DIMENSION, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    transition-property,
    transition_property,
    TransitionProperty,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_IDENTIFIER | VARIANT_NONE | VARIANT_ALL, // used only in shorthand
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    transition-timing-function,
    transition_timing_function,
    TransitionTimingFunction,
    CSS_PROPERTY_PARSE_VALUE_LIST |
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBoxOrientKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_XUL(
    -moz-box-pack,
    box_pack,
    CSS_PROP_DOMPROP_PREFIXED(BoxPack),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBoxPackKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_XUL(
    -moz-box-ordinal-group,
    box_ordinal_group,
    CSS_PROP_DOMPROP_PREFIXED(BoxOrdinalGroup),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HI,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_XUL(
    -moz-stack-sizing,
    stack_sizing,
    CSS_PROP_DOMPROP_PREFIXED(StackSizing),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kStackSizingKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)

#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_FONT(
    -moz-script-size-multiplier,
    script_size_multiplier,
    ScriptSizeMultiplier,
    // REVIEW: no range restriction?
    // NOTE: CSSParserImpl::ParseSingleValueProperty only accepts this
    // property when mUnsafeRulesEnabled is set.
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kMathDisplayKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_EXCLUDE_INTERNAL)
# 3786 "../../dist/include/nsCSSPropList.h"
#endif // !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND)
# 3787 "../../dist/include/nsCSSPropList.h"

CSS_PROP_SVGRESET(
    clip-path,
    clip_path,
    ClipPath,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    clip-rule,
    clip_rule,
    ClipRule,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kFillRuleKTable,
    offsetof(nsStyleSVG, mClipRule),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    color-interpolation,
    color_interpolation,
    ColorInterpolation,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kColorInterpolationKTable,
    offsetof(nsStyleSVG, mColorInterpolation),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    color-interpolation-filters,
    color_interpolation_filters,
    ColorInterpolationFilters,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kColorInterpolationKTable,
    offsetof(nsStyleSVG, mColorInterpolationFilters),
    eStyleAnimType_EnumU8)
CSS_PROP_SVGRESET(
    dominant-baseline,
    dominant_baseline,
    DominantBaseline,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kDominantBaselineKTable,
    offsetof(nsStyleSVGReset, mDominantBaseline),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    fill,
    fill,
    Fill,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    kContextPatternKTable,
    offsetof(nsStyleSVG, mFill),
    eStyleAnimType_PaintServer)
CSS_PROP_SVG(
    fill-opacity,
    fill_opacity,
    FillOpacity,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HN | VARIANT_OPENTYPE_SVG_KEYWORD,
    nullptr,
    offsetof(nsStyleSVGReset, mLightingColor),
    eStyleAnimType_Color)
CSS_PROP_SHORTHAND(
    marker,
    marker,
    Marker,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_SVG(
    marker-end,
    marker_end,
    MarkerEnd,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    marker-mid,
    marker_mid,
    MarkerMid,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    marker-start,
    marker_start,
    MarkerStart,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVGRESET(
    mask,
    mask,
    Mask,
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_NUMBERS_ARE_PIXELS,
        // NOTE: Internal values have range restrictions.
    "",
    0,
    kStrokeContextValueKTable,
    CSS_PROP_NO_OFFSET, /* property stored in 2 separate members */
    eStyleAnimType_Custom)
CSS_PROP_SVG(
    stroke-dashoffset,
    stroke_dashoffset,
    StrokeDashoffset,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_NUMBERS_ARE_PIXELS,
    "",
    VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
    kStrokeContextValueKTable,
    offsetof(nsStyleSVG, mStrokeDashoffset),
    eStyleAnimType_Coord)
CSS_PROP_SVG(
    stroke-linecap,
    stroke_linecap,
    StrokeLinecap,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kStrokeLinecapKTable,
    offsetof(nsStyleSVG, mStrokeLinecap),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    stroke-linejoin,
    stroke_width,
    StrokeWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_NUMBERS_ARE_PIXELS,
    "",
    VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
    kStrokeContextValueKTable,
    offsetof(nsStyleSVG, mStrokeWidth),
    eStyleAnimType_Coord)
CSS_PROP_SVG(
    text-anchor,
    text_anchor,
    TextAnchor,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kTextAnchorKTable,
    offsetof(nsStyleSVG, mTextAnchor),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    text-rendering,
    text_rendering,
    TextRendering,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kTextRenderingKTable,
    offsetof(nsStyleSVG, mTextRendering),
    eStyleAnimType_EnumU8)
CSS_PROP_SVGRESET(
    vector-effect,
    vector_effect,
    VectorEffect,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kVectorEffectKTable,
    offsetof(nsStyleSVGReset, mVectorEffect),
    eStyleAnimType_EnumU8)

CSS_PROP_POSITION(
    will-change,
    will_change,
    WillChange,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_CHROME_OR_CERTIFIED_APP,
    "layout.css.will-change.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)

// The shorthands below are essentially aliases, but they require different
// parsing rules, and are therefore implemented as shorthands.
CSS_PROP_SHORTHAND(
    -moz-transform,
    _moz_transform,
    MozTransform,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_IS_ALIAS,
    "layout.css.prefixes.transforms")

#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
// We have a few properties that are in style structs but are not stored
// in style sheets (or nsCSS* structs).  Some fields in these property
// definitions are bogus (e.g., they work for nsRuleData* offsets but
// not nsCSS* offsets).  Callers that care about these bogus fields can
// define CSS_PROP_STUB_NOT_CSS to define a replacement for these
// entries.
#ifdef CSS_PROP_STUB_NOT_CSS
CSS_PROP_STUB_NOT_CSS
CSS_PROP_STUB_NOT_CSS
#else
# 4160 "../../dist/include/nsCSSPropList.h"
CSS_PROP_FONT(
    -x-lang,
    _x_lang,
    Lang,
    CSS_PROPERTY_PARSE_INACCESSIBLE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TABLE(
    -x-span,
    _x_span,
    Span,
    CSS_PROPERTY_PARSE_INACCESSIBLE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    -x-text-zoom,
    _x_text_zoom,
    TextZoom,
    CSS_PROPERTY_PARSE_INACCESSIBLE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif /* !defined(CSS_PROP_STUB_NOT_CSS) */
# 4191 "../../dist/include/nsCSSPropList.h"
#endif /* !defined(CSS_PROP_LIST_EXCLUDE_INTERNAL) */
# 4192 "../../dist/include/nsCSSPropList.h"
#endif /* !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND) */
# 4193 "../../dist/include/nsCSSPropList.h"

#ifdef USED_CSS_PROP

#undef USED_CSS_PROP
#undef CSS_PROP_FONT
#undef CSS_PROP_COLOR
#undef CSS_PROP_BACKGROUND
#undef CSS_PROP_LIST
#undef CSS_PROP_POSITION
#undef CSS_PROP_TEXT
#undef CSS_PROP_TEXTRESET
#undef CSS_PROP_DISPLAY
#undef CSS_PROP_VISIBILITY
#undef CSS_PROP_CONTENT
#undef CSS_PROP_QUOTES
#undef CSS_PROP_USERINTERFACE
#undef CSS_PROP_UIRESET
#undef CSS_PROP_TABLE
#undef CSS_PROP_TABLEBORDER
#undef CSS_PROP_MARGIN
#undef CSS_PROP_PADDING
#undef CSS_PROP_BORDER
#undef CSS_PROP_OUTLINE
#undef CSS_PROP_XUL
#undef CSS_PROP_COLUMN
#ifdef DEFINED_CSS_PROP_SVGRESET
#undef CSS_PROP_SVGRESET
#undef DEFINED_CSS_PROP_SVGRESET
#endif
# 4320 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_VARIABLES
#undef CSS_PROP_VARIABLES
#undef DEFINED_CSS_PROP_VARIABLES
#endif
# 4324 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_BACKENDONLY
#undef CSS_PROP_BACKENDONLY
#undef DEFINED_CSS_PROP_BACKENDONLY
#endif
# 4328 "../../dist/include/nsCSSPropList.h"

#endif /* !defined(USED_CSS_PROP) */
# 4330 "../../dist/include/nsCSSPropList.h"

#ifdef DEFINED_CSS_PROP_SHORTHAND
#undef CSS_PROP_SHORTHAND
#undef DEFINED_CSS_PROP_SHORTHAND
#endif
# 4335 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_LOGICAL
#undef CSS_PROP_LOGICAL
#undef DEFINED_CSS_PROP_LOGICAL
#endif
# 4339 "../../dist/include/nsCSSPropList.h"

#undef CSS_PROP_DOMPROP_PREFIXED
# 36 "../../dist/include/nsCSSProperty.h" 2
  #undef CSS_PROP_SHORTHAND

  eCSSProperty_COUNT,
  // Make the count continue where it left off:
  eCSSProperty_COUNT_DUMMY2 = eCSSProperty_COUNT - 1,

  #define CSS_PROP_ALIAS(aliasname_, id_, method_, pref_) \
    eCSSPropertyAlias_##method_,
  #if 0 /* expanded by -frewrite-includes */
#include "nsCSSPropAliasList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSPropAliasList.h" 1
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * a list of all CSS property aliases with data about them, for preprocessing
 */

/******

  -. 'method' is the CSS2Properties property name.  Unlike
  nsCSSPropList.h, prefixes should just be included in this file (rather
  than needing the CSS_PROP_DOMPROP_PREFIXED(prop) macro).

  -. 'pref' is the name of a pref that controls whether the property
  is enabled.  The property is enabled if 'pref' is an empty string,
  or if the boolean property whose name is 'pref' is set to true.

 ******/

CSS_PROP_ALIAS(-moz-transform-origin,
               transform_origin,
               MozTransformOrigin,
               "layout.css.prefixes.transforms")
CSS_PROP_ALIAS(-moz-perspective-origin,
               border_start_width,
               BorderInlineStartWidth,
               "layout.css.vertical-text.enabled")
# 45 "../../dist/include/nsCSSProperty.h" 2
  #undef CSS_PROP_ALIAS

  eCSSProperty_COUNT_with_aliases,
  // Make the count continue where it left off:
  eCSSProperty_COUNT_DUMMY3 = eCSSProperty_COUNT_with_aliases - 1,

  // Some of the values below could probably overlap with each other
  // if we had a need for them to do so.

  // Extra values for use in the values of the 'transition-property'
  // property.
  eCSSPropertyExtra_no_properties,
  eCSSPropertyExtra_all_properties,

  // Extra dummy values for nsCSSParser internal use.
  eCSSPropertyExtra_x_none_value,
  eCSSPropertyExtra_x_auto_value,

  // Extra value to represent custom properties (--*).
  eCSSPropertyExtra_variable
};

// The "descriptors" that can appear in a @font-face rule.
// They have the syntax of properties but different value rules.
enum nsCSSFontDesc {
  eCSSFontDesc_UNKNOWN = -1,
#define CSS_FONT_DESC(name_, method_) eCSSFontDesc_##method_,
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSFontDescList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSFontDescList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

CSS_FONT_DESC(font-family, Family)
CSS_FONT_DESC(font-style, Style)
CSS_FONT_DESC(font-weight, Weight)
CSS_FONT_DESC(font-stretch, Stretch)
CSS_FONT_DESC(src, Src)
CSS_FONT_DESC(unicode-range, UnicodeRange)
CSS_FONT_DESC(font-feature-settings, FontFeatureSettings)
CSS_FONT_DESC(font-language-override, FontLanguageOverride)
# 73 "../../dist/include/nsCSSProperty.h" 2
#undef CSS_FONT_DESC
  eCSSFontDesc_COUNT
};

// The "descriptors" that can appear in a @counter-style rule.
// They have the syntax of properties but different value rules.
enum nsCSSCounterDesc {
  eCSSCounterDesc_UNKNOWN = -1,
#define CSS_COUNTER_DESC(name_, method_) eCSSCounterDesc_##method_,
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSCounterDescList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSCounterDescList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

CSS_COUNTER_DESC(system, System)
CSS_COUNTER_DESC(symbols, Symbols)
CSS_COUNTER_DESC(additive-symbols, AdditiveSymbols)
CSS_COUNTER_DESC(negative, Negative)
CSS_COUNTER_DESC(prefix, Prefix)
CSS_COUNTER_DESC(suffix, Suffix)
CSS_COUNTER_DESC(range, Range)
CSS_COUNTER_DESC(pad, Pad)
CSS_COUNTER_DESC(fallback, Fallback)
CSS_COUNTER_DESC(speak-as, SpeakAs)
# 83 "../../dist/include/nsCSSProperty.h" 2
#undef CSS_COUNTER_DESC
  eCSSCounterDesc_COUNT
};

enum nsCSSPropertyLogicalGroup {
  eCSSPropertyLogicalGroup_UNKNOWN = -1,
#define CSS_PROP_LOGICAL_GROUP_AXIS(name_) \
  eCSSPropertyLogicalGroup_##name_,
#define CSS_PROP_LOGICAL_GROUP_BOX(name_) \
  eCSSPropertyLogicalGroup_##name_,
#define CSS_PROP_LOGICAL_GROUP_SHORTHAND(name_) \
  eCSSPropertyLogicalGroup_##name_,
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSPropLogicalGroupList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSPropLogicalGroupList.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
//     that sets those four properties.  A table must be defined in
//     nsCSSProps.cpp named g<name_>LogicalGroupTable containing the
//     four physical properties in top/right/bottom/left order.
//
//   CSS_PROP_LOGICAL_GROUP_AXIS(name_)
//     Defines a logical property group whose corresponding physical
//     properties are a set of two axis-related properties.  For
//     example, the logical property group for {block,inline}-size
//     contains the width and height properties.  A table must be
//     defined in nCSSProps.cpp named g<name_>LogicalGroupTable
//     containing the two physical properties in vertical/horizontal
//     order, followed by an nsCSSProperty_UNKNOWN entry.

CSS_PROP_LOGICAL_GROUP_SHORTHAND(BorderColor)
CSS_PROP_LOGICAL_GROUP_SHORTHAND(BorderStyle)
CSS_PROP_LOGICAL_GROUP_SHORTHAND(BorderWidth)
CSS_PROP_LOGICAL_GROUP_SHORTHAND(Margin)
CSS_PROP_LOGICAL_GROUP_AXIS(MaxSize)
CSS_PROP_LOGICAL_GROUP_BOX(Offset)
CSS_PROP_LOGICAL_GROUP_SHORTHAND(Padding)
CSS_PROP_LOGICAL_GROUP_AXIS(MinSize)
CSS_PROP_LOGICAL_GROUP_AXIS(Size)
# 96 "../../dist/include/nsCSSProperty.h" 2
#undef CSS_PROP_LOGICAL_GROUP_SHORTHAND
#undef CSS_PROP_LOGICAL_GROUP_BOX
#undef CSS_PROP_LOGICAL_GROUP_AXIS
  eCSSPropertyLogicalGroup_COUNT
};

#endif /* nsCSSProperty_h___ */
# 103 "../../dist/include/nsCSSProperty.h"
# 1 "../../dist/include/nsRuleNode.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * a node in the lexicographic tree of rules that match an element,
 * responsible for converting the rules' information into computed style
 */

#ifndef nsRuleNode_h___
#define nsRuleNode_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsPresContext.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsRuleNode.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleStruct.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStruct.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

#ifndef nsStyleStruct_h___
#define nsStyleStruct_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsStyleStruct.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CSSVariableValues.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/CSSVariableValues.h" 1
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* computed CSS Variable values */

#ifndef mozilla_CSSVariableValues_h
#define mozilla_CSSVariableValues_h

#if 0 /* expanded by -frewrite-includes */
#include "nsCSSScanner.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsCSSScanner.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* tokenization of CSS style sheets */

#ifndef nsCSSScanner_h___
#define nsCSSScanner_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/layout/style/nsCSSScanner.h"

namespace mozilla {
namespace css {
class ErrorReporter;
}
}

// Token types; in close but not perfect correspondence to the token
// categorization in section 4.1.1 of CSS2.1.  (The deviations are all
// the fault of css3-selectors, which has requirements that can only be
// met by changing the generic tokenization.)  The comment on each line
// illustrates the form of each identifier.

enum nsCSSTokenType {
  // White space of any kind.  No value fields are used.  Note that
  // comments do *not* count as white space; comments separate tokens
  // but are not themselves tokens.
  eCSSToken_Whitespace,     //

  // Identifier-like tokens.  mIdent is the text of the identifier.
  // The difference between ID and Hash is: if the text after the #
  // would have been a valid Ident if the # hadn't been there, the
  // scanner produces an ID token.  Otherwise it produces a Hash token.
  // (This distinction is required by css3-selectors.)
  eCSSToken_Ident,          // word
  // token is semantically valid.  In that case, mInteger holds the
  // lowest value included in the range, and mInteger2 holds the
  // highest value included in the range.
  eCSSToken_URange,         // U+007e U+01?? U+2000-206F

  // HTML comment delimiters, ignored as a unit when they appear at
  // the top level of a style sheet, for compatibility with websites
  // written for compatibility with pre-CSS browsers.  This token type
  // subsumes the css2.1 CDO and CDC tokens, which are always treated
  // the same by the parser.  mIdent holds the text of the token, for
  // diagnostics.
  eCSSToken_HTMLComment,    // <!-- -->
};

// Classification of tokens used to determine if a "/**/" string must be
// inserted if pasting token streams together when serializing.  We include
// values corresponding to eCSSToken_Dashmatch and eCSSToken_Containsmatch,
// as css-syntax does not treat these as whole tokens, but we will still
// need to insert a "/**/" string between a '|' delim and a '|=' dashmatch
// and between a '/' delim and a '*=' containsmatch.
//
// https://dvcs.w3.org/hg/csswg/raw-file/372e659027a0/css-syntax/Overview.html#serialization
enum nsCSSTokenSerializationType {
  eCSSTokenSerialization_Nothing,
  eCSSTokenSerialization_Whitespace,
  eCSSTokenSerialization_AtKeyword_or_Hash,
  eCSSTokenSerialization_Number,
  eCSSTokenSerialization_Dimension,
  eCSSTokenSerialization_Percentage,
  eCSSTokenSerialization_URange,
  eCSSTokenSerialization_URL_or_BadURL,
  eCSSTokenSerialization_Function,
};

// A single token returned from the scanner.  mType is always
// meaningful; comments above describe which other fields are
// meaningful for which token types.
struct nsCSSToken {
  nsAutoString    mIdent;
  float           mNumber;
  int32_t         mInteger;
  int32_t         mInteger2;
  nsCSSTokenType  mType;
  char16_t       mSymbol;
  bool            mIntegerValid;
  bool            mHasSign;
  bool mSVGMode;
  bool mRecording;
  // Get the next token.  Return false on EOF.
  // aTokenResult is filled in with the data for the token.
  ;

private:
  const char16_t *mBuffer;
  uint32_t mOffset;
  uint32_t mCount;
};

#endif /* nsCSSScanner_h___ */
# 379 "/Users/luser/build/mozilla-central/layout/style/nsCSSScanner.h"
# 12 "../../dist/include/mozilla/CSSVariableValues.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsDataHashtable.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/CSSVariableValues.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/CSSVariableValues.h"

namespace mozilla {

class CSSVariableResolver;

class CSSVariableValues
{
public:
  ;
  ;
#ifdef DEBUG
  ~CSSVariableValues();
#endif
# 27 "../../dist/include/mozilla/CSSVariableValues.h"
  ;

  ;
  

  /**
   * Gets the value of a variable in this set of computed variables.
   *
   * @param aName The variable name (not including any "--" prefix that would
   *   be part of the custom property name).
   * @param aValue Out parameter into which the value of the variable will
   *   be stored.
   * @return Whether a variable with the given name was found.  When false
   *   is returned, aValue, aFirstToken and aLastToken will not be modified.
   */
  ;

  /**
   * Gets the name of the variable at the given index.
   *
   */
  ;

private:
  struct Variable
  {
    

    

    nsString mVariableName;
    nsString mValue;
    nsCSSTokenSerializationType mFirstToken;
    nsCSSTokenSerializationType mLastToken;
  };

  /**
   * Adds all the variables from aOther into this object.
   */
  ;

  /**
   * Map of variable names to IDs.  Variable IDs are indexes into
   * mVariables.
   */
  nsDataHashtable<nsStringHashKey, size_t> mVariableIDs;

  /**
   * Array of variables, indexed by variable ID.
   */
  nsTArray<Variable> mVariables;
};

} // namespace mozilla

#endif
# 148 "../../dist/include/mozilla/CSSVariableValues.h"
# 16 "../../dist/include/nsStyleStruct.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsColor.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsStyleStruct.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleConsts.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsStyleStruct.h"
#ifndef nsCSSValue_h___
#define nsCSSValue_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsCSSValue.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsCSSValue.h"
# 1 "../../dist/include/nsCSSKeywords.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
//CSS_KEY(square, square)
//CSS_KEY(start, start)
CSS_KEY(srgb, srgb)
CSS_KEY(symbolic, symbolic)
CSS_KEY(symbols, symbols)
CSS_KEY(text-after-edge, text_after_edge)
CSS_KEY(text-before-edge, text_before_edge)
CSS_KEY(use-script, use_script)
CSS_KEY(-moz-crisp-edges, _moz_crisp_edges)
# 24 "../../dist/include/nsCSSKeywords.h" 2
  eCSSKeyword_COUNT
};
#endif /* nsCSSKeywords_h___ */
# 43 "../../dist/include/nsCSSKeywords.h"
# 18 "../../dist/include/nsCSSValue.h" 2
// Clones a linked list iteratively to avoid blowing up the stack.
// If it fails to clone the entire list then 'to_' is deleted and
// we return null.
#define NS_CSS_CLONE_LIST_MEMBER(type_, from_, member_, to_, args_)            \
  {                                                                            \
    type_ *dest = (to_);                                                       \
    (to_)->member_ = nullptr;                                                  \
    for (const type_ *src = (from_)->member_; src; src = src->member_) {       \
      type_ *clm_clone = src->Clone args_;                                     \
      if (!clm_clone) {                                                        \
        delete (to_);                                                          \
        return nullptr;                                                        \
      }                                                                        \
      dest->member_ = clm_clone;                                               \
      dest = clm_clone;                                                        \
    }                                                                          \
  }

namespace mozilla {
namespace css {

struct URLValue {
  // Methods are not inline because using an nsIPrincipal means requiring
  // caps, which leads to REQUIRES hell, since this header is included all
  // over.

  // For both constructors aString must not be null.
  // For both constructors aOriginPrincipal must not be null.
  // Construct with a base URI; this will create the actual URI lazily from
  // aString and aBaseURI.
  ;
  // Construct with the actual URI.
  ;

protected:
  ~URLValue();

public:
  ;

  // URIEquals only compares URIs and principals (unlike operator==, which
  // also compares the original strings).  URIEquals also assumes that the
  // mURI member of both URL objects is non-null.  Do NOT call this method
  // unless you're sure this is the case.
  ;
  NS_INLINE_DECL_REFCOUNTING(URLValue)

private:
  mutable bool mURIResolved;

  URLValue(const URLValue& aOther) = delete;
  URLValue& operator=(const URLValue& aOther) = delete;
};

struct ImageValue : public URLValue {
  // Not making the constructor and destructor inline because that would
  // force us to include imgIRequest.h, which leads to REQUIRES hell, since
  // this header is included all over.
  // aString must not be null.
  ImageValue(nsIURI* aURI, nsStringBuffer* aString, nsIURI* aReferrer,
             nsIPrincipal* aOriginPrincipal, nsIDocument* aDocument);
private:
  ~ImageValue();

public:
  // Inherit operator== from URLValue

  nsRefPtrHashtable<nsPtrHashKey<nsISupports>, imgRequestProxy> mRequests; 

  // Override AddRef and Release to not only log ourselves correctly, but
  // also so that we delete correctly without a virtual destructor
  NS_INLINE_DECL_REFCOUNTING(ImageValue)
};

struct GridNamedArea {
  nsString mName;
  uint32_t mColumnStart;
  uint32_t mColumnEnd;
  uint32_t mRowStart;
  uint32_t mRowEnd;
};

struct GridTemplateAreasValue MOZ_FINAL {
  // Parsed value
  nsTArray<GridNamedArea> mNamedAreas;

  // Original <string> values. Length gives the number of rows,
  // content makes serialization easier.
  nsTArray<nsString> mTemplates;

  // How many columns grid-template-areas contributes to the explicit grid.
  // http://dev.w3.org/csswg/css-grid/#explicit-grid
  uint32_t mNColumns;

  // How many rows grid-template-areas contributes to the explicit grid.
  // http://dev.w3.org/csswg/css-grid/#explicit-grid
  uint32_t NRows() const {
    return mTemplates.Length();
  }

  GridTemplateAreasValue()
    : mNColumns(0)
    // Default constructors for mNamedAreas and mTemplates: empty arrays.
  {
  }

  bool operator==(const GridTemplateAreasValue& aOther) const
  {
    return mTemplates == aOther.mTemplates;
  }

  GridTemplateAreasValue(const GridTemplateAreasValue& aOther) = delete;
  GridTemplateAreasValue&
  operator=(const GridTemplateAreasValue& aOther) = delete;
};

class FontFamilyListRefCnt MOZ_FINAL : public FontFamilyList {
public:
    

    

    

    

    NS_INLINE_DECL_REFCOUNTING(FontFamilyListRefCnt);

private:
    ~FontFamilyListRefCnt() {
        MOZ_COUNT_DTOR(FontFamilyListRefCnt);
    }
};

}
}

enum nsCSSUnit {
  eCSSUnit_Null         = 0,      // (n/a) null unit, value is not specified
  eCSSUnit_Auto         = 1,      // (n/a) value is algorithmic
  eCSSUnit_Inherit      = 2,      // (n/a) value is inherited
  eCSSUnit_Initial      = 3,      // (n/a) value is default UA value
  eCSSUnit_Unset        = 4,      // (n/a) value equivalent to 'initial' if on a reset property, 'inherit' otherwise
  eCSSUnit_None         = 5,      // (n/a) value is none
  eCSSUnit_Normal       = 6,      // (n/a) value is normal (algorithmic, different than auto)
  eCSSUnit_System_Font  = 7,      // (n/a) value is -moz-use-system-font
  eCSSUnit_All          = 8,      // (n/a) value is all
  eCSSUnit_Dummy        = 9,      // (n/a) a fake but specified value, used
                                  //       only in temporary values
  eCSSUnit_DummyInherit = 10,     // (n/a) a fake but specified value, used
                                  //       only in temporary values

  eCSSUnit_String       = 11,     // (char16_t*) a string value
  eCSSUnit_Ident        = 12,     // (char16_t*) a string value
  eCSSUnit_Calc_Divided = 35,     // (nsCSSValue::Array*) / within calc

  eCSSUnit_URL          = 40,     // (nsCSSValue::URL*) value
  eCSSUnit_Turn         = 1003,    // (float) 1 per circle

  // Frequency units
  eCSSUnit_Hertz        = 2000,    // (float) 1/seconds
  eCSSUnit_Kilohertz    = 2001,    // (float) 1000 Hertz

  // Time units
  eCSSUnit_Seconds      = 3000,    // (float) Standard time
  eCSSUnit_Milliseconds = 3001,    // (float) 1/1000 second

  // Flexible fraction (CSS Grid)
  eCSSUnit_FlexFraction = 4000     // (float) Fraction of free space
};

struct nsCSSValueGradient;
struct nsCSSValuePair;
struct nsCSSValuePair_heap;
struct nsCSSValueTokenStream;
struct nsCSSRect;
struct nsCSSRect_heap;
struct nsCSSValueList;
struct nsCSSValueList_heap;
struct nsCSSValueSharedList;
struct nsCSSValuePairList;
struct nsCSSValuePairList_heap;
struct nsCSSValueTriplet;
struct nsCSSValueTriplet_heap;
class nsCSSValueFloatColor;

class nsCSSValue {
public:
  struct Array;
  friend struct Array;

  friend struct mozilla::css::URLValue;

  friend struct mozilla::css::ImageValue;

  // for valueless units only (null, auto, inherit, none, all, normal)
  explicit nsCSSValue(nsCSSUnit aUnit = eCSSUnit_Null)
    : mUnit(aUnit)
  {
    MOZ_ASSERT(aUnit <= eCSSUnit_DummyInherit, "not a valueless unit");
  }

  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  nsCSSValue(const nsCSSValue& aCopy);
  ~nsCSSValue() { Reset(); }

  ;
  bool        operator==(const nsCSSValue& aOther) const;

  bool operator!=(const nsCSSValue& aOther) const
  {
    return !(*this == aOther);
  }

  // Enum for AppendToString's aValueSerialization argument.
  enum Serialization { eNormalized, eAuthorSpecified };

  /**
   * Serialize |this| as a specified value for |aProperty| and append
   * it to |aResult|.
   */
  ;

  nsCSSUnit GetUnit() const { return mUnit; }
  
  /**
   * A "fixed" length unit is one that means a specific physical length
   * which we try to match based on the physical characteristics of an
   * output device.
   */
  
  /**
   * What the spec calls relative length units is, for us, split
   * between relative length units and pixel length units.
   * 
   * A "relative" length unit is a multiple of some derived metric,
   * such as a font em-size, which itself was controlled by an input CSS
   * length. Relative length units should not be scaled by zooming, since
   * the underlying CSS length would already have been scaled.
   */
  
  /**
   * A "pixel" length unit is a some multiple of CSS pixels.
   */

  // Not making this inline because that would force us to include
  // imgIRequest.h, which leads to REQUIRES hell, since this header is included
  // all over.
  ;

  ;
  ;

  void Reset()  // sets to null
  {
    if (mUnit != eCSSUnit_Null)
      DoReset();
  }
private:
  void DoReset();
  nsCSSUnit mUnit;
  union {
    int32_t    mInt;
    float      mFloat;
    // Note: the capacity of the buffer may exceed the length of the string.
    // If we're of a string type, mString is not null.
    nsStringBuffer* mString;
    nscolor    mColor;
    Array*     mArray;
    mozilla::css::URLValue* mURL;
    mozilla::css::ImageValue* mImage;
    mozilla::css::GridTemplateAreasValue* mGridTemplateAreas;
    nsCSSValueGradient* mGradient;
    nsCSSValueTokenStream* mTokenStream;
    nsCSSValuePair_heap* mPair;
    nsCSSRect_heap* mRect;
    nsCSSValueTriplet_heap* mTriplet;
    nsCSSValueList_heap* mList;
    nsCSSValueList* mListDependent;
    nsCSSValueSharedList* mSharedList;
    nsCSSValuePairList_heap* mPairList;
    nsCSSValuePairList* mPairListDependent;
    nsCSSValueFloatColor* mFloatColor;
    mozilla::css::FontFamilyListRefCnt* mFontFamilyList;
  } mValue;
};

struct nsCSSValue::Array MOZ_FINAL {

  // return |Array| with reference count of zero
  

  

  

  // XXXdholbert This uses a size_t ref count. Should we use a variant
  // of NS_INLINE_DECL_REFCOUNTING that takes a type as an argument?
  
  

private:

  size_t mRefCnt;
  const size_t mCount;
  // This must be the last sub-object, since we extend this array to
  // be of size mCount; it needs to be a sub-object so it gets proper
  // alignment.
  nsCSSValue mArray[1];

  void* operator new(size_t aSelfSize, size_t aItemCount) CPP_THROW_NEW {
    MOZ_ASSERT(aItemCount > 0, "cannot have a 0 item count");
    return ::operator new(aSelfSize + sizeof(nsCSSValue) * (aItemCount - 1));
  }

  void operator delete(void* aPtr) { ::operator delete(aPtr); }

  nsCSSValue* First() { return mArray; }

  const nsCSSValue* First() const { return mArray; }

#define CSSVALUE_LIST_FOR_EXTRA_VALUES(var)                                   \
  for (nsCSSValue *var = First() + 1, *var##_end = First() + mCount;          \
       var != var##_end; ++var)

  explicit Array(size_t aItemCount)
    : mRefCnt(0)
    , mCount(aItemCount)
  {
    MOZ_COUNT_CTOR(nsCSSValue::Array);
    CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
      new (val) nsCSSValue();
    }
  }

  ~Array()
  {
    MOZ_COUNT_DTOR(nsCSSValue::Array);
    CSSVALUE_LIST_FOR_EXTRA_VALUES(val) {
      val->~nsCSSValue();
    }
  }

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

#undef CSSVALUE_LIST_FOR_EXTRA_VALUES

private:
  Array(const Array& aOther) = delete;
  Array& operator=(const Array& aOther) = delete;
};

// Prefer nsCSSValue::Array for lists of fixed size.
struct nsCSSValueList {
  nsCSSValueList() : mNext(nullptr) { MOZ_COUNT_CTOR(nsCSSValueList); }
  ~nsCSSValueList();

  nsCSSValueList* Clone() const;  // makes a deep copy. Infallible.
  void CloneInto(nsCSSValueList* aList) const; // makes a deep copy into aList
  void AppendToString(nsCSSProperty aProperty, nsAString& aResult,
                      nsCSSValue::Serialization aValueSerialization) const;

  static bool Equal(const nsCSSValueList* aList1,
                    const nsCSSValueList* aList2);

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

  nsCSSValue      mValue;
  nsCSSValueList* mNext;

private:
  nsCSSValueList(const nsCSSValueList& aCopy) // makes a shallow copy
    : mValue(aCopy.mValue), mNext(nullptr)
  {
    MOZ_COUNT_CTOR(nsCSSValueList);
  }

  // We don't want operator== or operator!= because they wouldn't be
  // null-safe, which is generally what we need.  Use |Equal| method
  // above instead.
  bool operator==(nsCSSValueList const& aOther) const = delete;
  bool operator!=(const nsCSSValueList& aOther) const = delete;
};

// nsCSSValueList_heap differs from nsCSSValueList only in being
// refcounted.  It should not be necessary to use this class directly;
// it's an implementation detail of nsCSSValue.
struct nsCSSValueList_heap MOZ_FINAL : public nsCSSValueList {
  NS_INLINE_DECL_REFCOUNTING(nsCSSValueList_heap)

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

private:
  // Private destructor, to discourage deletion outside of Release():
  ~nsCSSValueList_heap()
  {
  }
};

// This is a reference counted list value.  Note that the object is
// a wrapper for the reference count and a pointer to the head of the
// list, whereas the other list types (such as nsCSSValueList) do
// not have such a wrapper.
struct nsCSSValueSharedList MOZ_FINAL {
  nsCSSValueSharedList()
    : mHead(nullptr)
  {
    MOZ_COUNT_CTOR(nsCSSValueSharedList);
  }

  // Takes ownership of aList.
  explicit nsCSSValueSharedList(nsCSSValueList* aList)
    : mHead(aList)
  {
    MOZ_COUNT_CTOR(nsCSSValueSharedList);
  }

private:
  // Private destructor, to discourage deletion outside of Release():
  ~nsCSSValueSharedList();

public:
  NS_INLINE_DECL_REFCOUNTING(nsCSSValueSharedList)

  void AppendToString(nsCSSProperty aProperty, nsAString& aResult,
                      nsCSSValue::Serialization aValueSerialization) const;

  bool operator==(nsCSSValueSharedList const& aOther) const;
  bool operator!=(const nsCSSValueSharedList& aOther) const
  { return !(*this == aOther); }

  ;

  nsCSSValueList* mHead;
};

// This has to be here so that the relationship between nsCSSValueList
// and nsCSSValueList_heap is visible.




struct nsCSSRect {
  ;
  ;
  ~nsCSSRect();

  ;

  

  
};

// nsCSSRect_heap differs from nsCSSRect only in being
// refcounted.  It should not be necessary to use this class directly;
// it's an implementation detail of nsCSSValue.
struct nsCSSRect_heap MOZ_FINAL : public nsCSSRect {
  NS_INLINE_DECL_REFCOUNTING(nsCSSRect_heap)

  ;

private:
  // Private destructor, to discourage deletion outside of Release():
  ~nsCSSRect_heap()
  {
  }
};

// This has to be here so that the relationship between nsCSSRect
// and nsCSSRect_heap is visible.




struct nsCSSValuePair {
  
  
  
  
  ~nsCSSValuePair()
  {
    MOZ_COUNT_DTOR(nsCSSValuePair);
  }
  ;

  ;

  nsCSSValue mXValue;
  nsCSSValue mYValue;
};

// nsCSSValuePair_heap differs from nsCSSValuePair only in being
// refcounted.  It should not be necessary to use this class directly;
// it's an implementation detail of nsCSSValue.
struct nsCSSValuePair_heap MOZ_FINAL : public nsCSSValuePair {
  // forward constructor
  

  NS_INLINE_DECL_REFCOUNTING(nsCSSValuePair_heap)

  ;

private:
  // Private destructor, to discourage deletion outside of Release():
  ~nsCSSValuePair_heap()
  {
  }
};

struct nsCSSValueTriplet {
    
    
    
    
    ~nsCSSValueTriplet()
    ;

    nsCSSValue mXValue;
    nsCSSValue mYValue;
    nsCSSValue mZValue;
};

// nsCSSValueTriplet_heap differs from nsCSSValueTriplet only in being
// refcounted.  It should not be necessary to use this class directly;
// it's an implementation detail of nsCSSValue.
struct nsCSSValueTriplet_heap MOZ_FINAL : public nsCSSValueTriplet {
  // forward constructor
  

  NS_INLINE_DECL_REFCOUNTING(nsCSSValueTriplet_heap)

  ;

private:
  // Private destructor, to discourage deletion outside of Release():
  ~nsCSSValueTriplet_heap()
  {
  }
};

// This has to be here so that the relationship between nsCSSValuePair
// and nsCSSValuePair_heap is visible.








// Maybe should be replaced with nsCSSValueList and nsCSSValue::Array?
struct nsCSSValuePairList {
  
  ~nsCSSValuePairList();

  ; // makes a deep copy. Infallible.
  ;

  static bool Equal(const nsCSSValuePairList* aList1,
                    const nsCSSValuePairList* aList2);

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

};

// nsCSSValuePairList_heap differs from nsCSSValuePairList only in being
// refcounted.  It should not be necessary to use this class directly;
// it's an implementation detail of nsCSSValue.
struct nsCSSValuePairList_heap MOZ_FINAL : public nsCSSValuePairList {
  NS_INLINE_DECL_REFCOUNTING(nsCSSValuePairList_heap)

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

private:
  // Private destructor, to discourage deletion outside of Release():
  ~nsCSSValuePairList_heap()
  {
  }
};

// This has to be here so that the relationship between nsCSSValuePairList
// and nsCSSValuePairList_heap is visible.




struct nsCSSValueGradientStop {
public:
  nsCSSValueGradientStop();
  // needed to keep bloat logs happy when we use the TArray
  // in nsCSSValueGradient
  ;
  ~nsCSSValueGradientStop();

  nsCSSValue mLocation;

  ;
};

struct nsCSSValueGradient MOZ_FINAL {
  ;

  // true if gradient is radial, false if it is linear
  bool mIsRadial;
  bool mIsRepeating;
  bool mIsLegacySyntax;
  bool mIsExplicitSize;
  // line position and angle
  nsCSSValuePair mBgPos;
  nsCSSValue mAngle;

  // Only meaningful if mIsRadial is true
private:
  nsCSSValue mRadialValues[2];
public:
  
  
  
  
  
  const nsCSSValue& GetRadiusX() const
  {
    MOZ_ASSERT(mIsExplicitSize);
    return mRadialValues[0];
  }
  nsCSSValue& GetRadiusY()
  {
  }

  nsCSSValueGradient(const nsCSSValueGradient& aOther) = delete;
  nsCSSValueGradient& operator=(const nsCSSValueGradient& aOther) = delete;
};

struct nsCSSValueTokenStream MOZ_FINAL {
  nsCSSValueTokenStream();

private:
  // Private destructor, to discourage deletion outside of Release():
  ~nsCSSValueTokenStream();

public:
  bool operator==(const nsCSSValueTokenStream& aOther) const
  {
    bool eq;
    return mPropertyID == aOther.mPropertyID &&
           mShorthandPropertyID == aOther.mShorthandPropertyID &&
           mTokenStream.Equals(aOther.mTokenStream) &&
           (mBaseURI == aOther.mBaseURI ||
            (mBaseURI && aOther.mBaseURI &&
             NS_SUCCEEDED(mBaseURI->Equals(aOther.mBaseURI, &eq)) &&
             eq)) &&
           (mSheetURI == aOther.mSheetURI ||
            (mSheetURI && aOther.mSheetURI &&
             NS_SUCCEEDED(mSheetURI->Equals(aOther.mSheetURI, &eq)) &&
             eq)) &&
           (mSheetPrincipal == aOther.mSheetPrincipal ||
            (mSheetPrincipal && aOther.mSheetPrincipal &&
             NS_SUCCEEDED(mSheetPrincipal->Equals(aOther.mSheetPrincipal,
                                                  &eq)) &&
             eq));
  }

  bool operator!=(const nsCSSValueTokenStream& aOther) const
  {
    return !(*this == aOther);
  }

  NS_INLINE_DECL_REFCOUNTING(nsCSSValueTokenStream)

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

  // The property that has mTokenStream as its unparsed specified value.
  // When a variable reference is used in a shorthand property, a
  // TokenStream value is stored as the specified value for each of its
  // component longhand properties.
  nsCSSProperty mPropertyID;

  // The shorthand property that had a value with a variable reference,
  // which caused the longhand property identified by mPropertyID to have
  // a TokenStream value.
  nsCSSProperty mShorthandPropertyID;

  // The unparsed CSS corresponding to the specified value of the property.
  // When the value of a shorthand property has a variable reference, the
  // same mTokenStream value is used on each of the nsCSSValueTokenStream
  // objects that will be set by parsing the shorthand.
  nsString mTokenStream;

  nsCOMPtr<nsIURI> mBaseURI;
  nsCOMPtr<nsIURI> mSheetURI;
  nsCOMPtr<nsIPrincipal> mSheetPrincipal;
private:
  nsCSSValueTokenStream(const nsCSSValueTokenStream& aOther) = delete;
  nsCSSValueTokenStream& operator=(const nsCSSValueTokenStream& aOther) = delete;
};

class nsCSSValueFloatColor MOZ_FINAL {
public:
  nsCSSValueFloatColor(float aComponent1, float aComponent2, float aComponent3,
                       float aAlpha)
    : mComponent1(aComponent1)
    , mComponent2(aComponent2)
    , mComponent3(aComponent3)
    , mAlpha(aAlpha)
  {
    MOZ_COUNT_CTOR(nsCSSValueFloatColor);
  }

private:
  // Private destructor, to discourage deletion outside of Release():
  ~nsCSSValueFloatColor()
  {
    MOZ_COUNT_DTOR(nsCSSValueFloatColor);
  }

public:
  bool operator==(nsCSSValueFloatColor& aOther) const;

  nscolor GetColorValue(nsCSSUnit aUnit) const;
  bool IsNonTransparentColor() const;

  void AppendToString(nsCSSUnit aUnit, nsAString& aResult) const;

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

  NS_INLINE_DECL_REFCOUNTING(nsCSSValueFloatColor)

private:
  // FIXME: We should not be clamping specified RGB color components.
  float mComponent1;  // 0..1 for RGB, 0..360 for HSL
  float mComponent2;  // 0..1
  float mComponent3;  // 0..1
  float mAlpha;       // 0..1

  nsCSSValueFloatColor(const nsCSSValueFloatColor& aOther) = delete;
  nsCSSValueFloatColor& operator=(const nsCSSValueFloatColor& aOther)
                                                                   = delete;
};

struct nsCSSCornerSizes {
  nsCSSCornerSizes(void);
  nsCSSCornerSizes(const nsCSSCornerSizes& aCopy);
  ~nsCSSCornerSizes();

  // argument is a "full corner" constant from nsStyleConsts.h
  nsCSSValue const & GetCorner(uint32_t aCorner) const {
    return this->*corners[aCorner];
  }
  nsCSSValue & GetCorner(uint32_t aCorner) {
    return this->*corners[aCorner];
  }

  

  

  

  ;

  nsCSSValue mTopLeft;
  nsCSSValue mTopRight;
  nsCSSValue mBottomRight;
  nsCSSValue mBottomLeft;

protected:
  typedef nsCSSValue nsCSSCornerSizes::*corner_type;
  static const corner_type corners[4];
};

#endif /* nsCSSValue_h___ */
# 1653 "../../dist/include/nsCSSValue.h"

# 28 "../../dist/include/nsStyleStruct.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "imgRequestProxy.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/imgRequestProxy.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef imgRequestProxy_h__
#define imgRequestProxy_h__

#if 0 /* expanded by -frewrite-includes */
#include "imgIRequest.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/imgIRequest.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/imgIRequest.idl
 */

#ifndef __gen_imgIRequest_h__
#define __gen_imgIRequest_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/imgIRequest.h"
#endif
# 12 "../../dist/include/imgIRequest.h"

#ifndef __gen_nsIRequest_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIRequest.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/imgIRequest.h"
#endif
# 16 "../../dist/include/imgIRequest.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 21 "../../dist/include/imgIRequest.h"
class imgIContainer; /* forward declaration */

class imgINotificationObserver; /* forward declaration */

class nsIURI; /* forward declaration */

class nsIPrincipal; /* forward declaration */


/* starting interface:    imgIRequest */
#define IMGIREQUEST_IID_STR "83a7708b-5c35-409f-bab3-7fc08be6a264"

#define IMGIREQUEST_IID \
  {0x83a7708b, 0x5c35, 0x409f, \
    { 0xba, 0xb3, 0x7f, 0xc0, 0x8b, 0xe6, 0xa2, 0x64 }}

class NS_NO_VTABLE imgIRequest : public nsIRequest {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(IMGIREQUEST_IID)

  /* readonly attribute imgIContainer image; */
  NS_IMETHOD GetImage(imgIContainer * *aImage) = 0;

  enum {
    STATUS_NONE = 0,
    STATUS_SIZE_AVAILABLE = 1,
    STATUS_LOAD_COMPLETE = 2,
    STATUS_ERROR = 4,
    STATUS_DECODE_STARTED = 8,
    STATUS_FRAME_COMPLETE = 16,
    STATUS_DECODE_COMPLETE = 32,
    STATUS_IS_ANIMATED = 64,
    STATUS_HAS_TRANSPARENCY = 128
  };

  /* readonly attribute unsigned long imageStatus; */
  NS_IMETHOD GetImageStatus(uint32_t *aImageStatus) = 0;

  /* [noscript] readonly attribute nsresult imageErrorCode; */
  NS_IMETHOD GetImageErrorCode(nsresult *aImageErrorCode) = 0;

  /* readonly attribute nsIURI URI; */
  NS_IMETHOD GetURI(nsIURI * *aURI) = 0;

  /* readonly attribute nsIURI currentURI; */
  NS_IMETHOD GetCurrentURI(nsIURI * *aCurrentURI) = 0;

  /* readonly attribute imgINotificationObserver notificationObserver; */
  NS_IMETHOD GetNotificationObserver(imgINotificationObserver * *aNotificationObserver) = 0;

  /* readonly attribute string mimeType; */
  NS_IMETHOD GetMimeType(char * *aMimeType) = 0;

  /* imgIRequest clone (in imgINotificationObserver aObserver); */
  NS_IMETHOD Clone(imgINotificationObserver *aObserver, imgIRequest * *_retval) = 0;

  /* readonly attribute nsIPrincipal imagePrincipal; */
  NS_IMETHOD GetImagePrincipal(nsIPrincipal * *aImagePrincipal) = 0;

  /* readonly attribute bool multipart; */
  NS_IMETHOD GetMultipart(bool *aMultipart) = 0;

  enum {
    CORS_NONE = 1,
    CORS_ANONYMOUS = 2,
    CORS_USE_CREDENTIALS = 3
  };

  /* readonly attribute long CORSMode; */
  NS_IMETHOD GetCORSMode(int32_t *aCORSMode) = 0;

  /* void cancelAndForgetObserver (in nsresult aStatus); */
  NS_IMETHOD CancelAndForgetObserver(nsresult aStatus) = 0;

  /* void requestDecode (); */
  NS_IMETHOD RequestDecode(void) = 0;

  /* void startDecoding (); */
  NS_IMETHOD StartDecoding(void) = 0;

  /* void lockImage (); */
  NS_IMETHOD LockImage(void) = 0;

  /* void unlockImage (); */
  NS_IMETHOD UnlockImage(void) = 0;

  /* void requestDiscard (); */
  NS_IMETHOD RequestDiscard(void) = 0;

  /* imgIRequest getStaticRequest (); */
  NS_IMETHOD GetStaticRequest(imgIRequest * *_retval) = 0;

  /* void incrementAnimationConsumers (); */
  NS_IMETHOD IncrementAnimationConsumers(void) = 0;

  /* void decrementAnimationConsumers (); */
  NS_IMETHOD DecrementAnimationConsumers(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(imgIRequest, IMGIREQUEST_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_IMGIREQUEST \
  NS_IMETHOD GetImage(imgIContainer * *aImage) MOZ_OVERRIDE; \
  NS_IMETHOD GetImageStatus(uint32_t *aImageStatus) MOZ_OVERRIDE; \
  NS_IMETHOD GetImageErrorCode(nsresult *aImageErrorCode) MOZ_OVERRIDE; \
  NS_IMETHOD GetURI(nsIURI * *aURI) MOZ_OVERRIDE; \
  NS_IMETHOD GetCurrentURI(nsIURI * *aCurrentURI) MOZ_OVERRIDE; \
  NS_IMETHOD GetNotificationObserver(imgINotificationObserver * *aNotificationObserver) MOZ_OVERRIDE; \
  NS_IMETHOD GetMimeType(char * *aMimeType) MOZ_OVERRIDE; \
  NS_IMETHOD Clone(imgINotificationObserver *aObserver, imgIRequest * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetImagePrincipal(nsIPrincipal * *aImagePrincipal) MOZ_OVERRIDE; \
  NS_IMETHOD GetMultipart(bool *aMultipart) MOZ_OVERRIDE; \
  NS_IMETHOD GetCORSMode(int32_t *aCORSMode) MOZ_OVERRIDE; \
  NS_IMETHOD CancelAndForgetObserver(nsresult aStatus) MOZ_OVERRIDE; \
  NS_IMETHOD RequestDecode(void) MOZ_OVERRIDE; \
  NS_IMETHOD StartDecoding(void) MOZ_OVERRIDE; \
  NS_IMETHOD LockImage(void) MOZ_OVERRIDE; \
  NS_IMETHOD UnlockImage(void) MOZ_OVERRIDE; \
  NS_IMETHOD RequestDiscard(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetStaticRequest(imgIRequest * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD IncrementAnimationConsumers(void) MOZ_OVERRIDE; \
  NS_IMETHOD DecrementAnimationConsumers(void) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_IMGIREQUEST(_to) \
  NS_IMETHOD GetImage(imgIContainer * *aImage) MOZ_OVERRIDE { return _to GetImage(aImage); } \
  NS_IMETHOD GetImageStatus(uint32_t *aImageStatus) MOZ_OVERRIDE { return _to GetImageStatus(aImageStatus); } \
  NS_IMETHOD GetImageErrorCode(nsresult *aImageErrorCode) MOZ_OVERRIDE { return _to GetImageErrorCode(aImageErrorCode); } \
  NS_IMETHOD GetURI(nsIURI * *aURI) MOZ_OVERRIDE { return _to GetURI(aURI); } \
  NS_IMETHOD GetCurrentURI(nsIURI * *aCurrentURI) MOZ_OVERRIDE { return _to GetCurrentURI(aCurrentURI); } \
  NS_IMETHOD GetNotificationObserver(imgINotificationObserver * *aNotificationObserver) MOZ_OVERRIDE { return _to GetNotificationObserver(aNotificationObserver); } \
  NS_IMETHOD GetMimeType(char * *aMimeType) MOZ_OVERRIDE { return _to GetMimeType(aMimeType); } \
  NS_IMETHOD Clone(imgINotificationObserver *aObserver, imgIRequest * *_retval) MOZ_OVERRIDE { return _to Clone(aObserver, _retval); } \
  NS_IMETHOD GetImagePrincipal(nsIPrincipal * *aImagePrincipal) MOZ_OVERRIDE { return _to GetImagePrincipal(aImagePrincipal); } \
  NS_IMETHOD GetMultipart(bool *aMultipart) MOZ_OVERRIDE { return _to GetMultipart(aMultipart); } \
  NS_IMETHOD GetCORSMode(int32_t *aCORSMode) MOZ_OVERRIDE { return _to GetCORSMode(aCORSMode); } \
  NS_IMETHOD CancelAndForgetObserver(nsresult aStatus) MOZ_OVERRIDE { return _to CancelAndForgetObserver(aStatus); } \
  NS_IMETHOD RequestDecode(void) MOZ_OVERRIDE { return _to RequestDecode(); } \
  NS_IMETHOD StartDecoding(void) MOZ_OVERRIDE { return _to StartDecoding(); } \
  NS_IMETHOD LockImage(void) MOZ_OVERRIDE { return _to LockImage(); } \
  NS_IMETHOD GetImagePrincipal(nsIPrincipal * *aImagePrincipal) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetImagePrincipal(aImagePrincipal); } \
  NS_IMETHOD GetMultipart(bool *aMultipart) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMultipart(aMultipart); } \
  NS_IMETHOD GetCORSMode(int32_t *aCORSMode) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCORSMode(aCORSMode); } \
  NS_IMETHOD CancelAndForgetObserver(nsresult aStatus) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->CancelAndForgetObserver(aStatus); } \
  NS_IMETHOD RequestDecode(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RequestDecode(); } \
  NS_IMETHOD StartDecoding(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->StartDecoding(); } \
  NS_IMETHOD LockImage(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->LockImage(); } \
  NS_IMETHOD UnlockImage(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->UnlockImage(); } \
  NS_IMETHOD RequestDiscard(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RequestDiscard(); } \
  NS_IMETHOD GetStaticRequest(imgIRequest * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStaticRequest(_retval); } \
  NS_IMETHOD IncrementAnimationConsumers(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IncrementAnimationConsumers(); } \
  NS_IMETHOD DecrementAnimationConsumers(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->DecrementAnimationConsumers(); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

NS_IMETHODIMP _MYCLASS_::IncrementAnimationConsumers()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void decrementAnimationConsumers (); */
NS_IMETHODIMP _MYCLASS_::DecrementAnimationConsumers()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 347 "../../dist/include/imgIRequest.h"


#endif /* __gen_imgIRequest_h__ */
# 350 "../../dist/include/imgIRequest.h"
# 11 "../../dist/include/imgRequestProxy.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISecurityInfoProvider.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISecurityInfoProvider.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsISecurityInfoProvider.idl
 */

#ifndef __gen_nsISecurityInfoProvider_h__
#define __gen_nsISecurityInfoProvider_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsISecurityInfoProvider.h"
#endif
# 12 "../../dist/include/nsISecurityInfoProvider.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsISecurityInfoProvider.h"

/* starting interface:    nsISecurityInfoProvider */
#define NS_ISECURITYINFOPROVIDER_IID_STR "b8cc9126-9319-4415-afd9-b82220d453ed"

#define NS_ISECURITYINFOPROVIDER_IID \
  {0xb8cc9126, 0x9319, 0x4415, \
    { 0xaf, 0xd9, 0xb8, 0x22, 0x20, 0xd4, 0x53, 0xed }}

class NS_NO_VTABLE nsISecurityInfoProvider : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISECURITYINFOPROVIDER_IID)

  /* readonly attribute nsISupports securityInfo; */
  NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo) = 0;

  /* readonly attribute boolean hasTransferredData; */
  NS_IMETHOD GetHasTransferredData(bool *aHasTransferredData) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsISecurityInfoProvider, NS_ISECURITYINFOPROVIDER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISECURITYINFOPROVIDER \
  NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo) MOZ_OVERRIDE; \
  NS_IMETHOD GetHasTransferredData(bool *aHasTransferredData) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISECURITYINFOPROVIDER(_to) \
  NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo) MOZ_OVERRIDE { return _to GetSecurityInfo(aSecurityInfo); } \
  NS_IMETHOD GetHasTransferredData(bool *aHasTransferredData) MOZ_OVERRIDE { return _to GetHasTransferredData(aHasTransferredData); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISECURITYINFOPROVIDER(_to) \
  NS_IMETHOD GetSecurityInfo(nsISupports * *aSecurityInfo) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSecurityInfo(aSecurityInfo); } \
  NS_IMETHOD GetHasTransferredData(bool *aHasTransferredData) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHasTransferredData(aHasTransferredData); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute boolean hasTransferredData; */
NS_IMETHODIMP nsSecurityInfoProvider::GetHasTransferredData(bool *aHasTransferredData)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 101 "../../dist/include/nsISecurityInfoProvider.h"


#endif /* __gen_nsISecurityInfoProvider_h__ */
# 104 "../../dist/include/nsISecurityInfoProvider.h"
# 12 "../../dist/include/imgRequestProxy.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "nsILoadGroup.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/imgRequestProxy.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsPriority.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISupportsPriority.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsISupportsPriority.idl
 */

#ifndef __gen_nsISupportsPriority_h__
#define __gen_nsISupportsPriority_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsISupportsPriority.h"
#endif
# 12 "../../dist/include/nsISupportsPriority.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsISupportsPriority.h"

/* starting interface:    nsISupportsPriority */
#define NS_ISUPPORTSPRIORITY_IID_STR "aa578b44-abd5-4c19-8b14-36d4de6fdc36"

#define NS_ISUPPORTSPRIORITY_IID \
  {0xaa578b44, 0xabd5, 0x4c19, \
    { 0x8b, 0x14, 0x36, 0xd4, 0xde, 0x6f, 0xdc, 0x36 }}

class NS_NO_VTABLE nsISupportsPriority : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISUPPORTSPRIORITY_IID)

  enum {
    PRIORITY_HIGHEST = -20,
    PRIORITY_HIGH = -10,
    PRIORITY_NORMAL = 0,
    PRIORITY_LOW = 10,
    PRIORITY_LOWEST = 20
  };

  /* attribute long priority; */
  NS_IMETHOD GetPriority(int32_t *aPriority) = 0;
  NS_IMETHOD SetPriority(int32_t aPriority) = 0;

  /* void adjustPriority (in long delta); */
  NS_IMETHOD AdjustPriority(int32_t delta) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsISupportsPriority, NS_ISUPPORTSPRIORITY_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISUPPORTSPRIORITY \
  NS_IMETHOD GetPriority(int32_t *aPriority) MOZ_OVERRIDE; \
  NS_IMETHOD SetPriority(int32_t aPriority) MOZ_OVERRIDE; \
  NS_IMETHOD AdjustPriority(int32_t delta) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISUPPORTSPRIORITY(_to) \
  NS_IMETHOD GetPriority(int32_t *aPriority) MOZ_OVERRIDE { return _to GetPriority(aPriority); } \
  NS_IMETHOD SetPriority(int32_t aPriority) MOZ_OVERRIDE { return _to SetPriority(aPriority); } \
  NS_IMETHOD AdjustPriority(int32_t delta) MOZ_OVERRIDE { return _to AdjustPriority(delta); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISUPPORTSPRIORITY(_to) \
  NS_IMETHOD GetPriority(int32_t *aPriority) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPriority(aPriority); } \
  NS_IMETHOD SetPriority(int32_t aPriority) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPriority(aPriority); } \
  NS_IMETHOD AdjustPriority(int32_t delta) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AdjustPriority(delta); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsSupportsPriority : public nsISupportsPriority
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSPRIORITY

/* void adjustPriority (in long delta); */
NS_IMETHODIMP nsSupportsPriority::AdjustPriority(int32_t delta)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 117 "../../dist/include/nsISupportsPriority.h"


#endif /* __gen_nsISupportsPriority_h__ */
# 120 "../../dist/include/nsISupportsPriority.h"
# 15 "../../dist/include/imgRequestProxy.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsITimedChannel.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsITimedChannel.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsITimedChannel.idl
 */

#ifndef __gen_nsITimedChannel_h__
#define __gen_nsITimedChannel_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsITimedChannel.h"
#endif
# 12 "../../dist/include/nsITimedChannel.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsITimedChannel.h"
class nsIPrincipal; /* forward declaration */

namespace mozilla {
class TimeStamp;
}

/* starting interface:    nsITimedChannel */
#define NS_ITIMEDCHANNEL_IID_STR "ca63784d-959c-4c3a-9a59-234a2a520de0"

#define NS_ITIMEDCHANNEL_IID \
  {0xca63784d, 0x959c, 0x4c3a, \
    { 0x9a, 0x59, 0x23, 0x4a, 0x2a, 0x52, 0x0d, 0xe0 }}

class nsITimedChannel : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITIMEDCHANNEL_IID)

  /* attribute boolean timingEnabled; */
  NS_IMETHOD GetTimingEnabled(bool *aTimingEnabled) = 0;
  NS_IMETHOD SetTimingEnabled(bool aTimingEnabled) = 0;

  /* attribute uint16_t redirectCount; */
  NS_IMETHOD GetRedirectCount(uint16_t *aRedirectCount) = 0;
  NS_IMETHOD GetRedirectEndTime(PRTime *aRedirectEndTime) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsITimedChannel, NS_ITIMEDCHANNEL_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITIMEDCHANNEL \
  NS_IMETHOD GetTimingEnabled(bool *aTimingEnabled) MOZ_OVERRIDE; \
  NS_IMETHOD SetTimingEnabled(bool aTimingEnabled) MOZ_OVERRIDE; \
  NS_IMETHOD GetAllRedirectsPassTimingAllowCheck(bool *aAllRedirectsPassTimingAllowCheck) MOZ_OVERRIDE { return _to GetAllRedirectsPassTimingAllowCheck(aAllRedirectsPassTimingAllowCheck); } \
  NS_IMETHOD SetAllRedirectsPassTimingAllowCheck(bool aAllRedirectsPassTimingAllowCheck) MOZ_OVERRIDE { return _to SetAllRedirectsPassTimingAllowCheck(aAllRedirectsPassTimingAllowCheck); } \
  NS_IMETHOD TimingAllowCheck(nsIPrincipal *origin, bool *_retval) MOZ_OVERRIDE { return _to TimingAllowCheck(origin, _retval); } \
  NS_IMETHOD GetCacheReadStart(mozilla::TimeStamp *aCacheReadStart) MOZ_OVERRIDE { return _to GetCacheReadStart(aCacheReadStart); } \
  NS_IMETHOD GetCacheReadEnd(mozilla::TimeStamp *aCacheReadEnd) MOZ_OVERRIDE { return _to GetCacheReadEnd(aCacheReadEnd); } \
  NS_IMETHOD GetChannelCreationTime(PRTime *aChannelCreationTime) MOZ_OVERRIDE { return _to GetChannelCreationTime(aChannelCreationTime); } \
  NS_IMETHOD GetResponseStartTime(PRTime *aResponseStartTime) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResponseStartTime(aResponseStartTime); } \
  NS_IMETHOD GetResponseEndTime(PRTime *aResponseEndTime) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResponseEndTime(aResponseEndTime); } \
  NS_IMETHOD GetCacheReadStartTime(PRTime *aCacheReadStartTime) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCacheReadStartTime(aCacheReadStartTime); } \
  NS_IMETHOD GetCacheReadEndTime(PRTime *aCacheReadEndTime) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCacheReadEndTime(aCacheReadEndTime); } \
  NS_IMETHOD GetRedirectStartTime(PRTime *aRedirectStartTime) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRedirectStartTime(aRedirectStartTime); } \
  NS_IMETHOD GetRedirectEndTime(PRTime *aRedirectEndTime) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRedirectEndTime(aRedirectEndTime); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsTimedChannel::SetTimingEnabled(bool aTimingEnabled)
    return NS_ERROR_NOT_IMPLEMENTED;
}
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute PRTime asyncOpenTime; */
NS_IMETHODIMP nsTimedChannel::GetAsyncOpenTime(PRTime *aAsyncOpenTime)
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIThreadRetargetableStreamListener.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIThreadRetargetableStreamListener.idl
 */

#ifndef __gen_nsIThreadRetargetableStreamListener_h__
#define __gen_nsIThreadRetargetableStreamListener_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIThreadRetargetableStreamListener.h"
#endif
# 12 "../../dist/include/nsIThreadRetargetableStreamListener.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIThreadRetargetableStreamListener.h"

/* starting interface:    nsIThreadRetargetableStreamListener */
#define NS_ITHREADRETARGETABLESTREAMLISTENER_IID_STR "fb2304b8-f82f-4433-af68-d874a2ebbdc1"

#define NS_ITHREADRETARGETABLESTREAMLISTENER_IID \
  {0xfb2304b8, 0xf82f, 0x4433, \
    { 0xaf, 0x68, 0xd8, 0x74, 0xa2, 0xeb, 0xbd, 0xc1 }}

class NS_NO_VTABLE nsIThreadRetargetableStreamListener : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITHREADRETARGETABLESTREAMLISTENER_IID)

  /* void checkListenerChain (); */
  NS_IMETHOD CheckListenerChain(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIThreadRetargetableStreamListener, NS_ITHREADRETARGETABLESTREAMLISTENER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER \
  NS_IMETHOD CheckListenerChain(void) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSITHREADRETARGETABLESTREAMLISTENER(_to) \
  NS_IMETHOD CheckListenerChain(void) MOZ_OVERRIDE { return _to CheckListenerChain(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSITHREADRETARGETABLESTREAMLISTENER(_to) \
  NS_IMETHOD CheckListenerChain(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->CheckListenerChain(); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
}

/* End of implementation class template. */
#endif
# 89 "../../dist/include/nsIThreadRetargetableStreamListener.h"


/* starting interface:    nsIAsyncVerifyRedirectCallback */
#define NS_IASYNCVERIFYREDIRECTCALLBACK_IID_STR "8d171460-a716-41f1-92be-8c659db39b45"

#define NS_IASYNCVERIFYREDIRECTCALLBACK_IID \
  {0x8d171460, 0xa716, 0x41f1, \
    { 0x92, 0xbe, 0x8c, 0x65, 0x9d, 0xb3, 0x9b, 0x45 }}

class NS_NO_VTABLE nsIAsyncVerifyRedirectCallback : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IASYNCVERIFYREDIRECTCALLBACK_IID)

  /* void onRedirectVerifyCallback (in nsresult result); */
  NS_IMETHOD OnRedirectVerifyCallback(nsresult result) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIAsyncVerifyRedirectCallback, NS_IASYNCVERIFYREDIRECTCALLBACK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK \
  NS_IMETHOD OnRedirectVerifyCallback(nsresult result) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIASYNCVERIFYREDIRECTCALLBACK(_to) \
  NS_IMETHOD OnRedirectVerifyCallback(nsresult result) MOZ_OVERRIDE { return _to OnRedirectVerifyCallback(result); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIASYNCVERIFYREDIRECTCALLBACK(_to) \
  NS_IMETHOD OnRedirectVerifyCallback(nsresult result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnRedirectVerifyCallback(result); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsAsyncVerifyRedirectCallback : public nsIAsyncVerifyRedirectCallback
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIASYNCVERIFYREDIRECTCALLBACK


nsAsyncVerifyRedirectCallback::~nsAsyncVerifyRedirectCallback()
{
  /* destructor code */
}

/* void onRedirectVerifyCallback (in nsresult result); */
NS_IMETHODIMP nsAsyncVerifyRedirectCallback::OnRedirectVerifyCallback(nsresult result)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 89 "../../dist/include/nsIAsyncVerifyRedirectCallback.h"


#endif /* __gen_nsIAsyncVerifyRedirectCallback_h__ */
# 92 "../../dist/include/nsIAsyncVerifyRedirectCallback.h"
# 22 "../../dist/include/imgRequest.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/net/ReferrerPolicy.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/imgRequest.h"

class imgCacheValidator;
class imgLoader;
class imgRequestProxy;
class imgCacheEntry;
class imgMemoryReporter;
class imgRequestNotifyRunnable;
class nsIApplicationCache;
class nsIProperties;
class nsIRequest;
class nsITimedChannel;
class nsIURI;

namespace mozilla {
namespace image {
class Image;
class ImageURL;
class ProgressTracker;
} // namespace image
} // namespace mozilla

class imgRequest MOZ_FINAL : public nsIStreamListener,
                             public nsIThreadRetargetableStreamListener,
                             public nsIChannelEventSink,
                             public nsIInterfaceRequestor,
                             public nsIAsyncVerifyRedirectCallback
{
  ;

public:
  typedef mozilla::image::Image Image;
  typedef mozilla::image::ImageURL ImageURL;
  typedef mozilla::image::ProgressTracker ProgressTracker;
  typedef mozilla::net::ReferrerPolicy ReferrerPolicy;

  ;

  NS_DECL_THREADSAFE_ISUPPORTS

  ;
  bool mIsMultiPartChannel : 1;
  bool mGotData : 1;
  bool mIsInCache : 1;
  bool mBlockingOnload : 1;
  bool mNewPartPending : 1;
};

#endif
# 279 "../../dist/include/imgRequest.h"
# 22 "../../dist/include/imgRequestProxy.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "IProgressObserver.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/IProgressObserver.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_IMAGELIB_PROGRESSOBSERVER_H_
#define MOZILLA_IMAGELIB_PROGRESSOBSERVER_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/WeakPtr.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/IProgressObserver.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/IProgressObserver.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRect.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/IProgressObserver.h"

namespace mozilla {
namespace image {

/**
 * An interface for observing changes to image state, as reported by
 * ProgressTracker.
 * 
 * This is the ImageLib-internal version of imgINotificationObserver,
 * essentially, with implementation details that code outside of ImageLib
 * shouldn't see.
 *
 * XXX(seth): It's preferable to avoid adding anything to this interface if
 * possible.  In the long term, it would be ideal to get to a place where we can
 * just use the imgINotificationObserver interface internally as well.
 */
class IProgressObserver : public SupportsWeakPtr<IProgressObserver>
{
public:
  MOZ_DECLARE_REFCOUNTED_TYPENAME(IProgressObserver)

  // Subclasses may or may not be XPCOM classes, so we just require that they
  // implement AddRef and Release.
  NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0;
  NS_IMETHOD_(MozExternalRefCountType) Release(void) = 0;

  // imgINotificationObserver methods:
  virtual void Notify(int32_t aType, const nsIntRect* aRect = nullptr) = 0;
  virtual void OnLoadComplete(bool aLastPart) = 0;

  // imgIOnloadBlocker methods:
  virtual void BlockOnload() = 0;
  virtual void UnblockOnload() = 0;

  // Other, internal-only methods:
  virtual void SetHasImage() = 0;
  virtual void OnStartDecode() = 0;
  virtual bool NotificationsDeferred() const = 0;
  virtual void SetNotificationsDeferred(bool aDeferNotifications) = 0;

protected:
  
};

} // namespace image
} // namespace mozilla

#endif // MOZILLA_IMAGELIB_PROGRESSOBSERVER_H_
# 60 "../../dist/include/IProgressObserver.h"
# 23 "../../dist/include/imgRequestProxy.h" 2

#define NS_IMGREQUESTPROXY_CID \
{ /* 20557898-1dd2-11b2-8f65-9c462ee2bc95 */         \
     0x20557898,                                     \
     0x1dd2,                                         \
     0x11b2,                                         \
    {0x8f, 0x65, 0x9c, 0x46, 0x2e, 0xe2, 0xbc, 0x95} \
}

class imgINotificationObserver;
class imgRequestNotifyRunnable;
class imgStatusNotifyRunnable;
struct nsIntRect;
class ProxyBehaviour;

namespace mozilla {
namespace image {
class Image;
class ImageURL;
class ProgressTracker;
} // namespace image
} // namespace mozilla

class imgRequestProxy : public imgIRequest,
                        public mozilla::image::IProgressObserver,
                        public nsISupportsPriority,
                        public nsISecurityInfoProvider,
                        public nsITimedChannel
{
protected:
  ;

public:
  typedef mozilla::image::Image Image;
  typedef mozilla::image::ImageURL ImageURL;
  typedef mozilla::image::ProgressTracker ProgressTracker;

  MOZ_DECLARE_REFCOUNTED_TYPENAME(imgRequestProxy)
  NS_DECL_ISUPPORTS
  NS_DECL_IMGIREQUEST
  NS_DECL_NSIREQUEST
  NS_DECL_NSISUPPORTSPRIORITY
  NS_DECL_NSISECURITYINFOPROVIDER
  // nsITimedChannel declared below
  virtual void BlockOnload() MOZ_OVERRIDE;
  virtual void UnblockOnload() MOZ_OVERRIDE;

  // Other, internal-only methods:
  virtual void SetHasImage() MOZ_OVERRIDE;
  virtual void OnStartDecode() MOZ_OVERRIDE;

  // Whether we want notifications from ProgressTracker to be deferred until
  // an event it has scheduled has been fired.
  virtual bool NotificationsDeferred() const MOZ_OVERRIDE
  {
    return mDeferNotifications;
  }
  virtual void SetNotificationsDeferred(bool aDeferNotifications) MOZ_OVERRIDE
  {
    mDeferNotifications = aDeferNotifications;
  }

  // Removes all animation consumers that were created with
  // IncrementAnimationConsumers. This is necessary since we need
  // to do it before the proxy itself is destroyed. See
  // imgRequest::RemoveProxy
  void ClearAnimationConsumers();

  virtual nsresult Clone(imgINotificationObserver* aObserver, imgRequestProxy** aClone);
  nsresult GetStaticRequest(imgRequestProxy** aReturn);

  // The URI of our request.
  nsRefPtr<ImageURL> mURI;

  // mListener is only promised to be a weak ref (see imgILoader.idl),
  // but we actually keep a strong ref to it until we've seen our
  // first OnStopRequest.
  imgINotificationObserver* mListener;
  nsCOMPtr<nsILoadGroup> mLoadGroup;

  nsLoadFlags mLoadFlags;
  uint32_t    mLockCount;
  uint32_t    mAnimationConsumers;
  bool mCanceled;
  bool mIsInLoadGroup;
  bool mListenerIsStrongRef;
  bool mDecodeRequested;

  // Whether we want to defer our notifications by the non-virtual Observer
  // interfaces as image loads proceed.
  bool mDeferNotifications;
};

// Used for static image proxies for which no requests are available, so
// certain behaviours must be overridden to compensate.
class imgRequestProxyStatic : public imgRequestProxy
{

public:
  ;

  NS_IMETHOD GetImagePrincipal(nsIPrincipal** aPrincipal) MOZ_OVERRIDE;

  using imgRequestProxy::Clone;

  virtual nsresult Clone(imgINotificationObserver* aObserver,
                         imgRequestProxy** aClone) MOZ_OVERRIDE;

protected:
  ;

  // Our principal. We have to cache it, rather than accessing the underlying
  // request on-demand, because static proxies don't have an underlying request.
  nsCOMPtr<nsIPrincipal> mPrincipal;
};

#endif // imgRequestProxy_h__
# 245 "../../dist/include/imgRequestProxy.h"
# 29 "../../dist/include/nsStyleStruct.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "Orientation.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/Orientation.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_IMAGELIB_ORIENTATION_H_
#define MOZILLA_IMAGELIB_ORIENTATION_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/Orientation.h"

namespace mozilla {
namespace image {

enum class Angle : uint8_t {
  D0,
  D90,
  D180,
  D270
};

enum class Flip : uint8_t {
  Unflipped,
  Horizontal
};

/**
 * A struct that describes an image's orientation as a rotation optionally
 * followed by a reflection. This may be used to be indicate an image's inherent
 * orientation or a desired orientation for the image.
 */
struct Orientation
{
  

  

  

  bool operator==(const Orientation& aOther) const {
    return (rotation == aOther.rotation) && (flip == aOther.flip);
  }

  

  Angle rotation;
  Flip  flip;
};

}
}

#endif
# 63 "../../dist/include/Orientation.h"
# 30 "../../dist/include/nsStyleStruct.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "CounterStyleManager.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/CounterStyleManager.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_CounterStyleManager_h_
#define mozilla_CounterStyleManager_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsStringFwd.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/CounterStyleManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRefPtrHashtable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/CounterStyleManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/CounterStyleManager.h"
class nsPresContext;
class nsCSSCounterStyleRule;

namespace mozilla {

class WritingMode;

typedef int32_t CounterValue;

class CounterStyleManager;
class AnonymousCounterStyle;

struct NegativeType;
struct PadType;

class CounterStyle
{
protected:
  

private:
  CounterStyle(const CounterStyle& aOther) = delete;
  void operator=(const CounterStyle& other) = delete;

public:
  int32_t GetStyle() const { return mStyle; }
  bool IsNone() const { return mStyle == NS_STYLE_LIST_STYLE_NONE; }
  bool IsCustomStyle() const { return mStyle == NS_STYLE_LIST_STYLE_CUSTOM; }
  // A style is dependent if it depends on the counter style manager.
  // Custom styles are certainly dependent. In addition, some builtin
  // styles are dependent for fallback.
  bool IsDependentStyle() const;

  virtual void GetPrefix(nsSubstring& aResult) = 0;
  virtual void GetSuffix(nsSubstring& aResult) = 0;
  void GetCounterText(CounterValue aOrdinal,
                      WritingMode aWritingMode,
                      nsSubstring& aResult,
                      bool& aIsRTL);
  virtual void GetSpokenCounterText(CounterValue aOrdinal,
                                    WritingMode aWritingMode,
                                    nsSubstring& aResult,
                                    bool& aIsBullet);

  // XXX This method could be removed once ::-moz-list-bullet and
  //     ::-moz-list-number are completely merged into ::marker.
  virtual bool IsBullet() = 0;

  virtual void GetNegative(NegativeType& aResult) = 0;
  /**
   * This method returns whether an ordinal is in the range of this
   * counter style. Note that, it is possible that an ordinal in range
   * is rejected by the generating algorithm.
   */
  virtual bool IsOrdinalInRange(CounterValue aOrdinal) = 0;
  /**
   * This method returns whether an ordinal is in the default range of
   * this counter style. This is the effective range when no 'range'
   * descriptor is specified.
   */
  virtual bool IsOrdinalInAutoRange(CounterValue aOrdinal) = 0;
  virtual void GetPad(PadType& aResult) = 0;
  virtual CounterStyle* GetFallback() = 0;
  virtual uint8_t GetSpeakAs() = 0;
  virtual bool UseNegativeSign() = 0;

  virtual void CallFallbackStyle(CounterValue aOrdinal,
                                 WritingMode aWritingMode,
                                 nsSubstring& aResult,
                                 bool& aIsRTL);
  virtual bool GetInitialCounterText(CounterValue aOrdinal,
                                     WritingMode aWritingMode,
                                     nsSubstring& aResult,
                                     bool& aIsRTL) = 0;

  virtual AnonymousCounterStyle* AsAnonymous() { return nullptr; }

  NS_IMETHOD_(MozExternalRefCountType) AddRef() = 0;
  NS_IMETHOD_(MozExternalRefCountType) Release() = 0;

protected:
  int32_t mStyle;
};

class AnonymousCounterStyle MOZ_FINAL : public CounterStyle
{
public:
  explicit AnonymousCounterStyle(const nsCSSValue::Array* aValue);

  virtual void GetPrefix(nsAString& aResult) MOZ_OVERRIDE;
  virtual void GetSuffix(nsAString& aResult) MOZ_OVERRIDE;
  virtual bool IsBullet() MOZ_OVERRIDE;

  virtual void GetNegative(NegativeType& aResult) MOZ_OVERRIDE;
  virtual bool IsOrdinalInRange(CounterValue aOrdinal) MOZ_OVERRIDE;
  virtual bool IsOrdinalInAutoRange(CounterValue aOrdinal) MOZ_OVERRIDE;

private:
  ~AnonymousCounterStyle() {}

  uint8_t mSystem;
  nsTArray<nsString> mSymbols;
};

class CounterStyleManager MOZ_FINAL
{
private:
  ~CounterStyleManager();
public:
  explicit CounterStyleManager(nsPresContext* aPresContext);

  static void InitializeBuiltinCounterStyles();

  void Disconnect();

  bool IsInitial() const
  {
    // only 'none' and 'decimal'
    return mCacheTable.Count() == 2;
  }

  CounterStyle* BuildCounterStyle(const nsSubstring& aName);
  CounterStyle* BuildCounterStyle(const nsCSSValue::Array* aParams);

  static CounterStyle* GetBuiltinStyle(int32_t aStyle);
  static CounterStyle* GetNoneStyle()
  {
    return GetBuiltinStyle(NS_STYLE_LIST_STYLE_NONE);
  }
  static CounterStyle* GetDecimalStyle()
  {
    return GetBuiltinStyle(NS_STYLE_LIST_STYLE_DECIMAL);
  }

  // This method will scan all existing counter styles generated by this
  // manager, and remove or mark data dirty accordingly. It returns true
  // if any counter style is changed, false elsewise. This method should
  // be called when any counter style may be affected.
  ;

  

  NS_INLINE_DECL_REFCOUNTING(CounterStyleManager)

private:
  nsPresContext* mPresContext;
  nsRefPtrHashtable<nsStringHashKey, CounterStyle> mCacheTable;
};

} // namespace mozilla

#endif /* !defined(mozilla_CounterStyleManager_h_) */
# 190 "../../dist/include/CounterStyleManager.h"
# 31 "../../dist/include/nsStyleStruct.h" 2

class nsIFrame;
class nsIURI;
class imgIContainer;

// Includes nsStyleStructID.
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructFwd.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructFwd.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Forward declarations to avoid including all of nsStyleStruct.h.
 */

#ifndef nsStyleStructFwd_h_
#define nsStyleStructFwd_h_

enum nsStyleStructID {

/*
 * Define the constants eStyleStruct_Font, etc.
 *
 * The C++ standard, section 7.2, guarantees that enums begin with 0 and
 * increase by 1.
 *
 * We separate the IDs of Reset and Inherited structs so that we can use
 * the IDs as indices (offset by nsStyleStructID_*_Start) into arrays of
 * one type or the other.
 */

nsStyleStructID_None = -1,
nsStyleStructID_Inherited_Start = 0,
// a dummy value so the value after it is the same as ..._Inherited_Start
nsStyleStructID_DUMMY1 = nsStyleStructID_Inherited_Start - 1,

#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  eStyleStruct_##name,
#define STYLE_STRUCT_RESET(name, checkdata_cb)
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructList.h" 1
/* THIS FILE IS AUTOGENERATED BY generate-stylestructlist.py - DO NOT EDIT */

// IWYU pragma: private, include "nsStyleStructFwd.h"

/*
 * list of structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#endif
# 27 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_DEP
#define STYLE_STRUCT_DEP(dep)
#define UNDEF_STYLE_STRUCT_DEP
#endif
# 32 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_END
#define STYLE_STRUCT_END()
#define UNDEF_STYLE_STRUCT_END
#endif
# 37 "../../dist/include/nsStyleStructList.h"

#ifdef STYLE_STRUCT_TEST
#define STYLE_STRUCT_TEST_CODE(c) c
#else
# 41 "../../dist/include/nsStyleStructList.h"
#define STYLE_STRUCT_TEST_CODE(c)
#endif
# 43 "../../dist/include/nsStyleStructList.h"

// The inherited structs are listed before the Reset structs.
// nsStyleStructID assumes this is the case, and callers other than
// nsStyleStructFwd.h that want the structs in id-order just define
// STYLE_STRUCT rather than including the file twice.


  STYLE_STRUCT_TEST_CODE(if (STYLE_STRUCT_TEST < 8) {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 4) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 2) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 0) {)
STYLE_STRUCT_INHERITED(Font, CheckFontCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Color, CheckColorCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 2) {)
STYLE_STRUCT_INHERITED(List, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Text, CheckTextCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 6) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 4) {)
STYLE_STRUCT_INHERITED(Visibility, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Quotes, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 6) {)
STYLE_STRUCT_INHERITED(UserInterface, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(TableBorder, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 16) {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 12) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 10) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 8) {)
STYLE_STRUCT_INHERITED(SVG, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Variables, CheckVariablesCallback)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 10) {)
STYLE_STRUCT_RESET(Background, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Position, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
nsStyleStructID_Reset_Start,
// a dummy value so the value after it is the same as ..._Reset_Start
nsStyleStructID_DUMMY2 = nsStyleStructID_Reset_Start - 1,

#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  eStyleStruct_##name,
#define STYLE_STRUCT_INHERITED(name, checkdata_cb)
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructList.h" 1
/* THIS FILE IS AUTOGENERATED BY generate-stylestructlist.py - DO NOT EDIT */

// IWYU pragma: private, include "nsStyleStructFwd.h"

/*
 * list of structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#endif
# 27 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_DEP
#define STYLE_STRUCT_DEP(dep)
#define UNDEF_STYLE_STRUCT_DEP
#endif
// The inherited structs are listed before the Reset structs.
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 10) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 8) {)
STYLE_STRUCT_INHERITED(SVG, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Variables, CheckVariablesCallback)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 10) {)
STYLE_STRUCT_RESET(Background, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Position, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 14) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 12) {)
STYLE_STRUCT_RESET(TextReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Display, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 14) {)
STYLE_STRUCT_RESET(Content, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(UIReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(} else {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 20) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 18) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 16) {)
STYLE_STRUCT_RESET(Table, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Margin, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 18) {)
STYLE_STRUCT_RESET(Padding, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Border, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 22) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 20) {)
STYLE_STRUCT_RESET(Outline, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(XUL, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 22) {)
STYLE_STRUCT_RESET(SVGReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Column, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
#undef STYLE_STRUCT_INHERITED
#undef STYLE_STRUCT_RESET

// one past the end; length of 0-based list
nsStyleStructID_Length,

nsStyleStructID_Inherited_Count =
  nsStyleStructID_Reset_Start - nsStyleStructID_Inherited_Start,
nsStyleStructID_Reset_Count =
  nsStyleStructID_Length - nsStyleStructID_Reset_Start,

// An ID used for properties that are not in style structs.  This is
// used only in some users of nsStyleStructID, such as
// nsCSSProps::kSIDTable, including some that store SIDs in a bitfield,
// such as nsCSSCompressedDataBlock::mStyleBits.
eStyleStruct_BackendOnly = nsStyleStructID_Length

};

// A bit corresponding to each struct ID
#define NS_STYLE_INHERIT_BIT(sid_)        (1 << uint64_t(eStyleStruct_##sid_))

#endif /* nsStyleStructFwd_h_ */
# 69 "../../dist/include/nsStyleStructFwd.h"
# 38 "../../dist/include/nsStyleStruct.h" 2

// Bits for each struct.

struct nsStyleFont {
  ;
  nsFont  mFont;        // [inherited]
  nscoord mSize;        // [inherited] Our "computed size". Can be different
                        // from mFont.size which is our "actual size" and is
                        // enforced to be >= the user's preferred min-size.
                        // mFont.size should be used for display purposes
                        // while mSize is the value to return in
                        // getComputedStyle() for example.
  uint8_t mGenericID;   // [inherited] generic CSS font family, if any;
                        // value is a kGenericFont_* constant, see nsFont.h.

  // MathML scriptlevel support
  int8_t  mScriptLevel;          // [inherited]
  // MathML  mathvariant support
};

struct nsStyleGradientStop {
  nsStyleCoord mLocation; // percent, coord, calc, none
  nscolor mColor;
  bool mIsInterpolationHint;

  // Use ==/!= on nsStyleGradient instead of on the gradient stop.
  bool operator==(const nsStyleGradientStop&) const = delete;
  bool operator!=(const nsStyleGradientStop&) const = delete;
};

class nsStyleGradient MOZ_FINAL {
public:
  nsStyleGradient();
  uint8_t mShape;  // NS_STYLE_GRADIENT_SHAPE_*
  uint8_t mSize;   // NS_STYLE_GRADIENT_SIZE_*;
                   // not used (must be FARTHEST_CORNER) for linear shape
  bool mRepeating;
  bool mLegacySyntax;

  nsStyleCoord mBgPosX; // percent, coord, calc, none
  nsStyleCoord mBgPosY; // percent, coord, calc, none
  nsStyleCoord mAngle;  // none, angle

  nsStyleCoord mRadiusX; // percent, coord, calc, none
  nsStyleCoord mRadiusY; // percent, coord, calc, none

  // stops are in the order specified in the stylesheet
  nsTArray<nsStyleGradientStop> mStops;

  bool operator==(const nsStyleGradient& aOther) const;
};

enum nsStyleImageType {
  eStyleImageType_Null,
  eStyleImageType_Image,
  eStyleImageType_Gradient,
  eStyleImageType_Element
};

/**
 * Represents a paintable image of one of the following types.
 * (1) A real image loaded from an external source.
 * (2) A CSS linear or radial gradient.
 * (3) An element within a document, or an <img>, <video>, or <canvas> element
 *     not in a document.
 * (*) Optionally a crop rect can be set to paint a partial (rectangular)
 * region of an image. (Currently, this feature is only supported with an
 * image of type (1)).
 */
struct nsStyleImage {
  nsStyleImage();
  ~nsStyleImage();
  nsStyleImage(const nsStyleImage& aOther);
  ;

  ;
  ;
  void TrackImage(nsPresContext* aContext);
  void UntrackImage(nsPresContext* aContext);
  ;
  ;
  ;

  nsStyleImageType GetType() const {
    return mType;
  }
  imgRequestProxy* GetImageData() const {
    MOZ_ASSERT(mType == eStyleImageType_Image, "Data is not an image!");
    MOZ_ASSERT(mImageTracked,
               "Should be tracking any image we're going to use!");
    return mImage;
  }
  
  
  

  /**
  /**
   * @return true if it is 100% confident that this image contains no pixel
   * to draw.
   */
  

  ;
  

  

  // These methods are used for the caller to caches the sub images created
  // during a border-image paint operation
  ;
  ;

private:
  ;

  // Cache for border-image painting.
  nsCOMArray<imgIContainer> mSubImages;

  nsStyleImageType mType;
  union {
    imgRequestProxy* mImage;
    nsStyleGradient* mGradient;
    char16_t* mElementId;
  };
  // This is _currently_ used only in conjunction with eStyleImageType_Image.
  nsAutoPtr<nsStyleSides> mCropRect;
#ifdef DEBUG
  bool mImageTracked;
#endif
# 323 "../../dist/include/nsStyleStruct.h"
};

struct nsStyleColor {
  ;
  ;
  ~nsStyleColor(void) {
    MOZ_COUNT_DTOR(nsStyleColor);
  }

  ;
  
  

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleColor();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleColor_id, this);
  }

  // Don't add ANY members to this struct!  We can achieve caching in the rule
  // tree (rather than the style tree) by letting color stay by itself! -dwh
  nscolor mColor;                 // [inherited]
};

struct nsStyleBackground {
  ;
  ;
  ;

  
  void Destroy(nsPresContext* aContext);

  ;
  
  

  struct Position;
  friend struct Position;
  struct Position {
    typedef nsStyleCoord::CalcValue PositionCoord;
    PositionCoord mXPosition, mYPosition;

    // Initialize nothing
    

    // Sets both mXPosition and mYPosition to the given percent value for the
    // initial property-value (e.g. 0.0f for "0% 0%", or 0.5f for "50% 50%")
    ;

    // Sets both mXPosition and mYPosition to 0 (app units) for the
    // initial property-value as a length with no percentage component.
    ;

    // True if the effective background image position described by this depends
    // on the size of the corresponding frame.
    

    
    
  };

  struct Size;
  friend struct Size;
  struct Size {
    struct Dimension : public nsStyleCoord::CalcValue {
      
    };
    Dimension mWidth, mHeight;

    

    

    // Except for eLengthPercentage, Dimension types which might change
    // how a layer is painted when the corresponding frame's dimensions
    // change *must* precede all dimension types which are agnostic to
    // frame size; see DependsOnDependsOnPositioningAreaSizeSize.
    enum DimensionType {
      // If one of mWidth and mHeight is eContain or eCover, then both are.
      // NOTE: eContain and eCover *must* be equal to NS_STYLE_BG_SIZE_CONTAIN
      // and NS_STYLE_BG_SIZE_COVER (in kBackgroundSizeKTable).
      eContain, eCover,

      eAuto,
      eLengthPercentage,
      eDimensionType_COUNT
    };
    uint8_t mWidthType, mHeightType;

    // True if the effective image size described by this depends on the size of
    // the corresponding frame, when aImage (which must not have null type) is
    // the background image.
    ;

    // Initialize nothing
    

    // Initialize to initial values
    ;

    ;
    
  };
  
  struct Repeat;
  friend struct Repeat;
  struct Repeat {
    uint8_t mXRepeat, mYRepeat;
    
    // Initialize nothing
    

    // Initialize to initial values
    ;

    
    
  };

  struct Layer;
  friend struct Layer;
  struct Layer {
    uint8_t mAttachment;                // [reset] See nsStyleConsts.h
    uint8_t mClip;                      // [reset] See nsStyleConsts.h
    uint8_t mOrigin;                    // [reset] See nsStyleConsts.h
    uint8_t mBlendMode;                 // [reset] See nsStyleConsts.h
    // True if the rendering of this layer might change when the size
    // of the background positioning area changes.  This is true for any
    // non-solid-color background whose position or size depends on
    // the size of the positioning area.  It's also true for SVG images
    // whose root <svg> node has a viewBox.
    ;

    // An equality operator that compares the images using URL-equality
    // rather than pointer-equality.
    ;
    
  };

  // The (positive) number of computed values of each property, since
  // the lengths of the lists are independent.
  uint32_t mAttachmentCount,
           mClipCount,
           mOriginCount,
           mRepeatCount,
           mPositionCount,
           mImageCount,
           mSizeCount,
           mBlendModeCount;
  // Layers are stored in an array, matching the top-to-bottom order in
  // which they are specified in CSS.  The number of layers to be used
  // should come from the background-image property.  We create
  // additional |Layer| objects for *any* property, not just
  // background-image.  This means that the bottommost layer that
  // callers in layout care about (which is also the one whose
  // background-clip applies to the background-color) may not be last
  // layer.  In layers below the bottom layer, properties will be
  // uninitialized unless their count, above, indicates that they are

  // We have to take slower codepaths for fixed background attachment,
  // but we don't want to do that when there's no image.
  // Not inline because it uses an nsCOMPtr<imgIRequest>
  // FIXME: Should be in nsStyleStructInlines.h.
  ;
};

// See https://bugzilla.mozilla.org/show_bug.cgi?id=271586#c43 for why
// this is hard to replace with 'currentColor'.
#define BORDER_COLOR_FOREGROUND   0x20
#define OUTLINE_COLOR_INITIAL     0x80
// FOREGROUND | INITIAL(OUTLINE)
#define BORDER_COLOR_SPECIAL      0xA0
#define BORDER_STYLE_MASK         0x1F

#define NS_SPACING_MARGIN   0
#define NS_SPACING_PADDING  1
#define NS_SPACING_BORDER   2


struct nsStyleMargin {
  ;
  ;
  

  
  void Destroy(nsPresContext* aContext);

  ;
  ;
  
  

  nsStyleSides  mMargin;          // [reset] coord, percent, calc, auto

  
  

protected:
  bool          mHasCachedMargin;
  nsMargin      mCachedMargin;
};


struct nsStylePadding {
  ;
  ;
private:
  ;
};

struct nsCSSShadowItem {
  nscoord mXOffset;
  nscoord mYOffset;
  nscoord mRadius;
  nscoord mSpread;

  nscolor      mColor;
  bool mHasColor; // Whether mColor should be used
  bool mInset;

  
  ~nsCSSShadowItem() {
    MOZ_COUNT_DTOR(nsCSSShadowItem);
  }

  
  
};

class nsCSSShadowArray MOZ_FINAL {
  public:
    

    

private:
    // Private destructor, to discourage deletion outside of Release():
    ~nsCSSShadowArray() {
      MOZ_COUNT_DTOR(nsCSSShadowArray);
      for (uint32_t i = 1; i < mLength; ++i) {
        mArray[i].~nsCSSShadowItem();
      }
    }

public:
    
    
    

    

    

    NS_INLINE_DECL_REFCOUNTING(nsCSSShadowArray)

  private:
    uint32_t mLength;
    nsCSSShadowItem mArray[1]; // This MUST be the last item
};

// Border widths are rounded to the nearest-below integer number of pixels,
// but values between zero and one device pixels are always rounded up to
// one device pixel.
#define NS_ROUND_BORDER_TO_PIXELS(l,tpp) \
  ((l) == 0) ? 0 : std::max((tpp), (l) / (tpp) * (tpp))
// Outline offset is rounded to the nearest integer number of pixels, but values
// between zero and one device pixels are always rounded up to one device pixel.
// Note that the offset can be negative.
#define NS_ROUND_OFFSET_TO_PIXELS(l,tpp) \
  (((l) == 0) ? 0 : \
    ((l) > 0) ? std::max( (tpp), ((l) + ((tpp) / 2)) / (tpp) * (tpp)) : \
                std::min(-(tpp), ((l) - ((tpp) / 2)) / (tpp) * (tpp)))

// Returns if the given border style type is visible or not


struct nsStyleBorder {
  ;
  ;
  ;

  
  void Destroy(nsPresContext* aContext);

  ;
  

  uint8_t       mBorderStyle[4];  // [reset] See nsStyleConsts.h
  nscolor       mBorderColor[4];  // [reset] the colors to use for a simple
                                  // border.  not used for -moz-border-colors
private:
  nscoord       mTwipsPerPixel;

  nsStyleBorder& operator=(const nsStyleBorder& aOther) = delete;
};


struct nsStyleOutline {
  explicit nsStyleOutline(nsPresContext* aPresContext);
  nsStyleOutline(const nsStyleOutline& aOutline);
  ~nsStyleOutline(void) {
    MOZ_COUNT_DTOR(nsStyleOutline);
  }

  

  

  

protected:
  // This value is the actual value, so it's rounded to the nearest device
  // pixel.
  nscoord       mCachedOutlineWidth;

  nscolor       mOutlineColor;    // [reset]

  bool          mHasCachedOutline;
  uint8_t       mOutlineStyle;    // [reset] See nsStyleConsts.h

  nscoord       mTwipsPerPixel;
};


struct nsStyleList {
  ;
  ;
  ~nsStyleList(void);

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleList();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleList_id, this);
  }

  nsChangeHint CalcDifference(const nsStyleList& aOther) const;
  static nsChangeHint MaxDifference() {
    return NS_CombineHint(NS_STYLE_HINT_FRAMECHANGE,
                          nsChangeHint_NeutralChange);
  }
  static nsChangeHint MaxDifferenceNeverInherited() {
    // CalcDifference never returns nsChangeHint_NeedReflow or
    // nsChangeHint_ClearAncestorIntrinsics as inherited hints.
    return NS_CombineHint(nsChangeHint_NeedReflow,
                          nsChangeHint_ClearAncestorIntrinsics);
  }

  imgRequestProxy* GetListStyleImage() const { return mListStyleImage; }
  void SetListStyleImage(imgRequestProxy* aReq)
  {
    if (mListStyleImage)
      mListStyleImage->UnlockImage();
    mListStyleImage = aReq;
    if (mListStyleImage)
      mListStyleImage->LockImage();
  }

  void GetListStyleType(nsSubstring& aType) const { aType = mListStyleType; }
  mozilla::CounterStyle* GetCounterStyle() const
  {
    return mCounterStyle.get();
  }
  void SetListStyleType(const nsSubstring& aType,
                        mozilla::CounterStyle* aStyle)
  {
    mListStyleType = aType;
    mCounterStyle = aStyle;
  }
  void SetListStyleType(const nsSubstring& aType,
                        nsPresContext* aPresContext)
  {
    SetListStyleType(aType, aPresContext->
                     CounterStyleManager()->BuildCounterStyle(aType));
  }

  uint8_t   mListStylePosition;         // [inherited]
private:
  nsString  mListStyleType;             // [inherited]
  nsRefPtr<mozilla::CounterStyle> mCounterStyle; // [inherited]
  nsRefPtr<imgRequestProxy> mListStyleImage; // [inherited]
  nsStyleList& operator=(const nsStyleList& aOther) = delete;
public:
  nsRect        mImageRegion;           // [inherited] the rect to use within an image
};

// Computed value of the grid-template-columns or grid-columns-rows property
// (but *not* grid-template-areas.)
// http://dev.w3.org/csswg/css-grid/#track-sizing
//
// This represents either:
// * none:
//   mIsSubgrid is false, all three arrays are empty
// * <track-list>:
//   mIsSubgrid is false,
//   mMinTrackSizingFunctions and mMaxTrackSizingFunctions
//   are of identical non-zero size,
//   and mLineNameLists is one element longer than that.
struct nsStyleGridLine {
  // http://dev.w3.org/csswg/css-grid/#typedef-grid-line
  bool mHasSpan;
  int32_t mInteger;  // 0 means not provided
  nsString mLineName;  // Empty string means not provided.

  

  

  void operator=(const nsStyleGridLine& aOther)
  {
    mHasSpan = aOther.mHasSpan;
    mInteger = aOther.mInteger;
    mLineName = aOther.mLineName;
  }

  

  

  

  
};

struct nsStylePosition {
  ;
  // for it, since it is the most common case.
  // FIXME: We should probably change the assumption to be the other way
  // around.
  
  // This method is defined in nsStyleStructInlines.h.
  /* Returns whether the element has the -moz-transform property
   * or a related property, and supports CSS transforms. */
  ;

private:
  static bool WidthCoordDependsOnContainer(const nsStyleCoord &aCoord);
  
};

struct nsStyleTextOverflowSide {
  

  
  

  nsString mString;
  uint8_t  mType;
};

struct nsStyleTextOverflow {
  
  
  

  // Returns the value to apply on the left side.
  

  // Returns the value to apply on the right side.
  

  // Returns the first value that was specified.
  

  // Returns the second value, or null if there was only one value specified.
  

  nsStyleTextOverflowSide mLeft;  // start side when mLogicalDirections is true
  nsStyleTextOverflowSide mRight; // end side when mLogicalDirections is true
  bool mLogicalDirections;  // true when only one value was specified
};

struct nsStyleTextReset {
  ;
  ;
  ~nsStyleTextReset(void);

  
  ;
  
  

  nsStyleCoord  mVerticalAlign;         // [reset] coord, percent, calc, enum (see nsStyleConsts.h)
  nsStyleTextOverflow mTextOverflow;    // [reset] enum, string

  uint8_t mTextDecorationLine;          // [reset] see nsStyleConsts.h
  uint8_t mUnicodeBidi;                 // [reset] see nsStyleConsts.h
protected:
  uint8_t mTextDecorationStyle;         // [reset] see nsStyleConsts.h

  nscolor mTextDecorationColor;         // [reset] the colors to use for a decoration lines, not used at currentColor
};

struct nsStyleText {
  uint8_t mTextAlignLast;               // [inherited] see nsStyleConsts.h
  bool mTextAlignTrue : 1;              // [inherited] see nsStyleConsts.h
  bool mTextAlignLastTrue : 1;          // [inherited] see nsStyleConsts.h
  uint8_t mTextTransform;               // [inherited] see nsStyleConsts.h
  uint8_t mWhiteSpace;                  // [inherited] see nsStyleConsts.h
  uint8_t mWordBreak;                   // [inherited] see nsStyleConsts.h
  uint8_t mWordWrap;                    // [inherited] see nsStyleConsts.h
  uint8_t mHyphens;                     // [inherited] see nsStyleConsts.h
  // style struct is for.  If the frame is for SVG text, the return
  // value will be massaged to be something that makes sense for
  // SVG text.
  ;
  ;
};

struct nsStyleImageOrientation {
  

  

  

protected:
  enum Bits {
    ORIENTATION_MASK = 0x1 | 0x2,  // The bottom two bits are the angle.
    FLIP_MASK        = 0x4,        // Whether the image should be flipped.
    FROM_IMAGE_MASK  = 0x8,        // Whether the image's inherent orientation
  };                               // should be used.

  enum Angles {
    ANGLE_0   = 0,
    ANGLE_90  = 1,
    ANGLE_180 = 2,
    ANGLE_270 = 3,
  };

  

  uint8_t mOrientation;
};

struct nsStyleVisibility {
  ;
  ;
  ~nsStyleVisibility() {
    MOZ_COUNT_DTOR(nsStyleVisibility);
  }

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleVisibility();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleVisibility_id, this);
  }

  ;
  
  

  nsStyleImageOrientation mImageOrientation;  // [inherited]
  uint8_t mDirection;                  // [inherited] see nsStyleConsts.h NS_STYLE_DIRECTION_*
  uint8_t mVisible;                    // [inherited]
  uint8_t mPointerEvents;              // [inherited] see nsStyleConsts.h
  uint8_t mWritingMode;                // [inherited] see nsStyleConsts.h
  uint8_t mTextOrientation;            // [inherited] see nsStyleConsts.h

  

  

  ;
};

struct nsTimingFunction {
  enum Type { Function, StepStart, StepEnd };

  

  


  

  

private:
  ;
};

namespace mozilla {

struct StyleTransition {
  
  ;

  ;
  

  

  ;
  

private:
  nsTimingFunction mTimingFunction;
  float mDuration;
  float mDelay;
  nsCSSProperty mProperty;
  nsCOMPtr<nsIAtom> mUnknownProperty; // used when mProperty is
                                      // eCSSProperty_UNKNOWN
};

struct StyleAnimation {
  
  ;
  float mDelay;
  nsString mName; // empty string for 'none'
  uint8_t mDirection;
  uint8_t mFillMode;
  uint8_t mPlayState;
  float mIterationCount; // mozilla::PositiveInfinity<float>() means infinite
};

} // namespace mozilla

struct nsStyleDisplay {
  ;
  ;
  uint8_t mScrollSnapTypeY;     // [reset] see nsStyleConsts.h NS_STYLE_SCROLL_SNAP_TYPE_*
  ;
  ;
  ;
  ;
  ;
  ;
};

struct nsStyleTable {
  ;
  ;
  ~nsStyleTable(void);

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleTable();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleTable_id, this);
  }

  ;
  
  

  uint8_t       mLayoutStrategy;// [reset] see nsStyleConsts.h NS_STYLE_TABLE_LAYOUT_*
  int32_t       mSpan;          // [reset] the number of columns spanned by a colgroup or col
};

struct nsStyleTableBorder {
  ;
  ;
  uint8_t       mCaptionSide;   // [inherited]
  uint8_t       mEmptyCells;    // [inherited]
};

enum nsStyleContentType {
  eStyleContentType_String        = 1,
  eStyleContentType_Image         = 10,
  eStyleContentType_Attr          = 20,
  eStyleContentType_Counter       = 30,
  eStyleContentType_Counters      = 31,
  eStyleContentType_OpenQuote     = 40,
  eStyleContentType_CloseQuote    = 41,
  eStyleContentType_NoOpenQuote   = 42,
  eStyleContentType_NoCloseQuote  = 43,
  eStyleContentType_AltContent    = 50,
  eStyleContentType_Uninitialized
};

struct nsStyleContentData {
  nsStyleContentType  mType;
  union {
    char16_t *mString;
    imgRequestProxy *mImage;
    nsCSSValue::Array* mCounters;
  } mContent;
#ifdef DEBUG
  bool mImageTracked;
#endif
# 2322 "../../dist/include/nsStyleStruct.h"

  

  ;
  ;
  ;

  

  ;
  ;

  
private:
  ; // not to be implemented
};

struct nsStyleCounterData {
  nsString  mCounter;
  int32_t   mValue;
};


#define DELETE_ARRAY_IF(array)  if (array) { delete[] array; array = nullptr; }

struct nsStyleQuotes {
  ;
  ;
  ~nsStyleQuotes();

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleQuotes();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleQuotes_id, this);
  }

  ;
  ;

  ;
  
  

   // [inherited]

  
  
  

  

  

protected:
  uint32_t            mQuotesCount;
  nsString*           mQuotes;
};

struct nsStyleContent {
  ;
  ;
  ;

  
  void Destroy(nsPresContext* aContext);


  uint32_t            mContentCount;
  uint32_t            mIncrementCount;
  uint32_t            mResetCount;
};

struct nsStyleUIReset {
  ;
  ;
  ~nsStyleUIReset(void);

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleUIReset();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleUIReset_id, this);
  }

  ;
  
  

  uint8_t   mUserSelect;      // [reset] (selection-style)
  uint8_t   mForceBrokenImageIcon; // [reset]  (0 if not forcing, otherwise forcing)
  uint8_t   mIMEMode;         // [reset]
  uint8_t   mWindowShadow;    // [reset]
};

struct nsCursorImage {
  bool mHaveHotspot;
  float mHotspotX, mHotspotY;

  ;
  ;
  ;

  ;
  /*
   * We hide mImage and force access through the getter and setter so that we
   * can lock the images we use. Cursor images are likely to be small, so we
   * don't care about discarding them. See bug 512260.
   * */
  
  

private:
  nsCOMPtr<imgIRequest> mImage;
};

struct nsStyleUserInterface {
  ;
  ;
  ~nsStyleUserInterface(void);

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleUserInterface();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleUserInterface_id, this);
  }

  ;
  
  
  ;
};

struct nsStyleXUL {
  ;
  ;
  ~nsStyleXUL();

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleXUL();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleXUL_id, this);
  }

  ;
  
  

  float         mBoxFlex;               // [reset] see nsStyleConsts.h
  uint32_t      mBoxOrdinal;            // [reset] see nsStyleConsts.h
  uint8_t       mBoxAlign;              // [reset] see nsStyleConsts.h
  uint8_t       mBoxDirection;          // [reset] see nsStyleConsts.h
  uint8_t       mBoxOrient;             // [reset] see nsStyleConsts.h
  uint8_t       mBoxPack;               // [reset] see nsStyleConsts.h
  bool          mStretchStack;          // [reset] see nsStyleConsts.h
};

struct nsStyleColumn {
  ;
  ;
  ~nsStyleColumn();
  

protected:
  nscoord mColumnRuleWidth;  // [reset] coord
  nscoord mTwipsPerPixel;
};

enum nsStyleSVGPaintType {
  eStyleSVGPaintType_None = 1,
  eStyleSVGPaintType_Color,
  eStyleSVGPaintType_Server,
  eStyleSVGPaintType_ContextFill,
  eStyleSVGPaintType_ContextStroke
};

enum nsStyleSVGOpacitySource {
  eStyleSVGOpacitySource_Normal,
  eStyleSVGOpacitySource_ContextFillOpacity,
  eStyleSVGOpacitySource_ContextStrokeOpacity
};

struct nsStyleSVGPaint
{
  union {
    nscolor mColor;
    nsIURI *mPaintServer;
  } mPaint;
  nsStyleSVGPaintType mType;
  nscolor mFallbackColor;

  
  ;
  ;
  ;
  ;

  
};

struct nsStyleSVG {
  ;
  ;
  ~nsStyleSVG();

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleSVG();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleSVG_id, this);
  }

  ;
  
  // Use 3 bits to avoid signedness problems in MSVC.
  nsStyleSVGOpacitySource mFillOpacitySource    : 3;
  nsStyleSVGOpacitySource mStrokeOpacitySource  : 3;

  // SVG glyph outer object inheritance for other properties
  bool mStrokeDasharrayFromObject   : 1;
  bool mStrokeDashoffsetFromObject  : 1;
  bool mStrokeWidthFromObject       : 1;

  

  /**
   * Returns true if the stroke is not "none" and the stroke-opacity is greater
   * than zero. This ignores stroke-widths as that depends on the context.
   */
  

  /**
   * Returns true if the fill is not "none" and the fill-opacity is greater
   * than zero.
   */
  
};

class nsStyleBasicShape MOZ_FINAL {
public:
  enum Type {
    eInset,
    eCircle,
    eEllipse,
    ePolygon
  };

  

  

  
  

  typedef nsStyleBackground::Position Position;
  
  
private:
  ~nsStyleBasicShape() {}

  Type mType;
  int32_t mFillRule;

  // mCoordinates has coordinates for polygon or radii for
  // ellipse and circle.
  nsTArray<nsStyleCoord> mCoordinates;
  Position mPosition;
  nsStyleCorners mRadius;
};

struct nsStyleClipPath
{
  ;
  ;
  ;

  ;

  bool operator==(const nsStyleClipPath& aOther) const;
  

  

  
  ;

  

  void SetBasicShape(nsStyleBasicShape* mBasicShape,
                     uint8_t aSizingBox = NS_STYLE_CLIP_SHAPE_SIZING_NOBOX);

  uint8_t GetSizingBox() const { return mSizingBox; }
  void SetSizingBox(uint8_t aSizingBox);

private:
  void ReleaseRef();
  void* operator new(size_t) = delete;

  int32_t mType; // see NS_STYLE_CLIP_PATH_* constants in nsStyleConsts.h
  union {
    nsStyleBasicShape* mBasicShape;
    nsIURI* mURL;
  };
  uint8_t mSizingBox; // see NS_STYLE_CLIP_SHAPE_SIZING_* constants in nsStyleConsts.h
};

struct nsStyleFilter {
  nsStyleFilter();
  nsStyleFilter(const nsStyleFilter& aSource);
  ;

  ;

  bool operator==(const nsStyleFilter& aOther) const;
  

  

  
  ;

  
  ;

  
  ;

private:
  ;

  int32_t mType; // see NS_STYLE_FILTER_* constants in nsStyleConsts.h
  nsStyleCoord mFilterParameter; // coord, percent, factor, angle
  union {
    nsIURI* mURL;
    nsCSSShadowArray* mDropShadow;
  };
};

template<>
struct nsTArray_CopyChooser<nsStyleFilter> {
  typedef nsTArray_CopyWithConstructors<nsStyleFilter> Type;
};

struct nsStyleSVGReset {
  ;
  ;
  ~nsStyleSVGReset();

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleSVGReset();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleSVGReset_id, this);
  }

  ;
  
  

  

  

  nsStyleClipPath mClipPath;          // [reset]
  nsTArray<nsStyleFilter> mFilters;   // [reset]
  nsCOMPtr<nsIURI> mMask;             // [reset]
  nscolor          mStopColor;        // [reset]
  nscolor          mFloodColor;       // [reset]
  nscolor          mLightingColor;    // [reset]

  float            mStopOpacity;      // [reset]
  float            mFloodOpacity;     // [reset]

  uint8_t          mDominantBaseline; // [reset] see nsStyleConsts.h
  uint8_t          mVectorEffect;     // [reset] see nsStyleConsts.h
  uint8_t          mMaskType;         // [reset] see nsStyleConsts.h
};

struct nsStyleVariables {
  ;
  ;
  ~nsStyleVariables();

  
  void Destroy(nsPresContext* aContext) {
    this->~nsStyleVariables();
    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsStyleVariables_id, this);
  }

  nsChangeHint CalcDifference(const nsStyleVariables& aOther) const;
  static nsChangeHint MaxDifference() {
    return nsChangeHint(0);
  }
  static nsChangeHint MaxDifferenceNeverInherited() {
    // CalcDifference never returns nsChangeHint_NeedReflow or
    // nsChangeHint_ClearAncestorIntrinsics at all.
    return nsChangeHint(0);
  }

  mozilla::CSSVariableValues mVariables;
};

#endif /* nsStyleStruct_h___ */
# 3143 "../../dist/include/nsStyleStruct.h"
# 16 "../../dist/include/nsRuleNode.h" 2

class nsStyleContext;
struct nsRuleData;
class nsIStyleRule;
struct nsCSSValueList;

class nsCSSValue;
struct nsCSSRect;

class nsStyleCoord;
struct nsCSSValuePairList;

template <nsStyleStructID MinIndex, nsStyleStructID Count>
class FixedStyleStructArray
{
private:
  void* mArray[Count];
public:
  void*& operator[](nsStyleStructID aIndex) {
    MOZ_ASSERT(MinIndex <= aIndex && aIndex < (MinIndex + Count),
               "out of range");
    return mArray[aIndex - MinIndex];
  }

  const void* operator[](nsStyleStructID aIndex) const {
    MOZ_ASSERT(MinIndex <= aIndex && aIndex < (MinIndex + Count),
               "out of range");
    return mArray[aIndex - MinIndex];
  }
};

struct nsInheritedStyleData
{
  FixedStyleStructArray<nsStyleStructID_Inherited_Start,
                        nsStyleStructID_Inherited_Count> mStyleStructs;

  void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
    return aContext->PresShell()->
      AllocateByObjectID(nsPresArena::nsInheritedStyleData_id, sz);
  }

  void DestroyStructs(uint64_t aBits, nsPresContext* aContext) {
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#endif
# 27 "../../dist/include/nsStyleStructList.h"
    for (nsStyleStructID i = nsStyleStructID_Inherited_Start;
         i < nsStyleStructID_Inherited_Start + nsStyleStructID_Inherited_Count;
         i = nsStyleStructID(i + 1)) {
      mStyleStructs[i] = nullptr;
    }
  }
};

struct nsResetStyleData
{
  FixedStyleStructArray<nsStyleStructID_Reset_Start,
                        nsStyleStructID_Reset_Count> mStyleStructs;

  nsResetStyleData()
  {
    for (nsStyleStructID i = nsStyleStructID_Reset_Start;
         i < nsStyleStructID_Reset_Start + nsStyleStructID_Reset_Count;
         i = nsStyleStructID(i + 1)) {
      mStyleStructs[i] = nullptr;
    }
  }

  void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW {
    return aContext->PresShell()->
      AllocateByObjectID(nsPresArena::nsResetStyleData_id, sz);
  }

  void Destroy(uint64_t aBits, nsPresContext* aContext) {
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
    void *name##Data = mStyleStructs[eStyleStruct_##name]; \
    if (name##Data && !(aBits & NS_STYLE_INHERIT_BIT(name))) \
      static_cast<nsStyle##name*>(name##Data)->Destroy(aContext);
#define STYLE_STRUCT_INHERITED(name, checkdata_cb)

#if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructList.h" 1
/* THIS FILE IS AUTOGENERATED BY generate-stylestructlist.py - DO NOT EDIT */

// IWYU pragma: private, include "nsStyleStructFwd.h"

/*
 * list of structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#endif
# 27 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_DEP
#define STYLE_STRUCT_DEP(dep)
#define UNDEF_STYLE_STRUCT_DEP
#endif
# 32 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_END
#define STYLE_STRUCT_END()
#define UNDEF_STYLE_STRUCT_END
#endif
# 37 "../../dist/include/nsStyleStructList.h"

#ifdef STYLE_STRUCT_TEST
#define STYLE_STRUCT_TEST_CODE(c) c
#else
# 41 "../../dist/include/nsStyleStructList.h"
#define STYLE_STRUCT_TEST_CODE(c)
#endif
# 43 "../../dist/include/nsStyleStructList.h"

// The inherited structs are listed before the Reset structs.
// nsStyleStructID assumes this is the case, and callers other than
// nsStyleStructFwd.h that want the structs in id-order just define
// STYLE_STRUCT rather than including the file twice.
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 2) {)
STYLE_STRUCT_INHERITED(List, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Text, CheckTextCallback)
STYLE_STRUCT_DEP(Variables)
#undef STYLE_STRUCT_INHERITED

    aContext->PresShell()->
      FreeByObjectID(nsPresArena::nsResetStyleData_id, this);
  }
};

struct nsCachedStyleData
{
  nsInheritedStyleData* mInheritedData;
  nsResetStyleData* mResetData;

  static bool IsReset(const nsStyleStructID aSID) {
    MOZ_ASSERT(0 <= aSID && aSID < nsStyleStructID_Length,
               "must be an inherited or reset SID");
    return nsStyleStructID_Reset_Start <= aSID;
  }

  static bool IsInherited(const nsStyleStructID aSID) {
    return !IsReset(aSID);
  }

  static uint32_t GetBitForSID(const nsStyleStructID aSID) {
    return 1 << aSID;
  }

  

  

  // Typesafe and faster versions of the above
  #define STYLE_STRUCT_INHERITED(name_, checkdata_cb_)                   \
    nsStyle##name_ * NS_FASTCALL GetStyle##name_ () {                    \
      return mInheritedData ? static_cast<nsStyle##name_*>(              \
        mInheritedData->mStyleStructs[eStyleStruct_##name_]) : nullptr;  \
    }
  #define STYLE_STRUCT_RESET(name_, checkdata_cb_)                       \
    nsStyle##name_ * NS_FASTCALL GetStyle##name_ () {                    \
      return mResetData ? static_cast<nsStyle##name_*>(                  \
        mResetData->mStyleStructs[eStyleStruct_##name_]) : nullptr;      \
    }
  #if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructList.h" 1
/* THIS FILE IS AUTOGENERATED BY generate-stylestructlist.py - DO NOT EDIT */

// IWYU pragma: private, include "nsStyleStructFwd.h"

/*
 * list of structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#define STYLE_STRUCT_TEST_CODE(c) c
#else
# 41 "../../dist/include/nsStyleStructList.h"
#define STYLE_STRUCT_TEST_CODE(c)
#endif
#ifdef UNDEF_STYLE_STRUCT_INHERITED
#undef STYLE_STRUCT_INHERITED
#undef UNDEF_STYLE_STRUCT_INHERITED
#endif
# 230 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_RESET
#undef STYLE_STRUCT_RESET
#undef UNDEF_STYLE_STRUCT_RESET
#endif
# 235 "../../dist/include/nsStyleStructList.h"
  #undef STYLE_STRUCT_RESET
  #undef STYLE_STRUCT_INHERITED

  

  
  
};

/**
 * nsRuleNode is a node in a lexicographic tree (the "rule tree")
 * indexed by style rules (implementations of nsIStyleRule).
 *
 * The rule tree is owned by the nsStyleSet and is destroyed when the
 * presentation of the document goes away.  It is garbage-collected
 * (using mark-and-sweep garbage collection) during the lifetime of the
 * Since the data represented by an nsIStyleRule are immutable, the data
 * represented by an nsRuleNode are also immutable.
 */

enum nsFontSizeType {
  eFontSize_HTML = 1,
  eFontSize_CSS = 2
};

class nsRuleNode {
public:
  enum RuleDetail {
    eRuleNone, // No props have been specified at all.
    eRulePartialReset, // At least one prop with a non-"inherit" value
                       // has been specified.  No props have been
                       // specified with an "inherit" value.  At least
                       // one prop remains unspecified.
    eRulePartialMixed, // At least one prop with a non-"inherit" value
                       // has been specified.  Some props may also have
                       // been specified with an "inherit" value.  At
                       // least one prop remains unspecified.
    eRulePartialInherited, // Only props with "inherit" values have
                           // have been specified.  At least one prop
                           // remains unspecified.
    eRuleFullReset, // All props have been specified.  None has an
                    // "inherit" value.
    eRuleFullMixed, // All props have been specified.  At least one has
                    // a non-"inherit" value.
    eRuleFullInherited  // All props have been specified with "inherit"
                        // values.
  };

private:
  nsPresContext* const mPresContext; // Our pres context.

  nsRuleNode* const mParent; // A pointer to the parent node in the tree.
                             // This enables us to walk backwards from the
                             // most specific rule matched to the least
                             // specific rule (which is the optimal order to
                             // use for lookups of style properties.
  nsIStyleRule* const mRule; // [STRONG] A pointer to our specific rule.

  nsRuleNode* mNextSibling; // This value should be used only by the
                            // parent, since the parent may store
                            // children in a hash, which means this
                            // pointer is not meaningful.  Order of
                            // siblings is also not meaningful.

  struct Key {
    void* asVoid;
    nsRuleNode* asList;
    PLDHashTable* asHash;
  } mChildren; // Accessed only through the methods below.

  enum {
    kTypeMask = 0x1,
    kListType = 0x0,
    kHashType = 0x1
  };
  enum {
    // Maximum to have in a list before converting to a hashtable.
    // XXX Need to optimize this.
    kMaxChildrenInList = 32
  };

  bool HaveChildren() const {
    return mChildren.asVoid != nullptr;
  }
  
  
  
  
  
  
  ;

  nsCachedStyleData mStyleData;   // Any data we cached on the rule node.

  uint32_t mDependentBits; // Used to cache the fact that we can look up
                           // cached data under a parent rule.
                      // Compute*Data functions don't initialize from
                      // inherited data.

  // Reference count.  This just counts the style contexts that reference this
  // rulenode.  And children the rulenode has had.  When this goes to 0 or
  // stops being 0, we notify the style set.
  // Note, in particular, that when a child is removed mRefCnt is NOT
  // decremented.  This is on purpose; the notifications to the style set are
  // only used to determine when it's worth running GC on the ruletree, and
  // this setup makes it so we only count unused ruletree leaves for purposes
  // of deciding when to GC.  We could more accurately count unused rulenodes
  // by releasing/addrefing our parent when our refcount transitions to or from
  // 0, but it doesn't seem worth it to do that.
  uint32_t mRefCnt;

public:
  // Overloaded new operator that allocates from a presShell arena.
  void* operator new(size_t sz, nsPresContext* aContext) CPP_THROW_NEW;
  void Destroy() { DestroyInternal(nullptr); }

  // Implemented in nsStyleSet.h, since it needs to know about nsStyleSet.
  inline void AddRef();

  // Implemented in nsStyleSet.h, since it needs to know about nsStyleSet.
  inline void Release();

protected:
  void DestroyInternal(nsRuleNode ***aDestroyQueueTail);
  void PropagateDependentBit(nsStyleStructID aSID, nsRuleNode* aHighestNode,
                             void* aStruct);
  void PropagateNoneBit(uint32_t aBit, nsRuleNode* aHighestNode);
  ;

  ;

  ;

  ;

public:
  static nsRuleNode* CreateRootNode(nsPresContext* aPresContext);

  static void EnsureBlockDisplay(uint8_t& display,
                                 bool aConvertListItem = false);
  static void EnsureInlineDisplay(uint8_t& display);

  // Transition never returns null; on out of memory it'll just return |this|.
  nsRuleNode* Transition(nsIStyleRule* aRule, uint8_t aLevel,
                         bool aIsImportantRule);
  nsRuleNode* GetParent() const { return mParent; }
  bool IsRoot() const { return mParent == nullptr; }

  // Return the root of the rule tree that this rule node is in.
  nsRuleNode* RuleTree();
  const nsRuleNode* RuleTree() const {
    return const_cast<nsRuleNode*>(this)->RuleTree();
  }

  // These uint8_ts are really nsStyleSet::sheetType values.
  
  

  /**
   * Has this rule node at some time in its lifetime been the mRuleNode
   * of some style context (as opposed to only being the ancestor of
   * some style context's mRuleNode)?
   */
  ;
  

  // NOTE:  Does not |AddRef|.  Null only for the root.
  
  // NOTE: Does not |AddRef|.  Never null.
  nsPresContext* PresContext() const { return mPresContext; }

  ;

  #define STYLE_STRUCT(name_, checkdata_cb_)                                  \
    const nsStyle##name_* GetStyle##name_(nsStyleContext* aContext,           \
                                          bool aComputeData);
  #if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructList.h" 1
/* THIS FILE IS AUTOGENERATED BY generate-stylestructlist.py - DO NOT EDIT */

// IWYU pragma: private, include "nsStyleStructFwd.h"

/*
 * list of structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#endif
# 27 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_DEP
#define STYLE_STRUCT_DEP(dep)
#define UNDEF_STYLE_STRUCT_DEP
#endif
# 32 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_END
#define STYLE_STRUCT_END()
#define UNDEF_STYLE_STRUCT_END
#endif
# 37 "../../dist/include/nsStyleStructList.h"

#ifdef STYLE_STRUCT_TEST
#define STYLE_STRUCT_TEST_CODE(c) c
#else
# 41 "../../dist/include/nsStyleStructList.h"
#define STYLE_STRUCT_TEST_CODE(c)
#endif
# 43 "../../dist/include/nsStyleStructList.h"

// The inherited structs are listed before the Reset structs.
// nsStyleStructID assumes this is the case, and callers other than
// nsStyleStructFwd.h that want the structs in id-order just define
// STYLE_STRUCT rather than including the file twice.


  STYLE_STRUCT_TEST_CODE(if (STYLE_STRUCT_TEST < 8) {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 4) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 2) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 0) {)
STYLE_STRUCT_INHERITED(Font, CheckFontCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Color, CheckColorCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 2) {)
STYLE_STRUCT_INHERITED(List, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Text, CheckTextCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 6) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 4) {)
STYLE_STRUCT_INHERITED(Visibility, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Quotes, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 6) {)
STYLE_STRUCT_INHERITED(UserInterface, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(TableBorder, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 16) {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 12) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 10) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 8) {)
STYLE_STRUCT_INHERITED(SVG, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Variables, CheckVariablesCallback)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 10) {)
STYLE_STRUCT_RESET(Background, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Position, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 14) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 12) {)
STYLE_STRUCT_RESET(TextReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Display, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 14) {)
STYLE_STRUCT_RESET(Content, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(UIReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(} else {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 20) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 18) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 16) {)
STYLE_STRUCT_RESET(Table, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Margin, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 18) {)
STYLE_STRUCT_RESET(Padding, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Border, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 22) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 20) {)
STYLE_STRUCT_RESET(Outline, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(XUL, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 22) {)
STYLE_STRUCT_RESET(SVGReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Column, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(})

#ifdef UNDEF_STYLE_STRUCT_INHERITED
#undef STYLE_STRUCT_INHERITED
#undef UNDEF_STYLE_STRUCT_INHERITED
#endif
# 230 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_RESET
#undef STYLE_STRUCT_RESET
#undef UNDEF_STYLE_STRUCT_RESET
#endif
# 235 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_DEP
#undef STYLE_STRUCT_DEP
#undef UNDEF_STYLE_STRUCT_DEP
#endif
# 240 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_END
#undef STYLE_STRUCT_END
#undef UNDEF_STYLE_STRUCT_END
#endif
# 245 "../../dist/include/nsStyleStructList.h"

#undef STYLE_STRUCT_TEST_CODE

# 723 "../../dist/include/nsRuleNode.h" 2
  #undef STYLE_STRUCT

  /*
   * Garbage collection.  Mark walks up the tree, marking any unmarked
   * ancestors until it reaches a marked one.  Sweep recursively sweeps
   * the children, destroys any that are unmarked, and clears marks,
   * returning true if the node on which it was called was destroyed.
   * If children are hashed, the mNextSibling field on the children is
   * temporarily used internally by Sweep.
   */
  ;

  // Compute the value of an nsStyleCoord that IsCalcUnit().
  // (Values that don't require aPercentageBasis should be handled
  // inside nsRuleNode rather than through this API.)
  ;

  // Compute the value of an nsStyleCoord that is either a coord, a
  // percent, or a calc expression.
  ;

  // Return whether the rule tree for which this node is the root has
  // cached data such that we need to do dynamic change handling for
  // changes that change the results of media queries or require
  // rebuilding all style data.
  bool TreeHasCachedData() const {
    NS_ASSERTION(IsRoot(), "should only be called on root of rule tree");
    return HaveChildren() || mStyleData.mInheritedData || mStyleData.mResetData;
  }

  

  ;

  ;

  ;

  ;

  /**
   * @param aValue The color value, returned from nsCSSParser::ParseColorString
   * @param aPresContext Presentation context whose preferences are used
   *                     for certain enumerated colors
   * @param aStyleContext Style context whose color is used for 'currentColor'
   *
   * @note aPresContext and aStyleContext may be null, but in that case, fully
   *       opaque black will be returned for the values that rely on these
   *       objects to compute the color. (For example, -moz-hyperlinktext.)
   *
   * @return false if we fail to extract a color; this will not happen if both
   *         aPresContext and aStyleContext are non-null
   */
  static bool ComputeColor(const nsCSSValue& aValue,
                           nsPresContext* aPresContext,
                           nsStyleContext* aStyleContext,
                           nscolor& aResult);
};

# 18 "../../dist/include/imgIContainer.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxMatrix.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/imgIContainer.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxRect.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/imgIContainer.h"
#if 0 /* expanded by -frewrite-includes */
#include "GraphicsFilter.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/imgIContainer.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 26 "../../dist/include/imgIContainer.h"
#if 0 /* expanded by -frewrite-includes */
#include "limits.h"
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/imgIContainer.h"
namespace mozilla {
namespace layers {
class LayerManager;
class ImageContainer;
}
}
class nsIFrame;
namespace mozilla {
class TimeStamp;
class SVGImageContext;
}
namespace mozilla {
namespace image {
class ImageRegion;
struct Orientation;
/**
 * An enumeration representing the result of a drawing operation.
 *
 * Most users of DrawResult will only be interested in whether the value is
 * SUCCESS or not. The other values are primarily useful for debugging and error
 * handling.
 *
 * SUCCESS: We successfully drew a completely decoded frame of the requested
 * size. Drawing again with FLAG_SYNC_DECODE would not change the result.
 *
 * INCOMPLETE: We successfully drew a frame that was partially decoded. (Note
 *
 * BAD_IMAGE: We failed to draw because the image has an error. This is a
 * permanent condition.
 *
 * BAD_ARGS: We failed to draw because bad arguments were passed to draw().
 */
enum class DrawResult : uint8_t
{
  SUCCESS,
  INCOMPLETE,
  WRONG_SIZE,
  NOT_READY,
  TEMPORARY_ERROR,
  BAD_IMAGE,
  BAD_ARGS
};
}
}

/* starting interface:    imgIContainer */
#define IMGICONTAINER_IID_STR "9a43298b-bf49-44fc-9abe-9ff702f1bd25"

#define IMGICONTAINER_IID \
  {0x9a43298b, 0xbf49, 0x44fc, \
    { 0x9a, 0xbe, 0x9f, 0xf7, 0x02, 0xf1, 0xbd, 0x25 }}

class NS_NO_VTABLE imgIContainer : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(IMGICONTAINER_IID)

  /* readonly attribute int32_t width; */
  NS_IMETHOD GetWidth(int32_t *aWidth) = 0;

  /* readonly attribute int32_t height; */
  NS_IMETHOD GetHeight(int32_t *aHeight) = 0;

  /* [noscript] readonly attribute nsSize intrinsicSize; */
  NS_IMETHOD GetIntrinsicSize(nsSize *aIntrinsicSize) = 0;

  /* [noscript] readonly attribute nsSize intrinsicRatio; */
  NS_IMETHOD GetIntrinsicRatio(nsSize *aIntrinsicRatio) = 0;

  /* [nostdcall,notxpcom] nsIntSizeByVal optimalImageSizeForDest ([const] in gfxSize aDest, in uint32_t aWhichFrame, in gfxGraphicsFilter aFilter, in uint32_t aFlags); */
  ;

  enum {
    TYPE_RASTER = 0U,
    FLAG_ASYNC_NOTIFY = 4U,
    FLAG_DECODE_NO_PREMULTIPLY_ALPHA = 8U,
    FLAG_DECODE_NO_COLORSPACE_CONVERSION = 16U,
    FLAG_CLAMP = 32U,
    FLAG_HIGH_QUALITY_SCALING = 64U,
    FLAG_WANT_DATA_SURFACE = 128U,
    FLAG_BYPASS_SURFACE_CACHE = 256U,
    DECODE_FLAGS_DEFAULT = 0U,
    FRAME_FIRST = 0U,
    FRAME_CURRENT = 1U,
    FRAME_MAX_VALUE = 1U
  };

  /* [noscript,notxpcom] TempRefSourceSurface getFrame (in uint32_t aWhichFrame, in uint32_t aFlags); */
  NS_IMETHOD_(mozilla::TemporaryRef<mozilla::gfx::SourceSurface>) GetFrame(uint32_t aWhichFrame, uint32_t aFlags) = 0;

  /* [notxpcom] boolean isOpaque (); */
  NS_IMETHOD_(bool) IsOpaque(void) = 0;

  /* [noscript] ImageContainer getImageContainer (in LayerManager aManager); */
  NS_IMETHOD GetImageContainer(mozilla::layers::LayerManager *aManager, mozilla::layers::ImageContainer **_retval) = 0;

  /* [noscript,notxpcom] DrawResult draw (in gfxContext aContext, [const] in nsIntSize aSize, [const] in ImageRegion aRegion, in uint32_t aWhichFrame, in gfxGraphicsFilter aFilter, [const] in MaybeSVGImageContext aSVGContext, in uint32_t aFlags); */
  NS_IMETHOD_(mozilla::image::DrawResult) Draw(gfxContext *aContext, const nsIntSize & aSize, const mozilla::image::ImageRegion & aRegion, uint32_t aWhichFrame, GraphicsFilter aFilter, const mozilla::Maybe<mozilla::SVGImageContext> & aSVGContext, uint32_t aFlags) = 0;

  /* void requestDecode (); */
  NS_IMETHOD RequestDecode(void) = 0;

  /* [noscript] void startDecoding (); */
  NS_IMETHOD StartDecoding(void) = 0;

  /* [noscript] void requestDecodeForSize ([const] in nsIntSize aSize, in uint32_t aFlags); */
  NS_IMETHOD RequestDecodeForSize(const nsIntSize & aSize, uint32_t aFlags) = 0;

  /* void lockImage (); */
  NS_IMETHOD LockImage(void) = 0;

  /* void unlockImage (); */
  NS_IMETHOD UnlockImage(void) = 0;

  /* void requestDiscard (); */
  NS_IMETHOD RequestDiscard(void) = 0;

  /* [nostdcall,notxpcom] TempRefImgIContainer unwrap (); */
  ;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(imgIContainer, IMGICONTAINER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_IMGICONTAINER \
  NS_IMETHOD GetWidth(int32_t *aWidth) MOZ_OVERRIDE; \
  NS_IMETHOD GetHeight(int32_t *aHeight) MOZ_OVERRIDE; \
  NS_IMETHOD GetIntrinsicSize(nsSize *aIntrinsicSize) MOZ_OVERRIDE; \
  NS_IMETHOD GetIntrinsicRatio(nsSize *aIntrinsicRatio) MOZ_OVERRIDE; \
  virtual nsIntSize OptimalImageSizeForDest(const gfxSize & aDest, uint32_t aWhichFrame, GraphicsFilter aFilter, uint32_t aFlags) MOZ_OVERRIDE; \
  NS_IMETHOD GetType(uint16_t *aType) MOZ_OVERRIDE; \
  NS_IMETHOD_(uint16_t) GetType(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetAnimated(bool *aAnimated) MOZ_OVERRIDE; \
  NS_IMETHOD_(mozilla::TemporaryRef<mozilla::gfx::SourceSurface>) GetFrame(uint32_t aWhichFrame, uint32_t aFlags) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) IsOpaque(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetImageContainer(mozilla::layers::LayerManager *aManager, mozilla::layers::ImageContainer **_retval) MOZ_OVERRIDE; \
  NS_IMETHOD_(mozilla::image::DrawResult) Draw(gfxContext *aContext, const nsIntSize & aSize, const mozilla::image::ImageRegion & aRegion, uint32_t aWhichFrame, GraphicsFilter aFilter, const mozilla::Maybe<mozilla::SVGImageContext> & aSVGContext, uint32_t aFlags) MOZ_OVERRIDE; \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class _MYCLASS_ : public imgIContainer
{
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [nostdcall,notxpcom] TempRefImgIContainer unwrap (); */
already_AddRefed<imgIContainer> _MYCLASS_::Unwrap()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 507 "../../dist/include/imgIContainer.h"


#endif /* __gen_imgIContainer_h__ */
# 510 "../../dist/include/imgIContainer.h"
# 29 "../../dist/include/nsLayoutUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 30 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "Units.h"
#endif /* expanded by -frewrite-includes */
#ifndef nsHTMLReflowMetrics_h___
#define nsHTMLReflowMetrics_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsRect.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsHTMLReflowMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsBoundingMetrics.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsHTMLReflowMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include "WritingModes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/WritingModes.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef WritingModes_h_
#define WritingModes_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsRect.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/WritingModes.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleContext.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleContext.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* the interface (to internal code) for retrieving computed style data */

#ifndef _nsStyleContext_h_
#define _nsStyleContext_h_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RestyleLogging.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsStyleContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsStyleContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRuleNode.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsStyleContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSPseudoElements.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsStyleContext.h"

class nsIAtom;
class nsPresContext;

/**
 * An nsStyleContext represents the computed style data for an element.
 * The computed style data are stored in a set of structs (see
 * collection.
 */

class nsStyleContext MOZ_FINAL
{
public:
  /**
   * Create a new style context.
   * @param aParent  The parent of a style context is used for CSS
   *                 inheritance.  When the element or pseudo-element
   *                 this style context represents the style data of
   *                 inherits a CSS property, the value comes from the
   *                 parent style context.  This means style context
   *                 parentage must match the definitions of inheritance
   *                 in the CSS specification.
   * @param aPseudoTag  The pseudo-element or anonymous box for which
   *                    this style context represents style.  Null if
   *                    this style context is for a normal DOM element.
   * @param aPseudoType  Must match aPseudoTag.
   * @param aRuleNode  A rule node representing the ordered sequence of
   *                   rules that any element, pseudo-element, or
   *                   anonymous box that this style context is for
   *                   matches.  See |nsRuleNode| and |nsIStyleRule|.
   * @param aSkipParentDisplayBasedStyleFixup
   *                 If set, this flag indicates that we should skip
   *                 the chunk of ApplyStyleFixups() that applies to 
   *                 special cases where a child element's style may 
   *                 need to be modified based on its parent's display 
   *                 value.
   */
  ;

  void* operator new(size_t sz, nsPresContext* aPresContext) CPP_THROW_NEW;
  void Destroy();

#ifdef DEBUG
  /**
   * Initializes a cached pref, which is only used in DEBUG code.
   */
  static void Initialize();
#endif
# 82 "../../dist/include/nsStyleContext.h"

  nsrefcnt AddRef() {
    if (mRefCnt == UINT32_MAX) {
      NS_WARNING("refcount overflow, leaking object");
      return mRefCnt;
    }
    ++mRefCnt;
    NS_LOG_ADDREF(this, mRefCnt, "nsStyleContext", sizeof(nsStyleContext));
    return mRefCnt;
  }

  nsrefcnt Release() {
    if (mRefCnt == UINT32_MAX) {
      NS_WARNING("refcount overflow, leaking object");
      return mRefCnt;
    }
    --mRefCnt;
    NS_LOG_RELEASE(this, mRefCnt, "nsStyleContext");
    if (mRefCnt == 0) {
      Destroy();
      return 0;
    }
    return mRefCnt;
  }

#ifdef DEBUG
  void FrameAddRef() {
    ++mFrameRefCnt;
  }

  void FrameRelease() {
    --mFrameRefCnt;
  }

  uint32_t FrameRefCnt() const {
    return mFrameRefCnt;
  }
#endif

  // Does this style context have any children that return true for
  // UsesGrandancestorStyle()?
  ;

  // Tell this style context to cache aStruct as the struct for aSID
  ;

  // Setters for inherit structs only, since rulenode only sets those eagerly.
  #define STYLE_STRUCT_INHERITED(name_, checkdata_cb_)                      \
    void SetStyle##name_ (nsStyle##name_ * aStruct) {                       \
      void *& slot =                                                        \
        mCachedInheritedData.mStyleStructs[eStyleStruct_##name_];           \
      NS_ASSERTION(!slot ||                                                 \
                   (mBits &                                                 \
                    nsCachedStyleData::GetBitForSID(eStyleStruct_##name_)), \
                   "Going to leak styledata");                              \
      slot = aStruct;                                                       \
    }
#define STYLE_STRUCT_RESET(name_, checkdata_cb_) /* nothing */
  #if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructList.h" 1
/* THIS FILE IS AUTOGENERATED BY generate-stylestructlist.py - DO NOT EDIT */

// IWYU pragma: private, include "nsStyleStructFwd.h"

/*
 * list of structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#endif
# 27 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_DEP
#define STYLE_STRUCT_DEP(dep)
#define UNDEF_STYLE_STRUCT_DEP
#endif
# 32 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_END
#define STYLE_STRUCT_END()
#define UNDEF_STYLE_STRUCT_END
#endif
# 37 "../../dist/include/nsStyleStructList.h"

#ifdef STYLE_STRUCT_TEST
#define STYLE_STRUCT_TEST_CODE(c) c
#else
# 41 "../../dist/include/nsStyleStructList.h"
#define STYLE_STRUCT_TEST_CODE(c)
#endif
# 43 "../../dist/include/nsStyleStructList.h"

// The inherited structs are listed before the Reset structs.
// nsStyleStructID assumes this is the case, and callers other than
// nsStyleStructFwd.h that want the structs in id-order just define
// STYLE_STRUCT rather than including the file twice.
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Margin, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(})

#ifdef UNDEF_STYLE_STRUCT_INHERITED
#undef STYLE_STRUCT_INHERITED
#undef UNDEF_STYLE_STRUCT_INHERITED
#endif
# 230 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_RESET
#undef STYLE_STRUCT_RESET
#undef UNDEF_STYLE_STRUCT_RESET
#endif
# 235 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_DEP
#undef STYLE_STRUCT_DEP
#undef UNDEF_STYLE_STRUCT_DEP
#endif
# 240 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_END
#undef STYLE_STRUCT_END
#undef UNDEF_STYLE_STRUCT_END
#endif
# 245 "../../dist/include/nsStyleStructList.h"

#undef STYLE_STRUCT_TEST_CODE

# 263 "../../dist/include/nsStyleContext.h" 2
  #undef STYLE_STRUCT_RESET
  #undef STYLE_STRUCT_INHERITED

  /**
   * Returns whether this style context and aOther both have the same
   * cached style struct pointer for a given style struct.
   */
  ;

  /**
   * Returns whether this style context has cached, inherited style data for a
   * given style struct.
   */
  

  nsRuleNode* RuleNode() { return mRuleNode; }
  

  /*
   * Mark this style context's rule node (and its ancestors) to prevent
   * it from being garbage collected.
   */
  ;

  /*
   * Get the style data for a style struct.  This is the most important
   * member function of nsIStyleContext.  It fills in a const pointer
   * to a style data struct that is appropriate for the style context's
   * frame.  This struct may be shared with other contexts (either in
   * the rule tree or the style context tree), so it should not be
   *   const nsStyleBorder* StyleBorder();
   *   const nsStyleColor* StyleColor();
   */
  #define STYLE_STRUCT(name_, checkdata_cb_)              \
    const nsStyle##name_ * Style##name_() {               \
      return DoGetStyle##name_(true);                     \
    }
  #if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructList.h" 1
/* THIS FILE IS AUTOGENERATED BY generate-stylestructlist.py - DO NOT EDIT */

// IWYU pragma: private, include "nsStyleStructFwd.h"

/*
 * list of structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#endif
# 27 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_DEP
#define STYLE_STRUCT_DEP(dep)
#define UNDEF_STYLE_STRUCT_DEP
#endif
# 32 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_END
#define STYLE_STRUCT_END()
#define UNDEF_STYLE_STRUCT_END
#endif
# 37 "../../dist/include/nsStyleStructList.h"

#ifdef STYLE_STRUCT_TEST
#define STYLE_STRUCT_TEST_CODE(c) c
#else
# 41 "../../dist/include/nsStyleStructList.h"
#define STYLE_STRUCT_TEST_CODE(c)
#endif
# 43 "../../dist/include/nsStyleStructList.h"

// The inherited structs are listed before the Reset structs.
// nsStyleStructID assumes this is the case, and callers other than
// nsStyleStructFwd.h that want the structs in id-order just define
// STYLE_STRUCT rather than including the file twice.


  STYLE_STRUCT_TEST_CODE(if (STYLE_STRUCT_TEST < 8) {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 4) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 2) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 0) {)
STYLE_STRUCT_INHERITED(Font, CheckFontCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Color, CheckColorCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 6) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 4) {)
STYLE_STRUCT_INHERITED(Visibility, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Quotes, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 6) {)
STYLE_STRUCT_INHERITED(UserInterface, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Variables, CheckVariablesCallback)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 10) {)
STYLE_STRUCT_RESET(Background, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Position, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 14) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 12) {)
STYLE_STRUCT_RESET(TextReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Display, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 14) {)
STYLE_STRUCT_RESET(Content, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(UIReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(})

#ifdef UNDEF_STYLE_STRUCT_INHERITED
#undef STYLE_STRUCT_INHERITED
#undef UNDEF_STYLE_STRUCT_INHERITED
#endif
# 230 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_RESET
#undef STYLE_STRUCT_RESET
#undef UNDEF_STYLE_STRUCT_RESET
#endif
# 235 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_DEP
#undef STYLE_STRUCT_DEP
#undef UNDEF_STYLE_STRUCT_DEP
#endif
# 240 "../../dist/include/nsStyleStructList.h"

#ifdef UNDEF_STYLE_STRUCT_END
#undef STYLE_STRUCT_END
#undef UNDEF_STYLE_STRUCT_END
#endif
# 245 "../../dist/include/nsStyleStructList.h"

#undef STYLE_STRUCT_TEST_CODE

# 318 "../../dist/include/nsStyleContext.h" 2
  #undef STYLE_STRUCT

  /**
   */
  ;

  /**
   * Get a color that depends on link-visitedness using this and
   * this->GetStyleIfVisited().
   *
   * aProperty must be a color-valued property that StyleAnimationValue
   * knows how to extract.  It must also be a property that we know to
   * do change handling for in nsStyleContext::CalcDifference.
   *
   * Note that if aProperty is eCSSProperty_border_*_color, this
   * function handles -moz-use-text-color.
   */
  nscolor GetVisitedDependentColor(nsCSSProperty aProperty);

  // Helper function that GetStyleData and GetUniqueStyleData use.  Only
  // returns the structs we cache ourselves; never consults the ruletree.
  ;

#ifdef DEBUG
  struct AutoCheckDependency {

    nsStyleContext* mStyleContext;
    nsStyleStructID mOuterSID;

    AutoCheckDependency(nsStyleContext* aContext, nsStyleStructID aInnerSID)
      : mStyleContext(aContext)
    {
      mOuterSID = aContext->mComputingStruct;
      MOZ_ASSERT(mOuterSID == nsStyleStructID_None ||
                 DependencyAllowed(mOuterSID, aInnerSID),
                 "Undeclared dependency, see generate-stylestructlist.py");
      aContext->mComputingStruct = aInnerSID;
    }

    ~AutoCheckDependency()
    {
      mStyleContext->mComputingStruct = mOuterSID;
    }

  };

#define AUTO_CHECK_DEPENDENCY(sid_) \
  AutoCheckDependency checkNesting_(this, sid_)
#else
# 482 "../../dist/include/nsStyleContext.h"
#define AUTO_CHECK_DEPENDENCY(sid_)
#endif
# 484 "../../dist/include/nsStyleContext.h"

  // Helper functions for GetStyle* and PeekStyle*
  #define STYLE_STRUCT_INHERITED(name_, checkdata_cb_)                  \
    const nsStyle##name_ * DoGetStyle##name_(bool aComputeData) {       \
      const nsStyle##name_ * cachedData =                               \
        static_cast<nsStyle##name_*>(                                   \
          mCachedInheritedData.mStyleStructs[eStyleStruct_##name_]);    \
      if (cachedData) /* Have it cached already, yay */                 \
        return cachedData;                                              \
      /* Have the rulenode deal */                                      \
      AUTO_CHECK_DEPENDENCY(eStyleStruct_##name_);                      \
      return mRuleNode->GetStyle##name_(this, aComputeData);            \
    }
  #define STYLE_STRUCT_RESET(name_, checkdata_cb_)                      \
    const nsStyle##name_ * DoGetStyle##name_(bool aComputeData) {       \
      const nsStyle##name_ * cachedData = mCachedResetData              \
        ? static_cast<nsStyle##name_*>(                                 \
            mCachedResetData->mStyleStructs[eStyleStruct_##name_])      \
        : nullptr;                                                      \
      if (cachedData) /* Have it cached already, yay */                 \
        return cachedData;                                              \
      /* Have the rulenode deal */                                      \
      AUTO_CHECK_DEPENDENCY(eStyleStruct_##name_);                      \
      return mRuleNode->GetStyle##name_(this, aComputeData);            \
    }
  #if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructList.h" 1
/* THIS FILE IS AUTOGENERATED BY generate-stylestructlist.py - DO NOT EDIT */

// IWYU pragma: private, include "nsStyleStructFwd.h"

/*
 * list of structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#endif
# 27 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_DEP
#define STYLE_STRUCT_DEP(dep)
#define UNDEF_STYLE_STRUCT_DEP
#endif
# 32 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_END
#define STYLE_STRUCT_END()
#define UNDEF_STYLE_STRUCT_END
#endif
# 37 "../../dist/include/nsStyleStructList.h"

#ifdef STYLE_STRUCT_TEST
#define STYLE_STRUCT_TEST_CODE(c) c
#else
# 41 "../../dist/include/nsStyleStructList.h"
#define STYLE_STRUCT_TEST_CODE(c)
#endif
# 43 "../../dist/include/nsStyleStructList.h"

// The inherited structs are listed before the Reset structs.
// nsStyleStructID assumes this is the case, and callers other than
// nsStyleStructFwd.h that want the structs in id-order just define
// STYLE_STRUCT rather than including the file twice.


  STYLE_STRUCT_TEST_CODE(if (STYLE_STRUCT_TEST < 8) {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 4) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 2) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 0) {)
STYLE_STRUCT_INHERITED(Font, CheckFontCallback)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Color, CheckColorCallback)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 6) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 4) {)
STYLE_STRUCT_INHERITED(Visibility, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Quotes, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 6) {)
STYLE_STRUCT_INHERITED(UserInterface, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(TableBorder, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(} else if (STYLE_STRUCT_TEST < 16) {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 12) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 10) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 8) {)
STYLE_STRUCT_INHERITED(SVG, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_INHERITED(Variables, CheckVariablesCallback)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 10) {)
STYLE_STRUCT_RESET(Background, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Position, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  } else {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 14) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 12) {)
STYLE_STRUCT_RESET(TextReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Display, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 14) {)
STYLE_STRUCT_RESET(Content, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(UIReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    })
  STYLE_STRUCT_TEST_CODE(  })
  STYLE_STRUCT_TEST_CODE(} else {)
  STYLE_STRUCT_TEST_CODE(  if (STYLE_STRUCT_TEST < 20) {)
  STYLE_STRUCT_TEST_CODE(    if (STYLE_STRUCT_TEST < 18) {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 16) {)
STYLE_STRUCT_RESET(Table, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Margin, nullptr)
STYLE_STRUCT_DEP(Variables)
# 510 "../../dist/include/nsStyleContext.h" 2
  #undef STYLE_STRUCT_RESET
  #undef STYLE_STRUCT_INHERITED

  // Helper for ClearCachedInheritedStyleDataOnDescendants.
  ;

  // element is visited (see RelevantLinkVisited()).
  nsRefPtr<nsStyleContext> mStyleIfVisited;

  // If this style context is for a pseudo-element or anonymous box,
  // the relevant atom.
  nsCOMPtr<nsIAtom> mPseudoTag;

  // The rule node is the node in the lexicographic tree of rule nodes
  // (the "rule tree") that indicates which style rules are used to
  // compute the style data, and in what cascading order.  The least
  // specific rule matched is the one whose rule node is a child of the
  // root of the rule tree, and the most specific rule matched is the
  // |mRule| member of |mRuleNode|.
  nsRuleNode* const       mRuleNode;

  // mCachedInheritedData and mCachedResetData point to both structs that
  // are owned by this style context and structs that are owned by one of
  // this style context's ancestors (which are indirectly owned since this
  // style context owns a reference to its parent).  If the bit in |mBits|
  // is set for a struct, that means that the pointer for that struct is
  // owned by an ancestor or by mRuleNode rather than by this style context.
  // Since style contexts typically have some inherited data but only sometimes
  // have reset data, we always allocate the mCachedInheritedData, but only
  // sometimes allocate the mCachedResetData.
  nsResetStyleData*       mCachedResetData; // Cached reset style data.
  nsInheritedStyleData    mCachedInheritedData; // Cached inherited style data
  uint64_t                mBits; // Which structs are inherited from the
                                 // parent context or owned by mRuleNode.
  uint32_t                mRefCnt;

#ifdef DEBUG
  uint32_t                mFrameRefCnt; // number of frames that use this
                                        // as their style context

  nsStyleStructID         mComputingStruct;

  static bool DependencyAllowed(nsStyleStructID aOuterSID,
                                nsStyleStructID aInnerSID)
  {
    return !!(sDependencyTable[aOuterSID] &
              nsCachedStyleData::GetBitForSID(aInnerSID));
  }

  static const uint32_t sDependencyTable[];
#endif
# 590 "../../dist/include/nsStyleContext.h"
};

;
#endif
# 599 "../../dist/include/nsStyleContext.h"
# 11 "../../dist/include/WritingModes.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsBidiUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsBidiUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// support using debug builds.

// Methods in logical-coordinate classes that take another logical-coordinate
// object as a parameter should call CHECK_WRITING_MODE on it to verify that
// the writing modes match.
// (In some cases, there are internal (private) methods that don't do this;
// such methods should only be used by other methods that have already checked
// the writing modes.)

#define CHECK_WRITING_MODE(param) \
   NS_ASSERTION(param == GetWritingMode(), "writing-mode mismatch")

namespace mozilla {

// Physical axis constants.
enum PhysicalAxis {
  eAxisVertical      = 0x0,
  eAxisHorizontal    = 0x1
};

// Logical axis, edge and side constants for use in various places.
enum LogicalAxis {
  eLogicalAxisBlock  = 0x0,
  eLogicalAxisInline = 0x1
};
enum LogicalEdge {
  eLogicalEdgeStart  = 0x0,
  eLogicalEdgeEnd    = 0x1
};
enum LogicalSide {
  eLogicalSideBStart = (eLogicalAxisBlock  << 1) | eLogicalEdgeStart,  // 0x0
  eLogicalSideBEnd   = (eLogicalAxisBlock  << 1) | eLogicalEdgeEnd,    // 0x1
  eLogicalSideIStart = (eLogicalAxisInline << 1) | eLogicalEdgeStart,  // 0x2
  eLogicalSideIEnd   = (eLogicalAxisInline << 1) | eLogicalEdgeEnd     // 0x3
};
















enum LogicalSideBits {
  eLogicalSideBitsNone   = 0,
  eLogicalSideBitsBStart = 1 << eLogicalSideBStart,
  eLogicalSideBitsBEnd   = 1 << eLogicalSideBEnd,
  eLogicalSideBitsIEnd   = 1 << eLogicalSideIEnd,
  eLogicalSideBitsIStart = 1 << eLogicalSideIStart,
  eLogicalSideBitsBBoth = eLogicalSideBitsBStart | eLogicalSideBitsBEnd,
  eLogicalSideBitsIBoth = eLogicalSideBitsIStart | eLogicalSideBitsIEnd,
  eLogicalSideBitsAll = eLogicalSideBitsBBoth | eLogicalSideBitsIBoth
};

enum LineRelativeDir {
  eLineRelativeDirOver  = eLogicalSideBStart,
  eLineRelativeDirUnder = eLogicalSideBEnd,
  eLineRelativeDirLeft  = eLogicalSideIStart,
  eLineRelativeDirRight = eLogicalSideIEnd
};

/**
 * LogicalSides represents a set of logical sides.
 */
struct LogicalSides MOZ_FINAL {
  LogicalSides() : mBits(0) {}
  
  
  
  
  
  
  
  
  
  
  
  
  

private:
  uint8_t mBits;
};

/**
 * mozilla::WritingMode is an immutable class representing a
 * writing mode.
 *
 * It efficiently stores the writing mode and can rapidly compute
 * interesting things about it for use in layout.
 *
 * Writing modes are computed from the CSS 'direction',
 * 'writing-mode', and 'text-orientation' properties.
 * See CSS3 Writing Modes for more information
 *   http://www.w3.org/TR/css3-writing-modes/
 */
class WritingMode {
public:
  /**
   * Absolute inline flow direction
   */
  enum InlineDir {
    eInlineLTR = 0x00, // text flows horizontally left to right
    eInlineRTL = 0x02, // text flows horizontally right to left
    eInlineTTB = 0x01, // text flows vertically top to bottom
    eInlineBTT = 0x03, // text flows vertically bottom to top
  };

  /**
   * Absolute block flow direction
   */
  enum BlockDir {
    eBlockTB = 0x00, // horizontal lines stack top to bottom
    eBlockRL = 0x01, // vertical lines stack right to left
    eBlockLR = 0x05, // vertical lines stack left to right
  };

  /**
   * Line-relative (bidi-relative) inline flow direction
   */
  enum BidiDir {
    eBidiLTR = 0x00, // inline flow matches bidi LTR text
    eBidiRTL = 0x10, // inline flow matches bidi RTL text
  };

  /**
   * Unknown writing mode (should never actually be stored or used anywhere).
   */
  enum {
    eUnknownWritingMode = 0xff
  };

  /**
   * Return the absolute inline flow direction as an InlineDir
   */
  

  /**
   * Return the absolute block flow direction as a BlockDir
   */
  BlockDir GetBlockDir() const { return BlockDir(mWritingMode & eBlockMask); }

  /**
   * Return the line-relative inline flow direction as a BidiDir
   */
  BidiDir GetBidiDir() const { return BidiDir(mWritingMode & eBidiMask); }

  /**
   * Return true if LTR. (Convenience method)
   */
  bool IsBidiLTR() const { return eBidiLTR == GetBidiDir(); }

  /**
   * True if vertical-mode block direction is LR (convenience method).
   */
  bool IsVerticalLR() const { return eBlockLR == GetBlockDir(); }

  /**
   * True if vertical-mode block direction is RL (convenience method).
   */
  

  /**
   * True if vertical writing mode, i.e. when
   * writing-mode: vertical-lr | vertical-rl.
   */
  bool IsVertical() const { return !!(mWritingMode & eOrientationMask); }

  /**
   * True if the text-orientation will force all text to be rendered sideways
   * in vertical lines, in which case we should prefer an alphabetic baseline;
   * otherwise, the default is centered.
   * Note that some glyph runs may be rendered sideways even if this is false,
   * due to text-orientation:mixed resolution, but in that case the dominant
   * baseline remains centered.
   */
  bool IsSideways() const { return !!(mWritingMode & eSidewaysMask); }

  

  

  static mozilla::Side PhysicalSideForBlockAxis(uint8_t aWritingModeValue,
                                                LogicalEdge aEdge)
  {
    // indexes are NS_STYLE_WRITING_MODE_* values, which are the same as these
    // two-bit values:
    //   bit 0 = the eOrientationMask value
    //   bit 1 = the eBlockFlowMask value
    static const mozilla::css::Side kLogicalBlockSides[][2] = {
      { NS_SIDE_TOP,    NS_SIDE_BOTTOM },  // horizontal-tb
      { NS_SIDE_RIGHT,  NS_SIDE_LEFT   },  // vertical-rl
      { NS_SIDE_BOTTOM, NS_SIDE_TOP    },  // (horizontal-bt)
      { NS_SIDE_LEFT,   NS_SIDE_RIGHT  },  // vertical-lr
    };

    NS_ASSERTION(aWritingModeValue < 4, "invalid aWritingModeValue value");
    return kLogicalBlockSides[aWritingModeValue][aEdge];
  }

  mozilla::Side PhysicalSideForInlineAxis(LogicalEdge aEdge) const
  {
    // indexes are four-bit values:
    //   bit 0 = the eOrientationMask value
    //   bit 1 = the eInlineFlowMask value
    //   bit 2 = the eBlockFlowMask value
    //   bit 3 = the eLineOrientMask value
    static const mozilla::css::Side kLogicalInlineSides[][2] = {
      { NS_SIDE_LEFT,   NS_SIDE_RIGHT  },  // horizontal-tb                  ltr
      { NS_SIDE_TOP,    NS_SIDE_BOTTOM },  // vertical-rl                    ltr
      { NS_SIDE_RIGHT,  NS_SIDE_LEFT   },  // horizontal-tb                  rtl
      { NS_SIDE_BOTTOM, NS_SIDE_TOP    },  // vertical-rl                    rtl
      { NS_SIDE_RIGHT,  NS_SIDE_LEFT   },  // (horizontal-bt)  (inverted)    ltr
      { NS_SIDE_TOP,    NS_SIDE_BOTTOM },  // vertical-lr      sideways-left rtl
      { NS_SIDE_LEFT,   NS_SIDE_RIGHT  },  // (horizontal-bt)  (inverted)    rtl
      { NS_SIDE_BOTTOM, NS_SIDE_TOP    },  // vertical-lr      sideways-left ltr
      { NS_SIDE_LEFT,   NS_SIDE_RIGHT  },  // horizontal-tb    (inverted)    rtl
      { NS_SIDE_TOP,    NS_SIDE_BOTTOM },  // vertical-rl      sideways-left rtl
      { NS_SIDE_RIGHT,  NS_SIDE_LEFT   },  // horizontal-tb    (inverted)    ltr
      { NS_SIDE_BOTTOM, NS_SIDE_TOP    },  // vertical-rl      sideways-left ltr
      { NS_SIDE_LEFT,   NS_SIDE_RIGHT  },  // (horizontal-bt)                ltr
      { NS_SIDE_TOP,    NS_SIDE_BOTTOM },  // vertical-lr                    ltr
      { NS_SIDE_RIGHT,  NS_SIDE_LEFT   },  // (horizontal-bt)                rtl
      { NS_SIDE_BOTTOM, NS_SIDE_TOP    },  // vertical-lr                    rtl
    };

    // Inline axis sides depend on all three of writing-mode, text-orientation
    // and direction, which are encoded in the eOrientationMask,
    // eInlineFlowMask, eBlockFlowMask and eLineOrientMask bits.  Use these four
    // bits to index into kLogicalInlineSides.
    static_assert(eOrientationMask == 0x01 && eInlineFlowMask == 0x02 &&
                  eBlockFlowMask == 0x04 && eLineOrientMask == 0x08,
                  "unexpected mask values");
    int index = mWritingMode & 0x0F;
    return kLogicalInlineSides[index][aEdge];
  }

  /**
   * Returns the physical side corresponding to the specified logical side,
   * given the current writing mode.
   */
  

  /**
   * Returns the physical side corresponding to the specified
   * line-relative direction, given the current writing mode.
   */
  

  /**
   * Default constructor gives us a horizontal, LTR writing mode.
   * XXX We will probably eliminate this and require explicit initialization
   *     in all cases once transition is complete.
   */
  

  /**
   * Construct writing mode based on a style context
   */
  explicit WritingMode(nsStyleContext* aStyleContext)
  {
    NS_ASSERTION(aStyleContext, "we need an nsStyleContext here");

    const nsStyleVisibility* styleVisibility = aStyleContext->StyleVisibility();

    switch (styleVisibility->mWritingMode) {
      case NS_STYLE_WRITING_MODE_HORIZONTAL_TB:
        mWritingMode = 0;
        break;

      case NS_STYLE_WRITING_MODE_VERTICAL_LR:
      {
        mWritingMode = eBlockFlowMask |
                       eLineOrientMask |
                       eOrientationMask;
        uint8_t textOrientation = aStyleContext->StyleVisibility()->mTextOrientation;
#if 0 // not yet implemented
        if (textOrientation == NS_STYLE_TEXT_ORIENTATION_SIDEWAYS_LEFT) {
          mWritingMode &= ~eLineOrientMask;
        }
#endif
# 433 "../../dist/include/WritingModes.h"
        if (textOrientation >= NS_STYLE_TEXT_ORIENTATION_SIDEWAYS_RIGHT) {
          mWritingMode |= eSidewaysMask;
        }
        break;
      }

      default:
        NS_NOTREACHED("unknown writing mode!");
        mWritingMode = 0;
        break;
    }

    if (NS_STYLE_DIRECTION_RTL == styleVisibility->mDirection) {
      mWritingMode |= eInlineFlowMask | //XXX needs update when text-orientation added
                      eBidiMask;
    }
  }

  // For unicode-bidi: plaintext, reset the direction of the writing mode from
  // the bidi paragraph level of the content

  //XXX change uint8_t to UBiDiLevel after bug 924851
  

  /**
   * Compare two WritingModes for equality.
   */
  bool operator==(const WritingMode& aOther) const
  {
    return mWritingMode == aOther.mWritingMode;
  }

  

  /**
   * Check whether two modes are orthogonal to each other.
   */
  bool IsOrthogonalTo(const WritingMode& aOther) const
  {
    return IsVertical() != aOther.IsVertical();
  }

private:
  friend class LogicalPoint;
  friend class LogicalSize;
  friend class LogicalMargin;
  explicit WritingMode(uint8_t aValue)
    : mWritingMode(aValue)
  { }

  uint8_t mWritingMode;

  enum Masks {
    // Masks for our bits; true chosen as opposite of commonest case
    eOrientationMask = 0x01, // true means vertical text
    eInlineFlowMask  = 0x02, // true means absolute RTL/BTT (against physical coords)
    eBlockFlowMask   = 0x04, // true means vertical-LR (or horizontal-BT if added)
    eLineOrientMask  = 0x08, // true means over != block-start
    eBidiMask        = 0x10, // true means line-relative RTL (bidi RTL)
    // Note: We have one excess bit of info; WritingMode can pack into 4 bits.
    // But since we have space, we're caching interesting things for fast access.

    eSidewaysMask    = 0x20, // true means text-orientation is sideways-*,
                             // which means we'll use alphabetic instead of
                             // centered default baseline for vertical text

    // Masks for output enums
    eInlineMask = 0x03,
    eBlockMask  = 0x05
  };
};


/**
 * Logical-coordinate classes:
 *
 * There are three sets of coordinate space:
 *   - physical (top, left, bottom, right)
  // fields as the inline and block directions. Hence, this is not exposed
  // directly, but only through accessors that will map them according to the
  // writing mode.
  nsPoint mPoint;
};

/**
 * Flow-relative size
 */
class LogicalSize {
public:
  explicit LogicalSize(WritingMode aWritingMode)
    :
#ifdef DEBUG
      mWritingMode(aWritingMode),
#endif
# 825 "../../dist/include/WritingModes.h"
      mSize(0, 0)
  { }

  LogicalSize(WritingMode aWritingMode, nscoord aISize, nscoord aBSize)
    :
#ifdef DEBUG
      mWritingMode(aWritingMode),
#endif
# 833 "../../dist/include/WritingModes.h"
      mSize(aISize, aBSize)
  { }

  LogicalSize(WritingMode aWritingMode, const nsSize& aPhysicalSize)
#ifdef DEBUG
    : mWritingMode(aWritingMode)
#endif
# 840 "../../dist/include/WritingModes.h"
  {
    if (aWritingMode.IsVertical()) {
      ISize() = aPhysicalSize.height;
      BSize() = aPhysicalSize.width;
    } else {
      ISize() = aPhysicalSize.width;
      BSize() = aPhysicalSize.height;
    }
  }

  void SizeTo(WritingMode aWritingMode, nscoord aISize, nscoord aBSize)
  {
    CHECK_WRITING_MODE(aWritingMode);
    mSize.SizeTo(aISize, aBSize);
  }

  /**
   * Dimensions in logical and physical terms
   */
  nscoord ISize(WritingMode aWritingMode) const // inline-size
  {
    CHECK_WRITING_MODE(aWritingMode);
    return mSize.width;
  }
  nscoord BSize(WritingMode aWritingMode) const // block-size
  {
    CHECK_WRITING_MODE(aWritingMode);
    return mSize.height;
  }


  
  

  /**
   * Return an nsSize containing our physical dimensions
   */
  

  /**
   * Return a LogicalSize representing this size in a different writing mode
   */
  

  /**
   * Test if a size is (0, 0).
   */
  

  /**
   * Various binary operators on LogicalSize. These are valid ONLY for operands
   * that share the same writing mode.
   */
  

  bool operator!=(const LogicalSize& aOther) const
  {
    CHECK_WRITING_MODE(aOther.GetWritingMode());
    return mSize != aOther.mSize;
  }

  LogicalSize operator+(const LogicalSize& aOther) const
  {
    CHECK_WRITING_MODE(aOther.GetWritingMode());
    return LogicalSize(GetWritingMode(), ISize() + aOther.ISize(),
                                         BSize() + aOther.BSize());
  }
  LogicalSize& operator+=(const LogicalSize& aOther)
  {
    CHECK_WRITING_MODE(aOther.GetWritingMode());
    ISize() += aOther.ISize();
    BSize() += aOther.BSize();
    return *this;
  }

  LogicalSize operator-(const LogicalSize& aOther) const
  {
    CHECK_WRITING_MODE(aOther.GetWritingMode());
    return LogicalSize(GetWritingMode(), ISize() - aOther.ISize(),
                                         BSize() - aOther.BSize());
  }
  LogicalSize& operator-=(const LogicalSize& aOther)
  {
    CHECK_WRITING_MODE(aOther.GetWritingMode());
    ISize() -= aOther.ISize();
    BSize() -= aOther.BSize();
    return *this;
  }

private:
  friend class LogicalRect;

  LogicalSize() = delete;

#ifdef DEBUG
  WritingMode GetWritingMode() const { return mWritingMode; }
#else
# 995 "../../dist/include/WritingModes.h"
  WritingMode GetWritingMode() const { return WritingMode::Unknown(); }
#endif
# 997 "../../dist/include/WritingModes.h"

  nscoord ISize() const // inline-size
  {
    return mSize.width;
  }
  nscoord BSize() const // block-size
  {
    return mSize.height;
  }

  nscoord& ISize() // inline-size
  {
    return mSize.width;
  }
  nscoord& BSize() // block-size
  {
    return mSize.height;
  }

#ifdef DEBUG
  WritingMode mWritingMode;
#endif
# 1019 "../../dist/include/WritingModes.h"
  nsSize      mSize;
};

/**
 * Flow-relative margin
 */
class LogicalMargin {
public:
  

  LogicalMargin(WritingMode aWritingMode,
                nscoord aBStart, nscoord aIEnd,
                nscoord aBEnd, nscoord aIStart)
    :
#ifdef DEBUG
      mWritingMode(aWritingMode),
#endif
# 1042 "../../dist/include/WritingModes.h"
      mMargin(aBStart, aIEnd, aBEnd, aIStart)
  { }

  LogicalMargin(WritingMode aWritingMode, const nsMargin& aPhysicalMargin)
#ifdef DEBUG
    : mWritingMode(aWritingMode)
#endif
# 1049 "../../dist/include/WritingModes.h"
  {
    if (aWritingMode.IsVertical()) {
      if (aWritingMode.IsVerticalLR()) {
        mMargin.top = aPhysicalMargin.left;
        mMargin.bottom = aPhysicalMargin.right;
      } else {
        mMargin.top = aPhysicalMargin.right;
        mMargin.bottom = aPhysicalMargin.left;
        mMargin.right = aPhysicalMargin.left;
      }
    }
  }

  
  
  
  

  
  
  
  nscoord& BEnd(WritingMode aWritingMode) // block-end margin
  {
    CHECK_WRITING_MODE(aWritingMode);
    return mMargin.bottom;
  }

  nscoord IStartEnd(WritingMode aWritingMode) const // inline margins
  {
    CHECK_WRITING_MODE(aWritingMode);
    return mMargin.LeftRight();
  }
  nscoord BStartEnd(WritingMode aWritingMode) const // block margins
  {
    CHECK_WRITING_MODE(aWritingMode);
    return mMargin.TopBottom();
  }
  LogicalMargin operator+(const LogicalMargin& aMargin) const {
    CHECK_WRITING_MODE(aMargin.GetWritingMode());
    return LogicalMargin(GetWritingMode(),
                         BStart() + aMargin.BStart(),
                         IEnd() + aMargin.IEnd(),
                         BEnd() + aMargin.BEnd(),
                         IStart() + aMargin.IStart());
  }

  LogicalMargin operator-(const LogicalMargin& aMargin) const {
    CHECK_WRITING_MODE(aMargin.GetWritingMode());
    return LogicalMargin(GetWritingMode(),
                         BStart() - aMargin.BStart(),
                         IEnd() - aMargin.IEnd(),
                         BEnd() - aMargin.BEnd(),
                         IStart() - aMargin.IStart());
  }

private:
  friend class LogicalRect;

  LogicalMargin() = delete;

#ifdef DEBUG
  WritingMode GetWritingMode() const { return mWritingMode; }
#else
# 1298 "../../dist/include/WritingModes.h"
  WritingMode GetWritingMode() const { return WritingMode::Unknown(); }
#endif
# 1300 "../../dist/include/WritingModes.h"

  nscoord IStart() const // inline-start margin
  {
    return mMargin.left;
  }
  nscoord IEnd() const // inline-end margin
  {
    return mMargin.right;
  }
  nscoord BStart() const // block-start margin
  {
    return mMargin.top;
  }
  nscoord BEnd() const // block-end margin
  {
    return mMargin.bottom;
  }

  nscoord& IStart() // inline-start margin
  {
    return mMargin.left;
  }
  nscoord& IEnd() // inline-end margin
  {
    return mMargin.right;
  }
  nscoord& BStart() // block-start margin
  {
    return mMargin.top;
  }
  nscoord& BEnd() // block-end margin
  {
    return mMargin.bottom;
  }

  nscoord IStartEnd() const // inline margins
  {
    return mMargin.LeftRight();
  }
  nscoord BStartEnd() const // block margins
  {
    return mMargin.TopBottom();
  }

#ifdef DEBUG
  WritingMode mWritingMode;
#endif
# 1347 "../../dist/include/WritingModes.h"
  nsMargin    mMargin;
};

/**
 * Flow-relative rectangle
 */
class LogicalRect {
public:
  

  

  

  LogicalRect(WritingMode aWritingMode,
              const nsRect& aRect,
              nscoord aContainerWidth)
#ifdef DEBUG
    : mWritingMode(aWritingMode)
#endif
# 1392 "../../dist/include/WritingModes.h"
  {
    if (aWritingMode.IsVertical()) {
      if (aWritingMode.IsVerticalLR()) {
        mRect.y = aRect.x;
      } else {
        mRect.y = aContainerWidth - aRect.XMost();
      }
      mRect.height = aRect.width;
      mRect.x = aRect.y;
      mRect.width = aRect.height;
    } else {
      if (aWritingMode.IsBidiLTR()) {
        mRect.x = aRect.x;
      } else {
        mRect.x = aContainerWidth - aRect.XMost();
      }
      mRect.width = aRect.width;
      mRect.y = aRect.y;
      mRect.height = aRect.height;
    }
  }

  /**
   * Inline- and block-dimension geometry.
   */
  // and modify XMax. This means that in the RTL case, we'll be moving
  // the IStart, so that IEnd remains constant.
  

  


  
  
  
  

#ifdef DEBUG
  WritingMode mWritingMode;
#endif
# 1772 "../../dist/include/WritingModes.h"
  nsRect      mRect;
};

} // namespace mozilla

#endif // WritingModes_h_
# 1778 "../../dist/include/WritingModes.h"
# 14 "../../dist/include/nsHTMLReflowMetrics.h" 2

//----------------------------------------------------------------------

struct nsHTMLReflowState;

// Option flags
#define NS_REFLOW_CALC_BOUNDING_METRICS  0x0001

/**
 * When we store overflow areas as an array of scrollable and visual
 * overflow, we use these indices.
 *
 * eOverflowType_LENGTH is needed (for gcc 4.5.*, at least) to ensure
 * that 2 is a valid value of nsOverflowType for use in
 * NS_FOR_FRAME_OVERFLOW_TYPES.
 */
enum nsOverflowType { eVisualOverflow, eScrollableOverflow,
                      eOverflowType_LENGTH };

#define NS_FOR_FRAME_OVERFLOW_TYPES(var_)                                     \
  for (nsOverflowType var_ = nsOverflowType(0); var_ < 2;                     \
       var_ = nsOverflowType(var_ + 1))

struct nsOverflowAreas {
private:
  nsRect mRects[2];
public:
  
  

  
  

  
  

  

  

  nsOverflowAreas(const nsOverflowAreas& aOther) {
    *this = aOther;
  }

  nsOverflowAreas& operator=(const nsOverflowAreas& aOther) {
    mRects[0] = aOther.mRects[0];
    mRects[1] = aOther.mRects[1];
    return *this;
  }

  

  

  

  

  

  // Mutates |this| by unioning both overflow areas with |aOther|.
  ;

  // Mutates |this| by unioning both overflow areas with |aRect|.
  ;

  // Mutates |this| by setting both overflow areas to |aRect|.
  ;
};

/**
 * An nsCollapsingMargin represents a vertical collapsing margin between
 * blocks as described in section 8.3.1 of CSS2,
 * <URL: http://www.w3.org/TR/REC-CSS2/box.html#collapsing-margins >.
 *
 * All adjacent vertical margins collapse, and the resulting margin is
 * the sum of the largest positive margin included and the smallest (most
 * negative) negative margin included.
 */
struct nsCollapsingMargin {
  private:
    nscoord mMostPos;  // the largest positive margin included
    nscoord mMostNeg;  // the smallest negative margin included

  public:
    

    

    

    

    

    

    

    

    

    
};

/**
 * Reflow metrics used to return the frame's desired size and alignment
 * information.
 *
 * @see #Reflow()
 */
class nsHTMLReflowMetrics {
public:
  // XXXldb Should |aFlags| generally be passed from parent to child?
  // Some places do it, and some don't.  |aFlags| should perhaps go away
  // entirely.
  // XXX width/height/ascent are OUT parameters and so they shouldn't
  // have to be initialized, but there are some bad frame classes that
  // aren't properly setting them when returning from Reflow()...
  

  ;

  // ISize and BSize are logical-coordinate dimensions:
  // ISize is the size in the writing mode's inline direction (which equates to
  // width in horizontal writing modes, height in vertical ones), and BSize is
};

#endif /* nsHTMLReflowMetrics_h___ */
# 333 "../../dist/include/nsHTMLReflowMetrics.h"
# 33 "../../dist/include/nsLayoutUtils.h" 2

#if 0 /* expanded by -frewrite-includes */
#include <limits>
#endif /* expanded by -frewrite-includes */
# 35 "../../dist/include/nsLayoutUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 36 "../../dist/include/nsLayoutUtils.h"

class nsIFormControlFrame;
class nsStyleCoord;
class nsStyleCorners;
class gfxContext;
class nsPIDOMWindow;
class imgIRequest;
class nsIDocument;
struct gfxPoint;
struct nsStyleFont;
struct nsStyleImageOrientation;
struct nsOverflowAreas;

namespace mozilla {
class EventListenerManager;
class SVGImageContext;
struct IntrinsicSize;
struct ContainerLayerParameters;
class WritingMode;
namespace dom {
class DOMRectList;
class Element;
class HTMLImageElement;
class HTMLCanvasElement;
class HTMLVideoElement;
} // namespace dom
namespace gfx {
struct RectCornerRadii;
} // namespace gfx
namespace layers {
class Layer;
class ClientLayerManager;
}
}

/**
 * nsLayoutUtils is a namespace class used for various helper
 * functions that are useful in multiple places in layout.  The goal
 * is not to define multiple copies of the same static helper.
 */
class nsLayoutUtils
{
  typedef ::GraphicsFilter GraphicsFilter;
  typedef mozilla::dom::DOMRectList DOMRectList;
  typedef mozilla::layers::Layer Layer;
  typedef mozilla::ContainerLayerParameters ContainerLayerParameters;
  typedef mozilla::IntrinsicSize IntrinsicSize;
  typedef mozilla::gfx::SourceSurface SourceSurface;
  typedef mozilla::gfx::Color Color;
  typedef mozilla::gfx::DrawTarget DrawTarget;
  typedef mozilla::gfx::Float Float;
  typedef mozilla::gfx::Point Point;
  typedef mozilla::gfx::Rect Rect;
  typedef mozilla::gfx::Matrix4x4 Matrix4x4;
  typedef mozilla::gfx::RectCornerRadii RectCornerRadii;
  typedef mozilla::gfx::StrokeOptions StrokeOptions;
  typedef mozilla::image::DrawResult DrawResult;

public:
  typedef mozilla::layers::FrameMetrics FrameMetrics;
  typedef FrameMetrics::ViewID ViewID;
  typedef mozilla::CSSPoint CSSPoint;
  typedef mozilla::CSSSize CSSSize;
  typedef mozilla::ScreenMargin ScreenMargin;
  typedef mozilla::LayoutDeviceIntSize LayoutDeviceIntSize;

  ;

  /**
   * Set the display port base rect for given element to be used with display
   * port margins.
   * SetDisplayPortBaseIfNotSet is like SetDisplayPortBase except it only sets
   * the display port base to aBase if no display port base is currently set.
   */
  ;
  ;

  /**
   * Get the critical display port for the given element.
   * @return < 0 if aContent1 is before aContent2
   *         > 0 if aContent1 is after aContent2,
   * Given a graphics rectangle in graphics space, return a rectangle in
   * app space that contains the graphics rectangle, rounding out as necessary.
   *
   * @param aRect The graphics rect to round outward.
   * @param aFactor The number of app units per graphics unit.
   * @return The smallest rectangle in app space that contains aRect.
   */
  static nsRect RoundGfxRectToAppRect(const gfxRect &aRect, float aFactor);

  /**
   * Returns a subrectangle of aContainedRect that is entirely inside the rounded
   * rect. Complex cases are handled conservatively by returning a smaller
   * rect than necessary.
   */
  ;
  static nsIntRegion RoundedRectIntersectIntRect(const nsIntRect& aRoundedRect,
                                                 const RectCornerRadii& aCornerRadii,
                                                 const nsIntRect& aContainedRect);

  /**
   * Return whether any part of aTestRect is inside of the rounded
   * rectangle formed by aBounds and aRadii (which are indexed by the
   * NS_CORNER_* constants in nsStyleConsts.h). This is precise.
   */
  static bool RoundedRectIntersectsRect(const nsRect& aRoundedRect,
                                        const nscoord aRadii[8],
                                        const nsRect& aTestRect);

  enum {
    PAINT_IN_TRANSFORM = 0x01,
    PAINT_SYNC_DECODE_IMAGES = 0x02,
    PAINT_WIDGET_LAYERS = 0x04,
    PAINT_IGNORE_SUPPRESSION = 0x08,
    PAINT_DOCUMENT_RELATIVE = 0x10,
    PAINT_HIDE_CARET = 0x20,
    PAINT_ALL_CONTINUATIONS = 0x40,
    PAINT_TO_WINDOW = 0x80,
    PAINT_EXISTING_TRANSACTION = 0x100,
    PAINT_NO_COMPOSITE = 0x200,
    PAINT_COMPRESSED = 0x400
  };

  /**
   * Given aFrame, the root frame of a stacking context, paint it and its
   * descendants to aRenderingContext.
   * @param aRenderingContext a rendering context translated so that (0,0)
   * is the origin of aFrame; for best results, (0,0) should transform
   * to pixel-aligned coordinates. This can be null, in which case
   * aFrame must be a "display root" (root frame for a root document,
   */

  enum {
    /* When creating a new surface, create an image surface */
    SFE_WANT_IMAGE_SURFACE = 1 << 0,
    /* Whether to extract the first frame (as opposed to the
       current frame) in the case that the element is an image. */
    SFE_WANT_FIRST_FRAME = 1 << 1,
    /* Whether we should skip colorspace/gamma conversion */
    SFE_NO_COLORSPACE_CONVERSION = 1 << 2,
    /* Specifies that the caller wants unpremultiplied pixel data.
       If this is can be done efficiently, the result will be a
       DataSourceSurface and mIsPremultiplied with be set to false. */
    SFE_PREFER_NO_PREMULTIPLY_ALPHA = 1 << 3,
    /* Whether we should skip getting a surface for vector images and
       return a DirectDrawInfo containing an imgIContainer instead. */
    SFE_NO_RASTERIZING_VECTORS = 1 << 4
  };

  struct DirectDrawInfo {
    /* imgIContainer to directly draw to a context */
    nsCOMPtr<imgIContainer> mImgContainer;
    /* which frame to draw */
    uint32_t mWhichFrame;
    /* imgIContainer flags to use when drawing */
    uint32_t mDrawingFlags;
  };

  struct SurfaceFromElementResult {
    SurfaceFromElementResult();

    /* mSourceSurface will contain the resulting surface, or will be nullptr on error */
    mozilla::RefPtr<SourceSurface> mSourceSurface;
    /* Contains info for drawing when there is no mSourceSurface. */
    DirectDrawInfo mDrawInfo;

    /* The size of the surface */
    gfxIntSize mSize;
    /* The principal associated with the element whose surface was returned.
       If there is a surface, this will never be null. */
    nsCOMPtr<nsIPrincipal> mPrincipal;
    /* The image request, if the element is an nsIImageLoadingContent */
    nsCOMPtr<imgIRequest> mImageRequest;
    /* Whether the element was "write only", that is, the bits should not be exposed to content */
    bool mIsWriteOnly;
    /* Whether the element was still loading.  Some consumers need to handle
       this case specially. */
    bool mIsStillLoading;
    /* Whether the element used CORS when loading. */
    bool mCORSUsed;
    /* Whether the returned image contains premultiplied pixel data */
    bool mIsPremultiplied;
  };

  static SurfaceFromElementResult SurfaceFromElement(mozilla::dom::Element *aElement,
                                                     uint32_t aSurfaceFlags = 0,
                                                     DrawTarget *aTarget = nullptr);
  ;
  // Need an HTMLImageElement overload, because otherwise the

  /**
   * Helper function for LogTestDataForPaint().
   */
  ;

  ;
};



namespace mozilla {

/**
 * Converts an nsPoint in app units to a Moz2D Point in pixels (whether those
 * are device pixels or CSS px depends on what the caller chooses to pass as
 * aAppUnitsPerPixel).
 */


/**
 * Converts an nsRect in app units to a Moz2D Rect in pixels (whether those
 * are device pixels or CSS px depends on what the caller chooses to pass as
 * aAppUnitsPerPixel).
 */
;

/**
 * Converts an nsRect in app units to a Moz2D Rect in pixels (whether those
 * are device pixels or CSS px depends on what the caller chooses to pass as
 * aAppUnitsPerPixel).
 *
 * The passed DrawTarget is used to additionally snap the returned Rect to
 * device pixels, if appropriate (as decided and carried out by Moz2D's
 * MaybeSnapToDevicePixels helper, which this function calls to do any
 * snapping).
 */
;

;

  namespace layout {

    /**
     * An RAII class which will, for the duration of its lifetime,
     * **if** the frame given is a container for font size inflation,
     * set the current inflation container on the pres context to null
     * (and then, in its destructor, restore the old value).
     */
    class AutoMaybeDisableFontInflation {
    public:
      ;

      ;
    private:
      nsPresContext *mPresContext;
      bool mOldValue;
    };

    ;

  }
}

class nsSetAttrRunnable : public nsRunnable
{
public:
  ;
  ;
  nsCOMPtr<nsIAtom> mAttrName;
};

#endif // nsLayoutUtils_h__
# 2716 "../../dist/include/nsLayoutUtils.h"
# 27 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EnumeratedArray.h"
#endif /* expanded by -frewrite-includes */
# 28 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
#if 0 /* expanded by -frewrite-includes */
#include "FilterSupport.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/FilterSupport.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __FilterSupport_h
#define __FilterSupport_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/FilterSupport.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/FilterSupport.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Rect.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/FilterSupport.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRegion.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/FilterSupport.h"

namespace mozilla {
namespace gfx {

// Morphology Operators
const unsigned short SVG_OPERATOR_UNKNOWN = 0;
const unsigned short SVG_OPERATOR_ERODE = 1;
const unsigned short SVG_OPERATOR_DILATE = 2;

// ColorMatrix types

// Turbulence Types
const unsigned short SVG_TURBULENCE_TYPE_UNKNOWN = 0;
const unsigned short SVG_TURBULENCE_TYPE_FRACTALNOISE = 1;
const unsigned short SVG_TURBULENCE_TYPE_TURBULENCE = 2;

// Composite Operators
const unsigned short SVG_FECOMPOSITE_OPERATOR_UNKNOWN = 0;
const unsigned short SVG_FECOMPOSITE_OPERATOR_OVER = 1;
const unsigned short SVG_FECOMPOSITE_OPERATOR_IN = 2;
const unsigned short SVG_FECOMPOSITE_OPERATOR_OUT = 3;
const unsigned short SVG_FECOMPOSITE_OPERATOR_ATOP = 4;
const unsigned short SVG_FECOMPOSITE_OPERATOR_XOR = 5;
const unsigned short SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6;

enum AttributeName {
  eBlendBlendmode = 0,
  eMorphologyRadii,
  eMorphologyOperator,
  eColorMatrixType,
  eColorMatrixValues,
  eTurbulenceSeed,
  eTurbulenceStitchable,
  eTurbulenceType,
  eCompositeOperator,
  eCompositeCoefficients,
  eGaussianBlurStdDeviation,
  eLightingLight,
  eLightingSurfaceScale,
  eLightingKernelUnitLength,
  eLightingColor,
  eDiffuseLightingDiffuseConstant,
  eImageNativeSize,
  eImageSubregion,
  eImageTransform,
  eLastAttributeName
};

class DrawTarget;
class SourceSurface;
class FilterNode;
struct FilterAttribute;

enum class AttributeType {
  eBool,
  eUint,
  eFloat,
  eSize,
  eIntSize,
  eIntPoint,
  eMatrix,
  eMatrix5x4,
  ePoint3D,
  eColor,
  eAttributeMap,
  eFloats,
  Max
};

// Limits
const float kMaxStdDeviation = 500;

// A class that stores values of different types, keyed by an attribute name.
// The Get*() methods assert that they're called for the same type that the
// attribute was Set() with.
// AttributeMaps can be nested because AttributeMap is a valid attribute type.
class AttributeMap MOZ_FINAL {
public:
  AttributeMap();
  ;
  ;
  ;
  
  ~AttributeMap();

  void Set(AttributeName aName, bool aValue);
  void Set(AttributeName aName, uint32_t aValue);
  void Set(AttributeName aName, float aValue);
  void Set(AttributeName aName, const Size& aValue);
  void Set(AttributeName aName, const IntSize& aValue);
  void Set(AttributeName aName, const IntPoint& aValue);
  void Set(AttributeName aName, const Matrix& aValue);
  void Set(AttributeName aName, const Matrix5x4& aValue);
  void Set(AttributeName aName, const Point3D& aValue);
  void Set(AttributeName aName, const Color& aValue);
  void Set(AttributeName aName, const AttributeMap& aValue);
  void Set(AttributeName aName, const float* aValues, int32_t aLength);

  bool GetBool(AttributeName aName) const;
  uint32_t GetUint(AttributeName aName) const;
  float GetFloat(AttributeName aName) const;
  Size GetSize(AttributeName aName) const;
  IntSize GetIntSize(AttributeName aName) const;
  IntPoint GetIntPoint(AttributeName aName) const;
  Matrix GetMatrix(AttributeName aName) const;
  Matrix5x4 GetMatrix5x4(AttributeName aName) const;
  Point3D GetPoint3D(AttributeName aName) const;
  Color GetColor(AttributeName aName) const;
  AttributeMap GetAttributeMap(AttributeName aName) const;
  const nsTArray<float>& GetFloats(AttributeName aName) const;

  typedef bool (*AttributeHandleCallback)(AttributeName aName, AttributeType aType, void* aUserData);
  void EnumerateRead(AttributeHandleCallback aCallback, void* aUserData) const;
  uint32_t Count() const;

private:
  mutable nsClassHashtable<nsUint32HashKey, FilterAttribute>  mMap;
};

enum class ColorSpace {
  SRGB,
  LinearRGB,
  Max
};

enum class AlphaModel {
  Unpremultiplied,
  Premultiplied
};

class ColorModel {
public:
  

  
  
  

  // Used to index FilterCachedColorModels::mFilterForColorModel.
  

  ColorSpace mColorSpace;
  AlphaModel mAlphaModel;
};

enum class PrimitiveType {
  Empty = 0,
  Blend,
  Morphology,
  ColorMatrix,
  Flood,
  Tile,
  ComponentTransfer,
  ConvolveMatrix,
  Offset,
  DisplacementMap,
  Turbulence,
  Composite,
  Merge,
  Image,
  GaussianBlur,
  DropShadow,
  DiffuseLighting,
  SpecularLighting,
  ToAlpha,
  Max
};

/**
 * A data structure to carry attributes for a given primitive that's part of a
 * filter. Will be serializable via IPDL, so it must not contain complex
 * functionality.
 * Used as part of a FilterDescription.
 */
class FilterPrimitiveDescription MOZ_FINAL {
public:
  enum {
    kPrimitiveIndexSourceGraphic = -1,
    kPrimitiveIndexSourceAlpha = -2,
    kPrimitiveIndexFillPaint = -3,
    kPrimitiveIndexStrokePaint = -4
  };

  FilterPrimitiveDescription();
  ;
  FilterPrimitiveDescription(const FilterPrimitiveDescription& aOther);
  ;

  PrimitiveType Type() const { return mType; }
  void SetType(PrimitiveType aType) { mType = aType; }
  const AttributeMap& Attributes() const { return mAttributes; }
  AttributeMap& Attributes() { return mAttributes; }

  IntRect PrimitiveSubregion() const { return mFilterPrimitiveSubregion; }
  IntRect FilterSpaceBounds() const { return mFilterSpaceBounds; }
  bool IsTainted() const { return mIsTainted; }

  size_t NumberOfInputs() const { return mInputPrimitives.Length(); }
  int32_t InputPrimitiveIndex(size_t aInputIndex) const
  {
    return aInputIndex < mInputPrimitives.Length() ?
      mInputPrimitives[aInputIndex] : 0;
  }

  ColorSpace InputColorSpace(size_t aInputIndex) const
  {
    return aInputIndex < mInputColorSpaces.Length() ?
      mInputColorSpaces[aInputIndex] : ColorSpace();
  }

  ColorSpace OutputColorSpace() const { return mOutputColorSpace; }

  void SetPrimitiveSubregion(const IntRect& aRect)
  {
    mFilterPrimitiveSubregion = aRect;
  }

  void SetFilterSpaceBounds(const IntRect& aRect)
  {
    mFilterSpaceBounds = aRect;
  }

  void SetIsTainted(bool aIsTainted)
  {
    mIsTainted = aIsTainted;
  }

  void SetInputPrimitive(size_t aInputIndex, int32_t aInputPrimitiveIndex)
  {
    mInputPrimitives.EnsureLengthAtLeast(aInputIndex + 1);
    mInputPrimitives[aInputIndex] = aInputPrimitiveIndex;
  }

  void SetInputColorSpace(size_t aInputIndex, ColorSpace aColorSpace)
  {
    mInputColorSpaces.EnsureLengthAtLeast(aInputIndex + 1);
    mInputColorSpaces[aInputIndex] = aColorSpace;
  }

  void SetOutputColorSpace(const ColorSpace& aColorSpace)
  {
    mOutputColorSpace = aColorSpace;
  }

  ;
  

private:
  PrimitiveType mType;
  AttributeMap mAttributes;
  nsTArray<int32_t> mInputPrimitives;
  IntRect mFilterPrimitiveSubregion;
  IntRect mFilterSpaceBounds;
  nsTArray<ColorSpace> mInputColorSpaces;
  ColorSpace mOutputColorSpace;
  bool mIsTainted;
};

/**
 * A data structure that contains one or more FilterPrimitiveDescriptions.
 * Designed to be serializable via IPDL, so it must not contain complex
 * functionality.
 */
struct FilterDescription MOZ_FINAL {
  
  

  ;
  

  nsTArray<FilterPrimitiveDescription> mPrimitives;
};

/**
 * The methods of this class are not on FilterDescription because
 * FilterDescription is designed as a simple value holder that can be used
 * on any thread.
 */
class FilterSupport {
public:

  /**
   * Draw the filter described by aFilter. All rect parameters are in filter
   * space coordinates. aRenderRect specifies the part of the filter output
   * that will be drawn at (0, 0) into the draw target aDT, subject to the
   * current transform on aDT but with no additional scaling.
   * The source surfaces must match their corresponding rect in size.
   * aAdditionalImages carries the images that are referenced by the
   * eImageInputIndex attribute on any image primitives in the filter.
   */
  static void
  RenderFilterDescription(DrawTarget* aDT,
                          const FilterDescription& aFilter,
                          const Rect& aRenderRect,
                          SourceSurface* aSourceGraphic,
                          const IntRect& aSourceGraphicRect,
                          SourceSurface* aFillPaint,
                          const IntRect& aFillPaintRect,
                          SourceSurface* aStrokePaint,
                          const IntRect& aStrokePaintRect,
                          nsTArray<RefPtr<SourceSurface>>& aAdditionalImages,
                          const Point& aDestPoint,
                          const DrawOptions& aOptions = DrawOptions());

  /**
   * Computes the region that changes in the filter output due to a change in
   * input.
   */
  ;

  /**
   * Computes the regions that need to be supplied in the filter inputs when
   * painting aResultNeededRegion of the filter output.
   */
  static void
  ComputeSourceNeededRegions(const FilterDescription& aFilter,
                             const nsIntRegion& aResultNeededRegion,
                             nsIntRegion& aSourceGraphicNeededRegion,
                             nsIntRegion& aFillPaintNeededRegion,
                             nsIntRegion& aStrokePaintNeededRegion);

  /**
   * Computes the size of the filter output.
   */
  static nsIntRegion
  ComputePostFilterExtents(const FilterDescription& aFilter,
                           const nsIntRegion& aSourceGraphicExtents);

  /**
   * Computes the size of a single FilterPrimitiveDescription's output given a
   * set of input extents.
   */
  ;
};

}
}

#endif // __FilterSupport_h
# 478 "../../dist/include/FilterSupport.h"
# 29 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGEffects.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsSVGEffects.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSSVGEFFECTS_H_
#define NSSVGEFFECTS_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsSVGEffects.h"
#if 0 /* expanded by -frewrite-includes */
#include "FramePropertyTable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsSVGEffects.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Element.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsSVGEffects.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsSVGEffects.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsID.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsSVGEffects.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIFrame.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIFrame.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 sw=2 et tw=78: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* interface for all rendering objects */

#ifndef nsIFrame_h___
#define nsIFrame_h___

#ifndef MOZILLA_INTERNAL_API
#error This header/class should only be used within Mozilla code. It should not be used by extensions.
#endif
# 15 "../../dist/include/nsIFrame.h"

#define MAX_REFLOW_DEPTH 200

/* nsIFrame is in the process of being deCOMtaminated, i.e., this file is eventually
   going to be eliminated, and all callers will use nsFrame instead.  At the moment
   we're midway through this process, so you will see inlined functions and member
   variables in this file.  -dwh */

#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/nsIFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsQueryFrame.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/nsIFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleContext.h"
#endif /* expanded by -frewrite-includes */
# 30 "../../dist/include/nsIFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "FramePropertyTable.h"
#endif /* expanded by -frewrite-includes */
# 31 "../../dist/include/nsIFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDirection.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsDirection.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 sw=2 et tw=78: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsDirection_h___
#define nsDirection_h___

// This file makes the nsDirection enum present both in nsIFrame.h and
// nsISelectionPrivate.h.

enum nsDirection {
  eDirNext    = 0,
  eDirPrevious= 1
};

#endif
# 19 "../../dist/include/nsDirection.h"

# 32 "../../dist/include/nsIFrame.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameState.h"
#endif /* expanded by -frewrite-includes */
# 37 "../../dist/include/nsIFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "CaretAssociationHint.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/CaretAssociationHint.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef CaretAssociationHint_h___
#define CaretAssociationHint_h___

namespace mozilla {

/**
 * Hint whether a caret is associated with the content before a
 * given character offset (ASSOCIATE_BEFORE), or with the content after a given
 * character offset (ASSOCIATE_AFTER).
 */
enum CaretAssociationHint {
  CARET_ASSOCIATE_BEFORE,
  CARET_ASSOCIATE_AFTER
};

}

#endif
# 23 "../../dist/include/CaretAssociationHint.h"
# 38 "../../dist/include/nsIFrame.h" 2

#ifdef ACCESSIBILITY
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/a11y/AccTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/a11y/AccTypes.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_a11y_AccTypes_h
#define mozilla_a11y_AccTypes_h

namespace mozilla {
namespace a11y {

/**
 * Accessible object types. Each accessible class can have own type.
 */
enum AccType {
  /**
   * This set of types is used for accessible creation, keep them together in
   * alphabetical order since they are used in switch statement.
   */
  eNoType,
  eHTMLBRType,
  eHTMLButtonType,
  eHTMLCanvasType,
  eHTMLCaptionType,
  eHTMLCheckboxType,
  eHTMLComboboxType,
  eHyperText = 1 << 5,
  eLandmark = 1 << 6,
  eList = 1 << 7,
  eListControl = 1 << 8,
  eMenuButton = 1 << 9,
  eSelect = 1 << 10,
  eTable = 1 << 11,
  eTableCell = 1 << 12,
  eTableRow = 1 << 13,

  eLastAccGenericType = eTableRow
};

} // namespace a11y
} // namespace mozilla

#endif // mozilla_a11y_AccTypes_h
# 93 "../../dist/include/mozilla/a11y/AccTypes.h"
# 41 "../../dist/include/nsIFrame.h" 2
#endif
# 42 "../../dist/include/nsIFrame.h"

/**
 * New rules of reflow:
 * 1. you get a WillReflow() followed by a Reflow() followed by a DidReflow() in order
 *    (no separate pass over the tree)
 * 2. it's the parent frame's responsibility to size/position the child's view (not
 *    the child frame's responsibility as it is today) during reflow (and before
 *    sending the DidReflow() notification)
 * 3. positioning of child frames (and their views) is done on the way down the tree,
 *    and sizing of child frames (and their views) on the way back up
 * 4. if you move a frame (outside of the reflow process, or after reflowing it),
 *    then you must make sure that its view (or its child frame's views) are re-positioned
 *    as well. It's reasonable to not position the view until after all reflowing the
 *    entire line, for example, but the frame should still be positioned and sized (and
 *    the view sized) during the reflow (i.e., before sending the DidReflow() notification)
 * 5. the view system handles moving of widgets, i.e., it's not our problem
 */

struct nsHTMLReflowState;
class nsHTMLReflowCommand;
class nsIAtom;
class nsPresContext;
class nsIPresShell;
class nsRenderingContext;
class nsView;
class nsIWidget;
class nsIDOMRange;
class nsISelectionController;
class nsBoxLayoutState;
class nsBoxLayout;
class nsILineIterator;
class nsDisplayListBuilder;
class nsDisplayListSet;
class nsDisplayList;
class gfxSkipChars;
class gfxSkipCharsIterator;
class gfxContext;
class nsLineList_iterator;
class nsAbsoluteContainingBlock;
class nsIContent;
class nsContainerFrame;

struct nsPeekOffsetStruct;
struct nsPoint;
struct nsRect;
struct nsSize;
struct nsMargin;
struct CharacterDataChangeInfo;

namespace mozilla {

class EventStates;

namespace layers {
class Layer;
}

namespace gfx {
class Matrix;
}
}

/**
 * Indication of how the frame can be split. This is used when doing runaround
 * of floats, and when pulling up child frames from a next-in-flow.
 *
 * The choices are splittable, not splittable at all, and splittable in
 * a non-rectangular fashion. This last type only applies to block-level
 * elements, and indicates whether splitting can be used when doing runaround.
 * If you can split across page boundaries, but you expect each continuing
 * frame to be the same width then return frSplittable and not
 * frSplittableNonRectangular.
 *
 * @see #GetSplittableType()
 */
typedef uint32_t nsSplittableType;

#define NS_FRAME_NOT_SPLITTABLE             0   // Note: not a bit!
#define NS_FRAME_SPLITTABLE                 0x1
#define NS_FRAME_SPLITTABLE_NON_RECTANGULAR 0x3

#define NS_FRAME_IS_SPLITTABLE(type)\
  (0 != ((type) & NS_FRAME_SPLITTABLE))

#define NS_FRAME_IS_NOT_SPLITTABLE(type)\
  (0 == ((type) & NS_FRAME_SPLITTABLE))

#define NS_INTRINSIC_WIDTH_UNKNOWN nscoord_MIN

//----------------------------------------------------------------------

//       if any are changed to be a value other than NS_UNCONSTRAINEDSIZE
//       at least update AdjustComputedHeight/Width and test ad nauseum

//----------------------------------------------------------------------

enum nsSelectionAmount {
  eSelectCharacter = 0, // a single Unicode character;
                        // do not use this (prefer Cluster) unless you
                        // are really sure it's what you want
  eSelectCluster   = 1, // a grapheme cluster: this is usually the right
                        // choice for movement or selection by "character"
                        // as perceived by the user
  eSelectWord      = 2,
  eSelectWordNoSpace = 3, // select a "word" without selecting the following
                          // space, no matter what the default platform
                          // behavior is
  eSelectLine      = 4, // previous drawn line in flow.
  // NOTE that selection code depends on the ordering of the above values,
  // allowing simple <= tests to check categories of caret movement.
  // Don't rearrange without checking the usage in nsSelection.cpp!

  eSelectBeginLine = 5,
  eSelectEndLine   = 6,
  eSelectNoAmount  = 7, // just bounce back current offset.
  eSelectParagraph = 8  // select a "paragraph"
};

enum nsSpread {
  eSpreadNone   = 0,
  eSpreadAcross = 1,
  eSpreadDown   = 2
};

// Carried out margin flags
#define NS_CARRIED_TOP_MARGIN_IS_AUTO    0x1
#define NS_CARRIED_BOTTOM_MARGIN_IS_AUTO 0x2

//----------------------------------------------------------------------

/**
 * Reflow status returned by the reflow methods. There are three
 * completion statuses, represented by two bit flags.
 *
 * NS_FRAME_COMPLETE means the frame is fully complete.
 *
 * NS_FRAME_NOT_COMPLETE bit flag means the frame does not map all its
 * content, and that the parent frame should create a continuing frame.
 * If this bit isn't set it means the frame does map all its content.
 * NS_FRAME_COMPLETE and NS_FRAME_REFLOW_NEXTINFLOW.
 *
 * The low 8 bits of the nsReflowStatus are reserved for future extensions;
 * the remaining 24 bits are zero (and available for extensions; however
 * API's that accept/return nsReflowStatus must not receive/return any
 * extension bits).
 *
 * @see #Reflow()
 */
typedef uint32_t nsReflowStatus;

#define NS_FRAME_COMPLETE             0       // Note: not a bit!
#define NS_INLINE_BREAK_BEFORE       0x0000
#define NS_INLINE_BREAK_AFTER        0x0200

// The type of break requested can be found in these bits.
// Merge the incompleteness, truncation and NS_FRAME_REFLOW_NEXTINFLOW
// status from aSecondary into aPrimary.
;

//----------------------------------------------------------------------

/**
 * DidReflow status values.
 */
enum class nsDidReflowStatus : uint32_t {
  NOT_FINISHED,
  FINISHED
};

/**
 * When there is no scrollable overflow rect, the visual overflow rect
 * may be stored as four 1-byte deltas each strictly LESS THAN 0xff, for
 * the four edges of the rectangle, or the four bytes may be read as a
 * single 32-bit "overflow-rect type" value including at least one 0xff
 * byte as an indicator that the value does NOT represent four deltas.
 * If all four deltas are zero, this means that no overflow rect has
 * actually been set (this is the initial state of newly-created frames).
 */
#define NS_FRAME_OVERFLOW_DELTA_MAX     0xfe // max delta we can store

#define NS_FRAME_OVERFLOW_NONE    0x00000000 // there are no overflow rects;
                                             // code relies on this being
                                             // the all-zero value

#define NS_FRAME_OVERFLOW_LARGE   0x000000ff // overflow is stored as a
                                             // separate rect property

namespace mozilla {
/*
 * For replaced elements only. Gets the intrinsic dimensions of this element.
 * The dimensions may only be one of the following two types:
 *
 *   eStyleUnit_Coord   - a length in app units
 *   eStyleUnit_None    - the element has no intrinsic size in this dimension
 */
struct IntrinsicSize {
  nsStyleCoord width, height;

  
  
  
  bool operator==(const IntrinsicSize& rhs) {
    return width == rhs.width && height == rhs.height;
  }
  bool operator!=(const IntrinsicSize& rhs) {
    return !(*this == rhs);
  }
};
}

/// Generic destructor for frame properties. Calls delete.
template<typename T>
static void DeleteValue(void* aPropertyValue)
{
  delete static_cast<T*>(aPropertyValue);
}

/// Generic destructor for frame properties. Calls Release().
template<typename T>
static void ReleaseValue(void* aPropertyValue)
{
  static_cast<T*>(aPropertyValue)->Release();
}

//----------------------------------------------------------------------

/**
 * A frame in the layout model. This interface is supported by all frame
 * objects.
 *
 * Frames can have multiple child lists: the default child list
 * (referred to as the <i>principal</i> child list, and additional named
 * child lists. There is an ordering of frames within a child list, but
 * there is no order defined between frames in different child lists of
 * the same parent frame.
 *
 * Frames are NOT reference counted. Use the Destroy() member function
 * to destroy a frame. The lifetime of the frame hierarchy is bounded by the
 * lifetime of the presentation shell which owns the frames.
 *
 * nsIFrame is a private Gecko interface. If you are not Gecko then you
 * should not use it. If you're not in layout, then you won't be able to
 * link to many of the functions defined here. Too bad.
 *
 * If you're not in layout but you must call functions in here, at least
 * restrict yourself to calling virtual methods, which won't hurt you as badly.
 */
class nsIFrame : public nsQueryFrame
{
public:
  typedef mozilla::FramePropertyDescriptor FramePropertyDescriptor;
  typedef mozilla::FrameProperties FrameProperties;
  typedef mozilla::layers::Layer Layer;
  typedef mozilla::layout::FrameChildList ChildList;
  typedef mozilla::layout::FrameChildListID ChildListID;
  typedef mozilla::layout::FrameChildListIDs ChildListIDs;
  typedef mozilla::layout::FrameChildListIterator ChildListIterator;
  typedef mozilla::layout::FrameChildListArrayIterator ChildListArrayIterator;
  typedef mozilla::gfx::Matrix Matrix;
  typedef mozilla::gfx::Matrix4x4 Matrix4x4;
  typedef mozilla::Sides Sides;
  typedef mozilla::LogicalSides LogicalSides;

  NS_DECL_QUERYFRAME_TARGET(nsIFrame)

  nsPresContext* PresContext() const {
    return StyleContext()->RuleNode()->PresContext();
  }

  /**
   * Called to initialize the frame. This is called immediately after creating
   * the frame.
   *
   * If the frame is a continuing frame, then aPrevInFlow indicates the previous
   * frame (the frame that was split).
   *
   * If you want a view associated with your frame, you should create the view
   * after Init() has returned.
   *
   * @param   aContent the content object associated with the frame
   * @param   aParent the parent frame
   * @param   aPrevInFlow the prev-in-flow frame
   */
  virtual void Init(nsIContent*       aContent,
                    nsContainerFrame* aParent,
                    nsIFrame*         aPrevInFlow) = 0;

  /**
   * Destroys this frame and each of its child frames (recursively calls
   * Destroy() for each child). If this frame is a first-continuation, this
   * also removes the frame from the primary frame map and clears undisplayed
   * content for its content node.
   * If the frame is a placeholder, it also ensures the out-of-flow frame's
   * removal and destruction.
   */
  void Destroy() { DestroyFrom(this); }
 
  /** Flags for PeekOffsetCharacter, PeekOffsetNoAmount, PeekOffsetWord return values.
    */
  enum FrameSearchResult {
    // Peek found a appropriate offset within frame.
    FOUND = 0x00,
    // try next frame for offset.
    CONTINUE = 0x1,
    // offset not found because the frame was empty of text.
    CONTINUE_EMPTY = 0x2 | CONTINUE,
    // offset not found because the frame didn't contain any text that could be selected.
    CONTINUE_UNSELECTABLE = 0x4 | CONTINUE,
  };

protected:
  /**
   * Return true if the frame is part of a Selection.
   * Helper method to implement the public IsSelected() API.
   */
  virtual bool IsFrameSelected() const;

  /**
   * Implements Destroy(). Do not call this directly except from within a
   * DestroyFrom() implementation.
   *
   * @note This will always be called, so it is not necessary to override
   *       Destroy() in subclasses of nsFrame, just DestroyFrom().
   *
   * @param  aDestructRoot is the root of the subtree being destroyed
   */
  virtual void DestroyFrom(nsIFrame* aDestructRoot) = 0;
  friend class nsFrameList; // needed to pass aDestructRoot through to children
  friend class nsLineBox;   // needed to pass aDestructRoot through to children
  friend class nsContainerFrame; // needed to pass aDestructRoot through to children
  friend class nsFrame; // need to assign mParent
public:

  /**
   * Get the content object associated with this frame. Does not add a reference.
   */
  nsIContent* GetContent() const { return mContent; }

  /**
   * Get the frame that should be the parent for the frames of child elements
   * May return nullptr during reflow
   */
  virtual nsContainerFrame* GetContentInsertionFrame() { return nullptr; }

  /**
   * Move any frames on our overflow list to the end of our principal list.
   * @return true if there were any overflow frames
  virtual nsresult GetOffsets(int32_t &start, int32_t &end) const = 0;

  /**
   * Reset the offsets when splitting frames during Bidi reordering
   *
   */
  virtual void AdjustOffsetsForBidi(int32_t aStart, int32_t aEnd) {}

  /**
   * Get the style context associated with this frame.
   */
  nsStyleContext* StyleContext() const { return mStyleContext; }
  void SetStyleContext(nsStyleContext* aContext)
  { 
    if (aContext != mStyleContext) {
      nsStyleContext* oldStyleContext = mStyleContext;
      mStyleContext = aContext;
      aContext->AddRef();
#ifdef DEBUG
      aContext->FrameAddRef();
#endif
# 544 "../../dist/include/nsIFrame.h"
      DidSetStyleContext(oldStyleContext);
#ifdef DEBUG
      oldStyleContext->FrameRelease();
#endif
# 548 "../../dist/include/nsIFrame.h"
      oldStyleContext->Release();
    }
  }

  /**
   * SetStyleContextWithoutNotification is for changes to the style
   * context that should suppress style change processing, in other
   * words, those that aren't really changes.  This generally means only
   * changes that happen during frame construction.
   */
  void SetStyleContextWithoutNotification(nsStyleContext* aContext)
  {
    if (aContext != mStyleContext) {
#ifdef DEBUG
      mStyleContext->FrameRelease();
#endif
# 564 "../../dist/include/nsIFrame.h"
      mStyleContext->Release();
      mStyleContext = aContext;
      aContext->AddRef();
#ifdef DEBUG
      aContext->FrameAddRef();
#endif
# 570 "../../dist/include/nsIFrame.h"
    }
  }

  // Style post processing hook
  // Attention: the old style context is the one we're forgetting,
  // and hence possibly completely bogus for GetStyle* purposes.
  // Use PeekStyleData instead.
  virtual void DidSetStyleContext(nsStyleContext* aOldStyleContext) = 0;

  /**
   * Define typesafe getter functions for each style struct by
   * preprocessing the list of style structs.  These functions are the
   * preferred way to get style data.  The macro creates functions like:
   *   const nsStyleBorder* StyleBorder();
   *   const nsStyleColor* StyleColor();
   *
   * Callers outside of libxul should use nsIDOMWindow::GetComputedStyle()
   * instead of these accessors.
   */
  #define STYLE_STRUCT(name_, checkdata_cb_)                                  \
    const nsStyle##name_ * Style##name_ () const {                            \
      NS_ASSERTION(mStyleContext, "No style context found!");                 \
      return mStyleContext->Style##name_ ();                                  \
    }
  #if 0 /* expanded by -frewrite-includes */
#include "nsStyleStructList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsStyleStructList.h" 1
/* THIS FILE IS AUTOGENERATED BY generate-stylestructlist.py - DO NOT EDIT */

// IWYU pragma: private, include "nsStyleStructFwd.h"

/*
 * list of structs that contain the data provided by nsStyleContext, the
 * internal API for computed style data for an element
 */

/*
 * This file is intended to be used by different parts of the code, with
 * the STYLE_STRUCT macro (or the STYLE_STRUCT_INHERITED and
 * STYLE_STRUCT_RESET pair of macros) defined in different ways.
 */

#ifndef STYLE_STRUCT_INHERITED
#define STYLE_STRUCT_INHERITED(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_INHERITED
#endif
# 21 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_RESET
#define STYLE_STRUCT_RESET(name, checkdata_cb) \
  STYLE_STRUCT(name, checkdata_cb)
#define UNDEF_STYLE_STRUCT_RESET
#endif
# 27 "../../dist/include/nsStyleStructList.h"

#ifndef STYLE_STRUCT_DEP
#define STYLE_STRUCT_DEP(dep)
#define UNDEF_STYLE_STRUCT_DEP
#endif
STYLE_STRUCT_RESET(TextReset, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_DEP(Font)
STYLE_STRUCT_DEP(Visibility)
STYLE_STRUCT_DEP(Color)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      } else {)
STYLE_STRUCT_RESET(Display, nullptr)
STYLE_STRUCT_DEP(Variables)
STYLE_STRUCT_END()
  STYLE_STRUCT_TEST_CODE(      })
  STYLE_STRUCT_TEST_CODE(    } else {)
  STYLE_STRUCT_TEST_CODE(      if (STYLE_STRUCT_TEST == 14) {)
STYLE_STRUCT_RESET(Content, nullptr)
STYLE_STRUCT_END()
#ifdef UNDEF_STYLE_STRUCT_END
#undef STYLE_STRUCT_END
#undef UNDEF_STYLE_STRUCT_END
#endif
# 245 "../../dist/include/nsStyleStructList.h"

#undef STYLE_STRUCT_TEST_CODE

# 595 "../../dist/include/nsIFrame.h" 2
  #undef STYLE_STRUCT

  /** Also forward GetVisitedDependentColor to the style context */
  nscolor GetVisitedDependentColor(nsCSSProperty aProperty)
    { return mStyleContext->GetVisitedDependentColor(aProperty); }

  /**
   * These methods are to access any additional style contexts that
   * the frame may be holding. These are contexts that are children
   * of the frame's primary context and are NOT used as style contexts
   * for any child frames. These contexts also MUST NOT have any child 
   * contexts whatsoever. If you need to insert style contexts into the
   * style tree, then you should create pseudo element frames to own them
   * The indicies must be consecutive and implementations MUST return an 
   * NS_ERROR_INVALID_ARG if asked for an index that is out of range.
   */
  virtual nsStyleContext* GetAdditionalStyleContext(int32_t aIndex) const = 0;

  virtual void SetAdditionalStyleContext(int32_t aIndex,
                                         nsStyleContext* aStyleContext) = 0;

  /**
   * Accessor functions for geometric parent.
   */
  /**
   * Get the writing mode of this frame, but if it is styled with
   * unicode-bidi: plaintext, reset the direction to the resolved paragraph
   * level of the given subframe (typically the first frame on the line),
   * not this frame's writing mode, because the container frame could be split
   * by hard line breaks into multiple paragraphs with different base direction.
   */
  ;

  /**
   * Bounding rect of the frame. The values are in app units, and the origin is
   * relative to the upper-left of the geometric parent. The size includes the
   * content area, borders, and padding.
   *
   * Note: moving or sizing the frame does not affect the view's size or
   * position.
   */
  nsRect GetRect() const { return mRect; }
  
  nsSize GetSize() const { return mRect.Size(); }
  
  /**
   * Dimensions and position in logical coordinates in the frame's writing mode
   *  or another writing mode
   */
  
  
  
  
  
  
  
  
  
  
  
  
  
  

  /**
   * When we change the size of the frame's border-box rect, we may need to
   * reset the overflow rect if it was previously stored as deltas.
   * This must be used only when moving a frame *after*
   * nsHTMLReflowState::ApplyRelativePositioning is called.  When moving
   * a frame during the reflow process prior to calling
   * nsHTMLReflowState::ApplyRelativePositioning, the position should
   * simply be adjusted directly (e.g., using SetPosition()).
   */
  ;

  /**
   * As above, using a logical-point delta in a given writing mode.
   */
  

  /**
   * Return frame's rect without relative positioning
   */
  ;

  /**
   * Return frame's position without relative positioning
   */
  ;
  

  
  
  ;

  static void DestroyContentArray(void* aPropertyValue);

#ifdef _MSC_VER
// XXX Workaround MSVC issue by making the static FramePropertyDescriptor
// non-const.  See bug 555727.
#define NS_PROPERTY_DESCRIPTOR_CONST
#else
# 819 "../../dist/include/nsIFrame.h"
#define NS_PROPERTY_DESCRIPTOR_CONST const
#endif
# 821 "../../dist/include/nsIFrame.h"

#define NS_DECLARE_FRAME_PROPERTY(prop, dtor)                                                  \
  static const FramePropertyDescriptor* prop() {                                               \
    static NS_PROPERTY_DESCRIPTOR_CONST FramePropertyDescriptor descriptor = { dtor, nullptr }; \
    return &descriptor;                                                                        \
  }
// Don't use this unless you really know what you're doing!
#define NS_DECLARE_FRAME_PROPERTY_WITH_FRAME_IN_DTOR(prop, dtor)                               \
  static const FramePropertyDescriptor* prop() {                                               \
    static NS_PROPERTY_DESCRIPTOR_CONST FramePropertyDescriptor descriptor = { nullptr, dtor }; \
    return &descriptor;                                                                        \
  }

  NS_DECLARE_FRAME_PROPERTY(IBSplitSibling, nullptr)
  

  
  

  /**
   * Like the frame's rect (see |GetRect|), which is the border rect,
   * other rectangles of the frame, in app units, relative to the parent.
   */
  ;
  ;
  ;
  nsRect GetContentRectRelativeToSelf() const;
  nsRect GetMarginRectRelativeToSelf() const;

  /**
  ;
  bool GetBorderRadii(nscoord aRadii[8]) const;

  ;
  ;

  /**
   * Get the position of the frame's baseline, relative to the top of
   * the frame (its top border edge).  Only valid when Reflow is not
   * needed.
   */
  virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const = 0;

  /**
   * Get the position of the baseline on which the caret needs to be placed,
   * relative to the top of the frame.  This is mostly needed for frames
   * which return a baseline from GetBaseline which is not useful for
   * caret positioning.
   */
  

  /**
   * Get the specified child list.
   *
   * @param   aListID identifies the requested child list.
   * @return  the child list.  If the requested list is unsupported by this
   *          frame type, an empty list will be returned.
   */
  virtual const nsFrameList& GetChildList(ChildListID aListID) const = 0;
  const nsFrameList& PrincipalChildList() { return GetChildList(kPrincipalList); }
  virtual void GetChildLists(nsTArray<ChildList>* aLists) const = 0;

  /**
   * Gets the child lists for this frame, including
   * ones belong to a child document.
   */
  void GetCrossDocChildLists(nsTArray<ChildList>* aLists);

  // XXXbz this method should go away
  nsIFrame* GetFirstChild(ChildListID aListID) const {
    return GetChildList(aListID).FirstChild();
  }
  // XXXmats this method should also go away then
  nsIFrame* GetLastChild(ChildListID aListID) const {
    return GetChildList(aListID).LastChild();
  }
  nsIFrame* GetFirstPrincipalChild() const {
    return GetFirstChild(kPrincipalList);
  }

  // The individual concrete child lists.
  static const ChildListID kPrincipalList = mozilla::layout::kPrincipalList;
  static const ChildListID kAbsoluteList = mozilla::layout::kAbsoluteList;
  static const ChildListID kBulletList = mozilla::layout::kBulletList;
  static const ChildListID kCaptionList = mozilla::layout::kCaptionList;
  static const ChildListID kColGroupList = mozilla::layout::kColGroupList;
  static const ChildListID kExcessOverflowContainersList = mozilla::layout::kExcessOverflowContainersList;
  static const ChildListID kFixedList = mozilla::layout::kFixedList;
  static const ChildListID kFloatList = mozilla::layout::kFloatList;
  static const ChildListID kOverflowContainersList = mozilla::layout::kOverflowContainersList;
  static const ChildListID kOverflowList = mozilla::layout::kOverflowList;
  static const ChildListID kOverflowOutOfFlowList = mozilla::layout::kOverflowOutOfFlowList;
  static const ChildListID kPopupList = mozilla::layout::kPopupList;
  static const ChildListID kPushedFloatsList = mozilla::layout::kPushedFloatsList;
  static const ChildListID kSelectPopupList = mozilla::layout::kSelectPopupList;
  // A special alias for kPrincipalList that do not request reflow.
  static const ChildListID kNoReflowPrincipalList = mozilla::layout::kNoReflowPrincipalList;

  /**
   * Child frames are linked together in a doubly-linked list
   */
  nsIFrame* GetNextSibling() const { return mNextSibling; }
  void SetNextSibling(nsIFrame* aNextSibling) {
    NS_ASSERTION(this != aNextSibling, "Creating a circular frame list, this is very bad.");
    if (mNextSibling && mNextSibling->GetPrevSibling() == this) {
      mNextSibling->mPrevSibling = nullptr;
    }
    mNextSibling = aNextSibling;
    if (mNextSibling) {
      mNextSibling->mPrevSibling = this;
    }
  }

  nsIFrame* GetPrevSibling() const { return mPrevSibling; }

  /**
   * Builds the display lists for the content represented by this frame
   * and its descendants. The background+borders of this element must
   * be added first, before any other content.
   * 
   * This should only be called by methods in nsFrame. Instead of calling this
   * directly, call either BuildDisplayListForStackingContext or
   * BuildDisplayListForChild.
   * 
   * See nsDisplayList.h for more information about display lists.
   * 
   * @see     nsEventStatus
   */
  virtual nsresult  HandleEvent(nsPresContext* aPresContext,
                                mozilla::WidgetGUIEvent* aEvent,
                                nsEventStatus* aEventStatus) = 0;

  virtual nsresult  GetContentForEvent(mozilla::WidgetEvent* aEvent,
                                       nsIContent** aContent) = 0;

  // This structure keeps track of the content node and offsets associated with
  // a point; there is a primary and a secondary offset associated with any
  // point.  The primary and secondary offsets differ when the point is over a
  // non-text object.  The primary offset is the expected position of the
  // cursor calculated from a point; the secondary offset, when it is different,
  // indicates that the point is in the boundaries of some selectable object.
  // Note that the primary offset can be after the secondary offset; for places
  // that need the beginning and end of the object, the StartOffset and 
  // EndOffset helpers can be used.
  struct MOZ_STACK_CLASS ContentOffsets {
    ContentOffsets();
    ContentOffsets(const ContentOffsets&);
    ~ContentOffsets();
    nsCOMPtr<nsIContent> content;
    bool IsNull() { return !content; }
    int32_t offset;
    int32_t secondaryOffset;
    // Helpers for places that need the ends of the offsets and expect them in
    // numerical order, as opposed to wanting the primary and secondary offsets
    int32_t StartOffset() { return std::min(offset, secondaryOffset); }
    int32_t EndOffset() { return std::max(offset, secondaryOffset); }
    // This value indicates whether the associated content is before or after
    // the offset; the most visible use is to allow the caret to know which line
    // to display on.
    mozilla::CaretAssociationHint associate;
  };
  enum {
    IGNORE_SELECTION_STYLE = 0x01,
    // Treat visibility:hidden frames as non-selectable
    SKIP_HIDDEN = 0x02
  };
  /**
   * This function calculates the content offsets for selection relative to
   * a point.  Note that this should generally only be callled on the event
   * frame associated with an event because this function does not account
   * for frame lists other than the primary one.
   * @param aPoint point relative to this frame
   */
  ContentOffsets GetContentOffsetsFromPoint(nsPoint aPoint,
                                            uint32_t aFlags = 0);

  virtual ContentOffsets GetContentOffsetsFromPointExternal(nsPoint aPoint,
                                                            uint32_t aFlags = 0)
  { return GetContentOffsetsFromPoint(aPoint, aFlags); }

  /**
   * Ensure that aImage gets notifed when the underlying image request loads
   * or animates.
   */
  void AssociateImage(const nsStyleImage& aImage, nsPresContext* aPresContext);

  /**
   * This structure holds information about a cursor. mContainer represents a
   * loaded image that should be preferred. If it is not possible to use it, or
   * if it is null, mCursor should be used.
                                     nsIAtom*        aAttribute,
                                     int32_t         aModType) = 0;

  /**
   * When the content states of a content object change, this method is invoked
   * on the primary frame of that content object.
   *
   * @param aStates the changed states
   */
  virtual void ContentStatesChanged(mozilla::EventStates aStates);

  /**
   * Return how your frame can be split.
   */
  virtual nsSplittableType GetSplittableType() const = 0;

  /**
   * Continuation member functions
   */
  virtual nsIFrame* GetPrevContinuation() const = 0;
  virtual void SetPrevContinuation(nsIFrame*) = 0;
  virtual nsIFrame* GetNextContinuation() const = 0;
  virtual void SetNextContinuation(nsIFrame*) = 0;
  virtual nsIFrame* FirstContinuation() const {
    return const_cast<nsIFrame*>(this);
  }
  virtual nsIFrame* LastContinuation() const {
    return const_cast<nsIFrame*>(this);
  }

  /**
   * GetTailContinuation gets the last non-overflow-container continuation
   * means inline-size, which could be height in vertical layout
   */

  /**
   * Mark any stored intrinsic width information as dirty (requiring
   * re-calculation).  Note that this should generally not be called
   * directly; nsPresShell::FrameNeedsReflow will call it instead.
   */
  virtual void MarkIntrinsicISizesDirty() = 0;

  /**
   * Get the min-content intrinsic inline size of the frame.  This must be
   * less than or equal to the max-content intrinsic inline size.
   *
   * This is *not* affected by the CSS 'min-width', 'width', and
   * 'max-width' properties on this frame, but it is affected by the
   * values of those properties on this frame's descendants.  (It may be
   * called during computation of the values of those properties, so it
   * cannot depend on any values in the nsStylePosition for this frame.)
   *
   * The value returned should **NOT** include the space required for
   * padding and border.
   *
   * Note that many frames will cache the result of this function call
   * unless MarkIntrinsicISizesDirty is called.
   *
   * It is not acceptable for a frame to mark itself dirty when this
   * method is called.
   *
   * This method must not return a negative value.
   */
  virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) = 0;

  /**
   * Get the max-content intrinsic inline size of the frame.  This must be
   * greater than or equal to the min-content intrinsic inline size.
   *
   * Otherwise, all the comments for |GetMinISize| above apply.
   */
  virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) = 0;

  /**
   * |InlineIntrinsicISize| represents the intrinsic width information
   * in inline layout.  Code that determines the intrinsic width of a
   * region of inline layout accumulates the result into this structure.
   * This pattern is needed because we need to maintain state
   * information about whitespace (for both collapsing and trimming).
   */
  struct InlineIntrinsicISizeData {
    InlineIntrinsicISizeData()
      : line(nullptr)
      , lineContainer(nullptr)
      , prevLines(0)
      , currentLine(0)
      , skipWhitespace(true)
      , trailingWhitespace(0)
    {}

    // The line. This may be null if the inlines are not associated with
    // a block or if we just don't know the line.
    const nsLineList_iterator* line;

    // The line container.
    nsIFrame* lineContainer;

    // The maximum intrinsic width for all previous lines.
    nscoord prevLines;

    // The maximum intrinsic width for the current line.  At a line
    // break (mandatory for preferred width; allowed for minimum width),
    // the caller should call |Break()|.
    nscoord currentLine;

    // True if initial collapsable whitespace should be skipped.  This
    // should be true at the beginning of a block, after hard breaks
    // and when the last text ended with whitespace.
    bool skipWhitespace;

    // This contains the width of the trimmable whitespace at the end of
    // |currentLine|; it is zero if there is no such whitespace.
    nscoord trailingWhitespace;

    // Floats encountered in the lines.
    class FloatInfo {
    public:
      FloatInfo(const nsIFrame* aFrame, nscoord aWidth)
        : mFrame(aFrame), mWidth(aWidth)
      { }
      const nsIFrame* Frame() const { return mFrame; }
      nscoord         Width() const { return mWidth; }

    private:
      const nsIFrame* mFrame;
      nscoord         mWidth;
    };

    nsTArray<FloatInfo> floats;
  };

  struct InlineMinISizeData : public InlineIntrinsicISizeData {
    InlineMinISizeData()
      : trailingTextFrame(nullptr)
      , atStartOfLine(true)
    {}

    // We need to distinguish forced and optional breaks for cases where the
    // current line total is negative.  When it is, we need to ignore
    // optional breaks to prevent min-width from ending up bigger than
    // pref-width.
    void ForceBreak(nsRenderingContext *aRenderingContext);

    // If the break here is actually taken, aHyphenWidth must be added to the
    // width of the current line.
    void OptionallyBreak(nsRenderingContext *aRenderingContext,
                         nscoord aHyphenWidth = 0);

    // The last text frame processed so far in the current line, when
    // the last characters in that text frame are relevant for line
    // break opportunities.
    nsIFrame *trailingTextFrame;

    // Whether we're currently at the start of the line.  If we are, we
    // can't break (for example, between the text-indent and the first
    // word).
    bool atStartOfLine;
  };

  struct InlinePrefISizeData : public InlineIntrinsicISizeData {
    void ForceBreak(nsRenderingContext *aRenderingContext);
  };

  /**
   * Add the intrinsic minimum width of a frame in a way suitable for
   * use in inline layout to an |InlineIntrinsicISizeData| object that
   * represents the intrinsic width information of all the previous
   * frames in the inline layout region.
   *
   * All *allowed* breakpoints within the frame determine what counts as
   * a line for the |InlineIntrinsicISizeData|.  This means that
   * |aData->trailingWhitespace| will always be zero (unlike for
   * AddInlinePrefISize).
   *
   * All the comments for |GetMinISize| apply, except that this function
   * is responsible for adding padding, border, and margin and for
   * considering the effects of 'width', 'min-width', and 'max-width'.
   *
   * This may be called on any frame.  Frames that do not participate in
   * line breaking can inherit the default implementation on nsFrame,
   * which calls |GetMinISize|.
   */
  virtual void
  AddInlineMinISize(nsRenderingContext *aRenderingContext,
                    InlineMinISizeData *aData) = 0;

  /**
   * Add the intrinsic preferred width of a frame in a way suitable for
   * use in inline layout to an |InlineIntrinsicISizeData| object that
   * represents the intrinsic width information of all the previous
   * frames in the inline layout region.
   *
   * All the comments for |AddInlineMinISize| and |GetPrefISize| apply,
   * except that this fills in an |InlineIntrinsicISizeData| structure
   * based on using all *mandatory* breakpoints within the frame.
   */
  virtual void
  AddInlinePrefISize(nsRenderingContext *aRenderingContext,
                     InlinePrefISizeData *aData) = 0;

  /**
   * Return the horizontal components of padding, border, and margin
   * that contribute to the intrinsic width that applies to the parent.
   */
  struct IntrinsicISizeOffsetData {
    nscoord hPadding, hBorder, hMargin;
    float hPctPadding, hPctMargin;

    IntrinsicISizeOffsetData()
      : hPadding(0), hBorder(0), hMargin(0)
      , hPctPadding(0.0f), hPctMargin(0.0f)
    {}
  };
  virtual IntrinsicISizeOffsetData
    IntrinsicISizeOffsets(nsRenderingContext* aRenderingContext) = 0;

  virtual mozilla::IntrinsicSize GetIntrinsicSize() = 0;

  /*
   * Get the intrinsic ratio of this element, or nsSize(0,0) if it has
   * no intrinsic ratio.  The intrinsic ratio is the ratio of the
   * height/width of a box with an intrinsic size or the intrinsic
   * aspect ratio of a scalable vector image without an intrinsic size.
   *
   * Either one of the sides may be zero, indicating a zero or infinite
   * ratio.
   */
  virtual nsSize GetIntrinsicRatio() = 0;

  /**
   * Bit-flags to pass to ComputeSize in |aFlags| parameter.
   */
  enum ComputeSizeFlags {
    eDefault =           0,
    /* Set if the frame is in a context where non-replaced blocks should
     * shrink-wrap (e.g., it's floating, absolutely positioned, or
     * inline-block). */
    eShrinkWrap =        1 << 0,
    /* Set if we'd like to compute our 'auto' height, regardless of our actual
     * computed value of 'height'. (e.g. to get an intrinsic height for flex
     * items with "min-height: auto" to use during flexbox layout.) */
    eUseAutoHeight =     1 << 1
  };

  /**
   * Compute the size that a frame will occupy.  Called while
   * @param aBorder  The sum of the vertical / horizontal border widths
   *                 of the frame.
   * @param aPadding The sum of the vertical / horizontal margins of
   *                 the frame, including actual values resulting from
   *                 percentages.
   * @param aFlags   Flags to further customize behavior (definitions above).
   */
  virtual mozilla::LogicalSize
  ComputeSize(nsRenderingContext *aRenderingContext,
              mozilla::WritingMode aWritingMode,
              const mozilla::LogicalSize& aCBSize,
              nscoord aAvailableISize,
              const mozilla::LogicalSize& aMargin,
              const mozilla::LogicalSize& aBorder,
              const mozilla::LogicalSize& aPadding,
              ComputeSizeFlags aFlags) = 0;

  /**
   * Compute a tight bounding rectangle for the frame. This is a rectangle
   * that encloses the pixels that are actually drawn. We're allowed to be
   * conservative and currently we don't try very hard. The rectangle is
   * in appunits and relative to the origin of this frame.
   *
   * This probably only needs to include frame bounds, glyph bounds, and
   * text decorations, but today it sometimes includes other things that
   * contribute to visual overflow.
   *          borders). If your new desired size is different than your current
   *          size, then your parent frame is responsible for making sure that
   *          the difference between the two rects is repainted
   *
   */
  Matrix4x4 GetTransformMatrix(const nsIFrame* aStopAtAncestor,
                               nsIFrame **aOutAncestor);

  /**
   * Bit-flags to pass to IsFrameOfType()
   */
  enum {
    eMathML =                           1 << 0,
    eSVG =                              1 << 1,
    eSVGForeignObject =                 1 << 2,
    eSVGContainer =                     1 << 3,
    eSVGGeometry =                      1 << 4,
    eSVGPaintServer =                   1 << 5,
    eBidiInlineContainer =              1 << 6,
    // the frame is for a replaced element, such as an image
    eReplaced =                         1 << 7,
    // Frame that contains a block but looks like a replaced element
    // from the outside
    eReplacedContainsBlock =            1 << 8,
    // A frame that participates in inline reflow, i.e., one that
    // requires nsHTMLReflowState::mLineLayout.
    eLineParticipant =                  1 << 9,
    eXULBox =                           1 << 10,
    eCanContainOverflowContainers =     1 << 11,
    eBlockFrame =                       1 << 12,
    eTablePart =                        1 << 13,
    // If this bit is set, the frame doesn't allow ignorable whitespace as
    // children. For example, the whitespace between <table>\n<tr>\n<td>
    // will be excluded during the construction of children. 
    eExcludesIgnorableWhitespace =      1 << 14,
    eSupportsCSSTransforms =            1 << 15,

    // These are to allow nsFrame::Init to assert that IsFrameOfType
    // implementations all call the base class method.  They are only
    // meaningful in DEBUG builds.
    eDEBUGAllFrames =                   1 << 30,
    eDEBUGNoFrames =                    1 << 31
  };

  /**
   * API for doing a quick check if a frame is of a given
   * type. Returns true if the frame matches ALL flags passed in.
   *
   * Implementations should always override with inline virtual
   * functions that call the base class's IsFrameOfType method.
   */
  virtual bool IsFrameOfType(uint32_t aFlags) const
  {
#ifdef DEBUG
    return !(aFlags & ~(nsIFrame::eDEBUGAllFrames | nsIFrame::eSupportsCSSTransforms));
#else
# 2077 "../../dist/include/nsIFrame.h"
    return !(aFlags & ~nsIFrame::eSupportsCSSTransforms);
#endif
# 2079 "../../dist/include/nsIFrame.h"
  }

  /**
   * Returns true if the frame is a block wrapper.
   */
  bool IsBlockWrapper() const;

  /**
   * Checks if a frame has had InvalidateFrame() called on it since the
   * last paint.
   *
   * If true, then the invalid rect is returned in aRect, with an
   * empty rect meaning all pixels drawn by this frame should be
   * invalidated.
   * If false, aRect is left unchanged.
   */
  bool IsInvalid(nsRect& aRect);
 
  /**
   * Check if any frame within the frame subtree (including this frame) 
   * composite operation to display the layer tree.
   * is a CSS transform scaling it down)
   */
  nsRect GetVisualOverflowRect() const {
    return GetOverflowRect(eVisualOverflow);
  }

  /**
   * Returns a rect that encompasses the area of this frame that the
   * user should be able to scroll to reach.  This is similar to
   * GetVisualOverflowRect, but does not include outline or shadows, and
   * may in the future include more margins than visual overflow does.
   * It does not include areas clipped out by the CSS "overflow" and
   * "clip" properties.
   *
   * HasOverflowRects() (below) will return true when this overflow
   * rect has been explicitly set, even if it matches mRect.
   * XXX Note: because of a space optimization using the formula above,
   * during reflow this function does not give accurate data if
   * FinishAndStoreOverflow has been called but mRect hasn't yet been
   * updated yet.
   *
   * @return the rect relative to this frame's origin, but after
   * CSS transforms have been applied (i.e. not really this frame's coordinate
   * system, and may not contain the frame's border-box, e.g. if there
   * is a CSS transform scaling it down)
   */
  

  nsRect GetOverflowRect(nsOverflowType aType) const;

  nsOverflowAreas GetOverflowAreas() const;

  /**
   * Same as GetOverflowAreas, except in this frame's coordinate
   * system (before transforms are applied).
   *
   * @return the overflow areas relative to this frame, before any CSS transforms have
   * been applied, i.e. in this frame's coordinate system
   */
  ;

  /**
   * Same as GetScrollableOverflowRect, except relative to the parent
   * frame.
   *
   * @return the rect relative to the parent frame, in the parent frame's
   * coordinate system
   * Return the same as IsEmpty(). This may only be called after the frame
   * has been reflowed and before any further style or content changes.
   */
  virtual bool CachedIsEmpty();
  /**
   * Determine whether the frame is logically empty, assuming that all
   * its children are empty.
   */
  virtual bool IsSelfEmpty() = 0;

  /**
   * IsGeneratedContentFrame returns whether a frame corresponds to
   * generated content
   *
   * @return whether the frame correspods to generated content
   */
  FrameProperties Properties() const {
    return FrameProperties(PresContext()->PropertyTable(), this);
  }

  NS_DECLARE_FRAME_PROPERTY(BaseLevelProperty, nullptr)
  NS_DECLARE_FRAME_PROPERTY(EmbeddingLevelProperty, nullptr)
  NS_DECLARE_FRAME_PROPERTY(ParagraphDepthProperty, nullptr)

#define NS_GET_BASE_LEVEL(frame) \
NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::BaseLevelProperty()))

#define NS_GET_EMBEDDING_LEVEL(frame) \
NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::EmbeddingLevelProperty()))

#define NS_GET_PARAGRAPH_DEPTH(frame) \
NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::ParagraphDepthProperty()))

  /**
   * Return true if and only if this frame obeys visibility:hidden.
   * if it does not, then nsContainerFrame will hide its view even though
   * this means children can't be made visible again.
   */
  virtual bool SupportsVisibilityHidden() { return true; }

  virtual bool IsFocusable(int32_t *aTabIndex = nullptr, bool aWithMouse = false);

  // BOX LAYOUT METHODS
  // These methods have been migrated from nsIBox and are in the process of
  // being refactored. DO NOT USE OUTSIDE OF XUL.
  bool IsBoxFrame() const
  {
    return IsFrameOfType(nsIFrame::eXULBox);
  }

  enum Halignment {
    hAlign_Left,
    hAlign_Right,
    hAlign_Center
  };

  enum Valignment {
    vAlign_Top,
    vAlign_Middle,
    vAlign_BaseLine,
    vAlign_Bottom
  };

  /**
   * This calculates the minimum size required for a box based on its state
   * @param[in] aBoxLayoutState The desired state to calculate for
   * @return The minimum size
   */
  virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) = 0;

  /**
   * This calculates the preferred size of a box based on its state
   * @param[in] aBoxLayoutState The desired state to calculate for
   * @return The preferred size
   */
  virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) = 0;

  /**
   * This calculates the maximum size for a box based on its state
   * @param[in] aBoxLayoutState The desired state to calculate for
   * @return The maximum size
   */    
  virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) = 0;

  /**
   * This returns the minimum size for the scroll area if this frame is
   * being scrolled. Usually it's (0,0).
   */
  virtual nsSize GetMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState) = 0;

  // Implemented in nsBox, used in nsBoxFrame
  uint32_t GetOrdinal();

  virtual nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState) = 0;
  virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) = 0;
  virtual bool IsCollapsed() = 0;
  // This does not alter the overflow area. If the caller is changing
  // the box size, the caller is responsible for updating the overflow
  // area. It's enough to just call Layout or SyncLayout on the
  // box. You can pass true to aRemoveOverflowArea as a
  // convenience.
  virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
                         bool aRemoveOverflowAreas = false) = 0;
  nsresult Layout(nsBoxLayoutState& aBoxLayoutState);
  // Box methods.  Note that these do NOT just get the CSS border, padding,
  // etc.  They also talk to nsITheme.
  virtual nsresult GetBorderAndPadding(nsMargin& aBorderAndPadding);
  virtual nsresult GetBorder(nsMargin& aBorder)=0;
  virtual nsresult GetPadding(nsMargin& aBorderAndPadding)=0;
  virtual nsresult GetMargin(nsMargin& aMargin)=0;
  virtual void SetLayoutManager(nsBoxLayout* aLayout) { }
  virtual nsBoxLayout* GetLayoutManager() { return nullptr; }
  nsresult GetClientRect(nsRect& aContentRect);

  // For nsSprocketLayout
  virtual Valignment GetVAlign() const = 0;
  virtual Halignment GetHAlign() const = 0;

  bool IsHorizontal() const { return (mState & NS_STATE_IS_HORIZONTAL) != 0; }
  bool IsNormalDirection() const { return (mState & NS_STATE_IS_DIRECTION_NORMAL) != 0; }

  nsresult Redraw(nsBoxLayoutState& aState);
  virtual nsresult RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild)=0;
  // XXX take this out after we've branched
  virtual bool GetMouseThrough() const { return false; }

#ifdef DEBUG_LAYOUT
  virtual nsresult SetDebug(nsBoxLayoutState& aState, bool aDebug)=0;
  virtual nsresult GetDebug(bool& aDebug)=0;

  virtual nsresult DumpBox(FILE* out)=0;
#endif
# 2746 "../../dist/include/nsIFrame.h"

  /**
   * @return true if this text frame ends with a newline character.  It
   * should return false if this is not a text frame.
   */
  ;

  ;
  ;
  ;
  ;

  // END OF BOX LAYOUT METHODS
  // The above methods have been migrated from nsIBox and are in the process of
  // being refactored. DO NOT USE OUTSIDE OF XUL.

  struct CaretPosition {
    ;
    ;

    nsCOMPtr<nsIContent> mResultContent;
    int32_t              mContentOffset;
  };

  /**
   * gets the first or last possible caret position within the frame
   *
  /**
   * Return whether this is a frame whose width is used when computing
   * the font size inflation of its descendants.
   */
  

  /**
   * Returns the content node within the anonymous content that this frame
   * generated and which corresponds to the specified pseudo-element type,
   * or nullptr if there is no such anonymous content.
   */
  ;

protected:
  // Members
  nsRect           mRect;
  nsIContent*      mContent;
  nsStyleContext*  mStyleContext;
private:
  nsContainerFrame* mParent;
  nsIFrame*        mNextSibling;  // doubly-linked list of frames
  nsIFrame*        mPrevSibling;  // Do not touch outside SetNextSibling!

  ;

  static void DestroyPaintedPresShellList(void* propertyValue) {
    nsTArray<nsWeakPtr>* list = static_cast<nsTArray<nsWeakPtr>*>(propertyValue);
    list->Clear();
    delete list;
  }

  // Stores weak references to all the PresShells that were painted during

protected:
  nsFrameState     mState;

  // When there is an overflow area only slightly larger than mRect,
  // we store a set of four 1-byte deltas from the edges of mRect
  // rather than allocating a whole separate rectangle property.
  // Note that these are unsigned values, all measured "outwards"
  // from the edges of mRect, so /mLeft/ and /mTop/ are reversed from
  // our normal coordinate system.
  // If mOverflow.mType == NS_FRAME_OVERFLOW_LARGE, then the
  // delta values are not meaningful and the overflow area is stored
  // as a separate rect property.
  struct VisualDeltas {
    uint8_t mLeft;
    uint8_t mTop;
    uint8_t mRight;
    uint8_t mBottom;
    bool operator==(const VisualDeltas& aOther) const
    {
      return mLeft == aOther.mLeft && mTop == aOther.mTop &&
             mRight == aOther.mRight && mBottom == aOther.mBottom;
    }
    bool operator!=(const VisualDeltas& aOther) const
    {
      return !(*this == aOther);
    }
  };
  union {
    uint32_t     mType;
    VisualDeltas mVisualDeltas;
  } mOverflow;
  /**
   * Returns true if any overflow changed.
   */
  bool SetOverflowAreas(const nsOverflowAreas& aOverflowAreas);

  // Helper-functions for SortFrameList():
  template<bool IsLessThanOrEqual(nsIFrame*, nsIFrame*)>
  static nsIFrame* SortedMerge(nsIFrame *aLeft, nsIFrame *aRight);

  template<bool IsLessThanOrEqual(nsIFrame*, nsIFrame*)>
  static nsIFrame* MergeSort(nsIFrame *aSource);

  bool HasOpacityInternal(float aThreshold) const;

#ifdef DEBUG_FRAME_DUMP
public:
  static void IndentBy(FILE* out, int32_t aIndent) {
    while (--aIndent >= 0) fputs("  ", out);
  }
  void ListTag(FILE* out) const {
    ListTag(out, this);
  }
  static void ListTag(FILE* out, const nsIFrame* aFrame) {
    nsAutoCString t;
    ListTag(t, aFrame);
    fputs(t.get(), out);
  }
  void ListTag(nsACString& aTo) const;
  static void ListTag(nsACString& aTo, const nsIFrame* aFrame);
  void ListGeneric(nsACString& aTo, const char* aPrefix = "", uint32_t aFlags = 0) const;
  enum {
    TRAVERSE_SUBDOCUMENT_FRAMES = 0x01
  };
  virtual void List(FILE* out = stderr, const char* aPrefix = "", uint32_t aFlags = 0) const;
  /**
   * lists the frames beginning from the root frame
   * - calls root frame's List(...)
   */
  static void RootFrameList(nsPresContext* aPresContext,
                            FILE* out = stderr, const char* aPrefix = "");
  virtual void DumpFrameTree();
  void DumpFrameTreeLimited();

  virtual nsresult  GetFrameName(nsAString& aResult) const = 0;
#endif
# 3206 "../../dist/include/nsIFrame.h"

#ifdef DEBUG
public:
  virtual nsFrameState  GetDebugStateBits() const = 0;
  virtual nsresult  DumpRegressionData(nsPresContext* aPresContext,
                                       FILE* out, int32_t aIndent) = 0;
#endif
# 3213 "../../dist/include/nsIFrame.h"
};

//----------------------------------------------------------------------


// Helper-functions for nsIFrame::SortFrameList()
// ---------------------------------------------------

template<bool IsLessThanOrEqual(nsIFrame*, nsIFrame*)>
/* static */ nsIFrame*
nsIFrame::SortedMerge(nsIFrame *aLeft, nsIFrame *aRight)
{
  NS_PRECONDITION(aLeft && aRight, "SortedMerge must have non-empty lists");

  nsIFrame *result;
  // Unroll first iteration to avoid null-check 'result' inside the loop.
  if (IsLessThanOrEqual(aLeft, aRight)) {
    result = aLeft;
    aLeft = aLeft->GetNextSibling();
    if (!aLeft) {
      result->SetNextSibling(aRight);
      return result;
    }
  }
  else {
    result = aRight;
    aRight = aRight->GetNextSibling();
    if (!aRight) {
      result->SetNextSibling(aLeft);
      return result;
    }
  }

  nsIFrame *last = result;
  for (;;) {
    if (IsLessThanOrEqual(aLeft, aRight)) {
      last->SetNextSibling(aLeft);
      last = aLeft;
      aLeft = aLeft->GetNextSibling();
      if (!aLeft) {
        last->SetNextSibling(aRight);
        return result;
      }
    }
    else {
      last->SetNextSibling(aRight);
      last = aRight;
      aRight = aRight->GetNextSibling();
      if (!aRight) {
        last->SetNextSibling(aLeft);
        return result;
      }
    }
  }
}

template<bool IsLessThanOrEqual(nsIFrame*, nsIFrame*)>
/* static */ nsIFrame*
nsIFrame::MergeSort(nsIFrame *aSource)
{
  NS_PRECONDITION(aSource, "MergeSort null arg");

  nsIFrame *sorted[32] = { nullptr };
  nsIFrame **fill = &sorted[0];
  nsIFrame **left;
  nsIFrame *rest = aSource;

  do {
    nsIFrame *current = rest;
    rest = rest->GetNextSibling();
    current->SetNextSibling(nullptr);

    // Merge it with sorted[0] if present; then merge the result with sorted[1] etc.
    // sorted[0] is a list of length 1 (or nullptr).
    // sorted[1] is a list of length 2 (or nullptr).
    // sorted[2] is a list of length 4 (or nullptr). etc.
    for (left = &sorted[0]; left != fill && *left; ++left) {
      current = SortedMerge<IsLessThanOrEqual>(*left, current);
      *left = nullptr;
    }

    // Fill the empty slot that we couldn't merge with the last result.
    *left = current;

    if (left == fill)
      ++fill;
  } while (rest);

  // Collect and merge the results.
  nsIFrame *result = nullptr;
  for (left = &sorted[0]; left != fill; ++left) {
    if (*left) {
      result = result ? SortedMerge<IsLessThanOrEqual>(*left, result) : *left;
    }
  }
  return result;
}





#endif /* nsIFrame_h___ */
# 3485 "../../dist/include/nsIFrame.h"
# 15 "../../dist/include/nsSVGEffects.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIMutationObserver.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsSVGEffects.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsInterfaceHashtable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsInterfaceHashtable.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsInterfaceHashtable_h__
#define nsInterfaceHashtable_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsBaseHashtable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsInterfaceHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsInterfaceHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/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
 */
template<class KeyClass, class Interface>
class nsInterfaceHashtable
  : public nsBaseHashtable<KeyClass, nsCOMPtr<Interface>, Interface*>
{
public:
  typedef typename KeyClass::KeyType KeyType;
  typedef Interface* UserDataType;
  typedef nsBaseHashtable<KeyClass, nsCOMPtr<Interface>, Interface*> base_type;

  
  

  /**
   * @copydoc nsBaseHashtable::Get
   * @param aData This is an XPCOM getter, so aData is already_addrefed.
   *   If the key doesn't exist, aData will be set to nullptr.
   */
  ;

  /**
   * @copydoc nsBaseHashtable::Get
   */
  ;

  /**
   * Gets a weak reference to the hashtable entry.
   * @param aFound If not nullptr, will be set to true if the entry is found,
   *               to false otherwise.
   * @return The entry, or nullptr if not found. Do not release this pointer!
   */
  ;
};





//
// nsInterfaceHashtable definitions
//







#endif // nsInterfaceHashtable_h__
# 144 "../../dist/include/nsInterfaceHashtable.h"
# 17 "../../dist/include/nsSVGEffects.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsBase.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsSVGEffects.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsSVGEffects.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsReferencedElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsReferencedElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 sw=2 et tw=78: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSREFERENCEDELEMENT_H_
#define NSREFERENCEDELEMENT_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsReferencedElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsReferencedElement.h"

class nsIURI;
class nsCycleCollectionCallback;

/**
 * Class to track what element is referenced by a given ID.
 * 
 * To use it, call Reset() to set it up to watch a given URI. Call get()
 * anytime to determine the referenced element (which may be null if
 * the element isn't found). When the element changes, ElementChanged
 * will be called, so subclass this class if you want to receive that
 * notification. ElementChanged runs at safe-for-script time, i.e. outside
 * of the content update. Call Unlink() if you want to stop watching
 * for changes (get() will then return null).
 *
 * By default this is a single-shot tracker --- i.e., when ElementChanged
 * fires, we will automatically stop tracking. get() will continue to return
 * the changed-to element.
 * Override IsPersistent to return true if you want to keep tracking after
 * the first change.
 */
class nsReferencedElement {
public:
  typedef mozilla::dom::Element Element;

  nsReferencedElement() {}
  ~nsReferencedElement() {
    Unlink();
  }

  /**
   * Find which element, if any, is referenced.
   */
  Element* get() { return mElement; }

  /**
   * Set up the reference. This can be called multiple times to
   * change which reference is being tracked, but these changes
   * do not trigger ElementChanged.
   * @param aFrom the source element for context
   * @param aURI the URI containing a hash-reference to the element
   * @param aWatch if false, then we do not set up the notifications to track
   * changes, so ElementChanged won't fire and get() will always return the same
   * value, the current element for the ID.
  /**
   * Clears the reference. ElementChanged is not triggered. get() will return
   * null.
   */
  void Unlink();

  ;
  
protected:
  /**
   * Override this to be notified of element changes. Don't forget
   * to call this superclass method to change mElement. This is called
   * at script-runnable time.
   */
  virtual void ElementChanged(Element* aFrom, Element* aTo) {
    mElement = aTo;
  }

  /**
   * Override this to convert from a single-shot notification to
   * a persistent notification.
   */
  virtual bool IsPersistent() { return false; }

  /**
   * Set ourselves up with our new document.  Note that aDocument might be
   * null.  Either aWatch must be false or aRef must be empty.
   */
  ;
  
private:
  ;

  class Notification : public nsISupports {
  public:
    ;
    virtual void Clear() { mTarget = nullptr; }
    virtual ~Notification() {}
  protected:
    
    nsReferencedElement* mTarget;
  };

  class ChangeNotification : public nsRunnable,
                             public Notification
  {
  public:
    

    NS_DECL_ISUPPORTS_INHERITED
    

    nsString mRef;
  };
  friend class DocumentLoadNotification;
  
  nsCOMPtr<nsIAtom>      mWatchID;
  nsCOMPtr<nsIDocument>  mWatchDocument;
  nsRefPtr<Element> mElement;
  nsRefPtr<Notification> mPendingNotification;
  bool                   mReferencingImage;
};





#endif /*NSREFERENCEDELEMENT_H_*/
# 204 "../../dist/include/nsReferencedElement.h"
# 20 "../../dist/include/nsSVGEffects.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsStubMutationObserver.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsSVGEffects.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsSVGUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NS_SVGUTILS_H
#define NS_SVGUTILS_H

// include math.h to pick up definition of M_ maths defines e.g. M_PI
#define _USE_MATH_DEFINES
#if 0 /* expanded by -frewrite-includes */
#include <math.h>
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsSVGUtils.h"

#if 0 /* expanded by -frewrite-includes */
#include "DrawMode.h"
#endif /* expanded by -frewrite-includes */
class nsSVGPathGeometryFrame;
class nsTextFrame;
class gfxTextContextPaint;

struct nsStyleSVG;
struct nsStyleSVGPaint;
struct nsRect;
struct nsIntRect;
struct nsPoint;

namespace mozilla {
class SVGAnimatedPreserveAspectRatio;
class SVGPreserveAspectRatio;
namespace dom {
class Element;
class UserSpaceMetrics;
} // namespace dom
namespace gfx {
class DrawTarget;
class GeneralPattern;
class SourceSurface;
}
} // namespace mozilla

// maximum dimension of an offscreen surface - choose so that
// the surface size doesn't overflow a 32-bit signed int using
// 4 bytes per pixel; in line with gfxASurface::CheckSurfaceSize
// In fact Macs can't even manage that
#define NS_SVG_OFFSCREEN_MAX_DIMENSION 4096

#define SVG_HIT_TEST_FILL        0x01
#define SVG_HIT_TEST_STROKE      0x02
#define SVG_HIT_TEST_CHECK_MRECT 0x04


;
;
;
;

/**
 * Sometimes we need to distinguish between an empty box and a box
 * that contains an element that has no size e.g. a point at the origin.
 */
class SVGBBox {
  typedef mozilla::gfx::Rect Rect;

public:
  

private:
  Rect mBBox;
  bool mIsEmpty;
};

// GRRR WINDOWS HATE HATE HATE
#undef CLIP_MASK

class MOZ_STACK_CLASS SVGAutoRenderState
{
  typedef mozilla::gfx::DrawTarget DrawTarget;

public:
  ;
  ;

  void SetPaintingToWindow(bool aPaintingToWindow);

  static bool IsPaintingToWindow(DrawTarget* aDrawTarget);

private:
  DrawTarget* mDrawTarget;
  void* mOriginalRenderState;
  bool mPaintingToWindow;
  MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
};


#define NS_ISVGFILTERREFERENCE_IID \
{ 0x9744ee20, 0x1bcf, 0x4c62, \
 { 0x86, 0x7d, 0xd3, 0x7a, 0x91, 0x60, 0x3e, 0xef } }

class nsISVGFilterReference : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISVGFILTERREFERENCE_IID)
  virtual void Invalidate() = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsISVGFilterReference, NS_ISVGFILTERREFERENCE_IID)

/**
 * General functions used by all of SVG layout and possibly content code.
 * If a method is used by content and depends only on other content methods
 * it should go in SVGContentUtils instead.
 */
class nsSVGUtils
{
public:
  typedef mozilla::dom::Element Element;
  typedef mozilla::gfx::AntialiasMode AntialiasMode;
  typedef mozilla::gfx::FillRule FillRule;
  typedef mozilla::gfx::GeneralPattern GeneralPattern;

  static void Init();

  /**
   * Gets the nearest nsSVGInnerSVGFrame or nsSVGOuterSVGFrame frame. aFrame
   * Returns the CanvasTM of the indicated frame, whether it's a
   * child SVG frame, container SVG frame, or a regular frame.
  /**
   * See https://svgwg.org/svg2-draft/painting.html#NonScalingStroke
   *   target context space
   * @param aResult the result (valid when true is returned)
   * @return true if calculating the extents succeeded
   */
  ;

  /**
   * Returns the app unit canvas bounds of a userspace rect.
   *
   * @param aToCanvas Transform from userspace to canvas device space.
   */
  ;
};

#endif
# 576 "../../dist/include/nsSVGUtils.h"
# 22 "../../dist/include/nsSVGEffects.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTHashtable.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsSVGEffects.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsURIHashKey.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsURIHashKey.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsURIHashKey_h__
#define nsURIHashKey_h__


/**
 * Hashtable key class to use with nsTHashtable/nsBaseHashtable
 */
class nsURIHashKey : public PLDHashEntryHdr
{
public:
    typedef nsIURI* KeyType;
    typedef const nsIURI* KeyTypePointer;

    
    
    

    

    

    
    
    
    enum { ALLOW_MEMMOVE = true };

protected:
    nsCOMPtr<nsIURI> mKey;
};

#endif // nsURIHashKey_h__
# 52 "../../dist/include/nsURIHashKey.h"
# 24 "../../dist/include/nsSVGEffects.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/nsSVGEffects.h"

class nsIAtom;
class nsIPresShell;
class nsIURI;
class nsSVGClipPathFrame;
class nsSVGPaintServerFrame;
class nsSVGFilterFrame;
class nsSVGMaskFrame;
class nsSVGFilterChainObserver;

/*
 * This interface allows us to be notified when a piece of SVG content is
 * re-rendered.
 *
 * Concrete implementations of this interface need to implement
 * "GetTarget()" to specify the piece of SVG content that they'd like to
 * monitor, and they need to implement "DoUpdate" to specify how we'll react
 * when that content gets re-rendered. They also need to implement a
 * constructor and destructor, which should call StartListening and
 * StopListening, respectively.
 */
class nsSVGRenderingObserver : public nsStubMutationObserver {

protected:
  

public:
  typedef mozilla::dom::Element Element;
  

  

  nsIFrame* GetReferencedFrame();
  /**
   * @param aOK this is only for the convenience of callers. We set *aOK to false
   * if the frame is the wrong type
   */
  nsIFrame* GetReferencedFrame(nsIAtom* aFrameType, bool* aOK);

  Element* GetReferencedElement();

  virtual bool ObservesReflow() { return true; }

protected:
  // Non-virtual protected methods
  void StartListening();
  void StopListening();

  // Virtual protected methods
  virtual void DoUpdate() = 0; // called when the referenced resource changes.

  // This is an internally-used version of GetReferencedElement that doesn't
  // forcibly add us as an observer. (whereas GetReferencedElement does)
  virtual Element* GetTarget() = 0;

  // Whether we're in our referenced element's observer list at this time.
  bool mInObserverList;
};


/*
 * SVG elements reference supporting resources by element ID. We need to
 * track when those resources change and when the DOM changes in ways
 * that affect which element is referenced by a given ID (e.g., when
 * element IDs change). The code here is responsible for that.
 *
 * When a frame references a supporting resource, we create a property
 * object derived from nsSVGIDRenderingObserver to manage the relationship. The
 * property object is attached to the referencing frame.
 */
class nsSVGIDRenderingObserver : public nsSVGRenderingObserver {
public:
  typedef mozilla::dom::Element Element;
  nsSVGIDRenderingObserver(nsIURI* aURI, nsIContent* aObservingContent,
                         bool aReferenceImage);
  virtual ~nsSVGIDRenderingObserver();

protected:
  

  // This is called when the referenced resource changes.
  virtual void DoUpdate() MOZ_OVERRIDE;

  class SourceReference : public nsReferencedElement {
  public:
    
  protected:
    virtual void ElementChanged(Element* aFrom, Element* aTo) MOZ_OVERRIDE {
      mContainer->StopListening();
      nsReferencedElement::ElementChanged(aFrom, aTo);
      mContainer->StartListening();
      mContainer->DoUpdate();
    }
    /**
     * Override IsPersistent because we want to keep tracking the element
     * for the ID even when it changes.
     */
    virtual bool IsPersistent() MOZ_OVERRIDE { return true; }
  private:
    nsSVGIDRenderingObserver* mContainer;
  };

  SourceReference mElement;
};

struct nsSVGFrameReferenceFromProperty
{
  explicit nsSVGFrameReferenceFromProperty(nsIFrame* aFrame)
    : mFrame(aFrame)
    , mFramePresShell(aFrame->PresContext()->PresShell())
  {}

  // Clear our reference to the frame.
  void Detach();

  // null if the frame has become invalid
  ;

private:
  // The frame that this property is attached to, may be null
  nsIFrame *mFrame;
  // When a presshell is torn down, we don't delete the properties for
  // each frame until after the frames are destroyed. So here we remember
  // the presshell for the frames we care about and, before we use the frame,
  // we test the presshell to see if it's destroying itself. If it is,
  // then the frame pointer is not valid and we know the frame has gone away.
  // mFramePresShell may be null, but when mFrame is non-null, mFramePresShell
  // is guaranteed to be non-null, too.
  nsIPresShell *mFramePresShell;
};

class nsSVGRenderingObserverProperty : public nsSVGIDRenderingObserver {
public:
  

protected:
  virtual void DoUpdate() MOZ_OVERRIDE;

  nsSVGFrameReferenceFromProperty mFrameReference;
};

/**
 * In a filter chain, there can be multiple SVG reference filters.
 * e.g. filter: url(#svg-filter-1) blur(10px) url(#svg-filter-2);
 *
 * This class keeps track of one SVG reference filter in a filter chain.
 * e.g. url(#svg-filter-1)
 *
 * It fires invalidations when the SVG filter element's id changes or when
 * the SVG filter element's content changes.
 *
 * The nsSVGFilterChainObserver class manages a list of nsSVGFilterReferences.
 */
class nsSVGFilterReference MOZ_FINAL :
  public nsSVGIDRenderingObserver, public nsISVGFilterReference {
public:
  

protected:
  virtual ~nsSVGFilterReference() {}

  // nsSVGIDRenderingObserver
  virtual void DoUpdate() MOZ_OVERRIDE;

private:
  nsSVGFilterChainObserver* mFilterChainObserver;
};

/**
 * This class manages a list of nsSVGFilterReferences, which represent SVG
 * reference filters in a filter chain.
 * e.g. filter: url(#svg-filter-1) blur(10px) url(#svg-filter-2);
 *
 * In the above example, the nsSVGFilterChainObserver will manage two
 * nsSVGFilterReferences, one for each SVG reference filter. CSS filters like
 * "blur(10px)" don't reference filter elements, so they don't need an
 * nsSVGFilterReference. The style system invalidates changes to CSS filters.
 */
class nsSVGFilterChainObserver : public nsISupports {
public:
  nsSVGFilterChainObserver(const nsTArray<nsStyleFilter>& aFilters,
                           nsIContent* aFilteredElement);

  bool ReferencesValidResources();
  bool IsInObserverLists() const;
  

  // nsISupports
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_CLASS(nsSVGFilterChainObserver)

protected:
  virtual ~nsSVGFilterChainObserver();

  virtual void DoUpdate() = 0;

private:
  nsTArray<nsRefPtr<nsSVGFilterReference>> mReferences;
};

class nsSVGFilterProperty : public nsSVGFilterChainObserver {
public:
  

  void DetachFromFrame() { mFrameReference.Detach(); }

protected:
  virtual void DoUpdate() MOZ_OVERRIDE;

  nsSVGFrameReferenceFromProperty mFrameReference;
};

class nsSVGMarkerProperty : public nsSVGRenderingObserverProperty {
public:
  

protected:
  virtual void DoUpdate() MOZ_OVERRIDE;
};

class nsSVGTextPathProperty : public nsSVGRenderingObserverProperty {
public:
  

  

protected:
  virtual void DoUpdate() MOZ_OVERRIDE;

private:
  /**
   * Returns true if the target of the textPath is the frame of a 'path' element.
   */
  ;

  bool mValid;
};

class nsSVGPaintingProperty : public nsSVGRenderingObserverProperty {
public:
  

protected:
  virtual void DoUpdate() MOZ_OVERRIDE;
};

/**
 * A manager for one-shot nsSVGRenderingObserver tracking.
 * nsSVGRenderingObservers can be added or removed. They are not strongly
 * referenced so an observer must be removed before it dies.
 * When InvalidateAll is called, all outstanding references get
 * InvalidateViaReferencedElement()
 * called on them and the list is cleared. The intent is that
 * the observer will force repainting of whatever part of the document
 * is needed, and then at paint time the observer will do a clean lookup
 * of the referenced element and [re-]add itself to the element's observer list.
 *
 * InvalidateAll must be called before this object is destroyed, i.e.
 * before the referenced frame is destroyed. This should normally happen
 * via nsSVGContainerFrame::RemoveFrame, since only frames in the frame
 * tree should be referenced.
 */
class nsSVGRenderingObserverList {
public:
  

  

  
  
#ifdef DEBUG
  bool Contains(nsSVGRenderingObserver* aObserver)
  { return (mObservers.GetEntry(aObserver) != nullptr); }
#endif
# 361 "../../dist/include/nsSVGEffects.h"
  

  /**
   * Drop all our observers, and notify them that we have changed and dropped
   * our reference to them.
   */
  void InvalidateAll();

  /**
   * Drop all observers that observe reflow, and notify them that we have changed and dropped
   * our reference to them.
   */
  ;

  /**
   * Drop all our observers, and notify them that we have dropped our reference
   * to them.
   */
  ;

private:
  nsTHashtable<nsPtrHashKey<nsSVGRenderingObserver> > mObservers;
};

class nsSVGEffects {
public:
  typedef mozilla::dom::Element Element;
  typedef mozilla::FramePropertyDescriptor FramePropertyDescriptor;
  typedef nsInterfaceHashtable<nsURIHashKey, nsIMutationObserver>
    URIObserverHashtable;

  static void DestroyFilterProperty(void* aPropertyValue)
  {
    auto* prop = static_cast<nsSVGFilterProperty*>(aPropertyValue);

    // nsSVGFilterProperty is cycle-collected, so dropping the last reference
    // doesn't necessarily destroy it. We need to tell it that the frame
    // has now become invalid.
    prop->DetachFromFrame();

    prop->Release();
  }

  NS_DECLARE_FRAME_PROPERTY(FilterProperty, DestroyFilterProperty)
  NS_DECLARE_FRAME_PROPERTY(MaskProperty, ReleaseValue<nsISupports>)
  NS_DECLARE_FRAME_PROPERTY(ClipPathProperty, ReleaseValue<nsISupports>)
  NS_DECLARE_FRAME_PROPERTY(MarkerBeginProperty, ReleaseValue<nsISupports>)
  NS_DECLARE_FRAME_PROPERTY(MarkerMiddleProperty, ReleaseValue<nsISupports>)
  NS_DECLARE_FRAME_PROPERTY(MarkerEndProperty, ReleaseValue<nsISupports>)
  NS_DECLARE_FRAME_PROPERTY(FillProperty, ReleaseValue<nsISupports>)
  NS_DECLARE_FRAME_PROPERTY(StrokeProperty, ReleaseValue<nsISupports>)
  NS_DECLARE_FRAME_PROPERTY(HrefProperty, ReleaseValue<nsISupports>)
  NS_DECLARE_FRAME_PROPERTY(BackgroundImageProperty,
                            DeleteValue<URIObserverHashtable>)

  /**

  /**
   * Removes all rendering observers from aElement.
   * to make invalidation relatively lightweight when an SVG effect changes.
   */
  ;

  enum {
    INVALIDATE_REFLOW = 1
  };

  /**
   * This can be called on any element or frame. Only direct observers of this
   * (frame's) element, if any, are invalidated.
   */
  static void InvalidateDirectRenderingObservers(Element *aElement, uint32_t aFlags = 0);
  ;

  /**
   * Get an nsSVGMarkerProperty for the frame, creating a fresh one if necessary
   */
  ;
  /**
   * Get an nsSVGTextPathProperty for the frame, creating a fresh one if necessary
   */
  ;
  /**
   * Get an nsSVGPaintingProperty for the frame, creating a fresh one if necessary
   */
  ;
  /**
   * Get an nsSVGPaintingProperty for the frame for that URI, creating a fresh
   * one if necessary
   */
  ;
};

#endif /*NSSVGEFFECTS_H_*/
# 548 "../../dist/include/nsSVGEffects.h"
# 30 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h" 2

class nsGlobalWindow;
class nsXULElement;

namespace mozilla {
namespace gl {
class SourceSurface;
}

namespace dom {
class HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement;
class ImageData;
class StringOrCanvasGradientOrCanvasPattern;
class OwningStringOrCanvasGradientOrCanvasPattern;
class TextMetrics;
class SVGMatrix;
class CanvasFilterChainObserver;

extern const mozilla::gfx::Float SIGMA_MAX;

template<typename T> class Optional;

class CanvasPath MOZ_FINAL :
  public nsWrapperCache
{
public:
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(CanvasPath)
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(CanvasPath)

  

  JSObject* WrapObject(JSContext* aCx);

  ;
  ;
  ;

  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;

  ;
  ;

  TemporaryRef<gfx::Path> GetPath(const CanvasWindingRule& aWinding,
                                  const gfx::DrawTarget* aTarget) const;

  ;
  // TemporaryRef arg because the return value from Path::CopyToBuilder() is
  // passed directly and we can't drop the only ref to have a raw pointer.
  ;

  ;

private:
  virtual ~CanvasPath() {}

  nsCOMPtr<nsISupports> mParent;
  

  mutable RefPtr<gfx::Path> mPath;
  mutable RefPtr<gfx::PathBuilder> mPathBuilder;

  void EnsurePathBuilder() const;
};

struct CanvasBidiProcessor;
class CanvasRenderingContext2DUserData;
class CanvasDrawObserver;

/**
 ** CanvasRenderingContext2D
 **/
class CanvasRenderingContext2D MOZ_FINAL :
  public nsICanvasRenderingContextInternal,
  public nsWrapperCache
{
typedef HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement
  HTMLImageOrCanvasOrVideoElement;

  virtual ~CanvasRenderingContext2D();

public:
  ;

  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
  void RemoveHitRegion(const nsAString& id);
  ;

  

  

  void DrawImage(const HTMLImageOrCanvasOrVideoElement& image,
                 double sx, double sy, double sw, double sh, double dx,
                 double dy, double dw, double dh, mozilla::ErrorResult& error)
  {
    DrawImage(image, sx, sy, sw, sh, dx, dy, dw, dh, 6, error);
  }

  already_AddRefed<ImageData>
    CreateImageData(JSContext* cx, double sw, double sh,
                    mozilla::ErrorResult& error);
  ;
  ;
  ;
  ;

  

  
  ;
  ;
  ;
  ;

  

  

  

  void SetFont(const nsAString& font, mozilla::ErrorResult& error);
  ;
  ;
  ;
  ;

  

  

  

  

  

  ;
  ;
  enum RenderingMode {
    SoftwareBackendMode,
    OpenGLBackendMode,
    DefaultBackendMode
  };

  bool SwitchRenderingMode(RenderingMode aRenderingMode);

  // Eventually this should be deprecated. Keeping for now to keep the binding functional.
  ;

  nsresult Redraw();

#ifdef DEBUG
    virtual int32_t GetWidth() const MOZ_OVERRIDE;
    virtual int32_t GetHeight() const MOZ_OVERRIDE;
#endif
# 488 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
  // nsICanvasRenderingContextInternal
  /**
    * Gets the pres shell from either the canvas element or the doc shell
    */
  virtual nsIPresShell *GetPresShell() MOZ_OVERRIDE {
    if (mCanvasElement) {
      return mCanvasElement->OwnerDoc()->GetShell();
    }
    if (mDocShell) {
      return mDocShell->GetPresShell();
    }
    return nullptr;
  }
  NS_IMETHOD SetDimensions(int32_t width, int32_t height) MOZ_OVERRIDE;
  NS_IMETHOD InitializeWithSurface(nsIDocShell *shell, gfxASurface *surface, int32_t width, int32_t height) MOZ_OVERRIDE;

  NS_IMETHOD GetInputStream(const char* aMimeType,
                            const char16_t* aEncoderOptions,
                            nsIInputStream **aStream) MOZ_OVERRIDE;

  mozilla::TemporaryRef<mozilla::gfx::SourceSurface> GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) MOZ_OVERRIDE
  {
    EnsureTarget();
    if (aPremultAlpha) {
      *aPremultAlpha = true;
    }
    return mTarget->Snapshot();
  }

  NS_IMETHOD SetIsOpaque(bool isOpaque) MOZ_OVERRIDE;
  bool GetIsOpaque() MOZ_OVERRIDE { return mOpaque; }
  NS_IMETHOD Reset() MOZ_OVERRIDE;
  already_AddRefed<CanvasLayer> GetCanvasLayer(nsDisplayListBuilder* aBuilder,
                                               CanvasLayer *aOldLayer,
                                               LayerManager *aManager) MOZ_OVERRIDE;
  virtual bool ShouldForceInactiveLayer(LayerManager *aManager) MOZ_OVERRIDE;
  void MarkContextClean() MOZ_OVERRIDE;
  NS_IMETHOD SetIsIPC(bool isIPC) MOZ_OVERRIDE;
  // this rect is in canvas device space
  void Redraw(const mozilla::gfx::Rect &r);
  NS_IMETHOD Redraw(const gfxRect &r) MOZ_OVERRIDE { Redraw(ToRect(r)); return NS_OK; }
  NS_IMETHOD SetContextOptions(JSContext* aCx, JS::Handle<JS::Value> aOptions) MOZ_OVERRIDE;

  /**
   * An abstract base class to be implemented by callers wanting to be notified
   * that a refresh has occurred. Callers must ensure an observer is removed
   * before it is destroyed.
   */
  virtual void DidRefresh() MOZ_OVERRIDE;

  // this rect is in mTarget's current user space
  void RedrawUser(const gfxRect &r);

  // nsISupports interface + CC
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS

  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(CanvasRenderingContext2D)

  enum class CanvasMultiGetterType : uint8_t {
    STRING = 0,
    PATTERN = 1,
    GRADIENT = 2
  };

  enum class Style : uint8_t {
    STROKE = 0,
    FILL,
    MAX
  };

  

  void LineTo(const mozilla::gfx::Point& aPoint)
  {
    if (mPathBuilder) {
      mPathBuilder->LineTo(aPoint);
    } else {
      mDSPathBuilder->LineTo(mTarget->GetTransform() * aPoint);
    }
  }

  void BezierTo(const mozilla::gfx::Point& aCP1,
                const mozilla::gfx::Point& aCP2,
                const mozilla::gfx::Point& aCP3)
  {
    if (mPathBuilder) {
      mPathBuilder->BezierTo(aCP1, aCP2, aCP3);
    } else {
      mozilla::gfx::Matrix transform = mTarget->GetTransform();
      mDSPathBuilder->BezierTo(transform * aCP1,
                                transform * aCP2,
                                transform * aCP3);
    }
  }

  friend class CanvasRenderingContext2DUserData;

  virtual void GetImageBuffer(uint8_t** aImageBuffer, int32_t* aFormat) MOZ_OVERRIDE;


  // Given a point, return hit region ID if it exists
  nsString GetHitRegion(const mozilla::gfx::Point& aPoint) MOZ_OVERRIDE;


  // return true and fills in the bound rect if element has a hit region.
  bool GetHitRegionRect(Element* aElement, nsRect& aRect) MOZ_OVERRIDE;

protected:
  ;

  ;

  /**
   * Internal method to complete initialisation, expects mTarget to have been set
   */
  ;

  ;

  /**
    * The number of living nsCanvasRenderingContexts.  When this goes down to
    * 0, we free the premultiply and unpremultiply tables, if they exist.
    */
  static uint32_t sNumLivingContexts;

  /**
    * Lookup table used to speed up GetImageData().
    */
  static uint8_t (*sUnpremultiplyTable)[256];

  /**
    * Lookup table used to speed up PutImageData().
    */
  static uint8_t (*sPremultiplyTable)[256];

  static mozilla::gfx::DrawTarget* sErrorTarget;
   // Returns whether a filter was successfully parsed.
  ;

  /**
   * Creates the error target, if it doesn't exist
   */
  static void EnsureErrorTarget();

  /* This function ensures there is a writable pathbuilder available, this
   * pathbuilder may be working in user space or in device space or
   * device space.
   * After calling this function mPathTransformWillUpdate will be false
   */
  ;

  // Ensures a path in UserSpace is available.
  ;

  /**
   * Needs to be called before updating the transform. This makes a call to
   * EnsureTarget() so you don't have to.
   */
  ;

  // Report the fillRule has changed.
  ;

   /**
   * Create the backing surfacing, if it doesn't exist. If there is an error
   * in creating the target then it will put sErrorTarget in place. If there
   * is in turn an error in creating the sErrorTarget then they would both
   * be null so IsTargetValid() would still return null.
   *
   * Returns the actual rendering mode being used by the created target.
   */
  RenderingMode EnsureTarget(RenderingMode aRenderMode = RenderingMode::DefaultBackendMode);

  /*
   * Disposes an old target and prepares to lazily create a new target.
   */
  void ClearTarget();

  /**
   * Check if the target is valid after calling EnsureTarget.
   */
  bool IsTargetValid() const {
    return mTarget != sErrorTarget && mTarget != nullptr;
  }

  /**
    * Returns the surface format this canvas should be allocated using. Takes
    * into account mOpaque, platform requirements, etc.
    */
  mozilla::gfx::SurfaceFormat GetSurfaceFormat() const;

  /**
   * Update CurrentState().filter with the filter description for
   * CurrentState().filterChain.
   */
  void UpdateFilter();

  nsLayoutUtils::SurfaceFromElementResult
    CachedSurfaceFromElement(Element* aElement);

  void DrawImage(const HTMLImageOrCanvasOrVideoElement &imgElt,
                 double sx, double sy, double sw, double sh,
                 double dx, double dy, double dw, double dh,
                 uint8_t optional_argc, mozilla::ErrorResult& error);

  void DrawDirectlyToCanvas(const nsLayoutUtils::DirectDrawInfo& image,
                            mozilla::gfx::Rect* bounds,
                            mozilla::gfx::Rect dest,
                            mozilla::gfx::Rect src,
                            gfx::IntSize imgSize);

  

  static std::vector<CanvasRenderingContext2D*>& DemotableContexts();
  static void DemoteOldestContextIfNecessary();

  static void AddDemotableContext(CanvasRenderingContext2D* context);
  static void RemoveDemotableContext(CanvasRenderingContext2D* context);

  RenderingMode mRenderingMode;

  // Texture informations for fast video rendering
  unsigned int mVideoTexture;
  nsIntSize mCurrentVideoSize;

  // Member vars
  int32_t mWidth, mHeight;

  // This is true when the canvas is valid, but of zero size, this requires
  // specific behavior on some operations.
  bool mZero;

  bool mOpaque;

  // This is true when the next time our layer is retrieved we need to
  // recreate it (i.e. our backing surface changed)
  bool mResetLayer;
  // This is needed for drawing in drawAsyncXULElement
  bool mIPC;

  nsTArray<CanvasRenderingContext2DUserData*> mUserDatas;

  // If mCanvasElement is not provided, then a docshell is
  nsCOMPtr<nsIDocShell> mDocShell;

  // This is created lazily so it is necessary to call EnsureTarget before
  // accessing it. In the event of an error it will be equal to
  // sErrorTarget.
  mozilla::RefPtr<mozilla::gfx::DrawTarget> mTarget;

  uint32_t SkiaGLTex() const;

  // This observes our draw calls at the beginning of the canvas
  // lifetime and switches to software or GPU mode depending on
  // what it thinks is best
  CanvasDrawObserver* mDrawObserver;
  void RemoveDrawObserver();

  /**
    * Flag to avoid duplicate calls to InvalidateFrame. Set to true whenever
    * Redraw is called, reset to false when Render is called.
    */
  bool mIsEntireFrameInvalid;
  /**
    * When this is set, the first call to Redraw(gfxRect) should set
    * mIsEntireFrameInvalid since we expect it will be followed by
    * many more Redraw calls.
    */
  bool mPredictManyRedrawCalls;

  // This is stored after GetThebesSurface has been called once to avoid
  // excessive ThebesSurface initialization overhead.
  nsRefPtr<gfxASurface> mThebesSurface;

  /**
    * We also have a device space pathbuilder. The reason for this is as
    * follows, when a path is being built, but the transform changes, we
    * can no longer keep a single path in userspace, considering there's
    * several 'user spaces' now. We therefore transform the current path
    * into device space, and add all operations to this path in device
    * mPath is always in user-space.
    */
  mozilla::RefPtr<mozilla::gfx::Path> mPath;
  mozilla::RefPtr<mozilla::gfx::PathBuilder> mDSPathBuilder;
  mozilla::RefPtr<mozilla::gfx::PathBuilder> mPathBuilder;
  bool mPathTransformWillUpdate;
  mozilla::gfx::Matrix mPathToDS;

  /**
    * Number of times we've invalidated before calling redraw
    */
  uint32_t mInvalidateCount;
  static const uint32_t kCanvasMaxInvalidateCount = 100;

  /**
    * State information for hit regions
    */
  struct RegionInfo
  {
    nsString          mId;
    // fallback element for a11y
    nsRefPtr<Element> mElement;
    // Path of the hit region in the 2d context coordinate space (not user space)
    RefPtr<gfx::Path> mPath;
  };

  nsTArray<RegionInfo> mHitRegionsOptions;

  /**
    * Returns true if a shadow should be drawn along with a
    * drawing operation.
    */
  bool NeedToDrawShadow()
  {
    const ContextState& state = CurrentState();

    // The spec says we should not draw shadows if the operator is OVER.
    // If it's over and the alpha value is zero, nothing needs to be drawn.
    return NS_GET_A(state.shadowColor) != 0 &&
      (state.shadowBlur != 0.f || state.shadowOffset.x != 0.f || state.shadowOffset.y != 0.f);
  }

  /**
    * Returns true if the result of a drawing operation should be
    * drawn with a filter.
    */
  bool NeedToApplyFilter()
  {
    const ContextState& state = CurrentState();
    return state.filter.mPrimitives.Length() > 0;
  }

  bool NeedToCalculateBounds()
  {
    return NeedToDrawShadow() || NeedToApplyFilter();
  }

  mozilla::gfx::CompositionOp UsedOperation()
  {
    if (NeedToDrawShadow() || NeedToApplyFilter()) {
      // In this case the shadow or filter rendering will use the operator.
      return mozilla::gfx::CompositionOp::OP_OVER;
    }

    return CurrentState().op;
  }

  // text

protected:
  enum class TextAlign : uint8_t {
    START,
    END,
    LEFT,
    RIGHT,
    CENTER
  };

  enum class TextBaseline : uint8_t {
    TOP,
    HANGING,
    MIDDLE,
    ALPHABETIC,
    IDEOGRAPHIC,
    BOTTOM
  };

  enum class TextDrawOperation : uint8_t {
    FILL,
    STROKE,
    MEASURE
  };

protected:
  gfxFontGroup *GetCurrentFontStyle();

  /*
    * Implementation of the fillText, strokeText, and measure functions with
    * the operation abstracted to a flag.
    */
  ;

  bool CheckSizeForSkiaGL(mozilla::gfx::IntSize size);

  // state stack handling
  class ContextState {
  public:
    

    

    

    

    

    /**
      * returns true iff the given style is a solid color.
      */
    bool StyleIsColor(Style whichStyle) const
    {
      return !(patternStyles[whichStyle] || gradientStyles[whichStyle]);
    }

    int32_t ShadowBlurRadius() const
    {
      static const gfxFloat GAUSSIAN_SCALE_FACTOR = (3 * sqrt(2 * M_PI) / 4) * 1.5;
      return (int32_t)floor(ShadowBlurSigma() * GAUSSIAN_SCALE_FACTOR + 0.5);
    }

    mozilla::gfx::Float ShadowBlurSigma() const
    {
      return std::min(SIGMA_MAX, shadowBlur / 2.0f);
    }

    std::vector<mozilla::RefPtr<mozilla::gfx::Path> > clipsPushed;

    nsRefPtr<gfxFontGroup> fontGroup;
    nsCOMPtr<nsIAtom> fontLanguage;
    nsFont fontFont;

    EnumeratedArray<Style, Style::MAX, nsRefPtr<CanvasGradient>> gradientStyles;
    EnumeratedArray<Style, Style::MAX, nsRefPtr<CanvasPattern>> patternStyles;
    EnumeratedArray<Style, Style::MAX, nscolor> colorStyles;

    nsString font;
    TextAlign textAlign;
    TextBaseline textBaseline;

    nscolor shadowColor;

    mozilla::gfx::Matrix transform;
    mozilla::gfx::Point shadowOffset;
    mozilla::gfx::Float lineWidth;
    mozilla::gfx::Float miterLimit;
    mozilla::gfx::Float globalAlpha;
    mozilla::gfx::Float shadowBlur;
    FallibleTArray<mozilla::gfx::Float> dash;
    mozilla::gfx::Float dashOffset;

    mozilla::gfx::CompositionOp op;
    mozilla::gfx::FillRule fillRule;
    mozilla::gfx::CapStyle lineCap;
    mozilla::gfx::JoinStyle lineJoin;

    nsString filterString;
    nsTArray<nsStyleFilter> filterChain;
    nsRefPtr<nsSVGFilterChainObserver> filterChainObserver;
    mozilla::gfx::FilterDescription filter;
    nsTArray<mozilla::RefPtr<mozilla::gfx::SourceSurface>> filterAdditionalImages;

    bool imageSmoothingEnabled;
    bool fontExplicitLanguage;
  };

  nsAutoTArray<ContextState, 3> mStyleStack;

  inline ContextState& CurrentState() {
    return mStyleStack[mStyleStack.Length() - 1];
  }

  

  friend class CanvasGeneralPattern;
  friend class CanvasFilterChainObserver;
  friend class AdjustedTarget;
  friend class AdjustedTargetForShadow;
  friend class AdjustedTargetForFilter;

  // other helpers
  

  friend struct CanvasBidiProcessor;
  friend class CanvasDrawObserver;
};

}
}

#endif /* CanvasRenderingContext2D_h */
# 1109 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.h"
# 7 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Helpers.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/Helpers.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_2D_HELPERS_H_
#define MOZILLA_GFX_2D_HELPERS_H_

#if 0 /* expanded by -frewrite-includes */
#include "2D.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/Helpers.h"

namespace mozilla {
namespace gfx {

class AutoRestoreTransform
{
 public:
  AutoRestoreTransform()
  {
  }

  explicit AutoRestoreTransform(DrawTarget *aTarget)
   : mDrawTarget(aTarget),
     mOldTransform(aTarget->GetTransform())
  {
  }

  void Init(DrawTarget *aTarget)
  {
    MOZ_ASSERT(!mDrawTarget || aTarget == mDrawTarget);
    if (!mDrawTarget) {
      mDrawTarget = aTarget;
      mOldTransform = aTarget->GetTransform();
    }
  }

  ~AutoRestoreTransform()
  {
    if (mDrawTarget) {
      mDrawTarget->SetTransform(mOldTransform);
    }
  }

 private:
  RefPtr<DrawTarget> mDrawTarget;
  Matrix mOldTransform;
};

class AutoPopClips
{
public:
  

  

  

  

  

  

private:
  RefPtr<DrawTarget> mDrawTarget;
  int32_t mPushCount;
};

} // namespace gfx
} // namespace mozilla

#endif // MOZILLA_GFX_2D_HELPERS_H_
# 98 "../../dist/include/mozilla/gfx/Helpers.h"
# 9 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsXULElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*

  The base XUL element class and associates.

*/

#ifndef nsXULElement_h__
#define nsXULElement_h__

#if 0 /* expanded by -frewrite-includes */
#include "js/TracingAPI.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMEvent.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIServiceManager.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIServiceManager.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIServiceManager.idl
 */

#ifndef __gen_nsIServiceManager_h__
#define __gen_nsIServiceManager_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIServiceManager.h"
#endif
# 12 "../../dist/include/nsIServiceManager.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIServiceManager.h"

/* starting interface:    nsIServiceManager */
#define NS_ISERVICEMANAGER_IID_STR "8bb35ed9-e332-462d-9155-4a002ab5c958"

#define NS_ISERVICEMANAGER_IID \
  {0x8bb35ed9, 0xe332, 0x462d, \
    { 0x91, 0x55, 0x4a, 0x00, 0x2a, 0xb5, 0xc9, 0x58 }}

class NS_NO_VTABLE nsIServiceManager : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISERVICEMANAGER_IID)

  /* void getService (in nsCIDRef aClass, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */
  NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void **result) = 0;

  /* void getServiceByContractID (in string aContractID, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult result); */
  NS_IMETHOD GetServiceByContractID(const char * aContractID, const nsIID & aIID, void **result) = 0;

  /* boolean isServiceInstantiated (in nsCIDRef aClass, in nsIIDRef aIID); */
  NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, bool *_retval) = 0;

  /* boolean isServiceInstantiatedByContractID (in string aContractID, in nsIIDRef aIID); */
  NS_IMETHOD IsServiceInstantiatedByContractID(const char * aContractID, const nsIID & aIID, bool *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIServiceManager, NS_ISERVICEMANAGER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISERVICEMANAGER \
  NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void **result) MOZ_OVERRIDE; \
  NS_IMETHOD GetServiceByContractID(const char * aContractID, const nsIID & aIID, void **result) MOZ_OVERRIDE; \
  NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD IsServiceInstantiatedByContractID(const char * aContractID, const nsIID & aIID, bool *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISERVICEMANAGER(_to) \
  NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void **result) MOZ_OVERRIDE { return _to GetService(aClass, aIID, result); } \
  NS_IMETHOD GetServiceByContractID(const char * aContractID, const nsIID & aIID, void **result) MOZ_OVERRIDE { return _to GetServiceByContractID(aContractID, aIID, result); } \
  NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, bool *_retval) MOZ_OVERRIDE { return _to IsServiceInstantiated(aClass, aIID, _retval); } \
  NS_IMETHOD IsServiceInstantiatedByContractID(const char * aContractID, const nsIID & aIID, bool *_retval) MOZ_OVERRIDE { return _to IsServiceInstantiatedByContractID(aContractID, aIID, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISERVICEMANAGER(_to) \
  NS_IMETHOD GetService(const nsCID & aClass, const nsIID & aIID, void **result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetService(aClass, aIID, result); } \
  NS_IMETHOD GetServiceByContractID(const char * aContractID, const nsIID & aIID, void **result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetServiceByContractID(aContractID, aIID, result); } \
  NS_IMETHOD IsServiceInstantiated(const nsCID & aClass, const nsIID & aIID, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsServiceInstantiated(aClass, aIID, _retval); } \
  NS_IMETHOD IsServiceInstantiatedByContractID(const char * aContractID, const nsIID & aIID, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsServiceInstantiatedByContractID(aContractID, aIID, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsServiceManager : public nsIServiceManager
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISERVICEMANAGER

  nsServiceManager();

private:
  ~nsServiceManager();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsServiceManager, nsIServiceManager)

nsServiceManager::nsServiceManager()
{
  /* member initializers and constructor code */
/* End of implementation class template. */
#endif
# 125 "../../dist/include/nsIServiceManager.h"

// Observing xpcom autoregistration.  Topics will be 'start' and 'stop'.
#define NS_XPCOM_AUTOREGISTRATION_OBSERVER_ID "xpcom-autoregistration"
#ifdef MOZILLA_INTERNAL_API
#if 0 /* expanded by -frewrite-includes */
#include "nsXPCOM.h"
#endif /* expanded by -frewrite-includes */
# 130 "../../dist/include/nsIServiceManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsComponentManagerUtils.h"
#endif /* expanded by -frewrite-includes */
# 131 "../../dist/include/nsIServiceManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsServiceManagerUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsServiceManagerUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsServiceManagerUtils_h__
#define nsServiceManagerUtils_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsIServiceManager.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIServiceManager.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIServiceManager.idl
 */

#ifndef __gen_nsIServiceManager_h__
#define __gen_nsIServiceManager_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIServiceManager.h"
#endif
# 12 "../../dist/include/nsIServiceManager.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIServiceManager.h"

/* starting interface:    nsIServiceManager */
#define NS_ISERVICEMANAGER_IID_STR "8bb35ed9-e332-462d-9155-4a002ab5c958"

#define NS_ISERVICEMANAGER_IID \
  {0x8bb35ed9, 0xe332, 0x462d, \
    { 0x91, 0x55, 0x4a, 0x00, 0x2a, 0xb5, 0xc9, 0x58 }}

class NS_NO_VTABLE nsIServiceManager : public nsISupports {
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsServiceManagerUtils.h"

inline const nsGetServiceByCID
do_GetService(const nsCID& aCID)
{
  return nsGetServiceByCID(aCID);
}

inline const nsGetServiceByCIDWithError
do_GetService(const nsCID& aCID, nsresult* aError)
{
  return nsGetServiceByCIDWithError(aCID, aError);
}

inline const nsGetServiceByContractID
do_GetService(const char* aContractID)
{
  return nsGetServiceByContractID(aContractID);
}

inline const nsGetServiceByContractIDWithError
do_GetService(const char* aContractID, nsresult* aError)
{
  return nsGetServiceByContractIDWithError(aContractID, aError);
}

class MOZ_STACK_CLASS nsGetServiceFromCategory : public nsCOMPtr_helper
{
public:
  nsGetServiceFromCategory(const char* aCategory, const char* aEntry,
                           nsresult* aErrorPtr)
    : mCategory(aCategory)
    , mEntry(aEntry)
    , mErrorPtr(aErrorPtr)
  {
  }

  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const
    MOZ_OVERRIDE;
protected:
  const char*                 mCategory;
  const char*                 mEntry;
  nsresult*                   mErrorPtr;
};

inline const nsGetServiceFromCategory
do_GetServiceFromCategory(const char* aCategory, const char* aEntry,
                          nsresult* aError = 0)
{
  return nsGetServiceFromCategory(aCategory, aEntry, aError);
}

nsresult CallGetService(const nsCID& aClass, const nsIID& aIID, void** aResult);

nsresult CallGetService(const char* aContractID, const nsIID& aIID,
                        void** aResult);

// type-safe shortcuts for calling |GetService|
template<class DestinationType>
inline nsresult
CallGetService(const nsCID& aClass,
               DestinationType** aDestination)
{
  NS_PRECONDITION(aDestination, "null parameter");

  return CallGetService(aClass,
                        NS_GET_TEMPLATE_IID(DestinationType),
                        reinterpret_cast<void**>(aDestination));
}

template<class DestinationType>
inline nsresult
CallGetService(const char* aContractID,
               DestinationType** aDestination)
{
  NS_PRECONDITION(aContractID, "null parameter");
  NS_PRECONDITION(aDestination, "null parameter");

  return CallGetService(aContractID,
                        NS_GET_TEMPLATE_IID(DestinationType),
                        reinterpret_cast<void**>(aDestination));
}

#endif
# 95 "../../dist/include/nsServiceManagerUtils.h"
# 132 "../../dist/include/nsIServiceManager.h" 2
#endif
# 133 "../../dist/include/nsIServiceManager.h"

#endif /* __gen_nsIServiceManager_h__ */
# 135 "../../dist/include/nsIServiceManager.h"
# 19 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIAtom.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/NodeInfo.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIControllers.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIControllers.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIControllers.idl
 */

#ifndef __gen_nsIControllers_h__
#define __gen_nsIControllers_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIControllers.h"
#endif
# 12 "../../dist/include/nsIControllers.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIControllers.h"
class nsIController; /* forward declaration */

class nsIDOMXULCommandDispatcher; /* forward declaration */


/* starting interface:    nsIControllers */
#define NS_ICONTROLLERS_IID_STR "f36e3ec1-9197-4ad8-8d4c-d3b1927fd6df"

#define NS_ICONTROLLERS_IID \
  {0xf36e3ec1, 0x9197, 0x4ad8, \
    { 0x8d, 0x4c, 0xd3, 0xb1, 0x92, 0x7f, 0xd6, 0xdf }}

class NS_NO_VTABLE nsIControllers : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTROLLERS_IID)

  /* nsIController getControllerForCommand (in string command); */
  NS_IMETHOD GetControllerForCommand(const char * command, nsIController * *_retval) = 0;

  /* void insertControllerAt (in unsigned long index, in nsIController controller); */

  /* nsIController getControllerById (in unsigned long controllerID); */
  NS_IMETHOD GetControllerById(uint32_t controllerID, nsIController * *_retval) = 0;

  /* unsigned long getControllerCount (); */
  NS_IMETHOD GetControllerCount(uint32_t *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIControllers, NS_ICONTROLLERS_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICONTROLLERS \
  NS_IMETHOD GetControllerForCommand(const char * command, nsIController * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD InsertControllerAt(uint32_t index, nsIController *controller) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveControllerAt(uint32_t index, nsIController * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetControllerById(uint32_t controllerID, nsIController * *_retval) MOZ_OVERRIDE { return _to GetControllerById(controllerID, _retval); } \
  NS_IMETHOD GetControllerCount(uint32_t *_retval) MOZ_OVERRIDE { return _to GetControllerCount(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICONTROLLERS(_to) \
  NS_IMETHOD GetControllerForCommand(const char * command, nsIController * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetControllerForCommand(command, _retval); } \
  NS_IMETHOD InsertControllerAt(uint32_t index, nsIController *controller) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertControllerAt(index, controller); } \
  NS_IMETHOD RemoveControllerAt(uint32_t index, nsIController * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveControllerAt(index, _retval); } \
  NS_IMETHOD GetControllerAt(uint32_t index, nsIController * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetControllerAt(index, _retval); } \
  NS_IMETHOD AppendController(nsIController *controller) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendController(controller); } \
  NS_IMETHOD RemoveController(nsIController *controller) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveController(controller); } \
  NS_IMETHOD GetControllerId(nsIController *controller, uint32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetControllerId(controller, _retval); } \
  NS_IMETHOD GetControllerById(uint32_t controllerID, nsIController * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetControllerById(controllerID, _retval); } \
  NS_IMETHOD GetControllerCount(uint32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetControllerCount(_retval); } 

#if 0
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsControllers, nsIControllers)

    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 189 "../../dist/include/nsIControllers.h"


#endif /* __gen_nsIControllers_h__ */
# 192 "../../dist/include/nsIControllers.h"
# 22 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMElement.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMXULElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMXULElement.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMXULElement.idl
 */

#ifndef __gen_nsIDOMXULElement_h__
#define __gen_nsIDOMXULElement_h__


#ifndef __gen_nsIDOMElement_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMElement.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMXULElement.h"
#endif
# 12 "../../dist/include/nsIDOMXULElement.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMXULElement.h"
class nsIRDFCompositeDataSource; /* forward declaration */

class nsIXULTemplateBuilder; /* forward declaration */

class nsIRDFResource; /* forward declaration */

class nsIControllers; /* forward declaration */

class nsIBoxObject; /* forward declaration */


/* starting interface:    nsIDOMXULElement */
#define NS_IDOMXULELEMENT_IID_STR "75435ab3-6863-42a1-ade3-025393d9e80e"

#define NS_IDOMXULELEMENT_IID \
  {0x75435ab3, 0x6863, 0x42a1, \
    { 0xad, 0xe3, 0x02, 0x53, 0x93, 0xd9, 0xe8, 0x0e }}

class NS_NO_VTABLE nsIDOMXULElement : public nsIDOMElement {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMXULELEMENT_IID)

  /* attribute DOMString align; */
  NS_IMETHOD GetAlign(nsAString & aAlign) = 0;
  NS_IMETHOD SetAlign(const nsAString & aAlign) = 0;

  /* attribute DOMString dir; */
  NS_IMETHOD GetDir(nsAString & aDir) = 0;
  NS_IMETHOD SetDir(const nsAString & aDir) = 0;

  /* attribute DOMString flex; */
  NS_IMETHOD GetFlex(nsAString & aFlex) = 0;
  NS_IMETHOD SetFlex(const nsAString & aFlex) = 0;

  /* attribute DOMString flexGroup; */
  NS_IMETHOD GetFlexGroup(nsAString & aFlexGroup) = 0;
  NS_IMETHOD SetFlexGroup(const nsAString & aFlexGroup) = 0;

  /* attribute DOMString ordinal; */
  NS_IMETHOD GetOrdinal(nsAString & aOrdinal) = 0;
  NS_IMETHOD SetOrdinal(const nsAString & aOrdinal) = 0;

  /* attribute DOMString orient; */
  NS_IMETHOD GetOrient(nsAString & aOrient) = 0;
  NS_IMETHOD SetOrient(const nsAString & aOrient) = 0;

  /* attribute DOMString pack; */
  NS_IMETHOD GetPack(nsAString & aPack) = 0;
  NS_IMETHOD SetPack(const nsAString & aPack) = 0;

  /* attribute boolean hidden; */
  NS_IMETHOD GetHidden(bool *aHidden) = 0;
  NS_IMETHOD SetHidden(bool aHidden) = 0;

  /* attribute boolean collapsed; */
  NS_IMETHOD GetCollapsed(bool *aCollapsed) = 0;
  NS_IMETHOD SetCollapsed(bool aCollapsed) = 0;

  /* attribute DOMString observes; */
  NS_IMETHOD GetObserves(nsAString & aObserves) = 0;
  NS_IMETHOD SetObserves(const nsAString & aObserves) = 0;

  /* attribute DOMString menu; */
  NS_IMETHOD GetMenu(nsAString & aMenu) = 0;
  NS_IMETHOD SetMenu(const nsAString & aMenu) = 0;

  /* attribute DOMString ref; */
  NS_IMETHOD GetRef(nsAString & aRef) = 0;
  NS_IMETHOD SetRef(const nsAString & aRef) = 0;

  /* attribute DOMString tooltipText; */
  NS_IMETHOD GetTooltipText(nsAString & aTooltipText) = 0;
  NS_IMETHOD SetTooltipText(const nsAString & aTooltipText) = 0;

  /* attribute DOMString statusText; */
  NS_IMETHOD GetStatusText(nsAString & aStatusText) = 0;
  NS_IMETHOD SetStatusText(const nsAString & aStatusText) = 0;

  /* attribute boolean allowEvents; */
  NS_IMETHOD GetAllowEvents(bool *aAllowEvents) = 0;
  NS_IMETHOD SetAllowEvents(bool aAllowEvents) = 0;

  /* readonly attribute nsIRDFCompositeDataSource database; */
  NS_IMETHOD GetDatabase(nsIRDFCompositeDataSource * *aDatabase) = 0;

  /* readonly attribute nsIXULTemplateBuilder builder; */
  NS_IMETHOD GetBuilder(nsIXULTemplateBuilder * *aBuilder) = 0;

  /* readonly attribute nsIRDFResource resource; */
  NS_IMETHOD GetResource(nsIRDFResource * *aResource) = 0;

  /* readonly attribute nsIControllers controllers; */
  NS_IMETHOD GetControllers(nsIControllers * *aControllers) = 0;

  /* readonly attribute nsIBoxObject boxObject; */
  NS_IMETHOD GetBoxObject(nsIBoxObject * *aBoxObject) = 0;

  /* void focus (); */
  NS_IMETHOD Focus(void) = 0;

  /* void blur (); */
  NS_IMETHOD Blur(void) = 0;

  /* void click (); */
  NS_IMETHOD Click(void) = 0;

  /* void doCommand (); */
  NS_IMETHOD DoCommand(void) = 0;

  /* nsIDOMNodeList getElementsByAttribute (in DOMString name, in DOMString value); */
  NS_IMETHOD GetElementsByAttribute(const nsAString & name, const nsAString & value, nsIDOMNodeList * *_retval) = 0;

  /* nsIDOMNodeList getElementsByAttributeNS (in DOMString namespaceURI, in DOMString name, in DOMString value); */
  NS_IMETHOD GetElementsByAttributeNS(const nsAString & namespaceURI, const nsAString & name, const nsAString & value, nsIDOMNodeList * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMXULElement, NS_IDOMXULELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMXULELEMENT \
  NS_IMETHOD GetAlign(nsAString & aAlign) MOZ_OVERRIDE; \
  NS_IMETHOD SetAlign(const nsAString & aAlign) MOZ_OVERRIDE; \
  NS_IMETHOD GetDir(nsAString & aDir) MOZ_OVERRIDE; \
  NS_IMETHOD SetDir(const nsAString & aDir) MOZ_OVERRIDE; \
  NS_IMETHOD GetFlex(nsAString & aFlex) MOZ_OVERRIDE; \
  NS_IMETHOD SetFlex(const nsAString & aFlex) MOZ_OVERRIDE; \
  NS_IMETHOD GetFlexGroup(nsAString & aFlexGroup) MOZ_OVERRIDE; \
  NS_IMETHOD SetFlexGroup(const nsAString & aFlexGroup) MOZ_OVERRIDE; \
  NS_IMETHOD GetOrdinal(nsAString & aOrdinal) MOZ_OVERRIDE; \
  NS_IMETHOD GetResource(nsIRDFResource * *aResource) MOZ_OVERRIDE; \
  NS_IMETHOD GetControllers(nsIControllers * *aControllers) MOZ_OVERRIDE; \
  NS_IMETHOD GetBoxObject(nsIBoxObject * *aBoxObject) MOZ_OVERRIDE; \
  NS_IMETHOD Focus(void) MOZ_OVERRIDE; \
  NS_IMETHOD Blur(void) MOZ_OVERRIDE; \
  NS_IMETHOD Click(void) MOZ_OVERRIDE; \
  NS_IMETHOD DoCommand(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetElementsByAttribute(const nsAString & name, const nsAString & value, nsIDOMNodeList * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetElementsByAttributeNS(const nsAString & namespaceURI, const nsAString & name, const nsAString & value, nsIDOMNodeList * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMXULELEMENT(_to) \
  NS_IMETHOD GetAlign(nsAString & aAlign) MOZ_OVERRIDE { return _to GetAlign(aAlign); } \
  NS_IMETHOD SetAlign(const nsAString & aAlign) MOZ_OVERRIDE { return _to SetAlign(aAlign); } \
  NS_IMETHOD GetDir(nsAString & aDir) MOZ_OVERRIDE { return _to GetDir(aDir); } \
  NS_IMETHOD SetDir(const nsAString & aDir) MOZ_OVERRIDE { return _to SetDir(aDir); } \
  NS_IMETHOD Blur(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Blur(); } \
  NS_IMETHOD Click(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Click(); } \
  NS_IMETHOD DoCommand(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->DoCommand(); } \
  NS_IMETHOD GetElementsByAttribute(const nsAString & name, const nsAString & value, nsIDOMNodeList * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetElementsByAttribute(name, value, _retval); } \
  NS_IMETHOD GetElementsByAttributeNS(const nsAString & namespaceURI, const nsAString & name, const nsAString & value, nsIDOMNodeList * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetElementsByAttributeNS(namespaceURI, name, value, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMXULElement : public nsIDOMXULElement
NS_IMETHODIMP nsDOMXULElement::SetPack(const nsAString & aPack)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

}

/* nsIDOMNodeList getElementsByAttributeNS (in DOMString namespaceURI, in DOMString name, in DOMString value); */
NS_IMETHODIMP nsDOMXULElement::GetElementsByAttributeNS(const nsAString & namespaceURI, const nsAString & name, const nsAString & value, nsIDOMNodeList * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 759 "../../dist/include/nsIDOMXULElement.h"


#endif /* __gen_nsIDOMXULElement_h__ */
# 762 "../../dist/include/nsIDOMXULElement.h"
# 24 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMXULMultSelectCntrlEl.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMXULMultSelectCntrlEl.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMXULMultSelectCntrlEl.idl
 */

#ifndef __gen_nsIDOMXULMultSelectCntrlEl_h__
#define __gen_nsIDOMXULMultSelectCntrlEl_h__


#ifndef __gen_nsIDOMXULSelectCntrlEl_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMXULSelectCntrlEl.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMXULSelectCntrlEl.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMXULSelectCntrlEl.idl
 */

#ifndef __gen_nsIDOMXULSelectCntrlEl_h__
#define __gen_nsIDOMXULSelectCntrlEl_h__


#ifndef __gen_nsIDOMXULControlElement_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMXULControlElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMXULControlElement.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMXULControlElement.idl
 */

#ifndef __gen_nsIDOMXULControlElement_h__
#define __gen_nsIDOMXULControlElement_h__


#ifndef __gen_nsIDOMElement_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMElement.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMXULControlElement.h"
#endif
# 12 "../../dist/include/nsIDOMXULControlElement.h"

#ifndef __gen_nsIDOMXULElement_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMXULElement.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsIDOMXULControlElement.h"
#endif
# 16 "../../dist/include/nsIDOMXULControlElement.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 21 "../../dist/include/nsIDOMXULControlElement.h"
class nsIControllers; /* forward declaration */


/* starting interface:    nsIDOMXULControlElement */
#define NS_IDOMXULCONTROLELEMENT_IID_STR "ea7f92d0-b379-4107-91b4-1e69bdd771e3"

#define NS_IDOMXULCONTROLELEMENT_IID \
  {0xea7f92d0, 0xb379, 0x4107, \
    { 0x91, 0xb4, 0x1e, 0x69, 0xbd, 0xd7, 0x71, 0xe3 }}

class NS_NO_VTABLE nsIDOMXULControlElement : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMXULCONTROLELEMENT_IID)

  /* attribute boolean disabled; */
  NS_IMETHOD GetDisabled(bool *aDisabled) = 0;
  NS_IMETHOD SetDisabled(bool aDisabled) = 0;

  /* attribute long tabIndex; */
  NS_IMETHOD GetTabIndex(int32_t *aTabIndex) = 0;
  NS_IMETHOD SetTabIndex(int32_t aTabIndex) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMXULControlElement, NS_IDOMXULCONTROLELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMXULCONTROLELEMENT \
  NS_IMETHOD GetDisabled(bool *aDisabled) MOZ_OVERRIDE; \
  NS_IMETHOD SetDisabled(bool aDisabled) MOZ_OVERRIDE; \
  NS_IMETHOD GetTabIndex(int32_t *aTabIndex) MOZ_OVERRIDE; \
  NS_IMETHOD SetTabIndex(int32_t aTabIndex) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMXULCONTROLELEMENT(_to) \
  NS_IMETHOD GetDisabled(bool *aDisabled) MOZ_OVERRIDE { return _to GetDisabled(aDisabled); } \
  NS_IMETHOD SetDisabled(bool aDisabled) MOZ_OVERRIDE { return _to SetDisabled(aDisabled); } \
  NS_IMETHOD GetTabIndex(int32_t *aTabIndex) MOZ_OVERRIDE { return _to GetTabIndex(aTabIndex); } \
  NS_IMETHOD SetTabIndex(int32_t aTabIndex) MOZ_OVERRIDE { return _to SetTabIndex(aTabIndex); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMXULCONTROLELEMENT(_to) \
  NS_IMETHOD GetDisabled(bool *aDisabled) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDisabled(aDisabled); } \
  NS_IMETHOD SetDisabled(bool aDisabled) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDisabled(aDisabled); } \
  NS_IMETHOD GetTabIndex(int32_t *aTabIndex) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTabIndex(aTabIndex); } \
  NS_IMETHOD SetTabIndex(int32_t aTabIndex) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetTabIndex(aTabIndex); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMXULControlElement : public nsIDOMXULControlElement
/* End of implementation class template. */
#endif
# 123 "../../dist/include/nsIDOMXULControlElement.h"


#endif /* __gen_nsIDOMXULControlElement_h__ */
# 126 "../../dist/include/nsIDOMXULControlElement.h"
# 11 "../../dist/include/nsIDOMXULSelectCntrlEl.h" 2
#endif
# 12 "../../dist/include/nsIDOMXULSelectCntrlEl.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMXULSelectCntrlEl.h"
class nsIDOMXULSelectControlItemElement; /* forward declaration */


/* starting interface:    nsIDOMXULSelectControlElement */
#define NS_IDOMXULSELECTCONTROLELEMENT_IID_STR "9bf188a7-d6f9-431b-b5c7-118013998e8b"

#define NS_IDOMXULSELECTCONTROLELEMENT_IID \
  {0x9bf188a7, 0xd6f9, 0x431b, \
    { 0xb5, 0xc7, 0x11, 0x80, 0x13, 0x99, 0x8e, 0x8b }}

class NS_NO_VTABLE nsIDOMXULSelectControlElement : public nsIDOMXULControlElement {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMXULSELECTCONTROLELEMENT_IID)

  /* attribute nsIDOMXULSelectControlItemElement selectedItem; */

  /* nsIDOMXULSelectControlItemElement removeItemAt (in long index); */
  NS_IMETHOD RemoveItemAt(int32_t index, nsIDOMXULSelectControlItemElement * *_retval) = 0;

  /* readonly attribute unsigned long itemCount; */
  NS_IMETHOD GetItemCount(uint32_t *aItemCount) = 0;

  /* long getIndexOfItem (in nsIDOMXULSelectControlItemElement item); */
  NS_IMETHOD GetIndexOfItem(nsIDOMXULSelectControlItemElement *item, int32_t *_retval) = 0;

  /* nsIDOMXULSelectControlItemElement getItemAtIndex (in long index); */
  NS_IMETHOD GetItemAtIndex(int32_t index, nsIDOMXULSelectControlItemElement * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMXULSelectControlElement, NS_IDOMXULSELECTCONTROLELEMENT_IID)
#define NS_FORWARD_SAFE_NSIDOMXULSELECTCONTROLELEMENT(_to) \
  NS_IMETHOD GetSelectedItem(nsIDOMXULSelectControlItemElement * *aSelectedItem) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelectedItem(aSelectedItem); } \
  NS_IMETHOD SetSelectedItem(nsIDOMXULSelectControlItemElement *aSelectedItem) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSelectedItem(aSelectedItem); } \
  NS_IMETHOD GetSelectedIndex(int32_t *aSelectedIndex) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelectedIndex(aSelectedIndex); } \
  NS_IMETHOD SetSelectedIndex(int32_t aSelectedIndex) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSelectedIndex(aSelectedIndex); } \
  NS_IMETHOD GetValue(nsAString & aValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aValue); } \
  NS_IMETHOD SetValue(const nsAString & aValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetValue(aValue); } \
  NS_IMETHOD AppendItem(const nsAString & label, const nsAString & value, nsIDOMXULSelectControlItemElement * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendItem(label, value, _retval); } \
  NS_IMETHOD InsertItemAt(int32_t index, const nsAString & label, const nsAString & value, nsIDOMXULSelectControlItemElement * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertItemAt(index, label, value, _retval); } \
  NS_IMETHOD RemoveItemAt(int32_t index, nsIDOMXULSelectControlItemElement * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveItemAt(index, _retval); } \
  NS_IMETHOD GetItemCount(uint32_t *aItemCount) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetItemCount(aItemCount); } \
  NS_IMETHOD GetIndexOfItem(nsIDOMXULSelectControlItemElement *item, int32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIndexOfItem(item, _retval); } \
  NS_IMETHOD GetItemAtIndex(int32_t index, nsIDOMXULSelectControlItemElement * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetItemAtIndex(index, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */

/* End of implementation class template. */
#endif
# 211 "../../dist/include/nsIDOMXULSelectCntrlEl.h"


#endif /* __gen_nsIDOMXULSelectCntrlEl_h__ */
# 214 "../../dist/include/nsIDOMXULSelectCntrlEl.h"
# 11 "../../dist/include/nsIDOMXULMultSelectCntrlEl.h" 2
#endif
# 12 "../../dist/include/nsIDOMXULMultSelectCntrlEl.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMXULMultSelectCntrlEl.h"

/* starting interface:    nsIDOMXULMultiSelectControlElement */
#define NS_IDOMXULMULTISELECTCONTROLELEMENT_IID_STR "40654a10-8204-4f06-9f21-7baa31c7b1dd"

#define NS_IDOMXULMULTISELECTCONTROLELEMENT_IID \
  {0x40654a10, 0x8204, 0x4f06, \
    { 0x9f, 0x21, 0x7b, 0xaa, 0x31, 0xc7, 0xb1, 0xdd }}

class NS_NO_VTABLE nsIDOMXULMultiSelectControlElement : public nsIDOMXULSelectControlElement {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMXULMULTISELECTCONTROLELEMENT_IID)

  /* attribute DOMString selType; */

  /* void invertSelection (); */
  NS_IMETHOD InvertSelection(void) = 0;

  /* void clearSelection (); */
  NS_IMETHOD ClearSelection(void) = 0;

  /* readonly attribute long selectedCount; */
  NS_IMETHOD GetSelectedCount(int32_t *aSelectedCount) = 0;

  /* [binaryname(MultiGetSelectedItem)] nsIDOMXULSelectControlItemElement getSelectedItem (in long index); */
  NS_IMETHOD MultiGetSelectedItem(int32_t index, nsIDOMXULSelectControlItemElement * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMXULMultiSelectControlElement, NS_IDOMXULMULTISELECTCONTROLELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMXULMULTISELECTCONTROLELEMENT \
  NS_IMETHOD GetSelType(nsAString & aSelType) MOZ_OVERRIDE; \
  NS_IMETHOD SetSelType(const nsAString & aSelType) MOZ_OVERRIDE; \
  NS_IMETHOD GetCurrentItem(nsIDOMXULSelectControlItemElement * *aCurrentItem) MOZ_OVERRIDE; \
  NS_IMETHOD SetCurrentItem(nsIDOMXULSelectControlItemElement *aCurrentItem) MOZ_OVERRIDE; \
  NS_IMETHOD GetCurrentIndex(int32_t *aCurrentIndex) MOZ_OVERRIDE; \
  NS_IMETHOD SetCurrentIndex(int32_t aCurrentIndex) MOZ_OVERRIDE; \
  NS_IMETHOD GetSelectedItems(nsIDOMNodeList * *aSelectedItems) MOZ_OVERRIDE; \
  NS_IMETHOD AddItemToSelection(nsIDOMXULSelectControlItemElement *item) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveItemFromSelection(nsIDOMXULSelectControlItemElement *item) MOZ_OVERRIDE; \
  NS_IMETHOD ToggleItemSelection(nsIDOMXULSelectControlItemElement *item) MOZ_OVERRIDE; \
  NS_IMETHOD SelectItem(nsIDOMXULSelectControlItemElement *item) MOZ_OVERRIDE; \
  NS_IMETHOD SelectItemRange(nsIDOMXULSelectControlItemElement *startItem, nsIDOMXULSelectControlItemElement *item) MOZ_OVERRIDE; \
  NS_IMETHOD SetCurrentItem(nsIDOMXULSelectControlItemElement *aCurrentItem) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCurrentItem(aCurrentItem); } \
  NS_IMETHOD GetCurrentIndex(int32_t *aCurrentIndex) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentIndex(aCurrentIndex); } \
  NS_IMETHOD SetCurrentIndex(int32_t aCurrentIndex) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCurrentIndex(aCurrentIndex); } \
  NS_IMETHOD GetSelectedItems(nsIDOMNodeList * *aSelectedItems) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelectedItems(aSelectedItems); } \
  NS_IMETHOD AddItemToSelection(nsIDOMXULSelectControlItemElement *item) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddItemToSelection(item); } \
  NS_IMETHOD RemoveItemFromSelection(nsIDOMXULSelectControlItemElement *item) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveItemFromSelection(item); } \
  NS_IMETHOD ToggleItemSelection(nsIDOMXULSelectControlItemElement *item) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ToggleItemSelection(item); } \
  NS_IMETHOD SelectItem(nsIDOMXULSelectControlItemElement *item) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SelectItem(item); } \
  NS_IMETHOD SelectItemRange(nsIDOMXULSelectControlItemElement *startItem, nsIDOMXULSelectControlItemElement *item) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SelectItemRange(startItem, item); } \
  NS_IMETHOD SelectAll(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SelectAll(); } \
  NS_IMETHOD InvertSelection(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->InvertSelection(); } \
  NS_IMETHOD ClearSelection(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ClearSelection(); } \
  NS_IMETHOD GetSelectedCount(int32_t *aSelectedCount) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelectedCount(aSelectedCount); } \
  NS_IMETHOD MultiGetSelectedItem(int32_t index, nsIDOMXULSelectControlItemElement * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->MultiGetSelectedItem(index, _retval); } 

#if 0
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 269 "../../dist/include/nsIDOMXULMultSelectCntrlEl.h"


#endif /* __gen_nsIDOMXULMultSelectCntrlEl_h__ */
# 272 "../../dist/include/nsIDOMXULMultSelectCntrlEl.h"
# 25 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIRDFCompositeDataSource.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIRDFCompositeDataSource.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIRDFCompositeDataSource.idl
 */

#ifndef __gen_nsIRDFCompositeDataSource_h__
#define __gen_nsIRDFCompositeDataSource_h__


#ifndef __gen_nsIRDFDataSource_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIRDFDataSource.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIRDFDataSource.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIRDFDataSource.idl
 */

#ifndef __gen_nsIRDFDataSource_h__
#define __gen_nsIRDFDataSource_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIRDFDataSource.h"
#endif
# 12 "../../dist/include/nsIRDFDataSource.h"

#ifndef __gen_nsISupportsArray_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsArray.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISupportsArray.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsISupportsArray.idl
 */

#ifndef __gen_nsISupportsArray_h__
#define __gen_nsISupportsArray_h__


#ifndef __gen_nsICollection_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsICollection.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsICollection.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsICollection.idl
 */

#ifndef __gen_nsICollection_h__
#define __gen_nsICollection_h__


#ifndef __gen_nsISerializable_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISerializable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsICollection.h"
#endif
# 12 "../../dist/include/nsICollection.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsICollection.h"
class nsIEnumerator; /* forward declaration */


/* starting interface:    nsICollection */
#define NS_ICOLLECTION_IID_STR "83b6019c-cbc4-11d2-8cca-0060b0fc14a3"

#define NS_ICOLLECTION_IID \
  {0x83b6019c, 0xcbc4, 0x11d2, \
    { 0x8c, 0xca, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 }}

class NS_NO_VTABLE nsICollection : public nsISerializable {
 public: 


  /* void RemoveElement (in nsISupports item); */
  NS_IMETHOD RemoveElement(nsISupports *item) = 0;

  /* nsIEnumerator Enumerate (); */
  NS_IMETHOD Enumerate(nsIEnumerator * *_retval) = 0;

  /* void Clear (); */
  NS_IMETHOD Clear(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsICollection, NS_ICOLLECTION_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSICOLLECTION \
  NS_IMETHOD RemoveElement(nsISupports *item) MOZ_OVERRIDE { return _to RemoveElement(item); } \
  NS_IMETHOD Enumerate(nsIEnumerator * *_retval) MOZ_OVERRIDE { return _to Enumerate(_retval); } \
  NS_IMETHOD Clear(void) MOZ_OVERRIDE { return _to Clear(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSICOLLECTION(_to) \
  NS_IMETHOD Count(uint32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Count(_retval); } \
  NS_IMETHOD GetElementAt(uint32_t index, nsISupports * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetElementAt(index, _retval); } \
  NS_IMETHOD QueryElementAt(uint32_t index, const nsIID & uuid, void **result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->QueryElementAt(index, uuid, result); } \
  NS_IMETHOD SetElementAt(uint32_t index, nsISupports *item) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetElementAt(index, item); } \
  NS_IMETHOD AppendElement(nsISupports *item) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendElement(item); } \
  NS_IMETHOD RemoveElement(nsISupports *item) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveElement(item); } \
  NS_IMETHOD Enumerate(nsIEnumerator * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Enumerate(_retval); } \
  NS_IMETHOD Clear(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Clear(); } 

#if 0
}

/* End of implementation class template. */
#endif
# 175 "../../dist/include/nsICollection.h"


#ifndef nsCOMPtr_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 179 "../../dist/include/nsICollection.h"
#endif
# 180 "../../dist/include/nsICollection.h"
class MOZ_STACK_CLASS nsQueryElementAt : public nsCOMPtr_helper
  {
    public:
      
      virtual nsresult NS_FASTCALL operator()( const nsIID& aIID, void** )
        const MOZ_OVERRIDE;
    private:
      nsICollection* MOZ_NON_OWNING_REF mCollection;
      uint32_t        mIndex;
      nsresult*       mErrorPtr;
  };


#endif /* __gen_nsICollection_h__ */
# 205 "../../dist/include/nsICollection.h"
# 11 "../../dist/include/nsISupportsArray.h" 2
#endif
# 12 "../../dist/include/nsISupportsArray.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsISupportsArray.h"

class nsIBidirectionalEnumerator;
class nsISupportsArray;
 
#define NS_SUPPORTSARRAY_CID                         \
{ /* bda17d50-0d6b-11d3-9331-00104ba0fd40 */         \
    0xbda17d50,                                      \
    0x0d6b,                                          \
    0x11d3,                                          \
    {0x93, 0x31, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
#define NS_SUPPORTSARRAY_CONTRACTID "@mozilla.org/supports-array;1"
 

/* starting interface:    nsISupportsArray */
#define NS_ISUPPORTSARRAY_IID_STR "241addc8-3608-4e73-8083-2fd6fa09eba2"

#define NS_ISUPPORTSARRAY_IID \
  {0x241addc8, 0x3608, 0x4e73, \
    { 0x80, 0x83, 0x2f, 0xd6, 0xfa, 0x09, 0xeb, 0xa2 }}

class NS_NO_VTABLE nsISupportsArray : public nsICollection {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISUPPORTSARRAY_IID)

  NS_IMETHOD GetIndexOfStartingAt(nsISupports *aPossibleElement, uint32_t aStartIndex, int32_t *_retval) = 0;

  /* long GetLastIndexOf (in nsISupports aPossibleElement); */
  NS_IMETHOD GetLastIndexOf(nsISupports *aPossibleElement, int32_t *_retval) = 0;

  /* [notxpcom] boolean InsertElementAt (in nsISupports aElement, in unsigned long aIndex); */

  /* [notxpcom] boolean RemoveElementsAt (in unsigned long aIndex, in unsigned long aCount); */
  NS_IMETHOD_(bool) RemoveElementsAt(uint32_t aIndex, uint32_t aCount) = 0;

  /* [notxpcom] boolean SizeTo (in long aSize); */
  NS_IMETHOD_(bool) SizeTo(int32_t aSize) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsISupportsArray, NS_ISUPPORTSARRAY_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISUPPORTSARRAY \
  NS_IMETHOD_(bool) Equals(const nsISupportsArray *other) MOZ_OVERRIDE; \
  NS_IMETHOD_(int32_t) IndexOf(const nsISupports *aPossibleElement) MOZ_OVERRIDE; \
  NS_IMETHOD_(int32_t) IndexOfStartingAt(const nsISupports *aPossibleElement, uint32_t aStartIndex) MOZ_OVERRIDE; \
  NS_IMETHOD_(int32_t) LastIndexOf(const nsISupports *aPossibleElement) MOZ_OVERRIDE; \
  NS_IMETHOD GetIndexOf(nsISupports *aPossibleElement, int32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetIndexOfStartingAt(nsISupports *aPossibleElement, uint32_t aStartIndex, int32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetLastIndexOf(nsISupports *aPossibleElement, int32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) InsertElementAt(nsISupports *aElement, uint32_t aIndex) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) ReplaceElementAt(nsISupports *aElement, uint32_t aIndex) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) RemoveElementAt(uint32_t aIndex) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) RemoveLastElement(const nsISupports *aElement) MOZ_OVERRIDE; \
  NS_IMETHOD DeleteLastElement(nsISupports *aElement) MOZ_OVERRIDE; \
  NS_IMETHOD DeleteElementAt(uint32_t aIndex) MOZ_OVERRIDE; \
  NS_IMETHOD Compact(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Compact(); } \
  NS_IMETHOD Clone(nsISupportsArray * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Clone(_retval); } \
  NS_IMETHOD_(bool) MoveElement(int32_t aFrom, int32_t aTo) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) InsertElementsAt(nsISupportsArray *aOther, uint32_t aIndex) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) RemoveElementsAt(uint32_t aIndex, uint32_t aCount) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) SizeTo(int32_t aSize) MOZ_OVERRIDE; 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsSupportsArray : public nsISupportsArray
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSARRAY
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 330 "../../dist/include/nsISupportsArray.h"


// Construct and return a default implementation of nsISupportsArray:
;

#endif /* __gen_nsISupportsArray_h__ */
# 337 "../../dist/include/nsISupportsArray.h"
# 15 "../../dist/include/nsIRDFDataSource.h" 2
#endif
# 16 "../../dist/include/nsIRDFDataSource.h"

#ifndef __gen_nsIRDFResource_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIRDFResource.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIRDFResource.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIRDFResource.idl
 */

#ifndef __gen_nsIRDFResource_h__
#define __gen_nsIRDFResource_h__


#ifndef __gen_nsrootidl_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsrootidl.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIRDFResource.h"
#endif
# 12 "../../dist/include/nsIRDFResource.h"

#ifndef __gen_nsIRDFNode_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIRDFNode.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIRDFNode.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIRDFNode.idl
 */

#ifndef __gen_nsIRDFNode_h__
#define __gen_nsIRDFNode_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIRDFNode.h"
#endif
# 12 "../../dist/include/nsIRDFNode.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIRDFNode.h"

/* starting interface:    nsIRDFNode */
#define NS_IRDFNODE_IID_STR "0f78da50-8321-11d2-8eac-00805f29f370"

#define NS_IRDFNODE_IID \
  {0x0f78da50, 0x8321, 0x11d2, \
    { 0x8e, 0xac, 0x00, 0x80, 0x5f, 0x29, 0xf3, 0x70 }}

class NS_NO_VTABLE nsIRDFNode : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRDFNODE_IID)

  /* boolean EqualsNode (in nsIRDFNode aNode); */
  NS_IMETHOD EqualsNode(nsIRDFNode *aNode, bool *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIRDFNode, NS_IRDFNODE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIRDFNODE \
  NS_IMETHOD EqualsNode(nsIRDFNode *aNode, bool *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIRDFNODE(_to) \
  NS_IMETHOD EqualsNode(nsIRDFNode *aNode, bool *_retval) MOZ_OVERRIDE { return _to EqualsNode(aNode, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIRDFNODE(_to) \
  NS_IMETHOD EqualsNode(nsIRDFNode *aNode, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->EqualsNode(aNode, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsRDFNode : public nsIRDFNode
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIRDFNODE

  nsRDFNode();

private:
  ~nsRDFNode();


/* boolean EqualsNode (in nsIRDFNode aNode); */
NS_IMETHODIMP nsRDFNode::EqualsNode(nsIRDFNode *aNode, bool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 89 "../../dist/include/nsIRDFNode.h"


#endif /* __gen_nsIRDFNode_h__ */
# 92 "../../dist/include/nsIRDFNode.h"
# 15 "../../dist/include/nsIRDFResource.h" 2
#endif
# 16 "../../dist/include/nsIRDFResource.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 21 "../../dist/include/nsIRDFResource.h"

/* starting interface:    nsIRDFResource */
#define NS_IRDFRESOURCE_IID_STR "fb9686a7-719a-49dc-9107-10dea5739341"

#define NS_IRDFRESOURCE_IID \
  {0xfb9686a7, 0x719a, 0x49dc, \
    { 0x91, 0x07, 0x10, 0xde, 0xa5, 0x73, 0x93, 0x41 }}

class NS_NO_VTABLE nsIRDFResource : public nsIRDFNode {
  /* boolean EqualsString (in string aURI); */
  NS_IMETHOD EqualsString(const char * aURI, bool *_retval) = 0;

  /* void GetDelegate (in string aKey, in nsIIDRef aIID, [iid_is (aIID), retval] out nsQIResult aResult); */
  NS_IMETHOD GetDelegate(const char * aKey, const nsIID & aIID, void **aResult) = 0;

  /* void ReleaseDelegate (in string aKey); */
  NS_IMETHOD ReleaseDelegate(const char * aKey) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIRDFResource, NS_IRDFRESOURCE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIRDFRESOURCE \
  NS_IMETHOD GetValue(char * *aValue) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIRDFRESOURCE(_to) \
  NS_IMETHOD GetValue(char * *aValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aValue); } \
  NS_IMETHOD GetValueUTF8(nsACString & aValueUTF8) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValueUTF8(aValueUTF8); } \
  NS_IMETHOD GetValueConst(const char * *aConstValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValueConst(aConstValue); } \
  NS_IMETHOD Init(const char * uri) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(uri); } \
  NS_IMETHOD EqualsString(const char * aURI, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->EqualsString(aURI, _retval); } \
  NS_IMETHOD GetDelegate(const char * aKey, const nsIID & aIID, void **aResult) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDelegate(aKey, aIID, aResult); } \
  NS_IMETHOD ReleaseDelegate(const char * aKey) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ReleaseDelegate(aKey); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsRDFResource : public nsIRDFResource
/* void ReleaseDelegate (in string aKey); */
NS_IMETHODIMP nsRDFResource::ReleaseDelegate(const char * aKey)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 165 "../../dist/include/nsIRDFResource.h"


#endif /* __gen_nsIRDFResource_h__ */
# 168 "../../dist/include/nsIRDFResource.h"
# 19 "../../dist/include/nsIRDFDataSource.h" 2
#endif
# 20 "../../dist/include/nsIRDFDataSource.h"

#ifndef __gen_nsIRDFNode_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIRDFNode.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsIRDFDataSource.h"
#endif
# 24 "../../dist/include/nsIRDFDataSource.h"

#ifndef __gen_nsISimpleEnumerator_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISimpleEnumerator.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsISimpleEnumerator.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsISimpleEnumerator.idl
 */

#ifndef __gen_nsISimpleEnumerator_h__
#define __gen_nsISimpleEnumerator_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsISimpleEnumerator.h"
#endif
# 12 "../../dist/include/nsISimpleEnumerator.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsISimpleEnumerator.h"

/* starting interface:    nsISimpleEnumerator */
#define NS_ISIMPLEENUMERATOR_IID_STR "d1899240-f9d2-11d2-bdd6-000064657374"

#define NS_ISIMPLEENUMERATOR_IID \
  {0xd1899240, 0xf9d2, 0x11d2, \
    { 0xbd, 0xd6, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 }}

class NS_NO_VTABLE nsISimpleEnumerator : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISIMPLEENUMERATOR_IID)

  /* boolean hasMoreElements (); */
  NS_IMETHOD HasMoreElements(bool *_retval) = 0;

  /* nsISupports getNext (); */
  NS_IMETHOD GetNext(nsISupports * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsISimpleEnumerator, NS_ISIMPLEENUMERATOR_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISIMPLEENUMERATOR \
  NS_IMETHOD HasMoreElements(bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetNext(nsISupports * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISIMPLEENUMERATOR(_to) \
  NS_IMETHOD HasMoreElements(bool *_retval) MOZ_OVERRIDE { return _to HasMoreElements(_retval); } \
  NS_IMETHOD GetNext(nsISupports * *_retval) MOZ_OVERRIDE { return _to GetNext(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISIMPLEENUMERATOR(_to) \
  NS_IMETHOD HasMoreElements(bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->HasMoreElements(_retval); } \
  NS_IMETHOD GetNext(nsISupports * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNext(_retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsSimpleEnumerator : public nsISimpleEnumerator
{
public:
NS_IMETHODIMP nsSimpleEnumerator::GetNext(nsISupports * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 101 "../../dist/include/nsISimpleEnumerator.h"


#endif /* __gen_nsISimpleEnumerator_h__ */
# 104 "../../dist/include/nsISimpleEnumerator.h"
# 27 "../../dist/include/nsIRDFDataSource.h" 2
#endif
# 28 "../../dist/include/nsIRDFDataSource.h"

#ifndef __gen_nsIRDFObserver_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIRDFObserver.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIRDFObserver.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIRDFObserver.idl
 */

#ifndef __gen_nsIRDFObserver_h__
#define __gen_nsIRDFObserver_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsIRDFObserver.h"
#endif
# 20 "../../dist/include/nsIRDFObserver.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 25 "../../dist/include/nsIRDFObserver.h"
class nsIRDFDataSource; /* forward declaration */


/* starting interface:    nsIRDFObserver */
#define NS_IRDFOBSERVER_IID_STR "3cc75360-484a-11d2-bc16-00805f912fe7"

#define NS_IRDFOBSERVER_IID \
  {0x3cc75360, 0x484a, 0x11d2, \
    { 0xbc, 0x16, 0x00, 0x80, 0x5f, 0x91, 0x2f, 0xe7 }}

class NS_NO_VTABLE nsIRDFObserver : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRDFOBSERVER_IID)

  /* void onAssert (in nsIRDFDataSource aDataSource, in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget); */
  NS_IMETHOD OnAssert(nsIRDFDataSource *aDataSource, nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget) = 0;

  /* void onUnassert (in nsIRDFDataSource aDataSource, in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget); */
  NS_IMETHOD OnUnassert(nsIRDFDataSource *aDataSource, nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget) = 0;

  /* void onChange (in nsIRDFDataSource aDataSource, in nsIRDFResource aSource, in nsIRDFResource aProperty, in nsIRDFNode aOldTarget, in nsIRDFNode aNewTarget); */
  NS_IMETHOD OnChange(nsIRDFDataSource *aDataSource, nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aOldTarget, nsIRDFNode *aNewTarget) = 0;

  /* void onMove (in nsIRDFDataSource aDataSource, in nsIRDFResource aOldSource, in nsIRDFResource aNewSource, in nsIRDFResource aProperty, in nsIRDFNode aTarget); */
  NS_IMETHOD OnMove(nsIRDFDataSource *aDataSource, nsIRDFResource *aOldSource, nsIRDFResource *aNewSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget) = 0;

  /* void onBeginUpdateBatch (in nsIRDFDataSource aDataSource); */
  NS_IMETHOD OnBeginUpdateBatch(nsIRDFDataSource *aDataSource) = 0;

  /* void onEndUpdateBatch (in nsIRDFDataSource aDataSource); */
  NS_IMETHOD OnEndUpdateBatch(nsIRDFDataSource *aDataSource) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIRDFObserver, NS_IRDFOBSERVER_IID)

/* Use this macro when declaring classes that implement this interface. */

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIRDFOBSERVER(_to) \
  NS_IMETHOD OnAssert(nsIRDFDataSource *aDataSource, nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnAssert(aDataSource, aSource, aProperty, aTarget); } \
  NS_IMETHOD OnUnassert(nsIRDFDataSource *aDataSource, nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnUnassert(aDataSource, aSource, aProperty, aTarget); } \
  NS_IMETHOD OnChange(nsIRDFDataSource *aDataSource, nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aOldTarget, nsIRDFNode *aNewTarget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnChange(aDataSource, aSource, aProperty, aOldTarget, aNewTarget); } \
  NS_IMETHOD OnMove(nsIRDFDataSource *aDataSource, nsIRDFResource *aOldSource, nsIRDFResource *aNewSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnMove(aDataSource, aOldSource, aNewSource, aProperty, aTarget); } \
  NS_IMETHOD OnBeginUpdateBatch(nsIRDFDataSource *aDataSource) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnBeginUpdateBatch(aDataSource); } \
  NS_IMETHOD OnEndUpdateBatch(nsIRDFDataSource *aDataSource) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnEndUpdateBatch(aDataSource); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsRDFObserver : public nsIRDFObserver
{
#endif
# 159 "../../dist/include/nsIRDFObserver.h"


#endif /* __gen_nsIRDFObserver_h__ */
# 162 "../../dist/include/nsIRDFObserver.h"
# 31 "../../dist/include/nsIRDFDataSource.h" 2
#endif
# 32 "../../dist/include/nsIRDFDataSource.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 37 "../../dist/include/nsIRDFDataSource.h"

/* starting interface:    nsIRDFDataSource */
#define NS_IRDFDATASOURCE_IID_STR "0f78da58-8321-11d2-8eac-00805f29f370"

#define NS_IRDFDATASOURCE_IID \
  {0x0f78da58, 0x8321, 0x11d2, \
    { 0x8e, 0xac, 0x00, 0x80, 0x5f, 0x29, 0xf3, 0x70 }}

class NS_NO_VTABLE nsIRDFDataSource : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRDFDATASOURCE_IID)

  /* readonly attribute string URI; */
  NS_IMETHOD GetURI(char * *aURI) = 0;

  /* nsIRDFResource GetSource (in nsIRDFResource aProperty, in nsIRDFNode aTarget, in boolean aTruthValue); */
  /* nsISimpleEnumerator GetAllCmds (in nsIRDFResource aSource); */
  NS_IMETHOD GetAllCmds(nsIRDFResource *aSource, nsISimpleEnumerator * *_retval) = 0;

  /* boolean hasArcIn (in nsIRDFNode aNode, in nsIRDFResource aArc); */
  NS_IMETHOD HasArcIn(nsIRDFNode *aNode, nsIRDFResource *aArc, bool *_retval) = 0;

  /* boolean hasArcOut (in nsIRDFResource aSource, in nsIRDFResource aArc); */
  NS_IMETHOD HasArcOut(nsIRDFResource *aSource, nsIRDFResource *aArc, bool *_retval) = 0;

  /* void beginUpdateBatch (); */
  NS_IMETHOD BeginUpdateBatch(void) = 0;

  /* void endUpdateBatch (); */
  NS_IMETHOD EndUpdateBatch(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIRDFDataSource, NS_IRDFDATASOURCE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIRDFDATASOURCE \
  NS_IMETHOD GetURI(char * *aURI) MOZ_OVERRIDE; \
  NS_IMETHOD GetSource(nsIRDFResource *aProperty, nsIRDFNode *aTarget, bool aTruthValue, nsIRDFResource * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetSources(nsIRDFResource *aProperty, nsIRDFNode *aTarget, bool aTruthValue, nsISimpleEnumerator * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetTarget(nsIRDFResource *aSource, nsIRDFResource *aProperty, bool aTruthValue, nsIRDFNode * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetTargets(nsIRDFResource *aSource, nsIRDFResource *aProperty, bool aTruthValue, nsISimpleEnumerator * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD Assert(nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget, bool aTruthValue) MOZ_OVERRIDE; \
  NS_IMETHOD Unassert(nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget) MOZ_OVERRIDE; \
  NS_IMETHOD Change(nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aOldTarget, nsIRDFNode *aNewTarget) MOZ_OVERRIDE; \
  NS_IMETHOD Move(nsIRDFResource *aOldSource, nsIRDFResource *aNewSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget) MOZ_OVERRIDE; \
  NS_IMETHOD HasAssertion(nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget, bool aTruthValue, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD AddObserver(nsIRDFObserver *aObserver) MOZ_OVERRIDE; \
  NS_IMETHOD Move(nsIRDFResource *aOldSource, nsIRDFResource *aNewSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Move(aOldSource, aNewSource, aProperty, aTarget); } \
  NS_IMETHOD HasAssertion(nsIRDFResource *aSource, nsIRDFResource *aProperty, nsIRDFNode *aTarget, bool aTruthValue, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->HasAssertion(aSource, aProperty, aTarget, aTruthValue, _retval); } \
  NS_IMETHOD AddObserver(nsIRDFObserver *aObserver) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddObserver(aObserver); } \
  NS_IMETHOD RemoveObserver(nsIRDFObserver *aObserver) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(aObserver); } \
  NS_IMETHOD ArcLabelsIn(nsIRDFNode *aNode, nsISimpleEnumerator * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ArcLabelsIn(aNode, _retval); } \
  NS_IMETHOD ArcLabelsOut(nsIRDFResource *aSource, nsISimpleEnumerator * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ArcLabelsOut(aSource, _retval); } \
  NS_IMETHOD GetAllResources(nsISimpleEnumerator * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllResources(_retval); } \
  NS_IMETHOD IsCommandEnabled(nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsCommandEnabled(aSources, aCommand, aArguments, _retval); } \
  NS_IMETHOD DoCommand(nsISupportsArray *aSources, nsIRDFResource *aCommand, nsISupportsArray *aArguments) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->DoCommand(aSources, aCommand, aArguments); } \
  NS_IMETHOD GetAllCmds(nsIRDFResource *aSource, nsISimpleEnumerator * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllCmds(aSource, _retval); } \
  NS_IMETHOD HasArcIn(nsIRDFNode *aNode, nsIRDFResource *aArc, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->HasArcIn(aNode, aArc, _retval); } \
  NS_IMETHOD HasArcOut(nsIRDFResource *aSource, nsIRDFResource *aArc, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->HasArcOut(aSource, aArc, _retval); } \
  NS_IMETHOD BeginUpdateBatch(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->BeginUpdateBatch(); } \
  NS_IMETHOD EndUpdateBatch(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->EndUpdateBatch(); } 

#if 0
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void endUpdateBatch (); */
NS_IMETHODIMP nsRDFDataSource::EndUpdateBatch()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 361 "../../dist/include/nsIRDFDataSource.h"


#endif /* __gen_nsIRDFDataSource_h__ */
# 364 "../../dist/include/nsIRDFDataSource.h"
# 11 "../../dist/include/nsIRDFCompositeDataSource.h" 2
#endif
# 12 "../../dist/include/nsIRDFCompositeDataSource.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIRDFCompositeDataSource.h"
class nsISimpleEnumerator; /* forward declaration */


/* starting interface:    nsIRDFCompositeDataSource */
#define NS_IRDFCOMPOSITEDATASOURCE_IID_STR "96343820-307c-11d2-bc15-00805f912fe7"

#define NS_IRDFCOMPOSITEDATASOURCE_IID \
  {0x96343820, 0x307c, 0x11d2, \
    { 0xbc, 0x15, 0x00, 0x80, 0x5f, 0x91, 0x2f, 0xe7 }}

class NS_NO_VTABLE nsIRDFCompositeDataSource : public nsIRDFDataSource {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IRDFCOMPOSITEDATASOURCE_IID)

  /* attribute boolean allowNegativeAssertions; */
  NS_IMETHOD GetAllowNegativeAssertions(bool *aAllowNegativeAssertions) = 0;
  NS_IMETHOD SetAllowNegativeAssertions(bool aAllowNegativeAssertions) = 0;

  /* attribute boolean coalesceDuplicateArcs; */
  NS_IMETHOD GetCoalesceDuplicateArcs(bool *aCoalesceDuplicateArcs) = 0;
  NS_IMETHOD SetCoalesceDuplicateArcs(bool aCoalesceDuplicateArcs) = 0;

  /* void AddDataSource (in nsIRDFDataSource aDataSource); */
  NS_IMETHOD AddDataSource(nsIRDFDataSource *aDataSource) = 0;

  /* void RemoveDataSource (in nsIRDFDataSource aDataSource); */
  NS_IMETHOD RemoveDataSource(nsIRDFDataSource *aDataSource) = 0;

  /* nsISimpleEnumerator GetDataSources (); */
  NS_IMETHOD GetDataSources(nsISimpleEnumerator * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIRDFCompositeDataSource, NS_IRDFCOMPOSITEDATASOURCE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIRDFCOMPOSITEDATASOURCE \
  NS_IMETHOD GetDataSources(nsISimpleEnumerator * *_retval) MOZ_OVERRIDE { return _to GetDataSources(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIRDFCOMPOSITEDATASOURCE(_to) \
  NS_IMETHOD GetAllowNegativeAssertions(bool *aAllowNegativeAssertions) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllowNegativeAssertions(aAllowNegativeAssertions); } \
  NS_IMETHOD SetAllowNegativeAssertions(bool aAllowNegativeAssertions) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAllowNegativeAssertions(aAllowNegativeAssertions); } \
  NS_IMETHOD GetCoalesceDuplicateArcs(bool *aCoalesceDuplicateArcs) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCoalesceDuplicateArcs(aCoalesceDuplicateArcs); } \
  NS_IMETHOD SetCoalesceDuplicateArcs(bool aCoalesceDuplicateArcs) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCoalesceDuplicateArcs(aCoalesceDuplicateArcs); } \
  NS_IMETHOD AddDataSource(nsIRDFDataSource *aDataSource) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddDataSource(aDataSource); } \
  NS_IMETHOD RemoveDataSource(nsIRDFDataSource *aDataSource) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveDataSource(aDataSource); } \
  NS_IMETHOD GetDataSources(nsISimpleEnumerator * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDataSources(_retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 155 "../../dist/include/nsIRDFCompositeDataSource.h"

;

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIXULTemplateBuilder.h"
class nsIAtom; /* forward declaration */

class nsIContent; /* forward declaration */

class nsIXULBuilderListener; /* forward declaration */

class nsIXULTemplateResult; /* forward declaration */

class nsIXULTemplateRuleFilter; /* forward declaration */

class nsIXULTemplateQueryProcessor; /* forward declaration */

class nsIRDFResource; /* forward declaration */

class nsIRDFCompositeDataSource; /* forward declaration */

class nsIDOMDataTransfer; /* forward declaration */


/* starting interface:    nsIXULTemplateBuilder */
#define NS_IXULTEMPLATEBUILDER_IID_STR "a583b676-5b02-4f9c-a0c9-cb850cb99818"

#define NS_IXULTEMPLATEBUILDER_IID \
  {0xa583b676, 0x5b02, 0x4f9c, \
    { 0xa0, 0xc9, 0xcb, 0x85, 0x0c, 0xb9, 0x98, 0x18 }}

class NS_NO_VTABLE nsIXULTemplateBuilder : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXULTEMPLATEBUILDER_IID)

  /* readonly attribute nsIDOMElement root; */
  NS_IMETHOD GetRoot(nsIDOMElement * *aRoot) = 0;

  /* void refresh (); */
  NS_IMETHOD Refresh(void) = 0;

  /* void addResult (in nsIXULTemplateResult aResult, in nsIDOMNode aQueryNode); */
  NS_IMETHOD AddResult(nsIXULTemplateResult *aResult, nsIDOMNode *aQueryNode) = 0;

  /* void removeResult (in nsIXULTemplateResult aResult); */

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIXULTemplateBuilder, NS_IXULTEMPLATEBUILDER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXULTEMPLATEBUILDER \
  NS_IMETHOD GetRoot(nsIDOMElement * *aRoot) MOZ_OVERRIDE; \
  NS_IMETHOD GetDatasource(nsISupports * *aDatasource) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveListener(nsIXULBuilderListener *aListener) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveListener(aListener); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsXULTemplateBuilder : public nsIXULTemplateBuilder
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIXULTEMPLATEBUILDER

  nsXULTemplateBuilder();

private:
  ~nsXULTemplateBuilder();

protected:
  /* additional members */
};

}

/* void removeListener (in nsIXULBuilderListener aListener); */
NS_IMETHODIMP nsXULTemplateBuilder::RemoveListener(nsIXULBuilderListener *aListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 331 "../../dist/include/nsIXULTemplateBuilder.h"


/* starting interface:    nsIXULTreeBuilderObserver */
#define NS_IXULTREEBUILDEROBSERVER_IID_STR "57ced9a7-ec0b-4a0e-8aeb-5da32ebe951c"

#define NS_IXULTREEBUILDEROBSERVER_IID \
  {0x57ced9a7, 0xec0b, 0x4a0e, \
    { 0x8a, 0xeb, 0x5d, 0xa3, 0x2e, 0xbe, 0x95, 0x1c }}

class NS_NO_VTABLE nsIXULTreeBuilderObserver : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXULTREEBUILDEROBSERVER_IID)

  enum {
    DROP_BEFORE = -1,
    DROP_ON = 0,
    DROP_AFTER = 1
  };

  /* boolean canDrop (in long index, in long orientation, in nsIDOMDataTransfer dataTransfer); */
  NS_IMETHOD CanDrop(int32_t index, int32_t orientation, nsIDOMDataTransfer *dataTransfer, bool *_retval) = 0;

  /* void onDrop (in long row, in long orientation, in nsIDOMDataTransfer dataTransfer); */
  NS_IMETHOD OnDrop(int32_t row, int32_t orientation, nsIDOMDataTransfer *dataTransfer) = 0;

  /* void onToggleOpenState (in long index); */
  NS_IMETHOD OnToggleOpenState(int32_t index) = 0;

  /* void onCycleHeader (in wstring colID, in nsIDOMElement elt); */
  NS_IMETHOD OnCycleHeader(const char16_t * colID, nsIDOMElement *elt) = 0;

  /* void onCycleCell (in long row, in wstring colID); */
  NS_IMETHOD OnCycleCell(int32_t row, const char16_t * colID) = 0;

  /* void onSelectionChanged (); */
  NS_IMETHOD OnSelectionChanged(void) = 0;

  /* void onPerformAction (in wstring action); */
  NS_IMETHOD OnPerformAction(const char16_t * action) = 0;

  /* void onPerformActionOnRow (in wstring action, in long row); */
  NS_IMETHOD OnPerformActionOnRow(const char16_t * action, int32_t row) = 0;

  /* void onPerformActionOnCell (in wstring action, in long row, in wstring colID); */
  NS_IMETHOD OnPerformActionOnCell(const char16_t * action, int32_t row, const char16_t * colID) = 0;

};
#define NS_FORWARD_NSIXULTREEBUILDEROBSERVER(_to) \
  NS_IMETHOD CanDrop(int32_t index, int32_t orientation, nsIDOMDataTransfer *dataTransfer, bool *_retval) MOZ_OVERRIDE { return _to CanDrop(index, orientation, dataTransfer, _retval); } \
  NS_IMETHOD OnDrop(int32_t row, int32_t orientation, nsIDOMDataTransfer *dataTransfer) MOZ_OVERRIDE { return _to OnDrop(row, orientation, dataTransfer); } \
  NS_IMETHOD OnToggleOpenState(int32_t index) MOZ_OVERRIDE { return _to OnToggleOpenState(index); } \
  NS_IMETHOD OnCycleHeader(const char16_t * colID, nsIDOMElement *elt) MOZ_OVERRIDE { return _to OnCycleHeader(colID, elt); } \
  NS_IMETHOD OnCycleCell(int32_t row, const char16_t * colID) MOZ_OVERRIDE { return _to OnCycleCell(row, colID); } \
  NS_IMETHOD OnSelectionChanged(void) MOZ_OVERRIDE { return _to OnSelectionChanged(); } \
  NS_IMETHOD OnPerformAction(const char16_t * action) MOZ_OVERRIDE { return _to OnPerformAction(action); } \
  NS_IMETHOD OnPerformActionOnRow(const char16_t * action, int32_t row) MOZ_OVERRIDE { return _to OnPerformActionOnRow(action, row); } \
  NS_IMETHOD OnPerformActionOnCell(const char16_t * action, int32_t row, const char16_t * colID) MOZ_OVERRIDE { return _to OnPerformActionOnCell(action, row, colID); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIXULTREEBUILDEROBSERVER(_to) \
  NS_IMETHOD CanDrop(int32_t index, int32_t orientation, nsIDOMDataTransfer *dataTransfer, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->CanDrop(index, orientation, dataTransfer, _retval); } \
  NS_IMETHOD OnDrop(int32_t row, int32_t orientation, nsIDOMDataTransfer *dataTransfer) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnDrop(row, orientation, dataTransfer); } \
  NS_IMETHOD OnToggleOpenState(int32_t index) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnToggleOpenState(index); } \

class nsITabParent; /* forward declaration */

class nsILoadContext; /* forward declaration */


/* starting interface:    nsIFrameLoader */
#define NS_IFRAMELOADER_IID_STR "d24f9330-ae4e-11e4-ab27-0800200c9a66"

#define NS_IFRAMELOADER_IID \
  {0xd24f9330, 0xae4e, 0x11e4, \
    { 0xab, 0x27, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 }}

class NS_NO_VTABLE nsIFrameLoader : public nsISupports {
 public: 


  /* [infallible] attribute boolean visible; */
  NS_IMETHOD GetVisible(bool *aVisible) = 0;
  
  NS_IMETHOD SetVisible(bool aVisible) = 0;

  /* readonly attribute boolean ownerIsBrowserOrAppFrame; */
  NS_IMETHOD GetOwnerIsBrowserOrAppFrame(bool *aOwnerIsBrowserOrAppFrame) = 0;

  /* readonly attribute boolean ownerIsWidget; */
  NS_IMETHOD GetOwnerIsWidget(bool *aOwnerIsWidget) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameLoader, NS_IFRAMELOADER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIFRAMELOADER \
  NS_IMETHOD GetDocShell(nsIDocShell * *aDocShell) MOZ_OVERRIDE; \
  NS_IMETHOD GetTabParent(nsITabParent * *aTabParent) MOZ_OVERRIDE; \
  NS_IMETHOD GetLoadContext(nsILoadContext * *aLoadContext) MOZ_OVERRIDE; \
  NS_IMETHOD LoadFrame(void) MOZ_OVERRIDE; \
  NS_IMETHOD LoadURI(nsIURI *aURI) MOZ_OVERRIDE; \
  NS_IMETHOD SetIsPrerendered(void) MOZ_OVERRIDE; \
  NS_IMETHOD Destroy(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetDepthTooGreat(bool *aDepthTooGreat) MOZ_OVERRIDE; \
  NS_IMETHOD UpdatePositionAndSize(nsSubDocumentFrame *aIFrame) MOZ_OVERRIDE; \
  NS_IMETHOD ActivateRemoteFrame(void) MOZ_OVERRIDE; \
  NS_IMETHOD DeactivateRemoteFrame(void) MOZ_OVERRIDE; \
  NS_IMETHOD SendCrossProcessMouseEvent(const nsAString & aType, float aX, float aY, int32_t aButton, int32_t aClickCount, int32_t aModifiers, bool aIgnoreRootScrollFrame) MOZ_OVERRIDE; \
  NS_IMETHOD ActivateFrameEvent(const nsAString & aType, bool capture) MOZ_OVERRIDE; \
  NS_IMETHOD GetMessageManager(nsIMessageSender * *aMessageManager) MOZ_OVERRIDE; \
  NS_IMETHOD GetOwnerElement(nsIDOMElement * *aOwnerElement) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnerElement(aOwnerElement); } \
  NS_IMETHOD GetChildID(uint64_t *aChildID) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetChildID(aChildID); } \
  NS_IMETHOD GetVisible(bool *aVisible) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetVisible(aVisible); } \
  NS_IMETHOD SetVisible(bool aVisible) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetVisible(aVisible); } \
  NS_IMETHOD GetOwnerIsBrowserOrAppFrame(bool *aOwnerIsBrowserOrAppFrame) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnerIsBrowserOrAppFrame(aOwnerIsBrowserOrAppFrame); } \
  NS_IMETHOD GetOwnerIsWidget(bool *aOwnerIsWidget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnerIsWidget(aOwnerIsWidget); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsFrameLoader : public nsIFrameLoader
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIFRAMELOADER

/* End of implementation class template. */
#endif
# 568 "../../dist/include/nsIFrameLoader.h"


#endif /* __gen_nsIFrameLoader_h__ */
# 571 "../../dist/include/nsIFrameLoader.h"
# 35 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameLoader.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * Class for managing loading of a subframe (creation of the docshell,
 * handling of loads in it, recursion-checking).
 */

#ifndef nsFrameLoader_h_
#define nsFrameLoader_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsIDocShell.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringFwd.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameMessageManager.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsFrameMessageManager.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsFrameMessageManager_h__
#define nsFrameMessageManager_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsIMessageManager.h"
#endif /* expanded by -frewrite-includes */
#if 0 /* expanded by -frewrite-includes */
#include "nsWeakPtr.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsWeakPtr.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

# 1 "../../dist/include/mozilla/dom/StructuredCloneUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_StructuredCloneUtils_h
#define mozilla_dom_StructuredCloneUtils_h

#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/StructuredCloneUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/StructuredCloneUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/File.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/File.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_File_h
#define mozilla_dom_File_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"

#endif // mozilla_dom_indexeddb_fileinfo_h__
# 91 "../../dist/include/mozilla/dom/indexedDB/FileInfo.h"
# 17 "../../dist/include/mozilla/dom/File.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/indexedDB/FileManager.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/indexedDB/FileManager.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_indexeddb_filemanager_h__
#define mozilla_dom_indexeddb_filemanager_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/indexedDB/FileManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/quota/PersistenceType.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/quota/PersistenceType.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_quota_persistencetype_h__
#define mozilla_dom_quota_persistencetype_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/quota/QuotaCommon.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/quota/QuotaCommon.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_quota_quotacommon_h__
#define mozilla_dom_quota_quotacommon_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/quota/QuotaCommon.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/quota/QuotaCommon.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/quota/QuotaCommon.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsPrintfCString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsPrintfCString.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsPrintfCString_h___
#define nsPrintfCString_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsPrintfCString.h"

/**
 * nsPrintfCString lets you create a nsCString using a printf-style format
 * string.  For example:
 *
 *   NS_WARNING(nsPrintfCString("Unexpected value: %f", 13.917).get());
 *
 * nsPrintfCString has a small built-in auto-buffer.  For larger strings, it
 * will allocate on the heap.
 *
 * See also nsCString::AppendPrintf().
 */
class nsPrintfCString : public nsFixedCString
{
  typedef nsCString string_type;

public:
  

private:
  static const uint32_t kLocalBufferSize = 16;
  char_type mLocalBuffer[kLocalBufferSize];
};

#endif // !defined(nsPrintfCString_h___)
# 43 "../../dist/include/nsPrintfCString.h"
# 14 "../../dist/include/mozilla/dom/quota/QuotaCommon.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/quota/QuotaCommon.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/quota/QuotaCommon.h"

#define BEGIN_QUOTA_NAMESPACE \
  namespace mozilla { namespace dom { namespace quota {
#define END_QUOTA_NAMESPACE \
  } /* namespace quota */ } /* namespace dom */ } /* namespace mozilla */
#define USING_QUOTA_NAMESPACE \
  using namespace mozilla::dom::quota;

#define DSSTORE_FILE_NAME ".DS_Store"

#define QM_WARNING(...)                                                        \
  do {                                                                         \
    nsPrintfCString str(__VA_ARGS__);                                          \
    mozilla::dom::quota::ReportInternalError(__FILE__, __LINE__, str.get());   \
    NS_WARNING(str.get());                                                     \
  } while (0)

BEGIN_QUOTA_NAMESPACE

;

;

;

;

END_QUOTA_NAMESPACE

#endif // mozilla_dom_quota_quotacommon_h__
# 50 "../../dist/include/mozilla/dom/quota/QuotaCommon.h"
# 11 "../../dist/include/mozilla/dom/quota/PersistenceType.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/StorageTypeBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/StorageTypeBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_StorageTypeBinding_h
#define mozilla_dom_StorageTypeBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/StorageTypeBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/StorageTypeBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/StorageTypeBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/StorageTypeBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/StorageTypeBinding.h"

namespace mozilla {
namespace dom {

namespace StorageTypeValues {
extern const EnumEntry strings[4];
} // namespace StorageTypeValues


} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_StorageTypeBinding_h
# 40 "../../dist/include/mozilla/dom/StorageTypeBinding.h"
# 13 "../../dist/include/mozilla/dom/quota/PersistenceType.h" 2

BEGIN_QUOTA_NAMESPACE

enum PersistenceType
{
  PERSISTENCE_TYPE_PERSISTENT = 0,
  PERSISTENCE_TYPE_TEMPORARY,
  PERSISTENCE_TYPE_DEFAULT,

  // Only needed for IPC serialization helper, should never be used in code.
  PERSISTENCE_TYPE_INVALID
};













END_QUOTA_NAMESPACE
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/quota/PersistenceType.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Mutex.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsClassHashtable.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"

class nsPIDOMWindow;
struct PRLogModuleInfo;

namespace mozilla {

class DOMEventTargetHelper;
class EventChainPostVisitor;

namespace dom {

class TabContext;

namespace indexedDB {

class FileManager;
class FileManagerInfo;
class IDBFactory;

class IndexedDatabaseManager MOZ_FINAL : public nsIObserver
{
  typedef mozilla::dom::quota::PersistenceType PersistenceType;

public:
  enum LoggingMode
  {
    Logging_Disabled = 0,
    Logging_Concise,
    Logging_Detailed,
    Logging_ConciseProfilerMarks,
    Logging_DetailedProfilerMarks
  };

  NS_DECL_ISUPPORTS
  NS_DECL_NSIOBSERVER

  // Returns a non-owning reference.
  static IndexedDatabaseManager*
  GetOrCreate();

  // Returns a non-owning reference.
  static IndexedDatabaseManager*
  Get();

  static bool
  IsClosed();

  static bool
  IsMainProcess()
#ifdef DEBUG
  ;
#else
# 70 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"
  {
    return sIsMainProcess;
  }
#endif
# 74 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"

  static bool
  InLowDiskSpaceMode()
#ifdef DEBUG
  ;
#else
# 80 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"
  {
    return !!sLowDiskSpaceMode;
  }
#endif
# 84 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"

  static bool
  InTestingMode();

  static bool
  FullSynchronous();

  static LoggingMode
  GetLoggingMode()
#ifdef DEBUG
  ;
#else
# 96 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"
  {
    return sLoggingMode;
  }
#endif
# 100 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"

  ;

  // Don't call this method in real code, it blocks the main thread!
  // It is intended to be used by mochitests to test correctness of the special
  static bool sFullSynchronousMode;
  static PRLogModuleInfo* sLoggingModule;
  static Atomic<LoggingMode> sLoggingMode;
  static mozilla::Atomic<bool> sLowDiskSpaceMode;
};

} // namespace indexedDB
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_indexeddb_indexeddatabasemanager_h__
# 206 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabaseManager.h"
# 19 "../../dist/include/mozilla/dom/File.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/dom/File.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/dom/File.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/mozilla/dom/File.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMFile.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMFile.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMFile.idl
 */

#ifndef __gen_nsIDOMFile_h__
#define __gen_nsIDOMFile_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMFile.h"
#endif
# 12 "../../dist/include/nsIDOMFile.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsIDOMFile.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 19 "../../dist/include/nsIDOMFile.h"
namespace mozilla {
namespace dom {
namespace indexedDB {
class FileInfo;
class FileManager;
}
}
}
class nsIDOMFileError; /* forward declaration */

class nsIInputStream; /* forward declaration */

class nsIURI; /* forward declaration */

class nsIPrincipal; /* forward declaration */

class nsIDOMBlob; /* forward declaration */


/* starting interface:    nsIDOMBlob */
#define NS_IDOMBLOB_IID_STR "6ef56697-7c9c-41ac-83df-e01c079fb1d1"

#define NS_IDOMBLOB_IID \
  {0x6ef56697, 0x7c9c, 0x41ac, \
    { 0x83, 0xdf, 0xe0, 0x1c, 0x07, 0x9f, 0xb1, 0xd1 }}

class NS_NO_VTABLE nsIDOMBlob : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMBLOB_IID)

  /* readonly attribute unsigned long long size; */
  NS_IMETHOD GetSize(uint64_t *aSize) = 0;

  /* readonly attribute DOMString type; */
  NS_IMETHOD GetType(nsAString & aType) = 0;

  /* [noscript] readonly attribute nsIInputStream internalStream; */
  NS_IMETHOD GetInternalStream(nsIInputStream * *aInternalStream) = 0;

  /* [optional_argc] nsIDOMBlob slice ([optional] in long long start, [optional] in long long end, [optional] in DOMString contentType); */
  NS_IMETHOD Slice(int64_t start, int64_t end, const nsAString & contentType, uint8_t _argc, nsIDOMBlob * *_retval) = 0;

  /* [notxpcom] long long getFileId (); */
  NS_IMETHOD_(int64_t) GetFileId(void) = 0;

  /* [notxpcom] void addFileInfo (in FileInfo aFileInfo); */
  NS_IMETHOD_(void) AddFileInfo(mozilla::dom::indexedDB::FileInfo *aFileInfo) = 0;

  /* [notxpcom] FileInfo getFileInfo (in FileManager aFileManager); */
  NS_IMETHOD_(mozilla::dom::indexedDB::FileInfo *) GetFileInfo(mozilla::dom::indexedDB::FileManager *aFileManager) = 0;

  /* [notxpcom] bool isMemoryFile (); */
  NS_IMETHOD_(bool) IsMemoryFile(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMBlob, NS_IDOMBLOB_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMBLOB \
  NS_IMETHOD GetSize(uint64_t *aSize) MOZ_OVERRIDE; \
  NS_IMETHOD GetType(nsAString & aType) MOZ_OVERRIDE; \
  NS_IMETHOD GetInternalStream(nsIInputStream * *aInternalStream) MOZ_OVERRIDE; \
  NS_IMETHOD Slice(int64_t start, int64_t end, const nsAString & contentType, uint8_t _argc, nsIDOMBlob * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD_(int64_t) GetFileId(void) MOZ_OVERRIDE; \
  NS_IMETHOD_(void) AddFileInfo(mozilla::dom::indexedDB::FileInfo *aFileInfo) MOZ_OVERRIDE; \
  NS_IMETHOD_(mozilla::dom::indexedDB::FileInfo *) GetFileInfo(mozilla::dom::indexedDB::FileManager *aFileManager) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) IsMemoryFile(void) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMBLOB(_to) \
  NS_IMETHOD GetSize(uint64_t *aSize) MOZ_OVERRIDE { return _to GetSize(aSize); } \
  NS_IMETHOD GetType(nsAString & aType) MOZ_OVERRIDE { return _to GetType(aType); } \
  NS_IMETHOD GetInternalStream(nsIInputStream * *aInternalStream) MOZ_OVERRIDE { return _to GetInternalStream(aInternalStream); } \
  NS_IMETHOD Slice(int64_t start, int64_t end, const nsAString & contentType, uint8_t _argc, nsIDOMBlob * *_retval) MOZ_OVERRIDE { return _to Slice(start, end, contentType, _argc, _retval); } \
  NS_IMETHOD_(int64_t) GetFileId(void) MOZ_OVERRIDE { return _to GetFileId(); } \
  NS_IMETHOD_(void) AddFileInfo(mozilla::dom::indexedDB::FileInfo *aFileInfo) MOZ_OVERRIDE { return _to AddFileInfo(aFileInfo); } \
  NS_IMETHOD_(mozilla::dom::indexedDB::FileInfo *) GetFileInfo(mozilla::dom::indexedDB::FileManager *aFileManager) MOZ_OVERRIDE { return _to GetFileInfo(aFileManager); } \
  NS_IMETHOD_(bool) IsMemoryFile(void) MOZ_OVERRIDE { return _to IsMemoryFile(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMBLOB(_to) \
  NS_IMETHOD GetSize(uint64_t *aSize) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSize(aSize); } \
  NS_IMETHOD GetType(nsAString & aType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
  NS_IMETHOD GetInternalStream(nsIInputStream * *aInternalStream) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInternalStream(aInternalStream); } \
  NS_IMETHOD Slice(int64_t start, int64_t end, const nsAString & contentType, uint8_t _argc, nsIDOMBlob * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Slice(start, end, contentType, _argc, _retval); } \
  NS_IMETHOD_(int64_t) GetFileId(void) MOZ_OVERRIDE; \
  NS_IMETHOD_(void) AddFileInfo(mozilla::dom::indexedDB::FileInfo *aFileInfo) MOZ_OVERRIDE; \
  NS_IMETHOD_(mozilla::dom::indexedDB::FileInfo *) GetFileInfo(mozilla::dom::indexedDB::FileManager *aFileManager) MOZ_OVERRIDE; \
  NS_IMETHOD_(bool) IsMemoryFile(void) MOZ_OVERRIDE; 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMBlob : public nsIDOMBlob
{
public:
  NS_DECL_ISUPPORTS
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [notxpcom] bool isMemoryFile (); */
NS_IMETHODIMP_(bool) nsDOMBlob::IsMemoryFile()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 193 "../../dist/include/nsIDOMFile.h"


/* starting interface:    nsIDOMFile */
#define NS_IDOMFILE_IID_STR "4e7d1a8b-e2d5-4304-a753-4affb731660c"

#define NS_IDOMFILE_IID \
  {0x4e7d1a8b, 0xe2d5, 0x4304, \
    { 0xa7, 0x53, 0x4a, 0xff, 0xb7, 0x31, 0x66, 0x0c }}

class NS_NO_VTABLE nsIDOMFile : public nsIDOMBlob {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMFILE_IID)

  /* readonly attribute DOMString name; */
  NS_IMETHOD GetName(nsAString & aName) = 0;

  /* readonly attribute DOMString path; */
  NS_IMETHOD GetPath(nsAString & aPath) = 0;

  /* [implicit_jscontext] readonly attribute jsval lastModifiedDate; */
  NS_IMETHOD GetLastModifiedDate(JSContext* cx, JS::MutableHandleValue aLastModifiedDate) = 0;

  /* readonly attribute DOMString mozFullPath; */
  NS_IMETHOD GetMozFullPath(nsAString & aMozFullPath) = 0;

  /* [noscript] readonly attribute DOMString mozFullPathInternal; */
  NS_IMETHOD GetMozFullPathInternal(nsAString & aMozFullPathInternal) = 0;

  /* [noscript] readonly attribute uint64_t mozLastModifiedDate; */
  NS_IMETHOD GetMozLastModifiedDate(uint64_t *aMozLastModifiedDate) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMFile, NS_IDOMFILE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMFILE \
  NS_IMETHOD GetName(nsAString & aName) MOZ_OVERRIDE; \
  NS_IMETHOD GetPath(nsAString & aPath) MOZ_OVERRIDE; \
  NS_IMETHOD GetLastModifiedDate(JSContext* cx, JS::MutableHandleValue aLastModifiedDate) MOZ_OVERRIDE; \
  NS_IMETHOD GetMozFullPath(nsAString & aMozFullPath) MOZ_OVERRIDE; \
  NS_IMETHOD GetMozFullPathInternal(nsAString & aMozFullPathInternal) MOZ_OVERRIDE; \
  NS_IMETHOD GetMozLastModifiedDate(uint64_t *aMozLastModifiedDate) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMFILE(_to) \
  NS_IMETHOD GetName(nsAString & aName) MOZ_OVERRIDE { return _to GetName(aName); } \
  NS_IMETHOD GetPath(nsAString & aPath) MOZ_OVERRIDE { return _to GetPath(aPath); } \
  NS_IMETHOD GetLastModifiedDate(JSContext* cx, JS::MutableHandleValue aLastModifiedDate) MOZ_OVERRIDE { return _to GetLastModifiedDate(cx, aLastModifiedDate); } \
  NS_IMETHOD GetMozFullPath(nsAString & aMozFullPath) MOZ_OVERRIDE { return _to GetMozFullPath(aMozFullPath); } \
  NS_IMETHOD GetMozFullPathInternal(nsAString & aMozFullPathInternal) MOZ_OVERRIDE { return _to GetMozFullPathInternal(aMozFullPathInternal); } \
  NS_IMETHOD GetMozLastModifiedDate(uint64_t *aMozLastModifiedDate) MOZ_OVERRIDE { return _to GetMozLastModifiedDate(aMozLastModifiedDate); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMFILE(_to) \
  NS_IMETHOD GetName(nsAString & aName) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \
  NS_IMETHOD GetPath(nsAString & aPath) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPath(aPath); } \
  NS_IMETHOD GetLastModifiedDate(JSContext* cx, JS::MutableHandleValue aLastModifiedDate) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLastModifiedDate(cx, aLastModifiedDate); } \
  NS_IMETHOD GetMozFullPath(nsAString & aMozFullPath) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMozFullPath(aMozFullPath); } \
  NS_IMETHOD GetMozFullPathInternal(nsAString & aMozFullPathInternal) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMozFullPathInternal(aMozFullPathInternal); } \
  NS_IMETHOD GetMozLastModifiedDate(uint64_t *aMozLastModifiedDate) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMozLastModifiedDate(aMozLastModifiedDate); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */

/* End of implementation class template. */
#endif
# 326 "../../dist/include/nsIDOMFile.h"


#endif /* __gen_nsIDOMFile_h__ */
# 329 "../../dist/include/nsIDOMFile.h"
# 23 "../../dist/include/mozilla/dom/File.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMFileList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMFileList.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMFileList.idl
 */

#ifndef __gen_nsIDOMFileList_h__
#define __gen_nsIDOMFileList_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMFileList.h"
#endif
# 12 "../../dist/include/nsIDOMFileList.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE

/* nsIDOMFile item (in unsigned long index); */
NS_IMETHODIMP nsDOMFileList::Item(uint32_t index, nsIDOMFile * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 103 "../../dist/include/nsIDOMFileList.h"


#endif /* __gen_nsIDOMFileList_h__ */
# 106 "../../dist/include/nsIDOMFileList.h"
# 24 "../../dist/include/mozilla/dom/File.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIFile.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIFile.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIFile.idl
 */

#ifndef __gen_nsIFile_h__
#define __gen_nsIFile_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIFile.h"
#endif
# 12 "../../dist/include/nsIFile.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIFile.h"
struct PRFileDesc;
struct PRLibrary;
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsIFile.h"
class nsISimpleEnumerator; /* forward declaration */


/* starting interface:    nsIFile */
#define NS_IFILE_IID_STR "dfb5a307-7ecf-41dd-aee2-f1d623459c44"

#define NS_IFILE_IID \
  {0xdfb5a307, 0x7ecf, 0x41dd, \
    { 0xae, 0xe2, 0xf1, 0xd6, 0x23, 0x45, 0x9c, 0x44 }}

class NS_NO_VTABLE nsIFile : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFILE_IID)

  enum {
    NORMAL_FILE_TYPE = 0U,
    DIRECTORY_TYPE = 1U
  };

  /* void append (in AString node); */
  NS_IMETHOD Append(const nsAString & node) = 0;

  /* [noscript] void appendNative (in ACString node); */
  NS_IMETHOD AppendNative(const nsACString & node) = 0;

  /* void normalize (); */
  NS_IMETHOD Normalize(void) = 0;

  /* void create (in unsigned long type, in unsigned long permissions); */
  NS_IMETHOD Create(uint32_t type, uint32_t permissions) = 0;

  /* attribute AString leafName; */
  NS_IMETHOD GetLeafName(nsAString & aLeafName) = 0;
  NS_IMETHOD SetLeafName(const nsAString & aLeafName) = 0;

  enum {
    OS_READAHEAD = 1073741824U,
    DELETE_ON_CLOSE = 2147483648U
  };

  /* void setRelativeDescriptor (in nsIFile fromFile, in ACString relativeDesc); */
  NS_IMETHOD SetRelativeDescriptor(nsIFile *fromFile, const nsACString & relativeDesc) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIFile, NS_IFILE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIFILE \
  NS_IMETHOD Load(PRLibrary **_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Load(_retval); } \
  NS_IMETHOD GetDiskSpaceAvailable(int64_t *aDiskSpaceAvailable) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDiskSpaceAvailable(aDiskSpaceAvailable); } \
  NS_IMETHOD AppendRelativePath(const nsAString & relativeFilePath) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendRelativePath(relativeFilePath); } \
  NS_IMETHOD AppendRelativeNativePath(const nsACString & relativeFilePath) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendRelativeNativePath(relativeFilePath); } \
  NS_IMETHOD GetPersistentDescriptor(nsACString & aPersistentDescriptor) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPersistentDescriptor(aPersistentDescriptor); } \
  NS_IMETHOD SetPersistentDescriptor(const nsACString & aPersistentDescriptor) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetPersistentDescriptor(aPersistentDescriptor); } \
  NS_IMETHOD Reveal(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Reveal(); } \
  NS_IMETHOD Launch(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Launch(); } \
  NS_IMETHOD GetRelativeDescriptor(nsIFile *fromFile, nsACString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRelativeDescriptor(fromFile, _retval); } \
  NS_IMETHOD SetRelativeDescriptor(nsIFile *fromFile, const nsACString & relativeDesc) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRelativeDescriptor(fromFile, relativeDesc); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsFile : public nsIFile
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsDirectoryServiceUtils_h___
#define nsDirectoryServiceUtils_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsIServiceManager.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsDirectoryServiceUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIProperties.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIProperties.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIProperties.idl
 */

#ifndef __gen_nsIProperties_h__
#define __gen_nsIProperties_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIProperties.h"
#endif
# 12 "../../dist/include/nsIProperties.h"
  NS_IMETHOD Get(const char * prop, const nsIID & iid, void **result) MOZ_OVERRIDE { return _to Get(prop, iid, result); } \
  NS_IMETHOD Set(const char * prop, nsISupports *value) MOZ_OVERRIDE { return _to Set(prop, value); } \
  NS_IMETHOD Has(const char * prop, bool *_retval) MOZ_OVERRIDE { return _to Has(prop, _retval); } \
  NS_IMETHOD Undefine(const char * prop) MOZ_OVERRIDE { return _to Undefine(prop); } \
  NS_IMETHOD GetKeys(uint32_t *count, char * **keys) MOZ_OVERRIDE { return _to GetKeys(count, keys); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPROPERTIES(_to) \
  NS_IMETHOD Get(const char * prop, const nsIID & iid, void **result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Get(prop, iid, result); } \
  NS_IMETHOD Set(const char * prop, nsISupports *value) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Set(prop, value); } \
  NS_IMETHOD Has(const char * prop, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Has(prop, _retval); } \
  NS_IMETHOD Undefine(const char * prop) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Undefine(prop); } \
  NS_IMETHOD GetKeys(uint32_t *count, char * **keys) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetKeys(count, keys); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* void undefine (in string prop); */
NS_IMETHODIMP nsProperties::Undefine(const char * prop)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void getKeys (out uint32_t count, [array, size_is (count), retval] out string keys); */
NS_IMETHODIMP nsProperties::GetKeys(uint32_t *count, char * **keys)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 137 "../../dist/include/nsIProperties.h"


#endif /* __gen_nsIProperties_h__ */
# 140 "../../dist/include/nsIProperties.h"
# 12 "../../dist/include/nsDirectoryServiceUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsServiceManagerUtils.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsDirectoryServiceUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsDirectoryServiceUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsXPCOMCID.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsDirectoryServiceUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIFile.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIFile.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIFile.idl
 */

#ifndef __gen_nsIFile_h__
#define __gen_nsIFile_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIFile.h"
#endif
# 12 "../../dist/include/nsIFile.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIFile.h"
struct PRFileDesc;
struct PRLibrary;
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsIFile.h"
  NS_IMETHOD SetRelativeDescriptor(nsIFile *fromFile, const nsACString & relativeDesc) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetRelativeDescriptor(fromFile, relativeDesc); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsFile : public nsIFile
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIFILE

  nsFile();
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* ACString getRelativeDescriptor (in nsIFile fromFile); */
NS_IMETHODIMP nsFile::GetRelativeDescriptor(nsIFile *fromFile, nsACString & _retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void setRelativeDescriptor (in nsIFile fromFile, in ACString relativeDesc); */
NS_IMETHODIMP nsFile::SetRelativeDescriptor(nsIFile *fromFile, const nsACString & relativeDesc)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 812 "../../dist/include/nsIFile.h"

#ifdef MOZILLA_INTERNAL_API
#if 0 /* expanded by -frewrite-includes */
#include "nsDirectoryServiceUtils.h"
#endif /* expanded by -frewrite-includes */
# 815 "../../dist/include/nsIFile.h"
#endif
# 816 "../../dist/include/nsIFile.h"

#endif /* __gen_nsIFile_h__ */
# 818 "../../dist/include/nsIFile.h"
# 16 "../../dist/include/nsDirectoryServiceUtils.h" 2

inline nsresult
NS_GetSpecialDirectory(const char* aSpecialDirName, nsIFile** aResult)
{
  nsresult rv;
  nsCOMPtr<nsIProperties> serv(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID,
                                             &rv));
  if (NS_FAILED(rv)) {
    return rv;
  }

  return serv->Get(aSpecialDirName, NS_GET_IID(nsIFile),
                   reinterpret_cast<void**>(aResult));
}

#endif
# 32 "../../dist/include/nsDirectoryServiceUtils.h"
# 815 "../../dist/include/nsIFile.h" 2
#endif
# 816 "../../dist/include/nsIFile.h"

#define NS_IMUTABLE_IID \
  {0x321578d0, 0x03c1, 0x4d95, \
    { 0x88, 0x21, 0x02, 0x1a, 0xc6, 0x12, 0xd1, 0x8d }}

class NS_NO_VTABLE nsIMutable : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMUTABLE_IID)

  /* attribute boolean mutable; */
  NS_IMETHOD GetMutable(bool *aMutable) = 0;
  NS_IMETHOD SetMutable(bool aMutable) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIMutable, NS_IMUTABLE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIMUTABLE \
  NS_IMETHOD GetMutable(bool *aMutable) MOZ_OVERRIDE; \
  NS_IMETHOD SetMutable(bool aMutable) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIMUTABLE(_to) \
  NS_IMETHOD GetMutable(bool *aMutable) MOZ_OVERRIDE { return _to GetMutable(aMutable); } \
  NS_IMETHOD SetMutable(bool aMutable) MOZ_OVERRIDE { return _to SetMutable(aMutable); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIMUTABLE(_to) \
  NS_IMETHOD GetMutable(bool *aMutable) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMutable(aMutable); } \
  NS_IMETHOD SetMutable(bool aMutable) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMutable(aMutable); } 
#ifndef __gen_nsIDOMEventTarget_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMEventTarget.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIXMLHttpRequest.h"
#endif
# 12 "../../dist/include/nsIXMLHttpRequest.h"



/* starting interface:    nsIXMLHttpRequestEventTarget */
#define NS_IXMLHTTPREQUESTEVENTTARGET_IID_STR "88e7d2a0-2e5b-4f65-9624-a61e607a9948"

#define NS_IXMLHTTPREQUESTEVENTTARGET_IID \
  {0x88e7d2a0, 0x2e5b, 0x4f65, \
    { 0x96, 0x24, 0xa6, 0x1e, 0x60, 0x7a, 0x99, 0x48 }}

class NS_NO_VTABLE nsIXMLHttpRequestEventTarget : public nsIDOMEventTarget {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXMLHTTPREQUESTEVENTTARGET_IID)

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIXMLHttpRequestEventTarget, NS_IXMLHTTPREQUESTEVENTTARGET_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXMLHTTPREQUESTEVENTTARGET \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIXMLHTTPREQUESTEVENTTARGET(_to) \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIXMLHTTPREQUESTEVENTTARGET(_to) \
  /* no methods! */

#if 0
/* End of implementation class template. */
#endif
# 104 "../../dist/include/nsIXMLHttpRequest.h"


/* starting interface:    nsIXMLHttpRequestUpload */
#define NS_IXMLHTTPREQUESTUPLOAD_IID_STR "d74c4dc4-bc8c-4f5d-b7f1-121a48750abe"

#define NS_IXMLHTTPREQUESTUPLOAD_IID \
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIXMLHTTPREQUESTUPLOAD(_to) \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIXMLHTTPREQUESTUPLOAD(_to) \
  /* no methods! */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsXMLHttpRequestUpload : public nsIXMLHttpRequestUpload
{
public:
  NS_DECL_ISUPPORTS
  /* member initializers and constructor code */
}

nsXMLHttpRequestUpload::~nsXMLHttpRequestUpload()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 168 "../../dist/include/nsIXMLHttpRequest.h"


/* starting interface:    nsIXMLHttpRequest */
#define NS_IXMLHTTPREQUEST_IID_STR "6f54214c-7175-498d-9d2d-0429e38c2869"

#define NS_IXMLHTTPREQUEST_IID \
  {0x6f54214c, 0x7175, 0x498d, \
    { 0x9d, 0x2d, 0x04, 0x29, 0xe3, 0x8c, 0x28, 0x69 }}

class nsIXMLHttpRequest : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXMLHTTPREQUEST_IID)

  /* readonly attribute nsIChannel channel; */
  NS_IMETHOD GetChannel(nsIChannel * *aChannel) = 0;

  /* readonly attribute nsIDOMDocument responseXML; */
  NS_IMETHOD GetResponseXML(nsIDOMDocument * *aResponseXML) = 0;

  /* readonly attribute AString responseText; */
  NS_IMETHOD GetResponseText(nsAString & aResponseText) = 0;

  /* attribute AString responseType; */
  NS_IMETHOD GetResponseType(nsAString & aResponseType) = 0;

  /* [implicit_jscontext] attribute jsval onreadystatechange; */
  NS_IMETHOD GetOnreadystatechange(JSContext* cx, JS::MutableHandleValue aOnreadystatechange) = 0;
  NS_IMETHOD SetOnreadystatechange(JSContext* cx, JS::HandleValue aOnreadystatechange) = 0;

  /* readonly attribute boolean mozAnon; */
  NS_IMETHOD GetMozAnon(bool *aMozAnon) = 0;

  /* readonly attribute boolean mozSystem; */
  NS_IMETHOD GetMozSystem(bool *aMozSystem) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIXMLHttpRequest, NS_IXMLHTTPREQUEST_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXMLHTTPREQUEST \
  NS_IMETHOD GetChannel(nsIChannel * *aChannel) MOZ_OVERRIDE; \
  NS_IMETHOD GetResponseXML(nsIDOMDocument * *aResponseXML) MOZ_OVERRIDE; \
  NS_IMETHOD GetResponseText(nsAString & aResponseText) MOZ_OVERRIDE; \
  NS_IMETHOD GetResponseType(nsAString & aResponseType) MOZ_OVERRIDE; \
  NS_IMETHOD GetResponseType(nsAString & aResponseType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResponseType(aResponseType); } \
  NS_IMETHOD SetResponseType(const nsAString & aResponseType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetResponseType(aResponseType); } \
  NS_IMETHOD GetResponse(JSContext* cx, JS::MutableHandleValue aResponse) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResponse(cx, aResponse); } \
  NS_IMETHOD GetStatus(uint32_t *aStatus) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStatus(aStatus); } \
  NS_IMETHOD GetStatusText(nsACString & aStatusText) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStatusText(aStatusText); } \
  NS_IMETHOD SlowAbort(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SlowAbort(); } \
  NS_IMETHOD GetAllResponseHeaders(nsACString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAllResponseHeaders(_retval); } \
  NS_IMETHOD GetMozAnon(bool *aMozAnon) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMozAnon(aMozAnon); } \
  NS_IMETHOD GetMozSystem(bool *aMozSystem) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMozSystem(aMozSystem); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsXMLHttpRequest : public nsIXMLHttpRequest
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIXMLHTTPREQUEST

  nsXMLHttpRequest();

    return NS_ERROR_NOT_IMPLEMENTED;
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute boolean mozSystem; */
NS_IMETHODIMP nsXMLHttpRequest::GetMozSystem(bool *aMozSystem)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 559 "../../dist/include/nsIXMLHttpRequest.h"


/* starting interface:    nsIXHRSendable */
#define NS_IXHRSENDABLE_IID_STR "840d0d00-e83e-4a29-b3c7-67e96e90a499"

#define NS_IXHRSENDABLE_IID \
  {0x840d0d00, 0xe83e, 0x4a29, \
    { 0xb3, 0xc7, 0x67, 0xe9, 0x6e, 0x90, 0xa4, 0x99 }}

class NS_NO_VTABLE nsIXHRSendable : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IXHRSENDABLE_IID)

  /* void getSendInfo (out nsIInputStream body, out uint64_t contentLength, out ACString contentType, out ACString charset); */
  NS_IMETHOD GetSendInfo(nsIInputStream * *body, uint64_t *contentLength, nsACString & contentType, nsACString & charset) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIXHRSendable, NS_IXHRSENDABLE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIXHRSENDABLE \
  NS_IMETHOD GetSendInfo(nsIInputStream * *body, uint64_t *contentLength, nsACString & contentType, nsACString & charset) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIXHRSENDABLE(_to) \
  NS_IMETHOD GetSendInfo(nsIInputStream * *body, uint64_t *contentLength, nsACString & contentType, nsACString & charset) MOZ_OVERRIDE { return _to GetSendInfo(body, contentLength, contentType, charset); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIXHRSENDABLE(_to) \
  NS_IMETHOD GetSendInfo(nsIInputStream * *body, uint64_t *contentLength, nsACString & contentType, nsACString & charset) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSendInfo(body, contentLength, contentType, charset); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 632 "../../dist/include/nsIXMLHttpRequest.h"


/* starting interface:    nsIJSXMLHttpRequest */
#define NS_IJSXMLHTTPREQUEST_IID_STR "8ae70a39-edf1-40b4-a992-472d23421c25"

#define NS_IJSXMLHTTPREQUEST_IID \
  {0x8ae70a39, 0xedf1, 0x40b4, \
    { 0xa9, 0x92, 0x47, 0x2d, 0x23, 0x42, 0x1c, 0x25 }}


/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIJSXMLHTTPREQUEST(_to) \
  /* no methods! */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsJSXMLHttpRequest : public nsIJSXMLHttpRequest
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIJSXMLHTTPREQUEST

  nsJSXMLHttpRequest();
nsJSXMLHttpRequest::~nsJSXMLHttpRequest()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 696 "../../dist/include/nsIXMLHttpRequest.h"

#define NS_XMLHTTPREQUEST_CID                       \
 { /* d164e770-4157-11d4-9a42-000064657374 */       \
  0xd164e770, 0x4157, 0x11d4,                       \
 {0x9a, 0x42, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74} }
#define NS_XMLHTTPREQUEST_CONTRACTID \
"@mozilla.org/xmlextras/xmlhttprequest;1"

#endif /* __gen_nsIXMLHttpRequest_h__ */
# 705 "../../dist/include/nsIXMLHttpRequest.h"
# 27 "../../dist/include/mozilla/dom/File.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/mozilla/dom/File.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTemporaryFileInputStream.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsTemporaryFileInputStream.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsTemporaryFileInputStream_h__
#define nsTemporaryFileInputStream_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Mutex.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsTemporaryFileInputStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIInputStream.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsTemporaryFileInputStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsTemporaryFileInputStream.h"
#if 0 /* expanded by -frewrite-includes */
#include "prio.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsTemporaryFileInputStream.h"

class nsTemporaryFileInputStream : public nsIInputStream
{
public:
  //used to release a PRFileDesc
  class FileDescOwner
  {
    friend class nsTemporaryFileInputStream;
  public:
    NS_INLINE_DECL_THREADSAFE_REFCOUNTING(FileDescOwner)
    
  private:
    ~FileDescOwner()
    {
      PR_Close(mFD);
    }
  public:
    

  private:
    PRFileDesc* mFD;
    mozilla::Mutex mMutex;
  };

  ;

  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSIINPUTSTREAM

private:
  

  nsRefPtr<FileDescOwner> mFileDescOwner;
  uint64_t mStartPos;
  uint64_t mEndPos;
  bool mClosed;
};

#endif // nsTemporaryFileInputStream_h__
# 57 "../../dist/include/nsTemporaryFileInputStream.h"
# 29 "../../dist/include/mozilla/dom/File.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 30 "../../dist/include/mozilla/dom/File.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWeakReference.h"
#endif /* expanded by -frewrite-includes */
# 31 "../../dist/include/mozilla/dom/File.h"

class nsDOMMultipartFile;
class nsIFile;
class nsIInputStream;
class nsIClassInfo;

#define FILEIMPL_IID \
  { 0xbccb3275, 0x6778, 0x4ac5, \
    { 0xaf, 0x03, 0x90, 0xed, 0x37, 0xad, 0xdf, 0x5d } }

namespace mozilla {
namespace dom {

namespace indexedDB {
class FileInfo;
};

struct BlobPropertyBag;
struct ChromeFilePropertyBag;
struct FilePropertyBag;
class FileImpl;
class OwningArrayBufferOrArrayBufferViewOrBlobOrString;

class File MOZ_FINAL : public nsIDOMFile
                     , public nsIXHRSendable
                     , public nsIMutable
                     , public nsSupportsWeakReference
                     , public nsWrapperCache
{
public:
  NS_DECL_NSIDOMBLOB
  NS_DECL_NSIDOMFILE
  NS_DECL_NSIXHRSENDABLE
  NS_DECL_NSIMUTABLE

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(File, nsIDOMFile)
  ;

  // File constructor - ChromeOnly
  ;

  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;


  // The member is the real backend implementation of this File/Blob.
  // It's thread-safe and not CC-able and it's the only element that is moved
  // between threads.
  // Note: we should not store any other state in this class!
  nsRefPtr<FileImpl> mImpl;

  nsCOMPtr<nsISupports> mParent;
};

// This is the abstract class for any File backend. It must be nsISupports
// because this class must be ref-counted and it has to work with IPC.
class FileImpl : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(FILEIMPL_IID)
  NS_DECL_THREADSAFE_ISUPPORTS

  FileImpl() {}

  virtual void GetName(nsAString& aName) = 0;

  virtual nsresult GetPath(nsAString& aName) = 0;


  virtual nsresult GetSendInfo(nsIInputStream** aBody,
                               uint64_t* aContentLength,
                               nsACString& aContentType,
                               nsACString& aCharset) = 0;

  virtual nsresult GetMutable(bool* aMutable) const = 0;

  

protected:
  
};

NS_DEFINE_STATIC_IID_ACCESSOR(FileImpl, FILEIMPL_IID)

class FileImplBase : public FileImpl
{
public:
  

  

  
  nsISupports *mParent;
};

} // dom namespace
} // file namespace

#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/js/StructuredClone.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/js/StructuredClone.h"

struct JSRuntime;
struct JSStructuredCloneReader;
struct JSStructuredCloneWriter;

// API for the HTML5 internal structured cloning algorithm.

namespace JS {
enum TransferableOwnership {
    // Transferable data has not been filled in yet
    SCTAG_TMO_UNFILLED = 0,

    // Structured clone buffer does not yet own the data
    SCTAG_TMO_UNOWNED = 1,

    // All values at least this large are owned by the clone buffer
    SCTAG_TMO_FIRST_OWNED = 2,

    // Data is a pointer that can be freed
    SCTAG_TMO_ALLOC_DATA = 2,

    // Data is a SharedArrayBufferObject's buffer
    SCTAG_TMO_SHARED_BUFFER = 3,

    // Data is a memory mapped pointer
    SCTAG_TMO_MAPPED_DATA = 4,

    // Data is embedding-specific. The engine can free it by calling the
    // freeTransfer op. The embedding can also use SCTAG_TMO_USER_MIN and
    // greater, up to 32 bits, to distinguish specific ownership variants.
    SCTAG_TMO_CUSTOM = 5,

    SCTAG_TMO_USER_MIN
};
} /* namespace JS */

// Read structured data from the reader r. This hook is used to read a value
// previously serialized by a call to the WriteStructuredCloneOp hook.
//
// tag and data are the pair of uint32_t values from the header. The callback
// may use the JS_Read* APIs to read any other relevant parts of the object
// from the reader r. closure is any value passed to the JS_ReadStructuredClone
// function. Return the new object on success, nullptr on error/exception.
typedef JSObject *(*ReadStructuredCloneOp)(JSContext *cx, JSStructuredCloneReader *r,
                                           uint32_t tag, uint32_t data, void *closure);

// Structured data serialization hook. The engine can write primitive values,
// Objects, Arrays, Dates, RegExps, TypedArrays, ArrayBuffers, Sets, Maps,
// and SharedTypedArrays. Any other type of object requires application support.
// This callback must first use the JS_WriteUint32Pair API to write an object
// header, passing a value greater than JS_SCTAG_USER to the tag parameter.
// Then it can use the JS_Write* APIs to write any other relevant parts of
// the value v to the writer w. closure is any value passed to the
// JS_WriteStructuredClone function.
//
// Return true on success, false on error/exception.
typedef bool (*WriteStructuredCloneOp)(JSContext *cx, JSStructuredCloneWriter *w,
                                       JS::HandleObject obj, void *closure);

// This is called when JS_WriteStructuredClone is given an invalid transferable.
// To follow HTML5, the application must throw a DATA_CLONE_ERR DOMException
// with error set to one of the JS_SCERR_* values.
typedef void (*StructuredCloneErrorOp)(JSContext *cx, uint32_t errorid);

// This is called when JS_ReadStructuredClone receives a transferable object
JS_PUBLIC_API(bool)
JS_WriteStructuredClone(JSContext *cx, JS::HandleValue v, uint64_t **datap, size_t *nbytesp,
                        const JSStructuredCloneCallbacks *optionalCallbacks,
                        void *closure, JS::HandleValue transferable);

JS_PUBLIC_API(bool)
JS_ClearStructuredClone(uint64_t *data, size_t nbytes,
                        const JSStructuredCloneCallbacks *optionalCallbacks,
                        void *closure);

JS_PUBLIC_API(bool)
JS_StructuredCloneHasTransferables(const uint64_t *data, size_t nbytes, bool *hasTransferable);

JS_PUBLIC_API(bool)
JS_StructuredClone(JSContext *cx, JS::HandleValue v, JS::MutableHandleValue vp,
                   const JSStructuredCloneCallbacks *optionalCallbacks, void *closure);

// RAII sugar for JS_WriteStructuredClone.
class JS_PUBLIC_API(JSAutoStructuredCloneBuffer) {
    uint64_t *data_;
    size_t nbytes_;
    uint32_t version_;
    const JSStructuredCloneCallbacks *callbacks_;
    void *closure_;

  public:
    

    

    ;
    ;

    

    uint64_t *data() const { return data_; }
    size_t nbytes() const { return nbytes_; }

    ;

    // Copy some memory. It will be automatically freed by the destructor.
    ;

    // Adopt some memory. It will be automatically freed by the destructor.
    // data must have been allocated by the JS engine (e.g., extracted via
    // JSAutoStructuredCloneBuffer::steal).
    ;

    // Remove the buffer so that it will not be automatically freed.
    // After this, the caller is responsible for feeding the memory back to
    // JSAutoStructuredCloneBuffer::adopt.
    ;

    ;

    ;

    ;

  private:
    // Copy and assignment are not supported.
    JSAutoStructuredCloneBuffer(const JSAutoStructuredCloneBuffer &other) = delete;
    JSAutoStructuredCloneBuffer &operator=(const JSAutoStructuredCloneBuffer &other) = delete;
};

JS_PUBLIC_API(bool)
JS_ReadTypedArray(JSStructuredCloneReader *r, JS::MutableHandleValue vp);

JS_PUBLIC_API(bool)
JS_WriteUint32Pair(JSStructuredCloneWriter *w, uint32_t tag, uint32_t data);

JS_PUBLIC_API(bool)
JS_WriteBytes(JSStructuredCloneWriter *w, const void *p, size_t len);

JS_PUBLIC_API(bool)
JS_WriteString(JSStructuredCloneWriter *w, JS::HandleString str);

JS_PUBLIC_API(bool)
JS_WriteTypedArray(JSStructuredCloneWriter *w, JS::HandleValue v);

#endif  /* js_StructuredClone_h */
# 249 "../../dist/include/js/StructuredClone.h"
# 15 "../../dist/include/mozilla/dom/StructuredCloneUtils.h" 2

namespace mozilla {

struct SerializedStructuredCloneBuffer;

namespace dom {

struct
StructuredCloneClosure
{
  nsTArray<nsRefPtr<File>> mBlobs;
};

struct
StructuredCloneData
{
  StructuredCloneData() : mData(nullptr), mDataLength(0) {}
  uint64_t* mData;
  size_t mDataLength;
  StructuredCloneClosure mClosure;
};

bool
ReadStructuredClone(JSContext* aCx, uint64_t* aData, size_t aDataLength,
                    const StructuredCloneClosure& aClosure,
                    JS::MutableHandle<JS::Value> aClone);

inline bool
ReadStructuredClone(JSContext* aCx, const StructuredCloneData& aData,
                    JS::MutableHandle<JS::Value> aClone)
{
  return ReadStructuredClone(aCx, aData.mData, aData.mDataLength,
                             aData.mClosure, aClone);
}

bool
WriteStructuredClone(JSContext* aCx, JS::Handle<JS::Value> aSource,
                     JSAutoStructuredCloneBuffer& aBuffer,
                     StructuredCloneClosure& aClosure);

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_StructuredCloneUtils_h
# 59 "../../dist/include/mozilla/dom/StructuredCloneUtils.h"
# 31 "/Users/luser/build/mozilla-central/dom/base/nsFrameMessageManager.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/jsipc/CpowHolder.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/jsipc/CpowHolder.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sw=4 et tw=80:
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_jsipc_CpowHolder_h__
#define mozilla_jsipc_CpowHolder_h__

#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/jsipc/CpowHolder.h"

namespace mozilla {
namespace jsipc {

class CpowHolder
{
  public:
    virtual bool ToObject(JSContext* cx, JS::MutableHandle<JSObject*> objp) = 0;
};

} // namespace jsipc
} // namespace mozilla

#endif // mozilla_jsipc_CpowHolder_h__
# 26 "../../dist/include/mozilla/jsipc/CpowHolder.h"
# 32 "/Users/luser/build/mozilla-central/dom/base/nsFrameMessageManager.h" 2

namespace mozilla {
namespace dom {

class nsIContentParent;
class nsIContentChild;
class ClonedMessageData;
class MessageManagerReporter;

namespace ipc {

enum MessageManagerFlags {
  MM_CHILD = 0,
  MM_CHROME = 1,
  MM_GLOBAL = 2,
  MM_PROCESSMANAGER = 4,
  MM_BROADCASTER = 8,
  MM_OWNSCALLBACK = 16
};

class MessageManagerCallback
{
public:
  virtual ~MessageManagerCallback() {}

  virtual bool DoLoadMessageManagerScript(const nsAString& aURL, bool aRunInGlobalScope)
  {
  }

  virtual bool CheckAppHasPermission(const nsAString& aPermission)
  {
    return false;
  }

  virtual bool CheckAppHasStatus(unsigned short aStatus)
  {
    return false;
  }

  virtual bool KillChild()
  {
    // By default, does nothing.
    return false;
  }

protected:
  bool BuildClonedMessageDataForParent(nsIContentParent* aParent,
                                       const StructuredCloneData& aData,
                                       ClonedMessageData& aClonedData);
  bool BuildClonedMessageDataForChild(nsIContentChild* aChild,
                                      const StructuredCloneData& aData,
                                      ClonedMessageData& aClonedData);
};

;
;

} // namespace ipc
} // namespace dom
} // namespace mozilla

class nsAXPCNativeCallContext;

struct nsMessageListenerInfo
{
  

  // Exactly one of mStrongListener and mWeakListener must be non-null.
  nsCOMPtr<nsIMessageListener> mStrongListener;
  nsWeakPtr mWeakListener;
};


class MOZ_STACK_CLASS SameProcessCpowHolder : public mozilla::jsipc::CpowHolder
{
public:
  

  virtual bool ToObject(JSContext* aCx, JS::MutableHandle<JSObject*> aObjp)
    MOZ_OVERRIDE;

private:
  JS::Rooted<JSObject*> mObj;
};

class nsFrameMessageManager MOZ_FINAL : public nsIContentFrameMessageManager,
                                        public nsIMessageBroadcaster,
                                        public nsIFrameScriptLoader,
                                        public nsIProcessScriptLoader,
                                        public nsIProcessChecker
{
  friend class mozilla::dom::MessageManagerReporter;
  typedef mozilla::dom::StructuredCloneData StructuredCloneData;
public:
  static nsFrameMessageManager* sChildProcessManager;
  enum ProcessCheckerType {
    PROCESS_CHECKER_PERMISSION,
    PROCESS_CHECKER_MANIFEST_URL,
    ASSERT_APP_HAS_PERMISSION
  };
  ;
};

/* A helper class for taking care of many details for async message sending
   within a single process.  Intended to be used like so:

   class MyAsyncMessage : public nsSameProcessAsyncMessageBase, public nsRunnable
   {
     // Initialize nsSameProcessAsyncMessageBase...

     NS_IMETHOD Run() {
       ReceiveMessage(..., ...);
       return NS_OK;
     }
   };
 */
class nsSameProcessAsyncMessageBase
{
  typedef mozilla::dom::StructuredCloneClosure StructuredCloneClosure;

public:
  typedef mozilla::dom::StructuredCloneData StructuredCloneData;

  ;

  ;

private:
  ;

  JSRuntime* mRuntime;
  nsString mMessage;
  JSAutoStructuredCloneBuffer mData;
  StructuredCloneClosure mClosure;
  JS::PersistentRooted<JSObject*> mCpows;
  nsCOMPtr<nsIPrincipal> mPrincipal;
};

class nsScriptCacheCleaner;

struct nsMessageManagerScriptHolder
{
  

  

  

  JS::PersistentRooted<JSScript*> mScript;
  bool mRunInGlobalScope;
};

class nsMessageManagerScriptExecutor
{
public:
  static void Shutdown();
  

  static nsScriptCacheCleaner* sScriptCacheCleaner;
};

class nsScriptCacheCleaner MOZ_FINAL : public nsIObserver
{
  

  NS_DECL_ISUPPORTS

  

  NS_IMETHODIMP Observe(nsISupports *aSubject,
                        const char *aTopic,
                        const char16_t *aData) MOZ_OVERRIDE
  {
    nsMessageManagerScriptExecutor::Shutdown();
    return NS_OK;
  }
};

#endif
# 451 "/Users/luser/build/mozilla-central/dom/base/nsFrameMessageManager.h"
# 22 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Element.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 24 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStubMutationObserver.h"
#endif /* expanded by -frewrite-includes */
# 25 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h"
#if 0 /* expanded by -frewrite-includes */
#include "Units.h"
#endif /* expanded by -frewrite-includes */
# 26 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h"

class nsIURI;
class nsSubDocumentFrame;
class nsView;
class nsIInProcessContentFrameMessageManager;
class AutoResetInShow;
class nsITabParent;
class nsIDocShellTreeItem;
class nsIDocShellTreeOwner;
class mozIApplication;

namespace mozilla {
namespace dom {
class ContentParent;
class PBrowserParent;
class TabParent;
struct StructuredCloneData;
}

namespace layout {
class RenderFrameParent;
}
}

#if defined(MOZ_WIDGET_GTK)
typedef struct _GtkWidget GtkWidget;
#endif
# 53 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h"
#ifdef MOZ_WIDGET_QT
class QX11EmbedContainer;
#endif
# 56 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h"

class nsFrameLoader MOZ_FINAL : public nsIFrameLoader,
                                public nsStubMutationObserver,
                                public mozilla::dom::ipc::MessageManagerCallback
{
  friend class AutoResetInShow;
  typedef mozilla::dom::PBrowserParent PBrowserParent;
  typedef mozilla::dom::TabParent TabParent;
  typedef mozilla::layout::RenderFrameParent RenderFrameParent;

  // Properly retrieves documentSize of any subdocument type.
  ;

  // Updates the subdocument position and size. This gets called only
  // when we have our own in-process DocShell.
  ;
  ;
  ;
  nsresult ReallyStartLoadingInternal();

  // Return true if remote browser created; nothing else to do
  bool TryRemoteBrowser();

  // Tell the remote browser that it's now "virtually visible"
  bool ShowRemoteFrame(const mozilla::ScreenIntSize& size,
                       nsSubDocumentFrame *aFrame = nullptr);

  bool AddTreeItemToTreeOwner(nsIDocShellTreeItem* aItem,
                              nsIDocShellTreeOwner* aOwner,
                              int32_t aParentType,
                              nsIDocShell* aParentNode);

  nsIAtom* TypeAttrName() const {
    return mOwnerContent->IsXULElement()
             ? nsGkAtoms::type : nsGkAtoms::mozframetype;
  }

  // Update the permission manager's app-id refcount based on mOwnerContent's
  // own-or-containing-app.
  void ResetPermissionManagerStatus();

  void InitializeBrowserAPI();

  nsCOMPtr<nsIDocShell> mDocShell;
  nsCOMPtr<nsIURI> mURIToLoad;
  mozilla::dom::Element* mOwnerContent; // WEAK

  // Note: this variable must be modified only by ResetPermissionManagerStatus()
  uint32_t mAppIdSentToPermissionManager;

public:
  // public because a callback needs these.
  nsRefPtr<nsFrameMessageManager> mMessageManager;
  nsCOMPtr<nsIInProcessContentFrameMessageManager> mChildMessageManager;
private:
  // Stores the root view of the subdocument while the subdocument is being
  // reframed. Used to restore the presentation after reframing.
  nsView* mDetachedSubdocViews;
  // Stores the containing document of the frame corresponding to this
  // strong ref in bug 545237, and we're not sure if we can get rid of it.
  nsRefPtr<mozilla::dom::nsIContentParent> mContentParent;
  RenderFrameParent* mCurrentRemoteFrame;
  TabParent* mRemoteBrowser;
  uint64_t mChildID;

  // See nsIFrameLoader.idl. EVENT_MODE_NORMAL_DISPATCH automatically
  // forwards some input events to out-of-process content.
  uint32_t mEventMode;
};

#endif
# 377 "/Users/luser/build/mozilla-central/dom/base/nsFrameLoader.h"
# 36 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMRect.h"
#endif /* expanded by -frewrite-includes */
# 37 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ElementInlines.h"
#endif /* expanded by -frewrite-includes */
# 38 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"

class nsIDocument;
class nsString;
class nsIDocShell;
class nsXULPrototypeDocument;

class nsIObjectInputStream;
class nsIObjectOutputStream;
class nsIOffThreadScriptReceiver;
class nsXULPrototypeNode;
typedef nsTArray<nsRefPtr<nsXULPrototypeNode> > nsPrototypeArray;

namespace mozilla {
class EventChainPreVisitor;
class EventListenerManager;
namespace css {
class StyleRule;
}
namespace dom {
class BoxObject;
}
}

namespace JS {
class SourceBufferHolder;
}

////////////////////////////////////////////////////////////////////////

#ifdef XUL_PROTOTYPE_ATTRIBUTE_METERING
#define XUL_PROTOTYPE_ATTRIBUTE_METER(counter) (nsXULPrototypeAttribute::counter++)
#else
# 70 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
#define XUL_PROTOTYPE_ATTRIBUTE_METER(counter) ((void) 0)
#endif
# 72 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"


/**

  A prototype attribute for an nsXULPrototypeElement.

 */

class nsXULPrototypeAttribute
{
public:
    nsXULPrototypeAttribute()
        : mName(nsGkAtoms::id)  // XXX this is a hack, but names have to have a value
    {
        XUL_PROTOTYPE_ATTRIBUTE_METER(gNumAttributes);
        MOZ_COUNT_CTOR(nsXULPrototypeAttribute);
    }

    ~nsXULPrototypeAttribute();

    nsAttrName mName;
    nsAttrValue mValue;

#ifdef XUL_PROTOTYPE_ATTRIBUTE_METERING
    static uint32_t   gNumElements;
    static uint32_t   gNumAttributes;
    static uint32_t   gNumCacheTests;
    static uint32_t   gNumCacheHits;
    static uint32_t   gNumCacheSets;
    static uint32_t   gNumCacheFills;
#endif /* !XUL_PROTOTYPE_ATTRIBUTE_METERING */
# 103 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
};


/**

  A prototype content model element that holds the "primordial" values
  that have been parsed from the original XUL document.

 */

class nsXULPrototypeNode
{
public:
    enum Type { eType_Element, eType_Script, eType_Text, eType_PI };

    Type                     mType;

    virtual nsresult Serialize(nsIObjectOutputStream* aStream,
                               nsXULPrototypeDocument* aProtoDoc,
                               const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) = 0;
    virtual nsresult Deserialize(nsIObjectInputStream* aStream,
                                 nsXULPrototypeDocument* aProtoDoc,
                                 nsIURI* aDocumentURI,
                                 const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) = 0;

#ifdef NS_BUILD_REFCNT_LOGGING
    virtual const char* ClassName() = 0;
    virtual uint32_t ClassSize() = 0;
#endif
# 132 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"

    /**
     * The prototype document must call ReleaseSubtree when it is going
     * away.  This makes the parents through the tree stop owning their
     * children, whether or not the parent's reference count is zero.
     * Individual elements may still own individual prototypes, but
     * those prototypes no longer remember their children to allow them
     * to be constructed.
     */
    virtual void ReleaseSubtree() { }

    NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsXULPrototypeNode)
    NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsXULPrototypeNode)

protected:
    explicit nsXULPrototypeNode(Type aType)
        : mType(aType) {}
    virtual ~nsXULPrototypeNode() {}
};

class nsXULPrototypeElement : public nsXULPrototypeNode
{

    nsRefPtr<mozilla::dom::NodeInfo> mNodeInfo;

    uint32_t                 mNumAttributes:29;
    uint32_t                 mHasIdAttribute:1;
    uint32_t                 mHasClassAttribute:1;
    uint32_t                 mHasStyleAttribute:1;
    nsXULPrototypeAttribute* mAttributes;         // [OWNER]
};

namespace mozilla {
namespace dom {
class XULDocument;
} // namespace dom
} // namespace mozilla

class nsXULPrototypeScript : public nsXULPrototypeNode
{
public:
    ;
    ;

#ifdef NS_BUILD_REFCNT_LOGGING
    virtual const char* ClassName() MOZ_OVERRIDE { return "nsXULPrototypeScript"; }
    virtual uint32_t ClassSize() MOZ_OVERRIDE { return sizeof(*this); }
#endif
# 227 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
    bool                     mSrcLoading;
    bool                     mOutOfLine;
    mozilla::dom::XULDocument* mSrcLoadWaiters;   // [OWNER] but not COMPtr
    uint32_t                 mLangVersion;
private:
    virtual nsresult Serialize(nsIObjectOutputStream* aStream,
                               nsXULPrototypeDocument* aProtoDoc,
                               const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) MOZ_OVERRIDE;
    virtual nsresult Deserialize(nsIObjectInputStream* aStream,
                                 nsXULPrototypeDocument* aProtoDoc,
                                 nsIURI* aDocumentURI,
                                 const nsTArray<nsRefPtr<mozilla::dom::NodeInfo>> *aNodeInfos) MOZ_OVERRIDE;

    nsString                 mValue;
};

class nsXULPrototypePI : public nsXULPrototypeNode
{
public:
    

    nsString                 mTarget;
    nsString                 mData;
};

////////////////////////////////////////////////////////////////////////

/**

  The XUL element.

 */

#define XUL_ELEMENT_FLAG_BIT(n_) NODE_FLAG_BIT(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + (n_))

// XUL element specific bits
enum {
  XUL_ELEMENT_TEMPLATE_GENERATED =        XUL_ELEMENT_FLAG_BIT(0),
  XUL_ELEMENT_HAS_CONTENTMENU_LISTENER =  XUL_ELEMENT_FLAG_BIT(1),
  XUL_ELEMENT_HAS_POPUP_LISTENER =        XUL_ELEMENT_FLAG_BIT(2)
};

ASSERT_NODE_FLAGS_SPACE(ELEMENT_TYPE_SPECIFIC_BITS_OFFSET + 3);

#undef XUL_ELEMENT_FLAG_BIT

class nsScriptEventHandlerOwnerTearoff;

class nsXULElement MOZ_FINAL : public nsStyledElement,
                               public nsIDOMXULElement
{
public:
    ;

    ;

    NS_IMPL_FROMCONTENT(nsXULElement, kNameSpaceID_XUL)

    // nsISupports
    NS_DECL_ISUPPORTS_INHERITED
    NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsXULElement, nsStyledElement)

    // nsINode
    virtual nsresult PreHandleEvent(
                       mozilla::EventChainPreVisitor& aVisitor) MOZ_OVERRIDE;

    // nsIContent
    virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                                nsIContent* aBindingParent,
                                bool aCompileEventHandlers) MOZ_OVERRIDE;
    virtual void UnbindFromTree(bool aDeep, bool aNullParent) MOZ_OVERRIDE;
    virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) MOZ_OVERRIDE;
    virtual void DestroyContent() MOZ_OVERRIDE;

#ifdef DEBUG
    virtual void List(FILE* out, int32_t aIndent) const MOZ_OVERRIDE;
    virtual void DumpContent(FILE* out, int32_t aIndent,bool aDumpAll) const MOZ_OVERRIDE
    {
    }
#endif
# 404 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"

    virtual void PerformAccesskey(bool aKeyCausesActivation,
                                  bool aIsTrustedEvent) MOZ_OVERRIDE;
    ;
    
    

    // nsIDOMNode
    NS_FORWARD_NSIDOMNODE_TO_NSINODE
    // And since that shadowed GetParentElement with the XPCOM
    // signature, pull in the one we care about.
    using nsStyledElement::GetParentElement;

    // nsIDOMElement
    NS_FORWARD_NSIDOMELEMENT_TO_GENERIC

    // nsIDOMXULElement
    NS_DECL_NSIDOMXULELEMENT

    virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;

    /**
     * The nearest enclosing content node with a binding
     * that created us. [Weak]
     */
    nsIContent*                         mBindingParent;

    /**
     * Abandon our prototype linkage, and copy all attributes locally
     */
    ;

    virtual nsresult BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
                                   const nsAttrValueOrString* aValue,
                                   bool aNotify) MOZ_OVERRIDE;
    virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsIAtom* aName,
                                  const nsAttrValue* aValue, bool aNotify) MOZ_OVERRIDE;

    virtual void UpdateEditableState(bool aNotify) MOZ_OVERRIDE;

    // appropriate value.
    nsIControllers *Controllers() {
      nsDOMSlots* slots = GetExistingDOMSlots();
      return slots ? slots->mControllers : nullptr; 
    }

    void UnregisterAccessKey(const nsAString& aOldValue);
    bool BoolAttrIsTrue(nsIAtom* aName) const;

    friend nsresult
    NS_NewXULElement(mozilla::dom::Element** aResult, mozilla::dom::NodeInfo *aNodeInfo);
    friend void
    NS_TrustedNewXULElement(nsIContent** aResult, mozilla::dom::NodeInfo *aNodeInfo);

    static already_AddRefed<nsXULElement>
    Create(nsXULPrototypeElement* aPrototype, mozilla::dom::NodeInfo *aNodeInfo,
           bool aIsScriptable, bool aIsRoot);

    bool IsReadWriteTextElement() const
    {
        return IsAnyOfXULElements(nsGkAtoms::textbox, nsGkAtoms::textarea) &&
               !HasAttr(kNameSpaceID_None, nsGkAtoms::readonly);
    }

    virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;

    void MaybeUpdatePrivateLifetime();
};

#endif // nsXULElement_h__
# 732 "/Users/luser/build/mozilla-central/dom/xul/nsXULElement.h"
# 10 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2

#if 0 /* expanded by -frewrite-includes */
#include "nsIServiceManager.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "nsMathUtils.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "SVGImageContext.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/SVGImageContext.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_SVGCONTEXT_H_
#define MOZILLA_SVGCONTEXT_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Maybe.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/SVGImageContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "SVGPreserveAspectRatio.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/SVGPreserveAspectRatio.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_CONTENT_SVGPRESERVEASPECTRATIO_H_
#define MOZILLA_CONTENT_SVGPRESERVEASPECTRATIO_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/HashFunctions.h"  // for HashGeneric
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/SVGPreserveAspectRatio.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsSVGElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __NS_SVGELEMENT_H__
#define __NS_SVGELEMENT_H__

/*
  nsSVGElement is the base class for all SVG content elements.
  It implements all the common DOM interfaces and handles attributes.
*/

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsSVGElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/css/StyleRule.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/css/StyleRule.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * representation of CSS style rules (selectors+declaration) and CSS
 * selectors
 */

#ifndef mozilla_css_StyleRule_h__
#define mozilla_css_StyleRule_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/css/StyleRule.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/css/StyleRule.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/css/Rule.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/css/Rule.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* base class for all rule types in a CSS style sheet */

#ifndef mozilla_css_Rule_h___
#define mozilla_css_Rule_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CSSStyleSheet.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/CSSStyleSheet.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// vim:cindent:tabstop=2:expandtab:shiftwidth=2:
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* representation of a CSS style sheet */

#ifndef mozilla_CSSStyleSheet_h
#define mozilla_CSSStyleSheet_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/CSSStyleSheet.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/CSSStyleSheet.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Element.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/CSSStyleSheet.h"

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/CSSStyleSheet.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/CSSStyleSheet.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/CSSStyleSheet.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIStyleSheet.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsIStyleSheet.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * interface representing a collection of style data attached to a
 * document, which may be or be combined into a style rule processor
 */

#ifndef nsIStyleSheet_h___
#define nsIStyleSheet_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/layout/style/nsIStyleSheet.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/layout/style/nsIStyleSheet.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/layout/style/nsIStyleSheet.h"

class nsString;
class nsIURI;
class nsIDocument;

// IID for the nsIStyleSheet interface
// 3eb34a60-04bd-41d9-9f60-882694e61c38
#define NS_ISTYLE_SHEET_IID     \
{ 0x3eb34a60, 0x04bd, 0x41d9,   \
 { 0x9f, 0x60, 0x88, 0x26, 0x94, 0xe6, 0x1c, 0x38 } }

/**
 * A style sheet is a thing associated with a document that has style
 * rules.  Those style rules can be reached in one of two ways, depending
 * on which level of the nsStyleSet it is in:
 *   1) It can be |QueryInterface|d to nsIStyleRuleProcessor
 *   2) It can be |QueryInterface|d to CSSStyleSheet, with which the
 *      |nsStyleSet| uses an |nsCSSRuleProcessor| to access the rules.
 */
class nsIStyleSheet : public nsISupports {
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTYLE_SHEET_IID)

  // basic style sheet data
  virtual nsIURI* GetSheetURI() const = 0;
  virtual nsIURI* GetBaseURI() const = 0;
  virtual void GetTitle(nsString& aTitle) const = 0;
  virtual void GetType(nsString& aType) const = 0;
  virtual bool HasRules() const = 0;

  /**
   * Whether the sheet is applicable.  A sheet that is not applicable
   * should never be inserted into a style set.  A sheet may not be

  /**
   * Whether the sheet is complete.
   */
  virtual bool IsComplete() const = 0;
  virtual void SetComplete() = 0;

  // style sheet owner info
  virtual nsIStyleSheet* GetParentSheet() const = 0;  // may be null
  virtual nsIDocument* GetOwningDocument() const = 0; // may be null
  virtual void SetOwningDocument(nsIDocument* aDocument) = 0;

#ifdef DEBUG
  virtual void List(FILE* out = stdout, int32_t aIndent = 0) const = 0;
#endif
# 81 "/Users/luser/build/mozilla-central/layout/style/nsIStyleSheet.h"

  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIStyleSheet, NS_ISTYLE_SHEET_IID)

#endif /* nsIStyleSheet_h___ */
# 88 "/Users/luser/build/mozilla-central/layout/style/nsIStyleSheet.h"
# 20 "../../dist/include/mozilla/CSSStyleSheet.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMCSSStyleSheet.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMCSSStyleSheet.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMCSSStyleSheet.idl
 */

#ifndef __gen_nsIDOMCSSStyleSheet_h__
#define __gen_nsIDOMCSSStyleSheet_h__


#ifndef __gen_nsIDOMStyleSheet_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMStyleSheet.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMStyleSheet.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMStyleSheet.idl
 */

#ifndef __gen_nsIDOMStyleSheet_h__
#define __gen_nsIDOMStyleSheet_h__
/* starting interface:    nsIDOMStyleSheet */
#define NS_IDOMSTYLESHEET_IID_STR "a6cf9080-15b3-11d2-932e-00805f8add32"

#define NS_IDOMSTYLESHEET_IID \
  {0xa6cf9080, 0x15b3, 0x11d2, \
    { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }}

class NS_NO_VTABLE nsIDOMStyleSheet : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMSTYLESHEET_IID)

  /* readonly attribute DOMString type; */
  NS_IMETHOD GetType(nsAString & aType) = 0;

  /* attribute boolean disabled; */
  NS_IMETHOD GetMedia(nsIDOMMediaList * *aMedia) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMStyleSheet, NS_IDOMSTYLESHEET_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMSTYLESHEET \
  NS_IMETHOD GetType(nsAString & aType) MOZ_OVERRIDE; \
  NS_IMETHOD GetDisabled(bool *aDisabled) MOZ_OVERRIDE; \
  NS_IMETHOD SetDisabled(bool aDisabled) MOZ_OVERRIDE; \
  NS_IMETHOD GetOwnerNode(nsIDOMNode * *aOwnerNode) MOZ_OVERRIDE; \
  NS_IMETHOD GetParentStyleSheet(nsIDOMStyleSheet * *aParentStyleSheet) MOZ_OVERRIDE; \
  NS_IMETHOD GetHref(nsAString & aHref) MOZ_OVERRIDE; \
  NS_IMETHOD GetTitle(nsAString & aTitle) MOZ_OVERRIDE; \
  NS_IMETHOD GetMedia(nsIDOMMediaList * *aMedia) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMSTYLESHEET(_to) \
  NS_IMETHOD GetType(nsAString & aType) MOZ_OVERRIDE { return _to GetType(aType); } \
  NS_IMETHOD GetDisabled(bool *aDisabled) MOZ_OVERRIDE { return _to GetDisabled(aDisabled); } \
  NS_IMETHOD SetDisabled(bool aDisabled) MOZ_OVERRIDE { return _to SetDisabled(aDisabled); } \
  NS_IMETHOD GetOwnerNode(nsIDOMNode * *aOwnerNode) MOZ_OVERRIDE { return _to GetOwnerNode(aOwnerNode); } \
  NS_IMETHOD GetParentStyleSheet(nsIDOMStyleSheet * *aParentStyleSheet) MOZ_OVERRIDE { return _to GetParentStyleSheet(aParentStyleSheet); } \
  NS_IMETHOD GetHref(nsAString & aHref) MOZ_OVERRIDE { return _to GetHref(aHref); } \
  NS_IMETHOD GetTitle(nsAString & aTitle) MOZ_OVERRIDE { return _to GetTitle(aTitle); } \
  NS_IMETHOD GetMedia(nsIDOMMediaList * *aMedia) MOZ_OVERRIDE { return _to GetMedia(aMedia); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMSTYLESHEET(_to) \
  NS_IMETHOD GetType(nsAString & aType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
  NS_IMETHOD GetDisabled(bool *aDisabled) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDisabled(aDisabled); } \
  NS_IMETHOD SetDisabled(bool aDisabled) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDisabled(aDisabled); } \
  NS_IMETHOD GetOwnerNode(nsIDOMNode * *aOwnerNode) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnerNode(aOwnerNode); } \
  NS_IMETHOD GetParentStyleSheet(nsIDOMStyleSheet * *aParentStyleSheet) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParentStyleSheet(aParentStyleSheet); } \
  NS_IMETHOD GetHref(nsAString & aHref) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHref(aHref); } \
  NS_IMETHOD GetTitle(nsAString & aTitle) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTitle(aTitle); } \
  NS_IMETHOD GetMedia(nsIDOMMediaList * *aMedia) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMedia(aMedia); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMStyleSheet : public nsIDOMStyleSheet
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMSTYLESHEET
/* readonly attribute nsIDOMMediaList media; */
NS_IMETHODIMP nsDOMStyleSheet::GetMedia(nsIDOMMediaList * *aMedia)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 169 "../../dist/include/nsIDOMStyleSheet.h"


#endif /* __gen_nsIDOMStyleSheet_h__ */
# 172 "../../dist/include/nsIDOMStyleSheet.h"
# 11 "../../dist/include/nsIDOMCSSStyleSheet.h" 2
#endif
# 12 "../../dist/include/nsIDOMCSSStyleSheet.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMCSSStyleSheet.h"

/* starting interface:    nsIDOMCSSStyleSheet */
#define NS_IDOMCSSSTYLESHEET_IID_STR "a6cf90c2-15b3-11d2-932e-00805f8add32"

#define NS_IDOMCSSSTYLESHEET_IID \
  {0xa6cf90c2, 0x15b3, 0x11d2, \
    { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }}

class NS_NO_VTABLE nsIDOMCSSStyleSheet : public nsIDOMStyleSheet {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMCSSSTYLESHEET_IID)

  /* readonly attribute nsIDOMCSSRule ownerRule; */
  NS_IMETHOD GetOwnerRule(nsIDOMCSSRule * *aOwnerRule) = 0;

  /* readonly attribute nsIDOMCSSRuleList cssRules; */
  NS_IMETHOD GetCssRules(nsIDOMCSSRuleList * *aCssRules) = 0;

  /* unsigned long insertRule (in DOMString rule, in unsigned long index) raises (DOMException); */
  NS_IMETHOD InsertRule(const nsAString & rule, uint32_t index, uint32_t *_retval) = 0;

  /* void deleteRule (in unsigned long index) raises (DOMException); */
  NS_IMETHOD DeleteRule(uint32_t index) = 0;

};

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMCSSSTYLESHEET(_to) \
  NS_IMETHOD GetOwnerRule(nsIDOMCSSRule * *aOwnerRule) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnerRule(aOwnerRule); } \
  NS_IMETHOD GetCssRules(nsIDOMCSSRuleList * *aCssRules) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCssRules(aCssRules); } \
  NS_IMETHOD InsertRule(const nsAString & rule, uint32_t index, uint32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->InsertRule(rule, index, _retval); } \
  NS_IMETHOD DeleteRule(uint32_t index) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->DeleteRule(index); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMCSSStyleSheet : public nsIDOMCSSStyleSheet
{
public:
  NS_DECL_ISUPPORTS

/* End of implementation class template. */
#endif
# 125 "../../dist/include/nsIDOMCSSStyleSheet.h"


#endif /* __gen_nsIDOMCSSStyleSheet_h__ */
# 128 "../../dist/include/nsIDOMCSSStyleSheet.h"
# 21 "../../dist/include/mozilla/CSSStyleSheet.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsICSSLoaderObserver.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsICSSLoaderObserver.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* internal interface for observing CSS style sheet loads */

#ifndef nsICSSLoaderObserver_h___
#define nsICSSLoaderObserver_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/layout/style/nsICSSLoaderObserver.h"

#define NS_ICSSLOADEROBSERVER_IID     \
{ 0x7eb90c74, 0xea0c, 0x4df5,       \
{0xa1, 0x5f, 0x95, 0xf0, 0x6a, 0x98, 0xb9, 0x40} }

namespace mozilla {
class CSSStyleSheet;
} // namespace mozilla

class nsICSSLoaderObserver : public nsISupports {
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSLOADEROBSERVER_IID)

  /**
   * StyleSheetLoaded is called after aSheet is marked complete and before any
   * load events associated with aSheet are fired.
   * @param aSheet the sheet that was loaded. Guaranteed to always be
   *        non-null, even if aStatus indicates failure.
   * @param aWasAlternate whether the sheet was an alternate.  This will always
   *        match the value LoadStyleLink or LoadInlineStyle returned in
   *        aIsAlternate if one of those methods were used to load the sheet,
   *        and will always be false otherwise.
   * @param aStatus is a success code if the sheet loaded successfully and a
   *        failure code otherwise.  Note that successful load of aSheet
   *        doesn't indicate anything about whether the data actually parsed
   *        as CSS, and doesn't indicate anything about the status of any child
   *        sheets of aSheet.
   */
  NS_IMETHOD StyleSheetLoaded(mozilla::CSSStyleSheet* aSheet,
                              bool aWasAlternate,
                              nsresult aStatus) = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSLoaderObserver, NS_ICSSLOADEROBSERVER_IID)

#endif // nsICSSLoaderObserver_h___
# 48 "/Users/luser/build/mozilla-central/layout/style/nsICSSLoaderObserver.h"
# 26 "../../dist/include/mozilla/CSSStyleSheet.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/mozilla/CSSStyleSheet.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/mozilla/CSSStyleSheet.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/net/ReferrerPolicy.h"
#endif /* expanded by -frewrite-includes */
# 29 "../../dist/include/mozilla/CSSStyleSheet.h"

class CSSRuleListImpl;
class nsCSSRuleProcessor;
class nsICSSRuleList;
class nsIPrincipal;
class nsIURI;
class nsMediaList;
class nsMediaQueryResultCacheKey;
class nsPresContext;
class nsXMLNameSpaceMap;

namespace mozilla {
struct ChildSheetListBuilder;
class CSSStyleSheet;

namespace css {
class Rule;
class GroupRule;
class ImportRule;
}
namespace dom {
class CSSRuleList;
}

// -------------------------------
// CSS Style Sheet Inner Data Container
//

class CSSStyleSheetInner
{
public:
  friend class mozilla::CSSStyleSheet;
  friend class ::nsCSSRuleProcessor;
  typedef net::ReferrerPolicy ReferrerPolicy;

  CORSMode               mCORSMode;
  // The Referrer Policy of a stylesheet is used for its child sheets, so it is
  // stored here.
  ReferrerPolicy         mReferrerPolicy;
  bool                   mComplete;

#ifdef DEBUG
  bool                   mPrincipalSet;
#endif
# 105 "../../dist/include/mozilla/CSSStyleSheet.h"
};


// -------------------------------
// CSS Style Sheet
//

// CID for the CSSStyleSheet class
// ca926f30-2a7e-477e-8467-803fb32af20a
#define NS_CSS_STYLE_SHEET_IMPL_CID     \
{ 0xca926f30, 0x2a7e, 0x477e, \
 { 0x84, 0x67, 0x80, 0x3f, 0xb3, 0x2a, 0xf2, 0x0a } }


class CSSStyleSheet MOZ_FINAL : public nsIStyleSheet,
                                public nsIDOMCSSStyleSheet,
                                public nsICSSLoaderObserver,
                                public nsWrapperCache
{
public:
  typedef net::ReferrerPolicy ReferrerPolicy;
  ;

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(CSSStyleSheet,
                                                         nsIStyleSheet)

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_CSS_STYLE_SHEET_IMPL_CID)

  // nsIStyleSheet interface
  virtual nsIURI* GetSheetURI() const MOZ_OVERRIDE;
  virtual nsIURI* GetBaseURI() const MOZ_OVERRIDE;
  virtual void GetTitle(nsString& aTitle) const MOZ_OVERRIDE;
  virtual void GetType(nsString& aType) const MOZ_OVERRIDE;
  ;

  /**
   * SetURIs must be called on all sheets before parsing into them.
   * SetURIs may only be called while the sheet is 1) incomplete and 2)
   * has no rules in it
   */
  ;

  /**
   * SetPrincipal should be called on all sheets before parsing into them.
   * This can only be called once with a non-null principal.  Calling this with
   * a null pointer is allowed and is treated as a no-op.
   */
  ;

  // Principal() never returns a null pointer.
  

  // The document this style sheet is associated with.  May be null
  nsIDocument* GetDocument() const { return mDocument; }

  
  ;
  

  
  

  

  ;

  

  

  enum EnsureUniqueInnerResult {
    // No work was needed to ensure a unique inner.
    eUniqueInner_AlreadyUnique,
    // A clone was done to ensure a unique inner (which means the style
    // rules in this sheet have changed).
    eUniqueInner_ClonedInner
  };
  ;

  
  // Our XPCOM GetHref is fine for WebIDL
  
  
  // Our nsIStyleSheet::GetTitle is a const method, so it ends up
  // ambiguous with with the XPCOM version.  Just disambiguate.
  
  ;
  nsRefPtr<CSSRuleListImpl> mRuleCollection;
  nsIDocument*          mDocument; // weak ref; parents maintain this for their children
  nsINode*              mOwningNode; // weak ref
  bool                  mDisabled;
  bool                  mDirty; // has been modified 
  nsRefPtr<dom::Element> mScopeElement;

  CSSStyleSheetInner*   mInner;

  nsAutoTArray<nsCSSRuleProcessor*, 8>* mRuleProcessors;

  friend class ::nsMediaList;
  friend class ::nsCSSRuleProcessor;
  friend struct mozilla::ChildSheetListBuilder;
};

NS_DEFINE_STATIC_IID_ACCESSOR(CSSStyleSheet, NS_CSS_STYLE_SHEET_IMPL_CID)

} // namespace mozilla

#endif /* !defined(mozilla_CSSStyleSheet_h) */
# 381 "../../dist/include/mozilla/CSSStyleSheet.h"
# 12 "../../dist/include/mozilla/css/Rule.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/css/Rule.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIStyleRule.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsIStyleRule.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * internal abstract interface for objects providing immutable style
 * information
 */

#ifndef nsIStyleRule_h___
#define nsIStyleRule_h___

#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/layout/style/nsIStyleRule.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/layout/style/nsIStyleRule.h"

struct nsRuleData;

// IID for the nsIStyleRule interface {f75f3f70-435d-43a6-a01b-65970489ca26}
#define NS_ISTYLE_RULE_IID     \
{ 0xf75f3f70, 0x435d, 0x43a6, \
 { 0xa0, 0x1b, 0x65, 0x97, 0x04, 0x89, 0xca, 0x26 } }

/**
 * |nsIStyleRule::MapRuleInfoInto| below.
 *
 * It is worth emphasizing that the data represented by a rule
 * implementation are immutable.  When the data need to be changed, a
 * new rule object must be created.  Failing to do this will lead to
 * bugs in the handling of dynamic style changes, since the rule tree
 * caches the results of |MapRuleInfoInto|.
 *
 * |nsIStyleRule| objects are owned by |nsRuleNode| objects (in addition
 * to typically being owned by their sheet), which are in turn garbage
 * collected (with the garbage collection roots being style contexts).
 */


class nsIStyleRule : public nsISupports {
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTYLE_RULE_IID)

  /**
   * |nsIStyleRule::MapRuleInfoInto| is a request to copy all stylistic
   * data represented by the rule that:
   *   + are relevant for any structs in |aRuleData->mSIDs| (style
   *     struct ID bits)
   *   + are not already filled into the data struct
   * into the appropriate data struct in |aRuleData|.  It is important
   * that only empty data are filled in, since the rule tree is walked
   * from highest priority rule to least, so that the walk can stop if
   * all needed data are found.  Thus overwriting non-empty data will
   * break CSS cascading rules.
   */
  virtual void MapRuleInfoInto(nsRuleData* aRuleData)=0;

#ifdef DEBUG
  virtual void List(FILE* out = stdout, int32_t aIndent = 0) const = 0;
#endif
# 77 "/Users/luser/build/mozilla-central/layout/style/nsIStyleRule.h"
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIStyleRule, NS_ISTYLE_RULE_IID)

#endif /* nsIStyleRule_h___ */
# 82 "/Users/luser/build/mozilla-central/layout/style/nsIStyleRule.h"
# 14 "../../dist/include/mozilla/css/Rule.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMCSSRule.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMCSSRule.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMCSSRule.idl
 */

#ifndef __gen_nsIDOMCSSRule_h__
#define __gen_nsIDOMCSSRule_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMCSSRule.h"
#endif
# 12 "../../dist/include/nsIDOMCSSRule.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMCSSRule.h"
namespace mozilla {
namespace css {
class Rule;
}
}

/* starting interface:    nsIDOMCSSRule */
#define NS_IDOMCSSRULE_IID_STR "4d6b3bad-f53c-4585-82f6-62982e27ede8"

#define NS_IDOMCSSRULE_IID \
  {0x4d6b3bad, 0xf53c, 0x4585, \
    { 0x82, 0xf6, 0x62, 0x98, 0x2e, 0x27, 0xed, 0xe8 }}

class NS_NO_VTABLE nsIDOMCSSRule : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMCSSRULE_IID)

  enum {
    UNKNOWN_RULE = 0U,
    STYLE_RULE = 1U,
    CHARSET_RULE = 2U,
    IMPORT_RULE = 3U,
    MEDIA_RULE = 4U,
    FONT_FACE_RULE = 5U,
    PAGE_RULE = 6U,
    KEYFRAMES_RULE = 7U,
    KEYFRAME_RULE = 8U,
    MOZ_KEYFRAMES_RULE = 7U,
    MOZ_KEYFRAME_RULE = 8U,
    NAMESPACE_RULE = 10U,
    COUNTER_STYLE_RULE = 11U,
    SUPPORTS_RULE = 12U,
    FONT_FEATURE_VALUES_RULE = 14U
  };

  /* readonly attribute unsigned short type; */
  NS_IMETHOD GetType(uint16_t *aType) = 0;

  /* attribute DOMString cssText; */
  NS_IMETHOD GetCssText(nsAString & aCssText) = 0;
  NS_IMETHOD SetCssText(const nsAString & aCssText) = 0;

  /* readonly attribute nsIDOMCSSStyleSheet parentStyleSheet; */
  NS_IMETHOD GetParentStyleSheet(nsIDOMCSSStyleSheet * *aParentStyleSheet) = 0;

  /* readonly attribute nsIDOMCSSRule parentRule; */
  NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule) = 0;

  /* [noscript,nostdcall,notxpcom] Rule getCSSRule (); */
  virtual mozilla::css::Rule * GetCSSRule(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMCSSRule, NS_IDOMCSSRULE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMCSSRULE \
  NS_IMETHOD GetType(uint16_t *aType) MOZ_OVERRIDE; \
  NS_IMETHOD GetCssText(nsAString & aCssText) MOZ_OVERRIDE; \
  NS_IMETHOD GetType(uint16_t *aType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
  NS_IMETHOD GetCssText(nsAString & aCssText) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCssText(aCssText); } \
  NS_IMETHOD SetCssText(const nsAString & aCssText) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCssText(aCssText); } \
  NS_IMETHOD GetParentStyleSheet(nsIDOMCSSStyleSheet * *aParentStyleSheet) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParentStyleSheet(aParentStyleSheet); } \
  NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParentRule(aParentRule); } \
  virtual mozilla::css::Rule * GetCSSRule(void) MOZ_OVERRIDE; 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMCSSRule : public nsIDOMCSSRule
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMCSSRULE
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript,nostdcall,notxpcom] Rule getCSSRule (); */
mozilla::css::Rule * nsDOMCSSRule::GetCSSRule()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 168 "../../dist/include/nsIDOMCSSRule.h"


#endif /* __gen_nsIDOMCSSRule_h__ */
# 171 "../../dist/include/nsIDOMCSSRule.h"
# 15 "../../dist/include/mozilla/css/Rule.h" 2

class nsIStyleSheet;
class nsIDocument;
struct nsRuleData;
template<class T> struct already_AddRefed;
class nsHTMLCSSStyleSheet;

namespace mozilla {
namespace css {
class GroupRule;

#define DECL_STYLE_RULE_INHERIT_NO_DOMRULE  \
virtual void MapRuleInfoInto(nsRuleData* aRuleData) MOZ_OVERRIDE;

#define DECL_STYLE_RULE_INHERIT                            \
  DECL_STYLE_RULE_INHERIT_NO_DOMRULE                       \
  virtual nsIDOMCSSRule* GetDOMRule() MOZ_OVERRIDE;        \
  virtual nsIDOMCSSRule* GetExistingDOMRule() MOZ_OVERRIDE;

class Rule : public nsIStyleRule {
protected:
  Rule(uint32_t aLineNumber, uint32_t aColumnNumber)
    : mSheet(0),
      mParentRule(nullptr),
      mLineNumber(aLineNumber),
      mColumnNumber(aColumnNumber),
      mWasMatched(false)
  {
  }

  // Note that CSSStyleSheet::RebuildChildList assumes that no other kinds of
  // rules can come between two rules of type IMPORT_RULE.
  enum {
    UNKNOWN_RULE = 0,
    CHARSET_RULE,
    IMPORT_RULE,
    NAMESPACE_RULE,
    STYLE_RULE,
    MEDIA_RULE,
    FONT_FACE_RULE,
    PAGE_RULE,
    KEYFRAME_RULE,
    KEYFRAMES_RULE,
    DOCUMENT_RULE,
    SUPPORTS_RULE,
    FONT_FEATURE_VALUES_RULE,
    COUNTER_STYLE_RULE
  };

  virtual int32_t GetType() const = 0;

  CSSStyleSheet* GetStyleSheet() const;
  nsHTMLCSSStyleSheet* GetHTMLCSSStyleSheet() const;

  // Return the document the rule lives in, if any
  nsIDocument* GetDocument() const
  {
    CSSStyleSheet* sheet = GetStyleSheet();
    return sheet ? sheet->GetDocument() : nullptr;
  }

  virtual void SetStyleSheet(CSSStyleSheet* aSheet);
  // This does not need to be virtual, because GroupRule and MediaRule are not
  // used for inline style.
  void SetHTMLCSSStyleSheet(nsHTMLCSSStyleSheet* aSheet);

  void SetParentRule(GroupRule* aRule) {
    // We don't reference count this up reference. The group rule
    // will tell us when it's going away or when we're detached from
    // it.
    mParentRule = aRule;
  }

  uint32_t GetLineNumber() const { return mLineNumber; }
  uint32_t GetColumnNumber() const { return mColumnNumber; }

  /**
   * Clones |this|. Never returns nullptr.
   */
  virtual already_AddRefed<Rule> Clone() const = 0;

  // Note that this returns null for inline style rules since they aren't
  // supposed to have a DOM rule representation (and our code wouldn't work).
  virtual nsIDOMCSSRule* GetDOMRule() = 0;

  // Like GetDOMRule(), but won't create one if we don't have one yet
  virtual nsIDOMCSSRule* GetExistingDOMRule() = 0;

  // to implement methods on nsIDOMCSSRule
  nsresult GetParentRule(nsIDOMCSSRule** aParentRule);
  nsresult GetParentStyleSheet(nsIDOMCSSStyleSheet** aSheet);
  Rule* GetCSSRule();

  // This is pure virtual because all of Rule's data members are non-owning and
  // thus measured elsewhere.
  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
    const MOZ_MUST_OVERRIDE = 0;

  // This is used to measure nsCOMArray<Rule>s.
  static size_t SizeOfCOMArrayElementIncludingThis(css::Rule* aElement,
                                                   mozilla::MallocSizeOf aMallocSizeOf,
                                                   void* aData);

protected:
  // This is either a CSSStyleSheet* or an nsHTMLStyleSheet*.  The former
  // if the low bit is 0, the latter if the low bit is 1.
  uintptr_t         mSheet;
  GroupRule*        mParentRule;

  // Keep the same type so that MSVC packs them.
  uint32_t          mLineNumber;
  uint32_t          mColumnNumber : 31;
  uint32_t          mWasMatched : 1;
};

} // namespace css
} // namespace mozilla

#endif /* mozilla_css_Rule_h___ */
# 150 "../../dist/include/mozilla/css/Rule.h"
# 17 "../../dist/include/mozilla/css/StyleRule.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/css/StyleRule.h"

/* atom list for CSS pseudo-classes */

#ifndef nsCSSPseudoClasses_h___
#define nsCSSPseudoClasses_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsStringFwd.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/layout/style/nsCSSPseudoClasses.h"

// This pseudo-element is accepted only in UA style sheets.
#define CSS_PSEUDO_CLASS_UA_SHEET_ONLY                 (1<<0)

class nsIAtom;

class nsCSSPseudoClasses {
public:

  ;

  enum Type {
#define CSS_PSEUDO_CLASS(_name, _value, _flags, _pref) \
    ePseudoClass_##_name,
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSPseudoClassList.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsCSSPseudoClassList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* atom list for CSS pseudo-classes */

/*
 * This file contains the list of nsIAtoms and their values for CSS
 * pseudo-classes.  It is designed to be used as inline input to
 * nsCSSPseudoClasses.cpp *only* through the magic of C preprocessing.
 * All entries must be enclosed in the macros CSS_PSEUDO_CLASS,
 * CSS_STATE_DEPENDENT_PSEUDO_CLASS, or CSS_STATE_PSEUDO_CLASS which
 * will have cruel and unusual things done to them.  The entries should
 * be kept in some sort of logical order.  The common arguments to these
 * macros are:
 * name_  : The C++ identifier used for the atom (which will be a member
 *          of nsCSSPseudoClasses)
 * value_ : The pseudo-class as a string, including the initial colon,
 *          used as the string value of the atom.
#undef DEFINED_CSS_STATE_DEPENDENT_PSEUDO_CLASS
#undef CSS_STATE_DEPENDENT_PSEUDO_CLASS
#endif
# 237 "/Users/luser/build/mozilla-central/layout/style/nsCSSPseudoClassList.h"
# 27 "/Users/luser/build/mozilla-central/layout/style/nsCSSPseudoClasses.h" 2
#undef CSS_PSEUDO_CLASS
    ePseudoClass_Count,
    ePseudoClass_NotPseudoClass /* This value MUST be last!  SelectorMatches
                                   depends on it. */
  };

  ;
  ;
  ;
  
  ;

  

  // Should only be used on types other than Count and NotPseudoClass
  ;

private:
  static uint32_t FlagsForPseudoClass(const Type aType);

  // Does the given pseudo-class have all of the flags given?
  static bool PseudoClassHasFlags(const Type aType, uint32_t aFlags)
  {
    return (FlagsForPseudoClass(aType) & aFlags) == aFlags;
  }
};

#endif /* nsCSSPseudoClasses_h___ */
# 59 "/Users/luser/build/mozilla-central/layout/style/nsCSSPseudoClasses.h"
# 22 "../../dist/include/mozilla/css/StyleRule.h" 2

class nsIAtom;
struct nsCSSSelectorList;
class nsCSSCompressedDataBlock;

namespace mozilla {
class CSSStyleSheet;
} // namespace mozilla

struct nsAtomList {
public:
  explicit nsAtomList(nsIAtom* aAtom);
  explicit nsAtomList(const nsString& aAtomValue);
  ~nsAtomList(void);

  /** Do a deep clone.  Should be used only on the first in the linked list. */
  nsAtomList* Clone() const { return Clone(true); }

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

  nsCOMPtr<nsIAtom> mAtom;
  nsAtomList*       mNext;
private: 
  nsAtomList* Clone(bool aDeep) const;

  nsAtomList(const nsAtomList& aCopy) = delete;
  nsAtomList& operator=(const nsAtomList& aCopy) = delete;
};

struct nsPseudoClassList {
public:
  explicit nsPseudoClassList(nsCSSPseudoClasses::Type aType);
  nsPseudoClassList(nsCSSPseudoClasses::Type aType, const char16_t *aString);
  nsPseudoClassList(nsCSSPseudoClasses::Type aType, const int32_t *aIntPair);
  nsPseudoClassList(nsCSSPseudoClasses::Type aType,
                    nsCSSSelectorList *aSelectorList /* takes ownership */);
  ~nsPseudoClassList(void);

  /** Do a deep clone.  Should be used only on the first in the linked list. */
  nsPseudoClassList* Clone() const { return Clone(true); }

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

  union {
    // For a given value of mType, we have either:
    //   a. no value, which means mMemory is always null
    //      (if none of the conditions for (b), (c), or (d) is true)
    //   b. a string value, which means mString/mMemory is non-null
    //      (if nsCSSPseudoClasses::HasStringArg(mType))
    //   c. an integer pair value, which means mNumbers/mMemory is non-null
    //      (if nsCSSPseudoClasses::HasNthPairArg(mType))
    //   d. a selector list, which means mSelectors is non-null
    //      (if nsCSSPseudoClasses::HasSelectorListArg(mType))
    void*           mMemory; // mString and mNumbers use NS_Alloc/NS_Free
    char16_t*      mString;
    int32_t*        mNumbers;
    nsCSSSelectorList* mSelectors;
  } u;
  nsCSSPseudoClasses::Type mType;
  nsPseudoClassList* mNext;
private: 
  nsPseudoClassList* Clone(bool aDeep) const;

  nsPseudoClassList(const nsPseudoClassList& aCopy) = delete;
  nsPseudoClassList& operator=(const nsPseudoClassList& aCopy) = delete;
};

#define NS_ATTR_FUNC_SET        0     // [attr]
#define NS_ATTR_FUNC_EQUALS     1     // [attr=value]
#define NS_ATTR_FUNC_INCLUDES   2     // [attr~=value] (space separated)
#define NS_ATTR_FUNC_DASHMATCH  3     // [attr|=value] ('-' truncated)
#define NS_ATTR_FUNC_BEGINSMATCH  4   // [attr^=value] (begins with)
#define NS_ATTR_FUNC_ENDSMATCH  5     // [attr$=value] (ends with)
#define NS_ATTR_FUNC_CONTAINSMATCH 6  // [attr*=value] (contains substring)

struct nsAttrSelector {
public:
  uint8_t         mFunction;
  bool            mCaseSensitive; // If we are in an HTML document,
                                  // is the value case sensitive?
private: 
  nsAttrSelector* Clone(bool aDeep) const;

  nsAttrSelector(const nsAttrSelector& aCopy) = delete;
  nsAttrSelector& operator=(const nsAttrSelector& aCopy) = delete;
};

struct nsCSSSelector {
public:
  nsCSSSelector(void);
  ;

  /** Do a deep clone.  Should be used only on the first in the linked list. */
  int16_t        mPseudoType;

  nsCSSSelector(const nsCSSSelector& aCopy) = delete;
  nsCSSSelector& operator=(const nsCSSSelector& aCopy) = delete;
};

/**
 * A selector list is the unit of selectors that each style rule has.
 * For example, "P B, H1 B { ... }" would be a selector list with two
 * items (where each |nsCSSSelectorList| object's |mSelectors| has
 * an |mNext| for the P or H1).  We represent them as linked lists.
 */
class inDOMUtils;

struct nsCSSSelectorList {
  nsCSSSelectorList(void);
  ~nsCSSSelectorList(void);

  /**
   * Create a new selector and push it onto the beginning of |mSelectors|,
   * setting its |mNext| to the current value of |mSelectors|.  If there is an
   * earlier selector, set its |mOperator| to |aOperator|; else |aOperator|
   * must be char16_t(0).
   * Returns the new selector.
   * The list owns the new selector.
   * The caller is responsible for updating |mWeight|.
   */
  nsCSSSelector* AddSelector(char16_t aOperator);

  /**
   * Point |mSelectors| to its |mNext|, and delete the first node in the old
   * |mSelectors|.
   * Should only be used on a list with more than one selector in it.
   */
  void RemoveRightmostSelector();

  /**
   * Should be used only on the first in the list
   */
  void ToString(nsAString& aResult, mozilla::CSSStyleSheet* aSheet);

  /**
   * Do a deep clone.  Should be used only on the first in the list.
   */
  nsCSSSelectorList* Clone() const { return Clone(true); }

  size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

  nsCSSSelector*     mSelectors;
  int32_t            mWeight;
  nsCSSSelectorList* mNext;
protected:
  friend class inDOMUtils;
  nsCSSSelectorList* Clone(bool aDeep) const;

private:
  nsCSSSelectorList(const nsCSSSelectorList& aCopy) = delete;
  nsCSSSelectorList& operator=(const nsCSSSelectorList& aCopy) = delete;
};

// 464bab7a-2fce-4f30-ab44-b7a5f3aae57d
#define NS_CSS_STYLE_RULE_IMPL_CID \
{ 0x464bab7a, 0x2fce, 0x4f30, \
  { 0xab, 0x44, 0xb7, 0xa5, 0xf3, 0xaa, 0xe5, 0x7d } }

namespace mozilla {
namespace css {

class Declaration;
class DOMCSSStyleRule;

class StyleRule;

class ImportantRule MOZ_FINAL : public nsIStyleRule {
public:
  explicit ImportantRule(Declaration *aDeclaration);

  NS_DECL_ISUPPORTS

  // nsIStyleRule interface
  virtual void MapRuleInfoInto(nsRuleData* aRuleData) MOZ_OVERRIDE;
#ifdef DEBUG
  virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
#endif
# 296 "../../dist/include/mozilla/css/StyleRule.h"

protected:
  virtual ~ImportantRule();

  // Not an owning reference; the StyleRule that owns this
  // ImportantRule also owns the mDeclaration, and any rule node
  // pointing to this rule keeps that StyleRule alive as well.
  Declaration* mDeclaration;

  friend class StyleRule;
};

class StyleRule MOZ_FINAL : public Rule
{
 public:
  StyleRule(nsCSSSelectorList* aSelector,
            Declaration *aDeclaration,
            uint32_t aLineNumber, uint32_t aColumnNumber);
private:
  // for |Clone|
  StyleRule(const StyleRule& aCopy);
  // for |DeclarationChanged|
  StyleRule(StyleRule& aCopy,
            Declaration *aDeclaration);
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_CSS_STYLE_RULE_IMPL_CID)

  NS_DECL_ISUPPORTS

  // null for style attribute
  

  Declaration* GetDeclaration() const { return mDeclaration; }

  /**
   * Return a new |nsIStyleRule| instance that replaces the current
   * one, with |aDecl| replacing the previous declaration. Due to the
   * |nsIStyleRule| contract of immutability, this must be called if
   * the declaration is modified.
   *
   * |DeclarationChanged| handles replacing the object in the container
   * sheet or group rule if |aHandleContainer| is true.
   */
  ;

  

  /**
   * The rule processor must call this method before calling
   * nsRuleWalker::Forward on this rule during rule matching.
   */
  void RuleMatched();

  // hooks for DOM rule
  ;
  ;
  ;
  ;

  virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const MOZ_OVERRIDE;

private:
  ;

private:
  nsCSSSelectorList*      mSelector; // null for style attribute
  Declaration*            mDeclaration;
  nsRefPtr<ImportantRule> mImportantRule; // initialized by RuleMatched
  nsRefPtr<DOMCSSStyleRule> mDOMRule;

private:
  StyleRule& operator=(const StyleRule& aCopy) = delete;
};

NS_DEFINE_STATIC_IID_ACCESSOR(StyleRule, NS_CSS_STYLE_RULE_IMPL_CID)

} // namespace css
} // namespace mozilla

#endif /* mozilla_css_StyleRule_h__ */
# 392 "../../dist/include/mozilla/css/StyleRule.h"
# 16 "../../dist/include/nsSVGElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsSVGElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsChangeHint.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsSVGElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ElementInlines.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsSVGElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/nsSVGElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStyledElement.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/nsSVGElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGClass.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsSVGClass.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __NS_SVGCLASS_H__
#define __NS_SVGCLASS_H__

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsSVGClass.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsSVGClass.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsSVGClass.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISMILAttr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsSVGClass.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsSVGClass.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsSVGClass.h"

class nsSVGElement;

namespace mozilla {
namespace dom {
class SVGAnimatedString;
}
}

class nsSVGClass
{

public:
  void Init() {
    mAnimVal = nullptr;
  }


  nsAutoPtr<nsString> mAnimVal;

public:
  struct SMILString : public nsISMILAttr
  {
  public:
    

    // These will stay alive because a nsISMILAttr only lives as long
    // as the Compositing step, and DOM elements don't get a chance to
    // die during that.
    nsSVGClass* mVal;
    nsSVGElement* mSVGElement;

    // nsISMILAttr methods
    virtual nsresult ValueFromString(const nsAString& aStr,
                                     const mozilla::dom::SVGAnimationElement *aSrcElement,
                                     nsSMILValue& aValue,
                                     bool& aPreventCachingOfSandwich) const MOZ_OVERRIDE;
    virtual nsSMILValue GetBaseValue() const MOZ_OVERRIDE;
    virtual void ClearAnimValue() MOZ_OVERRIDE;
    virtual nsresult SetAnimValue(const nsSMILValue& aValue) MOZ_OVERRIDE;
  };
};
#endif //__NS_SVGCLASS_H__
# 76 "../../dist/include/nsSVGClass.h"
# 26 "../../dist/include/nsSVGElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMSVGElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMSVGElement.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMSVGElement.idl
 */

#ifndef __gen_nsIDOMSVGElement_h__
#define __gen_nsIDOMSVGElement_h__


#ifndef __gen_nsIDOMElement_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMElement.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMSVGElement.h"
#endif
# 12 "../../dist/include/nsIDOMSVGElement.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMSVGElement.h"
class nsIDOMCSSStyleDeclaration; /* forward declaration */

class nsIDOMCSSValue; /* forward declaration */


/* starting interface:    nsIDOMSVGElement */
#define NS_IDOMSVGELEMENT_IID_STR "c63517c5-8bab-4cd1-8694-bccafc32a195"

#define NS_IDOMSVGELEMENT_IID \
  {0xc63517c5, 0x8bab, 0x4cd1, \
    { 0x86, 0x94, 0xbc, 0xca, 0xfc, 0x32, 0xa1, 0x95 }}

class NS_NO_VTABLE nsIDOMSVGElement : public nsIDOMElement {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMSVGELEMENT_IID)

  /* readonly attribute nsIDOMSVGElement ownerSVGElement; */
  NS_IMETHOD GetOwnerSVGElement(nsIDOMSVGElement * *aOwnerSVGElement) = 0;

  /* readonly attribute nsIDOMSVGElement viewportElement; */
  NS_IMETHOD GetViewportElement(nsIDOMSVGElement * *aViewportElement) = 0;

  /* [binaryname(SVGClassName)] readonly attribute nsISupports className; */
  NS_IMETHOD GetSVGClassName(nsISupports * *aClassName) = 0;

  /* readonly attribute nsIDOMCSSStyleDeclaration style; */
  NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMSVGElement, NS_IDOMSVGELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMSVGELEMENT \
  NS_IMETHOD GetOwnerSVGElement(nsIDOMSVGElement * *aOwnerSVGElement) MOZ_OVERRIDE; \
  NS_IMETHOD GetViewportElement(nsIDOMSVGElement * *aViewportElement) MOZ_OVERRIDE; \
  NS_IMETHOD GetSVGClassName(nsISupports * *aClassName) MOZ_OVERRIDE; \
  NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMSVGELEMENT(_to) \
  NS_IMETHOD GetOwnerSVGElement(nsIDOMSVGElement * *aOwnerSVGElement) MOZ_OVERRIDE { return _to GetOwnerSVGElement(aOwnerSVGElement); } \
  NS_IMETHOD GetViewportElement(nsIDOMSVGElement * *aViewportElement) MOZ_OVERRIDE { return _to GetViewportElement(aViewportElement); } \
  NS_IMETHOD GetSVGClassName(nsISupports * *aClassName) MOZ_OVERRIDE { return _to GetSVGClassName(aClassName); } \
  NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) MOZ_OVERRIDE { return _to GetStyle(aStyle); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMSVGELEMENT(_to) \
  NS_IMETHOD GetOwnerSVGElement(nsIDOMSVGElement * *aOwnerSVGElement) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOwnerSVGElement(aOwnerSVGElement); } \
  NS_IMETHOD GetViewportElement(nsIDOMSVGElement * *aViewportElement) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetViewportElement(aViewportElement); } \
  NS_IMETHOD GetSVGClassName(nsISupports * *aClassName) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSVGClassName(aClassName); } \
  NS_IMETHOD GetStyle(nsIDOMCSSStyleDeclaration * *aStyle) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStyle(aStyle); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMSVGElement : public nsIDOMSVGElement
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 129 "../../dist/include/nsIDOMSVGElement.h"


#endif /* __gen_nsIDOMSVGElement_h__ */
# 132 "../../dist/include/nsIDOMSVGElement.h"
# 27 "../../dist/include/nsSVGElement.h" 2

class nsSVGAngle;
class nsSVGBoolean;
class nsSVGEnum;
class nsSVGInteger;
class nsSVGIntegerPair;
class nsSVGLength2;
class nsSVGNumber2;
class nsSVGNumberPair;
class nsSVGPathGeometryElement;
class nsSVGString;
class nsSVGViewBox;

namespace mozilla {
namespace dom {
class CSSValue;
class SVGSVGElement;

static const unsigned short SVG_UNIT_TYPE_UNKNOWN           = 0;
static const unsigned short SVG_UNIT_TYPE_USERSPACEONUSE    = 1;
static const unsigned short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2;

}

class SVGAnimatedNumberList;
class SVGNumberList;
class SVGAnimatedLengthList;
class SVGUserUnitList;
class SVGAnimatedPointList;
class SVGAnimatedPathSegList;
class SVGAnimatedPreserveAspectRatio;
class nsSVGAnimatedTransformList;
class SVGStringList;
class DOMSVGStringList;

namespace gfx {
class Matrix;
}

}

class gfxMatrix;
struct nsSVGEnumMapping;

typedef nsStyledElementNotElementCSSInlineStyle nsSVGElementBase;

class nsSVGElement : public nsSVGElementBase    // nsIContent
                   , public nsIDOMSVGElement
{
protected:
  ;
  ;
  ;
  

public:

  virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_MUST_OVERRIDE MOZ_OVERRIDE;

  typedef mozilla::SVGNumberList SVGNumberList;
  typedef mozilla::SVGAnimatedNumberList SVGAnimatedNumberList;
  typedef mozilla::SVGUserUnitList SVGUserUnitList;
  typedef mozilla::SVGAnimatedLengthList SVGAnimatedLengthList;
  typedef mozilla::SVGAnimatedPointList SVGAnimatedPointList;
  typedef mozilla::SVGAnimatedPathSegList SVGAnimatedPathSegList;
  typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
  typedef mozilla::nsSVGAnimatedTransformList nsSVGAnimatedTransformList;
  typedef mozilla::SVGStringList SVGStringList;

  static const MappedAttributeEntry sFiltersMap[];
  static const MappedAttributeEntry sFEFloodMap[];
  static const MappedAttributeEntry sLightingEffectsMap[];
  static const MappedAttributeEntry sMaskMap[];

  NS_FORWARD_NSIDOMNODE_TO_NSINODE
  NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
  NS_DECL_NSIDOMSVGELEMENT

  // Gets the element that establishes the rectangular viewport against which
  // we should resolve percentage lengths (our "coordinate context"). Returns
  // nullptr for outer <svg> or SVG without an <svg> parent (invalid SVG).
  mozilla::dom::SVGSVGElement* GetCtx() const;

  enum TransformTypes {
     eAllTransforms
    ,eUserSpaceToParent
    ,eChildToUserSpace
  };
  /**
   * Returns aMatrix pre-multiplied by (explicit or implicit) transforms that
   * are introduced by attributes on this element.
   *
   * If aWhich is eAllTransforms, then all the transforms from the coordinate
   * space established by this element for its children to the coordinate
   * space established by this element's parent element for this element, are
   * included.
   *
   * If aWhich is eUserSpaceToParent, then only the transforms from this
   * element's userspace to the coordinate space established by its parent is
   * included. This includes any transforms introduced by the 'transform'
   * attribute, transform animations and animateMotion, but not any offsets
   * due to e.g. 'x'/'y' attributes, or any transform due to a 'viewBox'
   * attribute. (SVG userspace is defined to be the coordinate space in which
   * coordinates on an element apply.)
   *
   * If aWhich is eChildToUserSpace, then only the transforms from the
   * coordinate space established by this element for its childre to this
   * elements userspace are included. This includes any offsets due to e.g.
   * 'x'/'y' attributes, and any transform due to a 'viewBox' attribute, but
   * does not include any transforms due to the 'transform' attribute.
   */
  virtual gfxMatrix PrependLocalTransformsTo(const gfxMatrix &aMatrix,
                      TransformTypes aWhich = eAllTransforms) const;

  // Setter for to set the current <animateMotion> transformation
  // Only visible for nsSVGGraphicElement, so it's a no-op here, and that
  // subclass has the useful implementation.
  virtual void SetAnimateMotionTransform(const mozilla::gfx::Matrix* aMatrix) {/*no-op*/}
  virtual const mozilla::gfx::Matrix* GetAnimateMotionTransform() const { return nullptr; }

  
  
  virtual bool HasValidDimensions() const {
    return true;
  }
  ;

  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;

  ;

  struct LengthInfo {
    nsIAtom** mName;
    float     mDefaultValue;
    uint8_t   mDefaultUnitType;
    uint8_t   mCtxType;
  };

  struct LengthAttributesInfo {
    nsSVGLength2* mLengths;
    LengthInfo*   mLengthInfo;
    uint32_t      mLengthCount;

    

    ;
  };

  struct NumberInfo {
    nsIAtom** mName;
    float     mDefaultValue;
    bool mPercentagesAllowed;
  };

  struct NumberAttributesInfo {
    nsSVGNumber2* mNumbers;
    NumberInfo*   mNumberInfo;
    uint32_t      mNumberCount;

    

    ;
  };

  struct NumberPairInfo {
    nsIAtom** mName;
    float     mDefaultValue1;
    float     mDefaultValue2;
  };

  struct NumberPairAttributesInfo {
    nsSVGNumberPair* mNumberPairs;
    NumberPairInfo*  mNumberPairInfo;
    uint32_t         mNumberPairCount;
    uint32_t               mNumberListCount;

    

    ;
  };

  struct LengthListInfo {
    nsIAtom** mName;
    uint8_t   mAxis;
    /**
     * Flag to indicate whether appending zeros to the end of the list would
     * change the rendering of the SVG for the attribute in question. For x and
     * y on the <text> element this is true, but for dx and dy on <text> this
     * is false. This flag is fed down to SVGLengthListSMILType so it can
     * determine if it can sensibly animate from-to lists of different lengths,
     * which is desirable in the case of dx and dy.
     */
    bool mCouldZeroPadList;
  };

  struct LengthListAttributesInfo {
    SVGAnimatedLengthList* mLengthLists;
    LengthListInfo*        mLengthListInfo;
    uint32_t               mLengthListCount;

    

    ;
  };

  struct StringInfo {
    nsIAtom**    mName;
    int32_t      mNamespaceID;
    bool mIsAnimatable;
  };

  struct StringAttributesInfo {
    nsSVGString*  mStrings;
    StringInfo*   mStringInfo;
    uint32_t      mStringCount;

    

    ;
  };

  friend class mozilla::DOMSVGStringList;

  struct StringListInfo {
    nsIAtom**    mName;
  };

  struct StringListAttributesInfo {
    SVGStringList*    mStringLists;
    StringListInfo*   mStringListInfo;
    uint32_t          mStringListCount;

    

    ;
  };

  virtual LengthAttributesInfo GetLengthInfo();
  static nsSVGEnumMapping sSVGUnitTypesMap[];

private:
  ;

  nsSVGClass mClassAttribute;
  nsAutoPtr<nsAttrValue> mClassAnimAttr;
  nsRefPtr<mozilla::css::StyleRule> mContentStyleRule;
};

/**
 * A macro to implement the NS_NewSVGXXXElement() functions.
 */
#define NS_IMPL_NS_NEW_SVG_ELEMENT(_elementName)                             \
nsresult                                                                     \
NS_NewSVG##_elementName##Element(nsIContent **aResult,                       \
                                 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)  \
{                                                                            \
  nsRefPtr<nsSVG##_elementName##Element> it =                                \
    new nsSVG##_elementName##Element(aNodeInfo);                             \
                                                                             \
  nsresult rv = it->Init();                                                  \
                                                                             \
  if (NS_FAILED(rv)) {                                                       \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_element)                                \
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS                           \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END                                        \
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(_val)                                   \
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER                             \
NS_IMPL_CYCLE_COLLECTION_TRACE_END

#endif // __NS_SVGELEMENT_H__
# 723 "../../dist/include/nsSVGElement.h"
# 16 "../../dist/include/SVGPreserveAspectRatio.h" 2

namespace mozilla {
// Alignment Types
enum SVGAlign : uint8_t {
  SVG_PRESERVEASPECTRATIO_UNKNOWN = 0,
  SVG_PRESERVEASPECTRATIO_NONE = 1,
  SVG_PRESERVEASPECTRATIO_XMINYMIN = 2,
  SVG_PRESERVEASPECTRATIO_XMIDYMIN = 3,
  SVG_PRESERVEASPECTRATIO_XMAXYMIN = 4,
  SVG_PRESERVEASPECTRATIO_XMINYMID = 5,
  SVG_PRESERVEASPECTRATIO_XMIDYMID = 6,
  SVG_PRESERVEASPECTRATIO_XMAXYMID = 7,
  SVG_PRESERVEASPECTRATIO_XMINYMAX = 8,
  SVG_PRESERVEASPECTRATIO_XMIDYMAX = 9,
  SVG_PRESERVEASPECTRATIO_XMAXYMAX = 10
};

// These constants represent the range of valid enum values for the <align>
// parameter. They exclude the sentinel _UNKNOWN value.
const uint16_t SVG_ALIGN_MIN_VALID = SVG_PRESERVEASPECTRATIO_NONE;
const uint16_t SVG_ALIGN_MAX_VALID = SVG_PRESERVEASPECTRATIO_XMAXYMAX;

// Meet-or-slice Types
enum SVGMeetOrSlice : uint8_t {
  SVG_MEETORSLICE_UNKNOWN = 0,
  SVG_MEETORSLICE_MEET = 1,
  SVG_MEETORSLICE_SLICE = 2
};

// These constants represent the range of valid enum values for the
// <meetOrSlice> parameter. They exclude the sentinel _UNKNOWN value.
const uint16_t SVG_MEETORSLICE_MIN_VALID = SVG_MEETORSLICE_MEET;
const uint16_t SVG_MEETORSLICE_MAX_VALID = SVG_MEETORSLICE_SLICE;

class SVGAnimatedPreserveAspectRatio;

class SVGPreserveAspectRatio MOZ_FINAL
{
  friend class SVGAnimatedPreserveAspectRatio;
public:
  

  bool operator==(const SVGPreserveAspectRatio& aOther) const;

  

  

  SVGAlign GetAlign() const {
    return static_cast<SVGAlign>(mAlign);
  }

  nsresult SetMeetOrSlice(uint16_t aMeetOrSlice) {
    if (aMeetOrSlice < SVG_MEETORSLICE_MIN_VALID ||
        aMeetOrSlice > SVG_MEETORSLICE_MAX_VALID)
      return NS_ERROR_FAILURE;
    mMeetOrSlice = static_cast<uint8_t>(aMeetOrSlice);
    return NS_OK;
  }

  SVGMeetOrSlice GetMeetOrSlice() const {
    return static_cast<SVGMeetOrSlice>(mMeetOrSlice);
  }

  void SetDefer(bool aDefer) {
    mDefer = aDefer;
  }

  

  uint32_t Hash() const {
    return HashGeneric(mAlign, mMeetOrSlice, mDefer);
  }

private:
  // We can't use enum types here because some compilers fail to pack them.
  uint8_t mAlign;
  uint8_t mMeetOrSlice;
  bool mDefer;
};

namespace dom {

class DOMSVGPreserveAspectRatio MOZ_FINAL : public nsISupports,
                                            public nsWrapperCache
{
public:
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGPreserveAspectRatio)

  

  // WebIDL
  
  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

  ;
  ;
  ;
  ;

protected:
  ;

  SVGAnimatedPreserveAspectRatio* mVal; // kept alive because it belongs to mSVGElement
  nsRefPtr<nsSVGElement> mSVGElement;
  const bool mIsBaseValue;
};

} //namespace dom
} //namespace mozilla

#endif // MOZILLA_CONTENT_SVGPRESERVEASPECTRATIO_H_
# 150 "../../dist/include/SVGPreserveAspectRatio.h"
# 11 "../../dist/include/SVGImageContext.h" 2

namespace mozilla {

// SVG image-specific rendering context. For imgIContainer::Draw.
// Used to pass information such as
//  - viewport information from CSS, and
//  - overridden attributes from an SVG <image> element
// to the image's internal SVG document when it's drawn.
class SVGImageContext
{
public:
  

  SVGImageContext(nsIntSize aViewportSize,
                  Maybe<SVGPreserveAspectRatio> aPreserveAspectRatio,
                  gfxFloat aOpacity = 1.0)
    : mViewportSize(aViewportSize)
    , mPreserveAspectRatio(aPreserveAspectRatio)
    , mGlobalOpacity(aOpacity)
  { }

  

  

  

  bool operator==(const SVGImageContext& aOther) const {
    return mViewportSize == aOther.mViewportSize &&
           mPreserveAspectRatio == aOther.mPreserveAspectRatio &&
           mGlobalOpacity == aOther.mGlobalOpacity;
  }

  

  

private:
  static uint32_t HashPAR(const SVGPreserveAspectRatio& aPAR) {
    return aPAR.Hash();
  }

  nsIntSize                     mViewportSize;
  Maybe<SVGPreserveAspectRatio> mPreserveAspectRatio;
  gfxFloat                      mGlobalOpacity;
};

} // namespace mozilla

#endif // MOZILLA_SVGCONTEXT_H_
# 76 "../../dist/include/SVGImageContext.h"
# 14 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2

#if 0 /* expanded by -frewrite-includes */
#include "nsContentUtils.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"

#if 0 /* expanded by -frewrite-includes */
#include "nsIPresShell.h"
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"

#if 0 /* expanded by -frewrite-includes */
#include "nsIInterfaceRequestorUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIInterfaceRequestorUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __nsInterfaceRequestorUtils_h
#define __nsInterfaceRequestorUtils_h

#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIInterfaceRequestorUtils.h"

// a type-safe shortcut for calling the |GetInterface()| member function
// T must inherit from nsIInterfaceRequestor, but the cast may be ambiguous.
template<class T, class DestinationType>
inline nsresult
CallGetInterface(T* aSource, DestinationType** aDestination)
{
  NS_PRECONDITION(aSource, "null parameter");
  NS_PRECONDITION(aDestination, "null parameter");

  return aSource->GetInterface(NS_GET_TEMPLATE_IID(DestinationType),
                               reinterpret_cast<void**>(aDestination));
}

class MOZ_STACK_CLASS nsGetInterface : public nsCOMPtr_helper
{
public:
  nsGetInterface(nsISupports* aSource, nsresult* aError)
    : mSource(aSource)
    , mErrorPtr(aError)
  {
  }

  virtual nsresult NS_FASTCALL operator()(const nsIID&, void**) const
    MOZ_OVERRIDE;

private:
  nsISupports* MOZ_NON_OWNING_REF mSource;
  nsresult* mErrorPtr;
};

# 19 "/Users/luser/build/mozilla-central/layout/style/nsCSSParser.h"

class nsIPrincipal;
class nsIURI;
struct nsCSSSelectorList;
class nsMediaList;
class nsMediaQuery;
class nsCSSKeyframeRule;
class nsCSSValue;
struct nsRuleData;

namespace mozilla {
class CSSStyleSheet;
class CSSVariableValues;
namespace css {
class Rule;
class Declaration;
class Loader;
class StyleRule;
}
}

// Interface to the css parser.

class MOZ_STACK_CLASS nsCSSParser {
public:
  explicit nsCSSParser(mozilla::css::Loader* aLoader = nullptr,
                       mozilla::CSSStyleSheet* aSheet = nullptr);
  ;

  // Set loader to use for child sheets
  ;

  /**
   * Parse aInput into the stylesheet that was previously set by calling
   * SetStyleSheet.  Calling this method without calling SetStyleSheet first is
   * an error.
   *
   * @param aInput the data to parse
   * @param aSheetURL the URI to use as the sheet URI (for error reporting).
   *                  This must match the URI of the sheet passed to
   *                  SetStyleSheet.
   * @param aBaseURI the URI to use for relative URI resolution
   * @param aSheetPrincipal the principal of the stylesheet.  This must match
   *                        the principal of the sheet passed to SetStyleSheet.
   * @param aLineNumber the line number of the first line of the sheet.
   * @param aAllowUnsafeRules see aEnableUnsafeRules in
   *                          mozilla::css::Loader::LoadSheetSync
   */
  ;

  // Parse HTML style attribute or its equivalent in other markup
  // languages.  aBaseURL is the base url to use for relative links in
  // the declaration.
  nsresult ParseStyleAttribute(const nsAString&  aAttributeValue,
                               nsIURI*           aDocURL,
                               nsIURI*           aBaseURL,
                               nsIPrincipal*     aNodePrincipal,
                               mozilla::css::StyleRule** aResult);

  // mapped attributes, not inline styles or full style sheets in SVG.
  nsresult ParseProperty(const nsCSSProperty aPropID,
                         const nsAString&    aPropValue,
                         nsIURI*             aSheetURL,
                         nsIURI*             aBaseURL,
                         nsIPrincipal*       aSheetPrincipal,
                         mozilla::css::Declaration* aDeclaration,
                         bool*               aChanged,
                         bool                aIsImportant,
                         bool                aIsSVGMode = false);

  // The same as ParseProperty but for a variable.
  ;
  /**
   * Parse aBuffer into a media list |aMediaList|, which must be
   * non-null, replacing its current contents.  If aHTMLMode is true,
   */
  ;

  /**
   * Parses a string as a CSS token stream value for particular property,
   * resolving any variable references.  The parsed property value is stored
   * in the specified nsRuleData object.  If aShorthandPropertyID has a value
   * other than eCSSProperty_UNKNOWN, this is the property that will be parsed;
   * otherwise, aPropertyID will be parsed.  Either way, only aPropertyID,
   * a longhand property, will be copied over to the rule data.
   *
   * If the property cannot be parsed, it will be treated as if 'initial' or
   * 'inherit' were specified, for non-inherited and inherited properties
   * respectively.
   */
  ;

  ;

  ;

  ;

  // Check whether a given value can be applied to a property.
  ;

protected:
  // This is a CSSParserImpl*, but if we expose that type name in this
  // header, we can't put the type definition (in nsCSSParser.cpp) in
  // the anonymous namespace.
  void* mImpl;
};

#endif /* nsCSSParser_h___ */
# 320 "/Users/luser/build/mozilla-central/layout/style/nsCSSParser.h"
# 28 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/css/StyleRule.h"
#endif /* expanded by -frewrite-includes */
# 29 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/css/Declaration.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/css/Declaration.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * representation of a declaration block (or style attribute) in a CSS
 * stylesheet
 */

#ifndef mozilla_css_Declaration_h
#define mozilla_css_Declaration_h

// This header is in EXPORTS because it's used in several places in content/,
// but it's not really a public interface.
#ifndef MOZILLA_INTERNAL_API
#error "This file should only be included within libxul"
#endif
# 19 "../../dist/include/mozilla/css/Declaration.h"


/* CSS Custom Property assignments for a Declaration at a given priority */

#ifndef mozilla_CSSVariableDeclarations_h
#define mozilla_CSSVariableDeclarations_h

#if 0 /* expanded by -frewrite-includes */
#include "nsDataHashtable.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/layout/style/CSSVariableDeclarations.h"

namespace mozilla {
class CSSVariableResolver;
}
struct nsRuleData;

namespace mozilla {

class CSSVariableDeclarations
{
public:
  ;
  ;
#ifdef DEBUG
  ~CSSVariableDeclarations();
#endif
# 28 "/Users/luser/build/mozilla-central/layout/style/CSSVariableDeclarations.h"
  ;

  /**
   * Returns whether this set of variable declarations includes a variable
   * with a given name.
  ;

private:
  /**
   * Adds all the variable declarations from aOther into this object.
   */
  ;
  ;
  ;
  ;

  nsDataHashtable<nsStringHashKey, nsString> mVariables;
};

} // namespace mozilla

#endif
# 151 "/Users/luser/build/mozilla-central/layout/style/CSSVariableDeclarations.h"
# 23 "../../dist/include/mozilla/css/Declaration.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSDataBlock.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsCSSDataBlock.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * compact representation of the property-value pairs within a CSS
 * declaration, and the code for expanding and compacting it
 */

#ifndef nsCSSDataBlock_h__
#define nsCSSDataBlock_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/layout/style/nsCSSDataBlock.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSProps.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsCSSProps.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * methods for dealing with CSS properties and tables of the keyword
 * values they accept
 */

#ifndef nsCSSProps_h___
#define nsCSSProps_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/layout/style/nsCSSProps.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSProperty.h"
#endif /* expanded by -frewrite-includes */
enum nsStyleAnimType {
  // requires a custom implementation in
  // StyleAnimationValue::ExtractComputedValue
  eStyleAnimType_Custom,

  // nsStyleCoord with animatable values
  eStyleAnimType_Coord,

  // same as Coord, except for one side of an nsStyleSides
  // listed in the same order as the NS_STYLE_* constants
  eStyleAnimType_Sides_Top,
  eStyleAnimType_Sides_Right,
  eStyleAnimType_Sides_Bottom,
  eStyleAnimType_Sides_Left,

  // similar, but for the *pair* of coord members of an nsStyleCorners
  eStyleAnimType_float,

  // nscolor values
  eStyleAnimType_Color,

  // nsStyleSVGPaint values
  eStyleAnimType_PaintServer,

  // nsRefPtr<nsCSSShadowArray> values
  eStyleAnimType_Shadow,

  // property not animatable
  eStyleAnimType_None
};

class nsCSSProps {
public:
  typedef int16_t KTableValue;

  ;
  ;

  enum EnabledState {
    // The default EnabledState: only enable what's enabled for all content,
    // given the current values of preferences.
    eEnabledForAllContent = 0,
    // Enable a property in UA sheets.
    eEnabledInUASheets    = 0x01,
    // Enable a property in privileged content, i.e. chrome or Certified Apps
    eEnabledInChromeOrCertifiedApp = 0x02,
    // Special value to unconditionally enable a property. This implies all the
    // bits above, but is strictly more than just their OR-ed union.
    // This just skips any test so a property will be enabled even if it would
    // have been disabled with all the bits above set.
    eIgnoreEnabledState   = 0xff
  };

  // Looks up the property with name aProperty and returns its corresponding
  // nsCSSProperty value.  If aProperty is the name of a custom property,
  // then eCSSPropertyExtra_variable will be returned.
  ;
  ;
  // Returns whether aProperty is a custom property name, i.e. begins with
  // "--".  This assumes that the CSS Variables pref has been enabled.
  ;
  ;

  static inline bool IsShorthand(nsCSSProperty aProperty) {
    MOZ_ASSERT(0 <= aProperty && aProperty < eCSSProperty_COUNT,
               "out of range");
    return (aProperty >= eCSSProperty_COUNT_no_shorthands);
  }

  // Must be given a longhand property.
  ;

  // Same but for @font-face descriptors
  ;
  ;

  // For @counter-style descriptors
  ;
  ;

  static const KTableValue kRadialGradientShapeKTable[];
  static const KTableValue kVerticalAlignKTable[];
  static const KTableValue kVisibilityKTable[];
  static const KTableValue kVolumeKTable[];
  static const KTableValue kWhitespaceKTable[];
  static const KTableValue kWidthKTable[]; // also min-width, max-width
  static const KTableValue kWindowDraggingKTable[];
  static const KTableValue kWindowShadowKTable[];
  static const KTableValue kWordBreakKTable[];
  static const KTableValue kWordWrapKTable[];
  static const KTableValue kWritingModeKTable[];
};









#endif /* nsCSSProps_h___ */
# 735 "/Users/luser/build/mozilla-central/layout/style/nsCSSProps.h"
# 16 "/Users/luser/build/mozilla-central/layout/style/nsCSSDataBlock.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSPropertySet.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsCSSPropertySet.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* bit vectors for sets of CSS properties */

#ifndef nsCSSPropertySet_h__
#define nsCSSPropertySet_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ArrayUtils.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/layout/style/nsCSSPropertySet.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsCSSProperty.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/layout/style/nsCSSPropertySet.h"
#if 0 /* expanded by -frewrite-includes */
#include <limits.h> // for CHAR_BIT
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/layout/style/nsCSSPropertySet.h"

/**
 * nsCSSPropertySet maintains a set of non-shorthand CSS properties.  In
 * other words, for each longhand CSS property we support, it has a bit
 * for whether that property is in the set.
 */
class nsCSSPropertySet {
public:
    
    // auto-generated copy-constructor OK

    

    // Conversion of aProperty to |size_t| after AssertInSetRange
    // lets the compiler generate significantly tighter code.

    

    

    

    

    

private:
    typedef unsigned long property_set_type;
public:
    // number of bits in |property_set_type|.
};

#endif /* !defined(nsCSSPropertySet_h__) */
# 94 "/Users/luser/build/mozilla-central/layout/style/nsCSSPropertySet.h"
# 17 "/Users/luser/build/mozilla-central/layout/style/nsCSSDataBlock.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSValue.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/layout/style/nsCSSDataBlock.h"
#if 0 /* expanded by -frewrite-includes */
#include "imgRequestProxy.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/layout/style/nsCSSDataBlock.h"

struct nsRuleData;
class nsCSSExpandedDataBlock;

namespace mozilla {
namespace css {
class Declaration;
}
}

/**
 * An |nsCSSCompressedDataBlock| holds a usually-immutable chunk of
 * property-value data for a CSS declaration block (which we misname a
 * |css::Declaration|).  Mutation is accomplished through
 * |nsCSSExpandedDataBlock| or in some cases via direct slot access.
 */
class nsCSSCompressedDataBlock {
private:
    friend class nsCSSExpandedDataBlock;

    // Only this class (via |CreateEmptyBlock|) or nsCSSExpandedDataBlock
    // (in |Compress|) can create compressed data blocks.
    

public:
    ~nsCSSCompressedDataBlock();

    /**
     * Do what |nsIStyleRule::MapRuleInfoInto| needs to do for a style
     * rule using this block for storage.
     */
    void MapRuleInfoInto(nsRuleData *aRuleData) const;

    /**
     * Return the location at which the *value* for the property is
     * stored, or null if the block does not contain a value for the
     * property.
     *
     * Inefficient (by design).
     *
     * Must not be called for shorthands.
     */
    const nsCSSValue* ValueFor(nsCSSProperty aProperty) const;

    /**
     * Attempt to replace the value for |aProperty| stored in this block
     * with the matching value stored in |aFromBlock|.
     */
    ;

#ifdef DEBUG
    void DoAssertInitialState();
#endif
# 298 "/Users/luser/build/mozilla-central/layout/style/nsCSSDataBlock.h"

    /*
     * mPropertiesSet stores a bit for every property that is present,
     * to optimize compression of blocks with small numbers of
     * properties (the norm) and to allow quickly checking whether a
     * property is set in this block.
     */
    nsCSSPropertySet mPropertiesSet;
    /*
     * mPropertiesImportant indicates which properties are '!important'.
     */
    nsCSSPropertySet mPropertiesImportant;


    

    
};

#endif /* !defined(nsCSSDataBlock_h__) */
# 359 "/Users/luser/build/mozilla-central/layout/style/nsCSSDataBlock.h"
# 24 "../../dist/include/mozilla/css/Declaration.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSProperty.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/mozilla/css/Declaration.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSProps.h"
#endif /* expanded by -frewrite-includes */
# 26 "../../dist/include/mozilla/css/Declaration.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringFwd.h"
#endif /* expanded by -frewrite-includes */
# 27 "../../dist/include/mozilla/css/Declaration.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/mozilla/css/Declaration.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 29 "../../dist/include/mozilla/css/Declaration.h"

namespace mozilla {
namespace css {

// Declaration objects have unusual lifetime rules.  Every declaration
// begins life in an invalid state which ends when InitializeEmpty or
// CompressFrom is called upon it.  After that, it can be attached to
// exactly one style rule, and will be destroyed when that style rule
// is destroyed.  A declaration becomes immutable when its style rule's
// |RuleMatched| method is called; after that, it must be copied before
// it can be modified, which is taken care of by |EnsureMutable|.

class Declaration {
public:
  /**
   * Construct an |Declaration| that is in an invalid state (null
   * |mData|) and cannot be used until its |CompressFrom| method or
   * |InitializeEmpty| method is called.
   */

  void GetValue(nsCSSProperty aProperty, nsAString& aValue) const;
  ;

  
  ;
  ;

  /**
   * Adds a custom property declaration to this object.
   *
   * @param aName The variable name (i.e., without the "--" prefix).
   * @param aType The type of value the variable has.
   * @param aValue The value of the variable, if aType is
   *   CSSVariableDeclarations::eTokenStream.
   * @param aIsImportant Whether the declaration is !important.
   * Returns whether the custom property declaration for a variable with
   * the given name was !important.
   */
  ;

  

  // Returns whether we actually had a property at aIndex
  ;

  ;

  nsCSSCompressedDataBlock* GetNormalBlock() const { return mData; }
  

  /**
   */
  void GetCustomPropertyNameAt(uint32_t aIndex, nsAString& aResult) const {
    MOZ_ASSERT(mOrder[aIndex] >= eCSSProperty_COUNT);
    uint32_t variableIndex = mOrder[aIndex] - eCSSProperty_COUNT;
    aResult.Truncate();
    aResult.AppendLiteral("--");
    aResult.Append(mVariableOrder[variableIndex]);
  }

  ;

private:
  // The order of properties in this declaration.  Longhand properties are
  // represented by their nsCSSProperty value, and each custom property (--*)
  // is represented by a value that begins at eCSSProperty_COUNT.
  //
  // Subtracting eCSSProperty_COUNT from those values that represent custom
  // properties results in an index into mVariableOrder, which identifies the
  // specific variable the custom property declaration is for.
  nsAutoTArray<uint32_t, 8> mOrder;

  // variable names of custom properties found in mOrder
  nsTArray<nsString> mVariableOrder;

  // never null, except while expanded, or before the first call to
  // InitializeEmpty or CompressFrom.
  nsAutoPtr<nsCSSCompressedDataBlock> mData;

  // may be null
  nsAutoPtr<nsCSSCompressedDataBlock> mImportantData;

  // may be null
  nsAutoPtr<CSSVariableDeclarations> mVariables;

  // may be null
  nsAutoPtr<CSSVariableDeclarations> mImportantVariables;

  // set by style rules when |RuleMatched| is called;
  // also by ToString (hence the 'mutable').
  mutable bool mImmutable;
};

} // namespace css
} // namespace mozilla

#endif /* mozilla_css_Declaration_h */
# 363 "../../dist/include/mozilla/css/Declaration.h"
# 30 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsComputedDOMStyle.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsComputedDOMStyle.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* DOM object returned from element.getComputedStyle() */

#ifndef nsComputedDOMStyle_h__
#define nsComputedDOMStyle_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/layout/style/nsComputedDOMStyle.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDOMCSSDeclaration.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsDOMCSSDeclaration.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* base class for DOM objects for element.style and cssStyleRule.style */

#ifndef nsDOMCSSDeclaration_h___
#define nsDOMCSSDeclaration_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsICSSDeclaration.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsICSSDeclaration.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * faster version of nsIDOMCSSStyleDeclaration using enums instead of
 * strings, for internal use
 */

#ifndef nsICSSDeclaration_h__
#define nsICSSDeclaration_h__
# 1 "../../dist/include/nsIDOMCSSStyleDeclaration.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMCSSStyleDeclaration.idl
 */

#ifndef __gen_nsIDOMCSSStyleDeclaration_h__
#define __gen_nsIDOMCSSStyleDeclaration_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMCSSStyleDeclaration.h"
#endif
# 12 "../../dist/include/nsIDOMCSSStyleDeclaration.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMCSSStyleDeclaration.h"

/* starting interface:    nsIDOMCSSStyleDeclaration */
#define NS_IDOMCSSSTYLEDECLARATION_IID_STR "a6cf90be-15b3-11d2-932e-00805f8add32"

#define NS_IDOMCSSSTYLEDECLARATION_IID \
  {0xa6cf90be, 0x15b3, 0x11d2, \
    { 0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 }}

class NS_NO_VTABLE nsIDOMCSSStyleDeclaration : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMCSSSTYLEDECLARATION_IID)

  /* attribute DOMString cssText; */
  NS_IMETHOD GetCssText(nsAString & aCssText) = 0;
  NS_IMETHOD SetCssText(const nsAString & aCssText) = 0;

  /* DOMString getPropertyValue (in DOMString propertyName); */
  NS_IMETHOD GetPropertyValue(const nsAString & propertyName, nsAString & _retval) = 0;

  /* nsIDOMCSSValue getPropertyCSSValue (in DOMString propertyName); */
  NS_IMETHOD GetPropertyCSSValue(const nsAString & propertyName, nsIDOMCSSValue * *_retval) = 0;

  /* DOMString removeProperty (in DOMString propertyName) raises (DOMException); */
  NS_IMETHOD RemoveProperty(const nsAString & propertyName, nsAString & _retval) = 0;

  /* DOMString getPropertyPriority (in DOMString propertyName); */
  NS_IMETHOD GetPropertyPriority(const nsAString & propertyName, nsAString & _retval) = 0;

  /* void setProperty (in DOMString propertyName, in DOMString value, [optional] in DOMString priority) raises (DOMException); */
  NS_IMETHOD SetProperty(const nsAString & propertyName, const nsAString & value, const nsAString & priority) = 0;

  /* readonly attribute unsigned long length; */
  NS_IMETHOD GetLength(uint32_t *aLength) = 0;

  /* DOMString item (in unsigned long index); */
  NS_IMETHOD Item(uint32_t index, nsAString & _retval) = 0;

  /* readonly attribute nsIDOMCSSRule parentRule; */
  NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule) = 0;

};
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMCSSSTYLEDECLARATION(_to) \
  NS_IMETHOD GetCssText(nsAString & aCssText) MOZ_OVERRIDE { return _to GetCssText(aCssText); } \
  NS_IMETHOD SetCssText(const nsAString & aCssText) MOZ_OVERRIDE { return _to SetCssText(aCssText); } \
  NS_IMETHOD GetPropertyValue(const nsAString & propertyName, nsAString & _retval) MOZ_OVERRIDE { return _to GetPropertyValue(propertyName, _retval); } \
  NS_IMETHOD GetPropertyCSSValue(const nsAString & propertyName, nsIDOMCSSValue * *_retval) MOZ_OVERRIDE { return _to GetPropertyCSSValue(propertyName, _retval); } \
  NS_IMETHOD RemoveProperty(const nsAString & propertyName, nsAString & _retval) MOZ_OVERRIDE { return _to RemoveProperty(propertyName, _retval); } \
  NS_IMETHOD GetPropertyPriority(const nsAString & propertyName, nsAString & _retval) MOZ_OVERRIDE { return _to GetPropertyPriority(propertyName, _retval); } \
  NS_IMETHOD SetProperty(const nsAString & propertyName, const nsAString & value, const nsAString & priority) MOZ_OVERRIDE { return _to SetProperty(propertyName, value, priority); } \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return _to GetLength(aLength); } \
  NS_IMETHOD Item(uint32_t index, nsAString & _retval) MOZ_OVERRIDE { return _to Item(index, _retval); } \
  NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule) MOZ_OVERRIDE { return _to GetParentRule(aParentRule); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMCSSSTYLEDECLARATION(_to) \
  NS_IMETHOD GetCssText(nsAString & aCssText) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCssText(aCssText); } \
  NS_IMETHOD SetCssText(const nsAString & aCssText) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCssText(aCssText); } \
  NS_IMETHOD GetPropertyValue(const nsAString & propertyName, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPropertyValue(propertyName, _retval); } \
  NS_IMETHOD GetPropertyCSSValue(const nsAString & propertyName, nsIDOMCSSValue * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPropertyCSSValue(propertyName, _retval); } \
  NS_IMETHOD RemoveProperty(const nsAString & propertyName, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveProperty(propertyName, _retval); } \
  NS_IMETHOD GetPropertyPriority(const nsAString & propertyName, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPropertyPriority(propertyName, _retval); } \
  NS_IMETHOD SetProperty(const nsAString & propertyName, const nsAString & value, const nsAString & priority) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetProperty(propertyName, value, priority); } \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLength(aLength); } \
  NS_IMETHOD Item(uint32_t index, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Item(index, _retval); } \
  NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetParentRule(aParentRule); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMCSSStyleDeclaration : public nsIDOMCSSStyleDeclaration
{

/* readonly attribute nsIDOMCSSRule parentRule; */
NS_IMETHODIMP nsDOMCSSStyleDeclaration::GetParentRule(nsIDOMCSSRule * *aParentRule)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 193 "../../dist/include/nsIDOMCSSStyleDeclaration.h"


class nsIDOMCSSValue;
class nsROCSSPrimitiveValue;
namespace mozilla {
class ErrorResult;
}

namespace mozilla {
namespace dom {

/**
 * CSSValue - a DOM object representing values in DOM computed style.
 */
class CSSValue : public nsISupports,
                 public nsWrapperCache
{
public:
  // CSSValue
  ;
  ;
  ;

  // Downcasting

  /**
   * Return this as a nsROCSSPrimitiveValue* if its a primitive value, and null
   * otherwise.
   */
  ;
};

}
}

#endif
# 49 "/Users/luser/build/mozilla-central/layout/style/CSSValue.h"
# 26 "/Users/luser/build/mozilla-central/layout/style/nsICSSDeclaration.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 27 "/Users/luser/build/mozilla-central/layout/style/nsICSSDeclaration.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 28 "/Users/luser/build/mozilla-central/layout/style/nsICSSDeclaration.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMCSSRule.h"
#endif /* expanded by -frewrite-includes */
# 29 "/Users/luser/build/mozilla-central/layout/style/nsICSSDeclaration.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMCSSValue.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMCSSValue.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMCSSValue.idl
 */

#ifndef __gen_nsIDOMCSSValue_h__
#define __gen_nsIDOMCSSValue_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMCSSValue.h"
#endif
# 12 "../../dist/include/nsIDOMCSSValue.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMCSSValue.h"

/* starting interface:    nsIDOMCSSValue */
#define NS_IDOMCSSVALUE_IID_STR "009f7ea5-9e80-41be-b008-db62f10823f2"

#define NS_IDOMCSSVALUE_IID \
  {0x009f7ea5, 0x9e80, 0x41be, \
    { 0xb0, 0x08, 0xdb, 0x62, 0xf1, 0x08, 0x23, 0xf2 }}

class NS_NO_VTABLE nsIDOMCSSValue : public nsISupports {
 public: 

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMCSSValue, NS_IDOMCSSVALUE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMCSSVALUE \
  NS_IMETHOD GetCssText(nsAString & aCssText) MOZ_OVERRIDE; \
  NS_IMETHOD SetCssText(const nsAString & aCssText) MOZ_OVERRIDE; \
  NS_IMETHOD GetCssValueType(uint16_t *aCssValueType) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMCSSVALUE(_to) \
  NS_IMETHOD GetCssText(nsAString & aCssText) MOZ_OVERRIDE { return _to GetCssText(aCssText); } \
  NS_IMETHOD SetCssText(const nsAString & aCssText) MOZ_OVERRIDE { return _to SetCssText(aCssText); } \
  NS_IMETHOD GetCssValueType(uint16_t *aCssValueType) MOZ_OVERRIDE { return _to GetCssValueType(aCssValueType); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMCSSVALUE(_to) \
  NS_IMETHOD GetCssText(nsAString & aCssText) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCssText(aCssText); } \
  NS_IMETHOD SetCssText(const nsAString & aCssText) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCssText(aCssText); } \
  NS_IMETHOD GetCssValueType(uint16_t *aCssValueType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCssValueType(aCssValueType); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */
NS_IMETHODIMP nsDOMCSSValue::GetCssText(nsAString & aCssText)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsDOMCSSValue::SetCssText(const nsAString & aCssText)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute unsigned short cssValueType; */
NS_IMETHODIMP nsDOMCSSValue::GetCssValueType(uint16_t *aCssValueType)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 116 "../../dist/include/nsIDOMCSSValue.h"


#endif /* __gen_nsIDOMCSSValue_h__ */
# 119 "../../dist/include/nsIDOMCSSValue.h"
# 30 "/Users/luser/build/mozilla-central/layout/style/nsICSSDeclaration.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 31 "/Users/luser/build/mozilla-central/layout/style/nsICSSDeclaration.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 32 "/Users/luser/build/mozilla-central/layout/style/nsICSSDeclaration.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 33 "/Users/luser/build/mozilla-central/layout/style/nsICSSDeclaration.h"

class nsINode;

// dbeabbfa-6cb3-4f5c-aec2-dd558d9d681f
#define NS_ICSSDECLARATION_IID \
{ 0xdbeabbfa, 0x6cb3, 0x4f5c, \
 { 0xae, 0xc2, 0xdd, 0x55, 0x8d, 0x9d, 0x68, 0x1f } }

class nsICSSDeclaration : public nsIDOMCSSStyleDeclaration,
                          public nsWrapperCache
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICSSDECLARATION_IID)

  /**
   * Method analogous to nsIDOMCSSStyleDeclaration::GetPropertyValue,
   * which obeys all the same restrictions.
   */
  NS_IMETHOD GetPropertyValue(const nsCSSProperty aPropID,
                              nsAString& aValue) = 0;

  NS_IMETHOD GetAuthoredPropertyValue(const nsAString& aPropName,
                                      nsAString& aValue) = 0;

  /**
   * Method analogous to nsIDOMCSSStyleDeclaration::SetProperty.  This
   * method does NOT allow setting a priority (the priority will
   * always be set to default priority).
   */
  NS_IMETHOD SetPropertyValue(const nsCSSProperty aPropID,
                              const nsAString& aValue) = 0;

  ;

  // Also have to declare all the nsIDOMCSSStyleDeclaration methods,
  // since we want to be able to call them from the WebIDL versions.
  NS_IMETHOD GetCssText(nsAString& aCssText) MOZ_OVERRIDE = 0;
  NS_IMETHOD SetCssText(const nsAString& aCssText) MOZ_OVERRIDE = 0;
  NS_IMETHOD GetPropertyValue(const nsAString& aPropName,
                              nsAString& aValue) MOZ_OVERRIDE = 0;
  virtual already_AddRefed<mozilla::dom::CSSValue>
    GetPropertyCSSValue(const nsAString& aPropertyName,
                        mozilla::ErrorResult& aRv) = 0;
  NS_IMETHOD GetPropertyCSSValue(const nsAString& aProp, nsIDOMCSSValue** aVal) MOZ_OVERRIDE
  {
    mozilla::ErrorResult error;
    nsRefPtr<mozilla::dom::CSSValue> val = GetPropertyCSSValue(aProp, error);
    if (error.Failed()) {
      return error.ErrorCode();
    }

    nsCOMPtr<nsIDOMCSSValue> xpVal = do_QueryInterface(val);
    xpVal.forget(aVal);
    return NS_OK;
  }
  NS_IMETHOD RemoveProperty(const nsAString& aPropertyName,
                            nsAString& aReturn) MOZ_OVERRIDE = 0;
  NS_IMETHOD GetPropertyPriority(const nsAString& aPropertyName,
                                 nsAString& aReturn) MOZ_OVERRIDE = 0;
  NS_IMETHOD SetProperty(const nsAString& aPropertyName,
                         const nsAString& aValue,
                         const nsAString& aPriority) MOZ_OVERRIDE = 0;
  NS_IMETHOD GetLength(uint32_t* aLength) MOZ_OVERRIDE = 0;
  NS_IMETHOD Item(uint32_t aIndex, nsAString& aReturn) MOZ_OVERRIDE
  {
    bool found;
    IndexedGetter(aIndex, found, aReturn);
    if (!found) {
      aReturn.Truncate();
    }
    return NS_OK;
  }
  NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule) MOZ_OVERRIDE = 0;

  // WebIDL interface for CSSStyleDeclaration
  
  
  
  

  // The actual implementation of the Item method and the WebIDL indexed getter
  virtual void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName) = 0;

  
  
  
  
  void RemoveProperty(const nsAString& aPropName, nsString& aRetval,
                      mozilla::ErrorResult& rv) {
    rv = RemoveProperty(aPropName, aRetval);
  }
  already_AddRefed<nsIDOMCSSRule> GetParentRule() {
    nsCOMPtr<nsIDOMCSSRule> rule;
    GetParentRule(getter_AddRefs(rule));
    return rule.forget();
  }
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsICSSDeclaration, NS_ICSSDECLARATION_IID)

#define NS_DECL_NSICSSDECLARATION                                   \
  NS_IMETHOD GetPropertyValue(const nsCSSProperty aPropID,          \
                              nsAString& aValue) MOZ_OVERRIDE;      \
  NS_IMETHOD GetAuthoredPropertyValue(const nsAString& aPropName,   \
                                      nsAString& aValue) MOZ_OVERRIDE; \
  NS_IMETHOD SetPropertyValue(const nsCSSProperty aPropID,          \
                              const nsAString& aValue) MOZ_OVERRIDE;

#define NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER \
  NS_IMETHOD GetCssText(nsAString & aCssText) MOZ_OVERRIDE; \
  NS_IMETHOD SetCssText(const nsAString & aCssText) MOZ_OVERRIDE; \
  NS_IMETHOD GetPropertyValue(const nsAString & propertyName, nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveProperty(const nsAString & propertyName, nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetPropertyPriority(const nsAString & propertyName, nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD SetProperty(const nsAString & propertyName, const nsAString & value, const nsAString & priority) MOZ_OVERRIDE; \
  NS_IMETHOD GetLength(uint32_t *aLength) MOZ_OVERRIDE; \
  NS_IMETHOD Item(uint32_t index, nsAString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule) MOZ_OVERRIDE;

#endif // nsICSSDeclaration_h__
# 176 "/Users/luser/build/mozilla-central/layout/style/nsICSSDeclaration.h"
# 12 "/Users/luser/build/mozilla-central/layout/style/nsDOMCSSDeclaration.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/layout/style/nsDOMCSSDeclaration.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIURI.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/layout/style/nsDOMCSSDeclaration.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/layout/style/nsDOMCSSDeclaration.h"

class nsIPrincipal;
class nsIDocument;
struct JSContext;
class JSObject;

namespace mozilla {
namespace css {
class Declaration;
class Loader;
class Rule;
}
}

class nsDOMCSSDeclaration : public nsICSSDeclaration
{
  NS_IMETHOD GetParentRule(nsIDOMCSSRule * *aParentRule) MOZ_OVERRIDE = 0;

  // WebIDL interface for CSS2Properties
#define CSS_PROP_PUBLIC_OR_PRIVATE(publicname_, privatename_) publicname_
#define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_,          \
                 kwtable_, stylestruct_, stylestructoffset_, animtype_)      \
  void                                                                       \
  Get##method_(nsAString& aValue, mozilla::ErrorResult& rv)                  \
  {                                                                          \
    rv = GetPropertyValue(eCSSProperty_##id_, aValue);                       \
  }                                                                          \
                                                                             \
  void                                                                       \
  Set##method_(const nsAString& aValue, mozilla::ErrorResult& rv)            \
  {                                                                          \
    rv = SetPropertyValue(eCSSProperty_##id_, aValue);                       \
  }

#define CSS_PROP_LIST_EXCLUDE_INTERNAL
#define CSS_PROP_LIST_INCLUDE_LOGICAL
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_)  \
  CSS_PROP(name_, id_, method_, flags_, pref_, X, X, X, X, X)
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSPropList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSPropList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * a list of all CSS properties with considerable data about them, for
 * preprocessing
 */

/******

  This file contains the list of all parsed CSS properties.  It is
  designed to be used as inline input through the magic of C
  preprocessing.  All entries must be enclosed in the appropriate
  CSS_PROP_* macro which will have cruel and unusual things done to it.
  It is recommended (but not strictly necessary) to keep all entries in
  alphabetical order.

  The arguments to CSS_PROP, CSS_PROP_LOGICAL and CSS_PROP_* are:

  -. 'animtype_' [not used for CSS_PROP_BACKENDONLY] gives the
  animation type (see nsStyleAnimType) of this property.

  CSS_PROP_SHORTHAND only takes 1-5.

  CSS_PROP_LOGICAL should be used instead of CSS_PROP_struct when
  defining logical properties (which also must be defined with the
  CSS_PROPERTY_LOGICAL flag).  Logical shorthand properties should still
  be defined with CSS_PROP_SHORTHAND.

 ******/


/*************************************************************************/


// All includers must explicitly define CSS_PROP_SHORTHAND if they
// want it.
#ifndef CSS_PROP_SHORTHAND
#define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) /* nothing */
#define DEFINED_CSS_PROP_SHORTHAND
#endif
# 91 "../../dist/include/nsCSSPropList.h"

#define CSS_PROP_DOMPROP_PREFIXED(name_) \
  CSS_PROP_PUBLIC_OR_PRIVATE(Moz ## name_, name_)

#define CSS_PROP_NO_OFFSET (-1)

// Callers may define CSS_PROP_LIST_EXCLUDE_INTERNAL if they want to

// A caller who wants all the properties can define the |CSS_PROP|
// macro.
#ifdef CSS_PROP

#define USED_CSS_PROP
#define CSS_PROP_FONT(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Font, stylestructoffset_, animtype_)
#define CSS_PROP_COLOR(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Color, stylestructoffset_, animtype_)
#define CSS_PROP_BACKGROUND(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Background, stylestructoffset_, animtype_)
#define CSS_PROP_LIST(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, List, stylestructoffset_, animtype_)
#define CSS_PROP_POSITION(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Position, stylestructoffset_, animtype_)
#define CSS_PROP_TEXT(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Text, stylestructoffset_, animtype_)
#define CSS_PROP_TEXTRESET(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, TextReset, stylestructoffset_, animtype_)
#define CSS_PROP_DISPLAY(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Display, stylestructoffset_, animtype_)
#define CSS_PROP_VISIBILITY(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Visibility, stylestructoffset_, animtype_)
#define CSS_PROP_CONTENT(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Content, stylestructoffset_, animtype_)
#define CSS_PROP_QUOTES(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, Quotes, stylestructoffset_, animtype_)
#ifndef CSS_PROP_LOGICAL
#ifdef CSS_PROP_LIST_INCLUDE_LOGICAL
#define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, group_, struct_, stylestructoffset_, animtype_) CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, struct_, stylestructoffset_, animtype_)
#else
# 180 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_LIST_EXCLUDE_LOGICAL
#error Must define exactly one of CSS_PROP_LOGICAL, CSS_PROP_LIST_EXCLUDE_LOGICAL and CSS_PROP_LIST_INCLUDE_LOGICAL when capturing properties using CSS_PROP.
#endif
# 183 "../../dist/include/nsCSSPropList.h"
#define CSS_PROP_LOGICAL(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, group_, struct_, stylestructoffset_, animtype_) /* nothing */
#endif
# 185 "../../dist/include/nsCSSPropList.h"
#define DEFINED_CSS_PROP_LOGICAL
#endif
# 262 "../../dist/include/nsCSSPropList.h"
#ifndef CSS_PROP_PADDING
#endif
# 303 "../../dist/include/nsCSSPropList.h"

#endif /* !defined(CSS_PROP) */
# 305 "../../dist/include/nsCSSPropList.h"

/*************************************************************************/

// For notes XXX bug 3935 below, the names being parsed do not correspond
// to the constants used internally.  It would be nice to bring the
// constants into line sometime.

// The parser will refuse to parse properties marked with -x-.

// Those marked XXX bug 48973 are CSS2 properties that we support
// differently from the spec for UI requirements.  If we ever
// properties, 'color', and background properties.  We also allow
// 'text-shadow' (see above) and 'box-shadow' (which is like the
// border properties).

CSS_PROP_DISPLAY(
    -moz-appearance,
    appearance,
    CSS_PROP_DOMPROP_PREFIXED(Appearance),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kAppearanceKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    -moz-outline-radius,
    _moz_outline_radius,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadius),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_OUTLINE(
    -moz-outline-radius-topleft,
    _moz_outline_radius_topLeft,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusTopleft),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_TopLeft)
CSS_PROP_OUTLINE(
    -moz-outline-radius-topright,
    _moz_outline_radius_topRight,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusTopright),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_TopRight)
CSS_PROP_OUTLINE(
    -moz-outline-radius-bottomright,
    _moz_outline_radius_bottomRight,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusBottomright),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_BottomRight)
CSS_PROP_OUTLINE(
    -moz-outline-radius-bottomleft,
    _moz_outline_radius_bottomLeft,
    CSS_PROP_DOMPROP_PREFIXED(OutlineRadiusBottomleft),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleOutline, mOutlineRadius),
    eStyleAnimType_Corner_BottomLeft)
CSS_PROP_TEXT(
    -moz-tab-size,
    _moz_tab_size,
    CSS_PROP_DOMPROP_PREFIXED(TabSize),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HI,
    nullptr,
    offsetof(nsStyleText, mTabSize),
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_FONT(
    -x-system-font,
    _x_system_font,
    CSS_PROP_DOMPROP_PREFIXED(SystemFont),
    CSS_PROPERTY_PARSE_INACCESSIBLE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_EXCLUDE_INTERNAL)
# 429 "../../dist/include/nsCSSPropList.h"
CSS_PROP_SHORTHAND(
    all,
    all,
    All,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.all-shorthand.enabled")
CSS_PROP_SHORTHAND(
    animation,
    animation,
    Animation,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_DISPLAY(
    animation-delay,
    animation_delay,
    AnimationDelay,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-direction,
    animation_direction,
    AnimationDirection,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kAnimationDirectionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-duration,
    animation_duration,
    AnimationDuration,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME | VARIANT_NONNEGATIVE_DIMENSION, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-fill-mode,
    animation_fill_mode,
    AnimationFillMode,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kAnimationFillModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-iteration-count,
    animation_iteration_count,
    AnimationIterationCount,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        // nonnegative per
        // http://lists.w3.org/Archives/Public/www-style/2011Mar/0355.html
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD | VARIANT_NUMBER, // used by list parsing
    kAnimationIterationCountKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-name,
    animation_name,
    AnimationName,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    // FIXME: The spec should say something about 'inherit' and 'initial'
    // not being allowed.
    VARIANT_NONE | VARIANT_IDENTIFIER_NO_INHERIT, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-play-state,
    animation_play_state,
    AnimationPlayState,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kAnimationPlayStateKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    animation-timing-function,
    animation_timing_function,
    AnimationTimingFunction,
        CSS_PROPERTY_START_IMAGE_LOADS,
    "",
    VARIANT_IMAGE, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-blend-mode,
    background_blend_mode,
    BackgroundBlendMode,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "layout.css.background-blend-mode.enabled",
    VARIANT_KEYWORD, // used by list parsing
    kBlendModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-origin,
    background_origin,
    BackgroundOrigin,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kBackgroundOriginKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-position,
    background_position,
    BackgroundPosition,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_STORES_CALC,
    "",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BACKGROUND(
    background-repeat,
    background_repeat,
    BackgroundRepeat,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD, // used by list parsing
    kBackgroundRepeatKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKGROUND(
    background-size,
    background_size,
    BackgroundSize,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC,
    "",
    0,
    kBackgroundSizeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_DISPLAY(
    -moz-binding,
    binding,
    CSS_PROP_DOMPROP_PREFIXED(Binding),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_LOGICAL(
    block-size,
    block_size,
    BlockSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    Size,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    border,
    border,
    Border,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_SHORTHAND(
    border-block-end,
    border_block_end,
    BorderBlockEnd,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled")
CSS_PROP_SHORTHAND(
    border-block-start,
    border_block_start,
    BorderBlockStart,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled")
CSS_PROP_LOGICAL(
    border-block-end-color,
    border_block_end_color,
    BorderBlockEndColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_HCK,
    kBorderColorKTable,
    BorderColor,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    border-block-end-style,
    border_block_end_style,
    BorderBlockEndStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_HK,
    kBorderStyleKTable,
    BorderStyle,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    border-block-end-width,
    border_block_end_width,
    BorderBlockEndWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_HKL | VARIANT_CALC,
    kBorderStyleKTable,
    BorderStyle,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    border-block-start-width,
    border_block_start_width,
    BorderBlockStartWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
    border_bottom_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderBottomColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-bottom-style,
    border_bottom_style,
    BorderBottomStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)  // on/off will need reflow
CSS_PROP_BORDER(
    border-bottom-width,
    border_bottom_width,
    BorderBottomWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TABLEBORDER(
    border-collapse,
    border_collapse,
    BorderCollapse,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBorderCollapseKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    border-color,
    border_color,
    BorderColor,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "")
CSS_PROP_SHORTHAND(
    border-image,
    border_image,
    BorderImage,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-image-source,
    border_image_source,
    BorderImageSource,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_START_IMAGE_LOADS,
    "",
    VARIANT_IMAGE | VARIANT_INHERIT,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-slice,
    border_image_slice,
    BorderImageSlice,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    kBorderImageSliceKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-width,
    border_image_width,
    BorderImageWidth,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-outset,
    border_image_outset,
    BorderImageOutset,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-image-repeat,
    border_image_repeat,
    BorderImageRepeat,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    0,
    kBorderImageRepeatKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    -moz-border-end,
    border_end,
    CSS_PROP_DOMPROP_PREFIXED(BorderEnd),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_LOGICAL(
    -moz-border-end-color,
    border_end_color,
    CSS_PROP_DOMPROP_PREFIXED(BorderEndColor),
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    BorderWidth,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    -moz-border-start,
    border_start,
    CSS_PROP_DOMPROP_PREFIXED(BorderStart),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_LOGICAL(
    -moz-border-start-color,
    border_start_color,
    CSS_PROP_DOMPROP_PREFIXED(BorderStartColor),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_LOGICAL,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    BorderColor,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    -moz-border-start-style,
    border_start_style,
    CSS_PROP_DOMPROP_PREFIXED(BorderStartStyle),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_LOGICAL,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    BorderWidth,
    Border,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-right-color,
    border_right_color,
    BorderRightColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BORDER(
    -moz-border-right-colors,
    border_right_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderRightColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-right-style,
    border_right_style,
    BorderRightStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-right-width,
    border_right_width,
    BorderRightWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TABLEBORDER(
    border-spacing,
    border_spacing,
    BorderSpacing,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_SHORTHAND(
    border-style,
    border_style,
    BorderStyle,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")  // on/off will need reflow
CSS_PROP_SHORTHAND(
    border-top,
    border_top,
    BorderTop,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-top-color,
    border_top_color,
    BorderTopColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED |
        CSS_PROPERTY_HASHLESS_COLOR_QUIRK,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_BORDER(
    -moz-border-top-colors,
    border_top_colors,
    CSS_PROP_DOMPROP_PREFIXED(BorderTopColors),
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    border-top-style,
    border_top_style,
    BorderTopStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)  // on/off will need reflow
CSS_PROP_BORDER(
    border-top-width,
    border_top_width,
    BorderTopWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_SHORTHAND(
    border-width,
    border_width,
    BorderWidth,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "")
CSS_PROP_SHORTHAND(
    border-radius,
    border_radius,
    BorderRadius,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_BORDER(
    border-top-left-radius,
    border_top_left_radius,
    BorderTopLeftRadius,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleBorder, mBorderRadius),
    eStyleAnimType_Corner_TopLeft)
CSS_PROP_BORDER(
    border-top-right-radius,
    border_top_right_radius,
    BorderTopRightRadius,
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    nullptr,
    offsetof(nsStyleBorder, mBorderRadius),
    eStyleAnimType_Corner_BottomLeft)
CSS_PROP_POSITION(
    bottom,
    _moz_column_width,
    CSS_PROP_DOMPROP_PREFIXED(ColumnWidth),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_AHL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleColumn, mColumnWidth),
    eStyleAnimType_Coord)
CSS_PROP_COLUMN(
    -moz-column-gap,
    _moz_column_gap,
    CSS_PROP_DOMPROP_PREFIXED(ColumnGap),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleColumn, mColumnGap),
    eStyleAnimType_Coord)
CSS_PROP_SHORTHAND(
    -moz-column-rule,
    _moz_column_rule,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRule),
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_COLUMN(
    -moz-column-rule-color,
    _moz_column_rule_color,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRuleColor),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_COLUMN(
    -moz-column-rule-style,
    _moz_column_rule_style,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRuleStyle),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBorderStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_COLUMN(
    -moz-column-rule-width,
    _moz_column_rule_width,
    CSS_PROP_DOMPROP_PREFIXED(ColumnRuleWidth),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_CONTENT(
    content,
    content,
    Content,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_START_IMAGE_LOADS,
    "",
    0,
    kContentKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_TEXT(
    -moz-control-character-visibility,
    _moz_control_character_visibility,
    CSS_PROP_DOMPROP_PREFIXED(ControlCharacterVisibility),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kControlCharacterVisibilityKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif
# 1513 "../../dist/include/nsCSSPropList.h"
CSS_PROP_CONTENT(
    counter-increment,
    counter_increment,
    CounterIncrement,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 137285
CSS_PROP_CONTENT(
    counter-reset,
    counter_reset,
    CounterReset,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 137285
CSS_PROP_USERINTERFACE(
    cursor,
    cursor,
    Cursor,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_START_IMAGE_LOADS |
        CSS_PROPERTY_IMAGE_IS_IN_ARRAY_0,
    "",
    0,
    kCursorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
CSS_PROP_VISIBILITY(
    direction,
    direction,
    Direction,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kDirectionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND)
# 1558 "../../dist/include/nsCSSPropList.h"
CSS_PROP_DISPLAY(
    display,
    display,
    Display,
    CSS_PROPERTY_PARSE_VALUE |
        // This is allowed because we need to make the placeholder
        // pseudo-element an inline-block in the UA stylesheet. It is a block
        // by default.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kDisplayKTable,
    offsetof(nsStyleDisplay, mDisplay),
    eStyleAnimType_EnumU8)
CSS_PROP_TABLEBORDER(
    empty-cells,
    empty_cells,
    EmptyCells,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kEmptyCellsKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    align-content,
    align_content,
    AlignContent,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kAlignContentKTable,
    offsetof(nsStylePosition, mAlignContent),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    align-items,
    align_items,
    AlignItems,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kAlignItemsKTable,
    offsetof(nsStylePosition, mAlignItems),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    align-self,
    align_self,
    AlignSelf,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    // NOTE: The parsing implementation for the 'flex' shorthand property has
    // its own code to parse each subproperty. It does not depend on the
    // longhand parsing defined here.
    VARIANT_HN,
    nullptr,
    offsetof(nsStylePosition, mFlexShrink),
    eStyleAnimType_float)
CSS_PROP_POSITION(
    flex-wrap,
    flex_wrap,
    FlexWrap,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kFlexWrapKTable,
    offsetof(nsStylePosition, mFlexWrap),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    order,
    order,
    Order,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HI,
    nullptr,
    offsetof(nsStylePosition, mOrder),
    eStyleAnimType_Custom) // <integer>
CSS_PROP_POSITION(
    justify-content,
    justify_content,
    JustifyContent,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kJustifyContentKTable,
    offsetof(nsStylePosition, mJustifyContent),
    eStyleAnimType_EnumU8)
CSS_PROP_DISPLAY(
    float,
    float,
    CSS_PROP_PUBLIC_OR_PRIVATE(CssFloat, Float),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER,
    "",
    VARIANT_HK,
    kFloatKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BORDER(
    -moz-float-edge,
    float_edge,
    FontFamily,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-feature-settings,
    font_feature_settings,
    FontFeatureSettings,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-kerning,
    font_kerning,
    FontKerning,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kFontKerningKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-language-override,
    font_language_override,
    FontLanguageOverride,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_NORMAL | VARIANT_INHERIT | VARIANT_STRING,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-size,
    font_size,
    FontSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "",
    0,
    kFontVariantLigaturesKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-variant-numeric,
    font_variant_numeric,
    FontVariantNumeric,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kFontVariantNumericKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-variant-position,
    font_variant_position,
    FontVariantPosition,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HMK,
    kFontVariantPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    font-weight,
    font_weight,
    FontWeight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
        // NOTE: This property has range restrictions on interpolation!
    "",
    0,
    kFontWeightKTable,
    offsetof(nsStyleFont, mFont.weight),
    eStyleAnimType_Custom)
CSS_PROP_UIRESET(
    -moz-force-broken-image-icon,
    force_broken_image_icon,
    CSS_PROP_DOMPROP_PREFIXED(ForceBrokenImageIcon),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HI,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // bug 58646
CSS_PROP_POSITION(
    grid-auto-flow,
    grid_auto_flow,
    GridAutoFlow,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    kGridAutoFlowKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-auto-columns,
    grid_auto_columns,
    GridAutoColumns,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-auto-rows,
    grid_auto_rows,
    GridAutoRows,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-template-areas,
    grid_template_areas,
    GridTemplateAreas,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-template-columns,
    grid_template_columns,
    GridTemplateColumns,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-template-rows,
    grid_template_rows,
    GridTemplateRows,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "layout.css.grid.enabled",
    0,
    kGridTrackBreadthKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    grid-template,
    grid_template,
    GridTemplate,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_SHORTHAND(
    grid,
    grid,
    Grid,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_POSITION(
    grid-column-start,
    grid_column_start,
    GridColumnStart,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-column-end,
    grid_column_end,
    GridColumnEnd,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-row-start,
    grid_row_start,
    GridRowStart,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    grid-row-end,
    grid_row_end,
    GridRowEnd,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    grid-column,
    grid_column,
    GridColumn,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_SHORTHAND(
    grid-row,
    grid_row,
    GridRow,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_SHORTHAND(
    grid-area,
    grid_area,
    GridArea,
    CSS_PROPERTY_PARSE_FUNCTION,
    "layout.css.grid.enabled")
CSS_PROP_POSITION(
    height,
    height,
    Height,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mHeight),
    eStyleAnimType_Coord)
CSS_PROP_VISIBILITY(
    image-orientation,
    image_orientation,
    ImageOrientation,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "layout.css.image-orientation.enabled",
    0,
    kImageOrientationKTable,
    offsetof(nsStyleVisibility, mImageOrientation),
    eStyleAnimType_None)
CSS_PROP_LIST(
    -moz-image-region,
    image_region,
    CSS_PROP_DOMPROP_PREFIXED(ImageRegion),
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    offsetof(nsStyleList, mImageRegion),
    eStyleAnimType_Custom)
CSS_PROP_UIRESET(
    ime-mode,
    ime_mode,
    ImeMode,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kIMEModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    inline-size,
    inline_size,
    InlineSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    Size,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    left,
    left,
    Left,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mOffset),
    eStyleAnimType_Sides_Left)
CSS_PROP_TEXT(
    letter-spacing,
    letter_spacing,
    LetterSpacing,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "",
    VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleText, mLetterSpacing),
    eStyleAnimType_None)
CSS_PROP_LIST(
    list-style-position,
    list_style_position,
    ListStylePosition,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kListStylePositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LIST(
    list-style-type,
    list_style_type,
    ListStyleType,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    margin,
    margin,
    Margin,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE,
    "")
CSS_PROP_LOGICAL(
    margin-block-end,
    margin_block_end,
    MarginBlockEnd,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS |
        CSS_PROPERTY_LOGICAL_END_EDGE,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Margin,
    Margin,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_LOGICAL(
    margin-block-start,
    margin_block_start,
    MarginBlockStart,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Margin,
    Margin,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_MARGIN(
    margin-bottom,
    margin_bottom,
    MarginBottom,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleMargin, mMargin),
    eStyleAnimType_Sides_Bottom)
CSS_PROP_LOGICAL(
    -moz-margin-end,
    margin_end,
    CSS_PROP_DOMPROP_PREFIXED(MarginEnd),
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_APPLIES_TO_PAGE_RULE |
        CSS_PROPERTY_LOGICAL |
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS |
        CSS_PROPERTY_LOGICAL_BLOCK_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HKLPO | VARIANT_CALC,
    kWidthKTable,
    MaxSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    max-height,
    max_height,
    MaxHeight,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLPO | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mMaxHeight),
    eStyleAnimType_Coord)
CSS_PROP_LOGICAL(
    max-inline-size,
    max_inline_size,
    MaxInlineSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_HKLPO | VARIANT_CALC,
    kWidthKTable,
    MaxSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    max-width,
    max_width,
    MaxWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mMinHeight),
    eStyleAnimType_Coord)
CSS_PROP_LOGICAL(
    min-block-size,
    min_block_size,
    MinBlockSize,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_LOGICAL_AXIS,
    "layout.css.vertical-text.enabled",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    MinSize,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    min-width,
    min_width,
    MinWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    offsetof(nsStylePosition, mMinWidth),
    eStyleAnimType_Coord)
CSS_PROP_DISPLAY(
    mix-blend-mode,
    mix_blend_mode,
    MixBlendMode,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "layout.css.mix-blend-mode.enabled",
    VARIANT_HK,
    kBlendModeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    isolation,
    isolation,
    Isolation,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "layout.css.isolation.enabled",
    VARIANT_HK,
    kIsolationKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    object-fit,
    object_fit,
    ObjectFit,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.object-fit-and-position.enabled",
    VARIANT_HK,
    kObjectFitKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    object-position,
    object_position,
    ObjectPosition,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.object-fit-and-position.enabled",
    0,
    kBackgroundPositionKTable,
    offsetof(nsStylePosition, mObjectPosition),
    eStyleAnimType_Custom)
CSS_PROP_LOGICAL(
    offset-block-end,
    offset_block_end,
    OffsetBlockEnd,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_LOGICAL,
    "layout.css.vertical-text.enabled",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    Offset,
    Position,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    opacity,
    opacity,
    Opacity,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HN,
    nullptr,
    offsetof(nsStyleDisplay, mOpacity),
    eStyleAnimType_float)
CSS_PROP_DISPLAY(
    -moz-orient,
    orient,
    CSS_PROP_DOMPROP_PREFIXED(Orient),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kOrientKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_BACKENDONLY(
    orphans,
    orphans,
    Orphans,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_AT_LEAST_ONE,
    "",
    VARIANT_HI,
    nullptr)
CSS_PROP_SHORTHAND(
    outline,
    outline,
    Outline,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_OUTLINE(
    outline-color,
    outline_color,
    OutlineColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kOutlineColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_OUTLINE(
    outline-style,
    outline_style,
    OutlineStyle,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kOutlineStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_OUTLINE(
    outline-width,
    outline_width,
    OutlineWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HKL | VARIANT_CALC,
    kBorderWidthKTable,
    offsetof(nsStyleOutline, mOutlineWidth),
    eStyleAnimType_Coord)
CSS_PROP_OUTLINE(
    overflow-clip-box,
    overflow_clip_box,
    OverflowClipBox,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "layout.css.overflow-clip-box.enabled",
    VARIANT_HK,
    kOverflowClipBoxKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    overflow-x,
    overflow_x,
    OverflowX,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePadding, mPadding),
    eStyleAnimType_Sides_Top)
CSS_PROP_BACKENDONLY(
    page,
    page,
    Page,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_AUTO | VARIANT_IDENTIFIER,
    nullptr)
CSS_PROP_DISPLAY(
    page-break-after,
    page_break_after,
    PageBreakAfter,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kPageBreakKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // temp fix for bug 24000
CSS_PROP_DISPLAY(
    page-break-before,
    page_break_before,
    PageBreakBefore,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kPageBreakKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // temp fix for bug 24000
CSS_PROP_DISPLAY(
    page-break-inside,
    page_break_inside,
    PageBreakInside,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kPageBreakInsideKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    paint-order,
    paint_order,
    PaintOrder,
    CSS_PROPERTY_PARSE_FUNCTION,
    "svg.paint-order.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_VISIBILITY(
    pointer-events,
    pointer_events,
    PointerEvents,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kPointerEventsKTable,
    offsetof(nsStyleVisibility, mPointerEvents),
    eStyleAnimType_EnumU8)
CSS_PROP_DISPLAY(
    position,
    position,
    Position,
    CSS_PROPERTY_PARSE_VALUE |
        // For position: sticky
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_HK,
    kPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_QUOTES(
    quotes,
    quotes,
    Quotes,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    resize,
    resize,
    Resize,
    CSS_PROPERTY_PARSE_VALUE |
        // This is allowed because the UA stylesheet sets 'resize: both;' on
        // textarea and we need to disable this for the placeholder
        // pseudo-element.
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kResizeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    right,
    right,
    Right,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.scroll-behavior.property-enabled",
    VARIANT_HK,
    kScrollBehaviorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-type-x,
    scroll_snap_type_x,
    ScrollSnapTypeX,
    CSS_PROPERTY_PARSE_VALUE,
    "layout.css.scroll-snap.enabled",
    VARIANT_HK,
    kScrollSnapTypeKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-type-y,
    scroll_snap_type_y,
    ScrollSnapPointsX,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.scroll-snap.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-points-y,
    scroll_snap_points_y,
    ScrollSnapPointsY,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_STORES_CALC,
    "layout.css.scroll-snap.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    scroll-snap-destination,
    scroll_snap_destination,
    ScrollSnapDestination,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kTableLayoutKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    text-align,
    text_align,
    TextAlign,
    CSS_PROPERTY_PARSE_VALUE | CSS_PROPERTY_VALUE_PARSER_FUNCTION |
      CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    // When we support aligning on a string, we can parse text-align
    // as a string....
    VARIANT_HK /* | VARIANT_STRING */,
    kTextAlignKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    -moz-text-align-last,
    text_combine_upright,
    TextCombineUpright,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled",
    0,
    kTextCombineUprightKTable,
    offsetof(nsStyleText, mTextCombineUpright),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXTRESET(
    text-decoration-color,
    text_decoration_color,
    TextDecorationColor,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_IGNORED_WHEN_COLORS_DISABLED,
    "",
    VARIANT_HCK,
    kBorderColorKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_TEXTRESET(
    text-decoration-line,
    text_decoration_line,
    TextDecorationLine,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    0,
    kTextDecorationLineKTable,
    offsetof(nsStyleTextReset, mTextDecorationLine),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXTRESET(
    text-decoration-style,
    text_decoration_style,
    TextDecorationStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kTextDecorationStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    text-transform,
    text_transform,
    TextTransform,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
    "",
    VARIANT_HK,
    kTextTransformKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    transform,
    transform,
    Transform,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    0,
    nullptr,
    offsetof(nsStylePosition, mSpecifiedTransform),
    eStyleAnimType_Custom)
CSS_PROP_POSITION(
    transform-origin,
    transform_origin,
    TransformOrigin,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_POSITION(
    perspective-origin,
    perspective_origin,
    PerspectiveOrigin,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    0,
    kBackgroundPositionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_Custom)
CSS_PROP_POSITION(
    perspective,
    perspective,
    Perspective,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_NONE | VARIANT_INHERIT | VARIANT_LENGTH | VARIANT_POSITIVE_DIMENSION,
    nullptr,
    offsetof(nsStylePosition, mChildPerspective),
    eStyleAnimType_Coord)
CSS_PROP_POSITION(
    transform-style,
    transform_style,
    TransformStyle,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    VARIANT_HK,
    kTransformStyleKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_POSITION(
    backface-visibility,
    backface_visibility,
    BackfaceVisibility,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kBackfaceVisibilityKTable,
    offsetof(nsStylePosition, mBackfaceVisibility),
    eStyleAnimType_None)
CSS_PROP_POSITION(
    top,
    top,
    Top,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHLP | VARIANT_CALC,
    nullptr,
    offsetof(nsStylePosition, mOffset),
    eStyleAnimType_Sides_Top)
 CSS_PROP_DISPLAY(
    touch-action,
    touch_action,
    TouchAction,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_PARSER_FUNCTION,
    "layout.css.touch_action.enabled",
    VARIANT_HK,
    kTouchActionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SHORTHAND(
    transition,
    transition,
    Transition,
    CSS_PROPERTY_PARSE_FUNCTION,
    "")
CSS_PROP_DISPLAY(
    transition-delay,
    transition_delay,
    TransitionDelay,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    transition-duration,
    transition_duration,
    TransitionDuration,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_TIME | VARIANT_NONNEGATIVE_DIMENSION, // used by list parsing
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    transition-property,
    transition_property,
    TransitionProperty,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_IDENTIFIER | VARIANT_NONE | VARIANT_ALL, // used only in shorthand
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_DISPLAY(
    transition-timing-function,
    transition_timing_function,
    TransitionTimingFunction,
    CSS_PROPERTY_PARSE_VALUE_LIST |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
    "",
    VARIANT_KEYWORD | VARIANT_TIMING_FUNCTION, // used by list parsing
    kTransitionTimingFunctionKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
CSS_PROP_TEXTRESET(
    unicode-bidi,
    unicode_bidi,
    UnicodeBidi,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kUnicodeBidiKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND)
# 3462 "../../dist/include/nsCSSPropList.h"
CSS_PROP_USERINTERFACE(
    -moz-user-focus,
    user_focus,
    CSS_PROP_DOMPROP_PREFIXED(UserFocus),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kUserFocusKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_USERINTERFACE(
    -moz-user-input,
    user_input,
    CSS_PROP_DOMPROP_PREFIXED(UserInput),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kUserInputKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX ??? // XXX bug 3935
CSS_PROP_USERINTERFACE(
    -moz-user-modify,
    user_modify,
    CSS_PROP_DOMPROP_PREFIXED(UserModify),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kUserModifyKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
CSS_PROP_UIRESET(
    -moz-user-select,
    user_select,
    CSS_PROP_DOMPROP_PREFIXED(UserSelect),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kUserSelectKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None) // XXX bug 3935
// NOTE: vertical-align is only supposed to apply to :first-letter when
// 'float' is 'none', but we don't worry about that since it has no
// effect otherwise
CSS_PROP_TEXTRESET(
    vertical-align,
    vertical_align,
    VerticalAlign,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_HKLP | VARIANT_CALC,
    kVerticalAlignKTable,
    offsetof(nsStyleTextReset, mVerticalAlign),
    eStyleAnimType_Coord)
CSS_PROP_POSITION(
    width,
    width,
    Width,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_STORES_CALC |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK |
        CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
    "",
    VARIANT_AHKLP | VARIANT_CALC,
    kWidthKTable,
    offsetof(nsStylePosition, mWidth),
    eStyleAnimType_Coord)
CSS_PROP_USERINTERFACE(
    -moz-window-dragging,
    _moz_window_dragging,
    CSS_PROP_DOMPROP_PREFIXED(WindowDragging),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kWindowDraggingKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_UIRESET(
    -moz-window-shadow,
    _moz_window_shadow,
    CSS_PROP_DOMPROP_PREFIXED(WindowShadow),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kWindowShadowKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    word-break,
    word_break,
    WordBreak,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kWordBreakKTable,
    offsetof(nsStyleText, mWordBreak),
    eStyleAnimType_EnumU8)
CSS_PROP_TEXT(
    word-spacing,
    word_spacing,
    WordSpacing,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
        CSS_PROPERTY_APPLIES_TO_PLACEHOLDER |
        CSS_PROPERTY_UNITLESS_LENGTH_QUIRK,
    "",
    VARIANT_HL | VARIANT_NORMAL | VARIANT_CALC,
    nullptr,
    offsetof(nsStyleText, mWordSpacing),
    eStyleAnimType_nscoord)
CSS_PROP_TEXT(
    word-wrap,
    word_wrap,
    WordWrap,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kWordWrapKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_TEXT(
    -moz-hyphens,
    hyphens,
    CSS_PROP_DOMPROP_PREFIXED(Hyphens),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kHyphensKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_VISIBILITY(
    writing-mode,
    writing_mode,
    WritingMode,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_UA_SHEETS,
    "layout.css.vertical-text.enabled",
    VARIANT_HK,
    kWritingModeKTable,
    offsetof(nsStyleVisibility, mWritingMode),
    eStyleAnimType_EnumU8)
CSS_PROP_POSITION(
    z-index,
    z_index,
    ZIndex,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE,
    "",
    VARIANT_HI,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_XUL(
    -moz-stack-sizing,
    stack_sizing,
    CSS_PROP_DOMPROP_PREFIXED(StackSizing),
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kStackSizingKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)

#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
CSS_PROP_FONT(
    -moz-script-level,
    script_level,
    ScriptLevel,
    // REVIEW: no range restriction?
    // NOTE: CSSParserImpl::ParseSingleValueProperty only accepts this
    // property when mUnsafeRulesEnabled is set.
    CSS_PROPERTY_PARSE_VALUE,
    "",
    // script-level can take Auto, Integer and Number values, but only Auto
    // ("increment if parent is not in displaystyle") and Integer
    // ("relative") values can be specified in a style sheet.
    "",
    VARIANT_HK,
    kMathVariantKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_FONT(
    -moz-math-display,
    math_display,
    MathDisplay,
    // NOTE: CSSParserImpl::ParseSingleValueProperty only accepts this
    // property when mUnsafeRulesEnabled is set.
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kMathDisplayKTable,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif // !defined(CSS_PROP_LIST_EXCLUDE_INTERNAL)
# 3786 "../../dist/include/nsCSSPropList.h"
#endif // !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND)
# 3787 "../../dist/include/nsCSSPropList.h"

CSS_PROP_SVGRESET(
    clip-path,
    clip_path,
    ClipPath,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_CREATES_STACKING_CONTEXT,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    clip-rule,
    clip_rule,
    ClipRule,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kFillRuleKTable,
    offsetof(nsStyleSVG, mClipRule),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    color-interpolation,
    color_interpolation,
    ColorInterpolation,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kColorInterpolationKTable,
    offsetof(nsStyleSVG, mColorInterpolation),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    color-interpolation-filters,
    color_interpolation_filters,
    ColorInterpolationFilters,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kColorInterpolationKTable,
    offsetof(nsStyleSVG, mColorInterpolationFilters),
    eStyleAnimType_EnumU8)
CSS_PROP_SVGRESET(
    dominant-baseline,
    dominant_baseline,
    DominantBaseline,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kDominantBaselineKTable,
    offsetof(nsStyleSVGReset, mDominantBaseline),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    image-rendering,
    image_rendering,
    ImageRendering,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kImageRenderingKTable,
    offsetof(nsStyleSVG, mImageRendering),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    marker-end,
    marker_end,
    MarkerEnd,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    marker-mid,
    marker_mid,
    MarkerMid,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HUO,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
CSS_PROP_SVG(
    marker-start,
    marker_start,
    MarkerStart,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kShapeRenderingKTable,
    offsetof(nsStyleSVG, mShapeRendering),
    eStyleAnimType_EnumU8)
CSS_PROP_SVGRESET(
    stop-color,
    stop_color,
    StopColor,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HC,
    nullptr,
    offsetof(nsStyleSVGReset, mStopColor),
    eStyleAnimType_Color)
CSS_PROP_SVGRESET(
    stop-opacity,
    stop_opacity,
    StopOpacity,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HN,
    nullptr,
    offsetof(nsStyleSVGReset, mStopOpacity),
    eStyleAnimType_float)
CSS_PROP_SVG(
    stroke,
    stroke,
    Stroke,
    CSS_PROPERTY_PARSE_FUNCTION,
    "",
    0,
    kContextPatternKTable,
    offsetof(nsStyleSVG, mStroke),
    eStyleAnimType_PaintServer)
CSS_PROP_SVG(
    stroke-dasharray,
    stroke_dasharray,
    StrokeDasharray,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_NUMBERS_ARE_PIXELS,
        // NOTE: Internal values have range restrictions.
    "",
    0,
    kStrokeContextValueKTable,
    CSS_PROP_NO_OFFSET, /* property stored in 2 separate members */
    eStyleAnimType_Custom)
CSS_PROP_SVG(
    stroke-dashoffset,
    stroke_dashoffset,
    StrokeDashoffset,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_NUMBERS_ARE_PIXELS,
    "",
    VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
    kStrokeContextValueKTable,
    offsetof(nsStyleSVG, mStrokeDashoffset),
    eStyleAnimType_Coord)
CSS_PROP_SVG(
    stroke-linecap,
    stroke_linecap,
    StrokeOpacity,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HN | VARIANT_OPENTYPE_SVG_KEYWORD,
    kContextOpacityKTable,
    offsetof(nsStyleSVG, mStrokeOpacity),
    eStyleAnimType_float)
CSS_PROP_SVG(
    stroke-width,
    stroke_width,
    StrokeWidth,
    CSS_PROPERTY_PARSE_VALUE |
        CSS_PROPERTY_VALUE_NONNEGATIVE |
        CSS_PROPERTY_NUMBERS_ARE_PIXELS,
    "",
    VARIANT_HLPN | VARIANT_OPENTYPE_SVG_KEYWORD,
    kStrokeContextValueKTable,
    offsetof(nsStyleSVG, mStrokeWidth),
    eStyleAnimType_Coord)
CSS_PROP_SVG(
    text-anchor,
    text_anchor,
    TextAnchor,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kTextAnchorKTable,
    offsetof(nsStyleSVG, mTextAnchor),
    eStyleAnimType_EnumU8)
CSS_PROP_SVG(
    text-rendering,
    text_rendering,
    TextRendering,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kTextRenderingKTable,
    offsetof(nsStyleSVG, mTextRendering),
    eStyleAnimType_EnumU8)
CSS_PROP_SVGRESET(
    vector-effect,
    vector_effect,
    VectorEffect,
    CSS_PROPERTY_PARSE_VALUE,
    "",
    VARIANT_HK,
    kVectorEffectKTable,
    offsetof(nsStyleSVGReset, mVectorEffect),
    eStyleAnimType_EnumU8)

CSS_PROP_POSITION(
    will-change,
    will_change,
    WillChange,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
        CSS_PROPERTY_ALWAYS_ENABLED_IN_CHROME_OR_CERTIFIED_APP,
    "layout.css.will-change.enabled",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)

// The shorthands below are essentially aliases, but they require different
// parsing rules, and are therefore implemented as shorthands.
CSS_PROP_SHORTHAND(
    -moz-transform,
    _moz_transform,
    MozTransform,
    CSS_PROPERTY_PARSE_FUNCTION |
        CSS_PROPERTY_IS_ALIAS,
    "layout.css.prefixes.transforms")

#ifndef CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND
#ifndef CSS_PROP_LIST_EXCLUDE_INTERNAL
// We have a few properties that are in style structs but are not stored
// in style sheets (or nsCSS* structs).  Some fields in these property
// definitions are bogus (e.g., they work for nsRuleData* offsets but
// not nsCSS* offsets).  Callers that care about these bogus fields can
// define CSS_PROP_STUB_NOT_CSS to define a replacement for these
// entries.
#ifdef CSS_PROP_STUB_NOT_CSS
CSS_PROP_STUB_NOT_CSS
CSS_PROP_STUB_NOT_CSS
#else
# 4160 "../../dist/include/nsCSSPropList.h"
CSS_PROP_FONT(
    -x-lang,
    _x_lang,
    eStyleAnimType_None)
CSS_PROP_FONT(
    -x-text-zoom,
    _x_text_zoom,
    TextZoom,
    CSS_PROPERTY_PARSE_INACCESSIBLE,
    "",
    0,
    nullptr,
    CSS_PROP_NO_OFFSET,
    eStyleAnimType_None)
#endif /* !defined(CSS_PROP_STUB_NOT_CSS) */
# 4191 "../../dist/include/nsCSSPropList.h"
#endif /* !defined(CSS_PROP_LIST_EXCLUDE_INTERNAL) */
# 4192 "../../dist/include/nsCSSPropList.h"
#endif /* !defined(CSS_PROP_LIST_ONLY_COMPONENTS_OF_ALL_SHORTHAND) */
# 4193 "../../dist/include/nsCSSPropList.h"

#ifdef USED_CSS_PROP

#else /* !defined(USED_CSS_PROP) */
# 4227 "../../dist/include/nsCSSPropList.h"

#ifdef DEFINED_CSS_PROP_FONT
#undef CSS_PROP_FONT
#undef DEFINED_CSS_PROP_FONT
#endif
# 4232 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_COLOR
#undef CSS_PROP_COLOR
#undef DEFINED_CSS_PROP_COLOR
#endif
#ifdef DEFINED_CSS_PROP_TEXT
#undef CSS_PROP_TEXT
#endif
# 4276 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_UIRESET
#undef CSS_PROP_UIRESET
#undef DEFINED_CSS_PROP_UIRESET
#endif
# 4280 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_TABLE
#undef CSS_PROP_TABLE
#undef DEFINED_CSS_PROP_TABLE
#endif
# 4284 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_TABLEBORDER
#undef CSS_PROP_TABLEBORDER
#endif
#ifdef DEFINED_CSS_PROP_BACKENDONLY
#undef CSS_PROP_BACKENDONLY
#undef DEFINED_CSS_PROP_BACKENDONLY
#endif
# 4328 "../../dist/include/nsCSSPropList.h"

#endif /* !defined(USED_CSS_PROP) */
# 4330 "../../dist/include/nsCSSPropList.h"

#ifdef DEFINED_CSS_PROP_SHORTHAND
#undef CSS_PROP_SHORTHAND
#undef DEFINED_CSS_PROP_SHORTHAND
#endif
# 4335 "../../dist/include/nsCSSPropList.h"
#ifdef DEFINED_CSS_PROP_LOGICAL
#undef CSS_PROP_LOGICAL
#undef DEFINED_CSS_PROP_LOGICAL
#endif
# 4339 "../../dist/include/nsCSSPropList.h"

#undef CSS_PROP_DOMPROP_PREFIXED
# 86 "/Users/luser/build/mozilla-central/layout/style/nsDOMCSSDeclaration.h" 2

#define CSS_PROP_ALIAS(aliasname_, propid_, aliasmethod_, pref_)  \
  CSS_PROP(X, propid_, aliasmethod_, X, pref_, X, X, X, X, X)
#if 0 /* expanded by -frewrite-includes */
#include "nsCSSPropAliasList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsCSSPropAliasList.h" 1
/* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */
/* This Source Code Form is subject to the terms of the Mozilla Public
  or if the boolean property whose name is 'pref' is set to true.

 ******/

CSS_PROP_ALIAS(-moz-transform-origin,
               transform_origin,
               MozTransformOrigin,
               "layout.css.prefixes.transforms")
CSS_PROP_ALIAS(-moz-perspective-origin,
               perspective_origin,
               MozPerspectiveOrigin,
               "layout.css.prefixes.transforms")
CSS_PROP_ALIAS(-moz-perspective,
               perspective,
               MozPerspective,
               "layout.css.prefixes.transforms")
protected:
  ;
};

bool IsCSSPropertyExposedToJS(nsCSSProperty aProperty, JSContext* cx, JSObject* obj);

template <nsCSSProperty Property>
MOZ_ALWAYS_INLINE bool IsCSSPropertyExposedToJS(JSContext* cx, JSObject* obj)
{
  return IsCSSPropertyExposedToJS(Property, cx, obj);
}

#endif // nsDOMCSSDeclaration_h___
# 164 "/Users/luser/build/mozilla-central/layout/style/nsDOMCSSDeclaration.h"
# 17 "/Users/luser/build/mozilla-central/layout/style/nsComputedDOMStyle.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsColor.h"
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/mozilla-central/layout/style/nsComputedDOMStyle.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIContent.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/layout/style/nsComputedDOMStyle.h"

namespace mozilla {
namespace dom {
class Element;
}
}

struct nsComputedStyleMap;
class nsIFrame;
struct nsTimingFunction;
class gfx3DMatrix;

class nsComputedDOMStyle MOZ_FINAL : public nsDOMCSSDeclaration
{
public:
  typedef nsCSSProps::KTableValue KTableValue;

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsComputedDOMStyle,
                                                                   nsICSSDeclaration)

  NS_DECL_NSICSSDECLARATION

  NS_DECL_NSIDOMCSSSTYLEDECLARATION_HELPER
  virtual already_AddRefed<mozilla::dom::CSSValue>
  GetPropertyCSSValue(const nsAString& aProp, mozilla::ErrorResult& aRv)
    MOZ_OVERRIDE;
  using nsICSSDeclaration::GetPropertyCSSValue;
  virtual void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aPropName) MOZ_OVERRIDE;

  enum StyleType {
    eDefaultOnly, // Only includes UA and user sheets
    eAll // Includes all stylesheets
  };

  ;

  

  static already_AddRefed<nsStyleContext>
  GetStyleContextForElement(mozilla::dom::Element* aElement, nsIAtom* aPseudo,
                            nsIPresShell* aPresShell,
                            StyleType aStyleType = eAll);

  ;

  ;

  // Helper for nsDOMWindowUtils::GetVisitedDependentComputedStyle
  

  bool mExposeVisitedStyle;

#ifdef DEBUG
  bool mFlushedPendingReflows;
#endif
# 654 "/Users/luser/build/mozilla-central/layout/style/nsComputedDOMStyle.h"
};

;

#endif /* nsComputedDOMStyle_h__ */
# 664 "/Users/luser/build/mozilla-central/layout/style/nsComputedDOMStyle.h"

# 31 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleSet.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsStyleSet.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * the container for the style sheets that apply to a presentation, and
 * the internal API that the style system exposes for creating (and
 * potentially re-creating) style contexts
 */

#ifndef nsStyleSet_h_
#define nsStyleSet_h_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/layout/style/nsStyleSet.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CSSStyleSheet.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/layout/style/nsStyleSet.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/layout/style/nsStyleSet.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsIStyleRuleProcessor.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/layout/style/nsIStyleRuleProcessor.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * internal abstract interface for containers (roughly origins within
 * the CSS cascade) that provide style rules matching an element or
 * pseudo-element
 */

#ifndef nsIStyleRuleProcessor_h___
#define nsIStyleRuleProcessor_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MemoryReporting.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/layout/style/nsIStyleRuleProcessor.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
struct PseudoElementStateRuleProcessorData;
struct AttributeRuleProcessorData;
class nsPresContext;

// IID for the nsIStyleRuleProcessor interface
// {c1d6001e-4fcb-4c40-bce1-5eba80bfd8f3}
#define NS_ISTYLE_RULE_PROCESSOR_IID     \
{ 0xc1d6001e, 0x4fcb, 0x4c40, \
  {0xbc, 0xe1, 0x5e, 0xba, 0x80, 0xbf, 0xd8, 0xf3} }


/* The style rule processor interface is a mechanism to separate the matching
 * of style rules from style sheet instances.
 * Simple style sheets can and will act as their own processor. 
 * Sheets where rule ordering interlaces between multiple sheets, will need to 
 * share a single rule processor between them (CSS sheets do this for cascading order)
 *
 * @see nsIStyleRule (for significantly more detailed comments)
 */
class nsIStyleRuleProcessor : public nsISupports {
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTYLE_RULE_PROCESSOR_IID)

  // Shorthand for:
  //  nsCOMArray<nsIStyleRuleProcessor>::nsCOMArrayEnumFunc
  typedef bool (* EnumFunc)(nsIStyleRuleProcessor*, void*);

  /**
   * Find the |nsIStyleRule|s matching the given content node and
   * position the given |nsRuleWalker| at the |nsRuleNode| in the rule
   * tree representing that ordered list of rules (with higher
   * precedence being farther from the root of the lexicographic tree).
   */
  ;

  /**
   * Just like the previous |RulesMatching|, except for a given content
   * node <em>and pseudo-element</em>.
   * processor may return 0.
   */
  ;
  ;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIStyleRuleProcessor,
                              NS_ISTYLE_RULE_PROCESSOR_IID)

#endif /* nsIStyleRuleProcessor_h___ */
# 141 "/Users/luser/build/mozilla-central/layout/style/nsIStyleRuleProcessor.h"
# 20 "/Users/luser/build/mozilla-central/layout/style/nsStyleSet.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsBindingManager.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsBindingManager.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsBindingManager_h_
#define nsBindingManager_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsIContent.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsBindingManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsURIHashKey.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsBindingManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsBindingManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsXBLBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsXBLBinding.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsXBLBinding_h_
#define nsXBLBinding_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsXBLService.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsXBLService.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

//////////////////////////////////////////////////////////////////////////////////////////

#ifndef nsXBLService_h_
#define nsXBLService_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsXBLService.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWeakReference.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsXBLService.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsXBLService.h"

namespace mozilla {
namespace dom {
class EventTarget;
}
}

class nsXBLService MOZ_FINAL : public nsSupportsWeakReference
{
  NS_DECL_ISUPPORTS

  static nsXBLService* gInstance;

  ;

  
  /**
   * This method calls the one below with an empty |aDontExtendURIs| array.
   */
  ;

  /**
   * This method loads a binding doc and then builds the specific binding
   * required. It can also peek without building.
   * @param aBoundElement the element to get a binding for
   * @param aURI the binding URI
   * @param aPeekFlag if true then just peek to see if the binding is ready
   * @param aIsReady [out] if the binding is ready or not
   * @param aResult [out] where to store the resulting binding (not used if
   *                      aPeekFlag is true, otherwise it must be non-null)
   * @param aDontExtendURIs a set of URIs that are already bound to this
   *        element. If a binding extends any of these then further loading
   *        is aborted (because it would lead to the binding extending itself)
   *        and NS_ERROR_ILLEGAL_VALUE is returned.
   *
   * @note This method always calls LoadBindingDocumentInfo(), so it's
   *       enough to funnel all security checks through that function.
   */
  ;

// MEMBER VARIABLES
public:
  static bool gDisableChromeCache;
  static bool     gAllowDataURIs;            // Whether we should allow data
                                             // urls in -moz-binding. Needed for
                                             // testing.
};

#endif
# 122 "../../dist/include/nsXBLService.h"
# 10 "../../dist/include/nsXBLBinding.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsXBLBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsXBLBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsINodeList.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsXBLBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsXBLBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsXBLBinding.h"

class nsXBLPrototypeBinding;
class nsIContent;
class nsIAtom;
class nsIDocument;
class nsIScriptContext;

namespace mozilla {
namespace dom {

class ShadowRoot;
class XBLChildrenElement;

} // namespace dom
} // namespace mozilla

class nsAnonymousContentList;

// *********************************************************************/
// The XBLBinding class

class nsXBLBinding MOZ_FINAL
{
public:
  ;
  
  
  ;

  
  ;

  
  ;

  /*
   * Does a lookup for a method or attribute provided by one of the bindings'
   * prototype implementation. If found, |desc| will be set up appropriately,
   * and wrapped into cx->compartment.
   *
   * May only be called when XBL code is being run in a separate scope, because
   * otherwise we don't have untainted data with which to do a proper lookup.
   */
  ;

  /*
   * Determines whether the binding has a field with the given name.
   */
  ;

protected:

  ~nsXBLBinding();

  /*
   * Internal version. Requires that aCx is in appropriate xbl scope.
   */
  ;

public:

  ;
  

  ;
  ;
  ;

  ;
  ;
};

#endif // nsXBLBinding_h_
class nsIURI;
class nsXBLDocumentInfo;
class nsIStreamListener;
class nsStyleSet;
class nsXBLBinding;
template<class E> class nsRefPtr;
typedef nsTArray<nsRefPtr<nsXBLBinding> > nsBindingList;
class nsIPrincipal;
class nsITimer;

namespace mozilla {
class CSSStyleSheet;
} // namespace mozilla

class nsBindingManager MOZ_FINAL : public nsStubMutationObserver
{
  /**
   * Notify the binding manager that an element
   * has been removed from its document,
   * so that it can update any bindings or
   * nsIAnonymousContentCreator-created anonymous
   * content that may depend on the document.
   * @param aContent the element that's being moved
   * @param aOldDocument the old document in which the
   *   content resided.
   */
  // Our document.  This is a weak ref; the document owns us
  nsIDocument* mDocument;
};

#endif
# 209 "../../dist/include/nsBindingManager.h"
class nsRuleWalker;
struct ElementDependentRuleProcessorData;
struct TreeMatchContext;

namespace mozilla {
class EventStates;
} // namespace mozilla

class nsEmptyStyleRule MOZ_FINAL : public nsIStyleRule
{
private:
  

public:
  NS_DECL_ISUPPORTS
  virtual void MapRuleInfoInto(nsRuleData* aRuleData) MOZ_OVERRIDE;
#ifdef DEBUG
  virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
#endif
# 53 "/Users/luser/build/mozilla-central/layout/style/nsStyleSet.h"
};

class nsInitialStyleRule MOZ_FINAL : public nsIStyleRule
{
private:
  

public:
  NS_DECL_ISUPPORTS
  virtual void MapRuleInfoInto(nsRuleData* aRuleData) MOZ_OVERRIDE;
#ifdef DEBUG
  virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
#endif
# 66 "/Users/luser/build/mozilla-central/layout/style/nsStyleSet.h"
};

class nsDisableTextZoomStyleRule MOZ_FINAL : public nsIStyleRule
{
private:
  

public:
  NS_DECL_ISUPPORTS
  virtual void MapRuleInfoInto(nsRuleData* aRuleData) MOZ_OVERRIDE;
#ifdef DEBUG
  virtual void List(FILE* out = stdout, int32_t aIndent = 0) const MOZ_OVERRIDE;
#endif
# 79 "/Users/luser/build/mozilla-central/layout/style/nsStyleSet.h"
};

// The style set object is created by the document viewer and ownership is
// then handed off to the PresShell.  Only the PresShell should delete a
// style set.

class nsStyleSet
{
 public:
  ;

  ;

  ;

  

  // enable / disable the Quirk style sheet
  ;

  // get a style context for a non-pseudo frame.
  ;

  ;

  // Get a style context (with the given parent) for the
  // sequence of style rules in the |aRules| array.
  already_AddRefed<nsStyleContext>
  ResolveStyleForRules(nsStyleContext* aParentContext,
                       const nsTArray< nsCOMPtr<nsIStyleRule> > &aRules);

  // Get a style context that represents aBaseContext, but as though

  // The "origins" of the CSS cascade, from lowest precedence to
  // highest (for non-!important rules).
  enum sheetType {
    eAgentSheet, // CSS
    eUserSheet, // CSS
    ePresHintSheet,
    eSVGAttrAnimationSheet,
    eDocSheet, // CSS
    eScopedDocSheet,
    eStyleAttrSheet,
    eOverrideSheet, // CSS
    eAnimationSheet,
    eTransitionSheet,
    eSheetTypeCount
    // be sure to keep the number of bits in |mDirty| below and in
    // NS_RULE_NODE_LEVEL_MASK updated when changing the number of sheet
    // types
  };

  // APIs to manipulate the style sheet lists.  The sheets in each
  // list are stored with the most significant sheet last.
  ;
  ;
  ;
  ;
  ;

  ;

  // Enable/Disable entire author style level (Doc, ScopedDoc & PresHint levels)
  ;
  // they have cached rule cascades; getting the rule cascades again in
  // order to do rule matching will get the correct rule cascade.
  bool HasCachedStyleData() const {
    return (mRuleTree && mRuleTree->TreeHasCachedData()) || !mRoots.IsEmpty();
  }

  // Notify the style set that a rulenode is no longer in use, or was
  // just created and is not in use yet.
  void RuleNodeUnused() {
    ++mUnusedRuleNodeCount;
  }

  // Notify the style set that a rulenode that wasn't in use now is
  void RuleNodeInUse() {
    --mUnusedRuleNodeCount;
  }

  mozilla::CSSStyleSheet::EnsureUniqueInnerResult EnsureUniqueInnerOnCSSSheets();

  nsIStyleRule* InitialStyleRule();

 private:
  nsStyleSet(const nsStyleSet& aCopy) = delete;
  nsStyleSet& operator=(const nsStyleSet& aCopy) = delete;

  // Run mark-and-sweep GC on mRuleTree and mOldRuleTrees, based on mRoots.
  void GCRuleTrees();

  // Update the rule processor list after a change to the style sheet list.
  nsresult GatherRuleProcessors(sheetType aType);

  void AddImportantRules(nsRuleNode* aCurrLevelNode,
                         nsRuleNode* aLastPrevLevelNode,
                         nsRuleWalker* aRuleWalker);
  // The arrays for ePresHintSheet, eStyleAttrSheet, eTransitionSheet,
  // and eAnimationSheet are always empty.  (FIXME:  We should reduce
  // the storage needed for them.)
  nsCOMArray<nsIStyleSheet> mSheets[eSheetTypeCount];

  // mRuleProcessors[eScopedDocSheet] is always null; rule processors
  // for scoped style sheets are stored in mScopedDocSheetRuleProcessors.
  nsCOMPtr<nsIStyleRuleProcessor> mRuleProcessors[eSheetTypeCount];

  // Rule processors for HTML5 scoped style sheets, one per scope.
  nsTArray<nsCOMPtr<nsIStyleRuleProcessor> > mScopedDocSheetRuleProcessors;

  // cached instance for enabling/disabling
  nsCOMPtr<nsIStyleSheet> mQuirkStyleSheet;

  nsRefPtr<nsBindingManager> mBindingManager;

  nsRuleNode* mRuleTree; // This is the root of our rule tree.  It is a
                         // lexicographic tree of matched rules that style
                         // contexts use to look up properties.

  uint16_t mBatching;

  unsigned mInShutdown : 1;
  unsigned mAuthorStyleDisabled: 1;
  unsigned mInReconstruct : 1;
  unsigned mInitFontFeatureValuesLookup : 1;
  unsigned mDirty : 10;  // one dirty bit is used per sheet type

  uint32_t mUnusedRuleNodeCount; // used to batch rule node GC
  nsTArray<nsStyleContext*> mRoots; // style contexts with no parent

  // Empty style rules to force things that restrict which properties
  // apply into different branches of the rule tree.
  nsRefPtr<nsEmptyStyleRule> mFirstLineRule, mFirstLetterRule, mPlaceholderRule;

  // Style rule which sets all properties to their initial values for
  // determining when context-sensitive values are in use.
  nsRefPtr<nsInitialStyleRule> mInitialStyleRule;

  // Style rule that sets the internal -x-text-zoom property on
  // <svg:text> elements to disable the effect of text zooming.
  nsRefPtr<nsDisableTextZoomStyleRule> mDisableTextZoomStyleRule;

  // Old rule trees, which should only be non-empty between
  // BeginReconstruct and EndReconstruct, but in case of bugs that cause
  // style contexts to exist too long, may last longer.
  nsTArray<nsRuleNode*> mOldRuleTrees;

  // whether font feature values lookup object needs initialization
  nsRefPtr<gfxFontFeatureValueSet> mFontFeatureValuesLookup;
};

#ifdef MOZILLA_INTERNAL_API
inline
void nsRuleNode::AddRef()
{
  if (mRefCnt++ == 0 && !IsRoot()) {
    mPresContext->StyleSet()->RuleNodeInUse();
  }
}

inline
void nsRuleNode::Release()
{
  if (--mRefCnt == 0 && !IsRoot()) {
    mPresContext->StyleSet()->RuleNodeUnused();
  }
}
#endif
# 544 "/Users/luser/build/mozilla-central/layout/style/nsStyleSet.h"

#endif
# 546 "/Users/luser/build/mozilla-central/layout/style/nsStyleSet.h"
# 32 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2

#if 0 /* expanded by -frewrite-includes */
#include "nsPrintfCString.h"
#endif /* expanded by -frewrite-includes */
# 34 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"

#if 0 /* expanded by -frewrite-includes */
#include "nsReadableUtils.h"
#endif /* expanded by -frewrite-includes */
# 36 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"

#if 0 /* expanded by -frewrite-includes */
#include "nsColor.h"
#endif /* expanded by -frewrite-includes */
# 38 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "nsGfxCIID.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsGfxCIID.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsGfxCIID_h__
#define nsGfxCIID_h__

#define NS_FONT_ENUMERATOR_CID \
{ 0xa6cf9115, 0x15b3, 0x11d2, \
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* base class #1 for rendering objects that have child lists */

#ifndef nsContainerFrame_h___
#define nsContainerFrame_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsContainerFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSplittableFrame.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsSplittableFrame.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * base class for rendering objects that can be split across lines,
 * columns, or pages
 */

#ifndef nsSplittableFrame_h___
#define nsSplittableFrame_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsSplittableFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsFrame.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsFrame.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* base class of all rendering objects */

#ifndef nsFrame_h___
#define nsFrame_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Likely.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsBox.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsBox.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsBox_h___
#define nsBox_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsBox.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIFrame.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsBox.h"

class nsITheme;

class nsBox : public nsIFrame {

public:

  friend class nsIFrame;

  ;

  virtual nsSize GetPrefSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
  virtual nsSize GetMinSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
  virtual nsSize GetMaxSize(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
  virtual nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;
  virtual nscoord GetBoxAscent(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;

  virtual nsSize GetMinSizeForScrollArea(nsBoxLayoutState& aBoxLayoutState) MOZ_OVERRIDE;

  virtual bool IsCollapsed() MOZ_OVERRIDE;

  virtual void SetBounds(nsBoxLayoutState& aBoxLayoutState, const nsRect& aRect,
                         bool aRemoveOverflowAreas = false) MOZ_OVERRIDE;

  virtual nsresult GetBorder(nsMargin& aBorderAndPadding) MOZ_OVERRIDE;
  virtual nsresult GetPadding(nsMargin& aBorderAndPadding) MOZ_OVERRIDE;
  virtual nsresult GetMargin(nsMargin& aMargin) MOZ_OVERRIDE;

  
  

  virtual nsresult RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIFrame* aChild) MOZ_OVERRIDE;

  ;

  ;
  ;
  static nscoord BoundsCheck(nscoord aMinSize, nscoord aPrefSize, nscoord aMaxSize);
  ;
  NS_IMETHOD DoLayout(nsBoxLayoutState& aBoxLayoutState);
  ;

#ifdef DEBUG_LAYOUT
  virtual void GetBoxName(nsAutoString& aName);
  void PropagateDebug(nsBoxLayoutState& aState);
#endif
# 102 "../../dist/include/nsBox.h"

  static bool gGotTheme;
  static nsITheme* gTheme;

  enum eMouseThrough {
    unset,
    never,
    always
  };

private:

  //nscoord mX;
  //nscoord mY;
};

#ifdef DEBUG_LAYOUT
#define NS_BOX_ASSERTION(box,expr,str) \
  if (!(expr)) { \
       box->DumpBox(stdout); \
       NS_DebugBreak(NSDebugAssertion, str, #expr, __FILE__, __LINE__); \
  }
#else
# 125 "../../dist/include/nsBox.h"
#define NS_BOX_ASSERTION(box,expr,str) {}
#endif
# 127 "../../dist/include/nsBox.h"

#endif
# 129 "../../dist/include/nsBox.h"

# 15 "../../dist/include/nsFrame.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "prlog.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsFrame.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsIPresShell.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsHTMLReflowState.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsHTMLReflowState.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* struct containing the input to nsIFrame::Reflow */

#ifndef nsHTMLReflowState_h___
#define nsHTMLReflowState_h___

struct nsCSSOffsetState {
public:
  typedef mozilla::WritingMode WritingMode;
  typedef mozilla::LogicalMargin LogicalMargin;

  // the frame being reflowed
  nsIFrame*           frame;
  /**
   * Computes margin values from the specified margin style information, and
   * fills in the mComputedMargin member.
   *
   * @param aInlineDirPercentBasis
   *    Length to use for resolving percentage margin values in the inline
   *    axis. Usually the containing block inline-size (width if writing mode
   *    is horizontal, and height if vertical).
   * @param aBlockDirPercentBasis
   *        our prev-in-flows.
   */
  

  /**
   * Apply the mComputed(Min/Max)BSize constraints to the content
   * size computed so far.
   *
   * @param aBSize The block-size that we've computed an to which we want to apply
   *        min/max constraints.
   * @param aConsumed The amount of the computed block-size that was consumed by
   *        our prev-in-flows.
   */
  

  

  // Compute the offsets for a relative position element
  ;

  // If a relatively positioned element, adjust the position appropriately.
  ;

  

  

  

#ifdef DEBUG
  // Reflow trace methods.  Defined in nsFrame.cpp so they have access
  // to the display-reflow infrastructure.
  static void* DisplayInitConstraintsEnter(nsIFrame* aFrame,
                                           nsHTMLReflowState* aState,
                                           nscoord aCBWidth,
                                           nscoord aCBHeight,
                                           const nsMargin* aBorder,
                                           const nsMargin* aPadding);
  static void DisplayInitConstraintsExit(nsIFrame* aFrame,
                                         nsHTMLReflowState* aState,
                                         void* aValue);
  static void* DisplayInitFrameTypeEnter(nsIFrame* aFrame,
                                         nsHTMLReflowState* aState);
  static void DisplayInitFrameTypeExit(nsIFrame* aFrame,
                                       nsHTMLReflowState* aState,
                                       void* aValue);
#endif
# 867 "../../dist/include/nsHTMLReflowState.h"
  ;

  // Calculates the computed values for the 'min-Width', 'max-Width',
  // 'min-Height', and 'max-Height' properties, and stores them in the assorted
  // data members
  ;

  ;

  ;
};

#endif /* nsHTMLReflowState_h___ */
# 918 "../../dist/include/nsHTMLReflowState.h"

# 19 "../../dist/include/nsFrame.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsHTMLParts.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsHTMLParts.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* factory functions for rendering object classes */

#ifndef nsHTMLParts_h___
#define nsHTMLParts_h___

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsHTMLParts.h"


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsISelectionDisplay.h"
#endif
# 12 "../../dist/include/nsISelectionDisplay.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsISelectionDisplay.h"

/* starting interface:    nsISelectionDisplay */
#define NS_ISELECTIONDISPLAY_IID_STR "0ddf9e1c-1dd2-11b2-a183-908a08aa75ae"

#define NS_ISELECTIONDISPLAY_IID \
  {0x0ddf9e1c, 0x1dd2, 0x11b2, \
    { 0xa1, 0x83, 0x90, 0x8a, 0x08, 0xaa, 0x75, 0xae }}

class NS_NO_VTABLE nsISelectionDisplay : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISELECTIONDISPLAY_IID)

  enum {
    DISPLAY_TEXT = 1,
    DISPLAY_IMAGES = 2,
    DISPLAY_FRAMES = 4,
    DISPLAY_ALL = 7
  };

  /* void setSelectionFlags (in short toggle); */
  NS_IMETHOD SetSelectionFlags(int16_t toggle) = 0;

  /* short getSelectionFlags (); */
  NS_IMETHOD GetSelectionFlags(int16_t *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsISelectionDisplay, NS_ISELECTIONDISPLAY_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISELECTIONDISPLAY \
  NS_IMETHOD SetSelectionFlags(int16_t toggle) MOZ_OVERRIDE; \
  NS_IMETHOD GetSelectionFlags(int16_t *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISELECTIONDISPLAY(_to) \
  NS_IMETHOD SetSelectionFlags(int16_t toggle) MOZ_OVERRIDE { return _to SetSelectionFlags(toggle); } \
  NS_IMETHOD GetSelectionFlags(int16_t *_retval) MOZ_OVERRIDE { return _to GetSelectionFlags(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISELECTIONDISPLAY(_to) \
  NS_IMETHOD SetSelectionFlags(int16_t toggle) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetSelectionFlags(toggle); } \
  NS_IMETHOD GetSelectionFlags(int16_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSelectionFlags(_retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */
NS_IMETHODIMP nsSelectionDisplay::SetSelectionFlags(int16_t toggle)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* short getSelectionFlags (); */
NS_IMETHODIMP nsSelectionDisplay::GetSelectionFlags(int16_t *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 108 "../../dist/include/nsISelectionDisplay.h"


#endif /* __gen_nsISelectionDisplay_h__ */
# 111 "../../dist/include/nsISelectionDisplay.h"
# 21 "../../dist/include/nsFrame.h" 2

/**
 * nsFrame logging constants. We redefine the nspr
 * PRLogModuleInfo.level field to be a bitfield.  Each bit controls a
 * specific type of logging. Each logging operation has associated
 * inline methods defined below.
 */
#define NS_FRAME_TRACE_CALLS        0x1
#define NS_FRAME_TRACE_PUSH_PULL    0x2
#define NS_FRAME_TRACE_CHILD_REFLOW 0x4
#define NS_FRAME_TRACE_NEW_FRAMES   0x8

#define NS_FRAME_LOG_TEST(_lm,_bit) (int((_lm)->level) & (_bit))

#ifdef DEBUG
#define NS_FRAME_LOG(_bit,_args)                                \
  PR_BEGIN_MACRO                                                \
    if (NS_FRAME_LOG_TEST(nsFrame::GetLogModuleInfo(),_bit)) {  \
      PR_LogPrint _args;                                        \
    }                                                           \
  PR_END_MACRO
#else
# 43 "../../dist/include/nsFrame.h"
#define NS_FRAME_LOG(_bit,_args)
#endif
# 45 "../../dist/include/nsFrame.h"

// XXX Need to rework this so that logging is free when it's off
#ifdef DEBUG
#define NS_FRAME_TRACE_IN(_method) Trace(_method, true)

#define NS_FRAME_TRACE_OUT(_method) Trace(_method, false)

// XXX remove me
#define NS_FRAME_TRACE_MSG(_bit,_args)                          \
  PR_BEGIN_MACRO                                                \
    if (NS_FRAME_LOG_TEST(nsFrame::GetLogModuleInfo(),_bit)) {  \
      TraceMsg _args;                                           \
    }                                                           \
  PR_END_MACRO

#define NS_FRAME_TRACE(_bit,_args)                              \
  PR_BEGIN_MACRO                                                \
    if (NS_FRAME_LOG_TEST(nsFrame::GetLogModuleInfo(),_bit)) {  \
      TraceMsg _args;                                           \
    }                                                           \
  PR_END_MACRO

#define NS_FRAME_TRACE_REFLOW_IN(_method) Trace(_method, true)

#define NS_FRAME_TRACE_REFLOW_OUT(_method, _status) \
  Trace(_method, false, _status)

#else
# 73 "../../dist/include/nsFrame.h"
#define NS_FRAME_TRACE(_bits,_args)
#define NS_FRAME_TRACE_IN(_method)
#define NS_FRAME_TRACE_OUT(_method)
#define NS_FRAME_TRACE_MSG(_bits,_args)
#define NS_FRAME_TRACE_REFLOW_IN(_method)
#define NS_FRAME_TRACE_REFLOW_OUT(_method, _status)
#endif
# 80 "../../dist/include/nsFrame.h"

// Frame allocation boilerplate macros.  Every subclass of nsFrame
// must define its own operator new and GetAllocatedSize.  If they do
// not, the per-frame recycler lists in nsPresArena will not work
// correctly, with potentially catastrophic consequences (not enough
// memory is allocated for a frame object).

#define NS_DECL_FRAMEARENA_HELPERS                                \
  void* operator new(size_t, nsIPresShell*) MOZ_MUST_OVERRIDE;    \
  virtual nsQueryFrame::FrameIID GetFrameId() MOZ_OVERRIDE MOZ_MUST_OVERRIDE;

#define NS_IMPL_FRAMEARENA_HELPERS(class)                         \
  void* class::operator new(size_t sz, nsIPresShell* aShell)      \
  { return aShell->AllocateFrame(nsQueryFrame::class##_id, sz); } \
  nsQueryFrame::FrameIID class::GetFrameId()                      \
  { return nsQueryFrame::class##_id; }

//----------------------------------------------------------------------

struct nsBoxLayoutMetrics;
class nsDisplayBackgroundImage;
struct nsRect;

/**
 * Implementation of a simple frame that's not splittable and has no
 * child frames.
 *
 * Sets the NS_FRAME_SYNCHRONIZE_FRAME_AND_VIEW bit, so the default
 * behavior is to keep the frame and view position and size in sync.
 */
class nsFrame : public nsBox
{
public:
  /**
   * Create a new "empty" frame that maps a given piece of content into a
   * 0,0 area.
   */
  ;

private:
  // Left undefined; nsFrame objects are never allocated from the heap.
  void* operator new(size_t sz) CPP_THROW_NEW;

protected:
  // Overridden to prevent the global delete from being called, since
  // the memory came out of an arena instead of the heap.
  //
  // Ideally this would be private and undefined, like the normal
  // operator new.  Unfortunately, the C++ standard requires an
  // overridden operator delete to be accessible to any subclass that
  // defines a virtual destructor, so we can only make it protected;
  // worse, some C++ compilers will synthesize calls to this function
  // from the "deleting destructors" that they emit in case of
  // delete-expressions, so it can't even be undefined.
  ;

public:

  // nsQueryFrame
  NS_DECL_QUERYFRAME
   MOZ_MUST_OVERRIDE;
  virtual nsQueryFrame::FrameIID GetFrameId() MOZ_MUST_OVERRIDE;
  virtual void AddInlineMinISize(nsRenderingContext *aRenderingContext,
                                 InlineMinISizeData *aData) MOZ_OVERRIDE;
  virtual void AddInlinePrefISize(nsRenderingContext *aRenderingContext,
                                  InlinePrefISizeData *aData) MOZ_OVERRIDE;
  virtual IntrinsicISizeOffsetData
    IntrinsicISizeOffsets(nsRenderingContext* aRenderingContext) MOZ_OVERRIDE;
  virtual mozilla::IntrinsicSize GetIntrinsicSize() MOZ_OVERRIDE;
  virtual nsSize GetIntrinsicRatio() MOZ_OVERRIDE;

  virtual mozilla::LogicalSize
  ComputeSize(nsRenderingContext *aRenderingContext,
              mozilla::WritingMode aWritingMode,
              const mozilla::LogicalSize& aCBSize,
              nscoord aAvailableISize,
              const mozilla::LogicalSize& aMargin,
              const mozilla::LogicalSize& aBorder,
              const mozilla::LogicalSize& aPadding,
              ComputeSizeFlags aFlags) MOZ_OVERRIDE;

  // Compute tight bounds assuming this frame honours its border, background
  // and outline, its children's tight bounds, and nothing else.
  nsRect ComputeSimpleTightBounds(gfxContext* aContext) const;
  
  /**
   * A helper, used by |nsFrame::ComputeSize| (for frames that need to
   * override only this part of ComputeSize), that computes the size
   * that should be returned when 'width', 'height', and
   * min/max-width/height are all 'auto' or equivalent.
   *
   * In general, frames that can accept any computed width/height should
   * override only ComputeAutoSize, and frames that cannot do so need to
   * override ComputeSize to enforce their width/height invariants.
  // touched and false is returned.
  ;

  // Incorporate the child overflow areas into aOverflowAreas.
  // If the child does not have a overflow, use the child area.
  ;

  /**
   * @return true if we should avoid a page/column break in this frame.
   */
  

#ifdef DEBUG
  /**
   * Tracing method that writes a method enter/exit routine to the
   * nspr log using the nsIFrame log module. The tracing is only
   * should call the base classes same named method before doing
   * anything specific in a derived class. This means that derived
   * classes need not override DumpRegressionData unless they need
   * some custom behavior that requires changing how the outer "frame"
   * XML container is dumped.
   */
  virtual void DumpBaseRegressionData(nsPresContext* aPresContext, FILE* out, int32_t aIndent);
  
  // Display Reflow Debugging 
  static void* DisplayReflowEnter(nsPresContext*          aPresContext,
                                  nsIFrame*                aFrame,
                                  const nsHTMLReflowState& aReflowState);
  static void* DisplayLayoutEnter(nsIFrame* aFrame);
  static void* DisplayIntrinsicISizeEnter(nsIFrame* aFrame,
                                          const char* aType);
  static void* DisplayIntrinsicSizeEnter(nsIFrame* aFrame,
                                         const char* aType);
  static void  DisplayReflowExit(nsPresContext*      aPresContext,
                                 nsIFrame*            aFrame,
                                 nsHTMLReflowMetrics& aMetrics,
                                 uint32_t             aStatus,
                                 void*                aFrameTreeNode);
  static void  DisplayLayoutExit(nsIFrame* aFrame,
                                 void* aFrameTreeNode);
  static void  DisplayIntrinsicISizeExit(nsIFrame* aFrame,
                                         const char* aType,
                                         nscoord aResult,
                                         void* aFrameTreeNode);
  static void  DisplayIntrinsicSizeExit(nsIFrame* aFrame,
                                        const char* aType,
                                        nsSize aResult,
                                        void* aFrameTreeNode);

  static void DisplayReflowStartup();
  static void DisplayReflowShutdown();
#endif
# 500 "../../dist/include/nsFrame.h"

  /**
   * Adds display items for standard CSS background if necessary.
   * Does not check IsVisibleForPainting.
   * @param aForceBackground draw the background even if the frame
   * background style appears to have no background --- this is useful
   * for frames that might receive a propagated background via
   * nsCSSRendering::FindBackground
   * @return whether a themed background item was created.
   */
  ;
  /**
   * Adds display items for standard CSS borders, background and outline for
   * for this frame, as necessary. Checks IsVisibleForPainting and won't
   * display anything if the frame is not visible.
   * @param aForceBackground draw the background even if the frame
   * background style appears to have no background --- this is useful
   * for frames that might receive a propagated background via
   * nsCSSRendering::FindBackground
   */
  ;
  /**
   * Add a display item for the CSS outline. Does not check visibility.
   */
  ;
  /**
   * Add a display item for the CSS outline, after calling
   * IsVisibleForPainting to confirm we are visible.
   */
  ;

  /**
   * Adjust the given parent frame to the right style context parent frame for
   * the child, given the pseudo-type of the prospective child.  This handles
   * things like walking out of table pseudos and so forth.
   *
   * @param aProspectiveParent what GetParent() on the child returns.
   *                           Must not be null.
   * @param aChildPseudo the child's pseudo type, if any.
   */
  ;

protected:
  // Protected constructor and destructor
  explicit nsFrame(nsStyleContext* aContext);
  ;


private:
  ;

  NS_IMETHODIMP RefreshSizeCache(nsBoxLayoutState& aState);

#ifdef DEBUG_FRAME_DUMP
public:
  /**
   * Get a printable from of the name of the frame type.
   * XXX This should be eliminated and we use GetType() instead...
   */
  virtual nsresult  GetFrameName(nsAString& aResult) const MOZ_OVERRIDE;
  ;
  // Helper function to return the index in parent of the frame's content
  // object. Returns -1 on error or if the frame doesn't have a content object
  ;
#endif
# 685 "../../dist/include/nsFrame.h"

#ifdef DEBUG
public:
  /**
   * Return the state bits that are relevant to regression tests (that
   * is, those bits which indicate a real difference when they differ
   */
  virtual nsFrameState  GetDebugStateBits() const MOZ_OVERRIDE;
  /**
  static bool GetVerifyStyleTreeEnable();

  /**
   * Set the verify-style-tree enable flag.
   */
  static void SetVerifyStyleTreeEnable(bool aEnabled);

  /**
   * The frame class and related classes share an nspr log module
   * for logging frame activity.
   *
   * Note: the log module is created during library initialization which
   * means that you cannot perform logging before then.
   */
  static PRLogModuleInfo* GetLogModuleInfo();

  };

  struct DR_init_type_cookie {
    DR_init_type_cookie(nsIFrame* aFrame, nsHTMLReflowState* aState);
    ~DR_init_type_cookie();

    nsIFrame* mFrame;
    nsHTMLReflowState* mState;
    void* mValue;
  };

#define DISPLAY_REFLOW(dr_pres_context, dr_frame, dr_rf_state, dr_rf_metrics, dr_rf_status) \
  DR_cookie dr_cookie(dr_pres_context, dr_frame, dr_rf_state, dr_rf_metrics, dr_rf_status); 
#define DISPLAY_REFLOW_CHANGE() \
  dr_cookie.Change();
#define DISPLAY_LAYOUT(dr_frame) \
                                 dr_bdr, dr_pad)                           \
  PR_BEGIN_MACRO PR_END_MACRO
#define DISPLAY_INIT_OFFSETS(dr_frame, dr_state, dr_hpb, dr_vpb, dr_bdr, dr_pad)  \
  PR_BEGIN_MACRO PR_END_MACRO
#define DISPLAY_INIT_TYPE(dr_frame, dr_result) PR_BEGIN_MACRO PR_END_MACRO

#endif
# 890 "../../dist/include/nsFrame.h"
// End Display Reflow Debugging

// similar to NS_ENSURE_TRUE but with no return value
#define ENSURE_TRUE(x)                                        \
  PR_BEGIN_MACRO                                              \
    if (!(x)) {                                               \
       NS_WARNING("ENSURE_TRUE(" #x ") failed");              \
       return;                                                \
    }                                                         \
  PR_END_MACRO
#endif /* nsFrame_h___ */
# 901 "../../dist/include/nsFrame.h"
# 16 "../../dist/include/nsSplittableFrame.h" 2

// Derived class that allows splitting
class nsSplittableFrame : public nsFrame
{
public:
  NS_DECL_FRAMEARENA_HELPERS

  virtual void Init(nsIContent*       aContent,
                    nsContainerFrame* aParent,
                    nsIFrame*         aPrevInFlow) MOZ_OVERRIDE;
  
  nsIFrame*   mPrevContinuation;
  nsIFrame*   mNextContinuation;
};

#endif /* nsSplittableFrame_h___ */
# 109 "../../dist/include/nsSplittableFrame.h"
# 13 "../../dist/include/nsContainerFrame.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameList.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsContainerFrame.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsLayoutUtils.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsContainerFrame.h"

// width/height/x/y values computed during reflow.
// NOTE: AppUnitsPerCSSPixel value hardwired here to remove the
// dependency on nsDeviceContext.h.  It doesn't matter if it's a
// little off.
#ifdef DEBUG
#define CRAZY_COORD (1000000*60)
#define CRAZY_SIZE(_x) (((_x) < -CRAZY_COORD) || ((_x) > CRAZY_COORD))
#endif
# 40 "../../dist/include/nsContainerFrame.h"

/**
 * Implementation of a container frame.
 */
class nsContainerFrame : public nsSplittableFrame
{
public:
  NS_DECL_FRAMEARENA_HELPERS
  NS_DECL_QUERYFRAME_TARGET(nsContainerFrame)
  NS_DECL_QUERYFRAME

  // - clip
  // Call this when one of these styles changes or when the view has just
  // been created.
  // @param aStyleContext can be null, in which case the frame's style context is used
  ;

  /**
   * Converts the minimum and maximum sizes given in inner window app units to

  /**
   * Safely destroy the frames on the nsFrameList stored on aProp for this
   * frame then remove the property and delete the frame list.
   * Nothing happens if the property doesn't exist.
   */
  ;

  // ==========================================================================

  nsFrameList mFrames;
};

// ==========================================================================
/* The out-of-flow-related code below is for a hacky way of splitting
 * absolutely-positioned frames. Basically what we do is split the frame
 * in nsAbsoluteContainingBlock and pretend the continuation is an overflow
 * container. This isn't an ideal solution, but it lets us print the content
 * at least. See bug 154892.
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Utilities for animation of computed style values */

#ifndef mozilla_StyleAnimationValue_h_
#define mozilla_StyleAnimationValue_h_

#if 0 /* expanded by -frewrite-includes */
#include "nsStringFwd.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/StyleAnimationValue.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringBuffer.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/StyleAnimationValue.h"

class nsStyleContext;
class gfx3DMatrix;

namespace mozilla {

namespace dom {
class Element;
} // namespace dom

/**
 * Utility class to handle animated style values
 */
class StyleAnimationValue {
public:
  /**
   * Calculates a measure of 'distance' between two values.
   *
   * This measure of Distance is guaranteed to be proportional to
   * portions passed to Interpolate, Add, or AddWeighted.  However, for
   * some types of StyleAnimationValue it may not produce sensible results
   * for paced animation.
   *
   * If this method succeeds, the returned distance value is guaranteed to be
   *   aResultValue = aCoeff1 * aValue1 + aCoeff2 * aValue2
   *
   * @param [out] aResultValue The resulting interpolated value.  May be
   *                           the same as aValue1 or aValue2.
   * @return true on success, false on failure.
   *
   * NOTE: Current callers always pass aCoeff1 and aCoeff2 >= 0.  They
   * are currently permitted to be negative; however, if, as we add
   * support more value types types, we find that this causes
   * difficulty, we might change this to restrict them to being
   * positive.
   */
  ;

  // Type-conversion methods
  // -----------------------
  
  
  
  
  
  
  
};

} // namespace mozilla

#endif
# 410 "../../dist/include/mozilla/StyleAnimationValue.h"
# 26 "../../dist/include/Layers.h" 2

class gfxContext;

extern uint8_t gLayerManagerLayerBuilder;

namespace mozilla {

class ComputedTimingFunction;
class FrameLayerBuilder;
namespace layers {

class Animation;
class AnimationData;
class AsyncPanZoomController;
class ClientLayerManager;
class CommonLayerAttributes;
class Layer;
class LayerMetricsWrapper;
class PaintedLayer;
class ContainerLayer;
class ImageLayer;
class ColorLayer;
class ImageContainer;
class CanvasLayer;
class ReadbackLayer;
class ReadbackProcessor;
class RefLayer;
class LayerComposite;
class ShadowableLayer;
class ShadowLayerForwarder;
class LayerManagerComposite;
class SpecificLayerAttributes;
class SurfaceDescriptor;
class Compositor;
struct TextureFactoryIdentifier;
struct EffectMask;

namespace layerscope {
class LayersPacket;
}

#define MOZ_LAYER_DECL_NAME(n, e)                              \
  virtual const char* Name() const MOZ_OVERRIDE { return n; }  \
  virtual LayerType GetType() const MOZ_OVERRIDE { return e; }

/**
 * Base class for userdata objects attached to layers and layer managers.
 */
class LayerUserData {
public:
  virtual ~LayerUserData() {}
};

/*
 * Motivation: For truly smooth animation and video playback, we need to
 * be able to compose frames and render them on a dedicated thread (i.e.
 * off the main thread where DOM manipulation, script execution and layout
 * to have bifurcated "layers"/"non-layers" rendering paths in Gecko.
 * Therefore the layers API is carefully designed to permit maximally
 * efficient implementation in an "immediate mode" style. See the
 * BasicLayerManager for such an implementation.
 */

static void LayerManagerUserDataDestroy(void *data)
{
  delete static_cast<LayerUserData*>(data);
}

/**
 * A LayerManager controls a tree of layers. All layers in the tree
 * must use the same LayerManager.
 *
 * All modifications to a layer tree must happen inside a transaction.
 * root layer, and each container layer holds a reference to its children.
 */
class LayerManager {
  NS_INLINE_DECL_REFCOUNTING(LayerManager)

protected:
  typedef mozilla::gfx::DrawTarget DrawTarget;
  typedef mozilla::gfx::IntSize IntSize;
  typedef mozilla::gfx::SurfaceFormat SurfaceFormat;

public:
  

  /**
   * Release layers and resources held by this layer manager, and mark
   * it as destroyed.  Should do any cleanup necessary in preparation
   * do not already have an ancestor in the return list.
   */
  ;

  /**
   * CONSTRUCTION PHASE ONLY
   * Called when a managee has mutated.
   * Subclasses overriding this method must first call their
   * superclass's impl
   */
#ifdef DEBUG
  // In debug builds, we check some properties of |aLayer|.
  virtual void Mutated(Layer* aLayer);
#else
# 373 "../../dist/include/Layers.h"
  virtual void Mutated(Layer* aLayer) { }
#endif
# 375 "../../dist/include/Layers.h"

  /**
   * Hints that can be used during PaintedLayer creation to influence the type
   * or properties of the layer created.
   *
   * NONE: No hint.
   * SCROLLABLE: This layer may represent scrollable content.
   */
  enum PaintedLayerCreationHint {
    NONE, SCROLLABLE
  };

  /**
   * Returns true if aLayer is optimized for the given PaintedLayerCreationHint.
   */
  virtual already_AddRefed<CanvasLayer> CreateCanvasLayer() = 0;
  /**
   * CONSTRUCTION PHASE ONLY
   * Create a ReadbackLayer for this manager's layer tree.
   */
  
  /**
   * CONSTRUCTION PHASE ONLY
   * Create a RefLayer for this manager's layer tree.
   */
  


  /**
  /**
  /**
   * Creates a DrawTarget for use with canvas which is optimized for
   * inter-operating with this layermanager.
   */
  virtual TemporaryRef<mozilla::gfx::DrawTarget>
    CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
                     mozilla::gfx::SurfaceFormat aFormat);

  virtual bool CanUseCanvasLayerForSize(const gfx::IntSize &aSize) { return true; }

  /**
   * returns the maximum texture size on this layer backend, or INT32_MAX
   * if there is no maximum
   */
  virtual int32_t GetMaxTextureSize() const = 0;

  /**
   * Return the name of the layer manager's backend.
   */
  virtual void GetBackendName(nsAString& aName) = 0;

  /**
   * This setter can be used anytime. The user data for all keys is
   * initially null. Ownership pases to the layer manager.
   */
  
  /**
   * This can be used anytime. Ownership passes to the caller!
   */
  
  /**
   * This getter can be used anytime.
  /**
   *  Clears, then populates aFrameIntervals with the recorded frame timing
   *  data. The array will be empty if data was overwritten since
   *  aStartIndex was obtained.
   */
  virtual void StopFrameTimeRecording(uint32_t         aStartIndex,
                                      nsTArray<float>& aFrameIntervals);

  void RecordFrame();
  void PostPresent();

  void BeginTabSwitch();

  static bool IsLogEnabled();
  static PRLogModuleInfo* GetLog() { return sLog; }

  bool IsCompositingCheap(LayersBackend aBackend)
  {
    // LayersBackend::LAYERS_NONE is an error state, but in that case we should try to
    // avoid loading the compositor!
    return LayersBackend::LAYERS_BASIC != aBackend && LayersBackend::LAYERS_NONE != aBackend;
  }

  virtual bool IsCompositingCheap() { return true; }

  bool IsInTransaction() const { return mInTransaction; }
  virtual bool RequestOverfill(mozilla::dom::OverfillCallback* aCallback) { return true; }
  virtual void RunOverfillCallback(const uint32_t aOverfill) { }

  virtual void SetRegionToClear(const nsIntRegion& aRegion)
  {
    mRegionToClear = aRegion;
  }

  virtual bool SupportsMixBlendModes(EnumSet<gfx::CompositionOp>& aMixBlendModes)
  {
    return false;
  }

  

  

  

protected:
  nsRefPtr<Layer> mRoot;
  gfx::UserData mUserData;
  bool mDestroyed;
  bool mSnapEffectiveTransforms;

  nsIntRegion mRegionToClear;

  // Protected destructor, to discourage deletion outside of Release():
  virtual ~LayerManager() {}

  // Print interesting information about this into aStreamo.  Internally
  // used to implement Dump*() and Log*().
  ;

  // Print interesting information about this into layerscope packet.
  // Internally used to implement Dump().
  ;

  ;
  static PRLogModuleInfo* sLog;
  uint64_t mId;
  bool mInTransaction;
  // The time when painting most recently finished. This is recorded so that
  // we can time any play-pending animations from this point.
  TimeStamp mAnimationReadyTime;
private:
  struct FramesTimingRecording
  {
    // Stores state and data for frame intervals and paint times recording.
    // see LayerManager::StartFrameTimeRecording() at Layers.cpp for more details.
    
    bool mIsPaused;
    uint32_t mNextIndex;
    TimeStamp mLastFrameTime;
    nsTArray<float> mIntervals;
    uint32_t mLatestStartIndex;
    uint32_t mCurrentRunStartIndex;
  };
  FramesTimingRecording mRecording;

  TimeStamp mTabSwitchStart;
};

typedef InfallibleTArray<Animation> AnimationArray;

struct AnimData {
  InfallibleTArray<mozilla::StyleAnimationValue> mStartValues;
  InfallibleTArray<mozilla::StyleAnimationValue> mEndValues;
  InfallibleTArray<nsAutoPtr<mozilla::ComputedTimingFunction> > mFunctions;
};

/**
 * A Layer represents anything that can be rendered onto a destination
 * surface.
 */
class Layer {
  NS_INLINE_DECL_REFCOUNTING(Layer)

public:
  // Keep these in alphabetical order
  enum LayerType {
    TYPE_CANVAS,
    TYPE_COLOR,
    TYPE_CONTAINER,
    TYPE_IMAGE,
    TYPE_READBACK,
    TYPE_REF,
    TYPE_SHADOW,
    TYPE_PAINTED
  };

  /**
   * Returns the LayerManager this Layer belongs to. Note that the layer
   * manager might be in a destroyed state, at which point it's only
   * valid to set/get user data from it.
   */
  

  enum {
    /**
     * If this is set, the caller is promising that by the end of this
     * transaction the entire visible region (as specified by
     * SetVisibleRegion) will be filled with opaque content.
     */
    CONTENT_OPAQUE = 0x01,
    /**
     * If this is set, the caller is notifying that the contents of this layer
     * require per-component alpha for optimal fidelity. However, there is no
     * guarantee that component alpha will be supported for this layer at
     * paint time.
     * This should never be set at the same time as CONTENT_OPAQUE.
     */
    CONTENT_COMPONENT_ALPHA = 0x02,

    /**
     * If this is set then one of the descendant layers of this one has
     * CONTENT_COMPONENT_ALPHA set.
     */
    CONTENT_COMPONENT_ALPHA_DESCENDANT = 0x04,

    /**
     * If this is set then this layer is part of a preserve-3d group, and should
     * be sorted with sibling layers that are also part of the same group.
     */
    CONTENT_PRESERVE_3D = 0x08,
    /**
     * This indicates that the transform may be changed on during an empty
     * transaction where there is no possibility of redrawing the content, so the
     * implementation should be ready for that.
     */
    CONTENT_MAY_CHANGE_TRANSFORM = 0x10,

    /**
     * Disable subpixel AA for this layer. This is used if the display isn't suited
     * for subpixel AA like hidpi or rotated content.
     */
    CONTENT_DISABLE_SUBPIXEL_AA = 0x20
  };
  /**
   * CONSTRUCTION PHASE ONLY
   * This lets layout make some promises about what will be drawn into the
   * visible region of the PaintedLayer. This enables internal quality
   * and performance optimizations.
   */
  void SetContentFlags(uint32_t aFlags)
  {
    NS_ASSERTION((aFlags & (CONTENT_OPAQUE | CONTENT_COMPONENT_ALPHA)) !=
                 (CONTENT_OPAQUE | CONTENT_COMPONENT_ALPHA),
                 "Can't be opaque and require component alpha");
    if (mContentFlags != aFlags) {
      MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) ContentFlags", this));
      mContentFlags = aFlags;
      Mutated();
    }
  }

  /**
   * CONSTRUCTION PHASE ONLY
   * The union of the bounds of all the display item that got flattened
   * into this layer. This is intended to be an approximation to the
   * size of the layer if the nearest scrollable ancestor had an infinitely
   * large displayport. Computing this more exactly is too expensive,
   * but this approximation is sufficient for what we need to use it for.
   */
  virtual void SetLayerBounds(const nsIntRect& aLayerBounds)
  {
    if (!mLayerBounds.IsEqualEdges(aLayerBounds)) {
      MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) LayerBounds", this));
      mLayerBounds = aLayerBounds;
      Mutated();
    }
  }

  /**
   * CONSTRUCTION PHASE ONLY
   * Tell this layer which region will be visible. The visible region
   * is a region which contains all the contents of the layer that can
   * actually affect the rendering of the window. It can exclude areas
   * that are covered by opaque contents of other layers, and it can
   * exclude areas where this layer simply contains no content at all.
   * (This can be an overapproximation to the "true" visible region.)
   *
   * Set the (sub)document metrics used to render the Layer subtree
   * rooted at this. Note that a layer may have multiple FrameMetrics
   * objects; calling this function will remove all of them and replace
   * them with the provided FrameMetrics. See the documentation for
   * SetFrameMetrics(const nsTArray<FrameMetrics>&) for more details.
   */
  void SetFrameMetrics(const FrameMetrics& aFrameMetrics)
  {
    if (mFrameMetrics.Length() != 1 || mFrameMetrics[0] != aFrameMetrics) {
      MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) FrameMetrics", this));
      mFrameMetrics.ReplaceElementsAt(0, mFrameMetrics.Length(), aFrameMetrics);
      FrameMetricsChanged();
      Mutated();
    }
  }

  /**
   * CONSTRUCTION PHASE ONLY
   * Set the (sub)document metrics used to render the Layer subtree
   * rooted at this. There might be multiple metrics on this layer
   * because the layer may, for example, be contained inside multiple
   * nested scrolling subdocuments. In general a Layer having multiple
   * FrameMetrics objects is conceptually equivalent to having a stack
   * of ContainerLayers that have been flattened into this Layer.
   * See the documentation in LayerMetricsWrapper.h for a more detailed
   * explanation of this conceptual equivalence.
   *
   * Note also that there is actually a many-to-many relationship between
   * Layers and FrameMetrics, because multiple Layers may have identical
   * FrameMetrics objects. This happens when those layers belong to the
   * same scrolling subdocument and therefore end up with the same async
   * transform when they are scrolled by the APZ code.
   */
  

  /**
   * CONSTRUCTION PHASE ONLY
   * If a layer is "sticky position", |aScrollId| holds the scroll identifier
   * of the scrollable content that contains it. The difference between the two
   * rectangles |aOuter| and |aInner| is treated as two intervals in each
   * dimension, with the current scroll position at the origin. For each
   * dimension, while that component of the scroll position lies within either
   * interval, the layer should not move relative to its scrolling container.
   */
  

  enum ScrollDirection {
    NONE,
    VERTICAL,
    HORIZONTAL
  };

  /**
   * CONSTRUCTION PHASE ONLY
   * If a layer is a scrollbar layer, |aScrollId| holds the scroll identifier
   * of the scrollable content that the scrollbar is for.
   */
  

  // Set during construction for the container layer of scrollbar components.
  

  // These getters can be used anytime.
  
  
  
  
  
  const nsIntRegion& GetVisibleRegion() const { return mVisibleRegion; }
  ;
  
  
  ;
  ;
  
  
  
  
  
  
  
  


  /**
   * Retrieve the root level visible region for |this| taking into account
   * clipping applied to parent layers of |this| as well as subtracting
   * visible regions of higher siblings of this layer and each ancestor.
   *
   * Note translation values for offsets of visible regions and accumulated
   * aLayerOffset are integer rounded using Point's RoundedToInt.
   *
   * @param aResult - the resulting visible region of this layer.
   * @param aLayerOffset - this layer's total offset from the root layer.
   * @return - false if during layer tree traversal a parent or sibling
   *  transform is found to be non-translational. This method returns early
   *  in this case, results will not be valid. Returns true on successful
   */
  void ApplyPendingUpdatesToSubtree();

  /**
   * DRAWING PHASE ONLY
   *
   * Write layer-subtype-specific attributes into aAttrs.  Used to
   * synchronize layer attributes to their shadows'.
   */
  virtual void FillSpecificAttributes(SpecificLayerAttributes& aAttrs) { }

  // Returns true if it's OK to save the contents of aLayer in an
  // opaque surface (a surface without an alpha channel).
  // If we can use a surface without an alpha channel, we should, because
  // it will often make painting of antialiased text faster and higher
  void SetUserData(void* aKey, LayerUserData* aData)
  {
    mUserData.Add(static_cast<gfx::UserDataKey*>(aKey), aData, LayerManagerUserDataDestroy);
  }
  /**
   * This can be used anytime. Ownership passes to the caller!
   */
  nsAutoPtr<LayerUserData> RemoveUserData(void* aKey)
  {
    nsAutoPtr<LayerUserData> d(static_cast<LayerUserData*>(mUserData.Remove(static_cast<gfx::UserDataKey*>(aKey))));
    return d;
  }
  /**
   * This getter can be used anytime.
   */
  
  /**
   * This getter can be used anytime. Ownership is retained by the layer
   * manager.
   */
  LayerUserData* GetUserData(void* aKey) const
  {
    return static_cast<LayerUserData*>(mUserData.Get(static_cast<gfx::UserDataKey*>(aKey)));
  }

  /**
   * |Disconnect()| is used by layers hooked up over IPC.  It may be
   * called at any time, and may not be called at all.  Using an
   * IPC-enabled layer after Destroy() (drawing etc.) results in a
   * safe no-op; no crashy or uaf etc.
   *
   * Dynamic cast to a LayerComposite.  Return null if this is not a
   */
  RenderTargetIntRect CalculateScissorRect(const RenderTargetIntRect& aCurrentScissorRect);

  virtual const char* Name() const =0;
  virtual LayerType GetType() const =0;

  /**
   * Only the implementation should call this. This is per-implementation
   * private data. Normally, all layers with a given layer manager
   * use the same type of ImplData.
   */
  void* ImplData() { return mImplData; }

  /**
   * Only the implementation should use these methods.
   */
  
  
  

  /**
   * Dump information about this layer manager and its managed tree to
   * aStream.
   */
  ;
  /**
   * Dump information about just this layer manager itself to aStream.
   */
  ;

  /**
   * Dump information about this layer and its child & sibling layers to
   * layerscope packet.
   */
  ;

  /**
   * Log information about this layer manager and its managed tree to
   * the NSPR log (if enabled for "Layers").
   */
  ;
  /**
   * Log information about just this layer manager itself to the NSPR
   * log (if enabled for "Layers").
   */
  ;

  // Print interesting information about this into aStream. Internally
  // used to implement Dump*() and Log*(). If subclasses have
  // additional interesting properties, they should override this with
  // an implementation that first calls the base implementation then
  // appends additional info to aTo.
  virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix);

  // Just like PrintInfo, but this function dump information into layerscope packet,
  // instead of a StringStream. It is also internally used to implement Dump();
  virtual void DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent);

  static bool IsLogEnabled() { return LayerManager::IsLogEnabled(); }

  /**
   * Returns the current area of the layer (in layer-space coordinates)
   * marked as needed to be recomposited.
   */
  const nsIntRegion& GetInvalidRegion() { return mInvalidRegion; }
  const void SetInvalidRegion(const nsIntRegion& aRect) { mInvalidRegion = aRect; }

  /**
   * Mark the entirety of the layer's visible region as being invalid.
   */
  void SetInvalidRectToVisibleRegion() { mInvalidRegion = GetVisibleRegion(); }

  /**
   * Adds to the current invalid rect.
   */
  void AddInvalidRect(const nsIntRect& aRect) { mInvalidRegion.Or(mInvalidRegion, aRect); }

  /**
   * Clear the invalid rect, marking the layer as being identical to what is currently
   * composited.
   */
  void ClearInvalidRect() { mInvalidRegion.SetEmpty(); }

  // These functions allow attaching an AsyncPanZoomController to this layer,
  // and can be used anytime.
  // A layer has an APZC at index aIndex only-if GetFrameMetrics(aIndex).IsScrollable();
  // attempting to get an APZC for a non-scrollable metrics will return null.
  // The aIndex for these functions must be less than GetFrameMetricsCount().
  ;
  ;
  // The FrameMetricsChanged function is used internally to ensure the APZC array length
  // matches the frame metrics array length.
private:
  void FrameMetricsChanged();
public:

  ;

#ifdef DEBUG
  void SetDebugColorIndex(uint32_t aIndex) { mDebugColorIndex = aIndex; }
  uint32_t GetDebugColorIndex() { return mDebugColorIndex; }
#endif
# 1584 "../../dist/include/Layers.h"

  

  void Mutated()
  {
    mManager->Mutated(this);
  }

  
  /**
   * Clear debugging information. Useful for recycling.
   */
  

protected:
  ;

  // Protected destructor, to discourage deletion outside of Release():
  virtual ~Layer();

  /**
   * We can snap layer transforms for two reasons:
   * 1) To avoid unnecessary resampling when a transform is a translation
   * by a non-integer number of pixels.
   * Snapping the translation to an integer number of pixels avoids
   * transforms.
   * @param aResidualTransform a transform to apply before the result transform
   * in order to get the results to completely match aTransform.
   */
  ;
  /**
   * See comment for SnapTransformTranslation.
   * This function implements type 2 snapping. If aTransform is a translation
   * and/or scale, transform aSnapRect by aTransform, snap to pixel boundaries,
   * and return the transform that maps aSnapRect to that rect. Otherwise
   * just return aTransform.
   * @param aSnapRect a rectangle whose edges should be snapped to pixel
   * boundaries in the destination surface.
   * @param aResidualTransform a transform to apply before the result transform
   * in order to get the results to completely match aTransform.
   */
  ;

  LayerManager* mManager;
  ContainerLayer* mParent;
  Layer* mNextSibling;
  Layer* mPrevSibling;
  void* mImplData;
  nsRefPtr<Layer> mMaskLayer;
  gfx::UserData mUserData;
  nsIntRect mLayerBounds;
  nsIntRegion mVisibleRegion;
  nsTArray<FrameMetrics> mFrameMetrics;
  EventRegions mEventRegions;
  gfx::Matrix4x4 mTransform;
  // A mutation of |mTransform| that we've queued to be applied at the
  // end of the next transaction (if nothing else overrides it in the
  // meantime).
  nsAutoPtr<gfx::Matrix4x4> mPendingTransform;
  float mPostXScale;
  float mPostYScale;
  gfx::Matrix4x4 mEffectiveTransform;
  AnimationArray mAnimations;
  // See mPendingTransform above.
  nsAutoPtr<AnimationArray> mPendingAnimations;
  InfallibleTArray<AnimData> mAnimationData;
  float mOpacity;
  gfx::CompositionOp mMixBlendMode;
  bool mForceIsolatedGroup;
  nsIntRect mClipRect;
  nsIntRect mTileSourceRect;
  nsIntRegion mInvalidRegion;
  nsTArray<nsRefPtr<AsyncPanZoomController> > mApzcs;
  uint32_t mContentFlags;
  bool mUseClipRect;
  bool mUseTileSourceRect;
  bool mIsFixedPosition;
  LayerPoint mAnchor;
  LayerMargin mMargins;
  struct StickyPositionData {
    FrameMetrics::ViewID mScrollId;
    LayerRect mOuter;
    LayerRect mInner;
  };
  nsAutoPtr<StickyPositionData> mStickyPositionData;
  FrameMetrics::ViewID mScrollbarTargetId;
  ScrollDirection mScrollbarDirection;
  bool mIsScrollbarContainer;
  DebugOnly<uint32_t> mDebugColorIndex;
  // If this layer is used for OMTA, then this counter is used to ensure we
  // stay in sync with the animation manager
  uint64_t mAnimationGeneration;
#ifdef MOZ_DUMP_PAINTING
  nsTArray<nsCString> mExtraDumpInfo;
#endif
# 1724 "../../dist/include/Layers.h"
};

/**
 * A Layer which we can paint into. It is a conceptually
 * infinite surface, but each PaintedLayer has an associated "valid region"
 * of contents that it is currently storing, which is finite. PaintedLayer
 * implementations can store content between paints.
 *
 * PaintedLayers are rendered into during the drawing phase of a transaction.
 *
 * Currently the contents of a PaintedLayer are in the device output color
 * space.
 */
class PaintedLayer : public Layer {
public:
  /**
   * CONSTRUCTION PHASE ONLY
   * Tell this layer that the content in some region has changed and
   * will need to be repainted. This area is removed from the valid
   * region.
   */
  ;
  /**
  /**
   * True when
   */
  bool mAllowResidualTranslation;
};

/**
 * A Layer which other layers render into. It holds references to its
 * children.
 */
class ContainerLayer : public Layer {
public:

  ;

  /**
   * CONSTRUCTION PHASE ONLY
   * Insert aChild into the child list of this container. aChild must
   * since the decision about whether to use a temporary surface for the
   * container is backend-specific. ComputeEffectiveTransforms must also set
   * mUseIntermediateSurface.
   */
  ;

  /**
   * Call this only after ComputeEffectiveTransforms has been invoked
   * on this layer.
   * Returns true if this will use an intermediate surface. This is largely
   * backend-dependent, but it affects the operation of GetEffectiveOpacity().
   */
  

  virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) MOZ_OVERRIDE;

  virtual void DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent) MOZ_OVERRIDE;

  nsIntRect mBounds;
  gfxRGBA mColor;
};

/**
 * A Layer for HTML Canvas elements.  It's backed by either a
 * gfxASurface or a GLContext (for WebGL layers), and has some control
 * for intelligent updating from the source if necessary (for example,
 * if hardware compositing is not available, for reading from the GL
 * buffer into an image surface that we can layer composite.)
 *
 * After Initialize is called, the underlying canvas Surface/GLContext
 * must not be modified during a layer transaction.
 */
class CanvasLayer : public Layer {
public:
  struct Data {
    Data()
      : mDrawTarget(nullptr)
      , mGLContext(nullptr)
      , mFrontbufferGLTex(0)
      , mSize(0,0)
      , mHasAlpha(false)
      , mIsGLAlphaPremult(true)
    { }

    // One of these two must be specified for Canvas2D, but never both
    mozilla::gfx::DrawTarget* mDrawTarget; // a DrawTarget for the canvas contents
    mozilla::gl::GLContext* mGLContext; // or this, for GL.

    // Frontbuffer override
    uint32_t mFrontbufferGLTex;

    // The size of the canvas content
    nsIntSize mSize;

    // Whether the canvas drawingbuffer has an alpha channel.
    bool mHasAlpha;

    // Whether mGLContext contains data that is alpha-premultiplied.
    bool mIsGLAlphaPremult;
  };

  /**
   * CONSTRUCTION PHASE ONLY
   * Initialize this CanvasLayer with the given data.  The data must
   * have either mSurface or mGLContext initialized (but not both), as
   * well as mSize.
   *
   * This must only be called once.
   */
  virtual void Initialize(const Data& aData) = 0;

  /**
   * Check the data is owned by this layer is still valid for rendering
   */
  virtual bool IsDataValid(const Data& aData) { return true; }

  /**
   * Notify this CanvasLayer that the canvas surface contents have
   * changed (or will change) before the next transaction.
   */
  void Updated() { mDirty = true; SetInvalidRectToVisibleRegion(); }

  /**
   * Notify this CanvasLayer that the canvas surface contents have
   * been painted since the last change.
   */
  

  /**
   * Returns true if the canvas surface contents have changed since the
   * last paint.
   */
  

  /**
   * Register a callback to be called at the start of each transaction.
   */
  typedef void PreTransactionCallback(void* closureData);
  void SetPreTransactionCallback(PreTransactionCallback* callback, void* closureData)
  {
    mPreTransCallback = callback;
    mPreTransCallbackData = closureData;
  }

protected:
  

public:
  /**
   * Register a callback to be called at the end of each transaction.
   */
  typedef void (* DidTransactionCallback)(void* aClosureData);
  void SetDidTransactionCallback(DidTransactionCallback aCallback, void* aClosureData)
  {
    mPostTransCallback = aCallback;
    mPostTransCallbackData = aClosureData;
  }

  /**
   * CONSTRUCTION PHASE ONLY
   * Set the filter used to resample this image (if necessary).
   */
  
  

  MOZ_LAYER_DECL_NAME("CanvasLayer", TYPE_CANVAS)

  

protected:
  

  virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) MOZ_OVERRIDE;

  virtual void DumpPacket(layerscope::LayersPacket* aPacket, const void* aParent) MOZ_OVERRIDE;

  

  /**
   * 0, 0, canvaswidth, canvasheight
   */
  nsIntRect mBounds;
  PreTransactionCallback* mPreTransCallback;
  void* mPreTransCallbackData;
  DidTransactionCallback mPostTransCallback;
  void* mPostTransCallbackData;
  GraphicsFilter mFilter;

private:
  /**
   * Set to true in Updated(), cleared during a transaction.
   */
  bool mDirty;
};

/**
 * ContainerLayer that refers to a "foreign" layer tree, through an
 * ID.  Usage of RefLayer looks like
 *
 * Construction phase:
 *   allocate ID for layer subtree
 *   create RefLayer, SetReferentId(ID)
 *
 * Composition:
 *   look up subtree for GetReferentId()
 *   ConnectReferentLayer(subtree)
 *   compose
 *   ClearReferentLayer()
 *
 * Clients will usually want to Connect/Clear() on each transaction to
 * avoid difficulties managing memory across multiple layer subtrees.
 */
class RefLayer : public ContainerLayer {
  friend class LayerManager;

private:
  // 0 is a special value that means "no ID".
  uint64_t mId;
};

;

#ifdef MOZ_DUMP_PAINTING
;
;
;
#endif
# 2403 "../../dist/include/Layers.h"

// A utility function used by different LayerManager implementations.
;

}
}

#endif /* GFX_LAYERS_H */
# 2411 "../../dist/include/Layers.h"
# 24 "../../dist/include/nsDisplayList.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsRegion.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/nsDisplayList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDisplayListInvalidation.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsDisplayListInvalidation.h" 1
/*-*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSDISPLAYLISTINVALIDATION_H_
#define NSDISPLAYLISTINVALIDATION_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsDisplayListInvalidation.h"
#if 0 /* expanded by -frewrite-includes */
#include "FrameLayerBuilder.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/FrameLayerBuilder.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef FRAMELAYERBUILDER_H_
#define FRAMELAYERBUILDER_H_

#if 0 /* expanded by -frewrite-includes */
#include "nsTHashtable.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/FrameLayerBuilder.h"
#if 0 /* expanded by -frewrite-includes */
  

  MOZ_LAYER_DECL_NAME("ImageLayer", TYPE_IMAGE)

  virtual void ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSurface) MOZ_OVERRIDE;
  gfx::IntSize mScaleToSize;
  ScaleMode mScaleMode;
  bool mDisallowBigImage;
  gfx::Matrix4x4 mEffectiveTransformForBuffer;
};

}
}

#endif /* GFX_IMAGELAYER_H */
# 109 "../../dist/include/ImageLayers.h"
# 15 "../../dist/include/FrameLayerBuilder.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "DisplayItemClip.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/DisplayItemClip.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef DISPLAYITEMCLIP_H_
#define DISPLAYITEMCLIP_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/DisplayItemClip.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRect.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/DisplayItemClip.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/DisplayItemClip.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStyleConsts.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/DisplayItemClip.h"

class gfxContext;
class nsDisplayItem;
class nsPresContext;
class nsRegion;

namespace mozilla {
namespace gfx {
class DrawTarget;
class Path;
}
}

namespace mozilla {

/**
 * An DisplayItemClip represents the intersection of an optional rectangle
 * with a list of rounded rectangles (which is often empty), all in appunits.
 * It can represent everything CSS clipping can do to an element (except for
 * SVG clip-path), including no clipping at all.
 */
class DisplayItemClip {
  typedef mozilla::gfx::Color Color;
  typedef mozilla::gfx::DrawTarget DrawTarget;
  typedef mozilla::gfx::Path Path;

public:
  struct RoundedRect {
    nsRect mRect;
    // Indices into mRadii are the NS_CORNER_* constants in nsStyleConsts.h
    nscoord mRadii[8];

    
    
    
  };

  // Constructs a DisplayItemClip that does no clipping at all.
  

  ;
  ;
  ;
  void IntersectWith(const DisplayItemClip& aOther);

  // Apply this |DisplayItemClip| to the given gfxContext.  Any saving of state
  // or clearing of other clips must be done by the caller.
  

  bool HasClip() const { return mHaveClipRect; }
  

  ;

  ;

  /**
   * Find the largest N such that the first N rounded rects in 'this' are
   * equal to the first N rounded rects in aOther, and N <= aMax.
   */
  ;
  
  ;

  static const DisplayItemClip& NoClip();

  ;

private:
  nsRect mClipRect;
  nsTArray<RoundedRect> mRoundedClipRects;
  // If mHaveClipRect is false then this object represents no clipping at all
  // and mRoundedClipRects must be empty.
  bool mHaveClipRect;
};

}

#endif /* DISPLAYITEMCLIP_H_ */
# 193 "../../dist/include/DisplayItemClip.h"
# 16 "../../dist/include/FrameLayerBuilder.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/layers/LayersTypes.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/FrameLayerBuilder.h"
#if 0 /* expanded by -frewrite-includes */
#include "LayerState.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/LayerState.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef LAYERSTATE_H_
#define LAYERSTATE_H_

namespace mozilla {

enum LayerState {
  LAYER_NONE,
  LAYER_INACTIVE,
  LAYER_ACTIVE,
  // Force an active layer even if it causes incorrect rendering, e.g.
  // when the layer has rounded rect clips.
  LAYER_ACTIVE_FORCE,
  // Special layer that is metadata only.
  LAYER_ACTIVE_EMPTY,
  // Inactive style layer for rendering SVG effects.
  LAYER_SVG_EFFECTS
};

}

#endif
# 27 "../../dist/include/LayerState.h"
# 18 "../../dist/include/FrameLayerBuilder.h" 2

class nsDisplayListBuilder;
class nsDisplayList;
class nsDisplayItem;
class gfxContext;
class nsDisplayItemGeometry;

namespace mozilla {
namespace layers {
class ContainerLayer;
class LayerManager;
class BasicLayerManager;
class PaintedLayer;
}

namespace gfx {
class Matrix4x4;
}

class FrameLayerBuilder;
class LayerManagerData;
class PaintedLayerData;
class ContainerState;

class RefCountedRegion {
private:
  ~RefCountedRegion() {}
public:
  NS_INLINE_DECL_REFCOUNTING(RefCountedRegion)

  
  nsRegion mRegion;
  bool mIsInfinite;
};

struct NewLayerEntry;

struct ContainerLayerParameters {
  
  
  
  float mXScale, mYScale;
  /**
   * If non-null, the rectangle in which BuildContainerLayerFor stores the
   * visible rect of the layer, in the coordinate system of the created layer.
   */
  nsIntRect* mLayerContentsVisibleRect;
  /**
   * An offset to apply to all child layers created.
   */
  nsIntPoint mOffset;

  nscolor mBackgroundColor;
  bool mInTransformedSubtree;
  bool mInActiveTransformedSubtree;
  bool mDisableSubpixelAntialiasingInDescendants;
  bool mInLowPrecisionDisplayPort;
  /**
   * When this is false, PaintedLayer coordinates are drawn to with an integer
   * translation and the scale in mXScale/mYScale.
   */
  
};

/**
 * The FrameLayerBuilder is responsible for converting display lists 
 * into layer trees. Every LayerManager needs a unique FrameLayerBuilder
 * to build layers.
 * 
 * The most important API in this class is BuildContainerLayerFor. This
 */
class FrameLayerBuilder : public layers::LayerUserData {
public:
  typedef layers::ContainerLayer ContainerLayer;
  typedef layers::Layer Layer;
  typedef layers::PaintedLayer PaintedLayer;
  typedef layers::ImageLayer ImageLayer;
  typedef layers::LayerManager LayerManager;
  typedef layers::BasicLayerManager BasicLayerManager;
  typedef layers::EventRegions EventRegions;

  
  
  ;

  ;

  ;

  /**
   * Destroy any stored LayerManagerDataProperty and the associated data for
   * aFrame.
   */
  ;

  

  /**
   * Returns true if the given display item was rendered during the previous
   * Get the translation transform that was in aLayer when we last painted. It's either
   * created for that frame. DisplayItemData objects manage these lists automatically.
   *
   * During layer construction we update the data in the LayerManagerData object, marking
   * items that are modified. At the end we sweep the LayerManagerData hash-set and remove
   * all items that haven't been modified.
   */

  /**
   * Retained data for a display item.
   */
  class DisplayItemData MOZ_FINAL {
  public:
    friend class FrameLayerBuilder;

    
    nsAutoTArray<nsIFrame*, 1> mFrameListChanges;

    /**
     * Used to track if data currently stored in mFramesWithLayers (from an existing
     * paint) has been updated in the current paint.
     */
    bool            mUsed;
    bool            mIsInvalid;
  };

protected:

  friend class LayerManagerData;

  static void RemoveFrameFromLayerManager(nsIFrame* aFrame, void* aPropertyValue);

  ;
  ;
  ;
  ;

  ;
  /**
   * We store one of these for each display item associated with a
   * PaintedLayer, in a hashtable that maps each PaintedLayer to an array
   * of ClippedDisplayItems. (PaintedLayerItemsEntry is the hash entry
   * for that hashtable.)
   * These are only stored during the paint process, so that the
   * DrawPaintedLayer callback can figure out which items to draw for the
   * PaintedLayer.
   */
  struct ClippedDisplayItem {
    

    ;

    nsDisplayItem* mItem;

    /**
     * If the display item is being rendered as an inactive
     * layer, then this stores the layer manager being
     * used for the inactive transaction.
     */
    nsRefPtr<LayerManager> mInactiveLayerManager;

    uint32_t mContainerLayerGeneration;

  };

  ;

  ;

  /**
   * We accumulate ClippedDisplayItem elements in a hashtable during
   * the paint process. This is the hashentry for that hashtable.
   */
public:
  class PaintedLayerItemsEntry : public nsPtrHashKey<PaintedLayer> {
  public:
    
    

    nsTArray<ClippedDisplayItem> mItems;
    nsIFrame* mContainerLayerFrame;
    // The translation set on this PaintedLayer before we started updating the
    // layer tree.
    nsIntPoint mLastPaintOffset;
    uint32_t mLastCommonClipCount;

    uint32_t mContainerLayerGeneration;
    bool mHasExplicitLastPaintOffset;
    /**
      * The first mCommonClipCount rounded rectangle clips are identical for
      * all items in the layer. Computed in PaintedLayerData.
      */
    uint32_t mCommonClipCount;

    enum { ALLOW_MEMMOVE = true };
  };

  /**
   * Get the PaintedLayerItemsEntry object associated with aLayer in this
   * FrameLayerBuilder
   */
  

  

  

  

  /**
   * Attempt to build the most compressed layer tree possible, even if it means
   * throwing away existing retained buffers.
   * Saved generation counter so we can detect DOM changes.
   */
  uint32_t                            mInitialDOMGeneration;
  /**
   * Set to true if we have detected and reported DOM modification during
   * the current paint.
   */
  bool                                mDetectedDOMModification;
  /**
   * Indicates that the entire layer tree should be rerendered
   * during this paint.
   */
  bool                                mInvalidateAllLayers;

  bool                                mInLayerTreeCompressionMode;

  uint32_t                            mContainerLayerGeneration;
  uint32_t                            mMaxContainerLayerGeneration;
};

}

#endif /* FRAMELAYERBUILDER_H_ */
# 740 "../../dist/include/FrameLayerBuilder.h"
# 11 "../../dist/include/nsDisplayListInvalidation.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "imgIContainer.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsDisplayListInvalidation.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRect.h"
#endif /* expanded by -frewrite-includes */
class nsDisplayThemedBackground;

/**
 * This stores the geometry of an nsDisplayItem, and the area
 * that will be affected when painting the item.
 *
 * It is used to retain information about display items so they
 * can be compared against new display items in the next paint.
 */
class nsDisplayItemGeometry
{
public:
  ;
  virtual ~nsDisplayItemGeometry();
  
  /**
   * Compute the area required to be invalidated if this
   * display item is removed.
   */
  
  
  /**
   * Shifts all retained areas of the nsDisplayItemGeometry by the given offset.
   * 
   * This is used to compensate for scrolling, since the destination buffer
   * can scroll without requiring a full repaint.
   *
   * @param aOffset Offset to shift by.
   */
  virtual void MoveBy(const nsPoint& aOffset)
  {
    mBounds.MoveBy(aOffset);
  }

  /**
   * Bounds of the display item
   */
  nsRect mBounds;
};

/**
 * A default geometry implementation, used by nsDisplayItem. Retains
 * and compares the bounds, and border rect.
 *
 * This should be sufficient for the majority of display items.
 */
class nsDisplayItemGenericGeometry : public nsDisplayItemGeometry
{
public:
  nsDisplayItemGenericGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder);

  virtual void MoveBy(const nsPoint& aOffset) MOZ_OVERRIDE;

  nsRect mBorderRect;
};

;

/**
 * nsImageGeometryMixin is a mixin for geometry items that draw images. Geometry
 * items that include this mixin can track drawing results and use that
 * information to inform invalidation decisions.
 *
 * This mixin uses CRTP; its template parameter should be the type of the class
 * that is inheriting from it. See nsDisplayItemGenericImageGeometry for an
 * example.
 */
template <typename T>
class nsImageGeometryMixin
{
public:
  

  

  

private:
  mozilla::image::DrawResult mLastDrawResult;
  bool mWaitingForPaint;
};

/**
 * nsDisplayItemGenericImageGeometry is a generic geometry item class that
 * includes nsImageGeometryMixin.
 *
 * This should be sufficient for most display items that draw images.
 */
class nsDisplayItemGenericImageGeometry
  : public nsDisplayItemGenericGeometry
  , public nsImageGeometryMixin<nsDisplayItemGenericImageGeometry>
{
public:
  
};

class nsDisplayItemBoundsGeometry : public nsDisplayItemGeometry
{
public:
  nsDisplayItemBoundsGeometry(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder);


  nsRect mPositioningArea;
  bool mWindowIsActive;
};

class nsDisplayBoxShadowInnerGeometry : public nsDisplayItemGeometry
{
public:
  ;
  
  virtual void MoveBy(const nsPoint& aOffset) MOZ_OVERRIDE;

  nscolor mColor;
};

#endif /*NSDISPLAYLISTINVALIDATION_H_*/
# 274 "../../dist/include/nsDisplayListInvalidation.h"
# 26 "../../dist/include/nsDisplayList.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "DisplayListClipState.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/DisplayListClipState.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef DISPLAYLISTCLIPSTATE_H_
#define DISPLAYLISTCLIPSTATE_H_

#if 0 /* expanded by -frewrite-includes */
#include "DisplayItemClip.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/DisplayListClipState.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/DisplayListClipState.h"

class nsIFrame;
class nsDisplayListBuilder;

namespace mozilla {

/**
 * All clip coordinates are in appunits relative to the reference frame
 * for the display item we're building.
 */
class DisplayListClipState {
public:
  

  /**
   * Returns intersection of mClipContainingBlockDescendants and
   * mClipContentDescendants, allocated on aBuilder's arena.
   */
  ;

  
  

  class AutoSaveRestore;
  friend class AutoSaveRestore;

  class AutoClipContainingBlockDescendantsToContentBox;
  friend class AutoClipContainingBlockDescendantsToContentBox;

  class AutoClipMultiple;
  friend class AutoClipMultiple;

  enum {
    ASSUME_DRAWING_RESTRICTED_TO_CONTENT_RECT = 0x01
  };

private:
  

  

  /**
   * Intersects the given clip rect (with optional aRadii) with the current
   * mClipContainingBlockDescendants and sets mClipContainingBlockDescendants to
   * the result, stored in aClipOnStack.
   */
  ;

  ;
  ;

  /**
   * All containing-block descendants (i.e. frame descendants), including
   * display items for the current frame, should be clipped by
   * mClipContainingBlockDescendants.
   * Null if no clipping applies.
   */
  const DisplayItemClip* mClipContainingBlockDescendants;
  /**
   * The intersection of mClipContentDescendants and
   * mClipContainingBlockDescendants.
   * Allocated in the nsDisplayListBuilder arena. Null if none has been
   * allocated or both mClipContentDescendants and mClipContainingBlockDescendants
   * are null.
   */
  const DisplayItemClip* mCurrentCombinedClip;
};

/**
 * A class to automatically save and restore the current clip state. Also
 * offers methods for modifying the clip state. Only one modification is allowed
 * to be in scope at a time using one of these objects; multiple modifications
 * require nested objects. The interface is written this way to prevent
 * dangling pointers to DisplayItemClips.
 */
class DisplayListClipState::AutoSaveRestore {
public:
  ;
  
  

  

  /**
   * optimization to reduce the amount of clipping required.
   */
  

protected:
  DisplayListClipState& mState;
  DisplayListClipState mSavedState;
  DisplayItemClip mClip;
  DebugOnly<bool> mClipUsed;
  DebugOnly<bool> mRestored;
};

class DisplayListClipState::AutoClipContainingBlockDescendantsToContentBox : public AutoSaveRestore {
public:
  
};

/**
 * Do not use this outside of nsFrame::BuildDisplayListForChild, use
 * multiple AutoSaveRestores instead. We provide this class just to ensure
 * BuildDisplayListForChild is as efficient as possible.
 */
class DisplayListClipState::AutoClipMultiple : public AutoSaveRestore {
public:
  

  /**
   * *aClip must survive longer than this object. Be careful!!!
   */
  

  /**
   * Intersects the given clip rect (with optional aRadii) with the current
   * mClipContainingBlockDescendants and sets mClipContainingBlockDescendants to
   * the result, stored in aClipOnStack.
   */
  

protected:
  DisplayItemClip mExtraClip;
  DebugOnly<bool> mExtraClipUsed;
};

}

#endif /* DISPLAYLISTCLIPSTATE_H_ */

#if 0 /* expanded by -frewrite-includes */
#include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 37 "../../dist/include/nsDisplayList.h"
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 38 "../../dist/include/nsDisplayList.h"

class nsIContent;
class nsRenderingContext;
class nsDisplayTableItem;
class nsISelection;
class nsDisplayLayerEventRegions;
class nsCaret;

namespace mozilla {
class FrameLayerBuilder;
namespace layers {
class Layer;
class ImageLayer;
class ImageContainer;
} //namespace
} //namespace

// A set of blend modes, that never includes OP_OVER (since it's
// considered the default, rather than a specific blend mode).
typedef mozilla::EnumSet<mozilla::gfx::CompositionOp> BlendModeSet;

/*
 * a display list while a reflow is pending, before it starts.
 * 
 * A display list covers the "extended" frame tree; the display list for a frame
 * tree containing FRAME/IFRAME elements can include frames from the subdocuments.
 *
 * Display item's coordinates are relative to their nearest reference frame ancestor.
 * Both the display root and any frame with a transform act as a reference frame
 * for their frame subtrees.
 */

// All types are defined in nsDisplayItemTypes.h
#define NS_DISPLAY_DECL_NAME(n, e) \
  virtual const char* Name() MOZ_OVERRIDE { return n; } \
  virtual Type GetType() MOZ_OVERRIDE { return e; }

/**
 * This manages a display list and is passed as a parameter to
 * nsIFrame::BuildDisplayList.
 * It contains the parameters that don't change from frame to frame and manages
 * the display list memory using a PLArena. It also establishes the reference
 * coordinate system for all display list items. Some of the parameters are
 * available from the prescontext/presshell, but we copy them into the builder
 * for faster/more convenient access.
 */
class nsDisplayListBuilder {
public:
  typedef mozilla::FramePropertyDescriptor FramePropertyDescriptor;
  typedef mozilla::FrameLayerBuilder FrameLayerBuilder;
  typedef mozilla::DisplayItemClip DisplayItemClip;
  typedef mozilla::DisplayListClipState DisplayListClipState;
  typedef nsIWidget::ThemeGeometry ThemeGeometry;
  typedef mozilla::layers::Layer Layer;
  typedef mozilla::layers::FrameMetrics FrameMetrics;
  typedef mozilla::layers::FrameMetrics::ViewID ViewID;

  ;

  
  

  /**
   * @return true if the display is being built in order to determine which
   * frame is under the mouse position.
   */
  

  /**

  /**
   * Adjusts mWindowDraggingRegion to take into account aFrame. If aFrame's
   * -moz-window-dragging value is |drag|, its border box is added to the
   * automatically when the arena goes away.
   */
  const DisplayItemClip* AllocateDisplayItemClip(const DisplayItemClip& aOriginal);

  /**
   * Transfer off main thread animations to the layer.  May be called
   * with aBuilder and aItem both null, but only if the caller has
   * already checked that off main thread animations should be sent to
   * the layer.  When they are both null, the animations are added to
   * the layer as pending animations.

  /**
   * mContainsBlendMode is true if we processed a display item that
   * has a blend mode attached. We do this so we can insert a 
   * nsDisplayBlendContainer in the parent stacking context.
   */
  ;

  /**
   * Look up the cached animated geometry root for aFrame subject to
   * aStopAtAncestor. Store the nsIFrame* result into *aOutResult, and return
   * true if the cache was hit. Return false if the cache was not hit.
   */
  ;

private:
  ;

  struct PresShellState {
    nsIPresShell* mPresShell;
    nsIFrame*     mCaretFrame;
    nsRect        mCaretRect;
    uint32_t      mFirstFrameMarkedForDisplay;
    bool          mIsBackgroundOnly;
    // This is a per-document flag turning off event handling for all content
    // in the document, and is set when we enter a subdocument for a pointer-
    // events:none frame that doesn't have mozpasspointerevents set.
    bool          mInsidePointerEventsNoneDoc;
  };

  

  struct DocumentWillChangeBudget {
    

    uint32_t mBudget;
  };

  nsIFrame*                      mReferenceFrame;
  nsIFrame*                      mIgnoreScrollFrame;
  nsDisplayLayerEventRegions*    mLayerEventRegions;
  PLArenaPool                    mPool;
  nsCOMPtr<nsISelection>         mBoundingSelection;
  nsAutoTArray<PresShellState,8> mPresShellStates;
  nsAutoTArray<nsIFrame*,100>    mFramesMarkedForDisplay;
  nsAutoTArray<ThemeGeometry,2>  mThemeGeometries;
  // True when the first async-scrollable scroll frame for which we build a
  // display list has a display port. An async-scrollable scroll frame is one
  // which WantsAsyncScroll().
  bool                           mHaveScrollableDisplayPort;
  bool                           mWindowDraggingAllowed;
  bool                           mIsBuildingForPopup;
  bool                           mForceLayerForScrollParent;
};

class nsDisplayItem;
class nsDisplayList;
/**
 * nsDisplayItems are put in singly-linked lists rooted in an nsDisplayList.
 * nsDisplayItemLink holds the link. The lists are linked from lowest to
 * highest in z-order.
 */
class nsDisplayItemLink {
  // This is never instantiated directly, so no need to count constructors and
  // destructors.
protected:
  nsDisplayItemLink() : mAbove(nullptr) {}
  nsDisplayItem* mAbove;  
  
  friend class nsDisplayList;
};

/**
 * This is the unit of rendering and event testing. Each instance of this
 * class represents an entity that can be drawn on the screen, e.g., a
 * frame's CSS background, or a frame's text string.
 * 
 * nsDisplayListItems can be containers --- i.e., they can perform hit testing
 * and painting by recursively traversing a list of child items.
 * 
 * These are arena-allocated during display list construction. A typical
 * subclass would just have a frame pointer, so its object would be just three
 * pointers (vtable, next-item, frame).
 * 
 * Display items belong to a list at all times (except temporarily as they
 * move from one list to another).
 */
class nsDisplayItem : public nsDisplayItemLink {
public:
  typedef mozilla::ContainerLayerParameters ContainerLayerParameters;
  typedef mozilla::DisplayItemClip DisplayItemClip;
  typedef mozilla::layers::FrameMetrics FrameMetrics;
  typedef mozilla::layers::FrameMetrics::ViewID ViewID;
  typedef mozilla::layers::Layer Layer;
  typedef mozilla::layers::LayerManager LayerManager;
  typedef mozilla::LayerState LayerState;

  // This is never instantiated directly (it has pure virtual methods), so no
  // need to count constructors and destructors.
  nsDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame);
  /**
   * This constructor is only used in rare cases when we need to construct
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

/**
 * It's useful to be able to dynamically check the type of certain items.
 * Every subclass of nsDisplayItem must have a new type added here for the purposes
 * of easy comparison and matching of items in different display lists.
 * 
 * This is #included inside nsDisplayItem.
 */


enum Type {
  TYPE_ZERO = 0, /** Spacer so that the first item starts at 1 */

#define DECLARE_DISPLAY_ITEM_TYPE(name) TYPE_##name,
#define DECLARE_DISPLAY_ITEM_TYPE_FLAGS(name,flags) TYPE_##name,
#if 0 /* expanded by -frewrite-includes */
#include "nsDisplayItemTypesList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsDisplayItemTypesList.h" 1
// IWYU pragma: private, include "nsDisplayList.h"
DECLARE_DISPLAY_ITEM_TYPE(ALT_FEEDBACK)
DECLARE_DISPLAY_ITEM_TYPE(BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(THEMED_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE_FLAGS(BACKGROUND_COLOR,TYPE_RENDERS_NO_IMAGES)
DECLARE_DISPLAY_ITEM_TYPE(BLEND_CONTAINER)
DECLARE_DISPLAY_ITEM_TYPE(BORDER)
DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_OUTER)
DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_INNER)
DECLARE_DISPLAY_ITEM_TYPE(BULLET)
DECLARE_DISPLAY_ITEM_TYPE(BUTTON_BORDER_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(BUTTON_BOX_SHADOW_OUTER)
DECLARE_DISPLAY_ITEM_TYPE(BUTTON_FOREGROUND)
DECLARE_DISPLAY_ITEM_TYPE(CANVAS)
DECLARE_DISPLAY_ITEM_TYPE(CANVAS_BACKGROUND_COLOR)
DECLARE_DISPLAY_ITEM_TYPE(CANVAS_THEMED_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(CANVAS_BACKGROUND_IMAGE)
DECLARE_DISPLAY_ITEM_TYPE(CANVAS_FOCUS)
DECLARE_DISPLAY_ITEM_TYPE(CARET)
DECLARE_DISPLAY_ITEM_TYPE(CHECKED_CHECKBOX)
DECLARE_DISPLAY_ITEM_TYPE(CHECKED_RADIOBUTTON)
DECLARE_DISPLAY_ITEM_TYPE(CLEAR_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(COLUMN_RULE)
DECLARE_DISPLAY_ITEM_TYPE(COMBOBOX_FOCUS)
DECLARE_DISPLAY_ITEM_TYPE(EVENT_RECEIVER)
DECLARE_DISPLAY_ITEM_TYPE(LAYER_EVENT_REGIONS)
DECLARE_DISPLAY_ITEM_TYPE(FIELDSET_BORDER_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(STICKY_POSITION)
DECLARE_DISPLAY_ITEM_TYPE(FRAMESET_BORDER)
DECLARE_DISPLAY_ITEM_TYPE(FRAMESET_BLANK)
DECLARE_DISPLAY_ITEM_TYPE(HEADER_FOOTER)
DECLARE_DISPLAY_ITEM_TYPE(IMAGE)
DECLARE_DISPLAY_ITEM_TYPE(LIST_FOCUS)
DECLARE_DISPLAY_ITEM_TYPE(MIX_BLEND_MODE)
DECLARE_DISPLAY_ITEM_TYPE(OPACITY)
DECLARE_DISPLAY_ITEM_TYPE(OPTION_EVENT_GRABBER)
DECLARE_DISPLAY_ITEM_TYPE(OUTLINE)
DECLARE_DISPLAY_ITEM_TYPE(OWN_LAYER)
DECLARE_DISPLAY_ITEM_TYPE(PAGE_CONTENT)
DECLARE_DISPLAY_ITEM_TYPE(PAGE_SEQUENCE)
DECLARE_DISPLAY_ITEM_TYPE(PLUGIN)
DECLARE_DISPLAY_ITEM_TYPE(PLUGIN_READBACK)
DECLARE_DISPLAY_ITEM_TYPE(PLUGIN_VIDEO)
DECLARE_DISPLAY_ITEM_TYPE(PRINT_PLUGIN)
DECLARE_DISPLAY_ITEM_TYPE(REMOTE)
DECLARE_DISPLAY_ITEM_TYPE(REMOTE_SHADOW)
DECLARE_DISPLAY_ITEM_TYPE(RESOLUTION)
DECLARE_DISPLAY_ITEM_TYPE(SCROLL_LAYER)
DECLARE_DISPLAY_ITEM_TYPE(SCROLL_INFO_LAYER)
DECLARE_DISPLAY_ITEM_TYPE(SELECTION_OVERLAY)
DECLARE_DISPLAY_ITEM_TYPE(SOLID_COLOR)
DECLARE_DISPLAY_ITEM_TYPE(SUBDOCUMENT)
DECLARE_DISPLAY_ITEM_TYPE(SVG_EFFECTS)
DECLARE_DISPLAY_ITEM_TYPE(SVG_GLYPHS)
DECLARE_DISPLAY_ITEM_TYPE(SVG_OUTER_SVG)
DECLARE_DISPLAY_ITEM_TYPE(SVG_PATH_GEOMETRY)
DECLARE_DISPLAY_ITEM_TYPE(SVG_TEXT)
DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_SELECTION)
DECLARE_DISPLAY_ITEM_TYPE(TABLE_ROW_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(TABLE_ROW_GROUP_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(TABLE_BORDER_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(TEXT)
DECLARE_DISPLAY_ITEM_TYPE(TEXT_DECORATION)
DECLARE_DISPLAY_ITEM_TYPE(TEXT_OVERFLOW)
DECLARE_DISPLAY_ITEM_TYPE(TEXT_SHADOW)
DECLARE_DISPLAY_ITEM_TYPE(TRANSFORM)
DECLARE_DISPLAY_ITEM_TYPE(VIDEO)
DECLARE_DISPLAY_ITEM_TYPE(WRAP_LIST)
DECLARE_DISPLAY_ITEM_TYPE(ZOOM)
DECLARE_DISPLAY_ITEM_TYPE(EXCLUDE_GLASS_FRAME)

#if defined(MOZ_REFLOW_PERF_DSP) && defined(MOZ_REFLOW_PERF)
DECLARE_DISPLAY_ITEM_TYPE(REFLOW_COUNT)
#endif
# 76 "../../dist/include/nsDisplayItemTypesList.h"

#ifdef MOZ_XUL
DECLARE_DISPLAY_ITEM_TYPE(XUL_EVENT_REDIRECTOR)
DECLARE_DISPLAY_ITEM_TYPE(XUL_GROUP_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(XUL_IMAGE)
DECLARE_DISPLAY_ITEM_TYPE(XUL_TEXT_BOX)
DECLARE_DISPLAY_ITEM_TYPE(XUL_TREE_BODY)
DECLARE_DISPLAY_ITEM_TYPE(XUL_TREE_COL_SPLITTER_TARGET)
#ifdef DEBUG_LAYOUT
DECLARE_DISPLAY_ITEM_TYPE(XUL_DEBUG)
#endif
# 87 "../../dist/include/nsDisplayItemTypesList.h"
#endif
# 88 "../../dist/include/nsDisplayItemTypesList.h"

DECLARE_DISPLAY_ITEM_TYPE(MATHML_BAR)
DECLARE_DISPLAY_ITEM_TYPE(MATHML_CHAR_BACKGROUND)
DECLARE_DISPLAY_ITEM_TYPE(MATHML_CHAR_FOREGROUND)
DECLARE_DISPLAY_ITEM_TYPE(MATHML_ERROR)
DECLARE_DISPLAY_ITEM_TYPE(MATHML_MENCLOSE_NOTATION)
DECLARE_DISPLAY_ITEM_TYPE(MATHML_SELECTION_RECT)
DECLARE_DISPLAY_ITEM_TYPE(MATHML_SLASH)
#ifdef DEBUG
DECLARE_DISPLAY_ITEM_TYPE(MATHML_BOUNDING_METRICS)
DECLARE_DISPLAY_ITEM_TYPE(MATHML_CHAR_DEBUG)

DECLARE_DISPLAY_ITEM_TYPE(DEBUG_BORDER)
DECLARE_DISPLAY_ITEM_TYPE(DEBUG_IMAGE_MAP)
DECLARE_DISPLAY_ITEM_TYPE(DEBUG_PLACEHOLDER)
DECLARE_DISPLAY_ITEM_TYPE(EVENT_TARGET_BORDER)
#endif
# 105 "../../dist/include/nsDisplayItemTypesList.h"
# 24 "../../dist/include/nsDisplayItemTypes.h" 2
#undef DECLARE_DISPLAY_ITEM_TYPE
#undef DECLARE_DISPLAY_ITEM_TYPE_FLAGS

  TYPE_MAX
};

enum {
  // Number of bits needed to represent all types
  TYPE_BITS = 8
};

enum DisplayItemFlags {
  TYPE_RENDERS_NO_IMAGES = 1 << 0
};






# 1025 "../../dist/include/nsDisplayList.h" 2

  struct HitTestState {
    

    

    nsAutoTArray<nsDisplayItem*, 100> mItemBuffer;
  };

  /**
   * Some consecutive items should be rendered together as a unit, e.g.,
   * outlines for the same element. For this, we need a way for items to
   * identify their type. We use the type for other purposes too.
   */
  virtual Type GetType() = 0;
  /**
   * Pairing this with the GetUnderlyingFrame() pointer gives a key that
   * uniquely identifies this display item in the display item tree.
   * XXX check ScrollLayerWrapper/nsOptionEventGrabberWrapper/nsXULEventRedirectorWrapper
   */
  virtual uint32_t GetPerFrameKey() { return uint32_t(GetType()); }
  /**
   * This is called after we've constructed a display list for event handling.
   * When this is called, we've already ensured that aRect intersects the
   * item's bounds and that clipping has been taking into account.
   *
   * @param aRect the point or rect being tested, relative to the reference
   * frame. If the width and height are both 1 app unit, it indicates we're
   * hit testing a point, not a rect.
   * @param aState must point to a HitTestState. If you don't have one,
   * just create one with the default constructor and pass it in.
   * @param aOutFrames each item appends the frame(s) in this display item that
   * the rect is considered over (if any) to aOutFrames.
   */
  virtual void HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect,
                       HitTestState* aState, nsTArray<nsIFrame*> *aOutFrames) {}
  /**
   * @return the frame that this display item is based on. This is used to sort
   * items by z-index and content order and for some other uses. Never
   * returns null.
   */
  inline nsIFrame* Frame() const { return mFrame; }
  /**
   * Compute the used z-index of our frame; returns zero for elements to which
   * z-index does not apply, and for z-index:auto.
   * @note This can be overridden, @see nsDisplayWrapList::SetOverrideZIndex.
   */
  virtual int32_t ZIndex() const;
  /**
   * The default bounds is the frame border rect.
   * @param aSnap *aSnap is set to true if the returned rect will be
   * snapped to nearest device pixel edges during actual drawing.
   * It might be set to false and snap anyway, so code computing the set of
   * pixels affected by this display item needs to round outwards to pixel
   * boundaries when *aSnap is set to false.
   * This does not take the item's clipping into account.
   * @return a rectangle relative to aBuilder->ReferenceFrame() that
   * contains the area drawn by this display item
   */
  virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
  {
    *aSnap = false;
    return nsRect(ToReferenceFrame(), Frame()->GetSize());
  }
  /**
   * Returns true if nothing will be rendered inside aRect, false if uncertain.
   * aRect is assumed to be contained in this item's bounds.
   */
  virtual bool IsInvisibleInRect(const nsRect& aRect)
  {
    return false;
  }
  /**
   * Returns the result of GetBounds intersected with the item's clip.
   * The intersection is approximate since rounded corners are not taking into
   * account.
   */
  ;
  nsRect GetBorderRect() {
    return nsRect(ToReferenceFrame(), Frame()->GetSize());
  }
  
  

  /**
   * Checks if the frame(s) owning this display item have been marked as invalid,
   * and needing repainting.
   */
  virtual bool IsInvalid(nsRect& aRect) { 
    bool result = mFrame ? mFrame->IsInvalid(aRect) : false;
    aRect += ToReferenceFrame();
    return result;
  }

  /**
   * Creates and initializes an nsDisplayItemGeometry object that retains the current
   * areas covered by this display item. These need to retain enough information
   * such that they can be compared against a future nsDisplayItem of the same type, 
   * and determine if repainting needs to happen.
   *
   * Subclasses wishing to store more information need to override both this
   * and ComputeInvalidationRegion, as well as implementing an nsDisplayItemGeometry
   * subclass.
   *
   * The default implementation tracks both the display item bounds, and the frame's
   * border rect.
   */
  virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder)
  {
    return new nsDisplayItemGenericGeometry(this, aBuilder);
  }

  /**
   * Compares an nsDisplayItemGeometry object from a previous paint against the 
   * current item. Computes if the geometry of the item has changed, and the 
   * invalidation area required for correct repainting.
   *
   * The existing geometry will have been created from a display item with a 
   * matching GetPerFrameKey()/mFrame pair to the current item.
   *
   * The default implementation compares the display item bounds, and the frame's
   * border rect, and invalidates the entire bounds if either rect changes.
   *
   * @param aGeometry The geometry of the matching display item from the 
   * previous paint.
   * @param aInvalidRegion Output param, the region to invalidate, or
   * unchanged if none.
   */
  virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
                                         const nsDisplayItemGeometry* aGeometry,
                                         nsRegion* aInvalidRegion)
  {
    const nsDisplayItemGenericGeometry* geometry = static_cast<const nsDisplayItemGenericGeometry*>(aGeometry);
    bool snap;
    if (!geometry->mBounds.IsEqualInterior(GetBounds(aBuilder, &snap)) ||
        !geometry->mBorderRect.IsEqualInterior(GetBorderRect())) {
      aInvalidRegion->Or(GetBounds(aBuilder, &snap), geometry->mBounds);
    }
  }

  /**
   * An alternative default implementation of ComputeInvalidationRegion,
   * that instead invalidates only the changed area between the two items.
   */
  

  /**
   * Called when the area rendered by this display item has changed (been
   * invalidated or changed geometry) since the last paint. This includes
   * when the display item was not rendered at all in the last paint.
   * It does NOT get called when a display item was being rendered and no
   * longer is, because generally that means there is no display item to
   * call this method on.
   */
  virtual void NotifyRenderingChanged() {}

  /**
   * @param aSnap set to true if the edges of the rectangles of the opaque
   * region would be snapped to device pixels when drawing
   * @return a region of the item that is opaque --- that is, every pixel
   * that is visible is painted with an opaque
   * color. This is useful for determining when one piece
   * of content completely obscures another so that we can do occlusion
   * culling.
   * This does not take clipping into account.
   */
  virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
                                   bool* aSnap)
  {
    *aSnap = false;
    return nsRegion();
  }
  /**
   * If this returns true, then aColor is set to the uniform color
   * @return true if the item is guaranteed to paint every pixel in its
   * bounds with the same (possibly translucent) color
   */
  virtual bool IsUniform(nsDisplayListBuilder* aBuilder, nscolor* aColor) { return false; }
  /**
   * are not changing frequently. In this case it makes sense to composite
   * the layer into a PaintedLayer with other content, so we don't have to
   * recomposite it every time we paint.
   * Note: GetLayerState is only allowed to return LAYER_INACTIVE if all
   * descendant display items returned LAYER_INACTIVE or LAYER_NONE. Also,
   * all descendant display item frames must have an active scrolled root
   * that's either the same as this item's frame's active scrolled root, or
   * a descendant of this item's frame. This ensures that the entire
   * set of display items can be collapsed onto a single PaintedLayer.
   * Return LAYER_ACTIVE if the layer is active, that is, its contents are
   * changing frequently. In this case it makes sense to keep the layer
   * as a separate buffer in VRAM and composite it into the destination
   * every time we paint.
   *
   * Users of GetLayerState should check ForceActiveLayers() and if it returns
   * true, change a returned value of LAYER_INACTIVE to LAYER_ACTIVE.
   */
  virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
                                   LayerManager* aManager,
                                   const ContainerLayerParameters& aParameters)
  { return mozilla::LAYER_NONE; }
  /**
   * Return true to indicate the layer should be constructed even if it's
   * completely invisible.
   */
  virtual bool ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBuilder)
  { return false; }
  /**
   * Actually paint this item to some rendering context.
   * Content outside mVisibleRect need not be painted.
   * aCtx must be set up as for nsDisplayList::Paint.
   */
  virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) {}

#ifdef MOZ_DUMP_PAINTING
  /**
   * Mark this display item as being painted via FrameLayerBuilder::DrawPaintedLayer.
   */
  

  /**
   * Check if this display item has been painted.
   */
  void SetPainted() { mPainted = true; }
#endif
# 1303 "../../dist/include/nsDisplayList.h"

  /**
   * Get the layer drawn by this display item. Call this only if
   * GetLayerState() returns something other than LAYER_NONE.
   * If GetLayerState returned LAYER_NONE then Paint will be called
   * instead.
   * This is called while aManager is in the construction phase.
   * 
   * The caller (nsDisplayList) is responsible for setting the visible
   * region of the layer.
   *
   * @param aContainerParameters should be passed to
   * FrameLayerBuilder::BuildContainerLayerFor if a ContainerLayer is
   * constructed.
   */
  virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
                                             LayerManager* aManager,
                                             const ContainerLayerParameters& aContainerParameters)
  { return nullptr; }

  /**
   * On entry, aVisibleRegion contains the region (relative to ReferenceFrame())
   * which may be visible. If the display item opaquely covers an area, it
   */
  virtual bool ComputeVisibility(nsDisplayListBuilder* aBuilder,
                                 nsRegion* aVisibleRegion);

  /**
   * Try to merge with the other item (which is below us in the display
   * list). This gets used by nsDisplayClip to coalesce clipping operations
   * (optimization), by nsDisplayOpacity to merge rendering for the same
   * content element into a single opacity group (correctness), and will be
   * used by nsDisplayOutline to merge multiple outlines for the same element
   * (also for correctness).
   * @return true if the merge was successful and the other item should be deleted
   */
  virtual bool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) {
    return false;
  }

  /**
   * Appends the underlying frames of all display items that have been
   * merged into this one (excluding  this item's own underlying frame)
   * to aFrames.
   */
  virtual void GetMergedFrames(nsTArray<nsIFrame*>* aFrames) {}

  /**
   * During the visibility computation and after TryMerge, display lists may
   * return true here to flatten themselves away, removing them. This
   * flattening is distinctly different from FlattenTo, which occurs before
   * items are merged together.
   */
  virtual bool ShouldFlattenAway(nsDisplayListBuilder* aBuilder) {
    return false;
  }

  /**
   * If this has a child list where the children are in the same coordinate
   * system as this item (i.e., they have the same reference frame),
   * return the list.
   */
  virtual nsDisplayList* GetSameCoordinateSystemChildren() { return nullptr; }
  virtual void UpdateBounds(nsDisplayListBuilder* aBuilder) {}

  /**
   * If this has a child list, return it, even if the children are in
   * a different coordinate system to this item.
   */
  virtual nsDisplayList* GetChildren() { return nullptr; }

  /**
   * Returns the visible rect.
   */
  const nsRect& GetVisibleRect() const { return mVisibleRect; }

  /**
   * Returns the visible rect for the children, relative to their
   * reference frame. Can be different from mVisibleRect for nsDisplayTransform,
   * since the reference frame for the children is different from the reference
   * frame for the item itself.
   */
  virtual const nsRect& GetVisibleRectForChildren() const { return mVisibleRect; }

  /**
   * Stores the given opacity value to be applied when drawing. It is an error to
   * call this if CanApplyOpacity returned false.
   */
  virtual const char* Name() = 0;

  virtual void WriteDebugInfo(std::stringstream& aStream) {}

  nsDisplayItem* GetAbove() { return mAbove; }

  /**
   * Like ComputeVisibility, but does the work that nsDisplayList
   * does per-item:
   * -- Intersects GetBounds with aVisibleRegion and puts the result
   * in mVisibleRect
   * -- Subtracts bounds from aVisibleRegion if the item is opaque
   */
  bool RecomputeVisibility(nsDisplayListBuilder* aBuilder,
                           nsRegion* aVisibleRegion);

  /**
   * Returns the result of aBuilder->ToReferenceFrame(GetUnderlyingFrame())
   */
  const nsPoint& ToReferenceFrame() const {
    NS_ASSERTION(mFrame, "No frame?");
    return mToReferenceFrame;
  }
  /**
   * @return the root of the display list's frame (sub)tree, whose origin
   * establishes the coordinate system for the display list
   */
  const nsIFrame* ReferenceFrame() const { return mReferenceFrame; }

  /**
   * Returns the reference frame for display item children of this item.
   */
  virtual const nsIFrame* ReferenceFrameForChildren() const { return mReferenceFrame; }

  /**
   * Checks if this display item (or any children) contains content that might
   * be rendered with component alpha (e.g. subpixel antialiasing). Returns the
   * bounds of the area that needs component alpha, or an empty rect if nothing
   * in the item does.
   */
  virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) { return nsRect(); }

  /**
   * Disable usage of component alpha. Currently only relevant for items that have text.
   */
  virtual void DisableComponentAlpha() {}

  /**
   * Check if we can add async animations to the layer for this display item.
   */
  virtual bool CanUseAsyncAnimations(nsDisplayListBuilder* aBuilder) {
    return false;
  }
  
  virtual bool SupportsOptimizingToImage() { return false; }

  const DisplayItemClip& GetClip()
  {
    return mClip ? *mClip : DisplayItemClip::NoClip();
  }
  void SetClip(nsDisplayListBuilder* aBuilder, const DisplayItemClip& aClip)
  {
    if (!aClip.HasClip()) {
      mClip = nullptr;
      return;
    }
    mClip = aBuilder->AllocateDisplayItemClip(aClip);
  }

  void IntersectClip(nsDisplayListBuilder* aBuilder, const DisplayItemClip& aClip)
  {
    if (mClip) {
      DisplayItemClip temp = *mClip;
      temp.IntersectWith(aClip);
      SetClip(aBuilder, temp);
    } else {
      SetClip(aBuilder, aClip);
    }
  }

protected:
  friend class nsDisplayList;

  

  nsIFrame* mFrame;
  const DisplayItemClip* mClip;
  // Result of FindReferenceFrameFor(mFrame), if mFrame is non-null
  const nsIFrame* mReferenceFrame;
  // Result of ToReferenceFrame(mFrame), if mFrame is non-null
  nsPoint   mToReferenceFrame;
  // This is the rectangle that needs to be painted.
  // Display item construction sets this to the dirty rect.
  // nsDisplayList::ComputeVisibility sets this to the visible region
  // of the item by intersecting the current visible region with the bounds
  // of the item. Paint implementations can use this to limit their drawing.
  // Guaranteed to be contained in GetBounds().
  nsRect    mVisibleRect;
#ifdef MOZ_DUMP_PAINTING
  // True if this frame has been painted.
  bool      mPainted;
#endif
# 1525 "../../dist/include/nsDisplayList.h"
};

/**
 * Manages a singly-linked list of display list items.
 * 
 * mSentinel is the sentinel list value, the first value in the null-terminated
 * linked list of items. mTop is the last item in the list (whose 'above'
 * pointer is null). This class has no virtual methods. So list objects are just
 * two pointers.
 * 
 * Stepping upward through this list is very fast. Stepping downward is very
 * slow so we don't support it. The methods that need to step downward
 * (HitTest(), ComputeVisibility()) internally build a temporary array of all
 * the items while they do the downward traversal, so overall they're still
 * linear time. We have optimized for efficient AppendToTop() of both
 * items and lists, with minimal codesize. AppendToBottom() is efficient too.
 */
class nsDisplayList {
public:
  typedef mozilla::layers::Layer Layer;
  typedef mozilla::layers::LayerManager LayerManager;
  typedef mozilla::layers::PaintedLayer PaintedLayer;

  /**
   * @param aCommonAncestor a common ancestor of all the content elements
   * associated with the display items, for speeding up tree order
   * checks, or nullptr if not known; it's only a hint, if it is not an
   * ancestor of some elements, then we lose performance but not correctness
   */
  ;
  /**
   * Stable sort the list by the tree order of the content of
   * GetUnderlyingFrame() on each item. z-index is ignored.
   * @param aCommonAncestor a common ancestor of all the content elements
   * associated with the display items, for speeding up tree order
   * checks, or nullptr if not known; it's only a hint, if it is not an
   * ancestor of some elements, then we lose performance but not correctness
   */
  void SortByContentOrder(nsDisplayListBuilder* aBuilder, nsIContent* aCommonAncestor);

  /**
   * Generic stable sort. Take care, because some of the items might be nsDisplayLists
   * themselves.
   * aCmp(item1, item2) should return true if item1 <= item2. We sort the items
   * into increasing order.
   */
  typedef bool (* SortLEQ)(nsDisplayItem* aItem1, nsDisplayItem* aItem2,
                             void* aClosure);
  ;

  /**
   * Compute visiblity for the items in the list.
   * We put this logic here so it can be shared by top-level
   * painting and also display items that maintain child lists.
   * This is also a good place to put ComputeVisibility-related logic
  /**
   * Returns true if the visible region output from ComputeVisiblity was
   * empty, i.e. everything visible in this list is opaque.
   */
  

  /**
   * Returns true if any display item requires the surface to be transparent.
   */
  void* operator new(size_t sz) CPP_THROW_NEW;
  
  nsDisplayItemLink  mSentinel;
  nsDisplayItemLink* mTop;

  // This is set by ComputeVisibility
  nsRect mVisibleRect;
  // This is set to true by FrameLayerBuilder if the final visible region
  // is empty (i.e. everything that was visible is covered by some
  // opaque content in this list).
  bool mIsOpaque;
  // This is set to true by FrameLayerBuilder if any display item in this
  // list needs to force the surface containing this list to be transparent.
  bool mForceTransparentSurface;
};

/**
 * This is passed as a parameter to nsIFrame::BuildDisplayList. That method
 * will put any generated items onto the appropriate list given here. It's
 * basically just a collection with one list for each separate stacking layer.
 * The lists themselves are external to this object and thus can be shared
 * with others. Some of the list pointers may even refer to the same list.
 */
class nsDisplayListSet {
public:
  /**
   * @return a list where one should place the border and/or background for
   * this frame (everything from steps 1 and 2 of CSS 2.1 appendix E)
   */
  
  /**
   * @return a list where one should place the borders and/or backgrounds for
   * block-level in-flow descendants (step 4 of CSS 2.1 appendix E)
   */
  nsDisplayList* BlockBorderBackgrounds() const { return mBlockBorderBackgrounds; }
  /**
   * @return a list where one should place descendant floats (step 5 of
   * CSS 2.1 appendix E)
   */
  nsDisplayList* Floats() const { return mFloats; }
  nsDisplayListSet(nsDisplayList* aBorderBackground,
                   nsDisplayList* aBlockBorderBackgrounds,
                   nsDisplayList* aFloats,
                   nsDisplayList* aContent,
                   nsDisplayList* aPositionedDescendants,
                   nsDisplayList* aOutlines) :
     mBorderBackground(aBorderBackground),
     mBlockBorderBackgrounds(aBlockBorderBackgrounds),
     mFloats(aFloats),
     mContent(aContent),
     mPositioned(aPositionedDescendants),
     mOutlines(aOutlines) {
  }

  /**
   * A copy constructor that lets the caller override the BorderBackground
   * list.
   */  
  
  
  /**
   * Move all display items in our lists to top of the corresponding lists in the
   * destination.
   */
  ;

private:
  // This class is only used on stack, so we don't have to worry about leaking
  // it.  Don't let us be heap-allocated!
  void* operator new(size_t sz) CPP_THROW_NEW;

protected:
  nsDisplayList* mBorderBackground;
  nsDisplayList* mBlockBorderBackgrounds;
  nsDisplayList* mFloats;
  nsDisplayList* mContent;
  nsDisplayList* mPositioned;
  nsDisplayList* mOutlines;
};

/**
 * A specialization of nsDisplayListSet where the lists are actually internal
 * to the object, and all distinct.
 */
struct nsDisplayListCollection : public nsDisplayListSet {
  
  explicit nsDisplayListCollection(nsDisplayList* aBorderBackground) :
    nsDisplayListSet(aBorderBackground, &mLists[1], &mLists[2], &mLists[3], &mLists[4],
                     &mLists[5]) {}

  /**
   * Sort all lists by content order.
   */                     
  void SortAllByContentOrder(nsDisplayListBuilder* aBuilder, nsIContent* aCommonAncestor) {
    for (int32_t i = 0; i < 6; ++i) {
      mLists[i].SortByContentOrder(aBuilder, aCommonAncestor);
    }
  }

private:
  // This class is only used on stack, so we don't have to worry about leaking
  // it.  Don't let us be heap-allocated!
  void* operator new(size_t sz) CPP_THROW_NEW;

  nsDisplayList mLists[6];
};


class nsDisplayImageContainer : public nsDisplayItem {
public:
  typedef mozilla::layers::ImageContainer ImageContainer;
  typedef mozilla::layers::ImageLayer ImageLayer;

  nsDisplayImageContainer(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
    : nsDisplayItem(aBuilder, aFrame)
  {}

  virtual already_AddRefed<ImageContainer> GetContainer(LayerManager* aManager,
                                                        nsDisplayListBuilder* aBuilder) = 0;
  virtual void ConfigureLayer(ImageLayer* aLayer, const nsIntPoint& aOffset) = 0;

  virtual bool SupportsOptimizingToImage() MOZ_OVERRIDE { return true; }
};

/**
 * Use this class to implement not-very-frequently-used display items
 * that are not opaque, do not receive events, and are bounded by a frame's
 * border-rect.
 * 
 * This should not be used for display items which are created frequently,
 * because each item is one or two pointers bigger than an item from a
 * custom display item class could be, and fractionally slower. However it does
 * save code size. We use this for infrequently-used item types.
 */
class nsDisplayGeneric : public nsDisplayItem {
public:
  typedef void (* PaintCallback)(nsIFrame* aFrame, nsRenderingContext* aCtx,
                                 const nsRect& aDirtyRect, nsPoint aFramePt);

  nsDisplayGeneric(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
                   PaintCallback aPaint, const char* aName, Type aType)
    : nsDisplayItem(aBuilder, aFrame), mPaint(aPaint)
      , mName(aName)
      , mType(aType)
  {
    MOZ_COUNT_CTOR(nsDisplayGeneric);
  }
#ifdef NS_BUILD_REFCNT_LOGGING
  virtual ~nsDisplayGeneric() {
    MOZ_COUNT_DTOR(nsDisplayGeneric);
  }
#endif
# 1998 "../../dist/include/nsDisplayList.h"
  
  virtual void Paint(nsDisplayListBuilder* aBuilder,
                     nsRenderingContext* aCtx) MOZ_OVERRIDE {
    mPaint(mFrame, aCtx, mVisibleRect, ToReferenceFrame());
  }
  NS_DISPLAY_DECL_NAME(mName, mType)

protected:
  PaintCallback mPaint;
  const char*   mName;
  Type mType;
};

/**
 * Generic display item that can contain overflow. Use this in lieu of
 * nsDisplayGeneric if you have a frame that should use the visual overflow
 * rect of its frame when drawing items, instead of the frame's bounds.
 */
class nsDisplayGenericOverflow : public nsDisplayGeneric {
  public:
    
  #ifdef NS_BUILD_REFCNT_LOGGING
    virtual ~nsDisplayGenericOverflow() {
      MOZ_COUNT_DTOR(nsDisplayGenericOverflow);
    }
  #endif
# 2029 "../../dist/include/nsDisplayList.h"

    /**
     * Returns the frame's visual overflow rect instead of the frame's bounds.
     */
    virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
                             bool* aSnap) MOZ_OVERRIDE
    {
      *aSnap = false;
      return Frame()->GetVisualOverflowRect() + ToReferenceFrame();
    }
};

#if defined(MOZ_REFLOW_PERF_DSP) && defined(MOZ_REFLOW_PERF)
/**
 * This class implements painting of reflow counts.  Ideally, we would simply
 * make all the frame names be those returned by nsFrame::GetFrameName
 * (except that tosses in the content tag name!)  and support only one color
 * and eliminate this class altogether in favor of nsDisplayGeneric, but for
 * the time being we can't pass args to a PaintCallback, so just have a
 * separate class to do the right thing.  Sadly, this alsmo means we need to
 * hack all leaf frame classes to handle this.
 *
 * XXXbz the color thing is a bit of a mess, but 0 basically means "not set"
 * here...  I could switch it all to nscolor, but why bother?
 */
class nsDisplayReflowCount : public nsDisplayItem {
public:
  
#ifdef NS_BUILD_REFCNT_LOGGING
  virtual ~nsDisplayReflowCount() {
    MOZ_COUNT_DTOR(nsDisplayReflowCount);
  }
#endif
# 2070 "../../dist/include/nsDisplayList.h"

  virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE {
#endif // MOZ_REFLOW_PERF_DSP && MOZ_REFLOW_PERF
# 2119 "../../dist/include/nsDisplayList.h"

class nsDisplayCaret : public nsDisplayItem {
public:
  ;
#ifdef NS_BUILD_REFCNT_LOGGING
  virtual ~nsDisplayCaret();
#endif
# 2126 "../../dist/include/nsDisplayList.h"

  virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE;
  virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE;
  NS_DISPLAY_DECL_NAME("Caret", TYPE_CARET)
protected:
  nsRefPtr<nsCaret> mCaret;
  nsRect mBounds;
};

/**
 * The standard display item to paint the CSS borders of a frame.
 */
class nsDisplayBorder : public nsDisplayItem {
public:
  
#ifdef NS_BUILD_REFCNT_LOGGING
  virtual ~nsDisplayBorder() {
    MOZ_COUNT_DTOR(nsDisplayBorder);
  }
#endif
# 2150 "../../dist/include/nsDisplayList.h"

  virtual bool IsInvisibleInRect(const nsRect& aRect) MOZ_OVERRIDE;
  virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) MOZ_OVERRIDE;
  virtual void Paint(nsDisplayListBuilder* aBuilder, nsRenderingContext* aCtx) MOZ_OVERRIDE;
  NS_DISPLAY_DECL_NAME("Border", TYPE_BORDER)
  
  virtual nsDisplayItemGeometry* AllocateGeometry(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE;

  virtual void ComputeInvalidationRegion(nsDisplayListBuilder* aBuilder,
                                         const nsDisplayItemGeometry* aGeometry,
                                         nsRegion* aInvalidRegion) MOZ_OVERRIDE;

protected:
  ;
};

/**
 * Thus we force the creator to specify what the underlying frame is. The
 * underlying frame should be the root of a stacking context, because sorting
 * a list containing this item will not get at the children.
 * 
 * In some cases (e.g., clipping) we want to wrap a list but we don't have a
 * particular underlying frame that is a stacking context root. In that case
 * we allow the frame to be nullptr. Callers to GetUnderlyingFrame must
 * detect and handle this case.
 */
class nsDisplayWrapList : public nsDisplayItem {
public:
  /**
   * Takes all the items from aList and puts them in our list.
   */
  ;
  ;
  
  
  
  NS_DISPLAY_DECL_NAME("WrapList", TYPE_WRAP_LIST)

  virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) MOZ_OVERRIDE;
                                    
  
  

  virtual int32_t ZIndex() const MOZ_OVERRIDE
  {
    return (mHasZIndexOverride) ? mOverrideZIndex : nsDisplayItem::ZIndex();
  }

  
  

  nsDisplayList mList;
  // The frames from items that have been merged into this item, excluding
  // this item's own frame.
  nsTArray<nsIFrame*> mMergedFrames;
  nsRect mBounds;
  // Visible rect contributed by this display item itself.
  // Our mVisibleRect may include the visible areas of children.
  nsRect mBaseVisibleRect;
  int32_t mOverrideZIndex;
  bool mHasZIndexOverride;
};

/**
 * We call WrapDisplayList on the in-flow lists: BorderBackground(),
/**
 * A display item that has no purpose but to ensure its contents get
 * their own layer.
 */
class nsDisplayOwnLayer : public nsDisplayWrapList {
public:

  /**
   * nsDisplayOwnLayer constructor flags
   */
  enum {
    GENERATE_SUBDOC_INVALIDATIONS = 0x01,
    VERTICAL_SCROLLBAR = 0x02,
    HORIZONTAL_SCROLLBAR = 0x04,
    GENERATE_SCROLLABLE_LAYER = 0x08,
    SCROLLBAR_CONTAINER = 0x10
  };

  /**
   * @param aFlags GENERATE_SUBDOC_INVALIDATIONS :
   * Add UserData to the created ContainerLayer, so that invalidations
   * for this layer are send to our nsPresContext.
   * GENERATE_SCROLLABLE_LAYER : only valid on nsDisplaySubDocument (and
   * subclasses), indicates this layer is to be a scrollable layer, so call
   * ComputeFrameMetrics, etc.
   * @param aScrollTarget when VERTICAL_SCROLLBAR or HORIZONTAL_SCROLLBAR
   * is set in the flags, this parameter should be the ViewID of the
   * scrollable content this scrollbar is for.
   */
  ;
#ifdef NS_BUILD_REFCNT_LOGGING
  virtual ~nsDisplayOwnLayer();
#endif
# 3044 "../../dist/include/nsDisplayList.h"
  
  virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
                                             LayerManager* aManager,
                                             const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE;
  
  
  
  
  NS_DISPLAY_DECL_NAME("OwnLayer", TYPE_OWN_LAYER)
protected:
  uint32_t mFlags;
  ViewID mScrollTarget;
};

/**
 * A display item for subdocuments. This is more or less the same as nsDisplayOwnLayer,
 * except that it always populates the FrameMetrics instance on the ContainerLayer it
 * builds.
 */
class nsDisplaySubDocument : public nsDisplayOwnLayer {
public:
  ;
#ifdef NS_BUILD_REFCNT_LOGGING
  virtual ~nsDisplaySubDocument();
#endif
# 3081 "../../dist/include/nsDisplayList.h"

  virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
                                             LayerManager* aManager,
                                             const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE;
  bool mForceDispatchToContentRegion;
};

/**
 * A display item for subdocuments to capture the resolution from the presShell
 * and ensure that it gets applied to all the right elements. This item creates
 * a container layer.
 */
class nsDisplayResolution : public nsDisplaySubDocument {
public:
  ;
#ifdef NS_BUILD_REFCNT_LOGGING
  virtual ~nsDisplayResolution();
#endif
# 3117 "../../dist/include/nsDisplayList.h"

  virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
                                             LayerManager* aManager,
                                             const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE;
  NS_DISPLAY_DECL_NAME("Resolution", TYPE_RESOLUTION)
};

/**
 * A display item used to represent sticky position elements. The contents
 * gets its own layer and creates a stacking context, and the layer will have
 * position-related metadata set on it.
 */
class nsDisplayStickyPosition : public nsDisplayOwnLayer {
public:
  ;
#ifdef NS_BUILD_REFCNT_LOGGING
  virtual ~nsDisplayStickyPosition();
#endif
# 3136 "../../dist/include/nsDisplayList.h"

  virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
                                             LayerManager* aManager,
                                             const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE;
  NS_DISPLAY_DECL_NAME("StickyPosition", TYPE_STICKY_POSITION)
  
  virtual bool TryMerge(nsDisplayListBuilder* aBuilder, nsDisplayItem* aItem) MOZ_OVERRIDE;
};

/**
 * This potentially creates a layer for the given list of items, whose
 * visibility is determined by the displayport for the given frame instead of
 * normal visibility computation.
 *
 * Here in content, we can use this to render more content than is actually
 * visible. Then, the compositing process can manipulate the generated layer
 * through transformations so that asynchronous scrolling can be implemented.
 *
 * Note that setting the displayport will not change any hit testing! The
 * content process will know nothing about what the user is actually seeing,
 * so it can only do hit testing for what is supposed to be the visible region.
 *
 * It is possible for scroll boxes to have content that can be both above and
 * below content outside of the scroll box. We cannot create layers for these
 * cases. This is accomplished by wrapping display items with
 * nsDisplayScrollLayers. nsDisplayScrollLayers with the same scroll frame will
 * be merged together. If more than one nsDisplayScrollLayer exists after
 */ 
class nsDisplayTransform: public nsDisplayItem
{
  typedef mozilla::gfx::Matrix4x4 Matrix4x4;
  typedef mozilla::gfx::Point3D Point3D;
public:
  /**
   * Returns a matrix (in pixels) for the current frame. The matrix should be relative to
   * the current frame's coordinate space.
   *
   * @param aFrame The frame to compute the transform for.
   * @param aAppUnitsPerPixel The number of app units per graphics unit.
   */
  typedef Matrix4x4 (* ComputeTransformFunction)(nsIFrame* aFrame, float aAppUnitsPerPixel);

  /* Constructor accepts a display list, empties it, and wraps it up.  It also
   * ferries the underlying frame to the nsDisplayItem constructor.
   */
  ;
  

  enum {
    INDEX_MAX = UINT32_MAX >> nsDisplayItem::TYPE_BITS
  };

  ;

  ;

  /**
   * TransformRect takes in as parameters a rectangle (in aFrame's coordinate
   * space) and returns the smallest rectangle (in aFrame's coordinate space)
   * containing the transformed image of that rectangle.  That is, it takes
   * the four corners of the rectangle, transforms them according to the
   * matrix associated with the specified frame, then returns the smallest

  /**
   * This will return if it's possible for this element to be prerendered.
   * This should never return false if we're going to prerender.
   */
  
  /**
   * Check if this element will be prerendered. This must be done after the
   * display list has been fully built.
   */
  ;

  virtual void WriteDebugInfo(std::stringstream& aStream) MOZ_OVERRIDE;

private:
  ;
  ;

  ;

  nsDisplayWrapList mStoredList;
  Matrix4x4 mTransform;
  ComputeTransformFunction mTransformGetter;
  nsRect mChildrenVisibleRect;
  uint32_t mIndex;
  // We wont know if we pre-render until the layer building phase where we can
  // check layers will-change budget.
  bool mMaybePrerender;
};

/**
 * This class adds basic support for limiting the rendering to the part inside
  nscoord mLeftEdge;  // length from the left side
  nscoord mRightEdge; // length from the right side
};

/**
 * A wrapper layer that wraps its children in a container, then renders
 * everything with an appropriate VR effect based on the HMDInfo.
 */

class nsDisplayVR : public nsDisplayOwnLayer {
public:
  ;

  

  virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
                                             LayerManager* aManager,
                                             const ContainerLayerParameters& aContainerParameters) MOZ_OVERRIDE;

protected:
  nsRefPtr<mozilla::gfx::VRHMDInfo> mHMD;
};

#ifndef __gen_nsIFocusManager_h__
#define __gen_nsIFocusManager_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIFocusManager.h"
#endif
# 12 "../../dist/include/nsIFocusManager.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIFocusManager.h"
class nsIDocument; /* forward declaration */

class nsIContent; /* forward declaration */


/* starting interface:    nsIFocusManager */
#define NS_IFOCUSMANAGER_IID_STR "c0716002-5602-4002-a0de-cc69b924b2c6"

#define NS_IFOCUSMANAGER_IID \
  {0xc0716002, 0x5602, 0x4002, \
    { 0xa0, 0xde, 0xcc, 0x69, 0xb9, 0x24, 0xb2, 0xc6 }}

class NS_NO_VTABLE nsIFocusManager : public nsISupports {
 public: 

  /* [noscript] void windowHidden (in nsIDOMWindow aWindow); */
  NS_IMETHOD WindowHidden(nsIDOMWindow *aWindow) = 0;

  /* [noscript] void fireDelayedEvents (in nsIDocument aDocument); */
  NS_IMETHOD FireDelayedEvents(nsIDocument *aDocument) = 0;

  /* [noscript] void focusPlugin (in nsIContent aPlugin); */
  NS_IMETHOD FocusPlugin(nsIContent *aPlugin) = 0;

  /* [noscript] void parentActivated (in nsIDOMWindow aWindow, in bool active); */
  NS_IMETHOD ParentActivated(nsIDOMWindow *aWindow, bool active) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIFocusManager, NS_IFOCUSMANAGER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIFOCUSMANAGER \
  NS_IMETHOD GetActiveWindow(nsIDOMWindow * *aActiveWindow) MOZ_OVERRIDE; \
  NS_IMETHOD SetActiveWindow(nsIDOMWindow *aActiveWindow) MOZ_OVERRIDE; \
  NS_IMETHOD GetFocusedWindow(nsIDOMWindow * *aFocusedWindow) MOZ_OVERRIDE; \
  NS_IMETHOD SetFocusedWindow(nsIDOMWindow *aFocusedWindow) MOZ_OVERRIDE; \
  NS_IMETHOD GetFocusedElement(nsIDOMElement * *aFocusedElement) MOZ_OVERRIDE; \
  NS_IMETHOD GetLastFocusMethod(nsIDOMWindow *window, uint32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD SetFocus(nsIDOMElement *aElement, uint32_t aFlags) MOZ_OVERRIDE; \
  NS_IMETHOD MoveCaretToFocus(nsIDOMWindow *aWindow) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->MoveCaretToFocus(aWindow); } \
  NS_IMETHOD ElementIsFocusable(nsIDOMElement *aElement, uint32_t aFlags, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ElementIsFocusable(aElement, aFlags, _retval); } \
  NS_IMETHOD WindowRaised(nsIDOMWindow *aWindow) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->WindowRaised(aWindow); } \
  NS_IMETHOD WindowLowered(nsIDOMWindow *aWindow) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->WindowLowered(aWindow); } \
  NS_IMETHOD WindowShown(nsIDOMWindow *aWindow, bool aNeedsFocus) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->WindowShown(aWindow, aNeedsFocus); } \
  NS_IMETHOD WindowHidden(nsIDOMWindow *aWindow) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->WindowHidden(aWindow); } \
  NS_IMETHOD FireDelayedEvents(nsIDocument *aDocument) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->FireDelayedEvents(aDocument); } \
  NS_IMETHOD FocusPlugin(nsIContent *aPlugin) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->FocusPlugin(aPlugin); } \
  NS_IMETHOD ParentActivated(nsIDOMWindow *aWindow, bool active) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ParentActivated(aWindow, active); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsFocusManager : public nsIFocusManager
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIFOCUSMANAGER

    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void parentActivated (in nsIDOMWindow aWindow, in bool active); */
NS_IMETHODIMP nsFocusManager::ParentActivated(nsIDOMWindow *aWindow, bool active)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 320 "../../dist/include/nsIFocusManager.h"


#endif /* __gen_nsIFocusManager_h__ */
# 323 "../../dist/include/nsIFocusManager.h"
# 12 "/Users/luser/build/mozilla-central/dom/base/nsFocusManager.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIObserver.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/base/nsFocusManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIWidget.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/base/nsFocusManager.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWeakReference.h"
#endif /* expanded by -frewrite-includes */
struct nsDelayedBlurOrFocusEvent;

/**
 * The focus manager keeps track of where the focus is, that is, the node
 * which receives key events.
 */

class nsFocusManager MOZ_FINAL : public nsIFocusManager,
                                 public nsIObserver,
                                 public nsSupportsWeakReference
{
  typedef mozilla::widget::InputContextAction InputContextAction;

public:

  NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsFocusManager, nsIFocusManager)
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  ;
  // A document which is handling a mouse button event.
  // When a mouse down event process is finished, ESM sets focus to the target
  // content if it's not consumed.  Therefore, while DOM event handlers are
  // handling mouse down events or preceding mosue down event is consumed but
  // handling mouse up events, they should be able to steal focus from any
  // elements even if focus is in chrome content.  So, if this isn't nullptr
  // and the caller can access the document node, the caller should succeed in
  // moving focus.
  nsCOMPtr<nsIDocument> mMouseButtonEventHandlingDocument;

  static bool sTestMode;

  // the single focus manager
  static nsFocusManager* sInstance;
};

;

#endif
# 551 "/Users/luser/build/mozilla-central/dom/base/nsFocusManager.h"
# 44 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2

#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 46 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"

#if 0 /* expanded by -frewrite-includes */
#include "ImageEncoder.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/ImageEncoder.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef ImageEncoder_h
#define ImageEncoder_h

#if 0 /* expanded by -frewrite-includes */
#include "imgIEncoder.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/ImageEncoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/ImageEncoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/File.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/base/ImageEncoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLCanvasElementBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/HTMLCanvasElementBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_HTMLCanvasElementBinding_h
#define mozilla_dom_HTMLCanvasElementBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/HTMLCanvasElementBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CallbackFunction.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/HTMLCanvasElementBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/HTMLCanvasElementBinding.h"

namespace mozilla {
namespace dom {

class File;


class FileCallback : public CallbackFunction
{
public:
  

  

  

  

  

private:
  ;
};


namespace HTMLCanvasElementBinding {

  typedef mozilla::dom::HTMLCanvasElement NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  // hooks.  And then structures which embedded a pointer to this structure
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  // would require a run-time load for proper initialization, which would
  // then induce static constructors.  Lots of static constructors.
  ;

  ;

} // namespace MozCanvasPrintStateBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_HTMLCanvasElementBinding_h
# 242 "../../dist/include/mozilla/dom/HTMLCanvasElementBinding.h"
# 13 "/Users/luser/build/mozilla-central/dom/base/ImageEncoder.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsLayoutUtils.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/base/ImageEncoder.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsNetUtil.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsNetUtil.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set ts=4 sw=4 sts=4 et cin: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsNetUtil_h__
#define nsNetUtil_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsNetUtil.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsNetCID.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsNetCID.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsNetCID_h__
#define nsNetCID_h__


/******************************************************************************
 * netwerk/base/ classes
 */

// service implementing nsIIOService and nsIIOService2.
#define NS_IOSERVICE_CONTRACTID \
    "@mozilla.org/network/io-service;1"
#define NS_IOSERVICE_CID                             \
    0x11d3,                                          \
    {0x8c, 0xda, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
}

#define NS_RESURL_CID                    \
{ /* ff8fe7ec-2f74-4408-b742-6b7a546029a8 */         \
    0xff8fe7ec,                                      \
    0x2f74,                                          \

/******************************************************************************
 * netwerk/protocol/app/ classes
 */

#define NS_APPPROTOCOLHANDLER_CID                    \
{ /* {B6ED3030-9999-11d3-A178-0050041CAF44} */       \
    0xb6ed3030,                                      \
    0x9999,                                          \
    0x11d3,                                          \
    {0xa1, 0x78, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44} \
}

/******************************************************************************

/**
 * Services in this category can sniff content that is not necessarily loaded
 * from the network, and they won't be told about each load.
 */
#define NS_DATA_SNIFFER_CATEGORY "content-sniffing-services"

/**
 * Must implement nsINSSErrorsService.
 */
#define NS_NSS_ERRORS_SERVICE_CONTRACTID "@mozilla.org/nss_errors_service;1"

#endif // nsNetCID_h__
# 1037 "../../dist/include/nsNetCID.h"
# 12 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsNetUtil.h"

#if 0 /* expanded by -frewrite-includes */
#include "plstr.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsNetUtil.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIURI.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsNetUtil.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIStandardURL.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIStandardURL.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIStandardURL.idl
 */

#ifndef __gen_nsIStandardURL_h__
#define __gen_nsIStandardURL_h__


#ifndef __gen_nsIMutable_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIMutable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIStandardURL.h"
#endif
# 12 "../../dist/include/nsIStandardURL.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
}

/* End of implementation class template. */
#endif
# 97 "../../dist/include/nsIStandardURL.h"


#endif /* __gen_nsIStandardURL_h__ */
# 100 "../../dist/include/nsIStandardURL.h"
# 21 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIURLParser.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIURLParser.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIURLParser.idl
 */

#ifndef __gen_nsIURLParser_h__
#define __gen_nsIURLParser_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIURLParser.h"
#endif
# 12 "../../dist/include/nsIURLParser.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIURLParser.h"

/* starting interface:    nsIURLParser */
#define NS_IURLPARSER_IID_STR "78c5d19f-f5d2-4732-8d3d-d5a7d7133bc0"

#define NS_IURLPARSER_IID \
  {0x78c5d19f, 0xf5d2, 0x4732, \
    { 0x8d, 0x3d, 0xd5, 0xa7, 0xd7, 0x13, 0x3b, 0xc0 }}

class NS_NO_VTABLE nsIURLParser : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IURLPARSER_IID)

  NS_IMETHOD ParseFilePath(const char * filepath, int32_t filepathLen, uint32_t *directoryPos, int32_t *directoryLen, uint32_t *basenamePos, int32_t *basenameLen, uint32_t *extensionPos, int32_t *extensionLen) = 0;

  /* void parseFileName (in string filename, in long filenameLen, out unsigned long basenamePos, out long basenameLen, out unsigned long extensionPos, out long extensionLen); */
  NS_IMETHOD ParseFileName(const char * filename, int32_t filenameLen, uint32_t *basenamePos, int32_t *basenameLen, uint32_t *extensionPos, int32_t *extensionLen) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIURLParser, NS_IURLPARSER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIURLPARSER \
  NS_IMETHOD ParseURL(const char * spec, int32_t specLen, uint32_t *schemePos, int32_t *schemeLen, uint32_t *authorityPos, int32_t *authorityLen, uint32_t *pathPos, int32_t *pathLen) MOZ_OVERRIDE; \
  NS_IMETHOD ParseAuthority(const char * authority, int32_t authorityLen, uint32_t *usernamePos, int32_t *usernameLen, uint32_t *passwordPos, int32_t *passwordLen, uint32_t *hostnamePos, int32_t *hostnameLen, int32_t *port) MOZ_OVERRIDE; \
  NS_IMETHOD ParseUserInfo(const char * userinfo, int32_t userinfoLen, uint32_t *usernamePos, int32_t *usernameLen, uint32_t *passwordPos, int32_t *passwordLen) MOZ_OVERRIDE; \
  NS_IMETHOD ParseServerInfo(const char * serverinfo, int32_t serverinfoLen, uint32_t *hostnamePos, int32_t *hostnameLen, int32_t *port) MOZ_OVERRIDE; \
  NS_IMETHOD ParsePath(const char * path, int32_t pathLen, uint32_t *filepathPos, int32_t *filepathLen, uint32_t *queryPos, int32_t *queryLen, uint32_t *refPos, int32_t *refLen) MOZ_OVERRIDE; \
  NS_IMETHOD ParseAuthority(const char * authority, int32_t authorityLen, uint32_t *usernamePos, int32_t *usernameLen, uint32_t *passwordPos, int32_t *passwordLen, uint32_t *hostnamePos, int32_t *hostnameLen, int32_t *port) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseAuthority(authority, authorityLen, usernamePos, usernameLen, passwordPos, passwordLen, hostnamePos, hostnameLen, port); } \
  NS_IMETHOD ParseUserInfo(const char * userinfo, int32_t userinfoLen, uint32_t *usernamePos, int32_t *usernameLen, uint32_t *passwordPos, int32_t *passwordLen) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseUserInfo(userinfo, userinfoLen, usernamePos, usernameLen, passwordPos, passwordLen); } \
  NS_IMETHOD ParseServerInfo(const char * serverinfo, int32_t serverinfoLen, uint32_t *hostnamePos, int32_t *hostnameLen, int32_t *port) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseServerInfo(serverinfo, serverinfoLen, hostnamePos, hostnameLen, port); } \
  NS_IMETHOD ParsePath(const char * path, int32_t pathLen, uint32_t *filepathPos, int32_t *filepathLen, uint32_t *queryPos, int32_t *queryLen, uint32_t *refPos, int32_t *refLen) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ParsePath(path, pathLen, filepathPos, filepathLen, queryPos, queryLen, refPos, refLen); } \
  NS_IMETHOD ParseFilePath(const char * filepath, int32_t filepathLen, uint32_t *directoryPos, int32_t *directoryLen, uint32_t *basenamePos, int32_t *basenameLen, uint32_t *extensionPos, int32_t *extensionLen) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseFilePath(filepath, filepathLen, directoryPos, directoryLen, basenamePos, basenameLen, extensionPos, extensionLen); } \
  NS_IMETHOD ParseFileName(const char * filename, int32_t filenameLen, uint32_t *basenamePos, int32_t *basenameLen, uint32_t *extensionPos, int32_t *extensionLen) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ParseFileName(filename, filenameLen, basenamePos, basenameLen, extensionPos, extensionLen); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsURLParser : public nsIURLParser
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIURLPARSER

  nsURLParser();

/* End of implementation class template. */
#endif
# 161 "../../dist/include/nsIURLParser.h"

// url parser key for use with the category manager
// mapping from scheme to url parser.
#define NS_IURLPARSER_KEY "@mozilla.org/urlparser;1"

#endif /* __gen_nsIURLParser_h__ */
# 167 "../../dist/include/nsIURLParser.h"
# 22 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIUUIDGenerator.h"
  NS_IMETHOD GenerateUUID(nsID **_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GenerateUUIDInPlace(nsID *id) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIUUIDGENERATOR(_to) \
  NS_IMETHOD GenerateUUID(nsID **_retval) MOZ_OVERRIDE { return _to GenerateUUID(_retval); } \
  NS_IMETHOD GenerateUUIDInPlace(nsID *id) MOZ_OVERRIDE { return _to GenerateUUIDInPlace(id); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIUUIDGENERATOR(_to) \
  NS_IMETHOD GenerateUUID(nsID **_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GenerateUUID(_retval); } \
  NS_IMETHOD GenerateUUIDInPlace(nsID *id) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GenerateUUIDInPlace(id); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

    return NS_ERROR_NOT_IMPLEMENTED;
}

/* [noscript] void generateUUIDInPlace (in nsNonConstIDPtr id); */
NS_IMETHODIMP nsUUIDGenerator::GenerateUUIDInPlace(nsID *id)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 101 "../../dist/include/nsIUUIDGenerator.h"


#endif /* __gen_nsIUUIDGenerator_h__ */
# 104 "../../dist/include/nsIUUIDGenerator.h"
# 23 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIInputStream.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/nsNetUtil.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIOutputStream.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIOutputStream.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIOutputStream.idl
 */

#ifndef __gen_nsIOutputStream_h__
#define __gen_nsIOutputStream_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIOutputStream.h"
#endif
# 12 "../../dist/include/nsIOutputStream.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIOutputStream.h"
class nsIOutputStream; /* forward declaration */

class nsIInputStream; /* forward declaration */

/**
 * The signature for the reader function passed to WriteSegments. This 
 * is the "provider" of data that gets written into the stream's buffer.
 *
 * @param aOutStream stream being written to
 * @param aClosure opaque parameter passed to WriteSegments
 * @param aToSegment pointer to memory owned by the output stream
 * @param aFromOffset amount already written (since WriteSegments was called)
 * @param aCount length of toSegment
 * @param aReadCount number of bytes written
 *
 * Implementers should return the following:
 *
 * @throws <any-error> if not interested in providing any data
 *
 * Errors are never passed to the caller of WriteSegments.
 */
typedef NS_CALLBACK(nsReadSegmentFun)(nsIOutputStream *aOutStream,
                                      void *aClosure,
                                      char *aToSegment,
                                      uint32_t aFromOffset,
                                      uint32_t aCount,
                                      uint32_t *aReadCount);

/* starting interface:    nsIOutputStream */
#define NS_IOUTPUTSTREAM_IID_STR "0d0acd2a-61b4-11d4-9877-00c04fa0cf4a"

#define NS_IOUTPUTSTREAM_IID \
  {0x0d0acd2a, 0x61b4, 0x11d4, \
    { 0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a }}

class NS_NO_VTABLE nsIOutputStream : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOUTPUTSTREAM_IID)

  /* void close (); */
  NS_IMETHOD Close(void) = 0;

  /* void flush (); */
  NS_IMETHOD Flush(void) = 0;

  /* unsigned long write (in string aBuf, in unsigned long aCount); */
  NS_IMETHOD Write(const char * aBuf, uint32_t aCount, uint32_t *_retval) = 0;

  /* unsigned long writeFrom (in nsIInputStream aFromStream, in unsigned long aCount); */
  NS_IMETHOD WriteFrom(nsIInputStream *aFromStream, uint32_t aCount, uint32_t *_retval) = 0;

  /* [noscript] unsigned long writeSegments (in nsReadSegmentFun aReader, in voidPtr aClosure, in unsigned long aCount); */
  NS_IMETHOD WriteSegments(nsReadSegmentFun aReader, void *aClosure, uint32_t aCount, uint32_t *_retval) = 0;

  /* boolean isNonBlocking (); */
  NS_IMETHOD IsNonBlocking(bool *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIOutputStream, NS_IOUTPUTSTREAM_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIOUTPUTSTREAM \
  NS_IMETHOD Close(void) MOZ_OVERRIDE; \
  NS_IMETHOD Flush(void) MOZ_OVERRIDE; \
  NS_IMETHOD Init(nsIOutputStream *aSink, nsIRequestObserver *aObserver) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aSink, aObserver); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsSimpleStreamListener : public nsISimpleStreamListener
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISIMPLESTREAMLISTENER

  nsSimpleStreamListener();

private:
  ~nsSimpleStreamListener();
}

/* void init (in nsIOutputStream aSink, in nsIRequestObserver aObserver); */
NS_IMETHODIMP nsSimpleStreamListener::Init(nsIOutputStream *aSink, nsIRequestObserver *aObserver)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 91 "../../dist/include/nsISimpleStreamListener.h"


#endif /* __gen_nsISimpleStreamListener_h__ */
# 94 "../../dist/include/nsISimpleStreamListener.h"
# 29 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsILoadGroup.h"
#endif /* expanded by -frewrite-includes */
# 30 "../../dist/include/nsNetUtil.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIInterfaceRequestor.h"
#endif /* expanded by -frewrite-includes */
# 31 "../../dist/include/nsNetUtil.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIInterfaceRequestorUtils.h"
#endif /* expanded by -frewrite-includes */
# 32 "../../dist/include/nsNetUtil.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIIOService.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIIOService.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIIOService.idl
 */

#ifndef __gen_nsIIOService_h__
#define __gen_nsIIOService_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIIOService.h"
#endif
# 12 "../../dist/include/nsIIOService.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIIOService.h"
class nsIProtocolHandler; /* forward declaration */

class nsIChannel; /* forward declaration */

class nsIURI; /* forward declaration */

class nsIFile; /* forward declaration */

class nsIDOMNode; /* forward declaration */

class nsIPrincipal; /* forward declaration */

class nsILoadInfo; /* forward declaration */


/* starting interface:    nsIIOService */
#define NS_IIOSERVICE_IID_STR "b1c3c61d-2df9-4240-ae16-0355b51a2770"

#define NS_IIOSERVICE_IID \
  {0xb1c3c61d, 0x2df9, 0x4240, \
    { 0xae, 0x16, 0x03, 0x55, 0xb5, 0x1a, 0x27, 0x70 }}

class NS_NO_VTABLE nsIIOService : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIOSERVICE_IID)

  /* nsIProtocolHandler getProtocolHandler (in string aScheme); */
  NS_IMETHOD GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval) = 0;

  /* unsigned long getProtocolFlags (in string aScheme); */
  NS_IMETHOD GetProtocolFlags(const char * aScheme, uint32_t *_retval) = 0;

  /* nsIURI newURI (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
  NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) = 0;

  /* nsIURI newFileURI (in nsIFile aFile); */
  NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI * *_retval) = 0;

  /* nsIChannel newChannelFromURI2 (in nsIURI aURI, in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType); */
  NS_IMETHOD NewChannelFromURI2(nsIURI *aURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) = 0;

  /* nsIChannel newChannelFromURIWithLoadInfo (in nsIURI aURI, in nsILoadInfo aLoadInfo); */
  NS_IMETHOD SetAppOffline(uint32_t appId, int32_t state) = 0;

  /* boolean isAppOffline (in uint32_t appId); */
  NS_IMETHOD IsAppOffline(uint32_t appId, bool *_retval) = 0;

  /* long getAppOfflineState (in uint32_t appId); */
  NS_IMETHOD GetAppOfflineState(uint32_t appId, int32_t *_retval) = 0;

  /* boolean allowPort (in long aPort, in string aScheme); */
  NS_IMETHOD AllowPort(int32_t aPort, const char * aScheme, bool *_retval) = 0;

  /* ACString extractScheme (in AUTF8String urlString); */
  NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIIOService, NS_IIOSERVICE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIIOSERVICE \
  NS_IMETHOD GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetProtocolFlags(const char * aScheme, uint32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD NewChannelFromURI2(nsIURI *aURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD NewChannelFromURIWithLoadInfo(nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIChannel * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD NewChannel2(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetOffline(bool *aOffline) MOZ_OVERRIDE; \
  NS_IMETHOD SetOffline(bool aOffline) MOZ_OVERRIDE; \
  NS_IMETHOD SetAppOffline(uint32_t appId, int32_t state) MOZ_OVERRIDE; \
  NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannelFromURI(aURI, _retval); } \
  NS_IMETHOD NewChannel2(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannel2(aSpec, aOriginCharset, aBaseURI, aLoadingNode, aLoadingPrincipal, aTriggeringPrincipal, aSecurityFlags, aContentPolicyType, _retval); } \
  NS_IMETHOD NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannel(aSpec, aOriginCharset, aBaseURI, _retval); } \
  NS_IMETHOD GetOffline(bool *aOffline) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOffline(aOffline); } \
  NS_IMETHOD SetOffline(bool aOffline) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOffline(aOffline); } \
  NS_IMETHOD SetAppOffline(uint32_t appId, int32_t state) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAppOffline(appId, state); } \
  NS_IMETHOD IsAppOffline(uint32_t appId, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsAppOffline(appId, _retval); } \
  NS_IMETHOD GetAppOfflineState(uint32_t appId, int32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAppOfflineState(appId, _retval); } \
  NS_IMETHOD AllowPort(int32_t aPort, const char * aScheme, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AllowPort(aPort, aScheme, _retval); } \
  NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ExtractScheme(urlString, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsIOService : public nsIIOService

nsIOService::nsIOService()
/* readonly attribute unsigned long appId; */
NS_IMETHODIMP nsAppOfflineInfo::GetAppId(uint32_t *aAppId)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute long mode; */
NS_IMETHODIMP nsAppOfflineInfo::GetMode(int32_t *aMode)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

class nsIURI; /* forward declaration */


/* starting interface:    nsIInputStreamChannel */
#define NS_IINPUTSTREAMCHANNEL_IID_STR "e1e95852-914b-4d83-b574-23f114db9b89"

#define NS_IINPUTSTREAMCHANNEL_IID \
  {0xe1e95852, 0x914b, 0x4d83, \
    { 0xb5, 0x74, 0x23, 0xf1, 0x14, 0xdb, 0x9b, 0x89 }}

class NS_NO_VTABLE nsIInputStreamChannel : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IINPUTSTREAMCHANNEL_IID)

  /* void setURI (in nsIURI aURI); */
  NS_IMETHOD SetURI(nsIURI *aURI) = 0;

  /* attribute nsIInputStream contentStream; */
  NS_IMETHOD GetContentStream(nsIInputStream * *aContentStream) = 0;
  NS_IMETHOD SetContentStream(nsIInputStream *aContentStream) = 0;

  /* attribute AString srcdocData; */
  NS_IMETHOD GetSrcdocData(nsAString & aSrcdocData) = 0;
  NS_IMETHOD SetSrcdocData(const nsAString & aSrcdocData) = 0;

  /* readonly attribute boolean isSrcdocChannel; */
  NS_IMETHOD GetIsSrcdocChannel(bool *aIsSrcdocChannel) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIInputStreamChannel, NS_IINPUTSTREAMCHANNEL_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIINPUTSTREAMCHANNEL \
  NS_IMETHOD SetURI(nsIURI *aURI) MOZ_OVERRIDE; \
  NS_IMETHOD GetContentStream(nsIInputStream * *aContentStream) MOZ_OVERRIDE; \
  NS_IMETHOD SetContentStream(nsIInputStream *aContentStream) MOZ_OVERRIDE; \
class nsIOutputStream; /* forward declaration */

class nsITransportEventSink; /* forward declaration */

class nsIEventTarget; /* forward declaration */


/* starting interface:    nsITransport */
#define NS_ITRANSPORT_IID_STR "2a8c6334-a5e6-4ec3-9865-1256541446fb"

#define NS_ITRANSPORT_IID \
  {0x2a8c6334, 0xa5e6, 0x4ec3, \
    { 0x98, 0x65, 0x12, 0x56, 0x54, 0x14, 0x46, 0xfb }}

class NS_NO_VTABLE nsITransport : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITRANSPORT_IID)

  enum {
    OPEN_BLOCKING = 1U,
    OPEN_UNBUFFERED = 2U
  };

  /* nsIInputStream openInputStream (in unsigned long aFlags, in unsigned long aSegmentSize, in unsigned long aSegmentCount); */
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsITransport, NS_ITRANSPORT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITRANSPORT \
  NS_IMETHOD OpenInputStream(uint32_t aFlags, uint32_t aSegmentSize, uint32_t aSegmentCount, nsIInputStream * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD OpenOutputStream(uint32_t aFlags, uint32_t aSegmentSize, uint32_t aSegmentCount, nsIOutputStream * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD Close(nsresult aReason) MOZ_OVERRIDE; \
  NS_IMETHOD SetEventSink(nsITransportEventSink *aSink, nsIEventTarget *aEventTarget) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSITRANSPORT(_to) \
  NS_IMETHOD OpenInputStream(uint32_t aFlags, uint32_t aSegmentSize, uint32_t aSegmentCount, nsIInputStream * *_retval) MOZ_OVERRIDE { return _to OpenInputStream(aFlags, aSegmentSize, aSegmentCount, _retval); } \
  NS_IMETHOD OpenOutputStream(uint32_t aFlags, uint32_t aSegmentSize, uint32_t aSegmentCount, nsIOutputStream * *_retval) MOZ_OVERRIDE { return _to OpenOutputStream(aFlags, aSegmentSize, aSegmentCount, _retval); } \
  NS_IMETHOD Close(nsresult aReason) MOZ_OVERRIDE { return _to Close(aReason); } \
  NS_IMETHOD SetEventSink(nsITransportEventSink *aSink, nsIEventTarget *aEventTarget) MOZ_OVERRIDE { return _to SetEventSink(aSink, aEventTarget); } \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSITRANSPORT(_to) \
  NS_IMETHOD OpenInputStream(uint32_t aFlags, uint32_t aSegmentSize, uint32_t aSegmentCount, nsIInputStream * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenInputStream(aFlags, aSegmentSize, aSegmentCount, _retval); } \
  NS_IMETHOD OpenOutputStream(uint32_t aFlags, uint32_t aSegmentSize, uint32_t aSegmentCount, nsIOutputStream * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenOutputStream(aFlags, aSegmentSize, aSegmentCount, _retval); } \
  NS_IMETHOD Close(nsresult aReason) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(aReason); } \
  NS_IMETHOD SetEventSink(nsITransportEventSink *aSink, nsIEventTarget *aEventTarget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetEventSink(aSink, aEventTarget); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
    return NS_ERROR_NOT_IMPLEMENTED;
}

}

/* End of implementation class template. */
#endif
# 143 "../../dist/include/nsITransport.h"


/* starting interface:    nsITransportEventSink */
#define NS_ITRANSPORTEVENTSINK_IID_STR "eda4f520-67f7-484b-a691-8c3226a5b0a6"

#define NS_ITRANSPORTEVENTSINK_IID \
  {0xeda4f520, 0x67f7, 0x484b, \
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIStreamTransportService.h"
class nsITransport; /* forward declaration */

class nsIInputStream; /* forward declaration */

class nsIOutputStream; /* forward declaration */


/* starting interface:    nsIStreamTransportService */
#define NS_ISTREAMTRANSPORTSERVICE_IID_STR "5e0adf7d-9785-45c3-a193-04f25a75da8f"

#define NS_ISTREAMTRANSPORTSERVICE_IID \
  {0x5e0adf7d, 0x9785, 0x45c3, \
    { 0xa1, 0x93, 0x04, 0xf2, 0x5a, 0x75, 0xda, 0x8f }}

class NS_NO_VTABLE nsIStreamTransportService : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTREAMTRANSPORTSERVICE_IID)

  /* nsITransport createInputTransport (in nsIInputStream aStream, in long long aStartOffset, in long long aReadLimit, in boolean aCloseWhenDone); */
  NS_IMETHOD CreateInputTransport(nsIInputStream *aStream, int64_t aStartOffset, int64_t aReadLimit, bool aCloseWhenDone, nsITransport * *_retval) = 0;

  /* nsITransport createOutputTransport (in nsIOutputStream aStream, in long long aStartOffset, in long long aWriteLimit, in boolean aCloseWhenDone); */
  NS_IMETHOD CreateOutputTransport(nsIOutputStream *aStream, int64_t aStartOffset, int64_t aWriteLimit, bool aCloseWhenDone, nsITransport * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIStreamTransportService, NS_ISTREAMTRANSPORTSERVICE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISTREAMTRANSPORTSERVICE \
  NS_IMETHOD CreateInputTransport(nsIInputStream *aStream, int64_t aStartOffset, int64_t aReadLimit, bool aCloseWhenDone, nsITransport * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD CreateOutputTransport(nsIOutputStream *aStream, int64_t aStartOffset, int64_t aWriteLimit, bool aCloseWhenDone, nsITransport * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISTREAMTRANSPORTSERVICE(_to) \
  NS_IMETHOD CreateInputTransport(nsIInputStream *aStream, int64_t aStartOffset, int64_t aReadLimit, bool aCloseWhenDone, nsITransport * *_retval) MOZ_OVERRIDE { return _to CreateInputTransport(aStream, aStartOffset, aReadLimit, aCloseWhenDone, _retval); } \
  NS_IMETHOD CreateOutputTransport(nsIOutputStream *aStream, int64_t aStartOffset, int64_t aWriteLimit, bool aCloseWhenDone, nsITransport * *_retval) MOZ_OVERRIDE { return _to CreateOutputTransport(aStream, aStartOffset, aWriteLimit, aCloseWhenDone, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISTREAMTRANSPORTSERVICE(_to) \
  NS_IMETHOD CreateInputTransport(nsIInputStream *aStream, int64_t aStartOffset, int64_t aReadLimit, bool aCloseWhenDone, nsITransport * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateInputTransport(aStream, aStartOffset, aReadLimit, aCloseWhenDone, _retval); } \
  NS_IMETHOD CreateOutputTransport(nsIOutputStream *aStream, int64_t aStartOffset, int64_t aWriteLimit, bool aCloseWhenDone, nsITransport * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateOutputTransport(aStream, aStartOffset, aWriteLimit, aCloseWhenDone, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsStreamTransportService : public nsIStreamTransportService
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISTREAMTRANSPORTSERVICE

  nsStreamTransportService();

private:
/* End of implementation class template. */
#endif
# 107 "../../dist/include/nsIStreamTransportService.h"


#endif /* __gen_nsIStreamTransportService_h__ */
# 110 "../../dist/include/nsIStreamTransportService.h"
# 38 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIHttpChannel.h"
#endif /* expanded by -frewrite-includes */
# 39 "../../dist/include/nsNetUtil.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDownloader.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDownloader.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDownloader.idl
 */

#ifndef __gen_nsIDownloader_h__
#define __gen_nsIDownloader_h__

class nsIDownloadObserver; /* forward declaration */


/* starting interface:    nsIDownloader */
#define NS_IDOWNLOADER_IID_STR "fafe41a9-a531-4d6d-89bc-588a6522fb4e"

#define NS_IDOWNLOADER_IID \
  {0xfafe41a9, 0xa531, 0x4d6d, \
    { 0x89, 0xbc, 0x58, 0x8a, 0x65, 0x22, 0xfb, 0x4e }}

class NS_NO_VTABLE nsIDownloader : public nsIStreamListener {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOWNLOADER_IID)

  /* void init (in nsIDownloadObserver observer, in nsIFile downloadLocation); */
  NS_IMETHOD Init(nsIDownloadObserver *observer, nsIFile *downloadLocation) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDownloader, NS_IDOWNLOADER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOWNLOADER \
  NS_IMETHOD Init(nsIDownloadObserver *observer, nsIFile *downloadLocation) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOWNLOADER(_to) \
  NS_IMETHOD Init(nsIDownloadObserver *observer, nsIFile *downloadLocation) MOZ_OVERRIDE { return _to Init(observer, downloadLocation); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOWNLOADER(_to) \
  NS_IMETHOD Init(nsIDownloadObserver *observer, nsIFile *downloadLocation) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(observer, downloadLocation); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDownloader : public nsIDownloader
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOWNLOADER

  nsDownloader();

private:
  /* destructor code */
}

/* void init (in nsIDownloadObserver observer, in nsIFile downloadLocation); */
NS_IMETHODIMP nsDownloader::Init(nsIDownloadObserver *observer, nsIFile *downloadLocation)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 93 "../../dist/include/nsIDownloader.h"


/* starting interface:    nsIDownloadObserver */
#define NS_IDOWNLOADOBSERVER_IID_STR "44b3153e-a54e-4077-a527-b0325e40924e"
# 12 "../../dist/include/nsIStreamLoader.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIStreamLoader.h"
class nsIRequest; /* forward declaration */

class nsIStreamLoader; /* forward declaration */


/* starting interface:    nsIStreamLoaderObserver */
#define NS_ISTREAMLOADEROBSERVER_IID_STR "359f7990-d4e9-11d3-a1a5-0050041caf44"

#define NS_ISTREAMLOADEROBSERVER_IID \
  {0x359f7990, 0xd4e9, 0x11d3, \
    { 0xa1, 0xa5, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44 }}

class NS_NO_VTABLE nsIStreamLoaderObserver : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTREAMLOADEROBSERVER_IID)

  /* void onStreamComplete (in nsIStreamLoader loader, in nsISupports ctxt, in nsresult status, in unsigned long resultLength, [array, size_is (resultLength), const] in octet result); */
  NS_IMETHOD OnStreamComplete(nsIStreamLoader *loader, nsISupports *ctxt, nsresult status, uint32_t resultLength, const uint8_t *result) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIStreamLoaderObserver, NS_ISTREAMLOADEROBSERVER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISTREAMLOADEROBSERVER \
  NS_IMETHOD OnStreamComplete(nsIStreamLoader *loader, nsISupports *ctxt, nsresult status, uint32_t resultLength, const uint8_t *result) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISTREAMLOADEROBSERVER(_to) \
  NS_IMETHOD OnStreamComplete(nsIStreamLoader *loader, nsISupports *ctxt, nsresult status, uint32_t resultLength, const uint8_t *result) MOZ_OVERRIDE { return _to OnStreamComplete(loader, ctxt, status, resultLength, result); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISTREAMLOADEROBSERVER(_to) \
  NS_IMETHOD OnStreamComplete(nsIStreamLoader *loader, nsISupports *ctxt, nsresult status, uint32_t resultLength, const uint8_t *result) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStreamComplete(loader, ctxt, status, resultLength, result); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsStreamLoaderObserver : public nsIStreamLoaderObserver

/* End of implementation class template. */
#endif
# 93 "../../dist/include/nsIStreamLoader.h"


/* starting interface:    nsIStreamLoader */
#define NS_ISTREAMLOADER_IID_STR "8ea7e890-8211-11d9-8bde-f66bad1e3f3a"

#define NS_ISTREAMLOADER_IID \
  {0x8ea7e890, 0x8211, 0x11d9, \
    { 0x8b, 0xde, 0xf6, 0x6b, 0xad, 0x1e, 0x3f, 0x3a }}

class NS_NO_VTABLE nsIStreamLoader : public nsIStreamListener {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTREAMLOADER_IID)

  /* void init (in nsIStreamLoaderObserver aObserver); */
  NS_IMETHOD Init(nsIStreamLoaderObserver *aObserver) = 0;

  /* readonly attribute unsigned long numBytesRead; */
  NS_IMETHOD GetNumBytesRead(uint32_t *aNumBytesRead) = 0;

  /* readonly attribute nsIRequest request; */
  NS_IMETHOD GetRequest(nsIRequest * *aRequest) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIStreamLoader, NS_ISTREAMLOADER_IID)

/* Use this macro when declaring classes that implement this interface. */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsStreamLoader : public nsIStreamLoader
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISTREAMLOADER

  nsStreamLoader();

private:
  ~nsStreamLoader();

    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 190 "../../dist/include/nsIStreamLoader.h"


#endif /* __gen_nsIStreamLoader_h__ */
# 193 "../../dist/include/nsIStreamLoader.h"
# 41 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIUnicharStreamLoader.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIUnicharStreamLoader.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIUnicharStreamLoader.idl
 */

#ifndef __gen_nsIUnicharStreamLoader_h__
#define __gen_nsIUnicharStreamLoader_h__


#ifndef __gen_nsIStreamListener_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIStreamListener.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIUnicharStreamLoader.h"
#endif
# 12 "../../dist/include/nsIUnicharStreamLoader.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIUnicharStreamLoader.h"
class nsIUnicharInputStream; /* forward declaration */

class nsIUnicharStreamLoader; /* forward declaration */

class nsIChannel; /* forward declaration */


/* starting interface:    nsIUnicharStreamLoaderObserver */
#define NS_IUNICHARSTREAMLOADEROBSERVER_IID_STR "c2982b39-2e48-429e-92b7-99348a1633c5"

#define NS_IUNICHARSTREAMLOADEROBSERVER_IID \
  {0xc2982b39, 0x2e48, 0x429e, \

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER \
  NS_IMETHOD OnDetermineCharset(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, const nsACString & aSegment, nsACString & _retval) MOZ_OVERRIDE; \
  NS_IMETHOD OnStreamComplete(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, nsresult aStatus, const nsAString & aBuffer) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIUNICHARSTREAMLOADEROBSERVER(_to) \
  NS_IMETHOD OnDetermineCharset(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, const nsACString & aSegment, nsACString & _retval) MOZ_OVERRIDE { return _to OnDetermineCharset(aLoader, aContext, aSegment, _retval); } \
  NS_IMETHOD OnStreamComplete(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, nsresult aStatus, const nsAString & aBuffer) MOZ_OVERRIDE { return _to OnStreamComplete(aLoader, aContext, aStatus, aBuffer); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIUNICHARSTREAMLOADEROBSERVER(_to) \
  NS_IMETHOD OnDetermineCharset(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, const nsACString & aSegment, nsACString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnDetermineCharset(aLoader, aContext, aSegment, _retval); } \
  NS_IMETHOD OnStreamComplete(nsIUnicharStreamLoader *aLoader, nsISupports *aContext, nsresult aStatus, const nsAString & aBuffer) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStreamComplete(aLoader, aContext, aStatus, aBuffer); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsUnicharStreamLoaderObserver : public nsIUnicharStreamLoaderObserver
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIUNICHARSTREAMLOADEROBSERVER

  nsUnicharStreamLoaderObserver();

private:
  ~nsUnicharStreamLoaderObserver();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS(nsUnicharStreamLoaderObserver, nsIUnicharStreamLoaderObserver)

nsUnicharStreamLoaderObserver::nsUnicharStreamLoaderObserver()
{
  /* member initializers and constructor code */
}

nsUnicharStreamLoaderObserver::~nsUnicharStreamLoaderObserver()
}

/* End of implementation class template. */
#endif
# 202 "../../dist/include/nsIProtocolProxyService.h"


#endif /* __gen_nsIProtocolProxyService_h__ */
# 205 "../../dist/include/nsIProtocolProxyService.h"
# 50 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIProxyInfo.h"

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIProxyInfo, NS_IPROXYINFO_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPROXYINFO \
  NS_IMETHOD GetHost(nsACString & aHost) MOZ_OVERRIDE; \
  NS_IMETHOD GetFailoverProxy(nsIProxyInfo * *aFailoverProxy) MOZ_OVERRIDE { return _to GetFailoverProxy(aFailoverProxy); } \
  NS_IMETHOD SetFailoverProxy(nsIProxyInfo *aFailoverProxy) MOZ_OVERRIDE { return _to SetFailoverProxy(aFailoverProxy); } \

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPROXYINFO(_to) \
  NS_IMETHOD GetHost(nsACString & aHost) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHost(aHost); } \
  NS_IMETHOD GetPort(int32_t *aPort) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPort(aPort); } \
  NS_IMETHOD GetType(nsACString & aType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
  NS_IMETHOD GetFlags(uint32_t *aFlags) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFlags(aFlags); } \
  NS_IMETHOD GetResolveFlags(uint32_t *aResolveFlags) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetResolveFlags(aResolveFlags); } \
  NS_IMETHOD GetFailoverTimeout(uint32_t *aFailoverTimeout) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFailoverTimeout(aFailoverTimeout); } \
  NS_IMETHOD GetFailoverProxy(nsIProxyInfo * *aFailoverProxy) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFailoverProxy(aFailoverProxy); } \
  NS_IMETHOD SetFailoverProxy(nsIProxyInfo *aFailoverProxy) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFailoverProxy(aFailoverProxy); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsProxyInfo : public nsIProxyInfo
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPROXYINFO

  nsProxyInfo();

{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 173 "../../dist/include/nsIProxyInfo.h"


#endif /* __gen_nsIProxyInfo_h__ */
# 176 "../../dist/include/nsIProxyInfo.h"
# 51 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIFileStreams.h"
#endif /* expanded by -frewrite-includes */
# 52 "../../dist/include/nsNetUtil.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIBufferedStreams.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIBufferedStreams.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIBufferedStreams.idl
 */

#ifndef __gen_nsIBufferedStreams_h__
#define __gen_nsIBufferedStreams_h__


#ifndef __gen_nsIInputStream_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIInputStream.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIBufferedStreams.h"
#endif
# 12 "../../dist/include/nsIBufferedStreams.h"

#ifndef __gen_nsIOutputStream_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIOutputStream.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsIBufferedStreams.h"
#endif
# 16 "../../dist/include/nsIBufferedStreams.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 21 "../../dist/include/nsIBufferedStreams.h"

/* starting interface:    nsIBufferedInputStream */
#define NS_IBUFFEREDINPUTSTREAM_IID_STR "616f5b48-da09-11d3-8cda-0060b0fc14a3"

#define NS_IBUFFEREDINPUTSTREAM_IID \
#define NS_DECL_NSIBUFFEREDINPUTSTREAM \
  NS_IMETHOD Init(nsIInputStream *fillFromStream, uint32_t bufferSize) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIBUFFEREDINPUTSTREAM(_to) \
  NS_IMETHOD Init(nsIInputStream *fillFromStream, uint32_t bufferSize) MOZ_OVERRIDE { return _to Init(fillFromStream, bufferSize); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIBUFFEREDINPUTSTREAM(_to) \
  NS_IMETHOD Init(nsIInputStream *fillFromStream, uint32_t bufferSize) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(fillFromStream, bufferSize); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsBufferedInputStream : public nsIBufferedInputStream

nsBufferedOutputStream::~nsBufferedOutputStream()
{
  /* destructor code */
}
# 11 "../../dist/include/nsIInputStreamPump.h"
#endif
# 12 "../../dist/include/nsIInputStreamPump.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIInputStreamPump.h"
class nsIInputStream; /* forward declaration */

class nsIStreamListener; /* forward declaration */


/* starting interface:    nsIInputStreamPump */
#define NS_IINPUTSTREAMPUMP_IID_STR "400f5468-97e7-4d2b-9c65-a82aecc7ae82"

#define NS_IINPUTSTREAMPUMP_IID \
  {0x400f5468, 0x97e7, 0x4d2b, \
    { 0x9c, 0x65, 0xa8, 0x2a, 0xec, 0xc7, 0xae, 0x82 }}

class NS_NO_VTABLE nsIInputStreamPump : public nsIRequest {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IINPUTSTREAMPUMP_IID)

  /* void init (in nsIInputStream aStream, in long long aStreamPos, in long long aStreamLen, in unsigned long aSegmentSize, in unsigned long aSegmentCount, in boolean aCloseWhenDone); */
  NS_IMETHOD Init(nsIInputStream *aStream, int64_t aStreamPos, int64_t aStreamLen, uint32_t aSegmentSize, uint32_t aSegmentCount, bool aCloseWhenDone) = 0;

  /* void asyncRead (in nsIStreamListener aListener, in nsISupports aListenerContext); */
  NS_IMETHOD AsyncRead(nsIStreamListener *aListener, nsISupports *aListenerContext) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIInputStreamPump, NS_IINPUTSTREAMPUMP_IID)

/* Use this macro when declaring classes that implement this interface. */
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIASYNCSTREAMCOPIER \
  NS_IMETHOD Init(nsIInputStream *aSource, nsIOutputStream *aSink, nsIEventTarget *aTarget, bool aSourceBuffered, bool aSinkBuffered, uint32_t aChunkSize, bool aCloseSource, bool aCloseSink) MOZ_OVERRIDE; \
  NS_IMETHOD AsyncCopy(nsIRequestObserver *aObserver, nsISupports *aObserverContext) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */

#if 0
/* Use the code below as a template for the implementation class for this interface. */
NS_IMETHODIMP nsPropertyElement::GetKey(nsACString & aKey)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsPropertyElement::SetKey(const nsACString & aKey)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute AString value; */
NS_IMETHODIMP nsPropertyElement::GetValue(nsAString & aValue)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsPropertyElement::SetValue(const nsAString & aValue)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 123 "../../dist/include/nsIPersistentProperties2.h"


/* starting interface:    nsIPersistentProperties */
#define NS_IPERSISTENTPROPERTIES_IID_STR "706867af-0400-4faa-beb1-0dae87308784"

#define NS_IPERSISTENTPROPERTIES_IID \
  {0x706867af, 0x0400, 0x4faa, \
  NS_IMETHOD GetStringProperty(const nsACString & key, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStringProperty(key, _retval); } \
  NS_IMETHOD SetStringProperty(const nsACString & key, const nsAString & value, nsAString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetStringProperty(key, value, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsPersistentProperties : public nsIPersistentProperties
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPERSISTENTPROPERTIES

  nsPersistentProperties();

private:
}

/* End of implementation class template. */
#endif
# 244 "../../dist/include/nsIPersistentProperties2.h"


#define NS_IPERSISTENTPROPERTIES_CID \
{ 0x2245e573, 0x9464, 0x11d2, \
  { 0x9b, 0x8b, 0x0, 0x80, 0x5f, 0x8a, 0x16, 0xd9 } }
#define NS_PERSISTENTPROPERTIES_CONTRACTID "@mozilla.org/persistent-properties;1"

#endif /* __gen_nsIPersistentProperties2_h__ */
# 252 "../../dist/include/nsIPersistentProperties2.h"
# 56 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISYNCSTREAMLISTENER(_to) \
  NS_IMETHOD GetInputStream(nsIInputStream * *aInputStream) MOZ_OVERRIDE { return _to GetInputStream(aInputStream); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISYNCSTREAMLISTENER(_to) \
  NS_IMETHOD GetInputStream(nsIInputStream * *aInputStream) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInputStream(aInputStream); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsSyncStreamListener : public nsISyncStreamListener
{

/* End of implementation class template. */
#endif
# 89 "../../dist/include/nsISyncStreamListener.h"


#endif /* __gen_nsISyncStreamListener_h__ */
# 92 "../../dist/include/nsISyncStreamListener.h"
# 57 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsInterfaceRequestorAgg.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsInterfaceRequestorAgg.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsInterfaceRequestorAgg_h__
#define nsInterfaceRequestorAgg_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsInterfaceRequestorAgg.h"

class nsIEventTarget;
class nsIInterfaceRequestor;

/**
 * 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.
 */
;

/**
 * Like the previous method, but aFirst and aSecond will be released on the
 * provided target thread.
 */
extern nsresult
NS_NewInterfaceRequestorAggregation(nsIInterfaceRequestor* aFirst,
                                    nsIInterfaceRequestor* aSecond,
                                    nsIEventTarget* aTarget,
                                    nsIInterfaceRequestor** aResult);


/* starting interface:    nsINetUtil */
#define NS_INETUTIL_IID_STR "ca68c485-9db3-4c12-82a6-4fab7948e2d5"

#define NS_INETUTIL_IID \
  {0xca68c485, 0x9db3, 0x4c12, \
    { 0x82, 0xa6, 0x4f, 0xab, 0x79, 0x48, 0xe2, 0xd5 }}

class NS_NO_VTABLE nsINetUtil : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_INETUTIL_IID)

  /* AUTF8String parseContentType (in AUTF8String aTypeHeader, out AUTF8String aCharset, out boolean aHadCharset); */
  NS_IMETHOD ParseContentType(const nsACString & aTypeHeader, nsACString & aCharset, bool *aHadCharset, nsACString & _retval) = 0;

  /* boolean protocolHasFlags (in nsIURI aURI, in unsigned long aFlag); */
  NS_IMETHOD ProtocolHasFlags(nsIURI *aURI, uint32_t aFlag, bool *_retval) = 0;

  /* boolean URIChainHasFlags (in nsIURI aURI, in unsigned long aFlags); */
  NS_IMETHOD URIChainHasFlags(nsIURI *aURI, uint32_t aFlags, bool *_retval) = 0;

  /* nsIURI toImmutableURI (in nsIURI aURI); */
  NS_IMETHOD ToImmutableURI(nsIURI *aURI, nsIURI * *_retval) = 0;

  /* nsIURI newSimpleNestedURI (in nsIURI aURI); */
  NS_IMETHOD NewSimpleNestedURI(nsIURI *aURI, nsIURI * *_retval) = 0;

  enum {
    ESCAPE_ALL = 0U,
    ESCAPE_XALPHAS = 1U,
    ESCAPE_URL_QUERY = 256U,
    ESCAPE_URL_REF = 512U,
    ESCAPE_URL_FILEPATH = 112U,
    ESCAPE_URL_MINIMAL = 1023U,
    ESCAPE_URL_FORCED = 1024U,
    ESCAPE_URL_ONLY_ASCII = 2048U,
    ESCAPE_URL_ONLY_NONASCII = 4096U,
    ESCAPE_URL_COLON = 16384U,
    ESCAPE_URL_SKIP_CONTROL = 32768U
  };

  /* ACString escapeURL (in ACString aStr, in unsigned long aFlags); */
  NS_IMETHOD EscapeURL(const nsACString & aStr, uint32_t aFlags, nsACString & _retval) = 0;

  /* ACString unescapeString (in AUTF8String aStr, in unsigned long aFlags); */
  NS_IMETHOD UnescapeString(const nsACString & aStr, uint32_t aFlags, nsACString & _retval) = 0;

  /* boolean extractCharsetFromContentType (in AUTF8String aTypeHeader, out AUTF8String aCharset, out long aCharsetStart, out long aCharsetEnd); */
  NS_IMETHOD ExtractCharsetFromContentType(const nsACString & aTypeHeader, nsACString & aCharset, int32_t *aCharsetStart, int32_t *aCharsetEnd, bool *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsINetUtil, NS_INETUTIL_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSINETUTIL \
  NS_IMETHOD UnescapeString(const nsACString & aStr, uint32_t aFlags, nsACString & _retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->UnescapeString(aStr, aFlags, _retval); } \
  NS_IMETHOD ExtractCharsetFromContentType(const nsACString & aTypeHeader, nsACString & aCharset, int32_t *aCharsetStart, int32_t *aCharsetEnd, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ExtractCharsetFromContentType(aTypeHeader, aCharset, aCharsetStart, aCharsetEnd, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Implementation file */
NS_IMPL_ISUPPORTS(nsNetUtil, nsINetUtil)

nsNetUtil::nsNetUtil()
{
  /* member initializers and constructor code */
}

nsNetUtil::~nsNetUtil()
#endif
# 113 "../../dist/include/nsIPrivateBrowsingChannel.h"


#endif /* __gen_nsIPrivateBrowsingChannel_h__ */
# 116 "../../dist/include/nsIPrivateBrowsingChannel.h"
# 79 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozIApplicationClearPrivateDataParams.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozIApplicationClearPrivateDataParams.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/mozIApplicationClearPrivateDataParams.idl
 */

#ifndef __gen_mozIApplicationClearPrivateDataParams_h__
#define __gen_mozIApplicationClearPrivateDataParams_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozIApplicationClearPrivateDataParams.h"
#endif
# 12 "../../dist/include/mozIApplicationClearPrivateDataParams.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/mozIApplicationClearPrivateDataParams.h"

/* starting interface:    mozIApplicationClearPrivateDataParams */
#define MOZIAPPLICATIONCLEARPRIVATEDATAPARAMS_IID_STR "ba0e6c8e-8c03-4b9b-8f9b-4fb14216f56e"

#define MOZIAPPLICATIONCLEARPRIVATEDATAPARAMS_IID \
  {0xba0e6c8e, 0x8c03, 0x4b9b, \
    { 0x8f, 0x9b, 0x4f, 0xb1, 0x42, 0x16, 0xf5, 0x6e }}
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_MOZIAPPLICATIONCLEARPRIVATEDATAPARAMS \
  NS_IMETHOD GetAppId(uint32_t *aAppId) MOZ_OVERRIDE; \
  NS_IMETHOD GetBrowserOnly(bool *aBrowserOnly) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_MOZIAPPLICATIONCLEARPRIVATEDATAPARAMS(_to) \
  NS_IMETHOD GetAppId(uint32_t *aAppId) MOZ_OVERRIDE { return _to GetAppId(aAppId); } \
  NS_IMETHOD GetBrowserOnly(bool *aBrowserOnly) MOZ_OVERRIDE { return _to GetBrowserOnly(aBrowserOnly); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_MOZIAPPLICATIONCLEARPRIVATEDATAPARAMS(_to) \
  NS_IMETHOD GetAppId(uint32_t *aAppId) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAppId(aAppId); } \
  NS_IMETHOD GetBrowserOnly(bool *aBrowserOnly) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBrowserOnly(aBrowserOnly); } 

#if 0
NS_IMETHODIMP _MYCLASS_::GetAppId(uint32_t *aAppId)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute boolean browserOnly; */
NS_IMETHODIMP _MYCLASS_::GetBrowserOnly(bool *aBrowserOnly)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 101 "../../dist/include/mozIApplicationClearPrivateDataParams.h"

#define TOPIC_WEB_APP_CLEAR_DATA "webapps-clear-data"

#endif /* __gen_mozIApplicationClearPrivateDataParams_h__ */
# 105 "../../dist/include/mozIApplicationClearPrivateDataParams.h"
# 80 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsOfflineCacheUpdateObserver : public nsIOfflineCacheUpdateObserver
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIOFFLINECACHEUPDATEOBSERVER

}

/* End of implementation class template. */
#endif
# 133 "../../dist/include/nsIOfflineCacheUpdate.h"


/* starting interface:    nsIOfflineCacheUpdate */
#define NS_IOFFLINECACHEUPDATE_IID_STR "a4503a53-6ab8-4b50-b01e-1c4f393fc980"

#define NS_IOFFLINECACHEUPDATE_IID \
  NS_IMETHOD GetIsUpgrade(bool *aIsUpgrade) MOZ_OVERRIDE; \
  NS_IMETHOD GetUpdateDomain(nsACString & aUpdateDomain) MOZ_OVERRIDE; \
  NS_IMETHOD GetManifestURI(nsIURI * *aManifestURI) MOZ_OVERRIDE; \
  NS_IMETHOD GetSucceeded(bool *aSucceeded) MOZ_OVERRIDE; \
  NS_IMETHOD Init(nsIURI *aManifestURI, nsIURI *aDocumentURI, nsIDOMDocument *aDocument, nsIFile *aCustomProfileDir, uint32_t aAppId, bool aInBrowser) MOZ_OVERRIDE; \
  NS_IMETHOD InitPartial(nsIURI *aManifestURI, const nsACString & aClientID, nsIURI *aDocumentURI) MOZ_OVERRIDE; \
  NS_IMETHOD InitForUpdateCheck(nsIURI *aManifestURI, uint32_t aAppID, bool aInBrowser, nsIObserver *aObserver) MOZ_OVERRIDE; \
  NS_IMETHOD AddDynamicURI(nsIURI *aURI) MOZ_OVERRIDE; \
  NS_IMETHOD GetSucceeded(bool *aSucceeded) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSucceeded(aSucceeded); } \
  NS_IMETHOD Init(nsIURI *aManifestURI, nsIURI *aDocumentURI, nsIDOMDocument *aDocument, nsIFile *aCustomProfileDir, uint32_t aAppId, bool aInBrowser) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aManifestURI, aDocumentURI, aDocument, aCustomProfileDir, aAppId, aInBrowser); } \
  NS_IMETHOD InitPartial(nsIURI *aManifestURI, const nsACString & aClientID, nsIURI *aDocumentURI) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->InitPartial(aManifestURI, aClientID, aDocumentURI); } \
  NS_IMETHOD InitForUpdateCheck(nsIURI *aManifestURI, uint32_t aAppID, bool aInBrowser, nsIObserver *aObserver) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->InitForUpdateCheck(aManifestURI, aAppID, aInBrowser, aObserver); } \
  NS_IMETHOD AddDynamicURI(nsIURI *aURI) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddDynamicURI(aURI); } \
  NS_IMETHOD Schedule(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Schedule(); } \
  NS_IMETHOD AddObserver(nsIOfflineCacheUpdateObserver *aObserver, bool aHoldWeak) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddObserver(aObserver, aHoldWeak); } \
  NS_IMETHOD RemoveObserver(nsIOfflineCacheUpdateObserver *aObserver) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(aObserver); } \
  NS_IMETHOD Cancel(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Cancel(); } \
  NS_IMETHOD GetByteProgress(uint64_t *aByteProgress) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetByteProgress(aByteProgress); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsSupportsID : public nsISupportsID
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISUPPORTSID

  nsSupportsID();

private:
  ~nsSupportsID();

protected:

/* wstring toString (); */
NS_IMETHODIMP nsSupportsString::ToString(char16_t * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 388 "../../dist/include/nsISupportsPrimitives.h"


/* starting interface:    nsISupportsPRBool */
#define NS_ISUPPORTSPRBOOL_IID_STR "ddc3b490-4a1c-11d3-9890-006008962422"

  NS_IMETHOD ToString(char * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISUPPORTSVOID(_to) \
  NS_IMETHOD GetData(void **aData) MOZ_OVERRIDE { return _to GetData(aData); } \
  NS_IMETHOD SetData(void *aData) MOZ_OVERRIDE { return _to SetData(aData); } \
  NS_IMETHOD ToString(char * *_retval) MOZ_OVERRIDE { return _to ToString(_retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISUPPORTSVOID(_to) \
  NS_IMETHOD GetData(void **aData) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetData(aData); } \
  NS_IMETHOD SetData(void *aData) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetData(aData); } \
  NS_IMETHOD ToString(char * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ToString(_retval); } 

#if 0
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* string toString (); */
NS_IMETHODIMP nsSupportsInterfacePointer::ToString(char * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 1710 "../../dist/include/nsISupportsPrimitives.h"


#endif /* __gen_nsISupportsPrimitives_h__ */
# 1713 "../../dist/include/nsISupportsPrimitives.h"
# 16 "../../dist/include/nsCategoryCache.h" 2

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIVIEWSOURCECHANNEL(_to) \
  NS_IMETHOD GetOriginalContentType(nsACString & aOriginalContentType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOriginalContentType(aOriginalContentType); } \
  NS_IMETHOD SetOriginalContentType(const nsACString & aOriginalContentType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOriginalContentType(aOriginalContentType); } \
  NS_IMETHOD GetIsSrcdocChannel(bool *aIsSrcdocChannel) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsSrcdocChannel(aIsSrcdocChannel); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsViewSourceChannel : public nsIViewSourceChannel
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIVIEWSOURCECHANNEL

/* readonly attribute boolean isSrcdocChannel; */
NS_IMETHODIMP nsViewSourceChannel::GetIsSrcdocChannel(bool *aIsSrcdocChannel)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 109 "../../dist/include/nsIViewSourceChannel.h"


#endif /* __gen_nsIViewSourceChannel_h__ */
# 112 "../../dist/include/nsIViewSourceChannel.h"
# 85 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/LoadInfo.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/LoadInfo.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_LoadInfo_h
#define mozilla_LoadInfo_h

#if 0 /* expanded by -frewrite-includes */
#include "nsIContentPolicy.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/LoadInfo.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsILoadInfo.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsILoadInfo.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsILoadInfo.idl
 */

#ifndef __gen_nsILoadInfo_h__
#define __gen_nsILoadInfo_h__

class nsIDOMDocument; /* forward declaration */

class nsINode; /* forward declaration */

class nsIPrincipal; /* forward declaration */

class nsIURI; /* forward declaration */

typedef uint32_t  nsSecurityFlags;


/* starting interface:    nsILoadInfo */
#define NS_ILOADINFO_IID_STR "768a1f20-57d4-462a-812a-41c04e5d1e19"

#define NS_ILOADINFO_IID \
  {0x768a1f20, 0x57d4, 0x462a, \
    { 0x81, 0x2a, 0x41, 0xc0, 0x4e, 0x5d, 0x1e, 0x19 }}

class nsILoadInfo : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ILOADINFO_IID)

  enum {
    SEC_NORMAL = 0U,
    SEC_FORCE_INHERIT_PRINCIPAL = 1U,
    SEC_SANDBOXED = 2U
  };

  /* readonly attribute nsIPrincipal loadingPrincipal; */
  NS_IMETHOD GetLoadingPrincipal(nsIPrincipal * *aLoadingPrincipal) = 0;

  /* [binaryname(LoadingPrincipal),noscript,nostdcall,notxpcom] nsIPrincipal binaryLoadingPrincipal (); */
  virtual nsIPrincipal * LoadingPrincipal(void) = 0;

  /* readonly attribute nsIPrincipal triggeringPrincipal; */
  NS_IMETHOD GetTriggeringPrincipal(nsIPrincipal * *aTriggeringPrincipal) = 0;

  /* [binaryname(TriggeringPrincipal),noscript,nostdcall,notxpcom] nsIPrincipal binaryTriggeringPrincipal (); */
  virtual nsIPrincipal * TriggeringPrincipal(void) = 0;

  /* readonly attribute nsIDOMDocument loadingDocument; */
  NS_IMETHOD GetLoadingDocument(nsIDOMDocument * *aLoadingDocument) = 0;

  /* [binaryname(LoadingNode),noscript,nostdcall,notxpcom] nsINode binaryLoadingNode (); */
  virtual nsINode * LoadingNode(void) = 0;

  /* readonly attribute nsSecurityFlags securityFlags; */
  NS_IMETHOD GetSecurityFlags(nsSecurityFlags *aSecurityFlags) = 0;

   inline nsSecurityFlags GetSecurityFlags()
  {
    nsSecurityFlags result;
    mozilla::DebugOnly<nsresult> rv = GetSecurityFlags(&result);
    MOZ_ASSERT(NS_SUCCEEDED(rv));
    return result;
  }
  /* [infallible] readonly attribute boolean forceInheritPrincipal; */
  NS_IMETHOD GetForceInheritPrincipal(bool *aForceInheritPrincipal) = 0;
  inline bool GetForceInheritPrincipal()
  {
    bool result;
    mozilla::DebugOnly<nsresult> rv = GetForceInheritPrincipal(&result);
    MOZ_ASSERT(NS_SUCCEEDED(rv));
    return result;
  }

  /* [infallible] readonly attribute boolean loadingSandboxed; */
  NS_IMETHOD GetLoadingSandboxed(bool *aLoadingSandboxed) = 0;
  inline bool GetLoadingSandboxed()
  {
    bool result;
    mozilla::DebugOnly<nsresult> rv = GetLoadingSandboxed(&result);
    MOZ_ASSERT(NS_SUCCEEDED(rv));
    return result;
  }

  /* readonly attribute nsContentPolicyType contentPolicyType; */
  NS_IMETHOD GetContentPolicyType(nsContentPolicyType *aContentPolicyType) = 0;

   inline nsContentPolicyType GetContentPolicyType()
  {
    nsContentPolicyType result;
    mozilla::DebugOnly<nsresult> rv = GetContentPolicyType(&result);
    MOZ_ASSERT(NS_SUCCEEDED(rv));
    return result;
  }
  /* readonly attribute nsIURI baseURI; */
  NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI) = 0;

  /* [binaryname(BaseURI),noscript,nostdcall,notxpcom] nsIURI binaryBaseURI (); */
  virtual nsIURI * BaseURI(void) = 0;

  /* readonly attribute unsigned long innerWindowID; */
  NS_IMETHOD GetInnerWindowID(uint32_t *aInnerWindowID) = 0;

   inline uint32_t GetInnerWindowID()
  {
    uint32_t result;
    mozilla::DebugOnly<nsresult> rv = GetInnerWindowID(&result);
    MOZ_ASSERT(NS_SUCCEEDED(rv));
    return result;
  }
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsILoadInfo, NS_ILOADINFO_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSILOADINFO \
  NS_IMETHOD GetLoadingPrincipal(nsIPrincipal * *aLoadingPrincipal) MOZ_OVERRIDE; \
  virtual nsIPrincipal * LoadingPrincipal(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetTriggeringPrincipal(nsIPrincipal * *aTriggeringPrincipal) MOZ_OVERRIDE; \
  virtual nsIPrincipal * TriggeringPrincipal(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetLoadingDocument(nsIDOMDocument * *aLoadingDocument) MOZ_OVERRIDE; \
  virtual nsINode * LoadingNode(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetSecurityFlags(nsSecurityFlags *aSecurityFlags) MOZ_OVERRIDE; \
  using nsILoadInfo::GetForceInheritPrincipal; \
  NS_IMETHOD GetForceInheritPrincipal(bool *aForceInheritPrincipal) MOZ_OVERRIDE; \
  using nsILoadInfo::GetLoadingSandboxed; \
  NS_IMETHOD GetLoadingSandboxed(bool *aLoadingSandboxed) MOZ_OVERRIDE; \
  NS_IMETHOD GetContentPolicyType(nsContentPolicyType *aContentPolicyType) MOZ_OVERRIDE; \
  NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI) MOZ_OVERRIDE; \
  virtual nsIURI * BaseURI(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetInnerWindowID(uint32_t *aInnerWindowID) MOZ_OVERRIDE; \

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSILOADINFO(_to) \
  NS_IMETHOD GetLoadingPrincipal(nsIPrincipal * *aLoadingPrincipal) MOZ_OVERRIDE { return _to GetLoadingPrincipal(aLoadingPrincipal); } \
  virtual nsIPrincipal * LoadingPrincipal(void) MOZ_OVERRIDE { return _to LoadingPrincipal(); } \
  NS_IMETHOD GetTriggeringPrincipal(nsIPrincipal * *aTriggeringPrincipal) MOZ_OVERRIDE { return _to GetTriggeringPrincipal(aTriggeringPrincipal); } \
  virtual nsIPrincipal * TriggeringPrincipal(void) MOZ_OVERRIDE { return _to TriggeringPrincipal(); } \
  NS_IMETHOD GetLoadingDocument(nsIDOMDocument * *aLoadingDocument) MOZ_OVERRIDE { return _to GetLoadingDocument(aLoadingDocument); } \
  virtual nsINode * LoadingNode(void) MOZ_OVERRIDE { return _to LoadingNode(); } \
  NS_IMETHOD GetLoadingDocument(nsIDOMDocument * *aLoadingDocument) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLoadingDocument(aLoadingDocument); } \
  virtual nsINode * LoadingNode(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetSecurityFlags(nsSecurityFlags *aSecurityFlags) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSecurityFlags(aSecurityFlags); } \
  NS_IMETHOD GetForceInheritPrincipal(bool *aForceInheritPrincipal) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetForceInheritPrincipal(aForceInheritPrincipal); } \
  NS_IMETHOD GetLoadingSandboxed(bool *aLoadingSandboxed) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLoadingSandboxed(aLoadingSandboxed); } \
  NS_IMETHOD GetContentPolicyType(nsContentPolicyType *aContentPolicyType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetContentPolicyType(aContentPolicyType); } \
  NS_IMETHOD GetBaseURI(nsIURI * *aBaseURI) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBaseURI(aBaseURI); } \
  virtual nsIURI * BaseURI(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetInnerWindowID(uint32_t *aInnerWindowID) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInnerWindowID(aInnerWindowID); } \

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsLoadInfo : public nsILoadInfo
{
nsIURI * nsLoadInfo::BaseURI()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute unsigned long innerWindowID; */
NS_IMETHODIMP nsLoadInfo::GetInnerWindowID(uint32_t *aInnerWindowID)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 295 "../../dist/include/nsILoadInfo.h"


#endif /* __gen_nsILoadInfo_h__ */
# 298 "../../dist/include/nsILoadInfo.h"
# 12 "../../dist/include/mozilla/LoadInfo.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrincipal.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/LoadInfo.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIWeakReferenceUtils.h" // for nsWeakPtr
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/LoadInfo.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIURI.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/LoadInfo.h"

class nsINode;

namespace mozilla {

namespace net {
class HttpChannelParent;
class FTPChannelParent;
class WebSocketChannelParent;
}

/**
 * Class that provides an nsILoadInfo implementation.
 */
class MOZ_EXPORT LoadInfo MOZ_FINAL : public nsILoadInfo
{
public:
  ;

  nsCOMPtr<nsIPrincipal> mLoadingPrincipal;
  nsCOMPtr<nsIPrincipal> mTriggeringPrincipal;
  nsWeakPtr mLoadingContext;
  nsSecurityFlags mSecurityFlags;
  nsContentPolicyType mContentPolicyType;
  nsCOMPtr<nsIURI> mBaseURI;
  uint32_t mInnerWindowID;
};

} // namespace mozilla

#endif // mozilla_LoadInfo_h
# 71 "../../dist/include/mozilla/LoadInfo.h"

# 86 "../../dist/include/nsNetUtil.h" 2
#if 0 /* expanded by -frewrite-includes */
        util = do_QueryInterface(io);

    if (error)
        *error = !!util ? NS_OK : NS_ERROR_FAILURE;
    return util.forget();
}
#else
# 116 "../../dist/include/nsNetUtil.h"
// Helper, to simplify getting the I/O service.
inline const nsGetServiceByContractIDWithError
do_GetIOService(nsresult* error = 0)
{
    return nsGetServiceByContractIDWithError(NS_IOSERVICE_CONTRACTID, error);
}

// An alias to do_GetIOService
inline const nsGetServiceByContractIDWithError
do_GetNetUtil(nsresult* error = 0)
{
    return do_GetIOService(error);
}
#endif
# 130 "../../dist/include/nsNetUtil.h"

// private little helper function... don't call this directly!
inline nsresult
net_EnsureIOService(nsIIOService **ios, nsCOMPtr<nsIIOService> &grip)
{
    nsresult rv = NS_OK;
    if (!*ios) {
        grip = do_GetIOService(&rv);
        *ios = grip;
    }
    return rv;
}

inline nsresult
NS_NewURI(nsIURI **result, 
          const nsACString &spec, 
          const char *charset = nullptr,
          nsIURI *baseURI = nullptr,
          nsIIOService *ioService = nullptr)     // pass in nsIIOService to optimize callers
{
    nsresult rv;
    nsCOMPtr<nsIIOService> grip;
    rv = net_EnsureIOService(&ioService, grip);
    if (ioService)
        rv = ioService->NewURI(spec, charset, baseURI, result);
    return rv; 
}







/*
* How to create a new Channel, using NS_NewChannel,
* NS_NewChannelWithTriggeringPrincipal,
* NS_NewInputStreamChannel, NS_NewChannelInternal
* and it's variations:
/**
 * Return true if the given string is a reasonable HTTP header value given the
 * definition in RFC 2616 section 4.2.  Currently we don't pay the cost to do
 * full, sctrict validation here since it would require fulling parsing the
 * value.
 */
;

/**
 * Return true if the given string is a valid HTTP token per RFC 2616 section
 * 2.2.
 */
;

namespace mozilla {
namespace net {

const static uint64_t kJS_MAX_SAFE_UINTEGER = +9007199254740991ULL;
const static  int64_t kJS_MIN_SAFE_INTEGER  = -9007199254740991LL;
const static  int64_t kJS_MAX_SAFE_INTEGER  = +9007199254740991LL;

// Make sure a 64bit value can be captured by JS MAX_SAFE_INTEGER


// Make sure a 64bit value can be captured by JS MAX_SAFE_INTEGER


} // namespace mozilla
} // namespace mozilla::net

#endif // !nsNetUtil_h__
# 2861 "../../dist/include/nsNetUtil.h"
# 15 "/Users/luser/build/mozilla-central/dom/base/ImageEncoder.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/base/ImageEncoder.h"

class nsICanvasRenderingContextInternal;

namespace mozilla {

namespace layers {
class Image;
}

namespace dom {

class EncodeCompleteCallback;
class EncodingRunnable;

class ImageEncoder
{
public:
  // Extracts data synchronously and gives you a stream containing the image
  // represented by aContext. aType may change to "image/png" if we had to fall
  // back to a PNG encoder. A return value of NS_OK implies successful data
  // extraction. If there are any unrecognized custom parse options in
  // aOptions, NS_ERROR_INVALID_ARG will be returned. When encountering this
  // error it is usual to call this function again without any options at all.
  ;

  // Extracts data asynchronously. aType may change to "image/png" if we had to
  // fall back to a PNG encoder. aOptions are the options to be passed to the
  ;

  // Gives you a stream containing the image represented by aImageBuffer.
  // The format is given in aFormat, for example
  // imgIEncoder::INPUT_FORMAT_HOSTARGB.
  static nsresult GetInputStream(int32_t aWidth,
                                 int32_t aHeight,
                                 uint8_t* aImageBuffer,
                                 int32_t aFormat,
                                 imgIEncoder* aEncoder,
                                 const char16_t* aEncoderOptions,
                                 nsIInputStream** aStream);

private:
  // When called asynchronously, aContext is null.
  ;

  // Creates and returns an encoder instance of the type specified in aType.
  // aType may change to "image/png" if no instance of the original type could
  // be created and we had to fall back to a PNG encoder. A null return value
  // should be interpreted as NS_IMAGELIB_ERROR_NO_ENCODER and aType is
  // undefined in this case.
  ;

  friend class EncodingRunnable;
};

/**
 *  The callback interface of ExtractDataAsync and ExtractDataFromLayersImageAsync.
 *  ReceiveBlob() is called on main thread when encoding is complete.
 */
class EncodeCompleteCallback
{
public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(EncodeCompleteCallback)

  ;

protected:
  virtual ~EncodeCompleteCallback() {}
};

} // namespace dom
} // namespace mozilla

#endif // ImageEncoder_h
# 128 "/Users/luser/build/mozilla-central/dom/base/ImageEncoder.h"
# 48 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "ImageRegion.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/image/src/ImageRegion.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_IMAGELIB_IMAGE_REGION_H_
#define MOZILLA_IMAGELIB_IMAGE_REGION_H_

#if 0 /* expanded by -frewrite-includes */
#include "gfxRect.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/image/src/ImageRegion.h"

namespace mozilla {
namespace image {

/**
 * An axis-aligned rectangle in tiled image space, with an optional sampling
 * restriction rect. The drawing code ensures that if a sampling restriction
 * rect is present, any pixels sampled during the drawing process are found
 * within that rect.
 *
 * The sampling restriction rect exists primarily for callers which perform
 * pixel snapping. Other callers should generally use one of the Create()
 * overloads.
 */
class ImageRegion
{
public:
  

  static ImageRegion Create(const gfxRect& aRect)
  {
    return ImageRegion(aRect);
  }

  

  

  

  
  

  

  

  /* ImageRegion() : mIsRestricted(false) { } */

private:
  explicit ImageRegion(const gfxRect& aRect)
    : mRect(aRect)
    , mIsRestricted(false)
  { }

  

  gfxRect mRect;
  gfxRect mRestriction;
  bool    mIsRestricted;
};

}  // namespace image
}  // namespace mozilla

#endif
# 159 "/Users/luser/build/mozilla-central/image/src/ImageRegion.h"
# 49 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2

#if 0 /* expanded by -frewrite-includes */
#include "gfxContext.h"
#endif /* expanded by -frewrite-includes */
# 51 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "gfxASurface.h"
#endif /* expanded by -frewrite-includes */
# 52 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "gfxImageSurface.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxImageSurface.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_IMAGESURFACE_H
#define GFX_IMAGESURFACE_H

#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/gfxImageSurface.h"

// ARGB -- raw buffer.. wont be changed.. good for storing data.

class gfxSubimageSurface;

namespace mozilla {
namespace gfx {
class DataSourceSurface;
class SourceSurface;
}
}

/**
 * A raw image buffer. The format can be set in the constructor. Its main
 * purpose is for storing read-only images and using it as a source surface,
 * but it can also be drawn to.
 */
class gfxImageSurface : public gfxASurface {
public:
    /**
     * Construct an image surface around an existing buffer of image data.
     * @param aData A buffer containing the image data
     * @param aSize The size of the buffer
     * @param aStride The stride of the buffer
     * @param format Format of the data
     *
     * @see gfxImageFormat
     */
    ;

    virtual already_AddRefed<gfxImageSurface> GetAsImageSurface() MOZ_OVERRIDE;

    /** See gfxASurface.h. */
    ;

    virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
        MOZ_OVERRIDE;
    virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
        MOZ_OVERRIDE;
    virtual bool SizeOfIsMeasured() const MOZ_OVERRIDE;

protected:
    ;
    ;
    /**
     * See the parameters to the matching constructor.  This should only
     * be called once, in the constructor, which has already set mSize
     * and mFormat.
     */
    ;
    ;

    


    ;

    gfxIntSize mSize;
    bool mOwnsData;
    unsigned char *mData;
    gfxImageFormat mFormat;
    long mStride;
};

class gfxSubimageSurface : public gfxImageSurface {
protected:
    friend class gfxImageSurface;
    ;
private:
    nsRefPtr<gfxImageSurface> mParent;
};

#endif /* GFX_IMAGESURFACE_H */
# 171 "../../dist/include/gfxImageSurface.h"
# 53 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "gfxPlatform.h"
#endif /* expanded by -frewrite-includes */
# 54 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "gfxFont.h"
#endif /* expanded by -frewrite-includes */
# 55 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "gfxBlur.h"
#endif /* expanded by -frewrite-includes */
# 56 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "gfxUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/gfxUtils.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GFX_UTILS_H
#define GFX_UTILS_H

#if 0 /* expanded by -frewrite-includes */
#include "gfxColor.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/gfxUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxTypes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/gfxUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "GraphicsFilter.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/gfxUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsPrintfCString.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/gfxUtils.h"

class gfxASurface;
class gfxDrawable;
class nsIntRegion;
class nsIPresShell;

struct nsIntRect;

namespace mozilla {
namespace layers {
struct PlanarYCbCrData;
}
    ;

    /**
     * Draw something drawable while working around limitations like bad support
     * for EXTEND_PAD, lack of source-clipping, or cairo / pixman bugs with
     * extreme user-space-to-image-space transforms.
     *
     * The input parameters here usually come from the output of our image
     * snapping algorithm in nsLayoutUtils.cpp.
     * This method is split from nsLayoutUtils::DrawPixelSnapped to allow for
     * adjusting the parameters. For example, certain images with transparent
     * margins only have a drawable subimage. For those images, imgFrame::Draw
     * will tweak the rects and transforms that it gets from the pixel snapping
     * algorithm before passing them on to this method.
     *   for making sure that this is a sane value for the passed MIME-type
    
    ;
    
    ;
    ;
    ;

    /**
     * Copy to the clipboard as a PNG encoded Data URL.
     */
    ;
    ;

    ;

    static bool sDumpPainting;
    static bool sDumpPaintingToFile;
    static FILE* sDumpPaintFile;
};

namespace mozilla {
namespace gfx {

/**
 * If the CMS mode is eCMSMode_All, these functions transform the passed
 * color to a device color using the transform returened by gfxPlatform::
 * GetCMSRGBTransform().  If the CMS mode is some other value, the color is
 * returned unchanged (other than a type change to Moz2D Color, if
 * applicable).
 */
Color ToDeviceColor(Color aColor);
Color ToDeviceColor(nscolor aColor);
Color ToDeviceColor(const gfxRGBA& aColor);

/* These techniques are suggested by "Bit Twiddling Hacks"
 */

/**
 * Returns true if |aNumber| is a power of two
 * 0 is incorreclty considered a power of two
 */
static inline bool
IsPowerOfTwo(int aNumber)
{
    return (aNumber & (aNumber - 1)) == 0;
}

/**
 * Returns the first integer greater than |aNumber| which is a power of two
 * Undefined for |aNumber| < 0
 */
static inline int
NextPowerOfTwo(int aNumber)
{
#if defined(__arm__)
    return 1 << (32 - __builtin_clz(aNumber - 1));
#else
# 338 "../../dist/include/gfxUtils.h"
    --aNumber;
    aNumber |= aNumber >> 1;
    aNumber |= aNumber >> 2;
    aNumber |= aNumber >> 4;
    aNumber |= aNumber >> 8;
    aNumber |= aNumber >> 16;
    return ++aNumber;
#endif
# 346 "../../dist/include/gfxUtils.h"
}

} // namespace gfx
} // namespace mozilla

#endif
# 352 "../../dist/include/gfxUtils.h"
# 57 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2

#if 0 /* expanded by -frewrite-includes */
#include "nsFrameLoader.h"
#endif /* expanded by -frewrite-includes */
# 59 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "nsBidi.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsBidi.h" 1
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsBidi_h__
#define nsBidi_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsBidiUtils.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsBidi.h"

// Bidi reordering engine from ICU
/*
 * javadoc-style comments are intended to be transformed into HTML
 * using DOC++ - see
 * http://www.zib.de/Visual/software/doc++/index.html .
 *
 * The HTML documentation is created with
 *  doc++ -H nsIBidi.h
 */

/**
 * @mainpage BIDI algorithm for Mozilla (from ICU)
 *
/** Bit flag for level input. 
 *  Overrides directional properties. 
 */
#define NSBIDI_LEVEL_OVERRIDE 0x80

/**
 * <code>nsBidiDirection</code> values indicate the text direction.
 */
enum nsBidiDirection {
  /** All left-to-right text This is a 0 value. */
  NSBIDI_LTR,
  /** All right-to-left text This is a 1 value. */
  NSBIDI_RTL,
  /** Mixed-directional text. */
  NSBIDI_MIXED
};
#define IS_FIRST_SURROGATE(uchar) (((uchar)&0xfc00)==0xd800)
#define IS_SECOND_SURROGATE(uchar) (((uchar)&0xfc00)==0xdc00)

/* get the UTF-32 value directly from the surrogate pseudo-characters */
#define SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000)
#define GET_UTF_32(first, second) (((first)<<10UL)+(second)-SURROGATE_OFFSET)


#define UTF_ERROR_VALUE 0xffff

/* Run structure for reordering --------------------------------------------- */

typedef struct Run {
  int32_t logicalStart,  /* first character of the run; b31 indicates even/odd level */
  visualLimit;  /* last visual position of the run +1 */
} Run;

/* in a Run, logicalStart will get this bit set if the run level is odd */
#define INDEX_ODD_BIT (1UL<<31)

#define MAKE_INDEX_ODD_PAIR(index, level) (index|((uint32_t)level<<31))
#define ADD_ODD_BIT_FROM_LEVEL(x, level)  ((x)|=((uint32_t)level<<31))
#define REMOVE_ODD_BIT(x)          ((x)&=~INDEX_ODD_BIT)

#define GET_INDEX(x)   (x&~INDEX_ODD_BIT)
#define GET_ODD_BIT(x) ((uint32_t)x>>31)
#define IS_ODD_RUN(x)  ((x&INDEX_ODD_BIT)!=0)
#define IS_EVEN_RUN(x) ((x&INDEX_ODD_BIT)==0)

typedef uint32_t Flags;

/**
 * This class holds information about a paragraph of text
 * with Bidi-algorithm-related details, or about one line of
 * such a paragraph.<p>
 * Reordering can be done on a line, or on a paragraph which is
 * then interpreted as one single line.<p>
 *
 * On construction, the class is initially empty. It is assigned
 * the Bidi properties of a paragraph by <code>SetPara</code>
 * or the Bidi properties of a line of a paragraph by
 * <code>SetLine</code>.<p>
 * A Bidi class can be reused for as long as it is not deallocated
 * by calling its destructor.<p>
 * <code>SetPara</code> will allocate additional memory for
 * internal structures as necessary.
 */
class nsBidi
{
public: 
  /** @brief Default constructor.
   * 
   * The nsBidi object is initially empty. It is assigned
   * the Bidi properties of a paragraph by <code>SetPara()</code>
   * or the Bidi properties of a line of a paragraph by
   * <code>GetLine()</code>.<p>
   * This object can be reused for as long as it is not destroyed.<p>
   * <code>SetPara()</code> will allocate additional memory for
   * internal structures as necessary.
   *
   */
  nsBidi();

  /** @brief Destructor. */
  virtual ~nsBidi();


  /**
   * Perform the Unicode Bidi algorithm. It is defined in the
   * <a href="http://www.unicode.org/unicode/reports/tr9/";>Unicode Technical Report 9</a>,
   * version 5,
   * also described in The Unicode Standard, Version 3.0 .<p>
   *
   * This function takes a single plain text paragraph with or without
   * externally specified embedding levels from <quote>styled</quote> text
   * and computes the left-right-directionality of each character.<p>
   *
   * If the entire paragraph consists of text of only one direction, then
   * the function may not perform all the steps described by the algorithm,
   * i.e., some levels may not be the same as if all steps were performed.
   * This is not relevant for unidirectional text.<br>
  /** fields for line reordering */
  int32_t mRunCount;     /* ==-1: runs not set up yet */
  Run* mRuns;

  /** for non-mixed text, we only need a tiny array of runs (no malloc()) */
  Run mSimpleRuns[1];

private:
};

#endif // _nsBidi_h_
# 893 "../../dist/include/nsBidi.h"
# 60 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsBidiPresUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsBidiPresUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsBidiPresUtils_h___
#define nsBidiPresUtils_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsBidi.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsBidiPresUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsBidiUtils.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsBidiPresUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/nsBidiPresUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCoord.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsBidiPresUtils.h"

#ifdef DrawText
#undef DrawText
#endif
# 18 "../../dist/include/nsBidiPresUtils.h"

struct BidiParagraphData;
struct BidiLineData;
class nsFontMetrics;
class nsIFrame;
class nsBlockFrame;
class nsPresContext;
class nsRenderingContext;
class nsBlockInFlowLineIterator;
class nsStyleContext;
struct nsSize;
template<class T> class nsTHashtable;
namespace mozilla { class WritingMode; }

/**
 * A structure representing some continuation state for each frame on the line,
 * used to determine the first and the last continuation frame for each
 * continuation chain on the line.
 */
struct nsFrameContinuationState : public nsVoidPtrHashKey
{
  

  /**
   * The first visual frame in the continuation chain containing this frame, or
   * nullptr if this frame is the first visual frame in the chain.
   */
  nsIFrame* mFirstVisualFrame;

  /**
   * The number of frames in the continuation chain containing this frame, if
   * this frame is the first visual frame of the chain, or 0 otherwise.
   */
  uint32_t mFrameCount;

  /**
   * TRUE if this frame is the first visual frame of its continuation chain on
   * this line and the chain has some frames on the previous lines.
   */
  bool mHasContOnPrevLines;

  /**
   * TRUE if this frame is the first visual frame of its continuation chain on
   * this line and the chain has some frames left for next lines.
   */
  bool mHasContOnNextLines;
};

/*
 * Following type is used to pass needed hashtable to reordering methods
 */
typedef nsTHashtable<nsFrameContinuationState> nsContinuationStates;

/**
 * A structure representing a logical position which should be resolved
 * into its visual position during BiDi processing.
 */
struct nsBidiPositionResolve
{
  // [in] Logical index within string.
  int32_t logicalIndex;
  // [out] Visual index within string.
  // If the logical position was not found, set to kNotFound.
  int32_t visualIndex;
  // [out] Visual position of the character, from the left (on the X axis), in twips.
  // Eessentially, this is the X position (relative to the rendering context) where the text was drawn + the font metric of the visual string to the left of the given logical position.
  // If the logical position was not found, set to kNotFound.
  int32_t visualLeftTwips;
  // [out] Visual width of the character, in twips.
  // If the logical position was not found, set to kNotFound.
  int32_t visualWidth;
};

class nsBidiPresUtils {
public:
  ;
  ;
  
  /**
   * Interface for the processor used by ProcessText. Used by process text to
   * collect information about the width of subruns and to notify where each
   * subrun should be rendered.
   */
  class BidiProcessor {
  public:
    virtual ~BidiProcessor() { }

    /**
     * Sets the current text with the given length and the given direction.
     *
     * @remark The reason that the function gives a string instead of an index
     *  is that ProcessText copies and modifies the string passed to it, so
     *  passing an index would be impossible.
     *
     * @param aText The string of text.
     * @param aLength The length of the string of text.
     * This call is guaranteed to only be called once between SetText calls.
     * 
     * @param aXOffset The offset of the left side of the substring to be drawn
     *  from the beginning of the overall string passed to ProcessText.
     * @param aWidth The width returned by GetWidth.
     */
    ;
  };

  /**
   * Make Bidi engine calculate the embedding levels of the frames that are
   * descendants of a given block frame.
   *
   * @param aBlockFrame          The block frame
   *
   *  @lina 06/18/2000
   * symmetric and numeric swapping, removing control characters.
   *
   * @lina 06/18/2000 
   *      URI of document containing inline style (for reporting violations)
   *  @param aLineNumber
   *      Line number of inline style element in the containing document (for
   *      reporting violations)
   *  @param aStyleText
   *      Contents of the inline style element (for reporting violations)
   *  @param aRv
   *      Return error code in case of failure
   *  @return
   *      Does CSP allow application of the specified inline style?
   */
  ;

};


#endif /* nsStyleUtil_h___ */
# 171 "/Users/luser/build/mozilla-central/layout/style/nsStyleUtil.h"
# 65 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "CanvasImageCache.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/canvas/CanvasImageCache.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef CANVASIMAGECACHE_H_
class imgIRequest;

namespace mozilla {

class CanvasImageCache {
  typedef mozilla::gfx::SourceSurface SourceSurface;
public:
  /**
   * Notify that image element aImage was (or is about to be) drawn to aCanvas
   * using the first frame of aRequest's image. The data for the surface is
   * in aSurface, and the image size is in aSize.
   */
  static void NotifyDrawImage(dom::Element* aImage,
                              dom::HTMLCanvasElement* aCanvas,
                              imgIRequest* aRequest,
                              SourceSurface* aSource,
                              const gfxIntSize& aSize);

  /**
   * Check whether aImage has recently been drawn into aCanvas. If we return
   * a non-null surface, then the image was recently drawn into the canvas
   * (with the same image request) and the returned surface contains the image
   * data, and the image size will be returned in aSize.
   */
  static SourceSurface* Lookup(dom::Element* aImage,
                               dom::HTMLCanvasElement* aCanvas,
                               gfx::IntSize* aSize);

  /**
   * This is the same as Lookup, except it works on any image recently drawn
   * into any canvas. Security checks need to be done again if using the
   * results from this.
   */
  static SourceSurface* SimpleLookup(dom::Element* aImage);
};

}

#endif /* CANVASIMAGECACHE_H_ */
# 59 "/Users/luser/build/mozilla-central/dom/canvas/CanvasImageCache.h"
# 66 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2

#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 68 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"

#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 70 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "jsfriendapi.h"
#endif /* expanded by -frewrite-includes */
# 71 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "js/Conversions.h"
#endif /* expanded by -frewrite-includes */
# 72 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Alignment.h"
#endif /* expanded by -frewrite-includes */
# 74 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 75 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CheckedInt.h"
#endif /* expanded by -frewrite-includes */
# 76 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 77 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ContentParent.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/ContentParent.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_ContentParent_h
#define mozilla_dom_ContentParent_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/PContentParent.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PContentParent_h
#define PContentParent_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/PContent.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PContent_h
#define PContent_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h"
#if 0 /* expanded by -frewrite-includes */
#include "prtime.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h"
#if 0 /* expanded by -frewrite-includes */
#include "IPCMessageStart.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/IPCMessageStart.h" 1

// CODE GENERATED by ipdl.py. Do not edit.

#ifndef IPCMessageStart_h
#define IPCMessageStart_h

enum IPCMessageStart {

  PAsmJSCacheEntryMsgStart,
  PAsmJSCacheEntryMsgStartChild,
  PBackgroundIDBCursorMsgStart,
  PBackgroundIDBCursorMsgStartChild,
  PBackgroundIDBDatabaseFileMsgStart,
  PBackgroundIDBDatabaseFileMsgStartChild,
  PBackgroundIDBDatabaseMsgStart,
  PBackgroundIDBDatabaseMsgStartChild,
  PBackgroundIDBFactoryMsgStart,
  PBackgroundIDBFactoryMsgStartChild,
  PBackgroundIDBFactoryRequestMsgStart,
  PBluetoothMsgStartChild,
  PBluetoothRequestMsgStart,
  PBluetoothRequestMsgStartChild,
  PBroadcastChannelMsgStart,
  PBroadcastChannelMsgStartChild,
  PBrowserMsgStart,
  PBrowserMsgStartChild,
  PBrowserStreamMsgStart,
  PBrowserStreamMsgStartChild,
  PCacheMsgStart,
  PCacheMsgStartChild,
  PCacheStorageMsgStart,
  PCacheStorageMsgStartChild,
  PCacheStreamControlMsgStart,
  PCacheStreamControlMsgStartChild,
  PCellBroadcastMsgStart,
  PCellBroadcastMsgStartChild,
  PChannelDiverterMsgStart,
  PChannelDiverterMsgStartChild,
  PColorPickerMsgStart,
  PColorPickerMsgStartChild,
  PCompositableMsgStart,
  PCompositableMsgStartChild,
  PCompositorMsgStart,
  PCompositorMsgStartChild,
  PContentBridgeMsgStart,
  PContentBridgeMsgStartChild,
  PContentMsgStart,
  PContentMsgStartChild,
  PContentPermissionRequestMsgStart,
  PContentPermissionRequestMsgStartChild,
  PCookieServiceMsgStart,
  PWyciwygChannelMsgStartChild,

  LastMsgIndex
};

static_assert(LastMsgIndex <= 65536, "need to update IPC_MESSAGE_MACRO");

#endif // ifndef IPCMessageStart_h
# 216 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/IPCMessageStart.h"

# 12 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/ipc/IPCMessageUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __IPC_GLUE_IPCMESSAGEUTILS_H__
#define __IPC_GLUE_IPCMESSAGEUTILS_H__

#if 0 /* expanded by -frewrite-includes */
#include "base/process_util.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h" 1
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file/namespace contains utility functions for enumerating, ending and
// computing statistics of processes.

#ifndef BASE_PROCESS_UTIL_H_
#define BASE_PROCESS_UTIL_H_

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_BASICTYPES_H_
#define BASE_BASICTYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <limits.h>         // So we can set the bounds of our types
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h"
#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>         // For size_t
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <string.h>         // for memcpy
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/port.h"    // Types that only need exist on certain systems
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_PORT_H_
#define BASE_PORT_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h>
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h"
#if 0 /* expanded by -frewrite-includes */
#include "build/build_config.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h" 1
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This file adds defines about the platform we're currently building on.
//  Operating System:
//    OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX) / OS_NACL
//  Compiler:
//    COMPILER_MSVC / COMPILER_GCC
//  Processor:
//    ARCH_CPU_X86 / ARCH_CPU_X86_64 / ARCH_CPU_X86_FAMILY (X86 or X86_64)
//    ARCH_CPU_32_BITS / ARCH_CPU_64_BITS

#ifndef BUILD_BUILD_CONFIG_H_
#define BUILD_BUILD_CONFIG_H_

#if defined(__APPLE__)
#if 0 /* expanded by -frewrite-includes */
#include <TargetConditionals.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/TargetConditionals.h" 1 3 4
/*
 * Copyright (c) 2000-2014 by Apple Inc.. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 * 
                 Note:  TargetConditionals.h in 3.4 Universal Interfaces works
                        with all compilers.  This header only recognizes compilers
                        known to run on Mac OS X.
  
*/

#ifndef __TARGETCONDITIONALS__
#define __TARGETCONDITIONALS__
/****************************************************************************************************

    TARGET_CPU_*    
    These conditionals specify which microprocessor instruction set is being
    generated.  At most one of these is true, the rest are false.

        TARGET_CPU_PPC          - Compiler is generating PowerPC instructions for 32-bit mode
        TARGET_CPU_PPC64        - Compiler is generating PowerPC instructions for 64-bit mode
        TARGET_CPU_68K          - Compiler is generating 680x0 instructions
        TARGET_CPU_X86          - Compiler is generating x86 instructions
        TARGET_CPU_ARM          - Compiler is generating ARM instructions
        

****************************************************************************************************/


/*
 *    gcc based compiler used on Mac OS X
 */
#if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
    #define TARGET_OS_MAC               1
    #define TARGET_OS_WIN32             0
    #define TARGET_OS_UNIX              0
    #define TARGET_OS_EMBEDDED          1 
    #define TARGET_OS_IPHONE            1 
    #define TARGET_IPHONE_SIMULATOR     0 
    #if defined(__ppc__) 
        #define TARGET_CPU_PPC          1
        #define TARGET_CPU_PPC64        0
        #define TARGET_CPU_68K          0
        #define TARGET_CPU_X86          0
        #define TARGET_CPU_X86_64       0
        #define TARGET_CPU_ARM          0
        #define TARGET_CPU_ARM64        0
        #define TARGET_CPU_MIPS         0
        #define TARGET_CPU_SPARC        0   
        #define TARGET_CPU_ALPHA        0
        #define TARGET_RT_LITTLE_ENDIAN 0
        #define TARGET_RT_BIG_ENDIAN    1
        #define TARGET_RT_64_BIT        0
            
            The long term solution is to add a new case to this file which
            auto detects your compiler and sets up the TARGET_ conditionals.
            Then submit the changes to Apple Computer.
        */
        #error TargetConditionals.h: unknown compiler (see comment above)
        #define TARGET_CPU_PPC    0
        #define TARGET_CPU_68K    0
        #define TARGET_CPU_X86    0
        #define TARGET_CPU_ARM    0
        #define TARGET_CPU_ARM64  0
        #define TARGET_CPU_MIPS   0
        #define TARGET_CPU_SPARC  0
        #define TARGET_CPU_ALPHA  0
    #endif
# 331 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/TargetConditionals.h" 3 4
    #define TARGET_OS_MAC                1
    #define TARGET_OS_WIN32              0
    #define TARGET_OS_UNIX               0
    #define TARGET_OS_EMBEDDED           0
    #if TARGET_CPU_PPC || TARGET_CPU_PPC64
        #define TARGET_RT_BIG_ENDIAN     1
        #define TARGET_RT_LITTLE_ENDIAN  0
    #else
# 339 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/TargetConditionals.h" 3 4
        #define TARGET_RT_BIG_ENDIAN     0
        #define TARGET_RT_LITTLE_ENDIAN  1
    #endif
# 342 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/TargetConditionals.h" 3 4
    #if TARGET_CPU_PPC64 || TARGET_CPU_X86_64
        #define TARGET_RT_64_BIT         1
    #else
# 345 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/TargetConditionals.h" 3 4
        #define TARGET_RT_64_BIT         0
    #endif
# 347 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/TargetConditionals.h" 3 4
    #ifdef __MACH__
        #define TARGET_RT_MAC_MACHO      1
        #define TARGET_RT_MAC_CFM        0
    #else
# 351 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/TargetConditionals.h" 3 4
        #define TARGET_RT_MAC_MACHO      0
        #define TARGET_RT_MAC_CFM        1
    #endif
# 354 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/TargetConditionals.h" 3 4
    
#endif
# 356 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/TargetConditionals.h" 3 4

#endif  /* __TARGETCONDITIONALS__ */
# 358 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/TargetConditionals.h" 3 4
# 19 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h" 2
#endif
# 20 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"

// For access to standard POSIXish features, use OS_POSIX instead of a
// more specific macro.
#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_FREEBSD) ||     \
    defined(OS_OPENBSD) || defined(OS_SOLARIS) || defined(OS_ANDROID) ||  \
    defined(OS_NACL) || defined(OS_QNX)
#define OS_POSIX 1
#endif
# 72 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"

// Use tcmalloc
#if (defined(OS_WIN) || defined(OS_LINUX) || defined(OS_ANDROID)) && \
    !defined(NO_TCMALLOC)
#define USE_TCMALLOC 1
#endif
# 78 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"

// Compiler detection.
#if defined(__GNUC__)
#define COMPILER_GCC 1
#elif defined(_MSC_VER)
# 83 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#define COMPILER_MSVC 1
#else
# 85 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#error Please add support for your compiler in build/build_config.h
#endif
# 87 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"

// Processor architecture detection.  For more info on what's defined, see:
//   http://msdn.microsoft.com/en-us/library/b0084kay.aspx
//   http://www.agner.org/optimize/calling_conventions.pdf
//   or with gcc, run: "echo | gcc -E -dM -"
#if defined(_M_X64) || defined(__x86_64__)
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86_64 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(_M_IX86) || defined(__i386__)
# 98 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#define ARCH_CPU_X86_FAMILY 1
#define ARCH_CPU_X86 1
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__ARMEL__)
# 103 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#define ARCH_CPU_ARM_FAMILY 1
#define ARCH_CPU_ARMEL 1
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__aarch64__)
# 108 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#define ARCH_CPU_ARM_FAMILY 1
#define ARCH_CPU_ARM64 1
#define ARCH_CPU_64_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__pnacl__)
# 113 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_LITTLE_ENDIAN 1
#elif defined(__MIPSEL__)
# 116 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#define ARCH_CPU_MIPS_FAMILY 1
#define ARCH_CPU_MIPSEL 1
#elif defined(__mips64) && defined(__LP64__)
# 119 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#define ARCH_CPU_MIPS 1
#define ARCH_CPU_64_BITS 1

#else
# 123 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#error Please add support for your architecture in build/build_config.h
#endif
# 125 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"

// Type detection for wchar_t.
#if defined(OS_WIN)
#define WCHAR_T_IS_UTF16
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
    defined(__WCHAR_MAX__) && \
    (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff)
# 132 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#define WCHAR_T_IS_UTF32
#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \
    defined(__WCHAR_MAX__) && \
    (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff)
# 136 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to
// compile in this mode (in particular, Chrome doesn't). This is intended for
// other projects using base who manage their own dependencies and make sure
// short wchar works for them.
#define WCHAR_T_IS_UTF16
#else
# 142 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
#error Please add support for your compiler in build/build_config.h
#endif
# 144 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"

#if defined(OS_ANDROID)
// The compiler thinks std::string::const_iterator and "const char*" are
// equivalent types.
#define STD_STRING_ITERATOR_IS_CHAR_POINTER
// The compiler thinks base::string16::const_iterator and "char16*" are
// equivalent types.
#define BASE_STRING16_ITERATOR_IS_CHAR16_POINTER
#endif
# 153 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"

#endif  // BUILD_BUILD_CONFIG_H_
# 155 "/Users/luser/build/mozilla-central/ipc/chromium/src/build/build_config.h"
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h" 2

#ifdef COMPILER_MSVC
#define GG_LONGLONG(x) x##I64
#define GG_ULONGLONG(x) x##UI64
#else
# 15 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h"
#define GG_LONGLONG(x) x##LL
#define GG_ULONGLONG(x) x##ULL
#endif
# 18 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h"

namespace base {

// It's possible for functions that use a va_list, such as StringPrintf, to
// invalidate the data in it upon use.  The fix is to make a copy of the
// structure before using it and use that copy instead.  va_copy is provided
// for this purpose.  MSVC does not provide va_copy, so define an
// implementation here.  It is not guaranteed that assignment is a copy, so the
// StringUtil.VariableArgsFunc unit test tests this capability.

// The C standard says that va_copy is a "macro", not a function.  Trying to 
// use va_list as ref args to a function, as above, breaks some machines.
#  if defined(COMPILER_GCC)
#    define base_va_copy(_a, _b) ::va_copy(_a, _b)
#  elif defined(COMPILER_MSVC)
# 49 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h"
#    define base_va_copy(_a, _b) (_a = _b)
#  else
# 51 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h"
#    error No va_copy for your compiler
#  endif
# 53 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h"

}  // namespace base

// Define an OS-neutral wrapper for shared library entry points
#if defined(OS_WIN)
#define API_CALL __stdcall
#elif defined(OS_LINUX) || defined(OS_MACOSX)
# 60 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h"
#define API_CALL
#endif
# 62 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h"

#endif  // BASE_PORT_H_
# 64 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/port.h"
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/IntegerPrintfMacros.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/IntegerPrintfMacros.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* Implements the C99 <inttypes.h> interface. */

#ifndef mozilla_IntegerPrintfMacros_h_
#define mozilla_IntegerPrintfMacros_h_

/*
 * scanf is a footgun: if the input number exceeds the bounds of the target
 * type, behavior is undefined (in the compiler sense: that is, this code
 * could overwrite your hard drive with zeroes):
 *
 *   uint8_t u;
 *   sscanf("256", "%" SCNu8, &u); // BAD
 *
 * For this reason, *never* use the SCN* macros provided by this header!
 */

#if 0 /* expanded by -frewrite-includes */
#include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/inttypes.h" 1 3 4
/*
 * Copyright (c) 2000-2004, 2013 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * (aka "C99"), section 7.8.   This defines format string conversion
 * specifiers suitable for use within arguments to fprintf and fscanf
 * and their ilk.
 */

#if !defined(_INTTYPES_H_)
#define _INTTYPES_H_

#  define __PRI_8_LENGTH_MODIFIER__ "hh"
#  define __PRI_64_LENGTH_MODIFIER__ "ll"
#  define PRIiPTR "i"  /* intptr_t  */
#  undef  PRIoPTR      /* uintptr_t */
#  define PRIoPTR "o"  /* uintptr_t */
#  undef  PRIuPTR      /* uintptr_t */
#  define PRIuPTR "u"  /* uintptr_t */
#  undef  PRIxPTR      /* uintptr_t */
#  define PRIxPTR "x"  /* uintptr_t */
#  undef  PRIXPTR      /* uintptr_t */
#  define PRIXPTR "X"  /* uintptr_t */
#endif
# 45 "../../dist/include/mozilla/IntegerPrintfMacros.h"

#endif  /* mozilla_IntegerPrintfMacros_h_ */
# 47 "../../dist/include/mozilla/IntegerPrintfMacros.h"
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h" 2

// A type to represent a Unicode code-point value. As of Unicode 4.0,
// such values require up to 21 bits.
// (For type-checking on pointers, make this explicitly signed,
// and it should always be the signed version of whatever int32_t is.)
typedef signed int         char32;

const uint8_t  kuint8max  = (( uint8_t) 0xFF);
const uint16_t kuint16max = ((uint16_t) 0xFFFF);
const uint32_t kuint32max = ((uint32_t) 0xFFFFFFFF);
const uint64_t kuint64max = ((uint64_t) GG_LONGLONG(0xFFFFFFFFFFFFFFFF));
const  int8_t  kint8min   = ((  int8_t) 0x80);
const  int8_t  kint8max   = ((  int8_t) 0x7F);
const  int16_t kint16min  = (( int16_t) 0x8000);
const  int16_t kint16max  = (( int16_t) 0x7FFF);
const  int32_t kint32min  = (( int32_t) 0x80000000);
const  int32_t kint32max  = (( int32_t) 0x7FFFFFFF);
const  int64_t kint64min  = (( int64_t) GG_LONGLONG(0x8000000000000000));
const  int64_t kint64max  = (( int64_t) GG_LONGLONG(0x7FFFFFFFFFFFFFFF));

// Platform- and hardware-dependent printf specifiers
#  if defined(OS_POSIX)
#    define PRId64L "I64d"
#    define PRIu64L "I64u"
#    define PRIx64L "I64x"
#  elif defined(OS_WIN)
# 42 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h"
#    define PRId64L L"I64d"
#    define PRIu64L L"I64u"
#    define PRIx64L L"I64x"
#  endif
# 46 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h"

// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#undef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
  TypeName(const TypeName&);               \
  void operator=(const TypeName&)

// An older, deprecated, politically incorrect name for the above.
#undef DISALLOW_EVIL_CONSTRUCTORS
#define DISALLOW_EVIL_CONSTRUCTORS(TypeName) DISALLOW_COPY_AND_ASSIGN(TypeName)

// A macro to disallow all the implicit constructors, namely the
// default constructor, copy constructor and operator= functions.
//
// This should be used in the private: declarations for a class
// that wants to prevent anyone from instantiating it. This is
// especially useful for classes containing only static methods.
#undef DISALLOW_IMPLICIT_CONSTRUCTORS
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \
  TypeName();                                    \
  DISALLOW_COPY_AND_ASSIGN(TypeName)

// indeed an array, in which case the division result is the # of
// elements in the array.  Otherwise, arr cannot possibly be an array,
// and we generate a compiler error to prevent the code from
// implicit_cast would have been part of the C++ standard library,
// but the proposal was submitted too late.  It will probably make
// its way into the language in the future.


// The COMPILE_ASSERT macro (below) creates an otherwise-unused typedef.  This
// triggers compiler warnings with gcc 4.8 and higher, so mark the typedef
// as permissibly-unused to disable the warnings.
#  if defined(__GNUC__)
#    define COMPILE_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
#  else
# 166 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h"
#    define COMPILE_ASSERT_UNUSED_ATTRIBUTE /* nothing */
#  endif
# 168 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h"

// The COMPILE_ASSERT macro can be used to verify that a compile time
// expression is true. For example, you could use it to verify the
// size of a static array:
//
//   COMPILE_ASSERT(ARRAYSIZE_UNSAFE(content_type_names) == CONTENT_NUM_TYPES,
//                  content_type_names_incorrect_size);
//
// or to make sure a struct is smaller than a certain size:
//
//   COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large);
//
// The second argument to the macro is the name of the variable. If
// the expression is false, most compilers will issue a warning/error
// containing the name of the variable.

// Avoid multiple definitions for webrtc
#if !defined(COMPILE_ASSERT)
template <bool>
struct CompileAssert {
};

#define COMPILE_ASSERT(expr, msg) \
  typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] \
  COMPILE_ASSERT_UNUSED_ATTRIBUTE
#endif
# 194 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h"

// Implementation details of COMPILE_ASSERT:
//
// - The array size is (bool(expr) ? 1 : -1), instead of simply
//
//     ((expr) ? 1 : -1).
//
//   This is to avoid running into a bug in MS VC 7.1, which
//   causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1.


// MetatagId refers to metatag-id that we assign to
// each metatag <name, value> pair..
typedef uint32_t MetatagId;

// Argument type used in interfaces that can optionally take ownership
// of a passed in argument.  If TAKE_OWNERSHIP is passed, the called
// object takes ownership of the argument.  Otherwise it does not.
enum Ownership {
  DO_NOT_TAKE_OWNERSHIP,
  TAKE_OWNERSHIP
};

// The following enum should be used only as a constructor argument to indicate
// that the variable has static storage class, and that the constructor should
// do nothing to its state.  It indicates to the reader that it is legal to
// declare a static instance of the class, provided the constructor is given
// the base::LINKER_INITIALIZED argument.  Normally, it is unsafe to declare a
// static variable that has a constructor or a destructor because invocation
// order is undefined.  However, IF the type can be initialized by filling with
// zeroes (which the loader does for static variables), AND the destructor also
// does nothing to the storage, AND there are no virtual methods, then a
// constructor declared as
//       explicit MyClass(base::LinkerInitialized x) {}
// and invoked as
//       static MyClass my_variable_name(base::LINKER_INITIALIZED);
namespace base {
enum LinkerInitialized { LINKER_INITIALIZED };
}  // base


#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"             // pick up mozalloc operator new() etc.
#endif /* expanded by -frewrite-includes */
# 268 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h"


#endif  // BASE_BASICTYPES_H_
# 271 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/basictypes.h"
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h" 2

#if defined(OS_WIN)
#if 0 /* expanded by -frewrite-includes */
#include <windows.h>
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"
#if 0 /* expanded by -frewrite-includes */
#include <tlhelp32.h>
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"
#if 0 /* expanded by -frewrite-includes */
#include <io.h>
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"
#ifndef STDOUT_FILENO
#define STDOUT_FILENO 1
#endif

#ifndef	_MACH_H_
#define	_MACH_H_

#define __MACH30__
#define MACH_IPC_FLAVOR UNTYPED

#if 0 /* expanded by -frewrite-includes */
#include <mach/std_types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/std_types.h" 1 3 4
/*
 * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */
/*
 */
/*
 *	Mach standard external interface type definitions.
 *
 */

#ifndef	_MACH_STD_TYPES_H_
#define	_MACH_STD_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
 *	File:	mach/boolean.h
 *
 *	Boolean data type.
 *
 */

#ifndef	_MACH_BOOLEAN_H_
#define	_MACH_BOOLEAN_H_

/*
 *	Pick up "boolean_t" type definition
 */

#ifndef	ASSEMBLER
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/boolean.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/boolean.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _MACH_MACHINE_BOOLEAN_H_
#define _MACH_MACHINE_BOOLEAN_H_

#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "mach/arm/boolean.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/boolean.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,

/*
 *	File:	boolean.h
 *
 *	Boolean type, for ARM.
 */

#ifndef	_MACH_ARM_BOOLEAN_H_
#define _MACH_ARM_BOOLEAN_H_

typedef int		boolean_t;

#endif	/* _MACH_ARM_BOOLEAN_H_ */
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/boolean.h" 3 4
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/boolean.h" 2 3 4
#else
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/boolean.h" 3 4
#error architecture not supported
#endif
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/boolean.h" 3 4

#endif /* _MACH_MACHINE_BOOLEAN_H_ */
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/boolean.h" 3 4
# 74 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/boolean.h" 2 3 4
#endif	/* ASSEMBLER */
# 75 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/boolean.h" 3 4

/*
 *	Define TRUE and FALSE if not defined.
 */

#ifndef	TRUE
#define TRUE	1
#endif	/* TRUE */
# 83 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/boolean.h" 3 4

#ifndef	FALSE
#define FALSE	0
#endif	/* FALSE */
# 87 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/boolean.h" 3 4

#endif	/* _MACH_BOOLEAN_H_ */
# 89 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/boolean.h" 3 4
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/std_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/kern_return.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/kern_return.h" 1 3 4
 *
 */

#ifndef	_MACH_KERN_RETURN_H_
#define _MACH_KERN_RETURN_H_


#ifndef _MACH_MACHINE_KERN_RETURN_H_
#define _MACH_MACHINE_KERN_RETURN_H_

#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "mach/arm/kern_return.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/kern_return.h" 1 3 4
/*

#endif	/* _MACH_ARM_KERN_RETURN_H_ */
# 51 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/kern_return.h" 3 4
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/kern_return.h" 2 3 4
#else
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/kern_return.h" 3 4
#error architecture not supported
#endif
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/kern_return.h" 3 4

#endif /* _MACH_MACHINE_KERN_RETURN_H_ */
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/kern_return.h" 3 4
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/kern_return.h" 2 3 4

#define KERN_SUCCESS			0

#define KERN_INVALID_ADDRESS		1
		/* Specified address is not currently valid.
		 */

#define KERN_PROTECTION_FAILURE		2
		/* Specified memory is valid, but does not permit the
		 * required forms of access.
		 */

#endif	/* _MACH_KERN_RETURN_H_ */
# 327 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/kern_return.h" 3 4
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/std_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/port.h" 1 3 4
 *	and the various rights associated with them.  For more info see:
 *
 *	<mach/mach_port.h> - manipulation of port rights in a given space
 *	<mach/message.h> - message queue [and port right passing] mechanism
 *
 */

#ifndef	_MACH_PORT_H_
#define _MACH_PORT_H_

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/port.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 91 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/port.h" 3 4
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _MACH_MACHINE_VM_TYPES_H_
#define _MACH_MACHINE_VM_TYPES_H_

#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "mach/arm/vm_types.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_types.h" 1 3 4
/*

/*
 *	File:	vm_types.h
 *	Author:	Avadis Tevanian, Jr.
 *	Date: 1985
 *
 *	Header file for VM data types.  ARM version.
 */

#ifndef	_MACH_ARM_VM_TYPES_H_
#define _MACH_ARM_VM_TYPES_H_

#ifndef	ASSEMBLER

#if 0 /* expanded by -frewrite-includes */
#include <arm/_types.h>
#endif /* expanded by -frewrite-includes */
# 49 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 50 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 51 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_types.h" 3 4

/*
 * natural_t and integer_t are Mach's legacy types for machine-
 * independent integer types (unsigned, and signed, respectively).
 * Their original purpose was to define other types in a machine/
 * compiler independent way.
 * A vm_offset_t is a type-neutral pointer,
 * e.g. an offset into a virtual memory space.
 */
#ifdef __LP64__
typedef uintptr_t		vm_offset_t;
typedef uintptr_t		vm_size_t;

typedef uint64_t		mach_vm_address_t;
typedef uint64_t		mach_vm_offset_t;
typedef uint64_t		mach_vm_size_t;

typedef uint64_t		vm_map_offset_t;
typedef uint64_t		vm_map_address_t;
typedef uint64_t		vm_map_size_t;
#else
# 88 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_types.h" 3 4
typedef	natural_t		vm_offset_t;
/*
 * A vm_size_t is the proper type for e.g.
 * expressing the difference between two
 * vm_offset_t entities.
 */
typedef	natural_t		vm_size_t;

/*
 * This new type is independent of a particular vm map's
 * implementation size - and represents appropriate types
 * for all possible maps.  This is used for interfaces
 * where the size of the map is not known - or we don't
 * want to have to distinguish.
 */
#if defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0)
typedef uint32_t		mach_vm_address_t;
typedef uint32_t		mach_vm_offset_t;
typedef uint32_t		mach_vm_size_t;
#else
# 108 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_types.h" 3 4
typedef uint64_t		mach_vm_address_t;
typedef uint64_t		mach_vm_offset_t;
typedef uint64_t		mach_vm_size_t;
#endif
# 112 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_types.h" 3 4

typedef uint32_t		vm_map_offset_t;
typedef uint32_t		vm_map_address_t;
typedef uint32_t		vm_map_size_t;
#endif /* __LP64__ */
# 117 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_types.h" 3 4


typedef uint32_t		vm32_offset_t;
typedef uint32_t		vm32_address_t;
typedef uint32_t		vm32_size_t;

typedef vm_offset_t		mach_port_context_t;


#endif	/* ASSEMBLER */
# 127 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_types.h" 3 4

/*
 * If composing messages by hand (please do not)
 */
#define	MACH_MSG_TYPE_INTEGER_T	MACH_MSG_TYPE_INTEGER_32

#endif	/* _MACH_ARM_VM_TYPES_H_ */
# 134 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_types.h" 3 4
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/vm_types.h" 2 3 4
#else
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/vm_types.h" 3 4
#error architecture not supported
#endif
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/vm_types.h" 3 4

#endif /* _MACH_MACHINE_VM_TYPES_H_ */
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/vm_types.h" 3 4
# 93 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/port.h" 2 3 4

/*
 *	mach_port_name_t - the local identity for a Mach port
 *	The dividing line between the constituent parts is exposed so
 *	that efficient "mach_port_name_t to data structure pointer"
 *	conversion implementation can be made.  But it is possible
 *	for user-level code to assign their own names to Mach ports.
 *	These are not required to participate in this algorithm.  So
 *	care should be taken before "assuming" this model.
 *
 */

#ifndef	NO_PORT_GEN

#define	MACH_PORT_INDEX(name)		((name) >> 8)
#define	MACH_PORT_GEN(name)		(((name) & 0xff) << 24)
#define	MACH_PORT_MAKE(index, gen)	\
		(((index) << 8) | (gen) >> 24)

#else	/* NO_PORT_GEN */
# 170 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/port.h" 3 4

#define	MACH_PORT_INDEX(name)		(name)
#define	MACH_PORT_GEN(name)		(0)
#define	MACH_PORT_MAKE(index, gen)	(index)

#endif	/* NO_PORT_GEN */
# 176 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/port.h" 3 4


/*
 *  These are the different rights a task may have for a port.
 *  The MACH_PORT_RIGHT_* definitions are used as arguments
 *  to mach_port_allocate, mach_port_get_refs, etc, to specify
 *  a particular right to act upon.  The mach_port_names and
typedef mach_port_t		port_t;
typedef mach_port_name_t	port_name_t;
typedef mach_port_name_t	*port_name_array_t;

#define PORT_NULL		((port_t) 0)
#define PORT_DEAD		((port_t) ~0)
#define PORT_VALID(name) \
		((port_t)(name) != PORT_NULL && (port_t)(name) != PORT_DEAD)

#endif	/* !__DARWIN_UNIX03 && !_NO_PORT_T_FROM_MACH */
# 380 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/port.h" 3 4

#endif	/* _MACH_PORT_H_ */
# 382 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/port.h" 3 4
# 70 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/std_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_types.h" 1 3 4
/*
 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 */
#ifndef	_MACH_VM_TYPES_H_
#define _MACH_VM_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_types.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_types.h" 3 4

typedef vm_offset_t     	pointer_t;
typedef vm_offset_t     	vm_address_t;

/*

#define VM_MAP_NULL		((vm_map_t) 0)

/*
 * Evolving definitions, likely to change.
 */

typedef uint64_t		vm_object_offset_t;
typedef uint64_t		vm_object_size_t;


typedef mach_port_t		upl_t;
typedef mach_port_t		vm_named_entry_t;


#define UPL_NULL		((upl_t) 0)
#define VM_NAMED_ENTRY_NULL	((vm_named_entry_t) 0)

#endif	/* _MACH_VM_TYPES_H_ */
# 94 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_types.h" 3 4
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/std_types.h" 2 3 4

#endif	/* _MACH_STD_TYPES_H_ */
# 73 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/std_types.h" 3 4
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 1 3 4
/*
 * Copyright (c) 2000-2010 Apple Computer, Inc. All rights reserved.
 *	File:	mach/mach_types.h
 *	Author:	Avadis Tevanian, Jr., Michael Wayne Young
 *	Date:	1986
 *
 *	Mach external interface definitions.
 *
 */

#ifndef	_MACH_MACH_TYPES_H_
#define _MACH_MACH_TYPES_H_
#ifndef	_MACH_HOST_INFO_H_
#define	_MACH_HOST_INFO_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/message.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/message.h" 1 3 4
/*
 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
/*
 * Version 2.0.
 * Copyright (c) 2005 SPARTA, Inc.
 */
/*
 */
/*
 *	File:	mach/message.h
 *
 *	Mach IPC message and primitive function definitions.
 */

#ifndef	_MACH_MESSAGE_H_
#define _MACH_MESSAGE_H_
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_statistics.h" 1 3 4
/*
 * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 * 
 *	Virtual memory statistics structure.
 *
 */

#ifndef	_MACH_VM_STATISTICS_H_
#define	_MACH_VM_STATISTICS_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 70 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_statistics.h" 3 4


/*
 * vm_statistics
 *
# 414 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_statistics.h" 3 4
# 70 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_info.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 */

#ifndef	_MACH_MACHINE_H_
#define _MACH_MACHINE_H_

#ifndef __ASSEMBLER__

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/boolean.h>
#endif /* expanded by -frewrite-includes */
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine.h" 3 4

typedef integer_t	cpu_type_t;
typedef integer_t	cpu_subtype_t;
typedef integer_t	cpu_threadtype_t;

#define CPU_STATE_MAX		4

#define CPU_STATE_USER		0
#define CPU_STATE_SYSTEM	1
#define CPU_STATE_IDLE		2
#define CPU_STATE_NICE		3


#endif /* !__ASSEMBLER__ */
# 327 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine.h" 3 4

/*
 *	CPU families (sysctl hw.cpufamily)
 *
 * These are meant to identify the CPU's marketing name - an
 * application can map these to (possibly) localized strings.
 * NB: the encodings of the CPU families are intentionally arbitrary.
 * There is no ordering, and you should never try to deduce whether
 * or not some feature is available based on the family.
 * Use feature flags (eg, hw.optional.altivec) to test for optional
 * functionality.
 */
#define CPUFAMILY_UNKNOWN   		0
#define CPUFAMILY_POWERPC_G3		0xcee41549

#endif	/* _MACH_MACHINE_H_ */
# 375 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine.h" 3 4
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_info.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 72 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_info.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/time_value.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/time_value.h" 1 3 4
/*
 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */

#ifndef	_MACH_TIME_VALUE_H_
#define	_MACH_TIME_VALUE_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 61 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/time_value.h" 3 4

/*
 *	Time value returned by kernel.
 */
		>= TIME_MICROS_MAX) {			\
	    (val)->microseconds -= TIME_MICROS_MAX;	\
	    (val)->seconds++;				\
	}						\
}

#define	time_value_add(result, addend)		{		\
	(result)->microseconds += (addend)->microseconds;	\
	(result)->seconds += (addend)->seconds;			\
	if ((result)->microseconds >= TIME_MICROS_MAX) {	\
	    (result)->microseconds -= TIME_MICROS_MAX;		\
	    (result)->seconds++;				\
	}							\
}

#endif	/* _MACH_TIME_VALUE_H_ */
	(host_set_special_port((host), HOST_COALITION_PORT, (port)))

#endif	/* _MACH_HOST_SPECIAL_PORTS_H_ */
# 209 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_special_ports.h" 3 4
# 83 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 2 3 4
 *  Pittsburgh PA 15213-3890
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */
/*
 */
/*
 *	File:	memory_object.h
 *	Author:	Michael Wayne Young
 *
 *	External memory management interface definition.
 */

#ifndef	_MACH_MEMORY_OBJECT_TYPES_H_
#define _MACH_MEMORY_OBJECT_TYPES_H_

/*
 *	User-visible types used in the external memory
 *	management interface:
 */

#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
# 74 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/memory_object_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/message.h>
#endif /* expanded by -frewrite-includes */
# 75 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/memory_object_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_prot.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_prot.h" 1 3 4
/*
 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
/*
 *	Author:	Avadis Tevanian, Jr., Michael Wayne Young
 *
 *	Virtual memory protection definitions.
 *
 */

#ifndef	_MACH_VM_PROT_H_
#define	_MACH_VM_PROT_H_

/*
 *	Types defined:
 *
 *	vm_prot_t		VM protection values.
 *	against the actual protection bits of the map entry.
 */
#define VM_PROT_IS_MASK		((vm_prot_t) 0x40)

#endif	/* _MACH_VM_PROT_H_ */
# 141 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_prot.h" 3 4
# 76 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/memory_object_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_sync.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_sync.h" 1 3 4
/*
 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */
/*
 *	File:	mach/vm_sync.h
 *
 *	Virtual memory synchronisation definitions.
 *
 */

#ifndef _MACH_VM_SYNC_H_
#define _MACH_VM_SYNC_H_

typedef unsigned		vm_sync_t;

/*
 *	Synchronization flags, defined as bits within the vm_sync_t type
 */

#define	VM_SYNC_ASYNCHRONOUS	((vm_sync_t) 0x01)
#define	VM_SYNC_SYNCHRONOUS	((vm_sync_t) 0x02)
#define VM_SYNC_INVALIDATE	((vm_sync_t) 0x04)
#define VM_SYNC_KILLPAGES       ((vm_sync_t) 0x08)
#define VM_SYNC_DEACTIVATE      ((vm_sync_t) 0x10)
#define VM_SYNC_CONTIGUOUS      ((vm_sync_t) 0x20)
#define VM_SYNC_REUSABLEPAGES	((vm_sync_t) 0x40)

#endif  /* _MACH_VM_SYNC_H_ */
# 81 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_sync.h" 3 4
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/memory_object_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/memory_object_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 79 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/memory_object_types.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 81 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/memory_object_types.h" 3 4

#define VM_64_BIT_DATA_OBJECTS

typedef unsigned long long	memory_object_offset_t;
#define	EXC_SOFT_SIGNAL		0x10003	/* Unix signal exceptions */

#define	EXC_MACF_MIN		0x20000 /* MACF exceptions */
#define	EXC_MACF_MAX		0x2FFFF

#ifndef	ASSEMBLER

#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
# 173 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/exception_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/thread_status.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_status.h" 1 3 4
/*
 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
 */

#ifndef	_MACH_THREAD_STATUS_H_
#define	_MACH_THREAD_STATUS_H_

/*
 *	The actual structure that comprises the thread state is defined
 *	in the machine dependent module.
 */
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 76 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_status.h" 3 4

#ifndef _MACH_MACHINE_THREAD_STATUS_H_
#define _MACH_MACHINE_THREAD_STATUS_H_

#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "mach/arm/thread_status.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/thread_status.h" 1 3 4
/*
 * Copyright (c) 2007 Apple Inc. All rights reserved.
 */
/*
 * FILE_ID: thread_status.h
 */


#ifndef _ARM_THREAD_STATUS_H_
#define _ARM_THREAD_STATUS_H_
#endif    /* _ARM_THREAD_STATUS_H_ */
# 146 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/thread_status.h" 3 4
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/thread_status.h" 2 3 4
#else
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/thread_status.h" 3 4
#error architecture not supported
#endif
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/thread_status.h" 3 4

#endif /* _MACH_MACHINE_THREAD_STATUS_H_ */
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/thread_status.h" 3 4
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_status.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/thread_state.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/thread_state.h" 1 3 4
 *	Generic definition for machine-dependent thread status.
 */

typedef	natural_t	*thread_state_t;	/* Variable-length array */

/* THREAD_STATE_MAX is now defined in <mach/machine/thread_state.h> */
typedef	natural_t	thread_state_data_t[THREAD_STATE_MAX];

#define	THREAD_STATE_FLAVOR_LIST	0	/* List of valid flavors */
#define THREAD_STATE_FLAVOR_LIST_NEW	128
#define THREAD_STATE_FLAVOR_LIST_10_9	129

typedef	int			thread_state_flavor_t;
typedef thread_state_flavor_t	*thread_state_flavor_array_t;

#endif	/* _MACH_THREAD_STATUS_H_ */
typedef	unsigned int			exception_mask_t;
typedef	exception_mask_t		*exception_mask_array_t;
typedef exception_behavior_t		*exception_behavior_array_t;
typedef thread_state_flavor_t		*exception_flavor_array_t;
typedef mach_port_t			*exception_port_array_t;
typedef	mach_exception_data_type_t	mach_exception_code_t;
typedef	mach_exception_data_type_t	mach_exception_subcode_t;

#endif	/* ASSEMBLER */
# 194 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/exception_types.h" 3 4

#endif	/* _MACH_EXCEPTION_TYPES_H_ */
# 196 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/exception_types.h" 3 4
# 88 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
# 89 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_voucher_types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_voucher_types.h" 1 3 4
/*
 * Copyright (c) 2013 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 */

#ifndef	_MACH_VOUCHER_TYPES_H_
#define	_MACH_VOUCHER_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/std_types.h>
#endif /* expanded by -frewrite-includes */
typedef uint32_t mach_voucher_attr_value_reference_t;

/* USE - TBD */
typedef uint32_t mach_voucher_attr_control_flags_t;
#define MACH_VOUCHER_ATTR_CONTROL_FLAGS_NONE 	((mach_voucher_attr_control_flags_t)0)

/*
 * Commands and types for the IPC Importance Attribute Manager
 *
 * These are the valid mach_voucher_attr_command() options with the 
 * MACH_VOUCHER_ATTR_KEY_IMPORTANCE key.
 */
#define MACH_VOUCHER_IMPORTANCE_ATTR_ADD_EXTERNAL       1  /* Add some number of external refs (not supported) */
#define MACH_VOUCHER_IMPORTANCE_ATTR_DROP_EXTERNAL      2  /* Drop some number of external refs */
typedef uint32_t mach_voucher_attr_importance_refs;

#endif	/* _MACH_VOUCHER_TYPES_H_ */
# 232 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_voucher_types.h" 3 4
# 90 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/processor_info.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_info.h" 1 3 4
/*
 */

#ifndef	_MACH_PROCESSOR_INFO_H_
#define _MACH_PROCESSOR_INFO_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/message.h>
#endif /* expanded by -frewrite-includes */
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_info.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine.h>
#endif /* expanded by -frewrite-includes */
# 72 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_info.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/processor_info.h>
#endif /* expanded by -frewrite-includes */
#define PROCESSOR_SET_LOAD_INFO_COUNT	((mach_msg_type_number_t) \
                (sizeof(processor_set_load_info_data_t)/sizeof(natural_t)))


#endif	/* _MACH_PROCESSOR_INFO_H_ */
# 154 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_info.h" 3 4
# 91 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/task_info.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task_info.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */
/*
 *	Machine-independent task information structures and definitions.
 *
 *	The definitions in this file are exported to the user.  The kernel
 *	will translate its internal data structures to these structures
 *	as appropriate.
 *
 */

#ifndef	_MACH_TASK_INFO_H_
#define	_MACH_TASK_INFO_H_

#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 74 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task_info.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 76 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task_info.h" 3 4

/*
 *	Generic information structure to allow for expansion.
 */
typedef	natural_t	task_flavor_t;
typedef	integer_t	*task_info_t;		/* varying array of int */

/* Deprecated, use per structure _data_t's instead */

#pragma pack()

#endif	/* _MACH_TASK_INFO_H_ */
# 432 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task_info.h" 3 4
# 92 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/task_policy.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task_policy.h" 1 3 4
/*
 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _MACH_TASK_POLICY_H_
#define _MACH_TASK_POLICY_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_types.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 1 3 4
/*
	THROUGHPUT_QOS_TIER_2 = ((0xFE<<16) | 3),
	THROUGHPUT_QOS_TIER_3 = ((0xFE<<16) | 4),
	(sizeof (struct task_qos_policy) / sizeof (integer_t)))

/* These should be removed - they belong in proc_info.h */
#define PROC_FLAG_DARWINBG           0x8000    /* process in darwin background */
#define PROC_FLAG_EXT_DARWINBG		 0x10000   /* process in darwin background - external enforcement */
#define PROC_FLAG_IOS_APPLEDAEMON    0x20000   /* process is apple ios daemon */
#define PROC_FLAG_IOS_IMPPROMOTION   0x80000   /* process is apple ios daemon */
#define PROC_FLAG_ADAPTIVE           0x100000  /* Process is adaptive */
#define PROC_FLAG_ADAPTIVE_IMPORTANT 0x200000  /* Process is adaptive, and is currently important */
#define PROC_FLAG_IMPORTANCE_DONOR   0x400000  /* Process is marked as an importance donor */
#define PROC_FLAG_SUPPRESSED         0x800000  /* Process is suppressed */
#define PROC_FLAG_APPLICATION        0x1000000 /* Process is an application */
#define PROC_FLAG_IOS_APPLICATION PROC_FLAG_APPLICATION /* Process is an application */




#endif	/* _MACH_TASK_POLICY_H_ */
# 190 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task_policy.h" 3 4
# 93 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/task_special_ports.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task_special_ports.h" 1 3 4
/*
 * Copyright (c) 2000-2010 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 *
 *	Thread information structure and definitions.
 *
 *	The defintions in this file are exported to the user.  The kernel
 *	will translate its internal data structures to these structures
 *	as appropriate.
 *
 */

#ifndef	_MACH_THREAD_INFO_H_
#define _MACH_THREAD_INFO_H_
/*
 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
 * support for mandatory and extensible security protections.  This notice
 * is included in support of clause 2.2 (b) of the Apple Public License,
 * Version 2.0.
 */
/*
 *	File:	mach/mach_types.h
 *	Author:	Avadis Tevanian, Jr., Michael Wayne Young
 *	Date:	1986
 *
 *	Mach external interface definitions.
 *
 */

#ifndef	_MACH_MACH_TYPES_H_
#define _MACH_MACH_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 79 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <mach/host_info.h>
#endif /* expanded by -frewrite-includes */
# 81 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/host_notify.h>
#endif /* expanded by -frewrite-includes */
# 82 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/message.h>
#endif /* expanded by -frewrite-includes */
# 87 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/exception_types.h>
#endif /* expanded by -frewrite-includes */
# 88 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#include <mach/thread_special_ports.h>
#endif /* expanded by -frewrite-includes */
# 97 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/thread_status.h>
#endif /* expanded by -frewrite-includes */
# 98 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_purgable.h>
#endif /* expanded by -frewrite-includes */
# 103 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_behavior.h>
#endif /* expanded by -frewrite-includes */
# 104 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
# 238 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4

#endif	/* _MACH_MACH_TYPES_H_ */
# 240 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_policy.h" 2 3 4

/*
 * These are the calls for accessing the policy parameters
typedef integer_t	*thread_policy_t;

/*
kern_return_t	thread_policy_set(
					thread_t					thread,
					thread_policy_flavor_t		flavor,
					thread_policy_t				policy_info,
typedef struct thread_affinity_policy		thread_affinity_policy_data_t;
typedef struct thread_affinity_policy		*thread_affinity_policy_t;

#define THREAD_AFFINITY_POLICY_COUNT	((mach_msg_type_number_t) \
	(sizeof (thread_affinity_policy_data_t) / sizeof (integer_t)))

/*
 * THREAD_BACKGROUND_POLICY:
 */

#define THREAD_BACKGROUND_POLICY	5

#define thread_get_kernel_port(thread, port)	\
		(thread_get_special_port((thread), THREAD_KERNEL_PORT, (port)))

#define thread_set_kernel_port(thread, port)	\
		(thread_set_special_port((thread), THREAD_KERNEL_PORT, (port)))

#endif	/* _MACH_THREAD_SPECIAL_PORTS_H_ */
# 84 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_special_ports.h" 3 4
# 97 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/thread_status.h>
#endif /* expanded by -frewrite-includes */
# 98 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4

#ifndef	_MACH_CLOCK_TYPES_H_
#define	_MACH_CLOCK_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/time_value.h>
#endif /* expanded by -frewrite-includes */
# 47 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_types.h" 3 4

/*
 * Type definitions.
 */
typedef	int	alarm_type_t;		/* alarm time type */
typedef int	sleep_type_t;		/* sleep time type */
typedef	int	clock_id_t;			/* clock identification type */
typedef int	clock_flavor_t;		/* clock flavor type */

/*
 * Alarm parameter defines.
 */
#define ALRMTYPE			0xff		/* type (8-bit field)	*/
#define TIME_ABSOLUTE		0x00		/* absolute time */
#define	TIME_RELATIVE		0x01		/* relative time */

#define BAD_ALRMTYPE(t)		(((t) &~ TIME_RELATIVE) != 0)

#endif /* _MACH_CLOCK_TYPES_H_ */
# 128 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_types.h" 3 4
 *	File:	mach/vm_attributes.h
 *	Author:	Alessandro Forin
 *
 *	Virtual memory attributes definitions.
 *
 *	These definitions are in addition to the machine-independent
 *	ones (e.g. protection), and are only selectively supported
 *	on specific machine architectures.
 *
 */

#ifndef	_MACH_VM_ATTRIBUTES_H_
#define	_MACH_VM_ATTRIBUTES_H_

/*
 *	Types of machine-dependent attributes
#define MATTR_VAL_CACHE_FLUSH	6	/* flush from all caches */
#define MATTR_VAL_DCACHE_FLUSH	7	/* flush from data caches */
#define MATTR_VAL_ICACHE_FLUSH	8	/* flush from instruction caches */
#define MATTR_VAL_CACHE_SYNC	9	/* sync I+D caches */
#define MATTR_VAL_CACHE_SYNC	9	/* sync I+D caches */

#define MATTR_VAL_GET_INFO	10	/* get page info (stats) */

#endif	/* _MACH_VM_ATTRIBUTES_H_ */
# 100 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_attributes.h" 3 4
# 101 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_inherit.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_inherit.h" 1 3 4
/*
 * Objects that have been used and are cached for reuse (backward cached) should be queued FIFO.
 * Every user of purgeable memory is entitled to using the highest volatile group (7).
 * Only if a client wants some of its objects to definitely be purged earlier, it can put those in
 * another group. This could be used to make all FIFO objects (in the lower group) go away before 
 * any LIFO objects (in the higher group) go away.
 * Objects that should not get any chance to stay around can be marked as "obsolete". They will
 * be emptied before any other objects or pages are reclaimed. Obsolete objects are not emptied
 * in any particular order.
 * 'purgeable' is recognized as the correct spelling. For historical reasons, definitions 
 * in this file are spelled 'purgable'.
 */

#ifndef	_MACH_VM_PURGABLE_H_
#define	_MACH_VM_PURGABLE_H_

/*
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_behavior.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_behavior.h" 1 3 4
/*
 * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
#define VM_BEHAVIOR_CAN_REUSE	((vm_behavior_t) 10)

#endif	/*_MACH_VM_BEHAVIOR_H_*/
# 79 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_behavior.h" 3 4
# 104 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_prot.h>
#endif /* expanded by -frewrite-includes */
# 105 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_statistics.h>
#endif /* expanded by -frewrite-includes */
# 106 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_sync.h>
#endif /* expanded by -frewrite-includes */
# 107 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 108 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_region.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_region.h" 1 3 4
/*
 * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
 *
 *
 */

#ifndef	_MACH_VM_REGION_H_
#define _MACH_VM_REGION_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/boolean.h>
#endif /* expanded by -frewrite-includes */
# 42 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_region.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_prot.h>
#endif /* expanded by -frewrite-includes */
# 43 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_region.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_inherit.h>
#endif /* expanded by -frewrite-includes */
# 44 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_region.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_behavior.h>
#endif /* expanded by -frewrite-includes */
# 45 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_region.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_region.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/message.h>
#endif /* expanded by -frewrite-includes */
# 47 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_region.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_param.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/vm_param.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _MACH_MACHINE_VM_PARAM_H_
#define _MACH_MACHINE_VM_PARAM_H_

#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "mach/arm/vm_param.h"
#if !defined (KERNEL) && !defined (__ASSEMBLER__)
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_page_size.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_page_size.h" 1 3 4
/*
 * Copyright (c) 2013 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 *
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
 * terms of an Apple operating system software license agreement.
 *
 * Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this file.
 *
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _VM_PAGE_SIZE_H_
#define _VM_PAGE_SIZE_H_

#if 0 /* expanded by -frewrite-includes */
#include <Availability.h>
#endif /* expanded by -frewrite-includes */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_page_size.h" 3 4
 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
 * support for mandatory and extensible security protections.  This notice
 * is included in support of clause 2.2 (b) of the Apple Public License,
 * Version 2.0.
 */
/*
 *	File:	mach/mach_types.h
 *	Author:	Avadis Tevanian, Jr., Michael Wayne Young
 *	Date:	1986
 *
 *	Mach external interface definitions.
 *
 */

#ifndef	_MACH_MACH_TYPES_H_
#define _MACH_MACH_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
typedef int64_t 		ledger_amount_t;
#define LEDGER_LIMIT_INFINITY   ((ledger_amount_t)((1ULL << 63) - 1))

typedef mach_vm_offset_t	*emulation_vector_t;
typedef char			*user_subsystem_t;

typedef char			*labelstr_t;
/*
 *	Backwards compatibility, for those programs written
 *	before mach/{std,mach}_types.{defs,h} were set up.
 */
#if 0 /* expanded by -frewrite-includes */
#include <mach/std_types.h>
#endif /* expanded by -frewrite-includes */
# 238 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4

#endif	/* _MACH_MACH_TYPES_H_ */
# 240 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_page_size.h" 2 3 4
 *	These macros assume vm_page_size is a power-of-2.
 */
#define trunc_page(x)	((x) & (~(vm_page_size - 1)))
#define round_page(x)	trunc_page((x) + (vm_page_size - 1))

/*


#define PAGE_MAX_SHIFT		14
#define PAGE_MAX_SIZE		(1 << PAGE_MAX_SHIFT)
#define PAGE_MAX_MASK		(PAGE_MAX_SIZE-1)

#define PAGE_MIN_SHIFT		12
#define PAGE_MIN_SIZE		(1 << PAGE_MIN_SHIFT)
#define PAGE_MIN_MASK		(PAGE_MIN_SIZE-1)

#define VM_MAX_ADDRESS		((vm_address_t) 0x0000000080000000ULL)

/* system-wide values */
#define MACH_VM_MIN_ADDRESS	((mach_vm_offset_t) 0x0ULL)
#define MACH_VM_MAX_ADDRESS	((mach_vm_offset_t) 0x00000001A0000000ULL)

#else
# 61 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_param.h" 3 4
#error architecture not supported
#endif
# 63 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_param.h" 3 4

#define VM_MAP_MIN_ADDRESS      VM_MIN_ADDRESS
#define VM_MAP_MAX_ADDRESS      VM_MAX_ADDRESS


#endif	/* !__ASSEMBLER__ */
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_param.h" 3 4

#define SWI_SYSCALL	0x80

#endif	/* _MACH_ARM_VM_PARAM_H_ */
# 73 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/vm_param.h" 3 4
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/vm_param.h" 2 3 4
#else
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/vm_param.h" 3 4
#error architecture not supported
#endif
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/vm_param.h" 3 4

#endif /* _MACH_MACHINE_VM_PARAM_H_ */
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/vm_param.h" 3 4
# 48 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_region.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_types.h>
#endif /* expanded by -frewrite-includes */
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/kmod.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 */
/*
 * NOTICE: This file was modified by SPARTA, Inc. in 2005 to introduce
 * support for mandatory and extensible security protections.  This notice
 * is included in support of clause 2.2 (b) of the Apple Public License,
 * Version 2.0.
 */

#ifndef    _MACH_KMOD_H_
#define    _MACH_KMOD_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/kern_return.h>
 */
typedef processor_set_t		processor_set_name_t;

#if 0 /* expanded by -frewrite-includes */
#include <mach/std_types.h>
#endif /* expanded by -frewrite-includes */
# 238 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4

#endif	/* _MACH_MACH_TYPES_H_ */
# 240 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 3 4
# 40 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/kmod.h" 2 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 42 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/kmod.h" 3 4

__BEGIN_DECLS



#if PRAGMA_MARK
#pragma mark Obsolete kmod stuff
#endif
# 171 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/kmod.h" 3 4
/***********************************************************************
* These 3 should be dropped but they're referenced by MIG declarations.
***********************************************************************/
typedef void * kmod_args_t;
typedef int kmod_control_flavor_t;
typedef kmod_info_t * kmod_info_array_t;

__END_DECLS

#endif    /* _MACH_KMOD_H_ */
# 181 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/kmod.h" 3 4
# 110 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_types.h" 2 3 4


/*
 * If we are not in the kernel, then these will all be represented by
 * ports at user-space.
 */
typedef mach_port_t		task_t;
typedef mach_port_t		task_name_t;
typedef mach_port_t		task_suspension_token_t;
typedef mach_port_t		thread_t;
typedef	mach_port_t		thread_act_t;
typedef mach_port_t		ipc_space_t;
typedef mach_port_t		coalition_t;
#endif /* expanded by -frewrite-includes */
/*
 * This file represents the interfaces that used to come
 * from creating the user headers from the mach.defs file.
 * Because mach.defs was decomposed, this file now just
 * wraps up all the new interface headers generated from
 * each of the new .defs resulting from that decomposition.
 */
#ifndef	_MACH_INTERFACE_H_
#define _MACH_INTERFACE_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/clock_priv.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 1 3 4
#ifndef	_clock_priv_user_
#define	_clock_priv_user_
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
/*
 * @OSF_COPYRIGHT@
 */

#ifndef _MACH_NDR_H_
#define _MACH_NDR_H_
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _OS_OSBYTEORDER_H
#define _OS_OSBYTEORDER_H

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <libkern/_OSByteOrder.h>
#endif /* expanded by -frewrite-includes */
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4

/* Macros for swapping constant values in the preprocessing stage. */
#define OSSwapConstInt16(x)	__DARWIN_OSSwapConstInt16(x)
#define OSSwapConstInt32(x)	__DARWIN_OSSwapConstInt32(x)
#define OSSwapConstInt64(x)	__DARWIN_OSSwapConstInt64(x)

#if defined(__GNUC__)

#if   defined (__arm__) || defined(__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include <libkern/arm/OSByteOrder.h>
#endif /* expanded by -frewrite-includes */
# 44 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4
#else
# 45 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <libkern/machine/OSByteOrder.h>
#endif /* expanded by -frewrite-includes */
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4
#endif
# 47 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4

#else /* ! __GNUC__ */
# 49 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <libkern/machine/OSByteOrder.h>
#endif /* expanded by -frewrite-includes */
# 51 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4

#endif /* __GNUC__ */
# 53 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4

#define OSSwapInt16(x)	__DARWIN_OSSwapInt16(x)
#define OSSwapInt32(x)	__DARWIN_OSSwapInt32(x)
#define OSSwapInt64(x)	__DARWIN_OSSwapInt64(x)

enum {
    OSUnknownByteOrder,
    OSLittleEndian,
    OSBigEndian
#if		defined(__BIG_ENDIAN__)

/* Functions for loading big endian to host endianess. */

#define OSReadBigInt16(base, byteOffset) _OSReadInt16(base, byteOffset)
#define OSReadBigInt32(base, byteOffset) _OSReadInt32(base, byteOffset)
#define OSSwapLittleToHostInt64(x) ((uint64_t)(x))

#else
# 301 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4
#error Unknown endianess.
#endif
# 303 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4

#endif /* ! _OS_OSBYTEORDER_H */
# 305 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/libkern/OSByteOrder.h" 3 4


# 38 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/ndr.h" 2 3 4


typedef struct {
 * NDR 2.0 format flag type definition and values.
 */
#define  NDR_INT_BIG_ENDIAN    0
#define  NDR_INT_LITTLE_ENDIAN 1
#define  NDR_FLOAT_IEEE        0
#define  NDR_FLOAT_VAX         1
#define  NDR_FLOAT_CRAY        2
#define  NDR_FLOAT_IBM         3
#define  NDR_CHAR_ASCII        0
#define  NDR_CHAR_EBCDIC       1

extern NDR_record_t NDR_record;

/* NDR conversion off by default */

#if !defined(__NDR_convert__)

#if __NDR_convert__int_rep__

#define __NDR_READSWAP_assign(a, rs)	do { *(a) = rs(a); } while (0)

#define __NDR_READSWAP__uint16_t(a) 	OSReadSwapInt16((void *)a, 0)
#define __NDR_READSWAP__int16_t(a)	(int16_t)OSReadSwapInt16((void *)a, 0)
#define __NDR_READSWAP__uint32_t(a) 	OSReadSwapInt32((void *)a, 0)
#define __NDR_READSWAP__int32_t(a)	(int32_t)OSReadSwapInt32((void *)a, 0)
#define __NDR_READSWAP__uint64_t(a)	OSReadSwapInt64((void *)a, 0)
#define __NDR_READSWAP__int64_t(a)	(int64_t)OSReadSwapInt64((void *)a, 0)

__BEGIN_DECLS

static __inline__ float __NDR_READSWAP__float(float *argp) {
	union {

#warning  NDR floating point representation conversions not implemented yet!
#define __NDR_convert__float_rep__float(v,f)	__NDR_convert__NOOP
#define __NDR_convert__float_rep__double(v,f)	__NDR_convert__NOOP

#endif /* __NDR_convert__float_rep__ */
# 200 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/ndr.h" 3 4

#endif /* __NDR_convert__ */
# 202 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/ndr.h" 3 4

#endif /* _MACH_NDR_H_ */
# 204 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/ndr.h" 3 4
# 8 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/boolean.h>
#endif /* expanded by -frewrite-includes */
# 9 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/kern_return.h>
#endif /* expanded by -frewrite-includes */
# 10 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/notify.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/notify.h" 1 3 4
/*
 * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * Please see the License for the specific language governing rights and
 * limitations under the License.
/*
 */
/*
 *	File:	mach/notify.h
 *
 *	Kernel notification message definitions.
 */

#ifndef	_MACH_NOTIFY_H_
#define _MACH_NOTIFY_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
#define MACH_NOTIFY_PORT_DELETED	(MACH_NOTIFY_FIRST + 001)

#endif	/* _MACH_NOTIFY_H_ */
# 142 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/notify.h" 3 4
# 11 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_types.h>
#endif /* expanded by -frewrite-includes */
# 12 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/message.h>
#endif /* expanded by -frewrite-includes */
# 13 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mig_errors.h>
#endif /* expanded by -frewrite-includes */
#ifndef	_MACH_MIG_ERRORS_H_
#define _MACH_MIG_ERRORS_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/mig.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */
/*
 * @OSF_COPYRIGHT@
 */

/*
 * Mach MIG Subsystem Interfaces
 */

#ifndef	_MACH_MIG_H_
#define _MACH_MIG_H_

#if 0 /* expanded by -frewrite-includes */

#elif !defined(__MigTypeCheck)
# 57 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig.h" 3 4

#if defined(TypeCheck)
/* use legacy setting (temporary) */
#define __MigTypeCheck TypeCheck
#else
# 62 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig.h" 3 4
/* default MIG type checking on */
#define __MigTypeCheck 1
#endif
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig.h" 3 4

#endif /* !defined(MACH_KERNEL) && !defined(__MigTypeCheck) */
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig.h" 3 4

/*
extern mach_port_t mig_get_reply_port(void);

/* Client side reply port deallocate */
extern void mig_dealloc_reply_port(mach_port_t reply_port);

/* Client side reply port "deallocation" */
extern void mig_put_reply_port(mach_port_t reply_port);

/* Bounded string copy */
extern int mig_strncpy(char	*dest, const char *src,	int	len);


/* Allocate memory for out-of-line mig structures */
extern void mig_allocate(vm_address_t *, vm_size_t);

/* Deallocate memory used for out-of-line mig structures */
extern void mig_deallocate(vm_address_t, vm_size_t);


__END_DECLS

#endif	/* _MACH_MIG_H_ */
# 169 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig.h" 3 4
# 67 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig_errors.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/ndr.h>
#endif /* expanded by -frewrite-includes */
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig_errors.h" 3 4
#define MIG_SERVER_DIED		-308	/* server died */
#define MIG_TRAILER_ERROR       -309    /* trailer has an unknown format */

/*
 *	Whenever MIG detects an error, it sends back a generic
 *	mig_reply_error_t format message.  Clients must accept
 *	these in addition to the expected reply message format.
 */
#pragma pack(4)
typedef struct {
	mach_msg_header_t	Head;
	NDR_record_t		NDR;
	kern_return_t		RetCode;
} mig_reply_error_t;
#pragma pack()


__BEGIN_DECLS

#if !defined(__NDR_convert__mig_reply_error_t__defined)
#define __NDR_convert__mig_reply_error_t__defined

static __inline__ void
__NDR_convert__mig_reply_error_t(__unused mig_reply_error_t *x)
{
#if defined(__NDR_convert__int_rep__kern_return_t__defined)
	if (x->NDR.int_rep != NDR_record.int_rep)
		__NDR_convert__int_rep__kern_return_t(&x->RetCode, x->NDR.int_rep);
#endif /* __NDR_convert__int_rep__kern_return_t__defined */
# 119 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig_errors.h" 3 4
}
#endif /* !defined(__NDR_convert__mig_reply_error_t__defined) */
# 121 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig_errors.h" 3 4

__END_DECLS

#endif	/* _MACH_MIG_ERRORS_H_ */
# 125 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mig_errors.h" 3 4
# 14 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 3 4

#ifdef AUTOTEST
#ifndef FUNCTION_PTR_T
#define FUNCTION_PTR_T
typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
typedef struct {
        char            *name;
        function_ptr_t  function;
} function_table_entry;
typedef function_table_entry   *function_table_t;
#endif /* FUNCTION_PTR_T */
# 26 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 3 4
#endif /* AUTOTEST */
# 27 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 3 4

#ifndef	clock_priv_MSG_COUNT
#define	clock_priv_MSG_COUNT	2
#endif	/* clock_priv_MSG_COUNT */
# 31 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 3 4
);

__END_DECLS

/********************** Caution **************************/
/* The following data types should be used to calculate  */
/* maximum message sizes only. The actual message may be */
/* smaller, and the position of the arguments within the */
/* message layout may vary from what is presented here.  */
/* For example, if any of the arguments are variable-    */
/* sized, and less than the maximum is sent, the data    */
/* will be packed tight in the actual message to reduce  */
/* the presence of holes.                                */
/********************** Caution **************************/

/* typedefs for all requests */

#ifndef __Request__clock_priv_subsystem__defined
# 142 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/clock_priv.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)

#endif	/* _MACH_DEBUG_IPC_INFO_H_ */
# 117 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/ipc_info.h" 3 4
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/mach_debug_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach_debug/vm_info.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/vm_info.h" 1 3 4
/*
 * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
/*
 *	File:	mach_debug/vm_info.h
 *	Author:	Rich Draves
 *	Date:	March, 1990
 *
 *	Definitions for the VM debugging interface.
 */

#ifndef	_MACH_DEBUG_VM_INFO_H_
#define _MACH_DEBUG_VM_INFO_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/boolean.h>
#endif /* expanded by -frewrite-includes */
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/vm_info.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/vm_info.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_inherit.h>
#endif /* expanded by -frewrite-includes */
# 70 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/vm_info.h" 3 4
	natural_t vio_shadow;		/* shadow object */
	natural_t vio_shadow_offset;	/* offset into shadow object */
	natural_t vio_paging_offset;	/* offset into memory object */
	memory_object_copy_strategy_t vio_copy_strategy;
					/* how to handle data copy */
	vm_offset_t vio_last_alloc;	/* offset of last allocation */
	/* many random attributes */
	unsigned int vio_paging_in_progress;
	boolean_t vio_pager_created;
	boolean_t vio_pager_initialized;
	boolean_t vio_pager_ready;
	boolean_t vio_can_persist;
	boolean_t vio_internal;
	boolean_t vio_temporary;
	boolean_t vio_alive;
	boolean_t vio_purgable;
	boolean_t vio_purgable_volatile;
} vm_info_object_t;

typedef vm_info_object_t *vm_info_object_array_t;

#pragma pack()

#endif	/* _MACH_DEBUG_VM_INFO_H_ */
# 150 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/vm_info.h" 3 4
#ifndef	_MACH_DEBUG_ZONE_INFO_H_
#define _MACH_DEBUG_ZONE_INFO_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/boolean.h>
#endif /* expanded by -frewrite-includes */
# 63 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/zone_info.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/machine/vm_types.h>
#endif /* expanded by -frewrite-includes */
# 64 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/zone_info.h" 3 4

/*
 *	Legacy definitions for host_zone_info().  This interface, and
 *	these definitions have been deprecated in favor of the new
 *	mach_zone_info() inteface and types below.
	uint64_t	tzi_task_free;	/* sum of all frees by this task */
} task_zone_info_t;

typedef task_zone_info_t *task_zone_info_array_t;
#endif	/* _MACH_DEBUG_ZONE_INFO_H_ */
# 137 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/zone_info.h" 3 4
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/mach_debug_types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach_debug/page_info.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/page_info.h" 1 3 4
/*
 * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 

} lockgroup_info_t;

typedef lockgroup_info_t *lockgroup_info_array_t;

#endif	/* _MACH_DEBUG_LOCKGROUP_INFO_H_ */
# 75 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/lockgroup_info.h" 3 4

# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/mach_debug_types.h" 2 3 4

typedef	char	symtab_name_t[32];

#endif	/* _MACH_DEBUG_MACH_DEBUG_TYPES_H_ */
# 75 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach_debug/mach_debug_types.h" 3 4
# 38 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 2 3 4

#ifdef __BeforeMigUserHeader
__BeforeMigUserHeader
#endif /* __BeforeMigUserHeader */
# 42 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 44 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
__BEGIN_DECLS


/* Routine host_get_boot_info */
#ifdef	mig_external
mig_external
#else
#endif	/* mig_external */
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
kern_return_t host_reboot
(
	host_priv_t host_priv,
	int options
);

/* Routine host_priv_statistics */
#ifdef	mig_external
mig_external
#else
# 75 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
extern
#endif	/* mig_external */
# 104 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
kern_return_t vm_wire
(
	host_priv_t host_priv,
	vm_map_t task,
	vm_address_t address,
	vm_size_t size,
	int node,
	int which,
	mach_port_t *port
);

/* Routine host_set_special_port */
#ifdef	mig_external
#else
# 331 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
extern
#endif	/* mig_external */
# 333 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
kern_return_t set_dp_control_port
(
	host_priv_t host,
	mach_port_t control_port
);

/* Routine get_dp_control_port */
#ifdef	mig_external
mig_external
#else
# 343 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
extern
#endif	/* mig_external */
# 345 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
/* sized, and less than the maximum is sent, the data    */
/* will be packed tight in the actual message to reduce  */
/* the presence of holes.                                */
/********************** Caution **************************/

/* typedefs for all requests */

#ifndef __Request__host_priv_subsystem__defined
#define __Request__host_priv_subsystem__defined

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 415 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_port_descriptor_t old_handlerss[32];
		/* end of the kernel processed data */
		NDR_record_t NDR;
		mach_msg_type_number_t masksCnt;
		exception_mask_t masks[32];
		exception_behavior_t old_behaviors[32];
		thread_state_flavor_t old_flavors[32];
	} __Reply__host_swap_exception_ports_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1039 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1043 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__mach_vm_wire_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1051 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1055 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_ool_ports_descriptor_t processor_sets;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		mach_msg_type_number_t processor_setsCnt;
	} __Reply__host_processor_sets_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1067 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4

#ifdef  __MigPackStructs
#endif
# 1111 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__host_set_UNDServer_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1119 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1123 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4
#endif /* !__Reply__host_priv_subsystem__defined */
# 1153 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/host_priv.h" 3 4

/* union of all replies */

#ifndef __ReplyUnion__host_priv_subsystem__defined
#define __ReplyUnion__host_priv_subsystem__defined
union __ReplyUnion__host_priv_subsystem {
	__Reply__host_get_boot_info_t Reply_host_get_boot_info;
	__Reply__host_reboot_t Reply_host_reboot;
	__Reply__host_priv_statistics_t Reply_host_priv_statistics;
	__Reply__host_default_memory_manager_t Reply_host_default_memory_manager;
#endif	/* mig_external */
# 75 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/lock_set.h" 3 4
kern_return_t lock_try
(
);

/* Routine lock_handoff */
#ifdef	mig_external
mig_external
#else
# 97 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/lock_set.h" 3 4
extern
#endif	/* mig_external */
# 99 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/lock_set.h" 3 4
kern_return_t lock_handoff

/* typedefs for all requests */

#ifndef __Request__lock_set_subsystem__defined
#define __Request__lock_set_subsystem__defined

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 138 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/lock_set.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		int lock_id;
	} __Request__lock_acquire_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 146 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/lock_set.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 150 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/lock_set.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		int lock_id;
	} __Request__lock_release_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 158 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/lock_set.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
	__Request__lock_handoff_t Request_lock_handoff;
	__Request__lock_handoff_accept_t Request_lock_handoff_accept;
};
#endif /* !__RequestUnion__lock_set_subsystem__defined */
# 221 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/lock_set.h" 3 4

#endif	 /* _lock_set_user_ */
# 328 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/lock_set.h" 3 4
# 46 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_interface.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/processor.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 1 3 4
#ifndef	_processor_user_
#define	_processor_user_

/* Module processor */

#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 7 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/ndr.h>
#endif /* expanded by -frewrite-includes */
# 8 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/boolean.h>
#endif /* expanded by -frewrite-includes */
# 9 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/kern_return.h>
#endif /* expanded by -frewrite-includes */
# 14 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
#ifdef	mig_external
mig_external
#else
# 86 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
extern
#endif	/* mig_external */
# 88 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
kern_return_t processor_control
(
	processor_t processor,
#ifndef __Request__processor_subsystem__defined
#define __Request__processor_subsystem__defined

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 141 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__processor_start_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 147 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 151 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__processor_exit_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 157 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 161 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		processor_flavor_t flavor;
    { "processor_control", 3003 },\
    { "processor_assign", 3004 },\
    { "processor_get_assignment", 3005 }
#endif
# 332 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4

#ifdef __AfterMigUserHeader
__AfterMigUserHeader
#endif /* __AfterMigUserHeader */
# 336 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4

#endif	 /* _processor_user_ */
# 338 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor.h" 3 4
# 47 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_interface.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/processor_set.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 1 3 4
#ifndef	_processor_set_user_
#define	_processor_set_user_

/* Module processor_set */

#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 7 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/ndr.h>
#ifndef FUNCTION_PTR_T
#define FUNCTION_PTR_T
typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
typedef struct {
        char            *name;
        function_ptr_t  function;
} function_table_entry;
typedef function_table_entry   *function_table_t;
#endif /* FUNCTION_PTR_T */
# 26 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
#endif /* AUTOTEST */
# 27 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4

#ifndef	processor_set_MSG_COUNT
#define	processor_set_MSG_COUNT	10
#endif	/* processor_set_MSG_COUNT */
# 31 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <mach/std_types.h>
#endif /* expanded by -frewrite-includes */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mig.h>
#endif /* expanded by -frewrite-includes */
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mig.h>
#endif /* expanded by -frewrite-includes */
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_types.h>
#endif /* expanded by -frewrite-includes */
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4

#ifdef __BeforeMigUserHeader
__BeforeMigUserHeader
#endif /* __BeforeMigUserHeader */
# 40 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 42 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
__BEGIN_DECLS


/* Routine processor_set_statistics */
#ifdef	mig_external
mig_external
#else
# 63 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
extern
#endif	/* mig_external */
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
kern_return_t processor_set_destroy
(
	processor_set_t set
);

/* Routine processor_set_max_priority */
#ifdef	mig_external
mig_external
#else
#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 201 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		processor_set_flavor_t flavor;
		mach_msg_type_number_t info_outCnt;
	} __Request__processor_set_statistics_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 210 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 214 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__processor_set_destroy_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 220 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 224 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
	typedef struct {
		boolean_t change_threads;
	} __Request__processor_set_policy_disable_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 258 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 262 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__processor_set_tasks_t;
#ifdef  __MigPackStructs
#pragma pack()
#pragma pack(4)
#endif
# 282 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		processor_set_flavor_t flavor;
		mach_msg_type_number_t policy_infoCnt;
		integer_t policy_info[5];
		boolean_t change;
	} __Request__processor_set_policy_control_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 293 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 297 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__processor_set_stack_usage_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
};
#endif /* !__RequestUnion__processor_set_subsystem__defined */
# 498 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
#ifdef __AfterMigUserHeader
__AfterMigUserHeader
#endif /* __AfterMigUserHeader */
# 516 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4

#endif	 /* _processor_set_user_ */
# 518 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/processor_set.h" 3 4
# 48 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_interface.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/semaphore.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/semaphore.h" 1 3 4
/*
 * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 */

#ifndef _MACH_SEMAPHORE_H_
#define _MACH_SEMAPHORE_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
# 33 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/semaphore.h" 3 4
#if 0 /* expanded by -frewrite-includes */
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
#else
# 604 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
extern
#endif	/* mig_external */
# 606 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
kern_return_t task_swap_mach_voucher
(
	task_t task,
	ipc_voucher_t new_voucher,
/* typedefs for all requests */

#ifndef __Request__task_subsystem__defined
#define __Request__task_subsystem__defined

#ifdef  __MigPackStructs
#endif
# 687 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__mach_ports_lookup_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 693 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 697 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		task_flavor_t flavor;
		mach_msg_type_number_t task_info_outCnt;
	} __Request__task_info_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 706 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 724 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__task_suspend_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 730 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 734 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__task_resume_t;
#ifdef  __MigPackStructs
#pragma pack()
#pragma pack()
#endif
# 768 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 772 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__thread_create_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 792 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 796 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_port_descriptor_t new_port;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		exception_mask_t exception_mask;
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_ool_ports_descriptor_t act_list;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		mach_msg_type_number_t act_listCnt;
	} __Reply__task_threads_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1281 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1339 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__task_suspend_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1347 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1351 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1507 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__semaphore_destroy_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1515 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1519 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__task_policy_set_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1527 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1558 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
    { "task_set_mach_voucher", 3440 },\
    { "task_swap_mach_voucher", 3441 }
#endif
# 1902 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#ifdef __AfterMigUserHeader
__AfterMigUserHeader
#endif /* __AfterMigUserHeader */
# 1906 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4

#endif	 /* _task_user_ */
# 1908 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/task.h" 3 4
# 50 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_interface.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/thread_act.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 1 3 4
#ifndef	_thread_act_user_
# 13 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mig_errors.h>
#endif /* expanded by -frewrite-includes */
# 14 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef AUTOTEST
#ifndef FUNCTION_PTR_T
#define FUNCTION_PTR_T
typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t);
typedef struct {
        char            *name;
        function_ptr_t  function;
} function_table_entry;
typedef function_table_entry   *function_table_t;
#endif /* FUNCTION_PTR_T */
# 26 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
#endif /* AUTOTEST */
# 27 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifndef	thread_act_MSG_COUNT
#define	thread_act_MSG_COUNT	28
#endif	/* thread_act_MSG_COUNT */
# 31 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <mach/std_types.h>
#endif	/* mig_external */
# 129 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
kern_return_t thread_resume
(
	thread_act_t target_act
);

/* Routine thread_abort */
#ifdef	mig_external
mig_external
#else
# 138 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
extern
#endif	/* mig_external */
# 140 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	exception_mask_t exception_mask,
	mach_port_t new_port,
	exception_behavior_t behavior,
	thread_state_flavor_t new_flavor,
	exception_mask_array_t masks,
	mach_msg_type_number_t *masksCnt,
	exception_handler_array_t old_handlers,
	exception_behavior_array_t old_behaviors,
	exception_flavor_array_t old_flavors
);

/* Routine thread_policy */
#ifdef	mig_external
mig_external
#else
# 263 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
# 292 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
extern
#endif	/* mig_external */
# 294 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
kern_return_t thread_policy_get
(
	thread_act_t thread,
	thread_policy_flavor_t flavor,
	thread_policy_t policy_info,
	mach_msg_type_number_t *policy_infoCnt,
	boolean_t *get_default
);

/* Routine thread_sample */
#ifdef	mig_external
mig_external
#else
# 307 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
extern
#endif	/* mig_external */
# 309 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
kern_return_t thread_sample
(
	thread_act_t thread,
	mach_port_t reply
);

/* Routine etap_trace_thread */
# 368 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
kern_return_t thread_set_policy
(
	thread_act_t thr_act,

/* typedefs for all requests */

#ifndef __Request__thread_act_subsystem__defined
#define __Request__thread_act_subsystem__defined

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 438 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__thread_terminate_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 580 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		thread_flavor_t flavor;
		mach_msg_type_number_t thread_info_outCnt;
		mach_msg_header_t Head;
		NDR_record_t NDR;
		exception_mask_t exception_mask;
	} __Request__thread_get_exception_ports_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 619 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#endif
# 760 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 764 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		mach_voucher_selector_t which;
	} __Request__thread_get_mach_voucher_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 772 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	} __Reply__thread_resume_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 930 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 934 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__thread_abort_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 942 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 946 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__thread_abort_safely_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 954 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 958 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__thread_depress_abort_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 966 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1010 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__thread_set_exception_ports_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1018 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1037 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1041 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_port_descriptor_t old_handlers[32];
		/* end of the kernel processed data */
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__thread_sample_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1107 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1111 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__etap_trace_thread_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1119 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1123 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__thread_assign_t;
#ifdef  __MigPackStructs
#endif
# 1157 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1161 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__thread_set_policy_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1169 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
    { "thread_get_mach_voucher", 3625 },\
    { "thread_set_mach_voucher", 3626 },\
    { "thread_swap_mach_voucher", 3627 }
#endif
# 1278 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#ifdef __AfterMigUserHeader
__AfterMigUserHeader
#endif /* __AfterMigUserHeader */
# 1282 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4

#endif	 /* _thread_act_user_ */
# 1284 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_act.h" 3 4
# 51 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_interface.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_map.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 1 3 4
#ifndef	_vm_map_user_
#define	_vm_map_user_

/* Module vm_map */

#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 7 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/ndr.h>
#endif /* expanded by -frewrite-includes */
# 8 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/message.h>
#endif /* expanded by -frewrite-includes */
# 13 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mig_errors.h>
#endif /* expanded by -frewrite-includes */
# 14 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#include <mach/mig.h>
#endif /* expanded by -frewrite-includes */
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_types.h>
#endif /* expanded by -frewrite-includes */
# 36 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
/* typedefs for all requests */

#ifndef __Request__vm_map_subsystem__defined
#define __Request__vm_map_subsystem__defined

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 481 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		vm_address_t address;
		vm_region_flavor_t flavor;
		mach_msg_type_number_t infoCnt;
	} __Request__vm_region_t;
		NDR_record_t NDR;
		vm_address_t target_address;
		vm_size_t size;
		vm_address_t mask;
		int flags;
		vm_address_t src_address;
		boolean_t copy;
		vm_inherit_t inheritance;
	} __Request__vm_remap_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 707 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 711 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		boolean_t must_wire;
	} __Request__task_wire_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 719 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 723 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 741 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		vm_offset_t offset;
	} __Request__vm_map_page_query_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 749 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 753 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		vm_address_t address;
	} __Request__mach_vm_region_info_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 761 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 765 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1046 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
		vm_size_t outsize;
	} __Reply__vm_read_overwrite_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1055 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1059 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__vm_msync_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1067 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_ool_descriptor_t objects;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		vm_info_region_t region;
# 1285 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
		vm_address_t address;
	} __Reply__vm_map_64_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1294 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1298 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
		int state;
	} __Reply__vm_purgable_control_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
	__Reply__vm_region_64_t Reply_vm_region_64;
	__Reply__mach_make_memory_entry_64_t Reply_mach_make_memory_entry_64;
	__Reply__vm_map_64_t Reply_vm_map_64;
	__Reply__vm_purgable_control_t Reply_vm_purgable_control;
};
    { "vm_purgable_control", 3830 }
#endif
# 1374 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4

#ifdef __AfterMigUserHeader
__AfterMigUserHeader
#endif /* __AfterMigUserHeader */
# 1378 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4

#endif	 /* _vm_map_user_ */
# 1380 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/vm_map.h" 3 4
# 52 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_interface.h" 2 3 4

#endif /* _MACH_INTERFACE_H_ */
# 54 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_interface.h" 3 4
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_port.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 1 3 4
#ifndef	_mach_port_user_
#define	_mach_port_user_

/* Module mach_port */

#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

# 537 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
kern_return_t mach_port_space_basic_info
(
	ipc_space_t task,
	ipc_info_space_basic_t *basic_info
);

__END_DECLS

/********************** Caution **************************/
/* The following data types should be used to calculate  */
/* maximum message sizes only. The actual message may be */
/* smaller, and the position of the arguments within the */
/* message layout may vary from what is presented here.  */
/* For example, if any of the arguments are variable-    */
/* sized, and less than the maximum is sent, the data    */
/* will be packed tight in the actual message to reduce  */
/* the presence of holes.                                */
/********************** Caution **************************/

/* typedefs for all requests */

#ifndef __Request__mach_port_subsystem__defined
#define __Request__mach_port_subsystem__defined

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 564 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 595 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 599 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		mach_port_right_t right;
		mach_port_name_t name;
	} __Request__mach_port_allocate_name_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 608 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 612 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		mach_port_right_t right;
	} __Request__mach_port_allocate_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 636 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		mach_port_name_t name;
	} __Request__mach_port_deallocate_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 644 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 703 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		mach_port_name_t name;
	} __Request__mach_port_get_set_status_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 711 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 715 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_port_descriptor_t notify;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		mach_port_name_t name;
		mach_msg_id_t msgid;
		mach_port_mscount_t sync;
	} __Request__mach_port_request_notification_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 742 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 746 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_port_descriptor_t poly;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		mach_port_name_t name;
	} __Request__mach_port_insert_right_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 758 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 775 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		mach_port_name_t name;
		mach_port_seqno_t seqno;
	} __Request__mach_port_set_seqno_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 784 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 802 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		mach_port_name_t name;
		mach_port_flavor_t flavor;
		mach_msg_type_number_t port_infoCnt;
		integer_t port_info[17];
#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 919 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__mach_port_set_context_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 953 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 957 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		mach_port_name_t name;
	} __Request__mach_port_kobject_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 965 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 969 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_ool_descriptor_t options;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		mach_port_context_t context;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1136 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1140 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
		mach_port_name_t name;
	} __Reply__mach_port_allocate_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1149 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1153 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__mach_port_destroy_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1177 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
		mach_port_urefs_t refs;
	} __Reply__mach_port_get_refs_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1186 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1190 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__mach_port_mod_refs_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1198 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1219 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__mach_port_set_mscount_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1227 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1231 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_ool_descriptor_t members;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		mach_msg_type_number_t membersCnt;
	} __Reply__mach_port_get_set_status_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1243 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1247 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__mach_port_move_member_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1255 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1259 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_port_descriptor_t previous;
		/* end of the kernel processed data */
	} __Reply__mach_port_request_notification_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1269 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#endif
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
		mach_msg_type_number_t port_info_outCnt;
		integer_t port_info_out[17];
	} __Reply__mach_port_get_attributes_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1321 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 1437 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
	} __Reply__mach_port_insert_member_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 1445 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
    { "mach_port_insert_member", 3226 },\
    { "mach_port_extract_member", 3227 },\
    { "mach_port_get_context", 3228 },\
    { "mach_port_set_context", 3229 },\
    { "mach_port_kobject", 3230 },\
    { "mach_port_construct", 3231 },\
    { "mach_port_destruct", 3232 },\
    { "mach_port_guard", 3233 },\
    { "mach_port_unguard", 3234 },\
    { "mach_port_space_basic_info", 3235 }
#endif
# 1643 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#ifdef __AfterMigUserHeader
__AfterMigUserHeader
#endif /* __AfterMigUserHeader */
# 1647 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4

#endif	 /* _mach_port_user_ */
# 1649 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_port.h" 3 4
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_init.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_init.h" 1 3 4
/*
 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 * 
 *	Items provided by the Mach environment initialization.
 */

#ifndef	_MACH_INIT_
#define	_MACH_INIT_	1

#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_types.h>
#endif /* expanded by -frewrite-includes */
# 62 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_init.h" 3 4
 *	The kernel definitions are in <mach/syscall_sw.h>.
 *	Kernel RPC functions are defined in <mach/mach_interface.h>.
 */

#ifndef	_MACH_MACH_TRAPS_H_
#define _MACH_MACH_TRAPS_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 70 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_traps.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <mach/std_types.h>
#endif /* expanded by -frewrite-includes */
# 72 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_traps.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_types.h>
#endif /* expanded by -frewrite-includes */
# 73 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_traps.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/kern_return.h>
#endif /* expanded by -frewrite-includes */
# 74 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_traps.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/port.h>
#endif /* expanded by -frewrite-includes */
# 75 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_traps.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/vm_types.h>
#endif /* expanded by -frewrite-includes */

__END_DECLS

#endif	/* _MACH_MACH_TRAPS_H_ */
# 253 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_traps.h" 3 4
# 82 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_init.h" 2 3 4
__BEGIN_DECLS
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 1 3 4
#ifndef	_mach_host_user_
#define	_mach_host_user_

/* Module mach_host */

#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
#if 0 /* expanded by -frewrite-includes */
#include <mach/mig.h>
#endif /* expanded by -frewrite-includes */
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_types.h>
mig_external
#else
# 311 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
extern
#endif	/* mig_external */
# 313 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
kern_return_t host_register_mach_voucher_attr_manager
(
	host_t host,
	mach_voucher_attr_manager_t attr_manager,
	mach_voucher_attr_value_handle_t default_value,
	mach_voucher_attr_key_t *new_key,
	ipc_voucher_attr_control_t *new_attr_control
);

/* Routine host_register_well_known_mach_voucher_attr_manager */
__END_DECLS

/********************** Caution **************************/
/* The following data types should be used to calculate  */
/* maximum message sizes only. The actual message may be */
/* smaller, and the position of the arguments within the */
/* message layout may vary from what is presented here.  */
/* For example, if any of the arguments are variable-    */
/* sized, and less than the maximum is sent, the data    */
/* will be packed tight in the actual message to reduce  */
/* the presence of holes.                                */
/********************** Caution **************************/

/* typedefs for all requests */

#ifndef __Request__mach_host_subsystem__defined
# 449 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 453 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	} __Request__host_zone_info_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 459 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 573 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		mach_msg_type_number_t recipesCnt;
		uint8_t recipes[5120];
	} __Request__host_create_mach_voucher_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 582 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 586 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_port_descriptor_t attr_manager;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		mach_voucher_attr_value_handle_t default_value;
	} __Request__host_register_mach_voucher_attr_manager_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 598 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 602 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_port_descriptor_t attr_manager;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		mach_voucher_attr_value_handle_t default_value;
		mach_voucher_attr_key_t key;
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_ool_descriptor_t out_processor_info;
		/* end of the kernel processed data */
		NDR_record_t NDR;
		natural_t out_processor_count;
		mach_msg_type_number_t out_processor_infoCnt;
	} __Reply__host_processor_info_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 722 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4

#ifdef  __MigPackStructs
#pragma pack(4)
#endif
# 726 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
		/* start of the kernel processed data */
		mach_msg_body_t msgh_body;
		mach_msg_port_descriptor_t io_master;
		/* end of the kernel processed data */
	} __Reply__host_get_io_master_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 818 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
	typedef struct {
		mach_msg_header_t Head;
	typedef struct {
		mach_msg_header_t Head;
		NDR_record_t NDR;
		kern_return_t RetCode;
		mach_msg_type_number_t host_info64_outCnt;
		integer_t host_info64_out[256];
	} __Reply__host_statistics64_t;
#ifdef  __MigPackStructs
#pragma pack()
#endif
# 899 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
    { "host_register_mach_voucher_attr_manager", 223 },\
    { "host_register_well_known_mach_voucher_attr_manager", 224 }
#endif
# 1016 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4

#ifdef __AfterMigUserHeader
__AfterMigUserHeader
#endif /* __AfterMigUserHeader */
# 1020 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4

#endif	 /* _mach_host_user_ */
# 1022 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_host.h" 3 4
# 71 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/thread_switch.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_switch.h" 1 3 4
/*
 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon
 * the rights to redistribute these changes.
 */
/*
 */

#ifndef	_MACH_THREAD_SWITCH_H_
#define	_MACH_THREAD_SWITCH_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_types.h>
#endif /* expanded by -frewrite-includes */
# 63 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_switch.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/kern_return.h>
#endif /* expanded by -frewrite-includes */
# 64 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_switch.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/message.h>
#endif /* expanded by -frewrite-includes */
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/thread_switch.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_traps.h>
#endif /* expanded by -frewrite-includes */
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. The rights granted to you under the License
 * may not be used to create, or enable the creation or redistribution of,
 * unlawful or unlicensed copies of an Apple operating system, or to
 * circumvent, violate, or enable the circumvention or violation of, any
#ifndef _MACH_MACHINE_RPC_H_
#define _MACH_MACHINE_RPC_H_

#if   defined (__arm__) || defined (__arm64__)
#if 0 /* expanded by -frewrite-includes */
#include "mach/arm/rpc.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/rpc.h" 1 3 4
/*
 * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
 */
/*
 * @OSF_COPYRIGHT@
 */

#ifndef	_MACH_I386_RPC_H_
#define	_MACH_I386_RPC_H_

#endif /* _MACH_I386_RPC_H_ */
# 12 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/arm/rpc.h" 3 4
# 34 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/rpc.h" 2 3 4
#else
# 35 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/rpc.h" 3 4
#error architecture not supported
#endif
# 37 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/rpc.h" 3 4

#endif	/* _MACH_MACHINE_RPC_H_ */
# 39 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/machine/rpc.h" 3 4
# 47 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/rpc.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/thread_status.h>
#endif /* expanded by -frewrite-includes */
# 48 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/rpc.h" 3 4

/*
 * These are the types for RPC-specific variants of the MIG routine
 * descriptor and subsystem data types.
 *
# 77 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach_error.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_error.h" 1 3 4
/*
 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 * Please see the License for the specific language governing rights and
 * limitations under the License.
 * 
 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
 *
 *	Definitions of routines in mach_error.c
 */

#ifndef	_MACH_ERROR_
#define	_MACH_ERROR_	1

#if 0 /* expanded by -frewrite-includes */
#include <mach/error.h>
#endif /* expanded by -frewrite-includes */
 */

#ifndef	_MACH_ERROR_H_
#define	_MACH_ERROR_H_

#if 0 /* expanded by -frewrite-includes */
#include <mach/kern_return.h>
#endif /* expanded by -frewrite-includes */
# 69 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/error.h" 3 4

/*
 *	error number layout as follows:
 *
 *	hi		 		       lo
 *	| system(6) | subsystem(12) | code(14) |
 */


#define	err_none		(mach_error_t)0
#define ERR_SUCCESS		(mach_error_t)0
typedef	kern_return_t	mach_error_t;
typedef mach_error_t	(* mach_error_fn_t)( void );

#endif	/* _MACH_ERROR_H_ */
# 115 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/error.h" 3 4
# 66 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_error.h" 2 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 68 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_error.h" 3 4

char		*mach_error_type(
/*
 *	Returns a string with the error system, subsystem and code
 */
	mach_error_t	error_value
				);
__END_DECLS

#endif	/* _MACH_ERROR_ */
# 94 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach_error.h" 3 4
# 78 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach.h" 2 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 80 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach.h" 3 4

#endif	/* _MACH_H_ */
# 238 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/mach/mach.h" 3 4
# 26 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h" 2
#endif
# 27 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"

#if 0 /* expanded by -frewrite-includes */
#include <map>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 1 3
// -*- C++ -*-
//===----------------------------- map ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_MAP
#define _LIBCPP_MAP

/*

    map synopsis

namespace std
{

template <class Key, class T, class Compare = less<Key>,
    };

    // construct/copy/destroy:
    map()
        noexcept(
            is_nothrow_default_constructible<allocator_type>::value &&
            is_nothrow_default_constructible<key_compare>::value &&
#endif /* expanded by -frewrite-includes */
# 423 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
#if 0 /* expanded by -frewrite-includes */
#include <__tree>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP___TREE
#define _LIBCPP___TREE

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
#if 0 /* expanded by -frewrite-includes */
#include <iterator>
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 22 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
#endif
# 23 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Tp, class _Compare, class _Allocator> class __tree;
template <class _Tp, class _NodePtr, class _DiffType>
    class _LIBCPP_TYPE_VIS_ONLY __tree_iterator;
template <class _Tp, class _ConstNodePtr, class _DiffType>
    class _LIBCPP_TYPE_VIS_ONLY __tree_const_iterator;
template <class _Key, class _Tp, class _Compare, class _Allocator>
    class _LIBCPP_TYPE_VIS_ONLY map;
template <class _Key, class _Tp, class _Compare, class _Allocator>
    class _LIBCPP_TYPE_VIS_ONLY multimap;
template <class _Key, class _Compare, class _Allocator>
    class _LIBCPP_TYPE_VIS_ONLY set;
template <class _Key, class _Compare, class _Allocator>
    class _LIBCPP_TYPE_VIS_ONLY multiset;

/*

_NodePtr algorithms

The algorithms taking _NodePtr are red black tree algorithms.  Those
algorithms taking a parameter named __root should assume that __root
points to a proper red black tree (unless otherwise specified).

Each algorithm herein assumes that __root->__parent_ points to a non-null
structure which has a member __left_ which points back to __root.  No other
member is read or written to at __root->__parent_.

__root->__parent_ will be referred to below (in comments only) as end_node.
end_node->__left_ is an externably accessible lvalue for __root, and can be
changed by node insertion and removal (without explicit reference to end_node).

All nodes (with the exception of end_node), even the node referred to as
__root, have a non-null __parent_ field.

*/

// Returns:  true if __x is a left child of its parent, else false
// Precondition:  __x != nullptr.
template <class _NodePtr>
inline _LIBCPP_INLINE_VISIBILITY
bool
__tree_is_left_child(_NodePtr __x) _NOEXCEPT
{
    return __x == __x->__parent_->__left_;
}

// Determintes if the subtree rooted at __x is a proper red black subtree.  If
//    __x is a proper subtree, returns the black height (null counts as 1).  If
//    __x is an improper subtree, returns 0.
template <class _NodePtr>
unsigned
__tree_sub_invariant(_NodePtr __x)
{
    if (__x == nullptr)
        return 1;
    // parent consistency checked by caller
    // check __x->__left_ consistency
    if (__x->__left_ != nullptr && __x->__left_->__parent_ != __x)
        return 0;
    // check __x->__right_ consistency
    if (__x->__right_ != nullptr && __x->__right_->__parent_ != __x)
        return 0;
    // check __x->__left_ != __x->__right_ unless both are nullptr
    if (__x->__left_ == __x->__right_ && __x->__left_ != nullptr)
        return 0;
    // If this is red, neither child can be red
    if (!__x->__is_black_)
    {
        if (__x->__left_ && !__x->__left_->__is_black_)
            return 0;
        if (__x->__right_ && !__x->__right_->__is_black_)
            return 0;
    }
    unsigned __h = __tree_sub_invariant(__x->__left_);
    if (__h == 0)
        return 0;  // invalid left subtree
    if (__h != __tree_sub_invariant(__x->__right_))
        return 0;  // invalid or different height right subtree
    return __h + __x->__is_black_;  // return black height of this node
}

// Determintes if the red black tree rooted at __root is a proper red black tree.
//    __root == nullptr is a proper tree.  Returns true is __root is a proper
template <class _Allocator>
class __tree_node_destructor
{
    typedef _Allocator                                      allocator_type;
    typedef allocator_traits<allocator_type>                __alloc_traits;
    typedef typename __alloc_traits::value_type::value_type value_type;
public:
    typedef typename __alloc_traits::pointer                pointer;
private:

    allocator_type& __na_;

    ;

public:
    bool __value_constructed;

    _LIBCPP_INLINE_VISIBILITY
    explicit __tree_node_destructor(allocator_type& __na) _NOEXCEPT
        : __na_(__na),
          __value_constructed(false)
        {}

    _LIBCPP_INLINE_VISIBILITY
    void operator()(pointer __p) _NOEXCEPT
    {
        if (__value_constructed)
            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_));
        if (__p)
            __alloc_traits::deallocate(__na_, __p, 1);
    }

    template <class> friend class __map_node_destructor;
};

// node

template <class _Pointer>
class __tree_end_node
{
public:
    typedef _Pointer pointer;
    pointer __left_;

    _LIBCPP_INLINE_VISIBILITY
    __tree_end_node() _NOEXCEPT : __left_() {}
};

template <class _VoidPtr>
class __tree_node_base
    : public __tree_end_node
             <
                typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
                     rebind<__tree_node_base<_VoidPtr> >
#else
# 563 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                     rebind<__tree_node_base<_VoidPtr> >::other
#endif
# 565 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
             >
{
    ;
    ;
public:
    typedef typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<__tree_node_base>
#else
# 574 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
            rebind<__tree_node_base>::other
#endif
# 576 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                                                pointer;
    typedef typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<const __tree_node_base>
#else
# 581 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
            rebind<const __tree_node_base>::other
#endif
# 583 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                                                const_pointer;
    typedef __tree_end_node<pointer> base;

    pointer __right_;
    pointer __parent_;
    bool __is_black_;

    _LIBCPP_INLINE_VISIBILITY
    __tree_node_base() _NOEXCEPT
        : __right_(), __parent_(), __is_black_(false) {}
};

template <class _Tp, class _VoidPtr>
class __tree_node
    : public __tree_node_base<_VoidPtr>
{
public:
    typedef __tree_node_base<_VoidPtr> base;
    typedef _Tp value_type;

    value_type __value_;

#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
    template <class ..._Args>
        _LIBCPP_INLINE_VISIBILITY
        explicit __tree_node(_Args&& ...__args)
            : __value_(_VSTD::forward<_Args>(__args)...) {}
#else  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
# 611 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
    _LIBCPP_INLINE_VISIBILITY
    explicit __tree_node(const value_type& __v)
            : __value_(__v) {}
#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
# 615 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
};

template <class _TreeIterator> class _LIBCPP_TYPE_VIS_ONLY __map_iterator;
template <class _TreeIterator> class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator;

template <class _Tp, class _NodePtr, class _DiffType>
class _LIBCPP_TYPE_VIS_ONLY __tree_iterator
{
    typedef _NodePtr                                              __node_pointer;
    typedef typename pointer_traits<__node_pointer>::element_type __node;
    typedef typename __node::base                                 __node_base;
    typedef typename __node_base::pointer                         __node_base_pointer;

    __node_pointer __ptr_;

    typedef pointer_traits<__node_pointer> __pointer_traits;
public:
    typedef bidirectional_iterator_tag iterator_category;
    typedef _Tp                        value_type;
    typedef _DiffType                  difference_type;
    typedef value_type&                reference;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<value_type>
#else
# 640 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
            rebind<value_type>::other
#endif
# 642 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                                       pointer;

    _LIBCPP_INLINE_VISIBILITY __tree_iterator() _NOEXCEPT
#if _LIBCPP_STD_VER > 11
    : __ptr_(nullptr)
#endif
# 648 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
    {}

    _LIBCPP_INLINE_VISIBILITY reference operator*() const {return __ptr_->__value_;}
    template <class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multiset;
};

template <class _Tp, class _ConstNodePtr, class _DiffType>
class _LIBCPP_TYPE_VIS_ONLY __tree_const_iterator
{
    typedef _ConstNodePtr                                         __node_pointer;
    typedef typename pointer_traits<__node_pointer>::element_type __node;
    typedef typename __node::base                                 __node_base;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<__node_base>
#else
# 699 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
            rebind<__node_base>::other
#endif
# 701 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                                                                  __node_base_pointer;

    __node_pointer __ptr_;

    typedef pointer_traits<__node_pointer> __pointer_traits;
public:
    typedef bidirectional_iterator_tag       iterator_category;
    typedef _Tp                              value_type;
    typedef _DiffType                        difference_type;
    typedef const value_type&                reference;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<const value_type>
#else
# 715 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
            rebind<const value_type>::other
#endif
# 717 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                                       pointer;

    _LIBCPP_INLINE_VISIBILITY __tree_const_iterator() _NOEXCEPT
#if _LIBCPP_STD_VER > 11
    : __ptr_(nullptr)
#endif
# 723 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
    {}

private:
    typedef typename remove_const<__node>::type  __non_const_node;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<__non_const_node>
#else
# 731 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
            rebind<__non_const_node>::other
#endif
# 733 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                                                 __non_const_node_pointer;
    typedef __tree_iterator<value_type, __non_const_node_pointer, difference_type>
                                                 __non_const_iterator;
public:
    _LIBCPP_INLINE_VISIBILITY
    __tree_const_iterator(__non_const_iterator __p) _NOEXCEPT
        : __ptr_(__p.__ptr_) {}

    template <class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multiset;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator;
};

template <class _Tp, class _Compare, class _Allocator>
class __tree
{
public:
    typedef _Tp                                      value_type;
    typedef _Compare                                 value_compare;
    typedef _Allocator                               allocator_type;
    typedef allocator_traits<allocator_type>         __alloc_traits;
    typedef typename __alloc_traits::pointer         pointer;
    typedef typename __alloc_traits::const_pointer   const_pointer;
    typedef typename __alloc_traits::size_type       size_type;
    typedef typename __alloc_traits::difference_type difference_type;

    typedef typename __alloc_traits::void_pointer  __void_pointer;

    typedef __tree_node<value_type, __void_pointer> __node;
    typedef __tree_node_base<__void_pointer>        __node_base;
    typedef typename __alloc_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind_alloc<__node>
#else
# 801 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
            rebind_alloc<__node>::other
#endif
# 803 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                                                     __node_allocator;
    typedef allocator_traits<__node_allocator>       __node_traits;
    typedef typename __node_traits::pointer          __node_pointer;
    typedef typename __node_traits::pointer          __node_const_pointer;
    typedef typename __node_base::pointer            __node_base_pointer;
    typedef typename __node_base::pointer            __node_base_const_pointer;
private:
    typedef typename __node_base::base __end_node_t;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<__end_node_t>
#else
# 815 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
            rebind<__end_node_t>::other
#endif
# 817 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                                                     __end_node_ptr;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<__end_node_t>
#else
# 822 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
            rebind<__end_node_t>::other
#endif
# 824 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                                                     __end_node_const_ptr;

    __node_pointer                                          __begin_node_;
    __compressed_pair<__end_node_t, __node_allocator>  __pair1_;
    __compressed_pair<size_type, value_compare>        __pair3_;

public:
    _LIBCPP_INLINE_VISIBILITY
    __node_pointer __end_node() _NOEXCEPT
    {
        return static_cast<__node_pointer>
               (
                   pointer_traits<__end_node_ptr>::pointer_to(__pair1_.first())
               );
    }
    _LIBCPP_INLINE_VISIBILITY
    __node_const_pointer __end_node() const _NOEXCEPT
    {
        return static_cast<__node_const_pointer>
               (
                   pointer_traits<__end_node_const_ptr>::pointer_to(const_cast<__end_node_t&>(__pair1_.first()))
               );
    }
    _LIBCPP_INLINE_VISIBILITY
          __node_allocator& __node_alloc() _NOEXCEPT {return __pair1_.second();}
private:
    _LIBCPP_INLINE_VISIBILITY
    const __node_allocator& __node_alloc() const _NOEXCEPT
        {return __pair1_.second();}
    _LIBCPP_INLINE_VISIBILITY
          __node_pointer& __begin_node() _NOEXCEPT {return __begin_node_;}
    _LIBCPP_INLINE_VISIBILITY
    const __node_pointer& __begin_node() const _NOEXCEPT {return __begin_node_;}
public:
    _LIBCPP_INLINE_VISIBILITY
    allocator_type __alloc() const _NOEXCEPT
        {return allocator_type(__node_alloc());}
private:
    _LIBCPP_INLINE_VISIBILITY
          size_type& size() _NOEXCEPT {return __pair3_.first();}
public:
    _LIBCPP_INLINE_VISIBILITY
    const size_type& size() const _NOEXCEPT {return __pair3_.first();}
    _LIBCPP_INLINE_VISIBILITY
          value_compare& value_comp() _NOEXCEPT {return __pair3_.second();}
    _LIBCPP_INLINE_VISIBILITY
    const value_compare& value_comp() const _NOEXCEPT
        {return __pair3_.second();}
public:
    _LIBCPP_INLINE_VISIBILITY
    __node_pointer __root() _NOEXCEPT
        {return static_cast<__node_pointer>      (__end_node()->__left_);}
    _LIBCPP_INLINE_VISIBILITY
    __node_const_pointer __root() const _NOEXCEPT
        {return static_cast<__node_const_pointer>(__end_node()->__left_);}

    typedef __tree_iterator<value_type, __node_pointer, difference_type>             iterator;
    typedef __tree_const_iterator<value_type, __node_pointer, difference_type> const_iterator;

    explicit __tree(const value_compare& __comp)
        _NOEXCEPT_(
            is_nothrow_default_constructible<__node_allocator>::value &&
            is_nothrow_copy_constructible<value_compare>::value);
    ;
    ;
    ;
    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    __tree(__tree&& __t)
        _NOEXCEPT_(
            is_nothrow_move_constructible<__node_allocator>::value &&
            is_nothrow_move_constructible<value_compare>::value);
    __tree(__tree&& __t, const allocator_type& __a);
    __tree& operator=(__tree&& __t)
        _NOEXCEPT_(
            __node_traits::propagate_on_container_move_assignment::value &&
            is_nothrow_move_assignable<value_compare>::value &&
            is_nothrow_move_assignable<__node_allocator>::value);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 907 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3

    ~__tree();

    _LIBCPP_INLINE_VISIBILITY
          iterator begin()  _NOEXCEPT {return       iterator(__begin_node());}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator begin() const _NOEXCEPT {return const_iterator(__begin_node());}
    _LIBCPP_INLINE_VISIBILITY
          iterator end() _NOEXCEPT {return       iterator(__end_node());}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator end() const _NOEXCEPT {return const_iterator(__end_node());}

    _LIBCPP_INLINE_VISIBILITY
    size_type max_size() const _NOEXCEPT
        {return __node_traits::max_size(__node_alloc());}

    void clear() _NOEXCEPT;

    void swap(__tree& __t)
        _NOEXCEPT_(
            __is_nothrow_swappable<value_compare>::value &&
            (!__node_traits::propagate_on_container_swap::value ||
             __is_nothrow_swappable<__node_allocator>::value));

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class... _Args>
        pair<iterator, bool>
        __emplace_unique(_Args&&... __args);
    template <class... _Args>
        iterator
        __emplace_multi(_Args&&... __args);

    template <class... _Args>
        iterator
        __emplace_hint_unique(const_iterator __p, _Args&&... __args);
    template <class... _Args>
        iterator
        __emplace_hint_multi(const_iterator __p, _Args&&... __args);
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 947 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3

    template <class _Vp>
        pair<iterator, bool> __insert_unique(_Vp&& __v);
    template <class _Vp>
        iterator __insert_unique(const_iterator __p, _Vp&& __v);
    template <class _Vp>
        iterator __insert_multi(_Vp&& __v);
    template <class _Vp>
        iterator __insert_multi(const_iterator __p, _Vp&& __v);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 957 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3

    void __insert_node_at(__node_base_pointer __parent,
                          __node_base_pointer& __child,
                          __node_base_pointer __new_node);

    ;
    ;

    ;
    ;

    template <class _Key>
        _LIBCPP_INLINE_VISIBILITY
        iterator lower_bound(const _Key& __v)
            {return __lower_bound(__v, __root(), __end_node());}
    ;
    ;

    ;
    ;

    typedef __tree_node_destructor<__node_allocator> _Dp;
    typedef unique_ptr<__node, _Dp> __node_holder;

    __node_holder remove(const_iterator __p) _NOEXCEPT;
private:
    typename __node_base::pointer&
        __find_leaf_low(typename __node_base::pointer& __parent, const value_type& __v);
    typename __node_base::pointer&
        __find_leaf_high(typename __node_base::pointer& __parent, const value_type& __v);
    ;
    ;
    template <class _Key>
        typename __node_base::pointer&
        __find_equal(const_iterator __hint, typename __node_base::pointer& __parent,
                     const _Key& __v);

#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
    template <class ..._Args>
        __node_holder __construct_node(_Args&& ...__args);
#else  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
# 1061 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
        __node_holder __construct_node(const value_type& __v);
#endif
# 1063 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3

    void destroy(__node_pointer __nd) _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const __tree& __t)
        {__copy_assign_alloc(__t, integral_constant<bool,
             __node_traits::propagate_on_container_copy_assignment::value>());}

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const __tree& __t, true_type)
        {__node_alloc() = __t.__node_alloc();}
    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const __tree& __t, false_type) {}

    void __move_assign(__tree& __t, false_type);
    void __move_assign(__tree& __t, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<value_compare>::value &&
                   is_nothrow_move_assignable<__node_allocator>::value);

    static void __swap_alloc(__node_allocator& __x, __node_allocator& __y)
        _NOEXCEPT_(
            !__node_traits::propagate_on_container_swap::value ||
            __is_nothrow_swappable<__node_allocator>::value)
        {__swap_alloc(__x, __y, integral_constant<bool,
                      __node_traits::propagate_on_container_swap::value>());}
    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, true_type)
        _NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
        {
            using _VSTD::swap;
            swap(__x, __y);
        }
    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, false_type)
        _NOEXCEPT
        {}

    __node_pointer __detach();
    ;

    template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY map;
    template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multimap;
};

template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp)
        _NOEXCEPT_(
            is_nothrow_default_constructible<__node_allocator>::value &&
            is_nothrow_copy_constructible<value_compare>::value)
    : __pair3_(0, __comp)
{
    __begin_node() = __end_node();
}





// Precondition:  size() != 0
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_pointer
__tree<_Tp, _Compare, _Allocator>::__detach()
{
    __node_pointer __cache = __begin_node();
    __begin_node() = __end_node();
    __end_node()->__left_->__parent_ = nullptr;
    __end_node()->__left_ = nullptr;
    size() = 0;
    // __cache->__left_ == nullptr
    if (__cache->__right_ != nullptr)
        __cache = static_cast<__node_pointer>(__cache->__right_);
    // __cache->__left_ == nullptr
    // __cache->__right_ == nullptr
    return __cache;
}

// Precondition:  __cache != nullptr
//    __cache->left_ == nullptr
//    __cache->right_ == nullptr
//    This is no longer a red-black tree










#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
    _NOEXCEPT_(
        is_nothrow_move_constructible<__node_allocator>::value &&
        is_nothrow_move_constructible<value_compare>::value)
    : __begin_node_(_VSTD::move(__t.__begin_node_)),
      __pair1_(_VSTD::move(__t.__pair1_)),
      __pair3_(_VSTD::move(__t.__pair3_))
{
    if (size() == 0)
        __begin_node() = __end_node();
    else
    {
        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
        __t.__begin_node() = __t.__end_node();
        __t.__end_node()->__left_ = nullptr;
        __t.size() = 0;
    }
}

template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)
    : __pair1_(__node_allocator(__a)),
      __pair3_(0, _VSTD::move(__t.value_comp()))
{
    if (__a == __t.__alloc())
    {
        if (__t.size() == 0)
            __begin_node() = __end_node();
        else
        __end_node()->__left_->__parent_ = static_cast<__node_base_pointer>(__end_node());
        __t.__begin_node() = __t.__end_node();
        __t.__end_node()->__left_ = nullptr;
        __t.size() = 0;
    }
}

template <class _Tp, class _Compare, class _Allocator>
void
__tree<_Tp, _Compare, _Allocator>::__move_assign(__tree& __t, false_type)
{
    if (__node_alloc() == __t.__node_alloc())
        __move_assign(__t, true_type());
    else
    {
        value_comp() = _VSTD::move(__t.value_comp());
        const_iterator __e = end();
        if (size() != 0)
        {
            __node_pointer __cache = __detach();
#ifndef _LIBCPP_NO_EXCEPTIONS
            try
            {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 1385 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
                while (__cache != nullptr && __t.size() != 0)
                {
                    __cache->__value_ = _VSTD::move(__t.remove(__t.begin())->__value_);
                    __node_pointer __next = __detach(__cache);
                    __node_insert_multi(__cache);
                    __cache = __next;
                }
#ifndef _LIBCPP_NO_EXCEPTIONS
            }
            catch (...)
            {
                while (__cache->__parent_ != nullptr)
                    __cache = static_cast<__node_pointer>(__cache->__parent_);
                destroy(__cache);
                throw;
            }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 1402 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
            if (__cache != nullptr)
            {
                while (__cache->__parent_ != nullptr)
                    __cache = static_cast<__node_pointer>(__cache->__parent_);
                destroy(__cache);
            }
        }
        while (__t.size() != 0)
            __insert_multi(__e, _VSTD::move(__t.remove(__t.begin())->__value_));
    }
}

template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>&
__tree<_Tp, _Compare, _Allocator>::operator=(__tree&& __t)
    _NOEXCEPT_(
        __node_traits::propagate_on_container_move_assignment::value &&
        is_nothrow_move_assignable<value_compare>::value &&
        is_nothrow_move_assignable<__node_allocator>::value)
        
{
    __move_assign(__t, integral_constant<bool,
                  __node_traits::propagate_on_container_move_assignment::value>());
    return *this;
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1429 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3

template <class _Tp, class _Compare, class _Allocator>
__tree<_Tp, _Compare, _Allocator>::~__tree()
{
    destroy(__root());
}

template <class _Tp, class _Compare, class _Allocator>
void
__tree<_Tp, _Compare, _Allocator>::destroy(__node_pointer __nd) _NOEXCEPT
{
    if (__nd != nullptr)
    {
        destroy(static_cast<__node_pointer>(__nd->__left_));
        destroy(static_cast<__node_pointer>(__nd->__right_));
        __node_allocator& __na = __node_alloc();
        __node_traits::destroy(__na, _VSTD::addressof(__nd->__value_));
        __node_traits::deallocate(__na, __nd, 1);
    }
}

template <class _Tp, class _Compare, class _Allocator>
void
__tree<_Tp, _Compare, _Allocator>::swap(__tree& __t)
    _NOEXCEPT_(
        __is_nothrow_swappable<value_compare>::value &&
        (!__node_traits::propagate_on_container_swap::value ||
         __is_nothrow_swappable<__node_allocator>::value))
{
    using _VSTD::swap;
    swap(__begin_node_, __t.__begin_node_);
    swap(__pair1_.first(), __t.__pair1_.first());
    __swap_alloc(__node_alloc(), __t.__node_alloc());
    __pair3_.swap(__t.__pair3_);
    __begin_node() = __end_node();
    __end_node()->__left_ = nullptr;
}

// Find lower_bound place to insert
// Set __parent to parent of null leaf
// Return reference to null leaf
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_leaf_low(typename __node_base::pointer& __parent,
                                                   const value_type& __v)
{
    __node_pointer __nd = __root();
    if (__nd != nullptr)
    {
        while (true)
        {
            if (value_comp()(__nd->__value_, __v))
            {
                if (__nd->__right_ != nullptr)
                    __nd = static_cast<__node_pointer>(__nd->__right_);
                else
                {
                    __parent = static_cast<__node_base_pointer>(__nd);
                    return __parent->__right_;
                }
            }
            else
            {
                if (__nd->__left_ != nullptr)
                    __nd = static_cast<__node_pointer>(__nd->__left_);
                else
                {
                    __parent = static_cast<__node_base_pointer>(__nd);
                    return __parent->__left_;
                }
            }
        }
    }
    __parent = static_cast<__node_base_pointer>(__end_node());
    return __parent->__left_;
}

// Find upper_bound place to insert
// Set __parent to parent of null leaf
// Return reference to null leaf
template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_leaf_high(typename __node_base::pointer& __parent,
                                                    const value_type& __v)
{
    __node_pointer __nd = __root();
    if (__nd != nullptr)
    {
        while (true)
        {
            if (value_comp()(__v, __nd->__value_))
            {
                if (__nd->__left_ != nullptr)
                    __nd = static_cast<__node_pointer>(__nd->__left_);
                else
                {
                    __parent = static_cast<__node_base_pointer>(__nd);
                    return __parent->__left_;
                }
            }
            else
            {
                if (__nd->__right_ != nullptr)
                    __nd = static_cast<__node_pointer>(__nd->__right_);
                else
                {
                    __parent = static_cast<__node_base_pointer>(__nd);
                    return __parent->__right_;
                }
            }
        }
    }
    __parent = static_cast<__node_base_pointer>(__end_node());
    return __parent->__left_;
}

// Find leaf place to insert closest to __hint
// First check prior to __hint.
// Next check after __hint.
// Next do O(log N) search.
// Set __parent to parent of null leaf
// Return reference to null leaf


// Find place to insert if __v doesn't exist
// Set __parent to parent of null leaf
// Return reference to null leaf
// If __v exists, set parent to node of __v and return reference to node of __v


// Find place to insert if __v doesn't exist
// First check prior to __hint.
// Next check after __hint.
// Next do O(log N) search.
// Set __parent to parent of null leaf
// Return reference to null leaf
// If __v exists, set parent to node of __v and return reference to node of __v
template <class _Tp, class _Compare, class _Allocator>
template <class _Key>
typename __tree<_Tp, _Compare, _Allocator>::__node_base::pointer&
__tree<_Tp, _Compare, _Allocator>::__find_equal(const_iterator __hint,
                                                typename __node_base::pointer& __parent,
                                                const _Key& __v)
{
    if (__hint == end() || value_comp()(__v, *__hint))  // check before
    {
        // __v <= *prev(__hint)
        return __find_equal(__parent, __v);
    }
    else if (value_comp()(*__hint, __v))  // check after
    {
        // *__hint < __v
        const_iterator __next = _VSTD::next(__hint);
        if (__next == end() || value_comp()(__v, *__next))
        {
            // *__hint < __v < *_VSTD::next(__hint)
            if (__hint.__ptr_->__right_ == nullptr)
            {
                __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
                return __parent->__right_;
            }
            else
            {
                __parent = static_cast<__node_base_pointer>(__next.__ptr_);
                return __parent->__left_;
            }
        }
        // *next(__hint) <= __v
        return __find_equal(__parent, __v);
    }
    // else __v == *__hint
    __parent = static_cast<__node_base_pointer>(__hint.__ptr_);
    return __parent;
}

template <class _Tp, class _Compare, class _Allocator>
void
__tree<_Tp, _Compare, _Allocator>::__insert_node_at(__node_base_pointer __parent,
                                                    __node_base_pointer& __child,
                                                    __node_base_pointer __new_node)
{
    __new_node->__left_   = nullptr;
    __new_node->__right_  = nullptr;
    __new_node->__parent_ = __parent;
    __child = __new_node;
    if (__begin_node()->__left_ != nullptr)
        __begin_node() = static_cast<__node_pointer>(__begin_node()->__left_);
    __tree_balance_after_insert(__end_node()->__left_, __child);
    ++size();
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Compare, class _Allocator>
template <class ..._Args>
typename __tree<_Tp, _Compare, _Allocator>::__node_holder
__tree<_Tp, _Compare, _Allocator>::__construct_node(_Args&& ...__args)
{
    __node_allocator& __na = __node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
    __h.get_deleter().__value_constructed = true;
    return __h;
}

template <class _Tp, class _Compare, class _Allocator>
template <class... _Args>
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
__tree<_Tp, _Compare, _Allocator>::__emplace_unique(_Args&&... __args)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
    __node_base_pointer __parent;
    __node_base_pointer& __child = __find_equal(__parent, __h->__value_);
    __node_pointer __r = static_cast<__node_pointer>(__child);
    bool __inserted = false;
    if (__child == nullptr)
    {
        __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
        __r = __h.release();
        __inserted = true;
    }
    return pair<iterator, bool>(iterator(__r), __inserted);
}

template <class _Tp, class _Compare, class _Allocator>
template <class... _Args>
typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__emplace_hint_unique(const_iterator __p, _Args&&... __args)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
    __node_base_pointer __parent;
    __node_base_pointer& __child = __find_equal(__p, __parent, __h->__value_);
    __node_pointer __r = static_cast<__node_pointer>(__child);
    if (__child == nullptr)
    {
        __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
        __r = __h.release();
    }
    return iterator(__r);
}

template <class _Tp, class _Compare, class _Allocator>
template <class... _Args>
typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__emplace_multi(_Args&&... __args)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
    __node_base_pointer __parent;
    __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
    __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
    return iterator(static_cast<__node_pointer>(__h.release()));
}

template <class _Tp, class _Compare, class _Allocator>
template <class... _Args>
typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__emplace_hint_multi(const_iterator __p,
                                                        _Args&&... __args)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
    __node_base_pointer __parent;
    __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_);
    __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
    return iterator(static_cast<__node_pointer>(__h.release()));
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1798 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3

template <class _Tp, class _Compare, class _Allocator>
template <class _Vp>
pair<typename __tree<_Tp, _Compare, _Allocator>::iterator, bool>
__tree<_Tp, _Compare, _Allocator>::__insert_unique(_Vp&& __v)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v));
    pair<iterator, bool> __r = __node_insert_unique(__h.get());
    if (__r.second)
        __h.release();
    return __r;
}

template <class _Tp, class _Compare, class _Allocator>
template <class _Vp>
typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__insert_unique(const_iterator __p, _Vp&& __v)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v));
    iterator __r = __node_insert_unique(__p, __h.get());
    if (__r.__ptr_ == __h.get())
        __h.release();
    return __r;
}

template <class _Tp, class _Compare, class _Allocator>
template <class _Vp>
typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__insert_multi(_Vp&& __v)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v));
    __node_base_pointer __parent;
    __node_base_pointer& __child = __find_leaf_high(__parent, __h->__value_);
    __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
    return iterator(__h.release());
}

template <class _Tp, class _Compare, class _Allocator>
template <class _Vp>
typename __tree<_Tp, _Compare, _Allocator>::iterator
__tree<_Tp, _Compare, _Allocator>::__insert_multi(const_iterator __p, _Vp&& __v)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Vp>(__v));
    __node_base_pointer __parent;
    __node_base_pointer& __child = __find_leaf(__p, __parent, __h->__value_);
    __insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
    return iterator(__h.release());
}

#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1848 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3

template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_holder
__tree<_Tp, _Compare, _Allocator>::__construct_node(const value_type& __v)
{
    __node_allocator& __na = __node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
    __h.get_deleter().__value_constructed = true;
    return _VSTD::move(__h);  // explicitly moved for C++03
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1861 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3

















template <class _Tp, class _Compare, class _Allocator>
typename __tree<_Tp, _Compare, _Allocator>::__node_holder
__tree<_Tp, _Compare, _Allocator>::remove(const_iterator __p) _NOEXCEPT
{
    __node_pointer __np = __p.__ptr_;
    if (__begin_node() == __np)
    {
        if (__np->__right_ != nullptr)
            __begin_node() = static_cast<__node_pointer>(__np->__right_);
        else
            __begin_node() = static_cast<__node_pointer>(__np->__parent_);
    }
    --size();
    __tree_remove(__end_node()->__left_,
                  static_cast<__node_base_pointer>(__np));
    return __node_holder(__np, _Dp(__node_alloc()));
}



_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP___TREE
# 2310 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree" 3
# 424 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <iterator>
#endif /* expanded by -frewrite-includes */
# 425 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
#if 0 /* expanded by -frewrite-includes */
#include <memory>
#endif /* expanded by -frewrite-includes */
# 426 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
#if 0 /* expanded by -frewrite-includes */
#include <utility>
#endif
# 433 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Key, class _CP, class _Compare, bool = is_empty<_Compare>::value
#if __has_feature(is_final)
                                                        && !__is_final(_Compare)
#endif
# 440 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
         >
class __map_value_compare
    : private _Compare
{
public:
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Key& __x, const _CP& __y) const
        {return static_cast<const _Compare&>(*this)(__x, __y.__cc.first);}

#if _LIBCPP_STD_VER > 11
    template <typename _K2>
    _LIBCPP_INLINE_VISIBILITY
    typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
    operator () ( const _K2& __x, const _CP& __y ) const
        {return static_cast<const _Compare&>(*this) (__x, __y.__cc.first);}

    template <typename _K2>
    _LIBCPP_INLINE_VISIBILITY
    typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
    operator () (const _CP& __x, const _K2& __y) const
        {return static_cast<const _Compare&>(*this) (__x.__cc.first, __y);}
#endif
# 478 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
};

template <class _Key, class _CP, class _Compare>
class __map_value_compare<_Key, _CP, _Compare, false>
{
    _Compare comp;

public:
    _LIBCPP_INLINE_VISIBILITY
    __map_value_compare()
        _NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)
        : comp() {}
    _LIBCPP_INLINE_VISIBILITY
    __map_value_compare(_Compare c)
        _NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value)
        : comp(c) {}
    _LIBCPP_INLINE_VISIBILITY
    const _Compare& key_comp() const _NOEXCEPT {return comp;}

    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _CP& __x, const _CP& __y) const
        {return comp(__x.__cc.first, __y.__cc.first);}
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _CP& __x, const _Key& __y) const
        {return comp(__x.__cc.first, __y);}
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Key& __x, const _CP& __y) const
        {return comp(__x, __y.__cc.first);}

#if _LIBCPP_STD_VER > 11
    template <typename _K2>
    _LIBCPP_INLINE_VISIBILITY
    typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
    operator () ( const _K2& __x, const _CP& __y ) const
        {return comp (__x, __y.__cc.first);}

    template <typename _K2>
    _LIBCPP_INLINE_VISIBILITY
    typename enable_if<__is_transparent<_Compare, _K2>::value, bool>::type
    operator () (const _CP& __x, const _K2& __y) const
        {return comp (__x.__cc.first, __y);}
#endif
# 520 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
};

template <class _Allocator>
class __map_node_destructor
{
    typedef _Allocator                          allocator_type;
    typedef allocator_traits<allocator_type>    __alloc_traits;
    typedef typename __alloc_traits::value_type::value_type value_type;
public:
    typedef typename __alloc_traits::pointer    pointer;
private:
    typedef typename value_type::value_type::first_type     first_type;
    typedef typename value_type::value_type::second_type    second_type;

    allocator_type& __na_;

    ;

public:
    bool __first_constructed;
    bool __second_constructed;

    _LIBCPP_INLINE_VISIBILITY
    explicit __map_node_destructor(allocator_type& __na) _NOEXCEPT
        : __na_(__na),
          __first_constructed(false),
          __second_constructed(false)
        {}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    __map_node_destructor(__tree_node_destructor<allocator_type>&& __x) _NOEXCEPT
        : __na_(__x.__na_),
          __first_constructed(__x.__value_constructed),
          __second_constructed(__x.__value_constructed)
        {
            __x.__value_constructed = false;
        }
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 559 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

    _LIBCPP_INLINE_VISIBILITY
    void operator()(pointer __p) _NOEXCEPT
    {
        if (__second_constructed)
            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__cc.second));
        if (__first_constructed)
            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.__cc.first));
        if (__p)
            __alloc_traits::deallocate(__na_, __p, 1);
    }
};

template <class _Key, class _Tp, class _Compare, class _Allocator>
    class map;
template <class _Key, class _Tp, class _Compare, class _Allocator>
    class multimap;
template <class _TreeIterator> class __map_const_iterator;

#if __cplusplus >= 201103L

template <class _Key, class _Tp>
union __value_type
{
    typedef _Key                                     key_type;
    typedef _Tp                                      mapped_type;
    typedef pair<const key_type, mapped_type>        value_type;
    typedef pair<key_type, mapped_type>              __nc_value_type;

    value_type __cc;
    __nc_value_type __nc;

    template <class ..._Args>
    _LIBCPP_INLINE_VISIBILITY
    __value_type(_Args&& ...__args)
        : __cc(std::forward<_Args>(__args)...) {}

    _LIBCPP_INLINE_VISIBILITY
    __value_type(const __value_type& __v)
        : __cc(__v.__cc) {}

    _LIBCPP_INLINE_VISIBILITY
    __value_type(__value_type& __v)
        : __cc(__v.__cc) {}

    template <class _A0>
    _LIBCPP_INLINE_VISIBILITY
    __value_type(const _A0& __a0)
        : __cc(__a0) {}

    template <class _A0, class _A1>
    _LIBCPP_INLINE_VISIBILITY
    __value_type(const _A0& __a0, const _A1& __a1)
        : __cc(__a0, __a1) {}
};

#endif
# 646 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

template <class _TreeIterator>
class _LIBCPP_TYPE_VIS_ONLY __map_iterator
{
    _TreeIterator __i_;

    typedef typename _TreeIterator::__pointer_traits             __pointer_traits;
    typedef const typename _TreeIterator::value_type::value_type::first_type __key_type;
    typedef typename _TreeIterator::value_type::value_type::second_type      __mapped_type;
public:
    typedef bidirectional_iterator_tag                           iterator_category;
    typedef pair<__key_type, __mapped_type>                      value_type;
    typedef typename _TreeIterator::difference_type              difference_type;
    typedef value_type&                                          reference;
    typedef typename __pointer_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<value_type>
#else
# 664 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
            rebind<value_type>::other
#endif
# 666 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
                                                                 pointer;

    _LIBCPP_INLINE_VISIBILITY
    __map_iterator() _NOEXCEPT {}

    _LIBCPP_INLINE_VISIBILITY
    __map_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}

    _LIBCPP_INLINE_VISIBILITY
    reference operator*() const {return __i_->__cc;}
    _LIBCPP_INLINE_VISIBILITY
    pointer operator->() const {return pointer_traits<pointer>::pointer_to(__i_->__cc);}

    _LIBCPP_INLINE_VISIBILITY
    __map_iterator& operator++() {++__i_; return *this;}
    _LIBCPP_INLINE_VISIBILITY
    __map_iterator operator++(int)
    {
        __map_iterator __t(*this);
        ++(*this);
        return __t;
    }

    _LIBCPP_INLINE_VISIBILITY
    __map_iterator& operator--() {--__i_; return *this;}
    _LIBCPP_INLINE_VISIBILITY
    __map_iterator operator--(int)
    {
        __map_iterator __t(*this);
        --(*this);
        return __t;
    }

    
    

    template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY map;
    template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multimap;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator;
};

template <class _TreeIterator>
class _LIBCPP_TYPE_VIS_ONLY __map_const_iterator
{
    _TreeIterator __i_;

    typedef typename _TreeIterator::__pointer_traits             __pointer_traits;
    typedef const typename _TreeIterator::value_type::value_type::first_type __key_type;
    typedef typename _TreeIterator::value_type::value_type::second_type      __mapped_type;
public:
    typedef bidirectional_iterator_tag                           iterator_category;
    typedef pair<__key_type, __mapped_type>                      value_type;
    typedef typename _TreeIterator::difference_type              difference_type;
    typedef const value_type&                                    reference;
    typedef typename __pointer_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<const value_type>
#else
# 729 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
            rebind<const value_type>::other
#endif
# 731 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
                                                                 pointer;

    _LIBCPP_INLINE_VISIBILITY
    __map_const_iterator() _NOEXCEPT {}

    _LIBCPP_INLINE_VISIBILITY
    __map_const_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}
    _LIBCPP_INLINE_VISIBILITY
    __map_const_iterator(
            __map_iterator<typename _TreeIterator::__non_const_iterator> __i)
                _NOEXCEPT
                : __i_(__i.__i_) {}

    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_INLINE_VISIBILITY
    __map_const_iterator operator--(int)
    {
        __map_const_iterator __t(*this);
        --(*this);
        return __t;
    }

    
    

    template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY map;
    template <class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY multimap;
    template <class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY __tree_const_iterator;
};

template <class _Key, class _Tp, class _Compare = less<_Key>,
          class _Allocator = allocator<pair<const _Key, _Tp> > >
class _LIBCPP_TYPE_VIS_ONLY map
{
public:
    // types:
    typedef _Key                                     key_type;
    typedef _Tp                                      mapped_type;
    typedef pair<const key_type, mapped_type>        value_type;
    typedef pair<key_type, mapped_type>              __nc_value_type;
    typedef _Compare                                 key_compare;
    typedef _Allocator                               allocator_type;
    typedef value_type&                              reference;
    typedef const value_type&                        const_reference;

    class _LIBCPP_TYPE_VIS_ONLY value_compare
        : public binary_function<value_type, value_type, bool>
    {
        friend class map;
    protected:
        key_compare comp;

        _LIBCPP_INLINE_VISIBILITY value_compare(key_compare c) : comp(c) {}
    public:
        _LIBCPP_INLINE_VISIBILITY
        bool operator()(const value_type& __x, const value_type& __y) const
            {return comp(__x.first, __y.first);}
    };

private:

    typedef _VSTD::__value_type<key_type, mapped_type>             __value_type;
    typedef __map_value_compare<key_type, __value_type, key_compare> __vc;
    typedef typename allocator_traits<allocator_type>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind_alloc<__value_type>
#else
# 818 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
            rebind_alloc<__value_type>::other
#endif
# 820 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
                                                           __allocator_type;
    typedef __tree<__value_type, __vc, __allocator_type>   __base;
    typedef typename __base::__node_traits                 __node_traits;
    typedef allocator_traits<allocator_type>               __alloc_traits;

    __base __tree_;

public:
    typedef typename __alloc_traits::pointer               pointer;
    typedef typename __alloc_traits::const_pointer         const_pointer;
    typedef typename __alloc_traits::size_type             size_type;
    typedef typename __alloc_traits::difference_type       difference_type;
    typedef __map_iterator<typename __base::iterator>      iterator;
    typedef __map_const_iterator<typename __base::const_iterator> const_iterator;
    typedef _VSTD::reverse_iterator<iterator>               reverse_iterator;
    typedef _VSTD::reverse_iterator<const_iterator>         const_reverse_iterator;

    _LIBCPP_INLINE_VISIBILITY
    explicit map(const key_compare& __comp = key_compare())
        _NOEXCEPT_(
            is_nothrow_default_constructible<allocator_type>::value &&
            is_nothrow_default_constructible<key_compare>::value &&
            is_nothrow_copy_constructible<key_compare>::value)
        : __tree_(__vc(__comp)) {}

    _LIBCPP_INLINE_VISIBILITY
    explicit map(const key_compare& __comp, const allocator_type& __a)
        : __tree_(__vc(__comp), __a) {}

    template <class _InputIterator>
    _LIBCPP_INLINE_VISIBILITY
        map(_InputIterator __f, _InputIterator __l,
            const key_compare& __comp = key_compare())
        : __tree_(__vc(__comp))
        {
            insert(__f, __l);
        }

    template <class _InputIterator>
    _LIBCPP_INLINE_VISIBILITY
    map(const map& __m)
        : __tree_(__m.__tree_)
        {
            insert(__m.begin(), __m.end());
        }

    _LIBCPP_INLINE_VISIBILITY
    map& operator=(const map& __m)
        {
#if __cplusplus >= 201103L
            __tree_ = __m.__tree_;
#else
# 887 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
            __tree_.clear();
            __tree_.value_comp() = __m.__tree_.value_comp();
            __tree_.__copy_assign_alloc(__m.__tree_);
            insert(__m.begin(), __m.end());
#endif
# 892 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
            return *this;
        }

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

    _LIBCPP_INLINE_VISIBILITY
    map(map&& __m)
        _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
        : __tree_(_VSTD::move(__m.__tree_))
        {
        }

    map(map&& __m, const allocator_type& __a);

    _LIBCPP_INLINE_VISIBILITY
    map& operator=(map&& __m)
        _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
        {
            __tree_ = _VSTD::move(__m.__tree_);
            return *this;
        }

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 915 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

    _LIBCPP_INLINE_VISIBILITY
    map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
        : __tree_(__vc(__comp))
        {
            insert(__il.begin(), __il.end());
        }

    _LIBCPP_INLINE_VISIBILITY
    map(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)
        : __tree_(__vc(__comp), __a)
        {
            insert(__il.begin(), __il.end());
        }

#if _LIBCPP_STD_VER > 11
    _LIBCPP_INLINE_VISIBILITY 
    map(initializer_list<value_type> __il, const allocator_type& __a)
        : map(__il, key_compare(), __a) {}
#endif
# 937 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

    _LIBCPP_INLINE_VISIBILITY
    map& operator=(initializer_list<value_type> __il)
        {
            __tree_.__assign_unique(__il.begin(), __il.end());
            return *this;
        }

#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 946 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

    _LIBCPP_INLINE_VISIBILITY
    explicit map(const allocator_type& __a)
        : __tree_(__a)
        {
        }

    _LIBCPP_INLINE_VISIBILITY
    map(const map& __m, const allocator_type& __a)
        : __tree_(__m.__tree_.value_comp(), __a)
        {
            insert(__m.begin(), __m.end());
        }

    _LIBCPP_INLINE_VISIBILITY
          iterator begin() _NOEXCEPT {return __tree_.begin();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
    _LIBCPP_INLINE_VISIBILITY
          iterator end() _NOEXCEPT {return __tree_.end();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator end() const _NOEXCEPT {return __tree_.end();}

    _LIBCPP_INLINE_VISIBILITY
          reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rbegin() const _NOEXCEPT
        {return const_reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
          reverse_iterator rend() _NOEXCEPT
            {return       reverse_iterator(begin());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rend() const _NOEXCEPT
        {return const_reverse_iterator(begin());}

    _LIBCPP_INLINE_VISIBILITY
    const_iterator cbegin() const _NOEXCEPT {return begin();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator cend() const _NOEXCEPT {return end();}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crend() const _NOEXCEPT {return rend();}

    _LIBCPP_INLINE_VISIBILITY
    bool      empty() const _NOEXCEPT {return __tree_.size() == 0;}
    _LIBCPP_INLINE_VISIBILITY
    size_type size() const _NOEXCEPT {return __tree_.size();}
    _LIBCPP_INLINE_VISIBILITY
    size_type max_size() const _NOEXCEPT {return __tree_.max_size();}

    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    mapped_type& operator[](key_type&& __k);
#endif
# 1001 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

          ;
    ;

    _LIBCPP_INLINE_VISIBILITY
    allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
    _LIBCPP_INLINE_VISIBILITY
    key_compare    key_comp()      const {return __tree_.value_comp().key_comp();}
    _LIBCPP_INLINE_VISIBILITY
    value_compare  value_comp()    const {return value_compare(__tree_.value_comp().key_comp());}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS

    template <class ..._Args>
        pair<iterator, bool>
        emplace(_Args&& ...__args);

    template <class ..._Args>
        iterator
        emplace_hint(const_iterator __p, _Args&& ...__args);

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1024 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

    template <class _Pp,
              class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
        _LIBCPP_INLINE_VISIBILITY
        pair<iterator, bool> insert(_Pp&& __p)
            {return __tree_.__insert_unique(_VSTD::forward<_Pp>(__p));}

    template <class _Pp,
              class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
        _LIBCPP_INLINE_VISIBILITY
        iterator insert(const_iterator __pos, _Pp&& __p)
            {return __tree_.__insert_unique(__pos.__i_, _VSTD::forward<_Pp>(__p));}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1038 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

    _LIBCPP_INLINE_VISIBILITY
    pair<iterator, bool>
        insert(const value_type& __v) {return __tree_.__insert_unique(__v);}

    _LIBCPP_INLINE_VISIBILITY
    iterator
        insert(const_iterator __p, const value_type& __v)
            {return __tree_.__insert_unique(__p.__i_, __v);}

    template <class _InputIterator>
        _LIBCPP_INLINE_VISIBILITY
        void insert(_InputIterator __f, _InputIterator __l)
        {
            for (const_iterator __e = cend(); __f != __l; ++__f)
                insert(__e.__i_, *__f);
        }

#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

    _LIBCPP_INLINE_VISIBILITY
    void insert(initializer_list<value_type> __il)
        {insert(__il.begin(), __il.end());}

#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1063 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

    _LIBCPP_INLINE_VISIBILITY
    iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
    _LIBCPP_INLINE_VISIBILITY
    size_type erase(const key_type& __k)
        {return __tree_.__erase_unique(__k);}
    _LIBCPP_INLINE_VISIBILITY
    iterator  erase(const_iterator __f, const_iterator __l)
        {return __tree_.erase(__f.__i_, __l.__i_);}
    _LIBCPP_INLINE_VISIBILITY
    void clear() _NOEXCEPT {__tree_.clear();}

    _LIBCPP_INLINE_VISIBILITY
    pair<iterator,iterator> equal_range(const key_type& __k)
        {return __tree_.__equal_range_unique(__k);}
    _LIBCPP_INLINE_VISIBILITY
    pair<const_iterator,const_iterator> equal_range(const key_type& __k) const
        {return __tree_.__equal_range_unique(__k);}
#if _LIBCPP_STD_VER > 11
    template <typename _K2>
    _LIBCPP_INLINE_VISIBILITY
    typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
    equal_range(const _K2& __k)       {return __tree_.__equal_range_unique(__k);}
    template <typename _K2>
    _LIBCPP_INLINE_VISIBILITY
    typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
    equal_range(const _K2& __k) const {return __tree_.__equal_range_unique(__k);}
#endif
# 1149 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

private:
    typedef typename __base::__node                    __node;
    typedef typename __base::__node_allocator          __node_allocator;
    typedef typename __base::__node_pointer            __node_pointer;
    typedef typename __base::__node_const_pointer      __node_const_pointer;
    typedef typename __base::__node_base_pointer       __node_base_pointer;
    typedef typename __base::__node_base_const_pointer __node_base_const_pointer;
    typedef __map_node_destructor<__node_allocator> _Dp;
    typedef unique_ptr<__node, _Dp> __node_holder;

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    __node_holder __construct_node();
    template <class _A0>
        __node_holder __construct_node(_A0&& __a0);
    __node_holder __construct_node_with_key(key_type&& __k);
#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class _A0, class _A1, class ..._Args>
        __node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1169 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
#endif
# 1170 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
    ;

    ;
    ;
};

// Find place to insert if __k doesn't exist
// Set __parent to parent of null leaf
// Return reference to null leaf
// If __k exists, set parent to node of __k and return reference to node of __k


// Find __k
// Set __parent to parent of null leaf and
//    return reference to null leaf iv __k does not exist.
// If __k exists, set parent to node of __k and return reference to node of __k


#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Key, class _Tp, class _Compare, class _Allocator>
map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a)
    : __tree_(_VSTD::move(__m.__tree_), __a)
{
    if (__a != __m.get_allocator())
    {
        const_iterator __e = cend();
        while (!__m.empty())
            __tree_.__insert_unique(__e.__i_,
                    _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
    }
}

template <class _Key, class _Tp, class _Compare, class _Allocator>
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
map<_Key, _Tp, _Compare, _Allocator>::__construct_node()
{
    __node_allocator& __na = __tree_.__node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first));
    __h.get_deleter().__first_constructed = true;
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
    __h.get_deleter().__second_constructed = true;
    return __h;
}

template <class _Key, class _Tp, class _Compare, class _Allocator>
template <class _A0>
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
{
    __node_allocator& __na = __tree_.__node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0));
}

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Key, class _Tp, class _Compare, class _Allocator>
template <class _A0, class _A1, class ..._Args>
typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
map<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args)
{
    __node_allocator& __na = __tree_.__node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
                             _VSTD::forward<_A0>(__a0), _VSTD::forward<_A1>(__a1),
                             _VSTD::forward<_Args>(__args)...);
    __h.get_deleter().__first_constructed = true;
    __h.get_deleter().__second_constructed = true;
    return __h;
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1340 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1342 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3





#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Key, class _Tp, class _Compare, class _Allocator>
_Tp&
map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k)
{
    __node_base_pointer __parent;
    __node_base_pointer& __child = __find_equal_key(__parent, __k);
    __node_pointer __r = static_cast<__node_pointer>(__child);
    if (__child == nullptr)
    {
        __node_holder __h = __construct_node_with_key(_VSTD::move(__k));
        __tree_.__insert_node_at(__parent, __child, static_cast<__node_base_pointer>(__h.get()));
        __r = __h.release();
    }
    return __r->__value_.__cc.second;
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1391 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3





#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)

template <class _Key, class _Tp, class _Compare, class _Allocator>
template <class ..._Args>
pair<typename map<_Key, _Tp, _Compare, _Allocator>::iterator, bool>
map<_Key, _Tp, _Compare, _Allocator>::emplace(_Args&& ...__args)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
    pair<iterator, bool> __r = __tree_.__node_insert_unique(__h.get());
    if (__r.second)
        __h.release();
    return __r;
}

template <class _Key, class _Tp, class _Compare, class _Allocator>
template <class ..._Args>
typename map<_Key, _Tp, _Compare, _Allocator>::iterator
map<_Key, _Tp, _Compare, _Allocator>::emplace_hint(const_iterator __p,
                                                   _Args&& ...__args)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
    iterator __r = __tree_.__node_insert_unique(__p.__i_, __h.get());
    if (__r.__i_.__ptr_ == __h.get())
        __h.release();
    return __r;
}

#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
# 1446 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3















template <class _Key, class _Tp, class _Compare = less<_Key>,
          class _Allocator = allocator<pair<const _Key, _Tp> > >
class _LIBCPP_TYPE_VIS_ONLY multimap
{
public:
    // types:
    typedef _Key                                     key_type;
    typedef _Tp                                      mapped_type;
    typedef pair<const key_type, mapped_type>        value_type;
    typedef pair<key_type, mapped_type>              __nc_value_type;
    typedef _Compare                                 key_compare;
    typedef _Allocator                               allocator_type;
    typedef value_type&                              reference;
    typedef const value_type&                        const_reference;

    class _LIBCPP_TYPE_VIS_ONLY value_compare
        : public binary_function<value_type, value_type, bool>
    {
        friend class multimap;
    protected:
        key_compare comp;

        _LIBCPP_INLINE_VISIBILITY
        value_compare(key_compare c) : comp(c) {}
    public:
        _LIBCPP_INLINE_VISIBILITY
        bool operator()(const value_type& __x, const value_type& __y) const
            {return comp(__x.first, __y.first);}
    };

private:

    typedef _VSTD::__value_type<key_type, mapped_type>             __value_type;
    typedef __map_value_compare<key_type, __value_type, key_compare> __vc;
    typedef typename allocator_traits<allocator_type>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind_alloc<__value_type>
#else
# 1549 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
            rebind_alloc<__value_type>::other
#endif
# 1551 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
                                                                    __allocator_type;
    typedef __tree<__value_type, __vc, __allocator_type>            __base;
    typedef typename __base::__node_traits                          __node_traits;
    typedef allocator_traits<allocator_type>                        __alloc_traits;

    __base __tree_;

public:
    typedef typename __alloc_traits::pointer               pointer;
    typedef typename __alloc_traits::const_pointer         const_pointer;
    typedef typename __alloc_traits::size_type             size_type;
    typedef typename __alloc_traits::difference_type       difference_type;
    typedef __map_iterator<typename __base::iterator>      iterator;
    typedef __map_const_iterator<typename __base::const_iterator> const_iterator;
    typedef _VSTD::reverse_iterator<iterator>               reverse_iterator;
    typedef _VSTD::reverse_iterator<const_iterator>         const_reverse_iterator;

    _LIBCPP_INLINE_VISIBILITY
    explicit multimap(const key_compare& __comp = key_compare())
        _NOEXCEPT_(
            is_nothrow_default_constructible<allocator_type>::value &&
            is_nothrow_default_constructible<key_compare>::value &&
            is_nothrow_copy_constructible<key_compare>::value)
        : __tree_(__vc(__comp)) {}

    _LIBCPP_INLINE_VISIBILITY
    explicit multimap(const key_compare& __comp, const allocator_type& __a)
        : __tree_(__vc(__comp), __a) {}

    template <class _InputIterator>
        _LIBCPP_INLINE_VISIBILITY
        multimap(_InputIterator __f, _InputIterator __l,
            const key_compare& __comp = key_compare())
        : __tree_(__vc(__comp))
        {
            insert(__f, __l);
        }

    template <class _InputIterator>
        _LIBCPP_INLINE_VISIBILITY
        multimap(_InputIterator __f, _InputIterator __l,
            const key_compare& __comp, const allocator_type& __a)
        : __tree_(__vc(__comp), __a)
        {
# 1624 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
            return *this;
        }

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

    _LIBCPP_INLINE_VISIBILITY
    multimap(multimap&& __m)
        _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
        : __tree_(_VSTD::move(__m.__tree_))
        {
        }

    multimap(multimap&& __m, const allocator_type& __a);

    _LIBCPP_INLINE_VISIBILITY
    multimap& operator=(multimap&& __m)
        _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
        {
            __tree_ = _VSTD::move(__m.__tree_);
            return *this;
        }

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1647 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

    _LIBCPP_INLINE_VISIBILITY
    multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
        : __tree_(__vc(__comp))
        {
            insert(__il.begin(), __il.end());
        }

    _LIBCPP_INLINE_VISIBILITY
    multimap(initializer_list<value_type> __il, const key_compare& __comp, const allocator_type& __a)
        : __tree_(__vc(__comp), __a)
        {
            insert(__il.begin(), __il.end());
        }

#if _LIBCPP_STD_VER > 11
    _LIBCPP_INLINE_VISIBILITY 
    multimap(initializer_list<value_type> __il, const allocator_type& __a)
        : multimap(__il, key_compare(), __a) {}
#endif
# 1669 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

    _LIBCPP_INLINE_VISIBILITY
    multimap& operator=(initializer_list<value_type> __il)
        {
            __tree_.__assign_multi(__il.begin(), __il.end());
            return *this;
        }

#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1678 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

    _LIBCPP_INLINE_VISIBILITY
    explicit multimap(const allocator_type& __a)
        : __tree_(__a)
        {
        }

    _LIBCPP_INLINE_VISIBILITY
    multimap(const multimap& __m, const allocator_type& __a)
        : __tree_(__m.__tree_.value_comp(), __a)
        {
            insert(__m.begin(), __m.end());
        }

    _LIBCPP_INLINE_VISIBILITY
          iterator begin() _NOEXCEPT {return __tree_.begin();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator begin() const _NOEXCEPT {return __tree_.begin();}
    _LIBCPP_INLINE_VISIBILITY
          iterator end() _NOEXCEPT {return __tree_.end();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator end() const _NOEXCEPT {return __tree_.end();}

    _LIBCPP_INLINE_VISIBILITY
          reverse_iterator rbegin() _NOEXCEPT {return reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rbegin() const _NOEXCEPT
        {return const_reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
          reverse_iterator rend() _NOEXCEPT {return reverse_iterator(begin());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rend() const _NOEXCEPT
        {return const_reverse_iterator(begin());}

    _LIBCPP_INLINE_VISIBILITY
    const_iterator cbegin()  const _NOEXCEPT {return begin();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator cend() const _NOEXCEPT {return end();}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crbegin() const _NOEXCEPT {return rbegin();}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crend() const _NOEXCEPT {return rend();}

    _LIBCPP_INLINE_VISIBILITY
    bool empty() const _NOEXCEPT {return __tree_.size() == 0;}
    _LIBCPP_INLINE_VISIBILITY
    size_type size() const _NOEXCEPT {return __tree_.size();}
    _LIBCPP_INLINE_VISIBILITY
    size_type max_size() const _NOEXCEPT {return __tree_.max_size();}

    _LIBCPP_INLINE_VISIBILITY
    allocator_type get_allocator() const _NOEXCEPT {return __tree_.__alloc();}
    _LIBCPP_INLINE_VISIBILITY
    key_compare    key_comp() const {return __tree_.value_comp().key_comp();}
    _LIBCPP_INLINE_VISIBILITY
    value_compare  value_comp() const
        {return value_compare(__tree_.value_comp().key_comp());}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS

    template <class ..._Args>
        iterator
        emplace(_Args&& ...__args);

    template <class ..._Args>
        iterator
        emplace_hint(const_iterator __p, _Args&& ...__args);

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1748 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

    template <class _Pp,
              class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
        _LIBCPP_INLINE_VISIBILITY
        iterator insert(_Pp&& __p)
            {return __tree_.__insert_multi(_VSTD::forward<_Pp>(__p));}

    template <class _Pp,
              class = typename enable_if<is_constructible<value_type, _Pp>::value>::type>
        _LIBCPP_INLINE_VISIBILITY
        iterator insert(const_iterator __pos, _Pp&& __p)
            {return __tree_.__insert_multi(__pos.__i_, _VSTD::forward<_Pp>(__p));}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1762 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

    _LIBCPP_INLINE_VISIBILITY
    iterator insert(const value_type& __v) {return __tree_.__insert_multi(__v);}

    _LIBCPP_INLINE_VISIBILITY
    iterator insert(const_iterator __p, const value_type& __v)
            {return __tree_.__insert_multi(__p.__i_, __v);}

    _LIBCPP_INLINE_VISIBILITY
    size_type      count(const key_type& __k) const
        {return __tree_.__count_multi(__k);}
    _LIBCPP_INLINE_VISIBILITY
    iterator lower_bound(const key_type& __k)
        {return __tree_.lower_bound(__k);}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator lower_bound(const key_type& __k) const
            {return __tree_.lower_bound(__k);}
#if _LIBCPP_STD_VER > 11
    template <typename _K2>
    _LIBCPP_INLINE_VISIBILITY
    typename enable_if<__is_transparent<_Compare, _K2>::value,iterator>::type
    lower_bound(const _K2& __k)       {return __tree_.lower_bound(__k);}

    template <typename _K2>
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_INLINE_VISIBILITY
    typename enable_if<__is_transparent<_Compare, _K2>::value,pair<iterator,iterator>>::type
    equal_range(const _K2& __k)       {return __tree_.__equal_range_multi(__k);}
    template <typename _K2>
    _LIBCPP_INLINE_VISIBILITY
    typename enable_if<__is_transparent<_Compare, _K2>::value,pair<const_iterator,const_iterator>>::type
    equal_range(const _K2& __k) const {return __tree_.__equal_range_multi(__k);}
#endif
# 1870 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3

private:
    typedef typename __base::__node                    __node;
    typedef typename __base::__node_allocator          __node_allocator;
    typedef typename __base::__node_pointer            __node_pointer;
    typedef typename __base::__node_const_pointer      __node_const_pointer;
    typedef __map_node_destructor<__node_allocator> _Dp;
    typedef unique_ptr<__node, _Dp> __node_holder;

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    __node_holder __construct_node();
    template <class _A0>
        __node_holder
         __construct_node(_A0&& __a0);
#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class _A0, class _A1, class ..._Args>
        __node_holder __construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args);
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1888 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1889 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
};

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Key, class _Tp, class _Compare, class _Allocator>
multimap<_Key, _Tp, _Compare, _Allocator>::multimap(multimap&& __m, const allocator_type& __a)
    : __tree_(_VSTD::move(__m.__tree_), __a)
{
    if (__a != __m.get_allocator())
    {
        const_iterator __e = cend();
        while (!__m.empty())
            __tree_.__insert_multi(__e.__i_,
                    _VSTD::move(__m.__tree_.remove(__m.begin().__i_)->__value_));
    }
}

template <class _Key, class _Tp, class _Compare, class _Allocator>
typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node()
{
    __node_allocator& __na = __tree_.__node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first));
    __h.get_deleter().__first_constructed = true;
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
    __h.get_deleter().__second_constructed = true;
    return __h;
}

template <class _Key, class _Tp, class _Compare, class _Allocator>
template <class _A0>
typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0)
{
    __node_allocator& __na = __tree_.__node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_A0>(__a0));
    __h.get_deleter().__first_constructed = true;
    __h.get_deleter().__second_constructed = true;
    return __h;
}

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Key, class _Tp, class _Compare, class _Allocator>
template <class _A0, class _A1, class ..._Args>
typename multimap<_Key, _Tp, _Compare, _Allocator>::__node_holder
multimap<_Key, _Tp, _Compare, _Allocator>::__construct_node(_A0&& __a0, _A1&& __a1, _Args&& ...__args)
{
    __node_allocator& __na = __tree_.__node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_),
                             _VSTD::forward<_A0>(__a0), _VSTD::forward<_A1>(__a1),
                             _VSTD::forward<_Args>(__args)...);
    __h.get_deleter().__first_constructed = true;
    __h.get_deleter().__second_constructed = true;
    return __h;
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1950 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES













_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_MAP
# 2046 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map" 3
# 29 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h" 2
#ifndef OS_WIN
#if 0 /* expanded by -frewrite-includes */
#include <unistd.h>
#endif /* expanded by -frewrite-includes */
# 35 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"
#endif
# 36 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/command_line.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/command_line.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This class works with command lines: building and parsing.
// Switches can optionally have a value attached using an equals sign,
// as in "-switch=value".  Arguments that aren't prefixed with a
// switch prefix are considered "loose parameters".  Switch names are
// case-insensitive.  An argument of "--" will terminate switch
// parsing, causing everything after to be considered as loose
// parameters.

// There is a singleton read-only CommandLine that represents the command
// line that the current process was started with.  It must be initialized
// in main() (or whatever the platform's equivalent function is).

#ifndef BASE_COMMAND_LINE_H_
#define BASE_COMMAND_LINE_H_

#if 0 /* expanded by -frewrite-includes */
#include "build/build_config.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/command_line.h"

#if 0 /* expanded by -frewrite-includes */
#include <map>
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/command_line.h"
#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 24 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/command_line.h"
#if 0 /* expanded by -frewrite-includes */
#include <vector>
#endif /* expanded by -frewrite-includes */
# 25 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/command_line.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 27 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/command_line.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/logging.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/logging.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_LOGGING_H_
#define BASE_LOGGING_H_

# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/logging.h"

#ifdef NO_CHROMIUM_LOGGING
#if 0 /* expanded by -frewrite-includes */
#include <sstream>
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/logging.h"
#endif
# 17 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/logging.h"

// Replace the Chromium logging code with NSPR-based logging code and
// some C++ wrappers to emulate std::ostream

namespace mozilla {

enum LogSeverity {
  LOG_INFO,
  LOG_WARNING,
  LOG_ERROR,
  LOG_ERROR_REPORT,
  LOG_FATAL,
  LOG_0 = LOG_ERROR
};

class Logger
{
public:
  Logger(LogSeverity severity, const char* file, int line)
    : mSeverity(severity)
    , mFile(file)
    , mLine(line)
    , mMsg(NULL)
  { }

  ~Logger();

  // not private so that the operator<< overloads can get to it
  ;

private:
  static PRLogModuleInfo* gChromiumPRLog;
  ;

  LogSeverity mSeverity;
  const char* mFile;
  int mLine;
  char* mMsg;

  DISALLOW_EVIL_CONSTRUCTORS(Logger);
};

class LogWrapper
{
public:
  LogWrapper(LogSeverity severity, const char* file, int line) :
    log(severity, file, line) { }

  operator Logger&() const { return log; }

private:
  mutable Logger log;

  DISALLOW_EVIL_CONSTRUCTORS(LogWrapper);
};

struct EmptyLog
{
};

} // namespace mozilla

mozilla::Logger& operator<<(mozilla::Logger& log, const char* s);
;
;
;
;



#ifdef NO_CHROMIUM_LOGGING
#define CHROMIUM_LOG(info) std::stringstream()
#define LOG_IF(info, condition) if (!(condition)) std::stringstream()
#else
# 95 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/logging.h"
#define CHROMIUM_LOG(info) mozilla::LogWrapper(mozilla::LOG_ ## info, __FILE__, __LINE__)
#define LOG_IF(info, condition) \
  if (!(condition)) mozilla::LogWrapper(mozilla::LOG_ ## info, __FILE__, __LINE__)
#endif
# 99 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/logging.h"


#ifdef DEBUG
#define DLOG(info) CHROMIUM_LOG(info)
#define DLOG_IF(info) LOG_IF(info)
#define DCHECK(condition) CHECK(condition)
#else
# 106 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/logging.h"
#define DLOG(info) mozilla::EmptyLog()
#define DLOG_IF(info, condition) mozilla::EmptyLog()
#define DCHECK(condition) while (false && (condition)) mozilla::EmptyLog()
#endif
# 110 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/logging.h"

#undef LOG_ASSERT
#define LOG_ASSERT(cond) CHECK(0)
#define DLOG_ASSERT(cond) DCHECK(0)

#define NOTREACHED() CHROMIUM_LOG(ERROR)
#define NOTIMPLEMENTED() CHROMIUM_LOG(ERROR)

#undef CHECK
#define CHECK(condition) LOG_IF(FATAL, condition)

#define DCHECK_EQ(v1, v2) DCHECK((v1) == (v2))
#define DCHECK_NE(v1, v2) DCHECK((v1) != (v2))
#define DCHECK_LE(v1, v2) DCHECK((v1) <= (v2))
#define DCHECK_LT(v1, v2) DCHECK((v1) < (v2))
#define DCHECK_GE(v1, v2) DCHECK((v1) >= (v2))
#define DCHECK_GT(v1, v2) DCHECK((v1) > (v2))

#endif  // BASE_LOGGING_H_
# 129 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/logging.h"
# 28 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/command_line.h" 2

class InProcessBrowserTest;

class CommandLine {
 public:
  

  

  // Returns true if this command line contains the given switch.

  // The singleton CommandLine instance representing the current process's
  // command line.
  static CommandLine* current_process_commandline_;

  // We store a platform-native version of the command line, used when building
  // up a new command line to be executed.  This ifdef delimits that code.

#if defined(OS_WIN)
  // The quoted, space-separated command-line string.
  std::wstring command_line_string_;

  // The name of the program.
  std::wstring program_;

  // The type of native command line arguments.
  typedef std::wstring StringType;

#elif defined(OS_POSIX)
# 160 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/command_line.h"
  // The argv array, with the program name in argv_[0].
  std::vector<std::string> argv_;

  // The type of native command line arguments.
  typedef std::string StringType;

  // Shared by the two POSIX constructor forms.  Initalize from argv_.
  ;
#endif
# 169 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/command_line.h"

  // Returns true and fills in |switch_string| and |switch_value|
  // if |parameter_string| represents a switch.
  ;

  // Parsed-out values.
  std::map<std::string, StringType> switches_;

  // Non-switch command-line arguments.
  std::vector<StringType> loose_values_;

  // We allow copy constructors, because a common pattern is to grab a
  // copy of the current process's command line and then add some
  // flags to it.  E.g.:
  //   CommandLine cl(*CommandLine::ForCurrentProcess());
  //   cl.AppendSwitch(...);
};

#endif  // BASE_COMMAND_LINE_H_
# 190 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/command_line.h"
# 38 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/process.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_PROCESS_H_
#define BASE_PROCESS_H_

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process.h"

#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process.h"
#ifdef OS_WIN
#if 0 /* expanded by -frewrite-includes */
#include <windows.h>
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process.h"
#endif
# 14 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process.h"

namespace base {

// ProcessHandle is a platform specific type which represents the underlying OS
// handle to a process.
// ProcessId is a number which identifies the process in the OS.
#if defined(OS_WIN)
typedef HANDLE ProcessHandle;
typedef DWORD ProcessId;
#elif defined(OS_POSIX)
# 24 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process.h"
// On POSIX, our ProcessHandle will just be the PID.
typedef pid_t ProcessHandle;
typedef pid_t ProcessId;
#endif
# 28 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process.h"

class Process {
 public:
  
  

  // A handle to the current process.
  ;

  // Get/Set the handle for this process. The handle will be 0 if the process
  // is no longer running.
  
  
  size_t last_working_set_size_;
};

}  // namespace base

#endif  // BASE_PROCESS_H_
# 80 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process.h"
# 39 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h" 2

#if defined(OS_WIN)
typedef PROCESSENTRY32 ProcessEntry;
typedef IO_COUNTERS IoCounters;
#elif defined(OS_POSIX)
# 44 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"
// TODO(port): we should not rely on a Win32 structure.
struct ProcessEntry {
  int pid;
  int ppid;
  char szExeFile[NAME_MAX + 1];
};

struct IoCounters {
  unsigned long long ReadOperationCount;
  unsigned long long WriteOperationCount;
  unsigned long long OtherOperationCount;
  unsigned long long ReadTransferCount;
  unsigned long long WriteTransferCount;
  unsigned long long OtherTransferCount;
};

#if 0 /* expanded by -frewrite-includes */
#include "base/file_descriptor_shuffle.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_descriptor_shuffle.h" 1
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_FILE_DESCRIPTOR_SHUFFLE_H_
#define BASE_FILE_DESCRIPTOR_SHUFFLE_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_descriptor_shuffle.h"

// This code exists to perform the shuffling of file descriptors which is
// commonly needed when forking subprocesses. The naive approve is very simple,
// just call dup2 to setup the desired descriptors, but wrong. It's tough to
// handle the edge cases (like mapping 0 -> 1, 1 -> 0) correctly.
//
// In order to unittest this code, it's broken into the abstract action (an
// injective multimap) and the concrete code for dealing with file descriptors.
// Users should use the code like this:
//   base::InjectiveMultimap file_descriptor_map;
//   file_descriptor_map.push_back(base::InjectionArc(devnull, 0, true));
//   file_descriptor_map.push_back(base::InjectionArc(devnull, 2, true));
//   file_descriptor_map.push_back(base::InjectionArc(pipe[1], 1, true));
//   base::ShuffleFileDescriptors(file_descriptor_map);
//
// and trust the the Right Thing will get done.

#if 0 /* expanded by -frewrite-includes */
#include <vector>
#endif /* expanded by -frewrite-includes */
# 27 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_descriptor_shuffle.h"

namespace base {

// A Delegate which performs the actions required to perform an injective
// multimapping in place.
class InjectionDelegate {
 public:
  // Duplicate |fd|, an element of the domain, and write a fresh element of the
  // domain into |result|. Returns true iff successful.
  virtual bool Duplicate(int* result, int fd) = 0;
  // Destructively move |src| to |dest|, overwriting |dest|. Returns true iff
  // successful.
  virtual bool Move(int src, int dest) = 0;
  // Delete an element of the domain.
  virtual void Close(int fd) = 0;
};

// An implementation of the InjectionDelegate interface using the file
// descriptor table of the current process as the domain.
class FileDescriptorTableInjection : public InjectionDelegate {
  virtual bool Duplicate(int* result, int fd) MOZ_OVERRIDE;
  virtual bool Move(int src, int dest) MOZ_OVERRIDE;
  virtual void Close(int fd) MOZ_OVERRIDE;
};

// A single arc of the directed graph which describes an injective multimapping.
struct InjectionArc {
  InjectionArc(int in_source, int in_dest, bool in_close)
      : source(in_source),
        dest(in_dest),
        close(in_close) {
  }

  int source;
  int dest;
  bool close;  // if true, delete the source element after performing the
               // mapping.
};

typedef std::vector<InjectionArc> InjectiveMultimap;

bool PerformInjectiveMultimap(const InjectiveMultimap& map,
                              InjectionDelegate* delegate);
bool PerformInjectiveMultimapDestructive(InjectiveMultimap* map,
                                         InjectionDelegate* delegate);

// This function will not call malloc but will mutate |map|
static inline bool ShuffleFileDescriptors(InjectiveMultimap *map) {
  FileDescriptorTableInjection delegate;
  return PerformInjectiveMultimapDestructive(map, &delegate);
}

}  // namespace base

#endif  // !BASE_FILE_DESCRIPTOR_SHUFFLE_H_
# 82 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_descriptor_shuffle.h"
# 61 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h" 2
#endif
# 62 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"

#if defined(OS_MACOSX)
struct kinfo_proc;
#endif
# 66 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"

namespace base {

// These can be used in a 32-bit bitmask.
enum ProcessArchitecture {
  PROCESS_ARCH_I386 = 0x1,
  PROCESS_ARCH_X86_64 = 0x2,
  PROCESS_ARCH_PPC = 0x4,
  PROCESS_ARCH_ARM = 0x8
};

// Returns the ProcessHandle of the current process.
;

enum ChildPrivileges {
  PRIVILEGES_DEFAULT,
  PRIVILEGES_UNPRIVILEGED,
  PRIVILEGES_INHERIT,
  PRIVILEGES_LAST
};

#if defined(OS_WIN)
// Runs the given application name with the given command line. Normally, the
// first command line argument should be the path to the process, and don't
// forget to quote it.
//
// If wait is true, it will block and wait for the other process to finish,
// otherwise, it will just continue asynchronously.
//
// Example (including literal quotes)
// in process_handle if that pointer is non-null.
//
// Note that the first argument in argv must point to the filename,
// and must be fully specified.
typedef std::vector<std::pair<int, int> > file_handle_mapping_vector;
;

typedef std::map<std::string, std::string> environment_map;
;
;
#endif
# 191 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"

// Adjust the privileges of this process to match |privs|.  Only
// returns if privileges were successfully adjusted.
;
// methods.
class ProcessMetrics {
 public:
  // Creates a ProcessMetrics for the specified process.
  // The caller owns the returned object.
  ;

  ;

  // Returns the CPU usage in percent since the last time this method was
  // called. The first time this method is called it returns 0 and will return
  // the actual CPU info on subsequent calls.
  // Note that on multi-processor machines, the CPU usage value is for all
  // CPUs. So if you have 2 CPUs and your process is using all the cycles
  // of 1 CPU and not the other CPU, this method returns 50.
  ;

 private:
  ;

  ProcessHandle process_;

  int processor_count_;

  // Used to store the previous times so we can compute the CPU usage.
  int64_t last_time_;
  int64_t last_system_time_;

  DISALLOW_EVIL_CONSTRUCTORS(ProcessMetrics);
};

}  // namespace base

namespace mozilla {

class EnvironmentLog
{
public:
  

  

  

private:
  std::string fname_;

  DISALLOW_EVIL_CONSTRUCTORS(EnvironmentLog);
};

} // namespace mozilla

#if defined(OS_WIN)
// Undo the windows.h damage
#undef GetMessage
#undef CreateEvent
#undef GetClassName
#undef GetBinaryType
#undef RemoveDirectory
#endif
# 312 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"

#endif  // BASE_PROCESS_UTIL_H_
# 314 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/process_util.h"
# 11 "../../dist/include/ipc/IPCMessageUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/ipc_message_utils.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_IPC_MESSAGE_UTILS_H_
#define CHROME_COMMON_IPC_MESSAGE_UTILS_H_

#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h"
#if 0 /* expanded by -frewrite-includes */
#include <vector>
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h"
#if 0 /* expanded by -frewrite-includes */
#include <map>
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/file_path.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_path.h" 1
// Copyright (c) 2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// pathnames on Windows.
//
// Because a FilePath object should not be instantiated at the global scope,
// instead, use a FilePath::CharType[] and initialize it with
// FILE_PATH_LITERAL.  At runtime, a FilePath object can be created from the
// character array.  Example:
//
// | const FilePath::CharType kLogFileName[] = FILE_PATH_LITERAL("log.txt");
// |
// | void Function() {
// |   FilePath log_file_path(kLogFileName);
// |   [...]
// | }

#ifndef BASE_FILE_PATH_H_
#define BASE_FILE_PATH_H_

#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 69 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_path.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 71 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_path.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/compiler_specific.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/compiler_specific.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_COMPILER_SPECIFIC_H_
#define BASE_COMPILER_SPECIFIC_H_

#if 0 /* expanded by -frewrite-includes */
#include "build/build_config.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/compiler_specific.h"

#if defined(COMPILER_GCC)
#define ALLOW_UNUSED __attribute__((unused))
#define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else  // Not GCC
# 73 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/compiler_specific.h"
#define ALLOW_UNUSED
#define WARN_UNUSED_RESULT
#endif
# 76 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/compiler_specific.h"

#endif  // BASE_COMPILER_SPECIFIC_H_
# 78 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/compiler_specific.h"
# 72 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_path.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/hash_tables.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

//
// Deal with the differences between Microsoft and GNU implemenations
// of hash_map. Allows all platforms to use |base::hash_map| and
// |base::hash_set|.
//  eg:
//   base::hash_map<int> my_map;
//   base::hash_set<int> my_set;
//

#ifndef BASE_HASH_TABLES_H_
#define BASE_HASH_TABLES_H_

#if 0 /* expanded by -frewrite-includes */
#include "build/build_config.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/string16.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string16.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_STRING16_H_
#define BASE_STRING16_H_

// WHAT:
// A version of std::basic_string that provides 2-byte characters even when
// wchar_t is not implemented as a 2-byte type. You can access this class as
// string16. We also define char16, which string16 is based upon.

#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 30 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string16.h"
#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 31 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string16.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 33 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string16.h"

#if defined(WCHAR_T_IS_UTF16)

typedef wchar_t char16;
typedef std::wstring string16;

#elif defined(WCHAR_T_IS_UTF32)
# 40 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string16.h"

typedef uint16_t char16;

namespace base {

// char16 versions of the functions required by string16_char_traits; these
// are based on the wide character functions of similar names ("w" or "wcs"
// instead of "c16").
;
;
;
;
;
;

struct string16_char_traits {
  typedef char16 char_type;
  typedef int int_type;

  // int_type needs to be able to hold each possible value of char_type, and in
  // addition, the distinct value of eof().
  COMPILE_ASSERT(sizeof(int_type) > sizeof(char_type), unexpected_type_width);

  typedef std::streamoff off_type;
  typedef mbstate_t state_type;
  typedef std::fpos<state_type> pos_type;
  

  

  

  

  

  
};

}  // namespace base

// The string class will be explicitly instantiated only once, in string16.cc.
// stripping is enabled.  This bug causes the memory errors described above
// to occur even when a std::basic_string<> does not cross shared library
// boundaries, such as in statically-linked executables.
//
// TODO(mark): File this bug with Apple and update this note with a bug number.

extern template class std::basic_string<char16, base::string16_char_traits>;

typedef std::basic_string<char16, base::string16_char_traits> string16;

;

#endif  // WCHAR_T_IS_UTF32
# 172 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string16.h"

#endif  // BASE_STRING16_H_
# 174 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string16.h"
# 21 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h" 2

#if defined(COMPILER_MSVC) || (defined(ANDROID) && defined(_STLP_STD_NAME))
#ifdef COMPILER_MSVC
#pragma push_macro("_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS")
#define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
#endif
# 27 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h"
#if 0 /* expanded by -frewrite-includes */
#include <hash_map>
#endif /* expanded by -frewrite-includes */
# 28 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h"
#if 0 /* expanded by -frewrite-includes */
#include <hash_set>
#endif /* expanded by -frewrite-includes */
#elif defined(COMPILER_GCC)
# 42 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h"
// This is a hack to disable the gcc 4.4 warning about hash_map and hash_set
// being deprecated.  We can get rid of this when we upgrade to VS2008 and we
// can use <tr1/unordered_map> and <tr1/unordered_set>.
#ifdef __DEPRECATED
#define CHROME_OLD__DEPRECATED __DEPRECATED
#undef __DEPRECATED
#endif
# 49 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h"

#if 0 /* expanded by -frewrite-includes */
#include <ext/hash_map>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 1 3
// -*- C++ -*-
//===-------------------------- hash_map ----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_HASH_MAP
#define _LIBCPP_HASH_MAP

/*

    hash_map synopsis

#include <__config>
#endif /* expanded by -frewrite-includes */
# 203 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
#if 0 /* expanded by -frewrite-includes */
#include <__hash_table>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP__HASH_TABLE
#define _LIBCPP__HASH_TABLE

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
#if 0 /* expanded by -frewrite-includes */
#include <initializer_list>
#endif /* expanded by -frewrite-includes */
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
#if 0 /* expanded by -frewrite-includes */
#include <memory>
#endif /* expanded by -frewrite-includes */
# 17 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifdef min
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro min is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing min")
#else
# 16 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro min is incompatible with C++.  #undefing min
#endif
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef min
#endif
# 20 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3

#ifdef max
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro max is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing max")
#else
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro max is incompatible with C++.  #undefing max
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
#endif
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 22 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 2 3

#ifdef _LIBCPP_DEBUG
#if 0 /* expanded by -frewrite-includes */
#   include <__debug>
#endif /* expanded by -frewrite-includes */
# 25 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
#else
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
#   define _LIBCPP_ASSERT(x, m) ((void)0)
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 31 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
#endif
# 32 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

_LIBCPP_BEGIN_NAMESPACE_STD

_LIBCPP_FUNC_VIS
size_t __next_prime(size_t __n);

template <class _NodePtr>
struct __hash_node_base
{
    typedef __hash_node_base __first_node;

    _NodePtr    __next_;

    _LIBCPP_INLINE_VISIBILITY __hash_node_base() _NOEXCEPT : __next_(nullptr) {}
};

template <class _Tp, class _VoidPtr>
struct __hash_node
    : public __hash_node_base
             <
                 typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
                     rebind<__hash_node<_Tp, _VoidPtr> >
#else
# 56 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                     rebind<__hash_node<_Tp, _VoidPtr> >::other
#endif
# 58 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
             >
{
    typedef _Tp value_type;

    size_t     __hash_;
    value_type __value_;
};





inline _LIBCPP_INLINE_VISIBILITY
size_t
__next_pow2(size_t __n)
{
    return size_t(1) << (std::numeric_limits<size_t>::digits - __clz(__n-1));
}

template <class _Tp, class _Hash, class _Equal, class _Alloc> class __hash_table;
template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;
template <class _HashIterator> class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
    class _LIBCPP_TYPE_VIS_ONLY unordered_map;

template <class _NodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_iterator
{
    typedef _NodePtr __node_pointer;

    __node_pointer            __node_;

public:
    typedef forward_iterator_tag                         iterator_category;
    typedef typename pointer_traits<__node_pointer>::element_type::value_type value_type;
    typedef typename pointer_traits<__node_pointer>::difference_type difference_type;
    typedef value_type&                                  reference;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
                     rebind<value_type>
#else
# 110 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                     rebind<value_type>::other
#endif
# 112 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                                                         pointer;

    _LIBCPP_INLINE_VISIBILITY __hash_iterator() _NOEXCEPT
#if _LIBCPP_STD_VER > 11
    : __node_(nullptr)
#endif
# 118 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__insert_i(this);
#endif
# 122 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    }

#if _LIBCPP_DEBUG_LEVEL >= 2

    _LIBCPP_INLINE_VISIBILITY
    __hash_iterator(const __hash_iterator& __i)
        : __node_(__i.__node_)
    {
        __get_db()->__iterator_copy(this, &__i);
    }

    _LIBCPP_INLINE_VISIBILITY
    ~__hash_iterator()
    {
        __get_db()->__erase_i(this);
    }

    _LIBCPP_INLINE_VISIBILITY
    __hash_iterator& operator=(const __hash_iterator& __i)
    {
        if (this != &__i)
        {
            __get_db()->__iterator_copy(this, &__i);
            __node_ = __i.__node_;
        }
        return *this;
    }

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 151 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

    _LIBCPP_INLINE_VISIBILITY
        reference operator*() const
        {
        }

    _LIBCPP_INLINE_VISIBILITY
    __hash_iterator& operator++()
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to increment non-incrementable unordered container iterator");
#endif
# 178 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
        __node_ = __node_->__next_;
        return *this;
    }

    _LIBCPP_INLINE_VISIBILITY
    __hash_iterator operator++(int)
    {
        __hash_iterator __t(*this);
        ++(*this);
        return __t;
    }

    
    

private:
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_INLINE_VISIBILITY
    __hash_iterator(__node_pointer __node, const void* __c) _NOEXCEPT
        : __node_(__node)
        {
            __get_db()->__insert_ic(this, __c);
        }
#else
# 208 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    _LIBCPP_INLINE_VISIBILITY
    __hash_iterator(__node_pointer __node) _NOEXCEPT
        : __node_(__node)
        {}
#endif
# 213 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

    template <class, class, class, class> friend class __hash_table;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;
    template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_map;
    template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
};

template <class _ConstNodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator
{
    typedef _ConstNodePtr __node_pointer;

    __node_pointer         __node_;

    typedef typename remove_const<
        typename pointer_traits<__node_pointer>::element_type
                                 >::type __node;

public:
    typedef forward_iterator_tag                       iterator_category;
    typedef typename __node::value_type                value_type;
    typedef typename pointer_traits<__node_pointer>::difference_type difference_type;
    typedef const value_type&                          reference;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<const value_type>
#else
# 241 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            rebind<const value_type>::other
#endif
# 243 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                                                       pointer;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<__node>
#else
# 248 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            rebind<__node>::other
#endif
# 250 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                                                      __non_const_node_pointer;
    typedef __hash_iterator<__non_const_node_pointer> __non_const_iterator;

    _LIBCPP_INLINE_VISIBILITY __hash_const_iterator() _NOEXCEPT
#if _LIBCPP_STD_VER > 11
    : __node_(nullptr)
#endif
# 257 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__insert_i(this);
#endif
# 261 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    }
    _LIBCPP_INLINE_VISIBILITY 
    __hash_const_iterator(const __non_const_iterator& __x) _NOEXCEPT
        : __node_(__x.__node_)
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__iterator_copy(this, &__x);
#endif
# 269 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    }

#if _LIBCPP_DEBUG_LEVEL >= 2

    _LIBCPP_INLINE_VISIBILITY
    __hash_const_iterator(const __hash_const_iterator& __i)
        : __node_(__i.__node_)
    {
        }
        return *this;
    }

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 298 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

    _LIBCPP_INLINE_VISIBILITY
        reference operator*() const
        {
#if _LIBCPP_DEBUG_LEVEL >= 2
            _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                           "Attempted to dereference a non-dereferenceable unordered container const_iterator");
#endif
# 306 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            return __node_->__value_;
        }
    _LIBCPP_INLINE_VISIBILITY
        pointer operator->() const
        {
#if _LIBCPP_DEBUG_LEVEL >= 2
            _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                           "Attempted to dereference a non-dereferenceable unordered container const_iterator");
#endif
# 315 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            return pointer_traits<pointer>::pointer_to(__node_->__value_);
        }

    _LIBCPP_INLINE_VISIBILITY
    __hash_const_iterator& operator++()
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to increment non-incrementable unordered container const_iterator");
#endif
# 325 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
        __node_ = __node_->__next_;
        return *this;
    }

    _LIBCPP_INLINE_VISIBILITY
    __hash_const_iterator operator++(int)
    {
        __hash_const_iterator __t(*this);
        ++(*this);
        return __t;
    }

    
    

private:
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_INLINE_VISIBILITY
    __hash_const_iterator(__node_pointer __node, const void* __c) _NOEXCEPT
        : __node_(__node)
        {
            __get_db()->__insert_ic(this, __c);
        }
#else
# 355 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    _LIBCPP_INLINE_VISIBILITY
    __hash_const_iterator(__node_pointer __node) _NOEXCEPT
        : __node_(__node)
        {}
#endif
# 360 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

    template <class, class, class, class> friend class __hash_table;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
    template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_map;
    template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
};

template <class _ConstNodePtr> class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;

template <class _NodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_local_iterator
{
    typedef _NodePtr __node_pointer;

    __node_pointer         __node_;
    size_t                 __bucket_;
    size_t                 __bucket_count_;

    typedef pointer_traits<__node_pointer>          __pointer_traits;
public:
    typedef forward_iterator_tag                                iterator_category;
    typedef typename __pointer_traits::element_type::value_type value_type;
    typedef typename __pointer_traits::difference_type          difference_type;
    typedef value_type&                                         reference;
    typedef typename __pointer_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<value_type>
#else
# 388 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            rebind<value_type>::other
#endif
# 390 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                                                                pointer;

    _LIBCPP_INLINE_VISIBILITY __hash_local_iterator() _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__insert_i(this);
#endif
# 397 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    }

#if _LIBCPP_DEBUG_LEVEL >= 2

    _LIBCPP_INLINE_VISIBILITY
    {
        if (this != &__i)
        {
            __get_db()->__iterator_copy(this, &__i);
            __node_ = __i.__node_;
            __bucket_ = __i.__bucket_;
            __bucket_count_ = __i.__bucket_count_;
        }
        return *this;
    }

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 430 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

    _LIBCPP_INLINE_VISIBILITY
        reference operator*() const
        {
#if _LIBCPP_DEBUG_LEVEL >= 2
            _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                           "Attempted to dereference a non-dereferenceable unordered container local_iterator");
#endif
# 438 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            return __node_->__value_;
        }
    _LIBCPP_INLINE_VISIBILITY
        pointer operator->() const
        {
#if _LIBCPP_DEBUG_LEVEL >= 2
            _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                           "Attempted to dereference a non-dereferenceable unordered container local_iterator");
#endif
# 447 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            return pointer_traits<pointer>::pointer_to(__node_->__value_);
        }

    _LIBCPP_INLINE_VISIBILITY
    __hash_local_iterator& operator++()
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to increment non-incrementable unordered container local_iterator");
#endif
# 457 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
        __node_ = __node_->__next_;
        if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_)
            __node_ = nullptr;
        return *this;
    }

    _LIBCPP_INLINE_VISIBILITY
    __hash_local_iterator operator++(int)
    {
        __hash_local_iterator __t(*this);
        ++(*this);
        return __t;
    }
    template <class, class, class, class> friend class __hash_table;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator;
};

template <class _ConstNodePtr>
class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator
{
    typedef _ConstNodePtr __node_pointer;

    __node_pointer         __node_;
    size_t                 __bucket_;
    size_t                 __bucket_count_;

    typedef pointer_traits<__node_pointer>          __pointer_traits;
    typedef typename __pointer_traits::element_type __node;
    typedef typename remove_const<__node>::type     __non_const_node;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<__non_const_node>
#else
# 526 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            rebind<__non_const_node>::other
#endif
# 528 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                                                    __non_const_node_pointer;
    typedef __hash_local_iterator<__non_const_node_pointer>
                                                    __non_const_iterator;
public:
    typedef forward_iterator_tag                       iterator_category;
    typedef typename remove_const<
                        typename __pointer_traits::element_type::value_type
                     >::type                           value_type;
    typedef typename __pointer_traits::difference_type difference_type;
    typedef const value_type&                          reference;
    typedef typename __pointer_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<const value_type>
#else
# 542 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            rebind<const value_type>::other
#endif
# 544 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                                                       pointer;

    _LIBCPP_INLINE_VISIBILITY __hash_const_local_iterator() _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__insert_i(this);
#endif
# 551 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    }

    _LIBCPP_INLINE_VISIBILITY
    __hash_const_local_iterator(const __non_const_iterator& __x) _NOEXCEPT
        : __node_(__x.__node_),
          __bucket_(__x.__bucket_),
          __bucket_count_(__x.__bucket_count_)
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__iterator_copy(this, &__x);
#endif
# 562 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    }

#if _LIBCPP_DEBUG_LEVEL >= 2

    _LIBCPP_INLINE_VISIBILITY
    __hash_const_local_iterator(const __hash_const_local_iterator& __i)
        : __node_(__i.__node_),
          __bucket_(__i.__bucket_),
          __bucket_count_(__i.__bucket_count_)
            __node_ = __i.__node_;
            __bucket_ = __i.__bucket_;
            __bucket_count_ = __i.__bucket_count_;
        }
        return *this;
    }

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 595 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

    _LIBCPP_INLINE_VISIBILITY
        reference operator*() const
        {
#if _LIBCPP_DEBUG_LEVEL >= 2
            _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                           "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
#endif
# 603 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            return __node_->__value_;
        }
    _LIBCPP_INLINE_VISIBILITY
        pointer operator->() const
        {
#if _LIBCPP_DEBUG_LEVEL >= 2
            _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                           "Attempted to dereference a non-dereferenceable unordered container const_local_iterator");
#endif
# 612 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            return pointer_traits<pointer>::pointer_to(__node_->__value_);
        }

    _LIBCPP_INLINE_VISIBILITY
    __hash_const_local_iterator& operator++()
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to increment non-incrementable unordered container const_local_iterator");
#endif
# 622 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
        __node_ = __node_->__next_;
        if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_)
            __node_ = nullptr;
        return *this;
    }

    _LIBCPP_INLINE_VISIBILITY
    __hash_const_local_iterator operator++(int)
    {
        __hash_const_local_iterator __t(*this);
        ++(*this);
        return __t;
    }

    
    

private:
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_INLINE_VISIBILITY
    __hash_const_local_iterator(__node_pointer __node, size_t __bucket,
                                size_t __bucket_count, const void* __c) _NOEXCEPT
        : __node_(__node),
          __bucket_(__bucket),
          __bucket_count_(__bucket_count)
        }
#endif
# 670 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    template <class, class, class, class> friend class __hash_table;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
};

template <class _Alloc>
class __bucket_list_deallocator
{
    typedef _Alloc                                          allocator_type;
    typedef allocator_traits<allocator_type>                __alloc_traits;
    typedef typename __alloc_traits::size_type              size_type;

    __compressed_pair<size_type, allocator_type> __data_;
public:
    typedef typename __alloc_traits::pointer pointer;

    _LIBCPP_INLINE_VISIBILITY
    __bucket_list_deallocator()
        _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
        : __data_(0) {}

    _LIBCPP_INLINE_VISIBILITY
    __bucket_list_deallocator(const allocator_type& __a, size_type __size)
        _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
        : __data_(__size, __a) {}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

    _LIBCPP_INLINE_VISIBILITY
    __bucket_list_deallocator(__bucket_list_deallocator&& __x)
        _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
        : __data_(_VSTD::move(__x.__data_))
    {
        __x.size() = 0;
    }

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 706 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

    _LIBCPP_INLINE_VISIBILITY
    size_type& size() _NOEXCEPT {return __data_.first();}
    _LIBCPP_INLINE_VISIBILITY
    size_type  size() const _NOEXCEPT {return __data_.first();}

    _LIBCPP_INLINE_VISIBILITY
    allocator_type& __alloc() _NOEXCEPT {return __data_.second();}
    _LIBCPP_INLINE_VISIBILITY
    const allocator_type& __alloc() const _NOEXCEPT {return __data_.second();}

    _LIBCPP_INLINE_VISIBILITY
    void operator()(pointer __p) _NOEXCEPT
    {
        __alloc_traits::deallocate(__alloc(), __p, size());
    }
};

template <class _Alloc> class __hash_map_node_destructor;

template <class _Alloc>
class __hash_node_destructor
{
    typedef _Alloc                                          allocator_type;
    typedef allocator_traits<allocator_type>                __alloc_traits;
    typedef typename __alloc_traits::value_type::value_type value_type;
public:
    typedef typename __alloc_traits::pointer                pointer;
private:

    allocator_type& __na_;

    ;

public:
    bool __value_constructed;

    _LIBCPP_INLINE_VISIBILITY
    explicit __hash_node_destructor(allocator_type& __na,
                                    bool __constructed = false) _NOEXCEPT
        : __na_(__na),
          __value_constructed(__constructed)
        {}

    _LIBCPP_INLINE_VISIBILITY
    void operator()(pointer __p) _NOEXCEPT
    {
        if (__value_constructed)
            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_));
        if (__p)
            __alloc_traits::deallocate(__na_, __p, 1);
    }

    template <class> friend class __hash_map_node_destructor;
};

template <class _Tp, class _Hash, class _Equal, class _Alloc>
class __hash_table
{
public:
    typedef _Tp    value_type;
    typedef _Hash  hasher;
    typedef _Equal key_equal;
    typedef _Alloc allocator_type;

private:
    typedef allocator_traits<allocator_type> __alloc_traits;
public:
    typedef value_type&                              reference;
    typedef const value_type&                        const_reference;
    typedef typename __alloc_traits::pointer         pointer;
    typedef typename __alloc_traits::const_pointer   const_pointer;
    typedef typename __alloc_traits::size_type       size_type;
    typedef typename __alloc_traits::difference_type difference_type;
public:
    // Create __node
    typedef __hash_node<value_type, typename __alloc_traits::void_pointer> __node;
    typedef typename __alloc_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind_alloc<__node>
#else
# 787 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            rebind_alloc<__node>::other
#endif
# 789 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                                                     __node_allocator;
    typedef allocator_traits<__node_allocator>       __node_traits;
    typedef typename __node_traits::pointer          __node_pointer;
    typedef typename __node_traits::pointer          __node_const_pointer;
    typedef __hash_node_base<__node_pointer>         __first_node;
    typedef typename pointer_traits<__node_pointer>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<__first_node>
#else
# 798 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            rebind<__first_node>::other
#endif
# 800 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                                                     __node_base_pointer;

private:

    typedef typename __node_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind_alloc<__node_pointer>
#else
# 808 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            rebind_alloc<__node_pointer>::other
#endif
# 810 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
                                                            __pointer_allocator;
    typedef __bucket_list_deallocator<__pointer_allocator> __bucket_list_deleter;
    typedef unique_ptr<__node_pointer[], __bucket_list_deleter> __bucket_list;
    typedef allocator_traits<__pointer_allocator>          __pointer_alloc_traits;
    typedef typename __bucket_list_deleter::pointer __node_pointer_pointer;

    // --- Member data begin ---
    __bucket_list                                     __bucket_list_;
    __compressed_pair<__first_node, __node_allocator> __p1_;
    __compressed_pair<size_type, hasher>              __p2_;
    __compressed_pair<float, key_equal>               __p3_;
    // --- Member data end ---

    _LIBCPP_INLINE_VISIBILITY
    size_type& size() _NOEXCEPT {return __p2_.first();}
public:
    _LIBCPP_INLINE_VISIBILITY
    size_type  size() const _NOEXCEPT {return __p2_.first();}

    _LIBCPP_INLINE_VISIBILITY
    hasher& hash_function() _NOEXCEPT {return __p2_.second();}
    _LIBCPP_INLINE_VISIBILITY
    const hasher& hash_function() const _NOEXCEPT {return __p2_.second();}

    _LIBCPP_INLINE_VISIBILITY
    float& max_load_factor() _NOEXCEPT {return __p3_.first();}
    _LIBCPP_INLINE_VISIBILITY
    float  max_load_factor() const _NOEXCEPT {return __p3_.first();}

    _LIBCPP_INLINE_VISIBILITY
    key_equal& key_eq() _NOEXCEPT {return __p3_.second();}
    _LIBCPP_INLINE_VISIBILITY
    const key_equal& key_eq() const _NOEXCEPT {return __p3_.second();}

    _LIBCPP_INLINE_VISIBILITY
    __node_allocator& __node_alloc() _NOEXCEPT {return __p1_.second();}
    _LIBCPP_INLINE_VISIBILITY
    const __node_allocator& __node_alloc() const _NOEXCEPT
        {return __p1_.second();}

public:
    typedef __hash_iterator<__node_pointer>                   iterator;
    typedef __hash_const_iterator<__node_pointer>             const_iterator;
    typedef __hash_local_iterator<__node_pointer>             local_iterator;
    typedef __hash_const_local_iterator<__node_pointer>       const_local_iterator;

    __hash_table()
        _NOEXCEPT_(
            is_nothrow_default_constructible<__bucket_list>::value &&
            is_nothrow_default_constructible<__first_node>::value &&
            is_nothrow_default_constructible<__node_allocator>::value &&
            is_nothrow_default_constructible<hasher>::value &&
            is_nothrow_default_constructible<key_equal>::value);
    __hash_table(const hasher& __hf, const key_equal& __eql);
    ;
    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    __hash_table(__hash_table&& __u)
        _NOEXCEPT_(
            is_nothrow_move_constructible<__bucket_list>::value &&
            is_nothrow_move_constructible<__first_node>::value &&
            is_nothrow_move_constructible<__node_allocator>::value &&
            is_nothrow_move_constructible<hasher>::value &&
            is_nothrow_move_constructible<key_equal>::value);
    __hash_table(__hash_table&& __u, const allocator_type& __a);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 879 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    ;

    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    __hash_table& operator=(__hash_table&& __u)
        _NOEXCEPT_(
            __node_traits::propagate_on_container_move_assignment::value &&
            is_nothrow_move_assignable<__node_allocator>::value &&
            is_nothrow_move_assignable<hasher>::value &&
            is_nothrow_move_assignable<key_equal>::value);
#endif
# 890 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    ;
    ;

    _LIBCPP_INLINE_VISIBILITY
    size_type max_size() const _NOEXCEPT
    {
        return allocator_traits<__pointer_allocator>::max_size(
            __bucket_list_.get_deleter().__alloc());
    }

    pair<iterator, bool> __node_insert_unique(__node_pointer __nd);
    ;
    ;

#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
    template <class... _Args>
        pair<iterator, bool> __emplace_unique(_Args&&... __args);
    template <class... _Args>
        iterator __emplace_multi(_Args&&... __args);
    template <class... _Args>
        iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args);
#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
# 915 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

    pair<iterator, bool> __insert_unique(const value_type& __x);

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template <class _Pp>
        pair<iterator, bool> __insert_unique(_Pp&& __x);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 922 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template <class _Pp>
        iterator __insert_multi(_Pp&& __x);
    template <class _Pp>
        iterator __insert_multi(const_iterator __p, _Pp&& __x);
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 929 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    ;
    ;
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 932 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

    void clear() _NOEXCEPT;
    void rehash(size_type __n);
    _LIBCPP_INLINE_VISIBILITY void reserve(size_type __n)
        {rehash(static_cast<size_type>(ceil(__n / max_load_factor())));}

    _LIBCPP_INLINE_VISIBILITY
    size_type bucket_count() const _NOEXCEPT
    {
        return __bucket_list_.get_deleter().size();
    }

    iterator       begin() _NOEXCEPT;
    iterator       end() _NOEXCEPT;
    const_iterator begin() const _NOEXCEPT;
    const_iterator end() const _NOEXCEPT;

    template <class _Key>
        _LIBCPP_INLINE_VISIBILITY
        size_type bucket(const _Key& __k) const
        {
            _LIBCPP_ASSERT(bucket_count() > 0,
                "unordered container::bucket(key) called when bucket_count() == 0");
            return __constrain_hash(hash_function()(__k), bucket_count());
        }

    ;
    ;

    typedef __hash_node_destructor<__node_allocator> _Dp;
    typedef unique_ptr<__node, _Dp> __node_holder;

    ;
    ;
    ;
    ;
    __node_holder remove(const_iterator __p) _NOEXCEPT;

    ;
    ;

    ;
    ;

    ;
    ;

    void swap(__hash_table& __u)
        _NOEXCEPT_(
            (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value ||
             __is_nothrow_swappable<__pointer_allocator>::value) &&
            (!__node_traits::propagate_on_container_swap::value ||
             __is_nothrow_swappable<__node_allocator>::value) &&
            __is_nothrow_swappable<hasher>::value &&
            __is_nothrow_swappable<key_equal>::value);

    _LIBCPP_INLINE_VISIBILITY
    size_type max_bucket_count() const _NOEXCEPT
        {return __pointer_alloc_traits::max_size(__bucket_list_.get_deleter().__alloc());}
    ;
    _LIBCPP_INLINE_VISIBILITY float load_factor() const _NOEXCEPT
    {
        size_type __bc = bucket_count();
        return __bc != 0 ? (float)size() / __bc : 0.f;
    }
    _LIBCPP_INLINE_VISIBILITY void max_load_factor(float __mlf) _NOEXCEPT
    {
        _LIBCPP_ASSERT(__mlf > 0,
            "unordered container::max_load_factor(lf) called with lf <= 0");
        max_load_factor() = _VSTD::max(__mlf, load_factor());
    }

    _LIBCPP_INLINE_VISIBILITY
    local_iterator
    begin(size_type __n)
    {
        _LIBCPP_ASSERT(__n < bucket_count(),
            "unordered container::begin(n) called with n >= bucket_count()");
#if _LIBCPP_DEBUG_LEVEL >= 2
        return local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
#else
# 1027 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
        return local_iterator(__bucket_list_[__n], __n, bucket_count());
#endif
# 1029 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    }

    _LIBCPP_INLINE_VISIBILITY
    local_iterator
    end(size_type __n)
    {
        _LIBCPP_ASSERT(__n < bucket_count(),
            "unordered container::end(n) called with n >= bucket_count()");
#if _LIBCPP_DEBUG_LEVEL >= 2
# 1066 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
        return const_local_iterator(nullptr, __n, bucket_count());
#endif
# 1068 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    }

#if _LIBCPP_DEBUG_LEVEL >= 2

    bool __dereferenceable(const const_iterator* __i) const;
    bool __decrementable(const const_iterator* __i) const;
    bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
    bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 1078 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

private:
    void __rehash(size_type __n);

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class ..._Args>
        __node_holder __construct_node(_Args&& ...__args);
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1087 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    __node_holder __construct_node(value_type&& __v, size_t __hash);
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1089 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    ;
#endif
# 1091 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    __node_holder __construct_node(const value_type& __v, size_t __hash);

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const __hash_table& __u)
        {__copy_assign_alloc(__u, integral_constant<bool,
             __node_traits::propagate_on_container_copy_assignment::value>());}
    void __copy_assign_alloc(const __hash_table& __u, true_type);
    _LIBCPP_INLINE_VISIBILITY
        void __copy_assign_alloc(const __hash_table&, false_type) {}

    void __move_assign(__hash_table& __u, false_type);
    void __move_assign(__hash_table& __u, true_type)
        _NOEXCEPT_(
            is_nothrow_move_assignable<__node_allocator>::value &&
            is_nothrow_move_assignable<hasher>::value &&
            is_nothrow_move_assignable<key_equal>::value);
    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__hash_table& __u)
        _NOEXCEPT_(
            !__node_traits::propagate_on_container_move_assignment::value ||
            (is_nothrow_move_assignable<__pointer_allocator>::value &&
             is_nothrow_move_assignable<__node_allocator>::value))
        {__move_assign_alloc(__u, integral_constant<bool,
             __node_traits::propagate_on_container_move_assignment::value>());}
    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__hash_table& __u, true_type)
        _NOEXCEPT_(
            is_nothrow_move_assignable<__pointer_allocator>::value &&
            is_nothrow_move_assignable<__node_allocator>::value)
    {
        __bucket_list_.get_deleter().__alloc() =
                _VSTD::move(__u.__bucket_list_.get_deleter().__alloc());
        __node_alloc() = _VSTD::move(__u.__node_alloc());
    }
    _LIBCPP_INLINE_VISIBILITY
        void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {}

    template <class _Ap>
    _LIBCPP_INLINE_VISIBILITY
    static
    void
    __swap_alloc(_Ap& __x, _Ap& __y)
        _NOEXCEPT_(
            !allocator_traits<_Ap>::propagate_on_container_swap::value ||
            __is_nothrow_swappable<_Ap>::value)
    {
        __swap_alloc(__x, __y,
                     integral_constant<bool,
                        allocator_traits<_Ap>::propagate_on_container_swap::value
                                      >());
    }

    template <class _Ap>
    _LIBCPP_INLINE_VISIBILITY
    static
    void
    __swap_alloc(_Ap& __x, _Ap& __y, true_type)
        _NOEXCEPT_(__is_nothrow_swappable<_Ap>::value)
    {
        using _VSTD::swap;
        swap(__x, __y);
    }

    template <class _Ap>
    _LIBCPP_INLINE_VISIBILITY
    static
    void
    __swap_alloc(_Ap&, _Ap&, false_type) _NOEXCEPT {}

    void __deallocate(__node_pointer __np) _NOEXCEPT;
    __node_pointer __detach() _NOEXCEPT;

    template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_map;
    template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY unordered_multimap;
};

template <class _Tp, class _Hash, class _Equal, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table()
    _NOEXCEPT_(
        is_nothrow_default_constructible<__bucket_list>::value &&
        is_nothrow_default_constructible<__first_node>::value &&
        is_nothrow_default_constructible<hasher>::value &&
        is_nothrow_default_constructible<key_equal>::value)
    : __p2_(0),
      __p3_(1.0f)
{
}

template <class _Tp, class _Hash, class _Equal, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const hasher& __hf,
                                                       const key_equal& __eql)
    : __bucket_list_(nullptr, __bucket_list_deleter()),
      __p1_(),
      __p2_(0, __hf),
      __p3_(1.0f, __eql)
{
}









#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u)
        _NOEXCEPT_(
            is_nothrow_move_constructible<__bucket_list>::value &&
            is_nothrow_move_constructible<__first_node>::value &&
            is_nothrow_move_constructible<hasher>::value &&
            is_nothrow_move_constructible<key_equal>::value)
    : __bucket_list_(_VSTD::move(__u.__bucket_list_)),
      __p1_(_VSTD::move(__u.__p1_)),
      __p2_(_VSTD::move(__u.__p2_)),
      __p3_(_VSTD::move(__u.__p3_))
{
    if (size() > 0)
    {
        __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
        __u.__p1_.first().__next_ = nullptr;
        __u.size() = 0;
    }
}

template <class _Tp, class _Hash, class _Equal, class _Alloc>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
                                                       const allocator_type& __a)
    : __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
      __p1_(__node_allocator(__a)),
      __p2_(0, _VSTD::move(__u.hash_function())),
      __p3_(_VSTD::move(__u.__p3_))
{
    if (__a == allocator_type(__u.__node_alloc()))
    {
        __bucket_list_.reset(__u.__bucket_list_.release());
        __bucket_list_.get_deleter().size() = __u.__bucket_list_.get_deleter().size();
        __u.__bucket_list_.get_deleter().size() = 0;
        if (__u.size() > 0)
        {
            __p1_.first().__next_ = __u.__p1_.first().__next_;
            __u.__p1_.first().__next_ = nullptr;
            __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
                static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
            size() = __u.size();
            __u.size() = 0;
        }
    }
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1283 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3




template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__deallocate(__node_pointer __np)
    _NOEXCEPT
{
    __node_allocator& __na = __node_alloc();
    while (__np != nullptr)
    {
        __node_pointer __next = __np->__next_;
#if _LIBCPP_DEBUG_LEVEL >= 2
        __c_node* __c = __get_db()->__find_c_and_lock(this);
        for (__i_node** __p = __c->end_; __p != __c->beg_; )
        {
            --__p;
            iterator* __i = static_cast<iterator*>((*__p)->__i_);
            if (__i->__node_ == __np)
            {
                (*__p)->__c_ = nullptr;
                if (--__c->end_ != __p)
                    memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
            }
        }
        __get_db()->unlock();
#endif
# 1347 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
        __node_traits::destroy(__na, _VSTD::addressof(__np->__value_));
        __node_traits::deallocate(__na, __np, 1);
        __np = __next;
    }
}

template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_pointer
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__detach() _NOEXCEPT
{
    size_type __bc = bucket_count();
    for (size_type __i = 0; __i < __bc; ++__i)
        __bucket_list_[__i] = nullptr;
    size() = 0;
    __node_pointer __cache = __p1_.first().__next_;
    __p1_.first().__next_ = nullptr;
    return __cache;
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
        __hash_table& __u, true_type)
    _NOEXCEPT_(
        is_nothrow_move_assignable<__node_allocator>::value &&
        is_nothrow_move_assignable<hasher>::value &&
        is_nothrow_move_assignable<key_equal>::value)
{
    clear();
    __bucket_list_.reset(__u.__bucket_list_.release());
    __bucket_list_.get_deleter().size() = __u.__bucket_list_.get_deleter().size();
    __u.__bucket_list_.get_deleter().size() = 0;
    __move_assign_alloc(__u);
    size() = __u.size();
    hash_function() = _VSTD::move(__u.hash_function());
    max_load_factor() = __u.max_load_factor();
    key_eq() = _VSTD::move(__u.key_eq());
    __p1_.first().__next_ = __u.__p1_.first().__next_;
    if (size() > 0)
    {
        __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] =
            static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
        __u.__p1_.first().__next_ = nullptr;
        __u.size() = 0;
    }
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->swap(this, &__u);
#endif
# 1397 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
}

template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__move_assign(
        __hash_table& __u, false_type)
{
    if (__node_alloc() == __u.__node_alloc())
        __move_assign(__u, true_type());
    else
    {
        hash_function() = _VSTD::move(__u.hash_function());
        key_eq() = _VSTD::move(__u.key_eq());
        max_load_factor() = __u.max_load_factor();
        if (bucket_count() != 0)
        {
            __node_pointer __cache = __detach();
#ifndef _LIBCPP_NO_EXCEPTIONS
            try
                throw;
            }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 1434 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
            __deallocate(__cache);
        }
        const_iterator __i = __u.begin();
        while (__u.size() != 0)
        {
            __node_holder __h =
                    __construct_node(_VSTD::move(__u.remove(__i++)->__value_));
            __node_insert_multi(__h.get());
            __h.release();
        }
    }
}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::clear() _NOEXCEPT
{
    if (size() > 0)
    {
        __deallocate(__p1_.first().__next_);
        __p1_.first().__next_ = nullptr;
        size_type __bc = bucket_count();
        for (size_type __i = 0; __i < __bc; ++__i)
            __bucket_list_[__i] = nullptr;
        size() = 0;
    }
}

template <class _Tp, class _Hash, class _Equal, class _Alloc>
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_insert_unique(__node_pointer __nd)
{
    __nd->__hash_ = hash_function()(__nd->__value_);
    size_type __bc = bucket_count();
    bool __inserted = false;
    __node_pointer __ndptr;
    size_t __chash;
    if (__bc != 0)
    {
        __chash = __constrain_hash(__nd->__hash_, __bc);
        __ndptr = __bucket_list_[__chash];
        if (__ndptr != nullptr)
        {
        }
        // insert_after __bucket_list_[__chash], or __first_node if bucket is null
        __node_pointer __pn = __bucket_list_[__chash];
        if (__pn == nullptr)
        {
            __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
            __nd->__next_ = __pn->__next_;
            __pn->__next_ = __nd;
            // fix up __bucket_list_
            __bucket_list_[__chash] = __pn;
            if (__nd->__next_ != nullptr)
                __bucket_list_[__constrain_hash(__nd->__next_->__hash_, __bc)] = __nd;
        }
        else
        {
            __nd->__next_ = __pn->__next_;
            __pn->__next_ = __nd;
        }
        __ndptr = __nd;
        // increment size
        ++size();
        __inserted = true;
    }
__done:
#if _LIBCPP_DEBUG_LEVEL >= 2
    return pair<iterator, bool>(iterator(__ndptr, this), __inserted);
#else
# 1653 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    return pair<iterator, bool>(iterator(__ndptr), __inserted);
#endif
# 1655 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
}





template <class _Tp, class _Hash, class _Equal, class _Alloc>
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(const value_type& __x)
{
    size_t __hash = hash_function()(__x);
    size_type __bc = bucket_count();
    bool __inserted = false;
    __node_pointer __nd;
    size_t __chash;
    if (__bc != 0)
    {
        __chash = __constrain_hash(__hash, __bc);
        __nd = __bucket_list_[__chash];
        if (__nd != nullptr)
        {
            for (__nd = __nd->__next_; __nd != nullptr &&
                                       __constrain_hash(__nd->__hash_, __bc) == __chash;
                                                           __nd = __nd->__next_)
            {
                if (key_eq()(__nd->__value_, __x))
                    goto __done;
            }
        }
    }
    {
        __node_holder __h = __construct_node(__x, __hash);
        if (size()+1 > __bc * max_load_factor() || __bc == 0)
        {
            rehash(_VSTD::max<size_type>(2 * __bc + !__is_power2(__bc),
                           size_type(ceil(float(size() + 1) / max_load_factor()))));
            __bc = bucket_count();
            __chash = __constrain_hash(__hash, __bc);
        }
        // insert_after __bucket_list_[__chash], or __first_node if bucket is null
        __node_pointer __pn = __bucket_list_[__chash];
        if (__pn == nullptr)
        {
            __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
            __h->__next_ = __pn->__next_;
            __pn->__next_ = __h.get();
            // fix up __bucket_list_
            __bucket_list_[__chash] = __pn;
            if (__h->__next_ != nullptr)
                __bucket_list_[__constrain_hash(__h->__next_->__hash_, __bc)] = __h.get();
        }
        else
        {
            __h->__next_ = __pn->__next_;
            __pn->__next_ = __h.get();
        }
        __nd = __h.release();
        // increment size
        ++size();
        __inserted = true;
    }
__done:
#if _LIBCPP_DEBUG_LEVEL >= 2
    return pair<iterator, bool>(iterator(__nd, this), __inserted);
#else
# 1814 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    return pair<iterator, bool>(iterator(__nd), __inserted);
#endif
# 1816 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class... _Args>
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_unique(_Args&&... __args)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
    pair<iterator, bool> __r = __node_insert_unique(__h.get());
    if (__r.second)
        __h.release();
    return __r;
}

template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class... _Args>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_multi(_Args&&... __args)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
    iterator __r = __node_insert_multi(__h.get());
    __h.release();
    return __r;
}

template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class... _Args>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__emplace_hint_multi(
        const_iterator __p, _Args&&... __args)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
        "unordered container::emplace_hint(const_iterator, args...) called with an iterator not"
        " referring to this unordered container");
#endif
# 1855 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    __node_holder __h = __construct_node(_VSTD::forward<_Args>(__args)...);
    iterator __r = __node_insert_multi(__p, __h.get());
    __h.release();
    return __r;
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1862 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _Pp>
pair<typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator, bool>
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_Pp&& __x)
{
    __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x));
    pair<iterator, bool> __r = __node_insert_unique(__h.get());
    if (__r.second)
        __h.release();
    return __r;
}

template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class _Pp>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::iterator
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_multi(const_iterator __p,
                                                         _Pp&& __x)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
        "unordered container::insert(const_iterator, rvalue) called with an iterator not"
        " referring to this unordered container");
#endif
# 1901 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    __node_holder __h = __construct_node(_VSTD::forward<_Pp>(__x));
    iterator __r = __node_insert_multi(__p, __h.get());
    __h.release();
    return __r;
}

#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1908 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3





#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1936 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::rehash(size_type __n)
{
    if (__n == 1)
        __n = 2;
    else if (__n & (__n - 1))
        __n = __next_prime(__n);
    size_type __bc = bucket_count();
    if (__n > __bc)
        __rehash(__n);
    else if (__n < __bc)
    {
        __n = _VSTD::max<size_type>
              (
                  __n,
                  __is_power2(__bc) ? __next_pow2(size_t(ceil(float(size()) / max_load_factor()))) :
                                      __next_prime(size_t(ceil(float(size()) / max_load_factor())))
              );
        if (__n < __bc)
            __rehash(__n);
    }
}

template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__rehash(size_type __nbc)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__invalidate_all(this);
#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 1968 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
    __pointer_allocator& __npa = __bucket_list_.get_deleter().__alloc();
    __bucket_list_.reset(__nbc > 0 ?
                      __pointer_alloc_traits::allocate(__npa, __nbc) : nullptr);
    __bucket_list_.get_deleter().size() = __nbc;
    if (__nbc > 0)
    {
        for (size_type __i = 0; __i < __nbc; ++__i)
            __bucket_list_[__i] = nullptr;
        __node_pointer __pp(static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())));
        __node_pointer __cp = __pp->__next_;
        if (__cp != nullptr)
        {
            size_type __chash = __constrain_hash(__cp->__hash_, __nbc);
            __bucket_list_[__chash] = __pp;
            size_type __phash = __chash;
            for (__pp = __cp, __cp = __cp->__next_; __cp != nullptr;
                                                           __cp = __pp->__next_)
            {
                __chash = __constrain_hash(__cp->__hash_, __nbc);
                if (__chash == __phash)
                    __pp = __cp;
                else
                {
                    if (__bucket_list_[__chash] == nullptr)
                    {
                        __bucket_list_[__chash] = __pp;
                        __pp = __cp;
                        __phash = __chash;
                    }
                    else
                    {
                        __node_pointer __np = __cp;
                        for (; __np->__next_ != nullptr &&
                               key_eq()(__cp->__value_, __np->__next_->__value_);
                                                           __np = __np->__next_)
                            ;
                        __pp->__next_ = __np->__next_;
                        __np->__next_ = __bucket_list_[__chash]->__next_;
                        __bucket_list_[__chash]->__next_ = __cp;

                    }
                }
            }
        }
    }
}





#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Hash, class _Equal, class _Alloc>
template <class ..._Args>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(_Args&& ...__args)
{
    __node_allocator& __na = __node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::forward<_Args>(__args)...);
    __h.get_deleter().__value_constructed = true;
    __h->__hash_ = hash_function()(__h->__value_);
    __h->__next_ = nullptr;
    return __h;
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2092 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(value_type&& __v,
                                                           size_t __hash)
{
    __node_allocator& __na = __node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), _VSTD::move(__v));
    __h.get_deleter().__value_constructed = true;
    __h->__hash_ = __hash;
    __h->__next_ = nullptr;
    return __h;
}

#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2108 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3



#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2123 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3

template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__construct_node(const value_type& __v,
                                                           size_t __hash)
{
    __node_allocator& __na = __node_alloc();
    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
    __node_traits::construct(__na, _VSTD::addressof(__h->__value_), __v);
    __h.get_deleter().__value_constructed = true;
    __h->__hash_ = __hash;
    __h->__next_ = nullptr;
    return _VSTD::move(__h);  // explicitly moved for C++03
}









template <class _Tp, class _Hash, class _Equal, class _Alloc>
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::__node_holder
__hash_table<_Tp, _Hash, _Equal, _Alloc>::remove(const_iterator __p) _NOEXCEPT
{
    // current node
    __node_pointer __cn = __p.__node_;
    size_type __bc = bucket_count();
    size_t __chash = __constrain_hash(__cn->__hash_, __bc);
    // find previous node
    __node_pointer __pn = __bucket_list_[__chash];
    for (; __pn->__next_ != __cn; __pn = __pn->__next_)
        ;
    // Fix up __bucket_list_
        // if __pn is not in same bucket (before begin is not in same bucket) &&
        //    if __cn->__next_ is not in same bucket (nullptr is not in same bucket)
    if (__pn == static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()))
                            || __constrain_hash(__pn->__hash_, __bc) != __chash)
    {
        if (__cn->__next_ == nullptr || __constrain_hash(__cn->__next_->__hash_, __bc) != __chash)
            __bucket_list_[__chash] = nullptr;
    }
        // if __cn->__next_ is not in same bucket (nullptr is in same bucket)
    if (__cn->__next_ != nullptr)
    {
        size_t __nhash = __constrain_hash(__cn->__next_->__hash_, __bc);
        if (__nhash != __chash)
            __bucket_list_[__nhash] = __pn;
    }
    // remove __cn
    __pn->__next_ = __cn->__next_;
    __cn->__next_ = nullptr;
    --size();
    return __node_holder(__cn, _Dp(__node_alloc(), true));
}













template <class _Tp, class _Hash, class _Equal, class _Alloc>
void
__hash_table<_Tp, _Hash, _Equal, _Alloc>::swap(__hash_table& __u)
    _NOEXCEPT_(
        (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value ||
         __is_nothrow_swappable<__pointer_allocator>::value) &&
        (!__node_traits::propagate_on_container_swap::value ||
         __is_nothrow_swappable<__node_allocator>::value) &&
        __is_nothrow_swappable<hasher>::value &&
        __is_nothrow_swappable<key_equal>::value)
{
    {
    __node_pointer_pointer __npp = __bucket_list_.release();
    __bucket_list_.reset(__u.__bucket_list_.release());
    __u.__bucket_list_.reset(__npp);
    }
    _VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size());
}





#if _LIBCPP_DEBUG_LEVEL >= 2

template <class _Tp, class _Hash, class _Equal, class _Alloc>
bool
__hash_table<_Tp, _Hash, _Equal, _Alloc>::__dereferenceable(const const_iterator* __i) const
{
    return __i->__node_ != nullptr;
}

template <class _Tp, class _Hash, class _Equal, class _Alloc>
{
    return false;
}

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 2455 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP__HASH_TABLE
# 2458 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__hash_table" 3
# 204 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <functional>
#endif /* expanded by -frewrite-includes */
# 205 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
#if 0 /* expanded by -frewrite-includes */
#include <stdexcept>
#endif /* expanded by -frewrite-includes */
# 206 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
#if 0 /* expanded by -frewrite-includes */
#include <ext/__hash>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash" 1 3
// -*- C++ -*-
//===------------------------- hash_set ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_EXT_HASH
#define _LIBCPP_EXT_HASH

#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 15 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash" 3

#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 17 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash" 3
#if 0 /* expanded by -frewrite-includes */
#include <cstring>
#endif /* expanded by -frewrite-includes */
# 18 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash" 3

namespace __gnu_cxx {
using namespace std;

template <typename _Tp> struct _LIBCPP_TYPE_VIS_ONLY hash : public std::hash<_Tp>
    { };

template <> struct _LIBCPP_TYPE_VIS_ONLY hash<const char*>
    : public unary_function<const char*, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(const char *__c) const _NOEXCEPT
    {
        return __do_string_hash(__c, __c + strlen(__c));
    }
};

template <> struct _LIBCPP_TYPE_VIS_ONLY hash<char *>
    : public unary_function<char*, size_t>
{
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(char *__c) const _NOEXCEPT
    {
        return __do_string_hash<const char *>(__c, __c + strlen(__c));
    }
};
}

#endif  // _LIBCPP_EXT_HASH
# 47 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/__hash" 3
# 207 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 2 3

namespace __gnu_cxx {

using namespace std;

template <class _Tp, class _Hash, bool = is_empty<_Hash>::value
#if __has_feature(is_final)
                                         && !__is_final(_Hash)
#endif
# 226 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
        >
class __hash_map_hasher
    : private _Hash
{
public:
    _LIBCPP_INLINE_VISIBILITY __hash_map_hasher() : _Hash() {}
    _LIBCPP_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : _Hash(__h) {}
    _LIBCPP_INLINE_VISIBILITY const _Hash& hash_function() const {return *this;}
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(const _Tp& __x) const
        {return static_cast<const _Hash&>(*this)(__x.first);}
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(const typename _Tp::first_type& __x) const
        {return static_cast<const _Hash&>(*this)(__x);}
};

template <class _Tp, class _Hash>
class __hash_map_hasher<_Tp, _Hash, false>
{
    _Hash __hash_;
public:
    _LIBCPP_INLINE_VISIBILITY __hash_map_hasher() : __hash_() {}
    _LIBCPP_INLINE_VISIBILITY __hash_map_hasher(const _Hash& __h) : __hash_(__h) {}
    _LIBCPP_INLINE_VISIBILITY const _Hash& hash_function() const {return __hash_;}
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(const _Tp& __x) const
        {return __hash_(__x.first);}
    _LIBCPP_INLINE_VISIBILITY
    size_t operator()(const typename _Tp::first_type& __x) const
        {return __hash_(__x);}
};

template <class _Tp, class _Pred, bool = is_empty<_Pred>::value
#if __has_feature(is_final)
                                         && !__is_final(_Pred)
#endif
# 262 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
         >
class __hash_map_equal
    : private _Pred
{
public:
    _LIBCPP_INLINE_VISIBILITY __hash_map_equal() : _Pred() {}
    _LIBCPP_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : _Pred(__p) {}
    _LIBCPP_INLINE_VISIBILITY const _Pred& key_eq() const {return *this;}
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Tp& __x, const _Tp& __y) const
        {return static_cast<const _Pred&>(*this)(__x.first, __y.first);}
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
        {return static_cast<const _Pred&>(*this)(__x, __y.first);}
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
        {return static_cast<const _Pred&>(*this)(__x.first, __y);}
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const typename _Tp::first_type& __x,
                    const typename _Tp::first_type& __y) const
        {return static_cast<const _Pred&>(*this)(__x, __y);}
};

template <class _Tp, class _Pred>
class __hash_map_equal<_Tp, _Pred, false>
{
    _Pred __pred_;
public:
    _LIBCPP_INLINE_VISIBILITY __hash_map_equal() : __pred_() {}
    _LIBCPP_INLINE_VISIBILITY __hash_map_equal(const _Pred& __p) : __pred_(__p) {}
    _LIBCPP_INLINE_VISIBILITY const _Pred& key_eq() const {return __pred_;}
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Tp& __x, const _Tp& __y) const
        {return __pred_(__x.first, __y.first);}
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const typename _Tp::first_type& __x, const _Tp& __y) const
        {return __pred_(__x, __y.first);}
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const _Tp& __x, const typename _Tp::first_type& __y) const
        {return __pred_(__x.first, __y);}
    _LIBCPP_INLINE_VISIBILITY
    bool operator()(const typename _Tp::first_type& __x,
                    const typename _Tp::first_type& __y) const
        {return __pred_(__x, __y);}
};

template <class _Alloc>
class __hash_map_node_destructor
{
    typedef _Alloc                              allocator_type;
    typedef allocator_traits<allocator_type>    __alloc_traits;
    typedef typename __alloc_traits::value_type::value_type value_type;
public:
    typedef typename __alloc_traits::pointer    pointer;
private:
    typedef typename value_type::first_type     first_type;
    typedef typename value_type::second_type    second_type;

    allocator_type& __na_;

    ;

public:
    bool __first_constructed;
    bool __second_constructed;

    _LIBCPP_INLINE_VISIBILITY
    explicit __hash_map_node_destructor(allocator_type& __na)
        : __na_(__na),
          __first_constructed(false),
          __second_constructed(false)
        {}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    __hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x)
        : __na_(__x.__na_),
          __first_constructed(__x.__value_constructed),
          __second_constructed(__x.__value_constructed)
        {
            __x.__value_constructed = false;
        }
#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 345 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
    _LIBCPP_INLINE_VISIBILITY
    __hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x)
        : __na_(__x.__na_),
          __first_constructed(__x.__value_constructed),
          __second_constructed(__x.__value_constructed)
        {
            const_cast<bool&>(__x.__value_constructed) = false;
        }
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 354 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3

    _LIBCPP_INLINE_VISIBILITY
    void operator()(pointer __p)
    {
        if (__second_constructed)
            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.second));
        if (__first_constructed)
            __alloc_traits::destroy(__na_, _VSTD::addressof(__p->__value_.first));
        if (__p)
            __alloc_traits::deallocate(__na_, __p, 1);
    }
};

template <class _HashIterator>
class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator
{
    _HashIterator __i_;

    typedef pointer_traits<typename _HashIterator::pointer>      __pointer_traits;
    typedef const typename _HashIterator::value_type::first_type key_type;

    
    

    template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY hash_map;
    template <class, class, class, class, class> friend class _LIBCPP_TYPE_VIS_ONLY hash_multimap;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator;
};

template <class _HashIterator>
class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator
{
    _HashIterator __i_;

    typedef pointer_traits<typename _HashIterator::pointer>      __pointer_traits;
    typedef const typename _HashIterator::value_type::first_type key_type;
    typedef typename _HashIterator::value_type::second_type      mapped_type;
public:
    typedef forward_iterator_tag                                 iterator_category;
    typedef pair<key_type, mapped_type>                          value_type;
    typedef typename _HashIterator::difference_type              difference_type;
    typedef const value_type&                                    reference;
    typedef typename __pointer_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<value_type>
#else
# 435 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
            rebind<value_type>::other
#endif
# 437 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
                                                                 pointer;

    _LIBCPP_INLINE_VISIBILITY __hash_map_const_iterator() {}

    _LIBCPP_INLINE_VISIBILITY
    __hash_map_const_iterator(_HashIterator __i) : __i_(__i) {}
    _LIBCPP_INLINE_VISIBILITY
    __hash_map_const_iterator(
            __hash_map_iterator<typename _HashIterator::__non_const_iterator> __i)
                : __i_(__i.__i_) {}

    _LIBCPP_INLINE_VISIBILITY
    reference operator*() const {return *operator->();}
    _LIBCPP_INLINE_VISIBILITY
    pointer operator->() const {return (pointer)__i_.operator->();}
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator;
    template <class> friend class _LIBCPP_TYPE_VIS_ONLY __hash_const_local_iterator;
};

template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
          class _Alloc = allocator<pair<const _Key, _Tp> > >
class _LIBCPP_TYPE_VIS_ONLY hash_map
{
public:
    // types
    typedef _Key                                           key_type;
    typedef _Tp                                            mapped_type;
    typedef _Tp                                            data_type;
    typedef _Hash                                          hasher;
    typedef _Pred                                          key_equal;
    typedef _Alloc                                         allocator_type;
    typedef pair<const key_type, mapped_type>              value_type;
    typedef value_type&                                    reference;
    typedef const value_type&                              const_reference;

private:
    typedef pair<key_type, mapped_type>                    __value_type;
    typedef __hash_map_hasher<__value_type, hasher>   __hasher;
    typedef __hash_map_equal<__value_type, key_equal> __key_equal;
    typedef typename allocator_traits<allocator_type>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind_alloc<__value_type>
#else
# 500 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
            rebind_alloc<__value_type>::other
#endif
# 502 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
                                                           __allocator_type;

    typedef __hash_table<__value_type, __hasher,
                         __key_equal,  __allocator_type>   __table;

    __table __table_;

    typedef typename __table::__node_pointer               __node_pointer;
    typedef typename __table::__node_const_pointer         __node_const_pointer;
    typedef typename __table::__node_traits                __node_traits;
    typedef typename __table::__node_allocator             __node_allocator;
    typedef typename __table::__node                       __node;
    typedef __hash_map_node_destructor<__node_allocator>   _Dp;
    typedef unique_ptr<__node, _Dp>                         __node_holder;
    typedef allocator_traits<allocator_type>               __alloc_traits;
public:
    typedef typename __alloc_traits::pointer         pointer;
    typedef typename __alloc_traits::const_pointer   const_pointer;
    typedef typename __alloc_traits::size_type       size_type;
    typedef typename __alloc_traits::difference_type difference_type;

    typedef __hash_map_iterator<typename __table::iterator>       iterator;
    typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;

    _LIBCPP_INLINE_VISIBILITY hash_map() {__table_.rehash(193);}
    ;
    ;
    template <class _InputIterator>
        hash_map(_InputIterator __first, _InputIterator __last);
    _LIBCPP_INLINE_VISIBILITY
    void erase(const_iterator __p) {__table_.erase(__p.__i_);}
    _LIBCPP_INLINE_VISIBILITY
    _LIBCPP_INLINE_VISIBILITY
    size_type bucket_count() const {return __table_.bucket_count();}
    _LIBCPP_INLINE_VISIBILITY
    size_type max_bucket_count() const {return __table_.max_bucket_count();}

    _LIBCPP_INLINE_VISIBILITY
    size_type elems_in_bucket(size_type __n) const
        {return __table_.bucket_size(__n);}

    _LIBCPP_INLINE_VISIBILITY
    void resize(size_type __n) {__table_.rehash(__n);}

private:
    ;
};












template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
bool
operator==(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
           const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{
    if (__x.size() != __y.size())
        return false;
    typedef typename hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>::const_iterator
                                                                 const_iterator;
    for (const_iterator __i = __x.begin(), __ex = __x.end(), __ey = __y.end();
            __i != __ex; ++__i)
    {
        const_iterator __j = __y.find(__i->first);
        if (__j == __ey || !(*__i == *__j))
            return false;
    }
    return true;
}

template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator!=(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x,
           const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y)
{
    return !(__x == __y);
}

template <class _Key, class _Tp, class _Hash = hash<_Key>, class _Pred = equal_to<_Key>,
          class _Alloc = allocator<pair<const _Key, _Tp> > >
class _LIBCPP_TYPE_VIS_ONLY hash_multimap
{
public:
    // types
    typedef _Key                                           key_type;
    typedef _Tp                                            mapped_type;
    typedef _Tp                                            data_type;
    typedef _Hash                                          hasher;
    typedef _Pred                                          key_equal;
    typedef _Alloc                                         allocator_type;
    typedef pair<const key_type, mapped_type>              value_type;
    typedef value_type&                                    reference;
    typedef const value_type&                              const_reference;

private:
    typedef pair<key_type, mapped_type>                    __value_type;
    typedef __hash_map_hasher<__value_type, hasher>   __hasher;
    typedef __hash_map_equal<__value_type, key_equal> __key_equal;
    typedef typename allocator_traits<allocator_type>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind_alloc<__value_type>
#else
# 779 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
            rebind_alloc<__value_type>::other
#endif
# 781 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
                                                           __allocator_type;

    typedef __hash_table<__value_type, __hasher,
                         __key_equal,  __allocator_type>   __table;

    __table __table_;

    typedef typename __table::__node_traits                __node_traits;
    typedef typename __table::__node_allocator             __node_allocator;
    typedef typename __table::__node                       __node;
    typedef __hash_map_node_destructor<__node_allocator>   _Dp;
    typedef unique_ptr<__node, _Dp>                         __node_holder;
    typedef allocator_traits<allocator_type>               __alloc_traits;
public:
    typedef typename __alloc_traits::pointer         pointer;
    typedef typename __alloc_traits::const_pointer   const_pointer;
    typedef typename __alloc_traits::size_type       size_type;
    typedef typename __alloc_traits::difference_type difference_type;

    typedef __hash_map_iterator<typename __table::iterator>       iterator;
    typedef __hash_map_const_iterator<typename __table::const_iterator> const_iterator;
    _LIBCPP_INLINE_VISIBILITY
    pair<iterator, iterator>             equal_range(const key_type& __k)
        {return __table_.__equal_range_multi(__k);}
    _LIBCPP_INLINE_VISIBILITY
    pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
        {return __table_.__equal_range_multi(__k);}

    _LIBCPP_INLINE_VISIBILITY
    size_type bucket_count() const {return __table_.bucket_count();}
    _LIBCPP_INLINE_VISIBILITY
    size_type max_bucket_count() const {return __table_.max_bucket_count();}

    _LIBCPP_INLINE_VISIBILITY
    size_type elems_in_bucket(size_type __n) const
        {return __table_.bucket_size(__n);}

    _LIBCPP_INLINE_VISIBILITY
    void resize(size_type __n) {__table_.rehash(__n);}
};





} // __gnu_cxx

#endif  // _LIBCPP_HASH_MAP
# 1008 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_map" 3
# 51 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <ext/hash_set>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_set" 1 3
// -*- C++ -*-
//===------------------------- hash_set ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_HASH_SET
#define _LIBCPP_HASH_SET

/*

    hash_set synopsis

namespace __gnu_cxx
{

    bool      empty() const;
    size_type size() const;
    size_type max_size() const;

    hasher hash_funct() const;
    key_equal key_eq() const;

    iterator       find(const key_type& k);
#include <__config>
#endif /* expanded by -frewrite-includes */
# 197 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_set" 3
#if 0 /* expanded by -frewrite-includes */
#include <__hash_table>
#endif /* expanded by -frewrite-includes */
# 198 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_set" 3
#if 0 /* expanded by -frewrite-includes */
#include <functional>
#endif /* expanded by -frewrite-includes */
# 199 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_set" 3
namespace __gnu_cxx {

using namespace std;

template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
          class _Alloc = allocator<_Value> >
class _LIBCPP_TYPE_VIS_ONLY hash_set
{
public:
    // types
    typedef _Value                                                     key_type;
    typedef key_type                                                   value_type;
    typedef _Hash                                                      hasher;
    typedef _Pred                                                      key_equal;
    typedef _Alloc                                                     allocator_type;
    typedef value_type&                                                reference;
    typedef const value_type&                                          const_reference;

private:
    typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table;

    __table __table_;

public:
    typedef typename __table::pointer         pointer;
    typedef typename __table::const_pointer   const_pointer;
    typedef typename __table::size_type       size_type;
    typedef typename __table::difference_type difference_type;

    typedef typename __table::const_iterator       iterator;
    typedef typename __table::const_iterator       const_iterator;

    _LIBCPP_INLINE_VISIBILITY
    pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
        {return __table_.__equal_range_unique(__k);}

    _LIBCPP_INLINE_VISIBILITY
    size_type bucket_count() const {return __table_.bucket_count();}
    _LIBCPP_INLINE_VISIBILITY
    size_type max_bucket_count() const {return __table_.max_bucket_count();}

    _LIBCPP_INLINE_VISIBILITY
    size_type elems_in_bucket(size_type __n) const {return __table_.bucket_size(__n);}

    _LIBCPP_INLINE_VISIBILITY
    void resize(size_type __n) {__table_.rehash(__n);}
};





template <class _Value, class _Hash = hash<_Value>, class _Pred = equal_to<_Value>,
          class _Alloc = allocator<_Value> >
class _LIBCPP_TYPE_VIS_ONLY hash_multiset
{
public:
    // types
    typedef _Value                                                     key_type;
    typedef key_type                                                   value_type;
    typedef _Hash                                                      hasher;
    typedef _Pred                                                      key_equal;
    typedef _Alloc                                                     allocator_type;
    typedef value_type&                                                reference;
    typedef const value_type&                                          const_reference;

private:
    typedef __hash_table<value_type, hasher, key_equal, allocator_type> __table;

    __table __table_;

public:
    typedef typename __table::pointer         pointer;
    typedef typename __table::const_pointer   const_pointer;
    typedef typename __table::size_type       size_type;
    typedef typename __table::difference_type difference_type;

    typedef typename __table::const_iterator       iterator;
    typedef typename __table::const_iterator       const_iterator;

    _LIBCPP_INLINE_VISIBILITY
    pair<const_iterator, const_iterator> equal_range(const key_type& __k) const
        {return __table_.__equal_range_multi(__k);}

    _LIBCPP_INLINE_VISIBILITY
    size_type bucket_count() const {return __table_.bucket_count();}
    _LIBCPP_INLINE_VISIBILITY
    size_type max_bucket_count() const {return __table_.max_bucket_count();}

    _LIBCPP_INLINE_VISIBILITY
    size_type elems_in_bucket(size_type __n) const {return __table_.bucket_size(__n);}

    _LIBCPP_INLINE_VISIBILITY
    void resize(size_type __n) {__table_.rehash(__n);}
};





} // __gnu_cxx

#endif  // _LIBCPP_HASH_SET
# 662 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ext/hash_set" 3
# 52 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 53 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h"

#ifdef CHROME_OLD__DEPRECATED
#define __DEPRECATED CHROME_OLD__DEPRECATED
#undef CHROME_OLD__DEPRECATED
#endif
# 58 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h"

namespace base {
using __gnu_cxx::hash_map;
using __gnu_cxx::hash_set;
}  // namespace base

namespace __gnu_cxx {

// The GNU C++ library provides identiy hash functions for many integral types,
// but not for |long long|.  This hash function will truncate if |size_t| is
// narrower than |long long|.  This is probably good enough for what we will
// use it for.

// versions prior to 4.3.2 are unable to compile <tr1/functional> when RTTI
// is disabled, as it is in our build.

#define DEFINE_STRING_HASH(string_type) \
    template<> \
    struct hash<string_type> { \
      std::size_t operator()(const string_type& s) const { \
        std::size_t result = 0; \
        for (string_type::const_iterator i = s.begin(); i != s.end(); ++i) \
          result = (result * 131) + *i; \
        return result; \
      } \
    }

DEFINE_STRING_HASH(std::string);
DEFINE_STRING_HASH(std::wstring);

#if defined(WCHAR_T_IS_UTF32)
// If string16 and std::wstring are not the same type, provide a
// specialization for string16.
DEFINE_STRING_HASH(string16);
#endif  // WCHAR_T_IS_UTF32
# 109 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h"

#undef DEFINE_STRING_HASH

}  // namespace __gnu_cxx

#endif  // COMPILER
# 115 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h"

#endif  // BASE_HASH_TABLES_H_
# 117 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/hash_tables.h"
# 73 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_path.h" 2

// Windows-style drive letter support and pathname separator characters can be
// enabled and disabled independently, to aid testing.  These #defines are
// here so that the same setting can be used in both the implementation and
// in the unit test.
#if defined(OS_WIN)
#define FILE_PATH_USES_DRIVE_LETTERS
#define FILE_PATH_USES_WIN_SEPARATORS
#endif  // OS_WIN
# 82 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_path.h"

// An abstraction to isolate users from the differences between native
// pathnames on different platforms.
class FilePath {
 public:
#if defined(OS_POSIX)
  // On most platforms, native pathnames are char arrays, and the encoding
  // may or may not be specified.  On Mac OS X, native pathnames are encoded
  // in UTF-8.
  typedef std::string StringType;
#elif defined(OS_WIN)
# 93 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_path.h"
  // On Windows, for Unicode-aware applications, native pathnames are wchar_t
  // arrays encoded in UTF-16.
  typedef std::wstring StringType;
#endif  // OS_WIN
# 97 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_path.h"

  typedef StringType::value_type CharType;

  // extension.  Returns "" if BaseName() == "." or "..".
  // Examples:
  // support UNC paths on Windows.
  void StripTrailingSeparatorsInternal();

  StringType path_;
};

// Macros for string literal initialization of FilePath::CharType[].

#endif  // BASE_FILE_PATH_H_
# 272 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_path.h"
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/string_util.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// This file defines utility functions for working with strings.

#ifndef BASE_STRING_UTIL_H_
#define BASE_STRING_UTIL_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h>   // va_list
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h"
#if 0 /* expanded by -frewrite-includes */
#include <ctype.h>
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h"

#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h"
#if 0 /* expanded by -frewrite-includes */
#include <vector>
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/string16.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/string_piece.h"  // For implicit conversions.
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_piece.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Copied from strings/stringpiece.h with modifications
//
// A string-like object that points to a sized piece of memory.
//
// Functions or methods may use const StringPiece& parameters to accept either
// a "const char*" or a "string" value that will be implicitly converted to
// a StringPiece.  The implicit conversion means that it is often appropriate
// to include this .h file in other files rather than forward-declaring
// StringPiece as would be appropriate for most other Google classes.
//
// Systematic usage of StringPiece is encouraged as it will reduce unnecessary
// conversions from "const char*" to "string" and back again.
//

#ifndef BASE_STRING_PIECE_H_
#define BASE_STRING_PIECE_H_

#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_piece.h"
#if 0 /* expanded by -frewrite-includes */
#include <iosfwd>
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_piece.h"
#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 24 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_piece.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 26 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_piece.h"

class StringPiece {
 public:
  typedef size_t size_type;

 private:
  const char*   ptr_;
  size_type     length_;

 public:
  // We provide non-explicit singleton constructors so users can pass
  // in a "const char*" or a "string" wherever a "StringPiece" is
  // expected.
  StringPiece() : ptr_(NULL), length_(0) { }
  MOZ_IMPLICIT StringPiece(const char* str)
    : ptr_(str), length_((str == NULL) ? 0 : strlen(str)) { }
  MOZ_IMPLICIT StringPiece(const std::string& str)
    : ptr_(str.data()), length_(str.size()) { }
  StringPiece(const char* offset, size_type len)
    : ptr_(offset), length_(len) { }

  // data() may return a pointer to a buffer with embedded NULs, and the
  // returned buffer may or may not be null terminated.  Therefore it is
  // typically a mistake to pass data() to a routine that expects a NUL
  // terminated string.
  const char* data() const { return ptr_; }
  size_type size() const { return length_; }
  size_type length() const { return length_; }
  bool empty() const { return length_ == 0; }

  void clear() { ptr_ = NULL; length_ = 0; }
  void set(const char* data, size_type len) { ptr_ = data; length_ = len; }
  void set(const char* str) {
    ptr_ = str;
    length_ = str ? strlen(str) : 0;
  }
  

  

  

  

  

  

  ;
  ;

  // Does "this" start with "x"
  

  // Does "this" end with "x"
  

  // standard STL container boilerplate
  typedef char value_type;
  typedef const char* pointer;
  typedef const char& reference;
  typedef const char& const_reference;
  typedef ptrdiff_t difference_type;
  static const size_type npos;
  typedef const char* const_iterator;
  typedef const char* iterator;
  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
  ;
  
  ;
  ;
  ;
  
  ;
  ;

  ;

  static int wordmemcmp(const char* p, const char* p2, size_type N) {
    return memcmp(p, p2, N);
  }
};



// allow StringPiece to be logged (needed for unit testing).
;

#endif  // BASE_STRING_PIECE_H_
# 185 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_piece.h"
# 19 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h" 2

// Safe standard library wrappers for all platforms.

namespace base {

// C standard-library functions like "strncasecmp" and "snprintf" that aren't
// cross-platform are provided as "base::strncasecmp", and their prototypes
// are listed below.  These functions are then implemented as inline calls
//     data on all systems except Windows, which treat them as wchar_t data.
//     Use %ls and %lc for wchar_t data instead.
//  - 'S' and 'C', which operate on wchar_t data on all systems except Windows,
//     which treat them as char data.  Use %ls and %lc for wchar_t data
//     instead.
//  - 'F', which is not identified by Windows wprintf documentation.
//  - 'D', 'O', and 'U', which are deprecated and not available on all systems.
//     Use %ld, %lo, and %lu instead.
//
// Note that there is no portable conversion specifier for char data when
// working with wprintf.
//
// This function is intended to be called from base::vswprintf.
bool IsWprintfFormatPortable(const wchar_t* format);

}  // namespace base

#if defined(OS_WIN)
#if 0 /* expanded by -frewrite-includes */
#include "base/string_util_win.h"
#endif /* expanded by -frewrite-includes */
# 105 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h"
#elif defined(OS_POSIX)
# 106 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/string_util_posix.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util_posix.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_STRING_UTIL_POSIX_H_
#define BASE_STRING_UTIL_POSIX_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h>
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util_posix.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util_posix.h"
#if 0 /* expanded by -frewrite-includes */
#include <string.h>
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util_posix.h"
#if 0 /* expanded by -frewrite-includes */
#include <wchar.h>
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util_posix.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/logging.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util_posix.h"

namespace base {

// Chromium code style is to not use malloc'd strings; this is only for use
// for interaction with APIs that require it.






inline int vsnprintf(char* buffer, size_t size,
                     const char* format, va_list arguments) {
  return ::vsnprintf(buffer, size, format, arguments);
}

inline int vswprintf(wchar_t* buffer, size_t size,
                     const wchar_t* format, va_list arguments) {
  DCHECK(IsWprintfFormatPortable(format));
  return ::vswprintf(buffer, size, format, arguments);
}

}  // namespace base

#endif  // BASE_STRING_UTIL_POSIX_H_
# 45 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util_posix.h"
# 107 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h" 2
#else
# 108 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h"
#error Define string operations appropriately for your platform
#endif
# 110 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/string_util.h"

// Trims any whitespace from either end of the input string.  Returns where
// whitespace was found.
// The non-wide version has two functions:
// * TrimWhitespaceASCII()
//   This function is for ASCII strings and only looks for ASCII whitespace;
// * TrimWhitespaceUTF8()
//   This function is for UTF-8 strings and looks for Unicode whitespace.

template <class P>
struct TupleTraits {
  typedef P ValueType;
  typedef P& RefType;
  typedef const P& ParamType;
};

template <class P>
struct TupleTraits<P&> {
  typedef P ValueType;
  typedef P& RefType;
  typedef P& ParamType;
};

// Tuple -----------------------------------------------------------------------
//
// This set of classes is useful for bundling 0 or more heterogeneous data types
// into a single variable.  The advantage of this is that it greatly simplifies
// function objects that need to take an arbitrary number of parameters; see
// RunnableMethod and IPC::MessageWithTuple.
//
// Tuple0 is supplied to act as a 'void' type.  It can be used, for example,
// when dispatching to a function that accepts no arguments (see the
// Dispatchers below).
// Tuple1<A> is rarely useful.  One such use is when A is non-const ref that you
// want filled by the dispatchee, and the tuple is merely a container for that
// output (a "tier").  See MakeRefTuple and its usages.

struct Tuple0 {
  typedef Tuple0 ValueTuple;
  typedef Tuple0 RefTuple;
};

template <class A>
struct Tuple1 {
 public:
  typedef A TypeA;
  typedef Tuple1<typename TupleTraits<A>::ValueType> ValueTuple;
  typedef Tuple1<typename TupleTraits<A>::RefType> RefTuple;

  
  

  A a;
};

template <class A, class B>
struct Tuple2 {
 public:
  typedef A TypeA;
  typedef B TypeB;
  typedef Tuple2<typename TupleTraits<A>::ValueType,
                 typename TupleTraits<B>::ValueType> ValueTuple;
  typedef Tuple2<typename TupleTraits<A>::RefType,
                 typename TupleTraits<B>::RefType> RefTuple;

  
  

  A a;
  B b;
};

template <class A, class B, class C>
struct Tuple3 {
 public:
  typedef A TypeA;
  typedef B TypeB;
  typedef C TypeC;
  typedef Tuple3<typename TupleTraits<A>::ValueType,
                 typename TupleTraits<B>::ValueType,
                 typename TupleTraits<C>::ValueType> ValueTuple;
  typedef Tuple3<typename TupleTraits<A>::RefType,
                 typename TupleTraits<B>::RefType,
                 typename TupleTraits<C>::RefType> RefTuple;

  
  

  A a;
  B b;
  C c;
};

template <class A, class B, class C, class D>
struct Tuple4 {
 public:
  typedef A TypeA;
  typedef B TypeB;
  typedef C TypeC;
  typedef D TypeD;
  typedef Tuple4<typename TupleTraits<A>::ValueType,
                 typename TupleTraits<B>::ValueType,
                 typename TupleTraits<C>::ValueType,
                 typename TupleTraits<D>::ValueType> ValueTuple;
  typedef Tuple4<typename TupleTraits<A>::RefType,
                 typename TupleTraits<B>::RefType,
                 typename TupleTraits<C>::RefType,
                 typename TupleTraits<D>::RefType> RefTuple;

  
  

  A a;
  B b;
  C c;
  D d;
};

template <class A, class B, class C, class D, class E>
struct Tuple5 {

  
  

  A a;
  B b;
  C c;
  D d;
  E e;
};

template <class A, class B, class C, class D, class E, class F>
struct Tuple6 {
public:
  typedef A TypeA;
  typedef B TypeB;

  
  

  A a;
  B b;
  C c;
  D d;
  E e;
  F f;
};

template <class A, class B, class C, class D, class E, class F, class G>
struct Tuple7 {
public:
  typedef A TypeA;
  typedef B TypeB;
  typedef C TypeC;
  typedef D TypeD;
  typedef E TypeE;
  typedef F TypeF;
  typedef G TypeG;
  typedef Tuple7<typename TupleTraits<A>::ValueType,
    typename TupleTraits<B>::ValueType,
    typename TupleTraits<C>::ValueType,
    typename TupleTraits<D>::ValueType,
    typename TupleTraits<E>::ValueType,
    typename TupleTraits<F>::ValueType,
    typename TupleTraits<G>::ValueType> ValueTuple;
  typedef Tuple7<typename TupleTraits<A>::RefType,
    typename TupleTraits<B>::RefType,
    typename TupleTraits<C>::RefType,
    typename TupleTraits<D>::RefType,
    typename TupleTraits<E>::RefType,
    typename TupleTraits<F>::RefType,
    typename TupleTraits<G>::RefType> RefTuple;

  
  

  A a;
  B b;
  C c;
  D d;
  E e;
  F f;
  G g;
};









#endif  // BASE_TUPLE_H__
# 879 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/tuple.h"
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/time.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/time.h" 1
// decrease or jump).
//
// These classes are represented as only a 64-bit value, so they can be
// efficiently passed by value.

#ifndef BASE_TIME_H_
#define BASE_TIME_H_

#if 0 /* expanded by -frewrite-includes */
#include <time.h>
#endif /* expanded by -frewrite-includes */
# 26 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/time.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 28 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/time.h"

#if defined(OS_WIN)
// For FILETIME in FromFileTime, until it moves to a new converter class.
// See TODO(iyengar) below.
#if 0 /* expanded by -frewrite-includes */
#include <windows.h>
#endif /* expanded by -frewrite-includes */
# 33 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/time.h"
#endif
# 34 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/time.h"

namespace base {

class Time;
class TimeTicks;

// This unit test does a lot of manual time manipulation.
class PageLoadTrackerUnitTest;

// TimeDelta ------------------------------------------------------------------

class TimeDelta {
 public:
  

  // Converts units of time to TimeDeltas.
  ;
  ;
  ;
  ;
  ;

 private:
  friend class Time;
  friend class TimeTicks;
  ;

  // Constructs a delta given the duration in microseconds. This is private
  // to avoid confusion by callers with an integer constructor. Use
  // FromSeconds, FromMilliseconds, etc. instead.
  

  // Delta in microseconds.
  int64_t delta_;
};



// Time -----------------------------------------------------------------------

// Represents a wall clock time.
class Time {
 public:
  static const int64_t kMillisecondsPerSecond = 1000;
  static const int64_t kMicrosecondsPerMillisecond = 1000;
  static const int64_t kMicrosecondsPerSecond = kMicrosecondsPerMillisecond *
                                              kMillisecondsPerSecond;
  static const int64_t kMicrosecondsPerMinute = kMicrosecondsPerSecond * 60;
  static const int64_t kMicrosecondsPerHour = kMicrosecondsPerMinute * 60;
  static const int64_t kMicrosecondsPerDay = kMicrosecondsPerHour * 24;
  static const int64_t kMicrosecondsPerWeek = kMicrosecondsPerDay * 7;
  static const int64_t kNanosecondsPerMicrosecond = 1000;
  static const int64_t kNanosecondsPerSecond = kNanosecondsPerMicrosecond *
                                             kMicrosecondsPerSecond;

  // Represents an exploded time that can be formatted nicely. This is kind of
  // like the Win32 SYSTEMTIME structure or the Unix "struct tm" with a few
  // additions and changes to prevent errors.
  struct Exploded {
    int year;                 // Four digit year "2007"
    signed char month;        // 1-based month (values 1 = January, etc.)
    signed char day_of_week;  // 0-based day of week (0 = Sunday, etc.)
    signed char day_of_month; // 1-based day of month (1-31)
    signed char hour;         // Hour within the current day (0-23)
    signed char minute;       // Minute within the current hour (0-59)
    signed char second;       // Second within the current minute (0-59 plus
                              // leap seconds which may take it up to 60).
    int millisecond;          // Milliseconds within the current second (0-999)
  };

  // Contains the NULL time. Use Time::Now() to get the current time.
  

  // Returns true if the time object has not been initialized.
  bool is_null() const {
    return us_ == 0;
  }

  // Returns the current time. Watch out, the system might adjust its clock
  // in which case time will actually go backwards. We don't guarantee that
  // times are increasing, or that two calls to Now() won't be the same.
  static Time Now();

  // Returns the current time. Same as Now() except that this function always
  // uses system time so that there are no discrepancies between the returned

  // Return a new time modified by some delta.
  Time operator+(TimeDelta delta) const {
    return Time(us_ + delta.delta_);
  }
  

  // Comparison operators
  
  
  
  
  
  

 private:
  friend class TimeDelta;

  // Explodes the given time to either local time |is_local = true| or UTC
  // |is_local = false|.
  ;

  // Unexplodes a given time assuming the source is either local time
  // |is_local = true| or UTC |is_local = false|.
  ;

  explicit Time(int64_t us) : us_(us) {
  }

  // The representation of Jan 1, 1970 UTC in microseconds since the
  // platform-dependent epoch.
  static const int64_t kTimeTToMicrosecondsOffset;

  // Time in microseconds in UTC.
  int64_t us_;
};



// Inline the TimeDelta factory methods, for fast TimeDelta construction.

// static


// static


// static


// static


// static


// static


// TimeTicks ------------------------------------------------------------------

class TimeTicks {
 public:
  
  // Tick count in microseconds.
  int64_t ticks_;

#if defined(OS_WIN)
  typedef DWORD (*TickFunctionType)(void);
  static TickFunctionType SetMockTickFunction(TickFunctionType ticker);
#endif
# 476 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/time.h"
};



}  // namespace base

#endif  // BASE_TIME_H_
# 485 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/time.h"
# 17 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h" 2

#if defined(OS_POSIX)
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/file_descriptor_set_posix.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h" 1
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_
#define CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_

#if 0 /* expanded by -frewrite-includes */
#include <vector>
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/file_descriptor_posix.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_descriptor_posix.h" 1
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_FILE_DESCRIPTOR_POSIX_H_
#define BASE_FILE_DESCRIPTOR_POSIX_H_

namespace base {

// -----------------------------------------------------------------------------
// We introduct a special structure for file descriptors in order that we are
// able to use template specialisation to special-case their handling.
//
// WARNING: (Chromium only) There are subtleties to consider if serialising
// these objects over IPC. See comments in chrome/common/ipc_message_utils.h
// above the template specialisation for this structure.
// -----------------------------------------------------------------------------
struct FileDescriptor {
  

  

  int fd;
  // If true, this file descriptor should be closed after it has been used. For
  // example an IPC system might interpret this flag as indicating that the
  // file descriptor it has been given should be closed after use.
  bool auto_close;
};

}  // namespace base

#endif  // BASE_FILE_DESCRIPTOR_POSIX_H_
# 37 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/file_descriptor_posix.h"
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h"

// -----------------------------------------------------------------------------
// A FileDescriptorSet is an ordered set of POSIX file descriptors. These are
// associated with IPC messages so that descriptors can be transmitted over a
// UNIX domain socket.
// -----------------------------------------------------------------------------
class FileDescriptorSet {
 public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(FileDescriptorSet)
  // ---------------------------------------------------------------------------

 private:
  ~FileDescriptorSet();

  // A vector of descriptors and close flags. If this message is sent, then
  // these descriptors are sent as control data. After sending, any descriptors
  // with a true flag are closed. If this message has been received, then these
  // are the descriptors which were received and all close flags are true.
  std::vector<base::FileDescriptor> descriptors_;

  // This contains the index of the next descriptor which should be consumed.
  // It's used in a couple of ways. Firstly, at destruction we can check that
  // all the descriptors have been read (with GetNthDescriptor). Secondly, we
  // can check that they are read in order.
  mutable unsigned consumed_descriptor_highwater_;

  DISALLOW_COPY_AND_ASSIGN(FileDescriptorSet);
};

#endif  // CHROME_COMMON_FILE_DESCRIPTOR_SET_POSIX_H_
# 105 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/file_descriptor_set_posix.h"
# 20 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h" 2
#endif
# 21 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h"
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/ipc_sync_message.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_sync_message.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_IPC_SYNC_MESSAGE_H__
#define CHROME_COMMON_IPC_SYNC_MESSAGE_H__

#if defined(OS_WIN)
#if 0 /* expanded by -frewrite-includes */
#include <windows.h>
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_sync_message.h"
#endif
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_sync_message.h"
#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_sync_message.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_sync_message.h"
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/ipc_message.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_IPC_MESSAGE_H__
#define CHROME_COMMON_IPC_MESSAGE_H__

#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/pickle.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/pickle.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_PICKLE_H__
#define BASE_PICKLE_H__

#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/pickle.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/pickle.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/logging.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/pickle.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/string16.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/pickle.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/pickle.h"

// This class provides facilities for basic binary value packing and unpacking.
//
// The Pickle class supports appending primitive values (ints, strings, etc.)
// to a pickle instance.  The Pickle instance grows its internal memory buffer
// dynamically to hold the sequence of primitive values.   The internal memory
// buffer is exposed as the "data" of the Pickle.  This "data" can be passed
// to a Pickle object to initialize it for reading.
//
// When reading from a Pickle object, it is important for the consumer to know
// what value types to read and in what order to read them as the Pickle does
// not keep track of the type of data written to it.
//
// The Pickle's data has a header which contains the size of the Pickle's
// payload.  It can optionally support additional space in the header.  That
// space is controlled by the header_size parameter passed to the Pickle
// constructor.
//
class Pickle {
 public:

  // Methods for reading the payload of the Pickle.  To read from the start of
  // the Pickle, initialize *iter to NULL.  If successful, these methods return
  // true.  Otherwise, false is returned to indicate that the result could not
  // be extracted.
  MOZ_WARN_UNUSED_RESULT bool ReadBool(void** iter, bool* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadInt16(void** iter, int16_t* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadUInt16(void** iter, uint16_t* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadShort(void** iter, short* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadInt(void** iter, int* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadLong(void** iter, long* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadULong(void** iter, unsigned long* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadSize(void** iter, size_t* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadInt32(void** iter, int32_t* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadUInt32(void** iter, uint32_t* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadInt64(void** iter, int64_t* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadUInt64(void** iter, uint64_t* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadDouble(void** iter, double* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadIntPtr(void** iter, intptr_t* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadUnsignedChar(void** iter, unsigned char* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadString(void** iter, std::string* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadWString(void** iter, std::wstring* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadString16(void** iter, string16* result) const;
  MOZ_WARN_UNUSED_RESULT bool ReadData(void** iter, const char** data, int* length) const;
  MOZ_WARN_UNUSED_RESULT bool ReadBytes(void** iter, const char** data, int length,
					uint32_t alignment = sizeof(memberAlignmentType)) const;

  // Safer version of ReadInt() checks for the result not being negative.
  // Use it for reading the object sizes.
  MOZ_WARN_UNUSED_RESULT bool ReadLength(void** iter, int* result) const;

  // Methods for adding to the payload of the Pickle.  These values are
  // appended to the end of the Pickle's payload.  When reading values from a
  // Pickle, it is important to read them in the order in which they were added
  // to the Pickle.
  bool WriteBool(bool value) {
    return WriteInt(value ? 1 : 0);
  }
  
  bool WriteUInt16(uint16_t value) {
    return WriteBytes(&value, sizeof(value));
  }
  bool WriteInt(int value) {
    return WriteBytes(&value, sizeof(value));
  }
  
  
  bool WriteSize(size_t value) {
    // Always written as a 64-bit value since the size for this type can
    // differ between architectures.
    return WriteUInt64(uint64_t(value));
  }
  
  bool WriteUInt32(uint32_t value) {
    return WriteBytes(&value, sizeof(value));
  }
  bool WriteInt64(int64_t value) {
    return WriteBytes(&value, sizeof(value));
  }
  bool WriteUInt64(uint64_t value) {
    return WriteBytes(&value, sizeof(value));
  }
  
  
  
  ;
  ;
  ;
  bool WriteData(const char* data, int length);
  bool WriteBytes(const void* data, int data_len,
                  uint32_t alignment = sizeof(memberAlignmentType));

  // Same as WriteData, but allows the caller to write directly into the
  // Pickle. This saves a copy in cases where the data is not already
  // not been changed.
  ;

  

  // Payload follows after allocation of Header (header size is customizable).
  struct Header {
    uint32_t payload_size;  // Specifies the size of the payload.
  };

  // Returns the header, cast to a user-specified type T.  The type T must be a
  // subclass of Header and its size must correspond to the header_size passed
  // to the Pickle constructor.
  template <class T>
  T* headerT() {
    DCHECK(sizeof(T) == header_size_);
    return static_cast<T*>(header_);
  }
  template <class T>
  const T* headerT() const {
    DCHECK(sizeof(T) == header_size_);
    return static_cast<const T*>(header_);
  }

  // Returns true if the given iterator could point to data with the given
  // length. If there is no room for the given data before the end of the
  // payload, returns false.
  

  typedef uint32_t memberAlignmentType;

 protected:
  uint32_t payload_size() const { return header_->payload_size; }

  Header* header_;
  uint32_t header_size_;
  uint32_t capacity_;
  uint32_t variable_buffer_offset_;
};

#endif  // BASE_PICKLE_H__
# 294 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/pickle.h"
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h" 2

#ifdef MOZ_TASK_TRACER
#if 0 /* expanded by -frewrite-includes */
#include "GeckoTaskTracer.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"
#endif
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"

#if defined(OS_POSIX)
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"
#endif
# 20 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"

namespace base {
struct FileDescriptor;
}

class FileDescriptorSet;

namespace IPC {

//------------------------------------------------------------------------------

class Channel;
class Message;
struct LogData;

class Message : public Pickle {
 public:
  typedef uint32_t msgid_t;

  // Implemented by objects that can send IPC messages across a channel.
  class Sender {
   public:
    virtual ~Sender() {}

    // Sends the given IPC message.  The implementor takes ownership of the
    // given Message regardless of whether or not this method succeeds.  This
    // is done to make this method easier to use.  Returns true on success and
    // false otherwise.
    virtual bool Send(Message* msg) = 0;
  };

  enum PriorityValue {
    PRIORITY_NORMAL = 1,
    PRIORITY_HIGH = 2,
    PRIORITY_URGENT = 3
  };


  

  

  

  // Used for async messages with no parameters.
  

  // Find the end of the message data that starts at range_start.  Returns NULL
  // if the entire message is not found in the given data range.
  

#if defined(OS_POSIX)
  // On POSIX, a message supports reading / writing FileDescriptor objects.
# 258 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"
#endif
# 259 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"


  friend class Channel;
  friend class MessageReplyDeserializer;
  friend class SyncMessage;

  

  

#if !defined(OS_MACOSX)
 protected:
#endif
# 276 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"

  // flags
  enum {
    PRIORITY_MASK   = 0x0003,
    SYNC_BIT        = 0x0004,
    REPLY_BIT       = 0x0008,
    REPLY_ERROR_BIT = 0x0010,
    UNBLOCK_BIT     = 0x0020,
    PUMPING_MSGS_BIT= 0x0040,
    HAS_SENT_TIME_BIT = 0x0080,
    INTERRUPT_BIT   = 0x0100,
    COMPRESS_BIT    = 0x0200,
  };

  struct Header : Pickle::Header {
    int32_t routing;  // ID of the view that this message is destined for
    msgid_t type;   // specifies the user-defined message type
    uint32_t flags;   // specifies control flags for the message
#if defined(OS_POSIX)
    uint32_t num_fds; // the number of descriptors included with this message
# if defined(OS_MACOSX)
    uint32_t cookie;  // cookie to ACK that the descriptors have been read.
# endif
# 299 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"
#endif
# 300 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"
    union {
      // For Interrupt messages, a guess at what the *other* side's stack depth is.
      uint32_t interrupt_remote_stack_depth_guess;

      // For RPC and Urgent messages, a transaction ID for message ordering.
      int32_t txid;
    };
    // The actual local stack depth.
    uint32_t interrupt_local_stack_depth;
    // Sequence number
    int32_t seqno;
#ifdef MOZ_TASK_TRACER
    uint64_t source_event_id;
    uint64_t parent_task_id;
    mozilla::tasktracer::SourceEventType source_event_type;
#endif
# 316 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"
  };

  Header* header() {
    return headerT<Header>();
  }
  const Header* header() const {
    return headerT<Header>();
  }

  ;

#if defined(OS_POSIX)
  // The set of file descriptors associated with this message.
  nsRefPtr<FileDescriptorSet> file_descriptor_set_;

  // Ensure that a FileDescriptorSet is allocated
  ;

  
  
#endif
# 342 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"

  const char* name_;

};

//------------------------------------------------------------------------------

}  // namespace IPC

enum SpecialRoutingIDs {
  // indicates that we don't have a routing ID yet.
  MSG_ROUTING_NONE = kint32min,

  // indicates a general message not sent to a particular tab.
  MSG_ROUTING_CONTROL = kint32max
};

#define IPC_REPLY_ID 0xFFF0  // Special message id for replies
#define IPC_LOGGING_ID 0xFFF1  // Special message id for logging

#endif  // CHROME_COMMON_IPC_MESSAGE_H__
# 363 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message.h"
# 14 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_sync_message.h" 2

namespace base {
class WaitableEvent;
}

namespace IPC {

class MessageReplyDeserializer;

class SyncMessage : public Message {
 public:
  ;

  // Call this to get a deserializer for the output parameters.
  // Note that this can only be called once, and the caller is responsible
  // for deleting the deserializer when they're done.
  ;

  // If this message can cause the receiver to block while waiting for user
  // input (i.e. by calling MessageBox), then the caller needs to pump window
  // messages and dispatch asynchronous messages while waiting for the reply.
  // If this event is passed in, then window messages will start being pumped
  // when it's set.  Note that this behavior will continue even if the event is
  base::WaitableEvent* pump_messages_event_;

  static uint32_t next_id_;  // for generation of unique ids
};

// Used to deserialize parameters from a reply to a synchronous message
class MessageReplyDeserializer {
 public:
  ;
  
 private:
  // Derived classes need to implement this, using the given iterator (which
  // is skipped past the header for synchronous messages).
  ;
};

}  // namespace IPC

#endif  // CHROME_COMMON_IPC_SYNC_MESSAGE_H__
# 98 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_sync_message.h"
# 22 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/transport_dib.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h" 1
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_TRANSPORT_DIB_H_
#define CHROME_COMMON_TRANSPORT_DIB_H_

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"

#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
#if 0 /* expanded by -frewrite-includes */
#include "base/shared_memory.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_SHARED_MEMORY_H_
#define BASE_SHARED_MEMORY_H_

#if 0 /* expanded by -frewrite-includes */
#include "build/build_config.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"

#if defined(OS_POSIX)
#if 0 /* expanded by -frewrite-includes */
 * 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.
 *
 *	@(#)fcntl.h	8.3 (Berkeley) 1/21/94
 */


#ifndef _SYS_FCNTL_H_
#define	_SYS_FCNTL_H_

/*
 * This file includes the definitions for open and fcntl
 * described by POSIX for <fcntl.h>; it also includes
 * related kernel definitions.
 */
# 125 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/fcntl.h" 3 4
#define	O_CREAT		0x0200		/* create if nonexistant */
#define	O_TRUNC		0x0400		/* truncate to zero length */
#define	O_EXCL		0x0800		/* error if already exists */

#if __DARWIN_C_LEVEL >= 200809L 
/*
 * Descriptor value for the current working directory
 */
#define AT_FDCWD	-2

/*
 * Flags for the at functions
 */
#define AT_EACCESS		0x0010	/* Use effective ids in access check */
#define AT_SYMLINK_NOFOLLOW	0x0020	/* Act on the symlink itself not the target */

#define F_GETPROTECTIONLEVEL	77	/* Get the protection version number for this filesystem */

#define F_FINDSIGS		78	/* Add detached code signatures (used by dyld for shared libs) */



// FS-specific fcntl()'s numbers begin at 0x00010000 and go up
#define FCNTL_FS_SPECIFIC_BASE  0x00010000

#endif /* (_POSIX_C_SOURCE && !_DARWIN_C_SOURCE) */
# 278 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/fcntl.h" 3 4

#if __DARWIN_C_LEVEL >= 200809L
#define	F_DUPFD_CLOEXEC		67	/* mark the dup with FD_CLOEXEC */
#endif
# 472 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/fcntl.h" 3 4
int	creat(const char *, mode_t) __DARWIN_ALIAS_C(creat);
int	fcntl(int, int, ...) __DARWIN_ALIAS_C(fcntl);
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)

int	openx_np(const char *, int, filesec_t);
/* 
 * data-protected non-portable open(2) :
 int open_dprotected_np(user_addr_t path, int flags, int class, int dpflags, int mode)
 */ 
int open_dprotected_np ( const char *, int, int, int, ...);
int	flock(int, int);
filesec_t filesec_init(void);
filesec_t filesec_dup(filesec_t);
void	filesec_free(filesec_t);
int	filesec_get_property(filesec_t, filesec_property_t, void *);
int	filesec_query_property(filesec_t, filesec_property_t, int *);
int	filesec_set_property(filesec_t, filesec_property_t, const void *);
int	filesec_unset_property(filesec_t, filesec_property_t) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2);
#define _FILESEC_UNSET_PROPERTY	((void *)0)
#define _FILESEC_REMOVE_ACL	((void *)1)
#endif /* (!_POSIX_C_SOURCE || _DARWIN_C_SOURCE) */
# 493 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/fcntl.h" 3 4
__END_DECLS

#endif /* !_SYS_FCNTL_H_ */
# 496 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/fcntl.h" 3 4
# 28 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/semaphore.h" 2 3 4

#if 0 /* expanded by -frewrite-includes */
#include <sys/semaphore.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/semaphore.h" 1 3 4
/*
int sem_wait(sem_t *) __DARWIN_ALIAS_C(sem_wait);
__END_DECLS


#endif	/* _SYS_SEMAPHORE_H_ */
# 65 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/sys/semaphore.h" 3 4
# 30 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/semaphore.h" 2 3 4

#endif /* _BSD_SEMAPHORE_H */
# 32 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/semaphore.h" 3 4
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/file_descriptor_posix.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"
#endif
# 15 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"
#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/process.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"

namespace base {

// SharedMemoryHandle is a platform specific type which represents
// the underlying OS handle to a shared memory segment.
#if defined(OS_WIN)
typedef HANDLE SharedMemoryHandle;
typedef HANDLE SharedMemoryLock;
#elif defined(OS_POSIX)
# 28 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"
// A SharedMemoryId is sufficient to identify a given shared memory segment on a
// system, but insufficient to map it.
typedef FileDescriptor SharedMemoryHandle;
typedef ino_t SharedMemoryId;
// On POSIX, the lock is implemented as a lockf() on the mapped file,
// so no additional member (or definition of SharedMemoryLock) is
// needed.
#endif
# 36 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"

// Platform abstraction for shared memory.  Provides a C++ wrapper
// around the OS primitive for a memory mapped file.
class SharedMemory {
 public:
  // Create a new SharedMemory object.
  SharedMemory();

  // Create a new SharedMemory object from an existing, open
  // shared memory file.
  SharedMemory(SharedMemoryHandle handle, bool read_only);

#if defined(OS_POSIX)
  // Return a unique identifier for this shared memory segment. Inode numbers
  // are technically only unique to a single filesystem. However, we always
  // allocate shared memory backing files from the same directory, so will end
  // up on the same filesystem.
  SharedMemoryId id() const { return inode_; }
#endif
# 116 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"

  // Closes the open shared memory segment.
  // It is safe to call Close repeatedly.
  void Close();

  // Share the shared memory to another process.  Attempts
  // to create a platform-specific new_handle which can be
  // used in a remote process to access the shared memory
  // file.  new_handle is an ouput parameter to receive
  // the handle for use in the remote process.
  // Returns true on success, false otherwise.
  bool ShareToProcess(base::ProcessHandle process,
                      SharedMemoryHandle* new_handle) {
    return ShareToProcessCommon(process, new_handle, false);
  }

  // Logically equivalent to:
  //   bool ok = ShareToProcess(process, new_handle);
  //   Close();
  //   return ok;
  // Note that the memory is unmapped by calling this method, regardless of the
  // return value.
  bool GiveToProcess(ProcessHandle process,
                     SharedMemoryHandle* new_handle) {
    return ShareToProcessCommon(process, new_handle, true);
  }

  // Lock the shared memory.
  // This is a cross-process lock which may be recursively
  // locked by the same thread.
  // TODO(port):
  // WARNING: on POSIX the lock only works across processes, not
  // across threads.  2 threads in the same process can both grab the
  // lock at the same time.  There are several solutions for this
  // (futex, lockf+anon_semaphore) but none are both clean and common
  // across Mac and Linux.
  void Lock();

  // Release the shared memory lock.
  void Unlock();

 private:
#if defined(OS_POSIX)
  bool CreateOrOpen(const std::wstring &name, int posix_flags, size_t size);
  bool FilenameForMemoryName(const std::wstring &memname,
                             std::wstring *filename);
  void LockOrUnlockCommon(int function);

#endif
# 165 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"
  bool ShareToProcessCommon(ProcessHandle process,
                            SharedMemoryHandle* new_handle,
                            bool close_self);

#if defined(OS_WIN)
  std::wstring       name_;
  HANDLE             mapped_file_;
#elif defined(OS_POSIX)
# 173 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"
  int                mapped_file_;
  ino_t              inode_;
#endif
# 176 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"
  void*              memory_;
  bool               read_only_;
  size_t             max_size_;
#if !defined(OS_POSIX)
  SharedMemoryLock   lock_;
#endif
# 182 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"

  DISALLOW_EVIL_CONSTRUCTORS(SharedMemory);
};

// A helper class that acquires the shared memory lock while
// the SharedMemoryAutoLock is in scope.
class SharedMemoryAutoLock {
 public:
  explicit SharedMemoryAutoLock(SharedMemory* shared_memory)
      : shared_memory_(shared_memory) {
    shared_memory_->Lock();
  }

  ~SharedMemoryAutoLock() {
    shared_memory_->Unlock();
  }

 private:
  SharedMemory* shared_memory_;
  DISALLOW_EVIL_CONSTRUCTORS(SharedMemoryAutoLock);
};

}  // namespace base

#endif  // BASE_SHARED_MEMORY_H_
# 207 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/shared_memory.h"
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h" 2
#endif
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"

#if defined(OS_WIN)
#if 0 /* expanded by -frewrite-includes */
#include <windows.h>
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"
#elif defined(OS_LINUX)
# 17 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/x11_util.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"
#endif
# 19 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"

// -----------------------------------------------------------------------------
// A TransportDIB is a block of memory that is used to transport pixels
// between processes: from the renderer process to the browser, and
// between renderer and plugin processes.
// -----------------------------------------------------------------------------
class TransportDIB {
 public:
  ;

  // Two typedefs are defined. A Handle is the type which can be sent over
  // the wire so that the remote side can map the transport DIB. The Id typedef
  // is sufficient to identify the transport DIB when you know that the remote
  // side already may have it mapped.
#if defined(OS_WIN)
  typedef HANDLE Handle;
  // On Windows, the Id type includes a sequence number (epoch) to solve an ABA
  // issue:
  //   1) Process A creates a transport DIB with HANDLE=1 and sends to B.
  //   2) Process B maps the transport DIB and caches 1 -> DIB.
#elif defined(OS_LINUX)
# 70 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"
  typedef int Handle;  // These two ints are SysV IPC shared memory keys
  typedef int Id;
#endif
# 73 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"

  // Create a new TransportDIB
  //   size: the minimum size, in bytes
  //   epoch: Windows only: a global counter. See comment above.
  //   returns: NULL on failure
  ;

  // Map the referenced transport DIB. Returns NULL on failure.
  ;

  // Return a pointer to the shared memory
  ;

  // Return the maximum size of the shared memory. This is not the amount of
  // data which is valid, you have to know that via other means, this is simply
  // the maximum amount that /could/ be valid.
  

  // Return the identifier which can be used to refer to this shared memory
  // on the wire.
  ;

  // Return a handle to the underlying shared memory. This can be sent over the
  // wire to give this transport DIB to another process.
  ;

#if defined(OS_LINUX)
  // Map the shared memory into the X server and return an id for the shared
  // segment.
  ;
#endif
# 104 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"

 private:
  ;
#if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_BSD)
  explicit TransportDIB(base::SharedMemoryHandle dib);
  base::SharedMemory shared_memory_;
#elif defined(OS_LINUX)
# 111 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"
  int key_;  // SysV shared memory id
  void* address_;  // mapped address
  XID x_shm_;  // X id for the shared segment
  Display* display_;  // connection to the X server
#endif
# 116 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"
#ifdef OS_WIN
  uint32_t sequence_num_;
#endif
# 119 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"
  size_t size_;  // length, in bytes
};

class MessageLoop;

#endif  // CHROME_COMMON_TRANSPORT_DIB_H_
# 125 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/transport_dib.h"
# 23 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h" 2

namespace IPC {

//-----------------------------------------------------------------------------
// ParamTraits specializations, etc.
//
// The full set of types ParamTraits is specialized upon contains *possibly*
// repeated types: unsigned long may be uint32_t or size_t, unsigned long long
// may be uint64_t or size_t, nsresult may be uint32_t, and so on.  You can't
// have ParamTraits<unsigned int> *and* ParamTraits<uint32_t> if unsigned int
// is uint32_t -- that's multiple definitions, and you can only have one.
//
// You could use #ifs and macro conditions to avoid duplicates, but they'd be
// exactly the above idea.
//

template <class P> struct ParamTraits;

template <class P>
static inline void WriteParam(Message* m, const P& p) {
  ParamTraits<P>::Write(m, p);
}

template <class P>
static inline bool WARN_UNUSED_RESULT ReadParam(const Message* m, void** iter,
                                                P* p) {
  return ParamTraits<P>::Read(m, iter, p);
}



// Fundamental types.

template <class P>
struct ParamTraitsFundamental {};

template <>
struct ParamTraitsFundamental<bool> {
  typedef bool param_type;
  static void Write(Message* m, const param_type& p) {
    m->WriteBool(p);
  }
  static bool Read(const Message* m, void** iter, param_type* r) {
    return m->ReadBool(iter, r);
  }
  
};

template <>
struct ParamTraitsFundamental<int> {
  typedef int param_type;
  static void Write(Message* m, const param_type& p) {
    m->WriteInt(p);
  }
  static bool Read(const Message* m, void** iter, param_type* r) {
    return m->ReadInt(iter, r);
  }
  
};

template <>
struct ParamTraitsFundamental<long> {
  typedef long param_type;
  
  
  
};

template <>
struct ParamTraitsFundamental<unsigned long long> {
  typedef unsigned long long param_type;
  
  
  
};

template <>
struct ParamTraitsFundamental<double> {
  typedef double param_type;
  
  static bool Read(const Message* m, void** iter, param_type* r) {
    const char *data;
    int data_size = 0;
    bool result = m->ReadData(iter, &data, &data_size);
    if (result && data_size == sizeof(param_type)) {
      memcpy(r, data, sizeof(param_type));
    } else {
      result = false;
      NOTREACHED();
    }

    return result;
  }
  
};

// Fixed-size <stdint.h> types.

template <class P>
struct ParamTraitsFixed : ParamTraitsFundamental<P> {};

template <>
struct ParamTraitsFixed<int16_t> {
  typedef int16_t param_type;
  
  
  
};

template <>
struct ParamTraitsFixed<uint16_t> {
  typedef uint16_t param_type;
  
  static bool Read(const Message* m, void** iter, param_type* r) {
    return m->ReadUInt16(iter, r);
  }
  
};

template <>
struct ParamTraitsFixed<uint32_t> {
  typedef uint32_t param_type;
  static void Write(Message* m, const param_type& p) {
    m->WriteUInt32(p);
  }
  static bool Read(const Message* m, void** iter, param_type* r) {
    return m->ReadUInt32(iter, r);
  }
  
};

template <>
struct ParamTraitsFixed<int64_t> {
  typedef int64_t param_type;
  static void Write(Message* m, const param_type& p) {
    m->WriteInt64(p);
  }
  static bool Read(const Message* m, void** iter, param_type* r) {
    return m->ReadInt64(iter, r);
  }
  
};

template <>
struct ParamTraitsFixed<uint64_t> {
  typedef uint64_t param_type;
  
  static bool Read(const Message* m, void** iter, param_type* r) {
    return m->ReadInt64(iter, reinterpret_cast<int64_t*>(r));
  }
  
};

// Other standard C types.

template <class P>
struct ParamTraitsLibC : ParamTraitsFixed<P> {};

template <>
struct ParamTraitsLibC<size_t> {
  typedef size_t param_type;
  static void Write(Message* m, const param_type& p) {
    m->WriteSize(p);
  }
  static bool Read(const Message* m, void** iter, param_type* r) {
    return m->ReadSize(iter, r);
  }
  
};

// std::* types.

template <class P>
struct ParamTraitsStd : ParamTraitsLibC<P> {};

template <>
struct ParamTraitsStd<std::string> {
  typedef std::string param_type;
  
  
  
};

// Windows-specific types.

template <class P>
struct ParamTraitsWindows : ParamTraitsStd<P> {};

#if defined(OS_WIN)
template <>
struct ParamTraitsWindows<HANDLE> {
  typedef HANDLE param_type;
  static void Write(Message* m, const param_type& p) {
    m->WriteIntPtr(reinterpret_cast<intptr_t>(p));
  }
  static bool Read(const Message* m, void** iter, param_type* r) {
    return m->ReadIntPtr(iter, reinterpret_cast<intptr_t*>(r));
  }
  static void Log(const param_type& p, std::wstring* l) {
    l->append(StringPrintf(L"0x%X", p));
  }
};
#endif  // defined(OS_WIN)
# 453 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h"

// Various ipc/chromium types.

template <class P>
struct ParamTraitsIPC : ParamTraitsWindows<P> {};

#if defined(OS_POSIX)
// FileDescriptors may be serialised over IPC channels on POSIX. On the
// receiving side, the FileDescriptor is a valid duplicate of the file
// descriptor which was transmitted: *it is not just a copy of the integer like
// HANDLEs on Windows*. The only exception is if the file descriptor is < 0. In
// this case, the receiving end will see a value of -1. *Zero is a valid file
// descriptor*.
//
// The received file descriptor will have the |auto_close| flag set to true. The
// code which handles the message is responsible for taking ownership of it.
// File descriptors are OS resources and must be closed when no longer needed.
//
// When sending a file descriptor, the file descriptor must be valid at the time
// of transmission. Since transmission is not synchronous, one should consider
// dup()ing any file descriptors to be transmitted and setting the |auto_close|
// flag, which causes the file descriptor to be closed after writing.
template<>
struct ParamTraitsIPC<base::FileDescriptor> {
  typedef base::FileDescriptor param_type;
  
  
  
};
#endif // defined(OS_POSIX)
# 510 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h"

#if defined(OS_WIN)
template<>
struct ParamTraitsIPC<TransportDIB::Id> {
  typedef TransportDIB::Id param_type;
  static void Write(Message* m, const param_type& p) {
    WriteParam(m, p.handle);
    WriteParam(m, p.sequence_num);
  }
  static bool Read(const Message* m, void** iter, param_type* r) {
    return (ReadParam(m, iter, &r->handle) &&
            ReadParam(m, iter, &r->sequence_num));
  }
  static void Log(const param_type& p, std::wstring* l) {
    l->append(L"TransportDIB(");
    LogParam(p.handle, l);
    l->append(L", ");
    LogParam(p.sequence_num, l);
    l->append(L")");
  }
};
#endif
# 532 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_message_utils.h"

// Mozilla-specific types.

template <class P>
struct ParamTraitsMozilla : ParamTraitsIPC<P> {};

template <>
struct ParamTraitsMozilla<nsresult> {
  typedef nsresult param_type;
  
  
  
};

// Finally, ParamTraits itself.

template <class P> struct ParamTraits : ParamTraitsMozilla<P> {};

}  // namespace IPC

#endif  // CHROME_COMMON_IPC_MESSAGE_UTILS_H_
#ifdef _MSC_VER
#pragma warning( disable : 4800 )
#endif
# 34 "../../dist/include/ipc/IPCMessageUtils.h"

#if !defined(OS_POSIX)
// This condition must be kept in sync with the one in
// ipc_message_utils.h, but this dummy definition of
// base::FileDescriptor acts as a static assert that we only get one
// def or the other (or neither, in which case code using
// FileDescriptor fails to build)
namespace base { struct FileDescriptor { }; }
#endif
# 43 "../../dist/include/ipc/IPCMessageUtils.h"

namespace mozilla {

// This is a cross-platform approximation to HANDLE, which we expect
// to be typedef'd to void* or thereabouts.
typedef uintptr_t WindowsHandle;

// XXX there are out of place and might be generally useful.  Could
// move to nscore.h or something.
struct void_t {
  
};
struct null_t {
  
};

struct SerializedStructuredCloneBuffer
{
  

  

  

  SerializedStructuredCloneBuffer&
  operator=(const JSAutoStructuredCloneBuffer& aOther)
  {
    data = aOther.data();
    dataLength = aOther.nbytes();
    return *this;
  }

  uint64_t* data;
  size_t dataLength;
};

} // namespace mozilla

namespace IPC {

/**
 * Generic enum serializer.
 *
 * Consider using the specializations below, such as ContiguousEnumSerializer.
 *
 * This is a generic serializer for any enum type used in IPDL.
 * Programmers can define ParamTraits<E> for enum type E by deriving
 * EnumSerializer<E, MyEnumValidator> where MyEnumValidator is a struct
 * that has to define a static IsLegalValue function returning whether
 * a given value is a legal value of the enum type at hand.
 *
 * \sa https://developer.mozilla.org/en/IPDL/Type_Serialization
 */
template <typename E, typename EnumValidator>
struct EnumSerializer {
  typedef E paramType;
  typedef typename mozilla::UnsignedStdintTypeForSize<sizeof(paramType)>::Type
          uintParamType;

  static void Write(Message* aMsg, const paramType& aValue) {
    MOZ_ASSERT(EnumValidator::IsLegalValue(aValue));
    WriteParam(aMsg, uintParamType(aValue));
  }

  static bool Read(const Message* aMsg, void** aIter, paramType* aResult) {
    uintParamType value;
    if(!ReadParam(aMsg, aIter, &value) ||
       !EnumValidator::IsLegalValue(paramType(value))) {
      return false;
    }
    *aResult = paramType(value);
    return true;
  }
};

template <typename E,
          E MinLegal,
          E HighBound>
class ContiguousEnumValidator
{
  // Silence overzealous -Wtype-limits bug in GCC fixed in GCC 4.8:
  // "comparison of unsigned expression >= 0 is always true"
  // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11856
  template <typename T>
  static bool IsLessThanOrEqual(T a, T b) { return a <= b; }

public:
  static bool IsLegalValue(E e)
  {
    return IsLessThanOrEqual(MinLegal, e) && e < HighBound;
  }
};

template <typename E,
          E AllBits>
struct BitFlagsEnumValidator
{
  static bool IsLegalValue(E e)
  {
    return (e & AllBits) == e;
  }
};

/**
 * Specialization of EnumSerializer for enums with contiguous enum values.
 *
 * Provide two values: MinLegal, HighBound. An enum value x will be
 * considered legal if MinLegal <= x < HighBound.
 *
 * For example, following is definition of serializer for enum type FOO.
 * \code
 * enum FOO { FOO_FIRST, FOO_SECOND, FOO_LAST, NUM_FOO };
 *
 * template <>
 * struct ParamTraits<FOO>:
 *     public ContiguousEnumSerializer<FOO, FOO_FIRST, NUM_FOO> {};
 * \endcode
 * FOO_FIRST, FOO_SECOND, and FOO_LAST are valid value.
 */
template <typename E,
          E MinLegal,
          E HighBound>
struct ContiguousEnumSerializer
  : EnumSerializer<E,
                   ContiguousEnumValidator<E, MinLegal, HighBound>>
{};

/**
 * Specialization of EnumSerializer for enums representing bit flags.
 *
 * Provide one value: AllBits. An enum value x will be
 * considered legal if (x & AllBits) == x;
 *
 * Example:
 * \code
 * enum FOO {
 *   FOO_FIRST =  1 << 0,
 *   FOO_SECOND = 1 << 1,
 *   FOO_LAST =   1 << 2,
 *   ALL_BITS =   (1 << 3) - 1
 * };
 *
 * template <>
 * struct ParamTraits<FOO>:
 *     public BitFlagsEnumSerializer<FOO, FOO::ALL_BITS> {};
 * \endcode
 */
template <typename E,
          E AllBits>
struct BitFlagsEnumSerializer
  : EnumSerializer<E,
                   BitFlagsEnumValidator<E, AllBits>>
{};

template <>
struct ParamTraits<base::ChildPrivileges>
  : public ContiguousEnumSerializer<base::ChildPrivileges,
                                    base::PRIVILEGES_DEFAULT,
                                    base::PRIVILEGES_LAST>
{ };

template<>
struct ParamTraits<int8_t>
{
  typedef int8_t paramType;

  static void Write(Message* aMsg, const paramType& aParam)
  {
    aMsg->WriteBytes(&aParam, sizeof(aParam));
  }

  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
  {
    const char* outp;
    if (!aMsg->ReadBytes(aIter, &outp, sizeof(*aResult)))
      return false;

    *aResult = *reinterpret_cast<const paramType*>(outp);
    return true;
  }
};

template<>
struct ParamTraits<uint8_t>
{
  typedef uint8_t paramType;

  static void Write(Message* aMsg, const paramType& aParam)
  {
    aMsg->WriteBytes(&aParam, sizeof(aParam));
  }

  
};

#if !defined(OS_POSIX)
// See above re: keeping definitions in sync
template<>
struct ParamTraits<base::FileDescriptor>
{
  typedef base::FileDescriptor paramType;
  static void Write(Message* aMsg, const paramType& aParam) {
    NS_RUNTIMEABORT("FileDescriptor isn't meaningful on this platform");
  }
  static bool Read(const Message* aMsg, void** aIter, paramType* aResult) {
    NS_RUNTIMEABORT("FileDescriptor isn't meaningful on this platform");
    return false;
  }
};
#endif  // !defined(OS_POSIX)
# 271 "../../dist/include/ipc/IPCMessageUtils.h"

template <>
struct ParamTraits<nsACString>
{
  typedef nsACString paramType;

  

  

  
};

template <>
struct ParamTraits<nsAString>
{
  typedef nsAString paramType;

  

  

  
};

template <>
struct ParamTraits<nsCString> : ParamTraits<nsACString>
{
  typedef nsCString paramType;
};

template <>
struct ParamTraits<nsLiteralCString> : ParamTraits<nsACString>
{
  typedef nsLiteralCString paramType;
};

#ifdef MOZILLA_INTERNAL_API

template<>
struct ParamTraits<nsAutoCString> : ParamTraits<nsCString>
{
  typedef nsAutoCString paramType;
};

#endif  // MOZILLA_INTERNAL_API
# 402 "../../dist/include/ipc/IPCMessageUtils.h"

template <>
struct ParamTraits<nsString> : ParamTraits<nsAString>
{
  typedef nsString paramType;
};

template <>
struct ParamTraits<nsLiteralString> : ParamTraits<nsAString>
{
  typedef nsLiteralString paramType;
};

template <typename E>
struct ParamTraits<FallibleTArray<E> >
{
  typedef FallibleTArray<E> paramType;

  // We write arrays of integer or floating-point data using a single pickling
  // call, rather than writing each element individually.  We deliberately do
  // not use mozilla::IsPod here because it is perfectly reasonable to have
  // a data structure T for which IsPod<T>::value is true, yet also have a
  // ParamTraits<T> specialization.
  static const bool sUseWriteBytes = (mozilla::IsIntegral<E>::value ||
                                      mozilla::IsFloatingPoint<E>::value);

  // Compute the byte length for |aNumElements| of type E.  If that length
  // would overflow an int, return false.  Otherwise, return true and place
  // the byte length in |aTotalLength|.
  //
  // Pickle's ReadBytes/WriteBytes interface takes lengths in ints, hence this
  // dance.
  static bool ByteLengthIsValid(size_t aNumElements, int* aTotalLength) {
    static_assert(sizeof(int) == sizeof(int32_t), "int is an unexpected size!");

    // nsTArray only handles sizes up to INT32_MAX.
    if (aNumElements > size_t(INT32_MAX)) {
      return false;
    }

    int64_t numBytes = static_cast<int64_t>(aNumElements) * sizeof(E);
    if (numBytes > int64_t(INT32_MAX)) {
      return false;
    }

    *aTotalLength = static_cast<int>(numBytes);
    return true;
  }

  static void Write(Message* aMsg, const paramType& aParam)
  {
    uint32_t length = aParam.Length();
    WriteParam(aMsg, length);

    if (sUseWriteBytes) {
      int pickledLength = 0;
      mozilla::DebugOnly<bool> valid = ByteLengthIsValid(length, &pickledLength);
      MOZ_ASSERT(valid);
      aMsg->WriteBytes(aParam.Elements(), pickledLength);
    } else {
      for (uint32_t index = 0; index < length; index++) {
        WriteParam(aMsg, aParam[index]);
      }
    }
  }

  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
  {
    uint32_t length;
    if (!ReadParam(aMsg, aIter, &length)) {
      return false;
    }

    if (sUseWriteBytes) {
      int pickledLength = 0;
      if (!ByteLengthIsValid(length, &pickledLength)) {
        return false;
      }

      for (uint32_t index = 0; index < length; index++) {
        E* element = aResult->AppendElement();
        MOZ_ASSERT(element);
        if (!ReadParam(aMsg, aIter, element)) {
          return false;
        }
      }
    }

    return true;
  }

  
};

template<typename E>
struct ParamTraits<InfallibleTArray<E> >
{
  typedef InfallibleTArray<E> paramType;

  static void Write(Message* aMsg, const paramType& aParam)
  {
    WriteParam(aMsg, static_cast<const FallibleTArray<E>&>(aParam));
  }

  // deserialize the array fallibly, but return an InfallibleTArray
  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
  {
    FallibleTArray<E> temp;
    if (!ReadParam(aMsg, aIter, &temp))
      return false;

    aResult->SwapElements(temp);
    return true;
  }

  
};

template<typename E, size_t N>
struct ParamTraits<nsAutoTArray<E, N>> : ParamTraits<nsTArray<E>>
{
  typedef nsAutoTArray<E, N> paramType;
};

template<>
struct ParamTraits<float>
{
  typedef float paramType;

  static void Write(Message* aMsg, const paramType& aParam)
  {
    aMsg->WriteBytes(&aParam, sizeof(paramType));
  }

  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
  {
    const char* outFloat;
    if (!aMsg->ReadBytes(aIter, &outFloat, sizeof(float)))
      return false;
    *aResult = *reinterpret_cast<const float*>(outFloat);
    return true;
  }

  

  

  
};

template<>
struct ParamTraits<mozilla::TimeDuration>
{
  typedef mozilla::TimeDuration paramType;
  
  ;
};

template<>
struct ParamTraits<mozilla::TimeStamp>
{
  typedef mozilla::TimeStamp paramType;
  
  ;
};

#ifdef XP_WIN

template<>
struct ParamTraits<mozilla::TimeStampValue>
{
  typedef mozilla::TimeStampValue paramType;
  static void Write(Message* aMsg, const paramType& aParam)
  {
    WriteParam(aMsg, aParam.mGTC);
    WriteParam(aMsg, aParam.mQPC);
    WriteParam(aMsg, aParam.mHasQPC);
    WriteParam(aMsg, aParam.mIsNull);
  }
  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
  {
    return (ReadParam(aMsg, aIter, &aResult->mGTC) &&
            ReadParam(aMsg, aIter, &aResult->mQPC) &&
            ReadParam(aMsg, aIter, &aResult->mHasQPC) &&
            ReadParam(aMsg, aIter, &aResult->mIsNull));
  }
};

#endif
# 704 "../../dist/include/ipc/IPCMessageUtils.h"

template <>
struct ParamTraits<mozilla::SerializedStructuredCloneBuffer>
{
  typedef mozilla::SerializedStructuredCloneBuffer paramType;

  

  

  
};

} /* namespace IPC */

#endif /* __IPC_GLUE_IPCMESSAGEUTILS_H__ */
# 749 "../../dist/include/ipc/IPCMessageUtils.h"
# 13 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsRefPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/ProtocolUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ipc/ProtocolUtils.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: sw=4 ts=4 et :
 */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_ipc_ProtocolUtils_h
#define mozilla_ipc_ProtocolUtils_h 1

#if 0 /* expanded by -frewrite-includes */
** Returns: 
**   PRStatus.
#include "IPCMessageStart.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/ipc/ProtocolUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/ipc/ProtocolUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/FileDescriptor.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ipc/FileDescriptor.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_ipc_FileDescriptor_h
#define mozilla_ipc_FileDescriptor_h

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/ipc/FileDescriptor.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/process.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/ipc/FileDescriptor.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/ipc/FileDescriptor.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/ipc/FileDescriptor.h"

#ifdef XP_WIN
// Need the HANDLE typedef.
#if 0 /* expanded by -frewrite-includes */
#include <winnt.h>
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/ipc/FileDescriptor.h"
#else
# 17 "../../dist/include/mozilla/ipc/FileDescriptor.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/file_descriptor_posix.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/ipc/FileDescriptor.h"
#endif
# 19 "../../dist/include/mozilla/ipc/FileDescriptor.h"

namespace mozilla {
namespace ipc {

// This class is used by IPDL to share file descriptors across processes. When
// sending a FileDescriptor IPDL will first duplicate a platform-specific file
// handle type ('PlatformHandleType') into a handle that is valid in the other
// process. Then IPDL will convert the duplicated handle into a type suitable
// for pickling ('PickleType') and then send that through the IPC pipe. In the
// receiving process the pickled data is converted into a platform-specific file
// handle and then returned to the receiver.
//
// To use this class add 'FileDescriptor' as an argument in the IPDL protocol
// and then pass a file descriptor from C++ to the Call/Send method. The
// Answer/Recv method will receive a FileDescriptor& on which PlatformHandle()
// can be called to return the platform file handle.
class FileDescriptor
{
public:
  typedef base::ProcessHandle ProcessHandle;

#ifdef XP_WIN
  typedef HANDLE PlatformHandleType;
  typedef HANDLE PickleType;
#else
# 44 "../../dist/include/mozilla/ipc/FileDescriptor.h"
  typedef int PlatformHandleType;
  typedef base::FileDescriptor PickleType;
#endif
# 47 "../../dist/include/mozilla/ipc/FileDescriptor.h"

  // Performs platform-specific actions to duplicate mHandle in the other
  // process (e.g. dup() on POSIX, DuplicateHandle() on Windows). Returns a
  // pickled value that can be passed to the other process via IPC.
  ;

  // Tests mHandle against a well-known invalid platform-specific file handle
  // (e.g. -1 on POSIX, INVALID_HANDLE_VALUE on Windows).
  

  PlatformHandleType
  PlatformHandle() const
  {
    if (mHandleCreatedByOtherProcess) {
      mHandleCreatedByOtherProcessWasUsed = true;
    }
    return mHandle;
  }

  

private:
  

  ;

  void
  DuplicateInCurrentProcess(PlatformHandleType aHandle);

  void
  CloseCurrentProcessHandle();

  PlatformHandleType mHandle;

  // If this is true then this instance is created by IPDL to ferry a handle to
  // its eventual consumer and we never close the handle. If this is false then
  // we are a RAII wrapper around the handle and we close the handle on
  // destruction.
  bool mHandleCreatedByOtherProcess;

  // This is to ensure that we don't leak the handle (which is only possible
  // when we're in the receiving process).
  mutable DebugOnly<bool> mHandleCreatedByOtherProcessWasUsed;
};

} // namespace ipc
} // namespace mozilla

#endif // mozilla_ipc_FileDescriptor_h
# 159 "../../dist/include/mozilla/ipc/FileDescriptor.h"
# 20 "../../dist/include/mozilla/ipc/ProtocolUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/Shmem.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ipc/Shmem.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=8 et :
 */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_ipc_Shmem_h
#define mozilla_ipc_Shmem_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/ipc/Shmem.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/ipc/Shmem.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/process.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/ipc/Shmem.h"

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#include "mozilla/ipc/SharedMemory.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ipc/SharedMemory.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=8 et :
 */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_ipc_SharedMemory_h
#define mozilla_ipc_SharedMemory_h

#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/ipc/SharedMemory.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"    // NS_INLINE_DECL_REFCOUNTING
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/ipc/SharedMemory.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/ipc/SharedMemory.h"

//
// This is a low-level wrapper around platform shared memory.  Don't
// use it directly; use Shmem allocated through IPDL interfaces.
//
namespace {
enum Rights {
  RightsNone = 0,
  RightsRead = 1 << 0,
  RightsWrite = 1 << 1
};
}

namespace mozilla {

namespace ipc {
class SharedMemory;
}

namespace ipc {

class SharedMemory
{
protected:
  virtual ~SharedMemory()
  {
    Unmapped();
    Destroyed();
  }

public:
  enum SharedMemoryType {
    TYPE_BASIC,
    TYPE_SYSV,
    TYPE_UNKNOWN
  };

  size_t Size() const { return mMappedSize; }

  ;

  // Implementations should call these methods on shmem usage changes,
  // but *only if* the OS-specific calls are known to have succeeded.
  // The methods are expected to be called in the pattern
  //
  //   Created (Mapped Unmapped)* Destroy
  //
  // but this isn't checked.
  ;
  ;
  void Unmapped();
  void Destroyed();

  // The size of the shmem region requested in Create(), if
  // successful.  SharedMemory instances that are opened from a
  // foreign handle have an alloc size of 0, even though they have
  // access to the alloc-size information.
  size_t mAllocSize;
  // The size of the region mapped in Map(), if successful.  All
  // SharedMemorys that are mapped have a non-zero mapped size.
  size_t mMappedSize;
};

} // namespace ipc
} // namespace mozilla


#endif // ifndef mozilla_ipc_SharedMemory_h
# 117 "../../dist/include/mozilla/ipc/SharedMemory.h"
# 22 "../../dist/include/mozilla/ipc/Shmem.h" 2

/**
 * |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 |mozilla::ipc::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
 */

namespace mozilla {
namespace layers {
class ShadowLayerForwarder;
}

namespace ipc {

class Shmem MOZ_FINAL
{
  friend struct IPC::ParamTraits<mozilla::ipc::Shmem>;
#ifdef DEBUG
  // For ShadowLayerForwarder::CheckSurfaceDescriptor
  friend class mozilla::layers::ShadowLayerForwarder;
#endif
# 71 "../../dist/include/mozilla/ipc/Shmem.h"

public:
  typedef int32_t id_t;
  // Low-level wrapper around platform shmem primitives.
  typedef mozilla::ipc::SharedMemory SharedMemory;
  typedef SharedMemory::SharedMemoryType SharedMemoryType;
  struct IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead {};

  

  

#if !defined(DEBUG)
  
#else
# 106 "../../dist/include/mozilla/ipc/Shmem.h"
  Shmem(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead,
        SharedMemory* aSegment, id_t aId);
#endif
# 109 "../../dist/include/mozilla/ipc/Shmem.h"

  

  

  

  // Returns whether this Shmem is writable by you, and thus whether you can
  // transfer writability to another actor.
  

  // depend on the type of SharedMemory that was passed to us.
  ;

  ;

private:
  

#if !defined(DEBUG)
  

  

#else
# 265 "../../dist/include/mozilla/ipc/Shmem.h"
  void AssertInvariants() const;
#endif
# 267 "../../dist/include/mozilla/ipc/Shmem.h"

  SharedMemory* MOZ_NON_OWNING_REF mSegment;
  void* mData;
  size_t mSize;
  id_t mId;
};


} // namespace ipc
} // namespace mozilla


namespace IPC {


} // namespace IPC


#endif // ifndef mozilla_ipc_Shmem_h
# 315 "../../dist/include/mozilla/ipc/Shmem.h"
# 21 "../../dist/include/mozilla/ipc/ProtocolUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/Transport.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ipc/Transport.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=8 et :
 */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_ipc_Transport_h
#define mozilla_ipc_Transport_h 1

#if 0 /* expanded by -frewrite-includes */
#include "base/process_util.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/ipc/Transport.h"
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/ipc_channel.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_channel.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_IPC_CHANNEL_H_
#define CHROME_COMMON_IPC_CHANNEL_H_

#if 0 /* expanded by -frewrite-includes */
#include <queue>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 1 3
// -*- C++ -*-
//===--------------------------- queue ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_QUEUE
#define _LIBCPP_QUEUE

/*
    queue synopsis

namespace std
{

template <class T, class Container = deque<T>>
class queue

    bool            empty() const;
    size_type       size() const;
}  // std

*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 169 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3
#if 0 /* expanded by -frewrite-includes */
#include <deque>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 1 3
// -*- C++ -*-
//===---------------------------- deque -----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_DEQUE
#define _LIBCPP_DEQUE

/*
    bool operator!=(const deque<T,Allocator>& x, const deque<T,Allocator>& y);
template <class T, class Allocator>
    bool operator> (const deque<T,Allocator>& x, const deque<T,Allocator>& y);
template <class T, class Allocator>
    bool operator>=(const deque<T,Allocator>& x, const deque<T,Allocator>& y);
template <class T, class Allocator>
    bool operator<=(const deque<T,Allocator>& x, const deque<T,Allocator>& y);

// specialized algorithms:
template <class T, class Allocator>
    void swap(deque<T,Allocator>& x, deque<T,Allocator>& y)
         noexcept(noexcept(x.swap(y)));

}  // std

*/

# 20 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3

#ifdef max
#if defined(_MSC_VER) && ! defined(__clang__)
_LIBCPP_WARNING("macro max is incompatible with C++.  Try #define NOMINMAX "
                "before any Windows header. #undefing max")
#else
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro max is incompatible with C++.  #undefing max
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
#endif
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 167 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 2 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Tp, class _Allocator> class __deque_base;

template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
          class _DiffType, _DiffType _BlockSize>
class _LIBCPP_TYPE_VIS_ONLY __deque_iterator;

;

;

;

;

;

;

;

;

;

;

;

;

template <class _ValueType, class _Pointer, class _Reference, class _MapPointer,
          class _DiffType, _DiffType _BlockSize>
class _LIBCPP_TYPE_VIS_ONLY __deque_iterator
{
    typedef _MapPointer __map_iterator;
    ;

    ;

    ;

    ;

    ;
};

// copy







// move_backward







template <bool>
class __deque_base_common
{
protected:
    ;
    ;
};





template <class _Tp, class _Allocator>
class __deque_base
    : protected __deque_base_common<true>
{
    ;
    ;
protected:
    typedef _Tp                                      value_type;
    typedef _Allocator                               allocator_type;
    typedef allocator_traits<allocator_type>         __alloc_traits;
    typedef value_type&                              reference;
    typedef const value_type&                        const_reference;
    typedef typename __alloc_traits::size_type       size_type;
    typedef typename __alloc_traits::difference_type difference_type;
    typedef typename __alloc_traits::pointer         pointer;
    typedef typename __alloc_traits::const_pointer   const_pointer;

    static const difference_type __block_size = sizeof(value_type) < 256 ? 4096 / sizeof(value_type) : 16;

    typedef typename __alloc_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
                rebind_alloc<pointer>
#else
# 918 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
                rebind_alloc<pointer>::other
#endif
# 920 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
                                                         __pointer_allocator;
    typedef allocator_traits<__pointer_allocator>        __map_traits;
    typedef typename __map_traits::pointer               __map_pointer;
    typedef typename __alloc_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
                rebind_alloc<const_pointer>
#else
# 927 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
                rebind_alloc<const_pointer>::other
#endif
# 929 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
                                                         __const_pointer_allocator;
    typedef typename allocator_traits<__const_pointer_allocator>::const_pointer __map_const_pointer;
    typedef __split_buffer<pointer, __pointer_allocator> __map;

    typedef __deque_iterator<value_type, pointer, reference, __map_pointer,
                             difference_type, __block_size>    iterator;
    typedef __deque_iterator<value_type, const_pointer, const_reference, __map_const_pointer,
                             difference_type, __block_size>    const_iterator;

    __map __map_;
    size_type __start_;
    __compressed_pair<size_type, allocator_type> __size_;

    iterator       begin() _NOEXCEPT;
    const_iterator begin() const _NOEXCEPT;
    iterator       end() _NOEXCEPT;
    const_iterator end() const _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY size_type&            size()          {return __size_.first();}
    _LIBCPP_INLINE_VISIBILITY
    const size_type& size() const _NOEXCEPT {return __size_.first();}
    _LIBCPP_INLINE_VISIBILITY allocator_type&       __alloc()       {return __size_.second();}
    _LIBCPP_INLINE_VISIBILITY
    const allocator_type& __alloc() const _NOEXCEPT {return __size_.second();}

    __deque_base()
        _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value);
    explicit __deque_base(const allocator_type& __a);
public:
    ~__deque_base();

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

    __deque_base(__deque_base&& __c)
        _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
    __deque_base(__deque_base&& __c, const allocator_type& __a);

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 967 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
    void swap(__deque_base& __c)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<allocator_type>::value);
protected:
    void clear() _NOEXCEPT;

    bool __invariants() const;

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign(__deque_base& __c)
        _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
                   is_nothrow_move_assignable<allocator_type>::value)
    {
        __map_ = _VSTD::move(__c.__map_);
        __start_ = __c.__start_;
        size() = __c.size();
        __move_assign_alloc(__c);
        __c.__start_ = __c.size() = 0;
    }

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__deque_base& __c)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_move_assignment::value ||
                   is_nothrow_move_assignable<allocator_type>::value)
        {__move_assign_alloc(__c, integral_constant<bool,
                      __alloc_traits::propagate_on_container_move_assignment::value>());}

private:
    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__deque_base& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
        {
            __alloc() = _VSTD::move(__c.__alloc());
        }

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__deque_base&, false_type) _NOEXCEPT
        {}

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(allocator_type& __x, allocator_type& __y)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<allocator_type>::value)
        {__swap_alloc(__x, __y, integral_constant<bool,
                      __alloc_traits::propagate_on_container_swap::value>());}

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(allocator_type& __x, allocator_type& __y, true_type)
        _NOEXCEPT_(__is_nothrow_swappable<allocator_type>::value)
        {
            using _VSTD::swap;
            swap(__x, __y);
        }

    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(allocator_type&, allocator_type&, false_type)
        _NOEXCEPT
        {}
};

template <class _Tp, class _Allocator>
bool
__deque_base<_Tp, _Allocator>::__invariants() const
{
    if (!__map_.__invariants())
        return false;
    if (__map_.size() >= size_type(-1) / __block_size)
        return false;
    for (typename __map::const_iterator __i = __map_.begin(), __e = __map_.end();
         __i != __e; ++__i)
        if (*__i == nullptr)
            return false;
    if (__map_.size() != 0)
    {
        if (size() >= __map_.size() * __block_size)
            return false;
        if (__start_ >= __map_.size() * __block_size - size())
            return false;
    }
    else
    {
        if (size() != 0)
            return false;
        if (__start_ != 0)
            return false;
    }
    return true;
}

template <class _Tp, class _Allocator>
typename __deque_base<_Tp, _Allocator>::iterator
__deque_base<_Tp, _Allocator>::begin() _NOEXCEPT
{
    size_type __p = size() + __start_;
    __map_pointer __mp = __map_.begin() + __p / __block_size;
    return iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
}

template <class _Tp, class _Allocator>
typename __deque_base<_Tp, _Allocator>::const_iterator
__deque_base<_Tp, _Allocator>::end() const _NOEXCEPT
{
    size_type __p = size() + __start_;
    __map_const_pointer __mp = static_cast<__map_const_pointer>(__map_.begin() + __p / __block_size);
    return const_iterator(__mp, __map_.empty() ? 0 : *__mp + __p % __block_size);
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
__deque_base<_Tp, _Allocator>::__deque_base()
    _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
    : __start_(0), __size_(0) {}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
__deque_base<_Tp, _Allocator>::__deque_base(const allocator_type& __a)
    : __map_(__pointer_allocator(__a)), __start_(0), __size_(0, __a) {}

template <class _Tp, class _Allocator>
__deque_base<_Tp, _Allocator>::~__deque_base()
{
    clear();
    typename __map::iterator __i = __map_.begin();
    typename __map::iterator __e = __map_.end();
    for (; __i != __e; ++__i)
        __alloc_traits::deallocate(__alloc(), *__i, __block_size);
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Allocator>
__deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c)
    _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
    : __map_(_VSTD::move(__c.__map_)),
      __start_(_VSTD::move(__c.__start_)),
      __size_(_VSTD::move(__c.__size_))
{
    __c.__start_ = 0;
    __c.size() = 0;
}

template <class _Tp, class _Allocator>
__deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c, const allocator_type& __a)
    : __map_(_VSTD::move(__c.__map_), __pointer_allocator(__a)),
      __start_(_VSTD::move(__c.__start_)),
      __size_(_VSTD::move(__c.size()), __a)
{
    if (__a == __c.__alloc())
    {
        __c.__start_ = 0;
        __c.size() = 0;
    }
    else
    {
        __map_.clear();
        __start_ = 0;
        size() = 0;
    }
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1144 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3

template <class _Tp, class _Allocator>
void
__deque_base<_Tp, _Allocator>::swap(__deque_base& __c)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value||
                   __is_nothrow_swappable<allocator_type>::value)
{
    __map_.swap(__c.__map_);
    _VSTD::swap(__start_, __c.__start_);
    _VSTD::swap(size(), __c.size());
    switch (__map_.size())
    {
    case 1:
        __start_ = __block_size / 2;
        break;
    case 2:
        __start_ = __block_size;
        break;
    }
}

template <class _Tp, class _Allocator = allocator<_Tp> >
class _LIBCPP_TYPE_VIS_ONLY deque
    : private __deque_base<_Tp, _Allocator>
{
public:
    // types:

    typedef _Tp value_type;
    typedef _Allocator allocator_type;

    typedef __deque_base<value_type, allocator_type> __base;

    typedef typename __base::__alloc_traits        __alloc_traits;
    typedef typename __base::reference             reference;
    typedef typename __base::const_reference       const_reference;
    typedef typename __base::iterator              iterator;
    typedef typename __base::const_iterator        const_iterator;
    typedef typename __base::size_type             size_type;
    typedef typename __base::difference_type       difference_type;

    typedef typename __base::pointer               pointer;
    typedef typename __base::const_pointer         const_pointer;
    typedef _VSTD::reverse_iterator<iterator>       reverse_iterator;
    typedef _VSTD::reverse_iterator<const_iterator> const_reverse_iterator;

    // construct/copy/destroy:
    _LIBCPP_INLINE_VISIBILITY
    deque()
        _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
        {}
    _LIBCPP_INLINE_VISIBILITY deque(const allocator_type& __a) : __base(__a) {}
    explicit deque(size_type __n);
#if _LIBCPP_STD_VER > 11
    explicit deque(size_type __n, const _Allocator& __a);
#endif
# 1216 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
    deque(size_type __n, const value_type& __v);
    deque(size_type __n, const value_type& __v, const allocator_type& __a);
    ;
    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    deque(initializer_list<value_type> __il);
    deque(initializer_list<value_type> __il, const allocator_type& __a);
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1230 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3

    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    deque& operator=(initializer_list<value_type> __il) {assign(__il); return *this;}
#endif   // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1236 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value);
    deque(deque&& __c, const allocator_type& __a);
    deque& operator=(deque&& __c)
        _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
                   is_nothrow_move_assignable<allocator_type>::value);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1244 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3

    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1257 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3

    allocator_type get_allocator() const _NOEXCEPT;

    // iterators:

    _LIBCPP_INLINE_VISIBILITY
    iterator       begin() _NOEXCEPT       {return __base::begin();}
    _LIBCPP_INLINE_VISIBILITY

    // capacity:
    _LIBCPP_INLINE_VISIBILITY
    size_type size() const _NOEXCEPT {return __base::size();}
    _LIBCPP_INLINE_VISIBILITY
    size_type max_size() const _NOEXCEPT
        {return __alloc_traits::max_size(__base::__alloc());}
    ;
    ;
    void shrink_to_fit() _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY
    bool empty() const _NOEXCEPT {return __base::size() == 0;}

    // element access:
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;

    // 23.2.2.3 modifiers:
    ;
    void push_back(const value_type& __v);
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class... _Args> void emplace_front(_Args&&... __args);
    template <class... _Args> void emplace_back(_Args&&... __args);
    template <class... _Args> iterator emplace(const_iterator __p, _Args&&... __args);
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1328 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
    void push_front(value_type&& __v);
    void push_back(value_type&& __v);
    iterator insert(const_iterator __p, value_type&& __v);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1332 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
    ;
    ;
    ;
    template <class _BiIter>
        iterator insert (const_iterator __p, _BiIter __f, _BiIter __l,
                         typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type* = 0);
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    iterator insert(const_iterator __p, initializer_list<value_type> __il)
        {return insert(__p, __il.begin(), __il.end());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1346 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
    void pop_front();
    void pop_back();
    iterator erase(const_iterator __p);
    iterator erase(const_iterator __f, const_iterator __l);

    void swap(deque& __c)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<allocator_type>::value);
    void clear() _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY
    bool __invariants() const {return __base::__invariants();}
private:
    typedef typename __base::__map_const_pointer __map_const_pointer;

    _LIBCPP_INLINE_VISIBILITY
    static size_type __recommend_blocks(size_type __n)
    {
        return __n / __base::__block_size + (__n % __base::__block_size != 0);
    }
    _LIBCPP_INLINE_VISIBILITY
    size_type __capacity() const
    {
        return __base::__map_.size() == 0 ? 0 : __base::__map_.size() * __base::__block_size - 1;
    }
    _LIBCPP_INLINE_VISIBILITY
    size_type __front_spare() const
    {
        return __base::__start_;
    }
    _LIBCPP_INLINE_VISIBILITY
    size_type __back_spare() const
    {
        return __capacity() - (__base::__start_ + __base::size());
    }

    template <class _InpIter>
        void __append(_InpIter __f, _InpIter __l,
                 typename enable_if<__is_input_iterator<_InpIter>::value &&
                                   !__is_forward_iterator<_InpIter>::value>::type* = 0);
    template <class _ForIter>
        void __append(_ForIter __f, _ForIter __l,
                      typename enable_if<__is_forward_iterator<_ForIter>::value>::type* = 0);
    void __append(size_type __n);
    void __append(size_type __n, const value_type& __v);
    void __erase_to_end(const_iterator __f);
    void __add_front_capacity();
    void __add_front_capacity(size_type __n);
    void __add_back_capacity();
    void __add_back_capacity(size_type __n);
    iterator __move_and_check(iterator __f, iterator __l, iterator __r,
                              const_pointer& __vt);
    iterator __move_backward_and_check(iterator __f, iterator __l, iterator __r,
                                       const_pointer& __vt);
    void __move_construct_and_check(iterator __f, iterator __l,
                                    iterator __r, const_pointer& __vt);
    void __move_construct_backward_and_check(iterator __f, iterator __l,
                                             iterator __r, const_pointer& __vt);

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const deque& __c)
        {__copy_assign_alloc(__c, integral_constant<bool,
                      __alloc_traits::propagate_on_container_copy_assignment::value>());}

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const deque& __c, true_type)
        {
            if (__base::__alloc() != __c.__alloc())
            {
                clear();
                shrink_to_fit();
            }
            __base::__alloc() = __c.__alloc();
            __base::__map_.__alloc() = __c.__map_.__alloc();
        }

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const deque&, false_type)
        {}

    void __move_assign(deque& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
    void __move_assign(deque& __c, false_type);
};

template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(size_type __n)
{
    if (__n > 0)
        __append(__n);
}

#if _LIBCPP_STD_VER > 11
template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(size_type __n, const _Allocator& __a)
    : __base(__a)
{
    if (__n > 0)
        __append(__n);
}
#endif
# 1447 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3

template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v)
{
    if (__n > 0)
        __append(__n, __v);
}

template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(size_type __n, const value_type& __v, const allocator_type& __a)
    : __base(__a)
{
    if (__n > 0)
        __append(__n, __v);
}









#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il)
{
    __append(__il.begin(), __il.end());
}

template <class _Tp, class _Allocator>
deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il, const allocator_type& __a)
    : __base(__a)
{
    __append(__il.begin(), __il.end());
}

#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1510 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3



#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
deque<_Tp, _Allocator>::deque(deque&& __c)
    _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
    : __base(_VSTD::move(__c))
{
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
deque<_Tp, _Allocator>::deque(deque&& __c, const allocator_type& __a)
    : __base(_VSTD::move(__c), __a)
{
    if (__a != __c.__alloc())
    {
        typedef move_iterator<iterator> _Ip;
        assign(_Ip(__c.begin()), _Ip(__c.end()));
    }
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
deque<_Tp, _Allocator>&
deque<_Tp, _Allocator>::operator=(deque&& __c)
        _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
                   is_nothrow_move_assignable<allocator_type>::value)
{
    __move_assign(__c, integral_constant<bool,
          __alloc_traits::propagate_on_container_move_assignment::value>());
    return *this;
}

template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__move_assign(deque& __c, false_type)
{
    if (__base::__alloc() != __c.__alloc())
    {
        typedef move_iterator<iterator> _Ip;
        assign(_Ip(__c.begin()), _Ip(__c.end()));
    }
    else
        __move_assign(__c, true_type());
}

template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__move_assign(deque& __c, true_type)
    _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value)
{
    clear();
    shrink_to_fit();
    __base::__move_assign(__c);
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1581 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3







template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
_Allocator
deque<_Tp, _Allocator>::get_allocator() const _NOEXCEPT
{
    return __base::__alloc();
}





template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::shrink_to_fit() _NOEXCEPT
{
    allocator_type& __a = __base::__alloc();
    if (empty())
    {
        while (__base::__map_.size() > 0)
        {
            __alloc_traits::deallocate(__a, __base::__map_.back(), __base::__block_size);
            __base::__map_.pop_back();
        }
        __base::__start_ = 0;
    }
    else
    {
        if (__front_spare() >= __base::__block_size)
        {
            __alloc_traits::deallocate(__a, __base::__map_.front(), __base::__block_size);
            __base::__map_.pop_front();
            __base::__start_ -= __base::__block_size;
        }
        if (__back_spare() >= __base::__block_size)
        {
            __alloc_traits::deallocate(__a, __base::__map_.back(), __base::__block_size);
            __base::__map_.pop_back();
        }
    }
    __base::__map_.shrink_to_fit();
}

















template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::push_back(const value_type& __v)
{
    allocator_type& __a = __base::__alloc();
    if (__back_spare() == 0)
        __add_back_capacity();
    // __back_spare() >= 1
    __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), __v);
    ++__base::size();
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::push_back(value_type&& __v)
{
    allocator_type& __a = __base::__alloc();
    if (__back_spare() == 0)
        __add_back_capacity();
    // __back_spare() >= 1
    __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
    ++__base::size();
}

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Allocator>
template <class... _Args>
void
deque<_Tp, _Allocator>::emplace_back(_Args&&... __args)
{
    allocator_type& __a = __base::__alloc();
    if (__back_spare() == 0)
        __add_back_capacity();
    // __back_spare() >= 1
    __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
    ++__base::size();
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1806 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1807 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3



#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::push_front(value_type&& __v)
{
    allocator_type& __a = __base::__alloc();
    if (__front_spare() == 0)
        __add_front_capacity();
    // __front_spare() >= 1
    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
    --__base::__start_;
    ++__base::size();
}

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Allocator>
template <class... _Args>
void
deque<_Tp, _Allocator>::emplace_front(_Args&&... __args)
{
    allocator_type& __a = __base::__alloc();
    if (__front_spare() == 0)
        __add_front_capacity();
    // __front_spare() >= 1
    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
    --__base::__start_;
    ++__base::size();
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1853 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1854 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3



#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Allocator>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
{
    size_type __pos = __p - __base::begin();
    size_type __to_end = __base::size() - __pos;
    allocator_type& __a = __base::__alloc();
    if (__pos < __to_end)
    {   // insert by shifting things backward
        if (__front_spare() == 0)
            __add_front_capacity();
        // __front_spare() >= 1
        if (__pos == 0)
        {
            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
            --__base::__start_;
            ++__base::size();
        }
        else
        {
            iterator __b = __base::begin();
            iterator __bm1 = _VSTD::prev(__b);
            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
            --__base::__start_;
            ++__base::size();
            if (__pos > 1)
                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
            *__b = _VSTD::move(__v);
        }
    }
    else
    {   // insert by shifting things forward
        if (__back_spare() == 0)
            __add_back_capacity();
        // __back_capacity >= 1
        size_type __de = __base::size() - __pos;
        if (__de == 0)
        {
            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
            ++__base::size();
        }
        else
        {
            iterator __e = __base::end();
            iterator __em1 = _VSTD::prev(__e);
            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
            ++__base::size();
            if (__de > 1)
                __e = _VSTD::move_backward(__e - __de, __em1, __e);
            *--__e = _VSTD::move(__v);
        }
    }
    return __base::begin() + __pos;
}

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Allocator>
template <class... _Args>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
{
    size_type __pos = __p - __base::begin();
    size_type __to_end = __base::size() - __pos;
    allocator_type& __a = __base::__alloc();
    if (__pos < __to_end)
    {   // insert by shifting things backward
        if (__front_spare() == 0)
            __add_front_capacity();
        // __front_spare() >= 1
        if (__pos == 0)
        {
            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
            --__base::__start_;
            ++__base::size();
        }
            __add_back_capacity();
        // __back_capacity >= 1
        size_type __de = __base::size() - __pos;
        if (__de == 0)
        {
            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
            ++__base::size();
        }
        else
        {
            value_type __tmp(_VSTD::forward<_Args>(__args)...);
            iterator __e = __base::end();
            iterator __em1 = _VSTD::prev(__e);
            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
            ++__base::size();
            if (__de > 1)
                __e = _VSTD::move_backward(__e - __de, __em1, __e);
            *--__e = _VSTD::move(__tmp);
        }
    }
    return __base::begin() + __pos;
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 2034 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 2035 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3





template <class _Tp, class _Allocator>
template <class _BiIter>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
                               typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type*)
{
    size_type __n = _VSTD::distance(__f, __l);
    size_type __pos = __p - __base::begin();
    size_type __to_end = __base::size() - __pos;
    allocator_type& __a = __base::__alloc();
    if (__pos < __to_end)
    {   // insert by shifting things backward
        if (__n > __front_spare())
            __add_front_capacity(__n - __front_spare());
        // __n <= __front_spare()
        size_type __old_n = __n;
        iterator __old_begin = __base::begin();
        iterator __i = __old_begin;
        _BiIter __m = __f;
        if (__n > __pos)
        {
            __m = __pos < __n / 2 ? _VSTD::prev(__l, __pos) : _VSTD::next(__f, __n - __pos);
            for (_BiIter __j = __m; __j != __f; --__base::__start_, ++__base::size())
                __alloc_traits::construct(__a, _VSTD::addressof(*--__i), *--__j);
            __n = __pos;
        }
        if (__n > 0)
        {
            iterator __obn = __old_begin + __n;
            for (iterator __j = __obn; __j != __old_begin;)
            {
                __alloc_traits::construct(__a, _VSTD::addressof(*--__i), _VSTD::move(*--__j));
                --__base::__start_;
                ++__base::size();
            }
            if (__n < __pos)
                __old_begin = _VSTD::move(__obn, __old_begin + __pos, __old_begin);
            _VSTD::copy(__m, __l, __old_begin);
        }
    }
    else
    {   // insert by shifting things forward
        size_type __back_capacity = __back_spare();
        if (__n > __back_capacity)
            __add_back_capacity(__n - __back_capacity);
        // __n <= __back_capacity
        size_type __old_n = __n;
        iterator __old_end = __base::end();
        iterator __i = __old_end;
        _BiIter __m = __l;
        size_type __de = __base::size() - __pos;
        if (__n > __de)
        {
            __m = __de < __n / 2 ? _VSTD::next(__f, __de) : _VSTD::prev(__l, __n - __de);
            for (_BiIter __j = __m; __j != __l; ++__i, ++__j, ++__base::size())
                __alloc_traits::construct(__a, _VSTD::addressof(*__i), *__j);
            __n = __de;
        }
        if (__n > 0)
        {
            iterator __oen = __old_end - __n;
            for (iterator __j = __oen; __j != __old_end; ++__i, ++__j, ++__base::size())
                __alloc_traits::construct(__a, _VSTD::addressof(*__i), _VSTD::move(*__j));
            if (__n < __de)
                __old_end = _VSTD::move_backward(__old_end - __de, __oen, __old_end);
            _VSTD::copy_backward(__f, __m, __old_end);
        }
    }
    return __base::begin() + __pos;
}

template <class _Tp, class _Allocator>
template <class _InpIter>
void
deque<_Tp, _Allocator>::__append(_InpIter __f, _InpIter __l,
                                 typename enable_if<__is_input_iterator<_InpIter>::value &&
                                                   !__is_forward_iterator<_InpIter>::value>::type*)
{
    for (; __f != __l; ++__f)
        push_back(*__f);
}

template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__append(size_type __n)
{
    allocator_type& __a = __base::__alloc();
    size_type __back_capacity = __back_spare();
    if (__n > __back_capacity)
        __add_back_capacity(__n - __back_capacity);
    // __n <= __back_capacity
    for (iterator __i = __base::end(); __n; --__n, ++__i, ++__base::size())
        __alloc_traits::construct(__a, _VSTD::addressof(*__i));
}

template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__append(size_type __n, const value_type& __v)
{
    allocator_type& __a = __base::__alloc();
    size_type __back_capacity = __back_spare();
    if (__n > __back_capacity)
        __add_back_capacity(__n - __back_capacity);
    // __n <= __back_capacity
    for (iterator __i = __base::end(); __n; --__n, ++__i, ++__base::size())
        __alloc_traits::construct(__a, _VSTD::addressof(*__i), __v);
}

// Create front capacity for one block of elements.
// Strong guarantee.  Either do it or don't touch anything.
template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__add_front_capacity()
{
    allocator_type& __a = __base::__alloc();
    if (__back_spare() >= __base::__block_size)
    {
        __base::__start_ += __base::__block_size;
        pointer __pt = __base::__map_.back();
        __base::__map_.pop_back();
        __base::__map_.push_front(__pt);
    }
    // Else if __base::__map_.size() < __base::__map_.capacity() then we need to allocate 1 buffer
    else if (__base::__map_.size() < __base::__map_.capacity())
    {   // we can put the new buffer into the map, but don't shift things around
        // until all buffers are allocated.  If we throw, we don't need to fix
        // anything up (any added buffers are undetectible)
        if (__base::__map_.__front_spare() > 0)
            __base::__map_.push_front(__alloc_traits::allocate(__a, __base::__block_size));
        else
        {
            __base::__map_.push_back(__alloc_traits::allocate(__a, __base::__block_size));
            // Done allocating, reorder capacity
            pointer __pt = __base::__map_.back();
            __base::__map_.pop_back();
            __base::__map_.push_front(__pt);
        }
        __base::__start_ = __base::__map_.size() == 1 ?
                               __base::__block_size / 2 :
                               __base::__start_ + __base::__block_size;
    }
    // Else need to allocate 1 buffer, *and* we need to reallocate __map_.
    else
    {
        __split_buffer<pointer, typename __base::__pointer_allocator&>
            __buf(max<size_type>(2 * __base::__map_.capacity(), 1),
                  0, __base::__map_.__alloc());
#ifndef _LIBCPP_NO_EXCEPTIONS
        try
        {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 2276 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
            __buf.push_back(__alloc_traits::allocate(__a, __base::__block_size));
#ifndef _LIBCPP_NO_EXCEPTIONS
        }
        catch (...)
        {
            __alloc_traits::deallocate(__a, __buf.front(), __base::__block_size);
            throw;
        }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 2285 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
        for (typename __base::__map_pointer __i = __base::__map_.begin();
                __i != __base::__map_.end(); ++__i)
            __buf.push_back(*__i);
        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
        __base::__start_ = __base::__map_.size() == 1 ?
                               __base::__block_size / 2 :
                               __base::__start_ + __base::__block_size;
    }
}

// Create front capacity for __n elements.
// Strong guarantee.  Either do it or don't touch anything.
template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__add_front_capacity(size_type __n)
{
    allocator_type& __a = __base::__alloc();
    size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
    // Number of unused blocks at back:
    size_type __back_capacity = __back_spare() / __base::__block_size;
    __back_capacity = _VSTD::min(__back_capacity, __nb);  // don't take more than you need
    __nb -= __back_capacity;  // number of blocks need to allocate
    // If __nb == 0, then we have sufficient capacity.
    if (__nb == 0)
    {
        __base::__start_ += __base::__block_size * __back_capacity;
        for (; __back_capacity > 0; --__back_capacity)
        {
            pointer __pt = __base::__map_.back();
            __base::__map_.pop_back();
            __base::__map_.push_front(__pt);
        }
    }
    // Else if __nb <= __map_.capacity() - __map_.size() then we need to allocate __nb buffers
    else if (__nb <= __base::__map_.capacity() - __base::__map_.size())
    {   // we can put the new buffers into the map, but don't shift things around
        // until all buffers are allocated.  If we throw, we don't need to fix
        // anything up (any added buffers are undetectible)
        for (; __nb > 0; --__nb, __base::__start_ += __base::__block_size - (__base::__map_.size() == 1))
        {
            if (__base::__map_.__front_spare() == 0)
                break;
            __base::__map_.push_front(__alloc_traits::allocate(__a, __base::__block_size));
        }
        for (; __nb > 0; --__nb, ++__back_capacity)
            __base::__map_.push_back(__alloc_traits::allocate(__a, __base::__block_size));
        // Done allocating, reorder capacity
        __base::__start_ += __back_capacity * __base::__block_size;
        for (; __back_capacity > 0; --__back_capacity)
        {
            pointer __pt = __base::__map_.back();
            __base::__map_.pop_back();
            __base::__map_.push_front(__pt);
        }
    }
    // Else need to allocate __nb buffers, *and* we need to reallocate __map_.
    else
    {
        size_type __ds = (__nb + __back_capacity) * __base::__block_size - __base::__map_.empty();
        __split_buffer<pointer, typename __base::__pointer_allocator&>
            __buf(max<size_type>(2* __base::__map_.capacity(),
                                 __nb + __base::__map_.size()),
                  0, __base::__map_.__alloc());
#ifndef _LIBCPP_NO_EXCEPTIONS
        try
        {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 2355 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
            for (; __nb > 0; --__nb)
                __buf.push_back(__alloc_traits::allocate(__a, __base::__block_size));
#ifndef _LIBCPP_NO_EXCEPTIONS
        }
        catch (...)
        {
            for (typename __base::__map_pointer __i = __buf.begin();
                    __i != __buf.end(); ++__i)
                __alloc_traits::deallocate(__a, *__i, __base::__block_size);
            throw;
        }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 2367 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
        for (; __back_capacity > 0; --__back_capacity)
        {
            __buf.push_back(__base::__map_.back());
            __base::__map_.pop_back();
        }
        for (typename __base::__map_pointer __i = __base::__map_.begin();
                __i != __base::__map_.end(); ++__i)
            __buf.push_back(*__i);
        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
        __base::__start_ += __ds;
    }
}

// Create back capacity for one block of elements.
// Strong guarantee.  Either do it or don't touch anything.
template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__add_back_capacity()
{
    allocator_type& __a = __base::__alloc();
    if (__front_spare() >= __base::__block_size)
    {
        __base::__start_ -= __base::__block_size;
        pointer __pt = __base::__map_.front();
        __base::__map_.pop_front();
        __base::__map_.push_back(__pt);
    }
    // Else if __nb <= __map_.capacity() - __map_.size() then we need to allocate __nb buffers
    else if (__base::__map_.size() < __base::__map_.capacity())
    {   // we can put the new buffer into the map, but don't shift things around
        // until it is allocated.  If we throw, we don't need to fix
        // anything up (any added buffers are undetectible)
        if (__base::__map_.__back_spare() != 0)
            __base::__map_.push_back(__alloc_traits::allocate(__a, __base::__block_size));
        else
        {
            __base::__map_.push_front(__alloc_traits::allocate(__a, __base::__block_size));
            // Done allocating, reorder capacity
            pointer __pt = __base::__map_.front();
            __base::__map_.pop_front();
            __base::__map_.push_back(__pt);
        }
    }
    // Else need to allocate 1 buffer, *and* we need to reallocate __map_.
    else
    {
        __split_buffer<pointer, typename __base::__pointer_allocator&>
            __buf(max<size_type>(2* __base::__map_.capacity(), 1),
                  __base::__map_.size(),
                  __base::__map_.__alloc());
#ifndef _LIBCPP_NO_EXCEPTIONS
        try
        {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 2424 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
    }
}

// Create back capacity for __n elements.
// Strong guarantee.  Either do it or don't touch anything.
template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__add_back_capacity(size_type __n)
{
    allocator_type& __a = __base::__alloc();
    size_type __nb = __recommend_blocks(__n + __base::__map_.empty());
    // Number of unused blocks at front:
    size_type __front_capacity = __front_spare() / __base::__block_size;
    __front_capacity = _VSTD::min(__front_capacity, __nb);  // don't take more than you need
    __nb -= __front_capacity;  // number of blocks need to allocate
    // If __nb == 0, then we have sufficient capacity.
    if (__nb == 0)
    {
        __base::__start_ -= __base::__block_size * __front_capacity;
        for (; __front_capacity > 0; --__front_capacity)
        {
            pointer __pt = __base::__map_.front();
            __base::__map_.pop_front();
            __base::__map_.push_back(__pt);
        }
    }
    // Else if __nb <= __map_.capacity() - __map_.size() then we need to allocate __nb buffers
    else if (__nb <= __base::__map_.capacity() - __base::__map_.size())
    {   // we can put the new buffers into the map, but don't shift things around
        // until all buffers are allocated.  If we throw, we don't need to fix
        // anything up (any added buffers are undetectible)
        for (; __nb > 0; --__nb)
        {
            if (__base::__map_.__back_spare() == 0)
                break;
            __base::__map_.push_back(__alloc_traits::allocate(__a, __base::__block_size));
        }
        for (; __nb > 0; --__nb, ++__front_capacity, __base::__start_ +=
                                 __base::__block_size - (__base::__map_.size() == 1))
            __base::__map_.push_front(__alloc_traits::allocate(__a, __base::__block_size));
        // Done allocating, reorder capacity
        __base::__start_ -= __base::__block_size * __front_capacity;
        for (; __front_capacity > 0; --__front_capacity)
        {
            pointer __pt = __base::__map_.front();
            __base::__map_.pop_front();
            __base::__map_.push_back(__pt);
        }
    }
    // Else need to allocate __nb buffers, *and* we need to reallocate __map_.
    else
    {
        size_type __ds = __front_capacity * __base::__block_size;
        __split_buffer<pointer, typename __base::__pointer_allocator&>
            __buf(max<size_type>(2* __base::__map_.capacity(),
                                 __nb + __base::__map_.size()),
                  __base::__map_.size() - __front_capacity,
                  __base::__map_.__alloc());
#ifndef _LIBCPP_NO_EXCEPTIONS
        try
        {
#endif  // _LIBCPP_NO_EXCEPTIONS
# 2502 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
            for (; __nb > 0; --__nb)
                __buf.push_back(__alloc_traits::allocate(__a, __base::__block_size));
#ifndef _LIBCPP_NO_EXCEPTIONS
        }
        catch (...)
        {
            for (typename __base::__map_pointer __i = __buf.begin();
                    __i != __buf.end(); ++__i)
                __alloc_traits::deallocate(__a, *__i, __base::__block_size);
            throw;
        }
#endif  // _LIBCPP_NO_EXCEPTIONS
# 2514 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
        for (; __front_capacity > 0; --__front_capacity)
        {
            __buf.push_back(__base::__map_.front());
            __base::__map_.pop_front();
        }
        for (typename __base::__map_pointer __i = __base::__map_.end();
                __i != __base::__map_.begin();)
            __buf.push_front(*--__i);
        _VSTD::swap(__base::__map_.__first_, __buf.__first_);
        _VSTD::swap(__base::__map_.__begin_, __buf.__begin_);
        _VSTD::swap(__base::__map_.__end_, __buf.__end_);
        _VSTD::swap(__base::__map_.__end_cap(), __buf.__end_cap());
        __base::__start_ -= __ds;
    }
}

template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::pop_front()
{
    allocator_type& __a = __base::__alloc();
    __alloc_traits::destroy(__a, __to_raw_pointer(*(__base::__map_.begin() +
                                                    __base::__start_ / __base::__block_size) +
                                                    __base::__start_ % __base::__block_size));
    --__base::size();
    if (++__base::__start_ >= 2 * __base::__block_size)
    {
        __alloc_traits::deallocate(__a, __base::__map_.front(), __base::__block_size);
        __base::__map_.pop_front();
        __base::__start_ -= __base::__block_size;
    }
}

template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::pop_back()
{
    allocator_type& __a = __base::__alloc();
    size_type __p = __base::size() + __base::__start_ - 1;
    __alloc_traits::destroy(__a, __to_raw_pointer(*(__base::__map_.begin() +
                                                    __p / __base::__block_size) +
                                                    __p % __base::__block_size));
    --__base::size();
    if (__back_spare() >= 2 * __base::__block_size)
    {
        __alloc_traits::deallocate(__a, __base::__map_.back(), __base::__block_size);
        __base::__map_.pop_back();
    }
}

// move assign [__f, __l) to [__r, __r + (__l-__f)).
// If __vt points into [__f, __l), then subtract (__f - __r) from __vt.
template <class _Tp, class _Allocator>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::__move_and_check(iterator __f, iterator __l, iterator __r,
                                         const_pointer& __vt)
{
    // as if
    //   for (; __f != __l; ++__f, ++__r)
    //       *__r = _VSTD::move(*__f);
    difference_type __n = __l - __f;
    while (__n > 0)
    {
        pointer __fb = __f.__ptr_;
        pointer __fe = *__f.__m_iter_ + __base::__block_size;
        difference_type __bs = __fe - __fb;
        if (__bs > __n)
        {
            __bs = __n;
            __fe = __fb + __bs;
        }
        if (__fb <= __vt && __vt < __fe)
            __vt = (const_iterator(static_cast<__map_const_pointer>(__f.__m_iter_), __vt) -= __f - __r).__ptr_;
        __r = _VSTD::move(__fb, __fe, __r);
        __n -= __bs;
        __f += __bs;
    }
    return __r;
}

// move construct [__f, __l) to [__r, __r + (__l-__f)).
// If __vt points into [__f, __l), then add (__r - __f) to __vt.
template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__move_construct_and_check(iterator __f, iterator __l,
                                                   iterator __r, const_pointer& __vt)
{
    allocator_type& __a = __base::__alloc();
    // as if
    //   for (; __f != __l; ++__r, ++__f, ++__base::size())
    //       __alloc_traits::construct(__a, _VSTD::addressof(*__r), _VSTD::move(*__f));
    difference_type __n = __l - __f;
    while (__n > 0)
    {
        pointer __fb = __f.__ptr_;
        pointer __fe = *__f.__m_iter_ + __base::__block_size;
        difference_type __bs = __fe - __fb;
        if (__bs > __n)
        {
            __bs = __n;
            __fe = __fb + __bs;
        }
        if (__fb <= __vt && __vt < __fe)
            __vt = (const_iterator(static_cast<__map_const_pointer>(__f.__m_iter_), __vt) += __r - __f).__ptr_;
        for (; __fb != __fe; ++__fb, ++__r, ++__base::size())
            __alloc_traits::construct(__a, _VSTD::addressof(*__r), _VSTD::move(*__fb));
        __n -= __bs;
        __f += __bs;
    }
}

// move construct [__f, __l) to [__r - (__l-__f), __r) backwards.
// If __vt points into [__f, __l), then subtract (__l - __r) from __vt.
template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__move_construct_backward_and_check(iterator __f, iterator __l,
                                                            iterator __r, const_pointer& __vt)
{
    allocator_type& __a = __base::__alloc();
    // as if
    //   for (iterator __j = __l; __j != __f;)
    //   {
    //       __alloc_traitsconstruct(__a, _VSTD::addressof(*--__r), _VSTD::move(*--__j));
    //       --__base::__start_;
    //       ++__base::size();
    //   }
    difference_type __n = __l - __f;
    while (__n > 0)
    {
        --__l;
        pointer __lb = *__l.__m_iter_;
        pointer __le = __l.__ptr_ + 1;
        difference_type __bs = __le - __lb;
        if (__bs > __n)
        {
            __bs = __n;
            __lb = __le - __bs;
        }
        if (__lb <= __vt && __vt < __le)
            __vt = (const_iterator(static_cast<__map_const_pointer>(__l.__m_iter_), __vt) -= __l - __r + 1).__ptr_;
        while (__le != __lb)
        {
            __alloc_traits::construct(__a, _VSTD::addressof(*--__r), _VSTD::move(*--__le));
            --__base::__start_;
            ++__base::size();
        }
        __n -= __bs;
        __l -= __bs - 1;
    }
}

template <class _Tp, class _Allocator>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::erase(const_iterator __f)
{
    difference_type __n = 1;
    iterator __b = __base::begin();
    difference_type __pos = __f - __b;
    iterator __p = __b + __pos;
    allocator_type& __a = __base::__alloc();
    if (__pos < (__base::size() - 1) / 2)
    {   // erase from front
        _VSTD::move_backward(__b, __p, _VSTD::next(__p));
        {
            __alloc_traits::deallocate(__a, __base::__map_.back(), __base::__block_size);
            __base::__map_.pop_back();
        }
    }
    return __base::begin() + __pos;
}

template <class _Tp, class _Allocator>
typename deque<_Tp, _Allocator>::iterator
deque<_Tp, _Allocator>::erase(const_iterator __f, const_iterator __l)
{
    difference_type __n = __l - __f;
    iterator __b = __base::begin();
    difference_type __pos = __f - __b;
    iterator __p = __b + __pos;
    if (__n > 0)
    {
        allocator_type& __a = __base::__alloc();
        if (__pos < (__base::size() - __n) / 2)
        {   // erase from front
            iterator __i = _VSTD::move_backward(__b, __p, __p + __n);
            for (; __b != __i; ++__b)
                __alloc_traits::destroy(__a, _VSTD::addressof(*__b));
            __base::size() -= __n;
            __base::__start_ += __n;
            while (__front_spare() >= 2 * __base::__block_size)
            {
                __alloc_traits::deallocate(__a, __base::__map_.front(), __base::__block_size);
                __base::__map_.pop_front();
                __base::__start_ -= __base::__block_size;
            }
        }
        else
        {   // erase from back
            iterator __i = _VSTD::move(__p + __n, __base::end(), __p);
            for (iterator __e = __base::end(); __i != __e; ++__i)
                __alloc_traits::destroy(__a, _VSTD::addressof(*__i));
            __base::size() -= __n;
            while (__back_spare() >= 2 * __base::__block_size)
            {
                __alloc_traits::deallocate(__a, __base::__map_.back(), __base::__block_size);
                __base::__map_.pop_back();
            }
        }
    }
    return __base::begin() + __pos;
}

template <class _Tp, class _Allocator>
void
deque<_Tp, _Allocator>::__erase_to_end(const_iterator __f)
{
    iterator __e = __base::end();
    difference_type __n = __e - __f;
    if (__n > 0)
    {
        allocator_type& __a = __base::__alloc();
        iterator __b = __base::begin();
        difference_type __pos = __f - __b;
        for (iterator __p = __b + __pos; __p != __e; ++__p)
            __alloc_traits::destroy(__a, _VSTD::addressof(*__p));
        __base::size() -= __n;
        while (__back_spare() >= 2 * __base::__block_size)
        {
            __alloc_traits::deallocate(__a, __base::__map_.back(), __base::__block_size);
            __base::__map_.pop_back();
        }
    }
}

template <class _Tp, class _Allocator>
inline _LIBCPP_INLINE_VISIBILITY
void
deque<_Tp, _Allocator>::swap(deque& __c)
        _NOEXCEPT_(!__alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<allocator_type>::value)
{
    __base::swap(__c);
}







_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_DEQUE
# 2874 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque" 3
# 170 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 2 3
#if 0 /* expanded by -frewrite-includes */
#include <vector>
#endif /* expanded by -frewrite-includes */
# 171 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Tp, class _Container> class _LIBCPP_TYPE_VIS_ONLY queue;

template <class _Tp, class _Container>
_LIBCPP_INLINE_VISIBILITY
bool
operator==(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);

template <class _Tp, class _Container>
_LIBCPP_INLINE_VISIBILITY
bool
operator< (const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y);

template <class _Tp, class _Container = deque<_Tp> >
class _LIBCPP_TYPE_VIS_ONLY queue
{
public:
    typedef _Container                               container_type;
    typedef typename container_type::value_type      value_type;
    typedef typename container_type::reference       reference;
    typedef typename container_type::const_reference const_reference;
    typedef typename container_type::size_type       size_type;

protected:
    container_type c;

public:
    _LIBCPP_INLINE_VISIBILITY
    queue()
        _NOEXCEPT_(is_nothrow_default_constructible<container_type>::value)
        : c() {}

    _LIBCPP_INLINE_VISIBILITY
    queue(const queue& __q) : c(__q.c) {}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    queue(queue&& __q)
        _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
        : c(_VSTD::move(__q.c)) {}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 220 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3

    _LIBCPP_INLINE_VISIBILITY
    queue& operator=(const queue& __q) {c = __q.c; return *this;}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    queue& operator=(queue&& __q)
        _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
        {c = _VSTD::move(__q.c); return *this;}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 230 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3

    _LIBCPP_INLINE_VISIBILITY
    explicit queue(const container_type& __c)  : c(__c) {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 237 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3
    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        explicit queue(const _Alloc& __a,
                       typename enable_if<uses_allocator<container_type,
                                                         _Alloc>::value>::type* = 0)
            : c(__a) {}
    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        queue(const queue& __q, const _Alloc& __a,
                       typename enable_if<uses_allocator<container_type,
                                                         _Alloc>::value>::type* = 0)
            : c(__q.c, __a) {}
    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        queue(const container_type& __c, const _Alloc& __a,
                       typename enable_if<uses_allocator<container_type,
                                                         _Alloc>::value>::type* = 0)
            : c(__c, __a) {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        queue(container_type&& __c, const _Alloc& __a,
                       typename enable_if<uses_allocator<container_type,
                                                         _Alloc>::value>::type* = 0)
            : c(_VSTD::move(__c), __a) {}
    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        queue(queue&& __q, const _Alloc& __a,
                       typename enable_if<uses_allocator<container_type,
                                                         _Alloc>::value>::type* = 0)
            : c(_VSTD::move(__q.c), __a) {}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES

    _LIBCPP_INLINE_VISIBILITY
    void swap(queue& __q)
        _NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
    {
        using _VSTD::swap;
        swap(c, __q.c);
    }

    ;

    ;
};


template <class _Tp, class _Container = vector<_Tp>,
          class _Compare = less<typename _Container::value_type> >
class _LIBCPP_TYPE_VIS_ONLY priority_queue
{
public:
    typedef _Container                               container_type;
    typedef _Compare                                 value_compare;
    typedef typename container_type::value_type      value_type;
    typedef typename container_type::reference       reference;
    typedef typename container_type::const_reference const_reference;
    typedef typename container_type::size_type       size_type;

protected:
    container_type c;
    value_compare comp;

public:
    explicit priority_queue(const value_compare& __comp)
        : c(), comp(__comp) {}
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    explicit priority_queue(const value_compare& __comp, container_type&& __c);
#endif
# 437 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3
    ;
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template <class _InputIter>
        priority_queue(_InputIter __f, _InputIter __l,
                       const value_compare& __comp, container_type&& __c);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 448 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3
    ;
    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template <class _Alloc>
        priority_queue(const value_compare& __comp, container_type&& __c,
                       const _Alloc& __a,
                       typename enable_if<uses_allocator<container_type,
                                                         _Alloc>::value>::type* = 0);
    template <class _Alloc>
        priority_queue(priority_queue&& __q, const _Alloc& __a,
                       typename enable_if<uses_allocator<container_type,
                                                         _Alloc>::value>::type* = 0);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 476 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3

    _LIBCPP_INLINE_VISIBILITY
    bool            empty() const {return c.empty();}
    _LIBCPP_INLINE_VISIBILITY
    size_type       size() const  {return c.size();}
    _LIBCPP_INLINE_VISIBILITY
    const_reference top() const   {return c.front();}

    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    void push(value_type&& __v);
#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class... _Args> void emplace(_Args&&... __args);
#endif
# 490 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 491 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3
    void pop();

    void swap(priority_queue& __q)
        _NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
                   __is_nothrow_swappable<value_compare>::value);
};



#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Container, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
                                                          container_type&& __c)
    : c(_VSTD::move(__c)),
      comp(__comp)
{
    _VSTD::make_heap(c.begin(), c.end(), comp);
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 521 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3





#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Container, class _Compare>
template <class _InputIter>
inline _LIBCPP_INLINE_VISIBILITY
priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l,
                                                          const value_compare& __comp,
                                                          container_type&& __c)
    : c(_VSTD::move(__c)),
      comp(__comp)
{
    c.insert(c.end(), __f, __l);
    _VSTD::make_heap(c.begin(), c.end(), comp);
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 562 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3









#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Container, class _Compare>
template <class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp,
                                                          container_type&& __c,
                                                          const _Alloc& __a,
                       typename enable_if<uses_allocator<container_type,
                                                         _Alloc>::value>::type*)
    : c(_VSTD::move(__c), __a),
      comp(__comp)
{
    _VSTD::make_heap(c.begin(), c.end(), comp);
}

template <class _Tp, class _Container, class _Compare>
template <class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q,
                                                          const _Alloc& __a,
                       typename enable_if<uses_allocator<container_type,
                                                         _Alloc>::value>::type*)
    : c(_VSTD::move(__q.c), __a),
      comp(_VSTD::move(__q.comp))
{
    _VSTD::push_heap(c.begin(), c.end(), comp);
}

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Container, class _Compare>
template <class... _Args>
inline _LIBCPP_INLINE_VISIBILITY
void
priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args)
{
    c.emplace_back(_VSTD::forward<_Args>(__args)...);
    _VSTD::push_heap(c.begin(), c.end(), comp);
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 676 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 677 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3

template <class _Tp, class _Container, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
void
priority_queue<_Tp, _Container, _Compare>::pop()
{
    _VSTD::pop_heap(c.begin(), c.end(), comp);
    c.pop_back();
}

template <class _Tp, class _Container, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
void
priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q)
        _NOEXCEPT_(__is_nothrow_swappable<container_type>::value &&
                   __is_nothrow_swappable<value_compare>::value)
{
    using _VSTD::swap;
    swap(c, __q.c);
    swap(comp, __q.comp);
}

template <class _Tp, class _Container, class _Compare>
inline _LIBCPP_INLINE_VISIBILITY
void
swap(priority_queue<_Tp, _Container, _Compare>& __x,
     priority_queue<_Tp, _Container, _Compare>& __y)
    _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y)))
{
    __x.swap(__y);
}

template <class _Tp, class _Container, class _Compare, class _Alloc>
struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<priority_queue<_Tp, _Container, _Compare>, _Alloc>
    : public uses_allocator<_Container, _Alloc>
{
};

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_QUEUE
# 718 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue" 3
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_channel.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/ipc_message.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_channel.h"

namespace IPC {

//------------------------------------------------------------------------------

class Channel : public Message::Sender {
  // Security tests need access to the pipe handle.
  friend class ChannelTest;

 public:
  // Implemented by consumers of a Channel to receive messages.
  class Listener {
   public:
    virtual ~Listener() {}

    // Called when a message is received.
    virtual void OnMessageReceived(const Message& message) = 0;

    // Called when the channel is connected and we have received the internal
    // Hello message from the peer.
    virtual void OnChannelConnected(int32_t peer_pid) {}

    // Called when an error is detected that causes the channel to close.
    // This method is not called when a channel is closed normally.
    virtual void OnChannelError() {}

    // If the listener has queued messages, swap them for |queue| like so
    //   swap(impl->my_queued_messages, queue);
    virtual void GetQueuedMessages(std::queue<Message>& queue) {}
  };
  virtual bool Send(Message* message) MOZ_OVERRIDE;

  // Unsound_IsClosed() and Unsound_NumQueuedMessages() are safe to call from
  // any thread, but the value returned may be out of date, because we don't
  // use any synchronization when reading or writing it.
  ;
  ;

#if defined(OS_POSIX)
  // On POSIX an IPC::Channel wraps a socketpair(), this method returns the
  // FD # for the client end of the socket and the equivalent FD# to use for
  // mapping it into the Child process.
  // This method may only be called on the server side of a channel.
  //
  // If the kTestingChannelID flag is specified on the command line then
  // a named FIFO is used as the channel transport mechanism rather than a
#endif  // defined(OS_POSIX)
# 133 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_channel.h"

 private:
  // PIMPL to which all channel calls are delegated.
  class ChannelImpl;
  ChannelImpl *channel_impl_;

  enum {
#if defined(OS_MACOSX)
    // If the channel receives a message that contains file descriptors, then
    // it will reply back with this message, indicating that the message has
    // been received. The sending channel can then close any descriptors that
    // had been marked as auto_close. This works around a sendmsg() bug on BSD
    // where the kernel can eagerly close file descriptors that are in message
    // queues but not yet delivered.
    RECEIVED_FDS_MESSAGE_TYPE = kuint16max - 1,
#endif
# 149 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/ipc_channel.h"

    // The Hello message is internal to the Channel class.  It is sent
    // by the peer when the channel is connected.  The message contains
    // just the process id (pid).  The message has a special routing_id
    // (MSG_ROUTING_NONE) and type (HELLO_MESSAGE_TYPE).
    HELLO_MESSAGE_TYPE = kuint16max  // Maximum value of message type (uint16_t),
                                     // to avoid conflicting with normal
                                     // message types, which are enumeration
                                     // constants starting from 0.
  };
};

}  // namespace IPC

#ifndef mozilla_ipc_Transport_posix_h
#define mozilla_ipc_Transport_posix_h 1

#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/ipc/Transport_posix.h"


namespace mozilla {
namespace ipc {

struct TransportDescriptor
{
  base::FileDescriptor mFd;
};

} // namespace ipc
} // namespace mozilla


namespace IPC {

template<>
struct ParamTraits<mozilla::ipc::TransportDescriptor>
{
  typedef mozilla::ipc::TransportDescriptor paramType;
  
  
};

} // namespace IPC


#endif  // mozilla_ipc_Transport_posix_h
# 46 "../../dist/include/mozilla/ipc/Transport_posix.h"
# 16 "../../dist/include/mozilla/ipc/Transport.h" 2
#elif OS_WIN
# 17 "../../dist/include/mozilla/ipc/Transport.h"
#if 0 /* expanded by -frewrite-includes */
# include "mozilla/ipc/Transport_win.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/ipc/Transport.h"
#endif
# 19 "../../dist/include/mozilla/ipc/Transport.h"

namespace mozilla {
namespace ipc {

class FileDescriptor;

typedef IPC::Channel Transport;

;

;

;

;

} // namespace ipc
} // namespace mozilla
#define ipc_glue_MessageLink_h 1

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/ipc/MessageLink.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/message_loop.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_MESSAGE_LOOP_H_
#define BASE_MESSAGE_LOOP_H_
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h"
#if 0 /* expanded by -frewrite-includes */
#include <map>
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/lock.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock.h" 1
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_LOCK_H_
#define BASE_LOCK_H_

#if 0 /* expanded by -frewrite-includes */
#include "base/lock_impl.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_LOCK_IMPL_H_
#define BASE_LOCK_IMPL_H_

#if 0 /* expanded by -frewrite-includes */
#include "build/build_config.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h"

#if defined(OS_WIN)
#if 0 /* expanded by -frewrite-includes */
#include <windows.h>
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h"
#elif defined(OS_POSIX)
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h"
#if 0 /* expanded by -frewrite-includes */
#include <pthread.h>
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h"
#if defined(OS_WIN)
#if 0 /* expanded by -frewrite-includes */
#include <windows.h>
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"
typedef DWORD PlatformThreadId;
typedef void* PlatformThreadHandle;  // HANDLE
#elif defined(OS_POSIX)
# 23 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"
#if 0 /* expanded by -frewrite-includes */
#include <pthread.h>
#endif /* expanded by -frewrite-includes */
# 24 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"
typedef pthread_t PlatformThreadHandle;
#if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(__GLIBC__)
#if 0 /* expanded by -frewrite-includes */
#include <unistd.h>
#endif /* expanded by -frewrite-includes */
# 27 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"
typedef pid_t PlatformThreadId;
#elif defined(OS_BSD)
# 29 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 30 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"
typedef lwpid_t PlatformThreadId;
#elif defined(OS_MACOSX)
# 32 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"
#if 0 /* expanded by -frewrite-includes */
#include <mach/mach.h>
#endif /* expanded by -frewrite-includes */
# 33 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"
typedef mach_port_t PlatformThreadId;
#endif
# 35 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"
#endif
# 36 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"

// A namespace for low-level thread functions.
class PlatformThread {
 public:
  // Gets the current thread id, which may be useful for logging purposes.
  ;

  // Yield the current thread so another thread can be scheduled.
  ;

  // Sleeps for the specified duration (units are milliseconds).
  ;

  // Sets the thread name visible to a debugger.  This has no effect otherwise.
};

#endif  // BASE_PLATFORM_THREAD_H_
# 86 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/platform_thread.h"
# 18 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h" 2

// This class implements the underlying platform-specific spin-lock mechanism
// used for the Lock class.  Most users should not use LockImpl directly, but
// should instead use Lock.
class LockImpl {
 public:
#if defined(OS_WIN)
  typedef CRITICAL_SECTION OSLockType;
#elif defined(OS_POSIX)
# 27 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h"
  typedef pthread_mutex_t OSLockType;
#endif
# 29 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h"

  ;
  ~LockImpl();

  // If the lock is not held, take it and return true.  If the lock is already
  // held by something else, immediately return false.
  ;

  // Take the lock, blocking until it is available if necessary.
  void Lock();

  // Release the lock.  This must only be called by the lock's holder: after
  // a successful call to Try, or a call to Lock.
  void Unlock();

  // Debug-only method that will DCHECK() if the lock is not acquired by the
  // current thread.  In non-debug builds, no check is performed.
  // Because linux and mac condition variables modify the underlyning lock
  // through the os_lock() method, runtime assertions can not be done on those
  // builds.
#if defined(NDEBUG) || !defined(OS_WIN)
  void AssertAcquired() const {}
#else
# 52 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h"
  void AssertAcquired() const;
#endif
# 54 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h"

  // Return the native underlying lock.  Not supported for Windows builds.
  // TODO(awalker): refactor lock and condition variables so that this is
# 72 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h"

  DISALLOW_COPY_AND_ASSIGN(LockImpl);
};


#endif  // BASE_LOCK_IMPL_H_
# 78 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock_impl.h"
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock.h" 2

// A convenient wrapper for an OS specific critical section.

class Lock {
 public:
  
  ~Lock() {}
  void Acquire() { lock_.Lock(); }
  void Release() { lock_.Unlock(); }
  // If the lock is not held, take it and return true. If the lock is already
  // held by another thread, immediately return false.
  

  // In debug builds this method checks that the lock has been acquired by the
  // calling thread.  If the lock has not been acquired, then the method
  // will DCHECK().  In non-debug builds, the LockImpl's implementation of
  // AssertAcquired() is an empty inline method.
  void AssertAcquired() const { return lock_.AssertAcquired(); }

  // Return the underlying lock implementation.
  // TODO(awalker): refactor lock and condition variables so that this is
  // unnecessary.
  

 private:
  LockImpl lock_;  // Platform specific underlying lock implementation.

  DISALLOW_COPY_AND_ASSIGN(Lock);
};

// A helper class that acquires the given Lock while the AutoLock is in scope.
class AutoLock {
 public:
  

  

 private:
  Lock& lock_;
};

#endif  // BASE_LOCK_H_
# 76 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/lock.h"
# 15 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/message_pump.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_pump.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_MESSAGE_PUMP_H_
#define BASE_MESSAGE_PUMP_H_

#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_pump.h"

namespace base {

class TimeTicks;

class MessagePump {
 public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MessagePump)

  // Please see the comments above the Run method for an illustration of how
  // these delegate methods are used.
  class Delegate {
    virtual bool DoDelayedWork(TimeTicks* next_delayed_work_time) = 0;

    // Called from within Run just before the message pump goes to sleep.
    // Returns true to indicate that idle work was done.
    virtual bool DoIdleWork() = 0;
  };

  // The Run method is called to enter the message pump's run loop.
  //
  // Within the method, the message pump is responsible for processing native
  // messages as well as for giving cycles to the delegate periodically.  The
  // message pump should take care to mix delegate callbacks with native
  // message processing so neither type of event starves the other of cycles.
  //
  // The anatomy of a typical run loop:
  //
  // it returns false (meaning it has run out of things to do).
  //
  virtual void Run(Delegate* delegate) = 0;

  // Quit immediately from the most recently entered run loop.  This method may
  // only be used on the thread that called Run.
  virtual void Quit() = 0;

  // Schedule a DoWork callback to happen reasonably soon.  Does nothing if a
  // DoWork callback is already scheduled.  This method may be called from any
  // thread.  Once this call is made, DoWork should not be "starved" at least
  // until it returns a value of false.
  virtual void ScheduleWork() = 0;

  // This method may only called from the thread that called Run.
  //
  // Ensure that DoWork will be called if a nested loop is entered.
  // If a MessagePump can already guarantee that DoWork will be called
  // "reasonably soon", this method can be a no-op to avoid expensive
  // atomic tests and/or syscalls required for ScheduleWork().
  virtual void ScheduleWorkForNestedLoop() { ScheduleWork(); };

  // Schedule a DoDelayedWork callback to happen at the specified time,
  // cancelling any pending DoDelayedWork callback.  This method may only be
  // used on the thread that called Run.
  virtual void ScheduleDelayedWork(const TimeTicks& delayed_work_time) = 0;

protected:
  virtual ~MessagePump() {};
};

}  // namespace base

#endif  // BASE_MESSAGE_PUMP_H_
# 134 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_pump.h"
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/observer_list.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/observer_list.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_OBSERVER_LIST_H__
#define BASE_OBSERVER_LIST_H__

#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/observer_list.h"
#if 0 /* expanded by -frewrite-includes */
#include <limits>
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/observer_list.h"
#if 0 /* expanded by -frewrite-includes */
#include <vector>
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/observer_list.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/observer_list.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/logging.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/observer_list.h"

#if defined(ANDROID) && defined(_STLP_STD_NAME)
using _STLP_STD_NAME::find;
#endif
# 18 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/observer_list.h"

namespace base {

///////////////////////////////////////////////////////////////////////////////
//
// OVERVIEW:
//
//     }
//
//    private:
//     ObserverList<Observer> observer_list_;
//   };
//
//
///////////////////////////////////////////////////////////////////////////////

template <class ObserverType, bool check_empty = false>
class ObserverList {
 public:
  // Enumeration of which observers are notified.
  enum NotificationType {
    // Specifies that any observers added during notification are notified.
    // This is the default type if non type is provided to the constructor.
    NOTIFY_ALL,

    // Specifies that observers added while sending out notification are not
    // notified.
    NOTIFY_EXISTING_ONLY
  };

  ObserverList() : notify_depth_(0), type_(NOTIFY_ALL) {}
  
  

  // Add an observer to the list.
  

  // Remove an observer from the list.
  

  

  

  // An iterator class that can be used to access the list of observers.  See
  // also the FOREACH_OBSERVER macro defined below.
  class Iterator {
   public:
    

    

    

   private:
    const ObserverList<ObserverType>& list_;
    size_t index_;
    size_t max_index_;
  };

 private:
  typedef std::vector<ObserverType*> ListType;

  

  // These are marked mutable to facilitate having NotifyAll be const.
  mutable ListType observers_;
  mutable int notify_depth_;
  NotificationType type_;

  friend class ObserverList::Iterator;

  DISALLOW_EVIL_CONSTRUCTORS(ObserverList);
};

} // namespace base

#define FOR_EACH_OBSERVER(ObserverType, observer_list, func)		\
  do {									\
    base::ObserverList<ObserverType>::Iterator it(observer_list);	\
    ObserverType* obs;							\
    while ((obs = it.GetNext()) != NULL)				\
      obs->func;							\
  } while (0)

#endif  // BASE_OBSERVER_LIST_H__
# 185 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/observer_list.h"
# 17 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/task.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/task.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_TASK_H_
#define BASE_TASK_H_

#if 0 /* expanded by -frewrite-includes */
// In Release mode, CalledOnValidThread will always return true.
//
#ifndef NDEBUG
  ~NonThreadSafe() {}

  bool CalledOnValidThread() const {
    return true;
  }
};
#endif  // NDEBUG
# 51 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/non_thread_safe.h"

#endif  // BASE_NON_THREAD_SAFE_H__
# 53 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/non_thread_safe.h"
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/task.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/revocable_store.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/revocable_store.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_REVOCABLE_STORE_H_
#define BASE_REVOCABLE_STORE_H_

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/revocable_store.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/revocable_store.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/revocable_store.h"

// |RevocableStore| is a container of items that can be removed from the store.
class RevocableStore {
 public:
  // A |StoreRef| is used to link the |RevocableStore| to its items.  There is
  // one StoreRef per store, and each item holds a reference to it.  If the
  // store wishes to revoke its items, it sets |store_| to null.  Items are
  // permitted to release their reference to the |StoreRef| when they no longer
  // require the store.
  class StoreRef MOZ_FINAL {
   public:
    NS_INLINE_DECL_THREADSAFE_REFCOUNTING(StoreRef)
    

    
    

   protected:
    ~StoreRef() {}
   private:
    RevocableStore* store_;

    DISALLOW_EVIL_CONSTRUCTORS(StoreRef);
  };

  // An item in the store.  On construction, the object adds itself to the
  // store.
  class Revocable {
   public:
    ;
    ;

    // This item has been revoked if it no longer has a pointer to the store.
    

  private:
    // We hold a reference to the store through this ref pointer.  We release
    // this reference on destruction.
    nsRefPtr<StoreRef> store_reference_;

    DISALLOW_EVIL_CONSTRUCTORS(Revocable);
  };

  ;
  ;

  // The number of unrevoked items in the store.
  int count_;

  DISALLOW_EVIL_CONSTRUCTORS(RevocableStore);
};

#endif  // BASE_REVOCABLE_STORE_H_
# 80 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/revocable_store.h"
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/task.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/tracked.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/tracked.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

//------------------------------------------------------------------------------
// Tracked is the base class for all tracked objects.  During construction, it
// registers the fact that an instance was created, and at destruction time, it
// records that event.  The instance may be tagged with a name, which is refered
// to as its Location.  The Location is a file and line number, most
// typically indicated where the object was constructed.  In some cases, as the
// object's significance is refined (for example, a Task object is augmented to
// do additonal things), its Location may be redefined to that later location.

// Tracking includes (for each instance) recording the birth thread, death
// thread, and duration of life (from construction to destruction).  All this
// data is accumulated and filtered for review at about:objects.

#ifndef BASE_TRACKED_H_
#define BASE_TRACKED_H_

#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/tracked.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/time.h"
#endif /* expanded by -frewrite-includes */
# 24 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/tracked.h"

#ifndef NDEBUG
#ifndef TRACK_ALL_TASK_OBJECTS
#define TRACK_ALL_TASK_OBJECTS
#endif   // TRACK_ALL_TASK_OBJECTS
# 29 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/tracked.h"
#endif  // NDEBUG
# 30 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/tracked.h"

namespace tracked_objects {

//------------------------------------------------------------------------------
// Location provides basic info where of an object was constructed, or was
// significantly brought to life.

class Location {
 public:
  // Constructor should be called with a long-lived char*, such as __FILE__.
  // It assumes the provided value will persist as a global constant, and it
  // will not make a copy of it.
  
  ;

  // Write function_name_ in HTML with '<' and '>' properly encoded.
  ;

 private:
  const char* const function_name_;
  const char* const file_name_;
  const int line_number_;
};


//------------------------------------------------------------------------------
// Define a macro to record the current source location.

#define FROM_HERE tracked_objects::Location(__FUNCTION__, __FILE__, __LINE__)


//------------------------------------------------------------------------------


class Births;

class Tracked {
 public:
  Tracked();
  virtual ~Tracked();

  // Used to record the FROM_HERE location of a caller.
  ;

  // When a task sits around a long time, such as in a timer, or object watcher,
  // this method should be called when the task becomes active, and its
  // significant lifetime begins (and its waiting to be woken up has passed).
  ;

  ;

 private:
#ifdef TRACK_ALL_TASK_OBJECTS

  // Pointer to instance were counts of objects with the same birth location
  // (on the same thread) are stored.
  Births* tracked_births_;
  // The time this object was constructed.  If its life consisted of a long
  // waiting period, and then it became active, then this value is generally
  // reset before the object begins it active life.
  base::Time tracked_birth_time_;

#endif  // TRACK_ALL_TASK_OBJECTS
# 122 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/tracked.h"

  DISALLOW_COPY_AND_ASSIGN(Tracked);
};

}  // namespace tracked_objects

#endif  // BASE_TRACKED_H_
# 129 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/tracked.h"
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/task.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/tuple.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/task.h"

// Task ------------------------------------------------------------------------
//
// A task is a generic runnable thingy, usually used for running code on a
// different thread or for scheduling future tasks off of the message loop.

class Task : public tracked_objects::Tracked {
 public:
  Task() {}
  virtual ~Task() {}

  // Tasks are automatically deleted after Run is called.
  ;
};

class CancelableTask : public Task {
 public:
  // Not all tasks support cancellation.
  ;
};
//   void Object::DoStuff(int, string);
//   Callback2<int, string>::Type* callback =
//       NewCallback(obj, &Object::DoStuff);
//   callback->Run(5, string("hello"));
//   delete callback;
// or, equivalently, using tuples directly:
//   CallbackRunner<Tuple2<int, string> >* callback =
//       NewCallback(obj, &Object::DoStuff);
//   callback->RunWithParams(MakeTuple(5, string("hello")));

// Base for all Callbacks that handles storage of the pointers.
template <class T, typename Method>
class CallbackStorage {
 public:
  

 protected:
  T* MOZ_UNSAFE_REF("The validity of this pointer must be enforced by "
                    "external factors.") obj_;
  Method meth_;
};

// Interface that is exposed to the consumer, that does the actual calling
// of the method.
template <typename Params>
class CallbackRunner {
 public:
  typedef Params TupleType;
};

template <class T, typename Method, typename Params>
class CallbackImpl : public CallbackStorage<T, Method>,
                     public CallbackRunner<Params> {
 public:
  
  
};

// 0-arg implementation
struct Callback0 {
  typedef CallbackRunner<Tuple0> Type;
};



// 1-arg implementation
// 5-arg implementation
template <typename Arg1, typename Arg2, typename Arg3,
          typename Arg4, typename Arg5>
struct Callback5 {
  typedef CallbackRunner<Tuple5<Arg1, Arg2, Arg3, Arg4, Arg5> > Type;
};



// An UnboundMethod is a wrapper for a method where the actual object is
// provided at Run dispatch time.
template <class T, class Method, class Params>
class UnboundMethod {
 public:
  
  
 private:
  Method m_;
  Params p_;
};

#endif  // BASE_TASK_H_
# 677 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/task.h"
# 18 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/timer.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/timer.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// allows you to easily defer the timer event until the timer delay passes once
// again.  So, in the above example, if 0.5 seconds have already passed,
// calling Reset on timer_ would postpone DoStuff by another 1 second.  In
// other words, Reset is shorthand for calling Stop and then Start again with
// the same arguments.

#ifndef BASE_TIMER_H_
#define BASE_TIMER_H_

// IMPORTANT: If you change timer code, make sure that all tests (including
// disabled ones) from timer_unittests.cc pass locally. Some are disabled
// because they're flaky on the buildbot, but when you run them locally you
// should be able to tell the difference.

#if 0 /* expanded by -frewrite-includes */
#include "base/logging.h"
#endif /* expanded by -frewrite-includes */
# 50 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/timer.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/task.h"
#endif /* expanded by -frewrite-includes */
# 51 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/timer.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/time.h"
#endif /* expanded by -frewrite-includes */
# 52 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/timer.h"

class MessageLoop;

namespace base {

//-----------------------------------------------------------------------------
// This class is an implementation detail of OneShotTimer and RepeatingTimer.
// Please do not use this class directly.
//
// This class exists to share code between BaseTimer<T> template instantiations.
//
class BaseTimer_Helper {
 public:
  // Stops the timer.
  

  // Returns true if the timer is running (i.e., not stopped).
  bool IsRunning() const {
    return delayed_task_ != NULL;
  }

  // Returns the current delay for this timer.  May only call this method when
  // the timer is running!
  

 protected:
  BaseTimer_Helper() : delayed_task_(NULL) {}

  // We have access to the timer_ member so we can orphan this task.
  class TimerTask : public Task {
   public:
    explicit TimerTask(TimeDelta delay) : delay_(delay) {
      // timer_ is set in InitiateDelayedTask.
    }
    virtual ~TimerTask() {}
    BaseTimer_Helper* timer_;
    TimeDelta delay_;
  };

  // Used to orphan delayed_task_ so that when it runs it does nothing.
  ;

  // Used to initiated a new delayed task.  This has the side-effect of
  // orphaning delayed_task_ if it is non-null.
  void InitiateDelayedTask(TimerTask* timer_task);

  TimerTask* delayed_task_;

  DISALLOW_COPY_AND_ASSIGN(BaseTimer_Helper);
};

//-----------------------------------------------------------------------------
// This class is an implementation detail of OneShotTimer and RepeatingTimer.
// Please do not use this class directly.
template <class Receiver, bool kIsRepeating>
class BaseTimer : public BaseTimer_Helper {
 public:
  typedef void (Receiver::*ReceiverMethod)();

  // Call this method to start the timer.  It is an error to call this method
  // while the timer is already running.
  

  // Call this method to stop the timer.  It is a no-op if the timer is not
  // running.
  

  // Call this method to reset the timer delay of an already running timer.
  

 private:
  typedef BaseTimer<Receiver, kIsRepeating> SelfType;

  class TimerTask : public BaseTimer_Helper::TimerTask {
   public:
    

    

    

    

   private:
    // Inform the Base that the timer is no longer active.
    

    // Inform the Base that we're resetting the timer.
    

    Receiver* receiver_;
    ReceiverMethod method_;
  };
};

//-----------------------------------------------------------------------------
// A simple, one-shot timer.  See usage notes at the top of the file.
template <class Receiver>
class OneShotTimer : public BaseTimer<Receiver, false> {};

//-----------------------------------------------------------------------------
// A simple, repeating timer.  See usage notes at the top of the file.
template <class Receiver>
class RepeatingTimer : public BaseTimer<Receiver, true> {};

//-----------------------------------------------------------------------------
// A Delay timer is like The Button from Lost. Once started, you have to keep
// calling Reset otherwise it will call the given method in the MessageLoop
// thread.
//
// Once created, it is inactive until Reset is called. Once |delay| seconds have
// passed since the last call to Reset, the callback is made. Once the callback
// has been made, it's inactive until Reset is called again.
//
// If destroyed, the timeout is canceled and will not occur even if already
// inflight.
template <class Receiver>
class DelayTimer {
 public:
  typedef void (Receiver::*ReceiverMethod)();

  

  

 private:
  void DelayFor(TimeDelta delay) {
    trigger_time_ = Time::Now() + delay;

    // If we already have a timer that will expire at or before the given delay,
    // then we have nothing more to do now.
    if (timer_.IsRunning() && timer_.GetCurrentDelay() <= delay)
      return;

    (receiver_->*method_)();
  }

  Receiver *const receiver_;
  const ReceiverMethod method_;
  const TimeDelta delay_;

  OneShotTimer<DelayTimer<Receiver> > timer_;
  Time trigger_time_;
};

}  // namespace base

#endif  // BASE_TIMER_H_
# 272 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/timer.h"
# 19 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h" 2

#if defined(OS_WIN)
// We need this to declare base::MessagePumpWin::Dispatcher, which we should
// really just eliminate.
#if 0 /* expanded by -frewrite-includes */
#include "base/message_pump_win.h"
#endif /* expanded by -frewrite-includes */
# 24 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h"
#elif defined(OS_POSIX)
# 25 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/message_pump_libevent.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_pump_libevent.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_MESSAGE_PUMP_LIBEVENT_H_
#define BASE_MESSAGE_PUMP_LIBEVENT_H_

#if 0 /* expanded by -frewrite-includes */
#include "base/message_pump.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_pump_libevent.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/time.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_pump_libevent.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_pump_libevent.h"

// Declare structs we need from libevent.h rather than including it
struct event_base;
struct event;

class nsDependentCSubstring;

namespace base {

// Class to monitor sockets and issue callbacks when sockets are ready for I/O
// TODO(dkegel): add support for background file IO somehow
class MessagePumpLibevent : public MessagePump {
 public:

  // Object returned by WatchFileDescriptor to manage further watching.
  class FileDescriptorWatcher {
    public:
     ;
     ;  // Implicitly calls StopWatchingFileDescriptor.

     // NOTE: These methods aren't called StartWatching()/StopWatching() to
     // avoid confusion with the win32 ObjectWatcher class.

     // Stop watching the FD, always safe to call.  No-op if there's nothing
     // to do.
     ;

    private:
     // Called by MessagePumpLibevent, ownership of |e| is transferred to this
     // object.
     ;

     // Used by MessagePumpLibevent to take ownership of event_.
     event *ReleaseEvent();
     friend class MessagePumpLibevent;

    private:
     bool is_persistent_;  // false if this event is one-shot.
     event* event_;
     DISALLOW_COPY_AND_ASSIGN(FileDescriptorWatcher);
  };

  // Used with WatchFileDescptor to asynchronously monitor the I/O readiness of
  // a File Descriptor.
  class Watcher {
   public:
    virtual ~Watcher() {}
    // Called from MessageLoop::Run when an FD can be read from/written to
    // without blocking
    virtual void OnFileCanReadWithoutBlocking(int fd) = 0;
    virtual void OnFileCanWriteWithoutBlocking(int fd) = 0;
  };

  MessagePumpLibevent();

  enum Mode {
    WATCH_READ = 1 << 0,
    WATCH_WRITE = 1 << 1,
    WATCH_READ_WRITE = WATCH_READ | WATCH_WRITE
  };

  // Have the current thread's message loop watch for a a situation in which
  // when this class is out of scope, the signal-event it wraps is
  // removed from libevent's guts.
  //
  // XXX/cjones: this isn't my favorite API, but preserving it in
  // order to match code above
  class SignalEvent {
     friend class MessagePumpLibevent;

  public:
    ;
    ;             // implicitly calls StopCatching()

    // Have libevent forget this event.
    ;

  private:
    ;
    ;

    event* event_;

    DISALLOW_COPY_AND_ASSIGN(SignalEvent);
  };

  class SignalWatcher {
  public:
    
    // Called from MessageLoop::Run when |sig| has been delivered to
    // this process
    ;
  };

  // ... read end; OnWakeup reads it and then breaks Run() out of its sleep
  int wakeup_pipe_out_;
  // ... libevent wrapper for read end
  event* wakeup_event_;

  DISALLOW_COPY_AND_ASSIGN(MessagePumpLibevent);
};

/**
 *  LineWatcher overrides OnFileCanReadWithoutBlocking. It separates the read
 *  data by mTerminator and passes each line to OnLineRead.
 */
class LineWatcher : public MessagePumpLibevent::Watcher
{
public:
  
  int mBufferSize;
  char mTerminator;
};
}  // namespace base

#endif  // BASE_MESSAGE_PUMP_LIBEVENT_H_
# 219 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_pump_libevent.h"
# 26 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h" 2
#endif
# 27 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 29 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h"

namespace mozilla {
namespace ipc {

class DoWorkRunnable;

} /* namespace ipc */
} /* namespace mozilla */

// A MessageLoop is used to process events for a particular thread.  There is
// at most one MessageLoop instance per thread.
//
// Events include at a minimum Task instances submitted to PostTask or those
// managed by TimerManager.  Depending on the type of message pump used by the
// MessageLoop other events such as UI messages may be processed.  On Windows
// APC calls (as time permits) and signals sent to a registered set of HANDLEs
// may also be processed.
//   MessageLoop::current()->SetNestableTasksAllowed(old_state);
//   // Process hr  (the result returned by DoDragDrop().
//
// Please be SURE your task is reentrant (nestable) and all global variables
// are stable and accessible before calling SetNestableTasksAllowed(true).
//
class MessageLoop : public base::MessagePump::Delegate {

  friend class mozilla::ipc::DoWorkRunnable;

public:
  // A DestructionObserver is notified when the current MessageLoop is being
  // destroyed.  These obsevers are notified prior to MessageLoop::current()
  // being changed to return NULL.  This gives interested parties the chance to
  // do final cleanup that depends on the MessageLoop.
  //
  // NOTE: Any tasks posted to the MessageLoop during this notification will
  // not be run.  Instead, they will be deleted.
  //
  class DestructionObserver {
   public:
    
    ;
  };

  // Add a DestructionObserver, which will start receiving notifications
  // immediately.
  ;

  // Remove a DestructionObserver.  It is safe to call this method while a
  // DestructionObserver is receiving a notification callback.
  ;

  // The "PostTask" family of methods call the task's Run method asynchronously
  //
  // NOTE: This method may be called on any thread.  The object will be deleted
  // on the thread that executes MessageLoop::Run().  If this is not the same
  // as the thread that calls PostDelayedTask(FROM_HERE, ), then T MUST inherit
  // from RefCountedThreadSafe<T>!
  
  //   This type of ML is used in Mozilla parent processes which initialize
  //   XPCOM and use the nsThread event loop.
  //
  // TYPE_MOZILLA_NONMAINUITHREAD
  //   This type of ML is used in Mozilla processes which initialize XPCOM
  //   and use TYPE_UI loop logic.
  //
  enum Type {
    TYPE_DEFAULT,
    TYPE_UI,
    TYPE_IO,
    TYPE_MOZILLA_CHILD,
    TYPE_MOZILLA_UI,
    TYPE_MOZILLA_NONMAINTHREAD,
    TYPE_MOZILLA_NONMAINUITHREAD
  };

  // Normally, it is not necessary to instantiate a MessageLoop.  Instead, it
  // is typical to make use of the current thread's MessageLoop instance.
  explicit MessageLoop(Type type = TYPE_DEFAULT);
  ~MessageLoop();

  // Returns the type passed to the constructor.
  Type type() const { return type_; }
  // Set the timeouts for background hang monitoring.
  // A value of 0 indicates there is no timeout.
  
  
  

  //----------------------------------------------------------------------------
 protected:
  struct RunState {
    // Used to count how many Run() invocations are on the stack.
    int run_depth;

    // Used to record that Quit() was called, or that we should quit the pump
    // once it becomes idle.
    bool quit_received;

#if defined(OS_WIN)
    base::MessagePumpWin::Dispatcher* dispatcher;
#endif
# 309 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h"
  };

  class AutoRunState : RunState {
   public:
    ;
    ;
   private:
    MessageLoop* loop_;
    RunState* previous_state_;
  };

  // This structure is copied around by value.
  struct PendingTask {
    Task* task;                        // The task to run.
    base::TimeTicks delayed_run_time;  // The time when the task should be run.
    int sequence_num;                  // Secondary sort key for run time.
    bool nestable;                     // OK to dispatch from a nested loop.

    

    // Used to support sorting.
    ;
  };

  typedef std::queue<PendingTask> TaskQueue;
  typedef std::priority_queue<PendingTask> DelayedTaskQueue;

  virtual bool DoIdleWork() MOZ_OVERRIDE;

  Type type_;
  int32_t id_;

  // A list of tasks that need to be processed by this instance.  Note that
  // this queue is only accessed (push/pop) by our current thread.
  TaskQueue work_queue_;

  // Contains delayed tasks, sorted by their 'delayed_run_time' property.
  DelayedTaskQueue delayed_work_queue_;

  // A queue of non-nestable tasks that we had to defer because when it came
  // time to execute them we were in a nested message loop.  They will execute
  // once we're out of nested message loops.
  TaskQueue deferred_non_nestable_work_queue_;

  uint32_t permanent_hang_timeout_;

  // The next sequence number to use for delayed tasks.
  int next_sequence_num_;

  DISALLOW_COPY_AND_ASSIGN(MessageLoop);
};

//-----------------------------------------------------------------------------
// MessageLoopForUI extends MessageLoop with methods that are particular to a
// MessageLoop instantiated with TYPE_UI.
//
// This class is typically used like so:
//   MessageLoopForUI::current()->...call some method...
//
class MessageLoopForUI : public MessageLoop {
 public:
  

  // Returns the MessageLoopForUI of the current thread.
  

#if defined(OS_WIN)
  typedef base::MessagePumpWin::Dispatcher Dispatcher;
  typedef base::MessagePumpWin::Observer Observer;

  // Please see MessagePumpWin for definitions of these methods.
  void Run(Dispatcher* dispatcher);
  void AddObserver(Observer* observer);
  void RemoveObserver(Observer* observer);
  void WillProcessMessage(const MSG& message);
  void DidProcessMessage(const MSG& message);
  void PumpOutPendingPaintMessages();

 protected:
  // TODO(rvargas): Make this platform independent.
  base::MessagePumpForUI* pump_ui() {
    return static_cast<base::MessagePumpForUI*>(pump_.get());
  }
#endif  // defined(OS_WIN)
# 499 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h"
};

// Do not add any member variables to MessageLoopForUI!  This is important b/c
// MessageLoopForUI is often allocated via MessageLoop(TYPE_UI).  Any extra
// data that you need should be stored on the MessageLoop's pump_ instance.
COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForUI),
               MessageLoopForUI_should_not_have_extra_member_variables);

//-----------------------------------------------------------------------------
// MessageLoopForIO extends MessageLoop with methods that are particular to a
// MessageLoop instantiated with TYPE_IO.
//
// This class is typically used like so:
//   MessageLoopForIO::current()->...call some method...
//
class MessageLoopForIO : public MessageLoop {
 public:
  

  // Returns the MessageLoopForIO of the current thread.
  

#if defined(OS_WIN)

#endif  // defined(OS_POSIX)
# 566 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h"
};

// Do not add any member variables to MessageLoopForIO!  This is important b/c
// MessageLoopForIO is often allocated via MessageLoop(TYPE_IO).  Any extra
// data that you need should be stored on the MessageLoop's pump_ instance.
COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO),
               MessageLoopForIO_should_not_have_extra_member_variables);

#endif  // BASE_MESSAGE_LOOP_H_
# 575 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/message_loop.h"
# 13 "../../dist/include/mozilla/ipc/MessageLink.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/WeakPtr.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/ipc/MessageLink.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/Transport.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/ipc/MessageLink.h"

namespace mozilla {
namespace ipc {

class MessageChannel;

struct HasResultCodes
{
    enum Result {
        MsgProcessed,
        MsgDropped,
        MsgNotKnown,
        MsgNotAllowed,
        MsgPayloadError,
        MsgProcessingError,
        MsgRouteError,
        MsgValueError
    };
};

enum Side {
    ParentSide,
    ChildSide,
    UnknownSide
};

enum ChannelState {
    ChannelClosed,
    ChannelOpening,
    ChannelConnected,
    ChannelTimeout,
    ChannelClosing,
    ChannelError
};

// What happens if Interrupt calls race?
enum RacyInterruptPolicy {
    RIPError,
    RIPChildWins,
    RIPParentWins
};

class MessageListener
  : protected HasResultCodes,
    public mozilla::SupportsWeakPtr<MessageListener>
{
  public:
    MOZ_DECLARE_REFCOUNTED_TYPENAME(MessageListener)
    typedef IPC::Message Message;

    

    virtual void OnChannelClose() = 0;
    virtual void OnChannelError() = 0;
    virtual Result OnMessageReceived(const Message& aMessage) = 0;
    virtual Result OnMessageReceived(const Message& aMessage, Message *& aReply) = 0;
    virtual Result OnCallReceived(const Message& aMessage, Message *& aReply) = 0;
    virtual void OnProcessingError(Result aError, const char* aMsgName) = 0;
    virtual void OnChannelConnected(int32_t peer_pid) {}
    virtual bool OnReplyTimeout() {
        return false;
    }

    virtual void OnEnteredCxxStack() {
        NS_RUNTIMEABORT("default impl shouldn't be invoked");
    }
    virtual void OnExitedCxxStack() {
        NS_RUNTIMEABORT("default impl shouldn't be invoked");
    }
    virtual void OnEnteredCall() {
        NS_RUNTIMEABORT("default impl shouldn't be invoked");
    }
    virtual void OnExitedCall() {
        NS_RUNTIMEABORT("default impl shouldn't be invoked");
    }
    /* This callback is called when a sync message is sent that begins a new IPC transaction
       (i.e., when it is not part of an existing sequence of nested messages). */
    virtual void OnBeginSyncTransaction() {
    }
    virtual RacyInterruptPolicy MediateInterruptRace(const Message& parent,
                                                     const Message& child)
    {
        return RIPChildWins;
    }

    virtual void OnEnteredSyncSend() {
    }
    virtual void OnExitedSyncSend() {
    }

    virtual void ProcessRemoteNativeEventsInInterruptCall() {
    }

    // FIXME/bug 792652: this doesn't really belong here, but a
    // large refactoring is needed to put it where it belongs.
    virtual int32_t GetProtocolTypeId() = 0;
};

class MessageLink
{
  public:
    typedef IPC::Message Message;

    explicit MessageLink(MessageChannel *aChan);
    virtual ~MessageLink();

    // n.b.: These methods all require that the channel monitor is
    // held when they are invoked.
    virtual void EchoMessage(Message *msg) = 0;
    virtual void SendMessage(Message *msg) = 0;
    virtual void SendClose() = 0;

    virtual bool Unsound_IsClosed() const = 0;
    virtual uint32_t Unsound_NumQueuedMessages() const = 0;

  protected:
    MessageChannel *mChan;
};

class ProcessLink
  : public MessageLink,
    public Transport::Listener
{
    void OnCloseChannel();
    void OnChannelOpened();
    ;
    ;

    

  public:
    ;
    ;

    // The ProcessLink will register itself as the IPC::Channel::Listener on the
    // transport passed here. If the transport already has a listener registered
    // then a listener chain will be established (the ProcessLink listener
    // methods will be called first and may call some methods on the original
    // listener as well). Once the channel is closed (either via normal shutdown
    // or a pipe error) the chain will be destroyed and the original listener
    // will again be registered.
    ;

    virtual void EchoMessage(Message *msg) MOZ_OVERRIDE;
    virtual void SendMessage(Message *msg) MOZ_OVERRIDE;
    virtual void SendClose() MOZ_OVERRIDE;

    virtual bool Unsound_IsClosed() const MOZ_OVERRIDE;
    virtual uint32_t Unsound_NumQueuedMessages() const MOZ_OVERRIDE;

  protected:
    MessageChannel* mTargetChan;
};

} // namespace ipc
} // namespace mozilla

#endif  // ifndef ipc_glue_MessageLink_h
# 208 "../../dist/include/mozilla/ipc/MessageLink.h"

# 23 "../../dist/include/mozilla/ipc/ProtocolUtils.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/LinkedList.h"
#endif /* expanded by -frewrite-includes */
# 24 "../../dist/include/mozilla/ipc/ProtocolUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "MainThreadUtils.h"
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/mozilla/ipc/ProtocolUtils.h"

#if defined(ANDROID) && defined(DEBUG)
#if 0 /* expanded by -frewrite-includes */
#include <android/log.h>
#endif /* expanded by -frewrite-includes */
# 28 "../../dist/include/mozilla/ipc/ProtocolUtils.h"
#endif
# 29 "../../dist/include/mozilla/ipc/ProtocolUtils.h"

// WARNING: this takes into account the private, special-message-type
// enum in ipc_channel.h.  They need to be kept in sync.
namespace {
// XXX the max message ID is actually kuint32max now ... when this
// changed, the assumptions of the special message IDs changed in that
// they're not carving out messages from likely-unallocated space, but
// rather carving out messages from the end of space allocated to
// protocol 0.  Oops!  We can get away with this until protocol 0
// starts approaching its 65,536th message.
enum {
    CHANNEL_OPENED_MESSAGE_TYPE = kuint16max - 5,
    SHMEM_DESTROYED_MESSAGE_TYPE = kuint16max - 4,
    SHMEM_CREATED_MESSAGE_TYPE = kuint16max - 3,
    GOODBYE_MESSAGE_TYPE       = kuint16max - 2

    // kuint16max - 1 is used by ipc_channel.h.
};
}

namespace mozilla {
namespace dom {
class ContentParent;
}

namespace net {
class NeckoParent;
}

namespace ipc {

#ifdef XP_WIN
const base::ProcessHandle kInvalidProcessHandle = INVALID_HANDLE_VALUE;
#else
# 63 "../../dist/include/mozilla/ipc/ProtocolUtils.h"
const base::ProcessHandle kInvalidProcessHandle = -1;
#endif
# 65 "../../dist/include/mozilla/ipc/ProtocolUtils.h"

class ProtocolFdMapping;
class ProtocolCloneContext;

// Used to pass references to protocol actors across the wire.
// Actors created on the parent-side have a positive ID, and actors
// allocated on the child side have a negative ID.
struct ActorHandle
{
    int mId;
};

// Used internally to represent a "trigger" that might cause a state
// transition.  Triggers are normalized across parent+child to Send
// and Recv (instead of child-in, child-out, parent-in, parent-out) so
// that they can share the same state machine implementation.  To
// further normalize, |Send| is used for 'call', |Recv| for 'answer'.
struct Trigger
{
    enum Action { Send, Recv };

    

    Action mAction;
    int32_t mMsg;
};

class ProtocolCloneContext
{
  typedef mozilla::dom::ContentParent ContentParent;
  typedef mozilla::net::NeckoParent NeckoParent;

  ContentParent* mContentParent;
  NeckoParent* mNeckoParent;

public:
  

  

  

  

  
};

template<class ListenerT>
class /*NS_INTERFACE_CLASS*/ IProtocolManager
{
public:
    enum ActorDestroyReason {
        FailedConstructor,
        Deletion,
        AncestorDeletion,
        NormalShutdown,
        AbnormalShutdown
    };

    typedef base::ProcessHandle ProcessHandle;

    ;
    ;
    ;
    ;
    ;

    ;
    ;
    ;
    ;
    ;

    // XXX odd ducks, acknowledged
    ;
    ;

    // The implementation of function is generated by code generator.
    ;
};

typedef IPCMessageStart ProtocolId;

/**
 * All RPC protocols should implement this interface.
 */
class IProtocol : protected MessageListener
{
public:
    /**
     * This function is used to clone this protocol actor.
     *
     * see IProtocol::CloneProtocol()
     */
    ;
};

/**
 * All top-level protocols should inherit this class.
 *
 * IToplevelProtocol tracks all top-level protocol actors created from
 * this protocol actor.
 */
class IToplevelProtocol : public LinkedListElement<IToplevelProtocol>
{
protected:
    

    ;

    /**
     * Add an actor to the list of actors that have been opened by this
     * protocol.
     */
#ifdef MOZ_IPDL_TESTS
    static bool sAllowNonMainThreadUse;
#endif
# 257 "../../dist/include/mozilla/ipc/ProtocolUtils.h"
};






MOZ_NEVER_INLINE void
ProtocolErrorBreakpoint(const char* aMsg);

MOZ_NEVER_INLINE void
FatalError(const char* aProtocolName, const char* aMsg,
           base::ProcessHandle aHandle, bool aIsParent);

struct PrivateIPDLInterface {};

;

;

;

} // namespace ipc
} // namespace mozilla


namespace IPC {

template <>
struct ParamTraits<mozilla::ipc::ActorHandle>
{
    typedef mozilla::ipc::ActorHandle paramType;

    

    

    
};

} // namespace IPC


#endif  // mozilla_ipc_ProtocolUtils_h

#ifndef mozilla_RegistryMessageUtils_h
#define mozilla_RegistryMessageUtils_h

#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/chrome/RegistryMessageUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/chrome/RegistryMessageUtils.h"

struct SerializedURI
{
  nsCString spec;
  nsCString charset;

  
};

struct ChromePackage
{
  nsCString package;
  SerializedURI contentBaseURI;
  SerializedURI localeBaseURI;
  SerializedURI skinBaseURI;
  uint32_t flags;

  
};

struct ResourceMapping
{
  nsCString resource;
  SerializedURI resolvedURI;

  
};

struct OverrideMapping
{
  SerializedURI originalURI;
  SerializedURI overrideURI;

  
};

namespace IPC {

template<>
struct ParamTraits<SerializedURI>
{
  typedef SerializedURI paramType;

  

  
  
  
  

  
};

}

#endif // RegistryMessageUtils_h
# 203 "../../dist/include/mozilla/chrome/RegistryMessageUtils.h"
# 21 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ipc/IdType.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/ipc/IdType.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_IdType_h
#define mozilla_dom_IdType_h

#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/ipc/IdType.h"

namespace IPC {
template<typename T> struct ParamTraits;
}

namespace mozilla {
namespace dom {
class ContentParent;
class TabParent;


template<typename T>
class IdType
{

  friend struct IPC::ParamTraits<IdType<T>>;

public:
  
  

  

  

  bool operator<(const IdType& rhs)
  {
    return mId < rhs.mId;
  }
private:
  uint64_t mId;
};

typedef IdType<TabParent> TabId;
typedef IdType<ContentParent> ContentParentId;

} // namespace dom
} // namespace mozilla

namespace IPC {

template<typename T>
struct ParamTraits<mozilla::dom::IdType<T>>
{
  typedef mozilla::dom::IdType<T> paramType;

  

  
};

}

#endif
# 74 "../../dist/include/mozilla/dom/ipc/IdType.h"
# 22 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/DOMTypes.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef DOMTypes_h
#define DOMTypes_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/DOMTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/DOMTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/DOMTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/ProtocolUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/DOMTypes.h"

// Headers for typedefs
#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/DOMTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsID.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/DOMTypes.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union OptionalID|
//
namespace mozilla {
namespace dom {
class OptionalID MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TnsID = 1,
        Tvoid_t,
        T__Last = Tvoid_t
    };

private:
    typedef mozilla::void_t void_t;
    typedef nsID nsID__tdef;
    typedef void_t void_t__tdef;

    union Value {
        char VnsID[sizeof(nsID)];
        char Vvoid_t[sizeof(void_t)];
    };

};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBlobParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBlobChild;
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ClonedMessageData|
//
namespace mozilla {
namespace dom {
class ClonedMessageData MOZ_FINAL
{
private:
    typedef mozilla::SerializedStructuredCloneBuffer SerializedStructuredCloneBuffer;
    typedef mozilla::dom::PBlobParent PBlobParent;
    typedef mozilla::dom::PBlobChild PBlobChild;

public:
    MOZ_IMPLICIT ;

    
    

private:
    ;

    ;

    SerializedStructuredCloneBuffer data_;
    nsTArray<PBlobParent*> blobsParent_;
    nsTArray<PBlobChild*> blobsChild_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union BlobData|
//
namespace mozilla {
namespace dom {
class BlobData MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TnsID = 1,
        TArrayOfuint8_t,
        Tintptr_t,
        TArrayOfBlobData,
        T__Last = TArrayOfBlobData
    };

private:
    typedef nsID nsID__tdef;
    typedef nsTArray<uint8_t> ArrayOfuint8_t__tdef;
    typedef intptr_t intptr_t__tdef;
    typedef nsTArray<BlobData>* ArrayOfBlobData__tdef;

    union Value {
        char VnsID[sizeof(nsID)];
        char VArrayOfuint8_t[sizeof(nsTArray<uint8_t>)];
        char Vintptr_t[sizeof(intptr_t)];
        nsTArray<BlobData>* VArrayOfBlobData;
    };

    
    
    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class BlobData;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union OptionalBlobData|
//
namespace mozilla {
namespace dom {
class OptionalBlobData MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TBlobData = 1,
        Tvoid_t,
        T__Last = Tvoid_t
    };

private:
    typedef mozilla::dom::BlobData BlobData;
    typedef mozilla::void_t void_t;
    typedef BlobData BlobData__tdef;
    typedef void_t void_t__tdef;

    union Value {
        char VBlobData[sizeof(BlobData)];
        char Vvoid_t[sizeof(void_t)];
    };

    
    
    
    

    ;

    
    

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT ;

    MOZ_IMPLICIT ;
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class OptionalBlobData;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct NormalBlobConstructorParams|
//
namespace mozilla {
namespace dom {
class NormalBlobConstructorParams MOZ_FINAL
{
    OptionalBlobData optionalBlobData_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class OptionalBlobData;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FileBlobConstructorParams|
//
namespace mozilla {
namespace dom {
class FileBlobConstructorParams MOZ_FINAL
{
private:
    typedef mozilla::dom::OptionalBlobData OptionalBlobData;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    


private:
    ;

    ;

    nsString name_;
    nsString contentType_;
    uint64_t length_;
    uint64_t modDate_;
    OptionalBlobData optionalBlobData_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class SlicedBlobConstructorParams MOZ_FINAL
{
private:
    typedef mozilla::dom::PBlobParent PBlobParent;
    typedef mozilla::dom::PBlobChild PBlobChild;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    nsString contentType_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct MysteryBlobConstructorParams|
//
namespace mozilla {
namespace dom {
class MysteryBlobConstructorParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

private:
    ;

    ;

};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct KnownBlobConstructorParams|
//
namespace mozilla {
namespace dom {
class KnownBlobConstructorParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    ;

    nsID id_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct SameProcessBlobConstructorParams|
//
namespace mozilla {
namespace dom {
class SameProcessBlobConstructorParams MOZ_FINAL
{
private:

private:
    ;

    ;

    intptr_t addRefedFileImpl_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class NormalBlobConstructorParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class FileBlobConstructorParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class SameProcessBlobConstructorParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class MysteryBlobConstructorParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class SlicedBlobConstructorParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class KnownBlobConstructorParams;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union AnyBlobConstructorParams|
//
namespace mozilla {
namespace dom {
class AnyBlobConstructorParams MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TNormalBlobConstructorParams = 1,
        TFileBlobConstructorParams,
        TSameProcessBlobConstructorParams,
        TMysteryBlobConstructorParams,
        TSlicedBlobConstructorParams,
        TKnownBlobConstructorParams,
        T__Last = TKnownBlobConstructorParams
    };

private:
    typedef mozilla::dom::NormalBlobConstructorParams NormalBlobConstructorParams;
    typedef mozilla::dom::FileBlobConstructorParams FileBlobConstructorParams;
    typedef mozilla::dom::SameProcessBlobConstructorParams SameProcessBlobConstructorParams;
    typedef mozilla::dom::MysteryBlobConstructorParams MysteryBlobConstructorParams;
    typedef mozilla::dom::SlicedBlobConstructorParams SlicedBlobConstructorParams;
    typedef mozilla::dom::KnownBlobConstructorParams KnownBlobConstructorParams;
    typedef NormalBlobConstructorParams NormalBlobConstructorParams__tdef;
    typedef FileBlobConstructorParams FileBlobConstructorParams__tdef;
    typedef SameProcessBlobConstructorParams SameProcessBlobConstructorParams__tdef;
    typedef MysteryBlobConstructorParams MysteryBlobConstructorParams__tdef;
    typedef SlicedBlobConstructorParams SlicedBlobConstructorParams__tdef;
    typedef KnownBlobConstructorParams KnownBlobConstructorParams__tdef;

    union Value {
        char VNormalBlobConstructorParams[sizeof(NormalBlobConstructorParams)];
        char VFileBlobConstructorParams[sizeof(FileBlobConstructorParams)];
        char VSameProcessBlobConstructorParams[sizeof(SameProcessBlobConstructorParams)];
        char VMysteryBlobConstructorParams[sizeof(MysteryBlobConstructorParams)];
        char VSlicedBlobConstructorParams[sizeof(SlicedBlobConstructorParams)];
        char VKnownBlobConstructorParams[sizeof(KnownBlobConstructorParams)];
    };

    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class AnyBlobConstructorParams;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ChildBlobConstructorParams|
//
namespace mozilla {
namespace dom {
class ChildBlobConstructorParams MOZ_FINAL
{
private:
    typedef mozilla::dom::AnyBlobConstructorParams AnyBlobConstructorParams;

public:
    MOZ_IMPLICIT ;

private:
    ;

    ;

    nsID id_;
    AnyBlobConstructorParams blobParams_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class AnyBlobConstructorParams;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ParentBlobConstructorParams|
//
namespace mozilla {
namespace dom {
class ParentBlobConstructorParams MOZ_FINAL
{
private:
    typedef mozilla::dom::AnyBlobConstructorParams AnyBlobConstructorParams;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    AnyBlobConstructorParams blobParams_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class ChildBlobConstructorParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class ParentBlobConstructorParams;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union BlobConstructorParams|
//
namespace mozilla {
namespace dom {
class BlobConstructorParams MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TChildBlobConstructorParams = 1,
        TParentBlobConstructorParams,
        T__Last = TParentBlobConstructorParams
    };

private:
    typedef mozilla::dom::ChildBlobConstructorParams ChildBlobConstructorParams;
    typedef mozilla::dom::ParentBlobConstructorParams ParentBlobConstructorParams;
    typedef ChildBlobConstructorParams ChildBlobConstructorParams__tdef;
    typedef ParentBlobConstructorParams ParentBlobConstructorParams__tdef;

    union Value {
        char VChildBlobConstructorParams[sizeof(ChildBlobConstructorParams)];
        char VParentBlobConstructorParams[sizeof(ParentBlobConstructorParams)];
    };

    
    
    ;

    
    
    
    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla

#endif // ifndef DOMTypes_h
# 1852 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/DOMTypes.h"
# 23 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/jsipc/JavaScriptTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/jsipc/JavaScriptTypes.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef JavaScriptTypes_h
#define JavaScriptTypes_h

#if 0 /* expanded by -frewrite-includes */
#include "nsRefPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/jsipc/JavaScriptTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/jsipc/JavaScriptTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/jsipc/JavaScriptTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/ProtocolUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/jsipc/JavaScriptTypes.h"

// Headers for typedefs
#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/jsipc/JavaScriptTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMTypes.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/jsipc/JavaScriptTypes.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct JSIID|
//
namespace mozilla {
namespace jsipc {
class JSIID MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 
    
    

    
    

    uint8_t m3_5_;
    uint8_t m3_6_;
    uint8_t m3_7_;
};
} // namespace jsipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct LocalObject|
//
namespace mozilla {
namespace jsipc {
class LocalObject MOZ_FINAL
{
private:

private:
    ;

    ;

    uint64_t serializedId_;
};
} // namespace jsipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct RemoteObject|
//
namespace mozilla {
namespace jsipc {
class RemoteObject MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    


    ;

    uint64_t serializedId_;
    bool isCallable_;
    bool isConstructor_;
    nsCString objectTag_;
};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class LocalObject;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class RemoteObject;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union ObjectVariant|
//
namespace mozilla {
namespace jsipc {
class ObjectVariant MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TLocalObject = 1,
        TRemoteObject,
        T__Last = TRemoteObject
    };

private:
    typedef mozilla::jsipc::LocalObject LocalObject;
    typedef mozilla::jsipc::RemoteObject RemoteObject;
    typedef LocalObject LocalObject__tdef;
    typedef RemoteObject RemoteObject__tdef;

    union Value {
        char VLocalObject[sizeof(LocalObject)];
        char VRemoteObject[sizeof(RemoteObject)];
    };

    Type mType;
};
} // namespace jsipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct WellKnownSymbol|
//
namespace mozilla {
namespace jsipc {
class WellKnownSymbol MOZ_FINAL
{
private:

public:
    ;

    ;

    uint32_t which_;
};
} // namespace jsipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct RegisteredSymbol|
//
namespace mozilla {
namespace jsipc {
class RegisteredSymbol MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

    
    

private:
    ;

    ;

    nsString key_;
};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class WellKnownSymbol;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class RegisteredSymbol;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union SymbolVariant|
//
namespace mozilla {
namespace jsipc {
class SymbolVariant MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TWellKnownSymbol = 1,
        TRegisteredSymbol,
        T__Last = TRegisteredSymbol
    };

private:
    typedef mozilla::jsipc::WellKnownSymbol WellKnownSymbol;
    typedef mozilla::jsipc::RegisteredSymbol RegisteredSymbol;
    typedef WellKnownSymbol WellKnownSymbol__tdef;
    typedef RegisteredSymbol RegisteredSymbol__tdef;

    union Value {
        char VWellKnownSymbol[sizeof(WellKnownSymbol)];
        char VRegisteredSymbol[sizeof(RegisteredSymbol)];
    };

    ;

    ;

    
    
    
    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace jsipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct UndefinedVariant|
//
namespace mozilla {
namespace jsipc {
class UndefinedVariant MOZ_FINAL
{
private:

};
} // namespace jsipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct NullVariant|
//
namespace mozilla {
namespace jsipc {
class NullVariant MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

private:
    ;

    ;

};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class ObjectVariant;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class NullVariant;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union ObjectOrNullVariant|
//
namespace mozilla {
namespace jsipc {
class ObjectOrNullVariant MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TObjectVariant = 1,
        TNullVariant,
        T__Last = TNullVariant
    };

private:
    typedef mozilla::jsipc::ObjectVariant ObjectVariant;
    typedef mozilla::jsipc::NullVariant NullVariant;
    typedef ObjectVariant ObjectVariant__tdef;
    typedef NullVariant NullVariant__tdef;

    union Value {
        char VObjectVariant[sizeof(ObjectVariant)];
        char VNullVariant[sizeof(NullVariant)];
    };

    
    
    
    

    
    
    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class UndefinedVariant;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class NullVariant;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class ObjectVariant;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class SymbolVariant;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class JSIID;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union JSVariant|
//
namespace mozilla {
namespace jsipc {
class JSVariant MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TUndefinedVariant = 1,
        TNullVariant,
        TObjectVariant,
        TSymbolVariant,
        TnsString,
        Tdouble,
        Tbool,
        TJSIID,
        T__Last = TJSIID
    };

private:
    typedef mozilla::jsipc::UndefinedVariant UndefinedVariant;
    typedef mozilla::jsipc::NullVariant NullVariant;
    typedef mozilla::jsipc::ObjectVariant ObjectVariant;
    typedef mozilla::jsipc::SymbolVariant SymbolVariant;
    typedef mozilla::jsipc::JSIID JSIID;
    typedef UndefinedVariant UndefinedVariant__tdef;
    typedef NullVariant NullVariant__tdef;
    typedef ObjectVariant ObjectVariant__tdef;
    typedef SymbolVariant SymbolVariant__tdef;
    typedef nsString nsString__tdef;
    typedef double double__tdef;
    typedef bool bool__tdef;
    typedef JSIID JSIID__tdef;

    union Value {
        char VUndefinedVariant[sizeof(UndefinedVariant)];
        char VNullVariant[sizeof(NullVariant)];
        char VObjectVariant[sizeof(ObjectVariant)];
        char VSymbolVariant[sizeof(SymbolVariant)];
        char VnsString[sizeof(nsString)];
        char Vdouble[sizeof(double)];
        char Vbool[sizeof(bool)];
        char VJSIID[sizeof(JSIID)];
    };

    
    
    
    
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT ;

    MOZ_IMPLICIT ;

    ;
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class SymbolVariant;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union JSIDVariant|
//
namespace mozilla {
namespace jsipc {
class JSIDVariant MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TSymbolVariant = 1,
        TnsString,
        Tint32_t,
        T__Last = Tint32_t
    };

private:
    typedef mozilla::jsipc::SymbolVariant SymbolVariant;
    typedef SymbolVariant SymbolVariant__tdef;
    typedef nsString nsString__tdef;
    typedef int32_t int32_t__tdef;

    union Value {
        char VSymbolVariant[sizeof(SymbolVariant)];
        char VnsString[sizeof(nsString)];
        char Vint32_t[sizeof(int32_t)];
    };

    
    

    MOZ_IMPLICIT ;

    MOZ_IMPLICIT ;

    ;

    

private:
    Value mValue;
    Type mType;
};
} // namespace jsipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ReturnSuccess|
//
namespace mozilla {
namespace jsipc {
class ReturnSuccess MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

private:
    ;

    ;

};
} // namespace jsipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ReturnStopIteration|
//
namespace mozilla {
namespace jsipc {
class ReturnStopIteration MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

private:
    ;

    ;

};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class JSVariant;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ReturnException|
//
namespace mozilla {
namespace jsipc {
class ReturnException MOZ_FINAL
{
private:
    typedef mozilla::jsipc::JSVariant JSVariant;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    JSVariant exn_;
};
} // namespace jsipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ReturnObjectOpResult|
//
namespace mozilla {
namespace jsipc {
class ReturnObjectOpResult MOZ_FINAL
{
private:

private:
    ;

    ;

    uint32_t code_;
};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class ReturnSuccess;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class ReturnStopIteration;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class ReturnException;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class ReturnObjectOpResult;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union ReturnStatus|
//
namespace mozilla {
namespace jsipc {
class ReturnStatus MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TReturnSuccess = 1,
        TReturnStopIteration,
        TReturnException,
        TReturnObjectOpResult,
        T__Last = TReturnObjectOpResult
    };

private:
    typedef mozilla::jsipc::ReturnSuccess ReturnSuccess;
    typedef mozilla::jsipc::ReturnStopIteration ReturnStopIteration;
    typedef mozilla::jsipc::ReturnException ReturnException;
    typedef mozilla::jsipc::ReturnObjectOpResult ReturnObjectOpResult;
    typedef ReturnSuccess ReturnSuccess__tdef;
    typedef ReturnStopIteration ReturnStopIteration__tdef;
    typedef ReturnException ReturnException__tdef;
    typedef ReturnObjectOpResult ReturnObjectOpResult__tdef;

    union Value {
        char VReturnSuccess[sizeof(ReturnSuccess)];
        char VReturnStopIteration[sizeof(ReturnStopIteration)];
        char VReturnException[sizeof(ReturnException)];
        char VReturnObjectOpResult[sizeof(ReturnObjectOpResult)];
    };

    
    
    
    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class JSVariant;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union JSParam|
//
namespace mozilla {
namespace jsipc {
class JSParam MOZ_FINAL
{
public:
    enum Type {
        T__None,
        Tvoid_t = 1,
        TJSVariant,
        T__Last = TJSVariant
    };

private:
    typedef mozilla::void_t void_t;
    typedef mozilla::jsipc::JSVariant JSVariant;
    typedef void_t void_t__tdef;
    typedef JSVariant JSVariant__tdef;

    union Value {
        char Vvoid_t[sizeof(void_t)];
        char VJSVariant[sizeof(JSVariant)];
    };

    
    
    
    

    ;

    
    

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT ;
    Value mValue;
    Type mType;
};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class ObjectVariant;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union GetterSetter|
//
namespace mozilla {
namespace jsipc {
class GetterSetter MOZ_FINAL
{
public:
    enum Type {
        T__None,
        Tuint64_t = 1,
        TObjectVariant,
        T__Last = TObjectVariant
    };

private:
    typedef mozilla::jsipc::ObjectVariant ObjectVariant;
    typedef uint64_t uint64_t__tdef;
    typedef ObjectVariant ObjectVariant__tdef;

    union Value {
        char Vuint64_t[sizeof(uint64_t)];
        char VObjectVariant[sizeof(ObjectVariant)];
    };

    
    
    
    

    ;

    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class ObjectOrNullVariant;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class JSVariant;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class GetterSetter;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct PPropertyDescriptor|
//
namespace mozilla {
namespace jsipc {
class PPropertyDescriptor MOZ_FINAL
{
private:
    typedef mozilla::jsipc::ObjectOrNullVariant ObjectOrNullVariant;
    typedef mozilla::jsipc::JSVariant JSVariant;
    typedef mozilla::jsipc::GetterSetter GetterSetter;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    
    

private:
    ;

    ;

    ObjectOrNullVariant obj_;
    uint32_t attrs_;
    JSVariant value_;
    GetterSetter getter_;
    GetterSetter setter_;
};
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class JSVariant;
} // namespace jsipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct CpowEntry|
//
namespace mozilla {
namespace jsipc {
class CpowEntry MOZ_FINAL
{
private:
    typedef mozilla::jsipc::JSVariant JSVariant;

    
    

private:
    ;

    ;

    nsString name_;
    JSVariant value_;
};
} // namespace jsipc
} // namespace mozilla

#endif // ifndef JavaScriptTypes_h
# 2703 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/jsipc/JavaScriptTypes.h"
# 24 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/InputStreamParams.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/InputStreamParams.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef InputStreamParams_h
#define InputStreamParams_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/InputStreamParams.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/InputStreamParams.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/InputStreamParams.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/ProtocolUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/InputStreamParams.h"

// Headers for typedefs
#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/InputStreamParams.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMTypes.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/InputStreamParams.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct StringInputStreamParams|
//
namespace mozilla {
namespace ipc {
class StringInputStreamParams MOZ_FINAL
{
    

private:
    ;

    ;

    nsCString data_;
};
} // namespace ipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FileInputStreamParams|
//
namespace mozilla {
namespace ipc {
class FileInputStreamParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    uint32_t fileDescriptorIndex_;
    int32_t behaviorFlags_;
    int32_t ioFlags_;
};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class FileInputStreamParams;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct PartialFileInputStreamParams|
//
namespace mozilla {
namespace ipc {
class PartialFileInputStreamParams MOZ_FINAL
{
private:
    typedef mozilla::ipc::FileInputStreamParams FileInputStreamParams;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    ;

    FileInputStreamParams fileStreamParams_;
    uint64_t begin_;
    uint64_t length_;
};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class InputStreamParams;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct MultiplexInputStreamParams|
//
namespace mozilla {
namespace ipc {
class MultiplexInputStreamParams MOZ_FINAL
{
private:
    typedef mozilla::ipc::InputStreamParams InputStreamParams;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 
    
    

private:
    ;

    ;

    nsTArray<InputStreamParams>* streams_;
    uint32_t currentStream_;
    nsresult status_;
    bool startedReadingCurrent_;
};
} // namespace ipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct RemoteInputStreamParams|
//
namespace mozilla {
namespace ipc {
class RemoteInputStreamParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 
};
} // namespace ipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct SameProcessInputStreamParams|
//
namespace mozilla {
namespace ipc {
class SameProcessInputStreamParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    ;

    intptr_t addRefedInputStream_;
};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class StringInputStreamParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class FileInputStreamParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class PartialFileInputStreamParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class BufferedInputStreamParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class MIMEInputStreamParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class MultiplexInputStreamParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class RemoteInputStreamParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class SameProcessInputStreamParams;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union InputStreamParams|
//
namespace mozilla {
namespace ipc {
class InputStreamParams MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TStringInputStreamParams = 1,
        TFileInputStreamParams,
        TPartialFileInputStreamParams,
        TBufferedInputStreamParams,
        TMIMEInputStreamParams,
        TMultiplexInputStreamParams,
        TRemoteInputStreamParams,
        TSameProcessInputStreamParams,
        T__Last = TSameProcessInputStreamParams
    };

private:
    typedef mozilla::ipc::StringInputStreamParams StringInputStreamParams;
    typedef mozilla::ipc::FileInputStreamParams FileInputStreamParams;
    typedef mozilla::ipc::PartialFileInputStreamParams PartialFileInputStreamParams;
    typedef mozilla::ipc::BufferedInputStreamParams BufferedInputStreamParams;
    typedef mozilla::ipc::MIMEInputStreamParams MIMEInputStreamParams;
    typedef mozilla::ipc::MultiplexInputStreamParams MultiplexInputStreamParams;
    typedef mozilla::ipc::RemoteInputStreamParams RemoteInputStreamParams;
    typedef mozilla::ipc::SameProcessInputStreamParams SameProcessInputStreamParams;
    typedef StringInputStreamParams StringInputStreamParams__tdef;
    typedef FileInputStreamParams FileInputStreamParams__tdef;
    typedef PartialFileInputStreamParams PartialFileInputStreamParams__tdef;
    typedef BufferedInputStreamParams* BufferedInputStreamParams__tdef;
    typedef MIMEInputStreamParams* MIMEInputStreamParams__tdef;
    typedef MultiplexInputStreamParams* MultiplexInputStreamParams__tdef;
    typedef RemoteInputStreamParams RemoteInputStreamParams__tdef;
    typedef SameProcessInputStreamParams SameProcessInputStreamParams__tdef;

    union Value {
        char VStringInputStreamParams[sizeof(StringInputStreamParams)];
        char VFileInputStreamParams[sizeof(FileInputStreamParams)];
        char VPartialFileInputStreamParams[sizeof(PartialFileInputStreamParams)];
        BufferedInputStreamParams* VBufferedInputStreamParams;
        MIMEInputStreamParams* VMIMEInputStreamParams;
        MultiplexInputStreamParams* VMultiplexInputStreamParams;
        char VRemoteInputStreamParams[sizeof(RemoteInputStreamParams)];
        char VSameProcessInputStreamParams[sizeof(SameProcessInputStreamParams)];
    };

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    ;

    
    

public:

private:
    Value mValue;
    Type mType;
};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class OptionalInputStreamParams;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct BufferedInputStreamParams|
//
namespace mozilla {
namespace ipc {
class BufferedInputStreamParams MOZ_FINAL
{
private:
    

    
    

private:
    ;

    ;

    OptionalInputStreamParams* optionalStream_;
    uint32_t bufferSize_;
};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class OptionalInputStreamParams;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct MIMEInputStreamParams|
//
namespace mozilla {
namespace ipc {
class MIMEInputStreamParams MOZ_FINAL
{
private:
    typedef mozilla::ipc::OptionalInputStreamParams OptionalInputStreamParams;


    OptionalInputStreamParams* optionalStream_;
    nsCString headers_;
    nsCString contentLength_;
    bool startedReading_;
    bool addContentLength_;
};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class PFileDescriptorSetParent;
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class PFileDescriptorSetChild;
} // namespace ipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union OptionalFileDescriptorSet|
//
namespace mozilla {
namespace ipc {
class OptionalFileDescriptorSet MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TPFileDescriptorSetParent = 1,
        TPFileDescriptorSetChild,
        TArrayOfFileDescriptor,
        Tvoid_t,
        T__Last = Tvoid_t
    };

private:
    typedef mozilla::ipc::PFileDescriptorSetParent PFileDescriptorSetParent;
    typedef mozilla::ipc::PFileDescriptorSetChild PFileDescriptorSetChild;
    typedef mozilla::ipc::FileDescriptor FileDescriptor;
    typedef mozilla::void_t void_t;
    typedef PFileDescriptorSetParent* PFileDescriptorSetParent__tdef;
    typedef PFileDescriptorSetChild* PFileDescriptorSetChild__tdef;
    typedef nsTArray<FileDescriptor> ArrayOfFileDescriptor__tdef;
    typedef void_t void_t__tdef;

    union Value {
        char VPFileDescriptorSetParent[sizeof(PFileDescriptorSetParent*)];
        char VPFileDescriptorSetChild[sizeof(PFileDescriptorSetChild*)];
        char VArrayOfFileDescriptor[sizeof(nsTArray<FileDescriptor>)];
        char Vvoid_t[sizeof(void_t)];
    };

    
    
    
    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace ipc
} // namespace mozilla

#endif // ifndef InputStreamParams_h
# 1551 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/InputStreamParams.h"
# 25 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/PTabContext.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PTabContext.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PTabContext_h
#define PTabContext_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PTabContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "prtime.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PTabContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PTabContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/ProtocolUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PTabContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/PBrowserOrId.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserOrId.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PBrowserOrId_h
#define PBrowserOrId_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserOrId.h"
#if 0 /* expanded by -frewrite-includes */
#include "prtime.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserOrId.h"
#if 0 /* expanded by -frewrite-includes */
#include "IPCMessageStart.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserOrId.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/ProtocolUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserOrId.h"

// Headers for typedefs
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ipc/IdType.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserOrId.h"

namespace mozilla {
namespace dom {
class PBrowserParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBrowserChild;
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union PBrowserOrId|
//
namespace mozilla {
namespace dom {
class PBrowserOrId MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TPBrowserParent = 1,
        TPBrowserChild,
        TTabId,
        T__Last = TTabId
    };

private:
    typedef mozilla::dom::PBrowserParent PBrowserParent;
    typedef mozilla::dom::PBrowserChild PBrowserChild;
    typedef mozilla::dom::TabId TabId;
    typedef PBrowserParent* PBrowserParent__tdef;
    typedef PBrowserChild* PBrowserChild__tdef;
    typedef TabId TabId__tdef;

    union Value {
        char VPBrowserParent[sizeof(PBrowserParent*)];
        char VPBrowserChild[sizeof(PBrowserChild*)];
        char VTabId[sizeof(TabId)];
    };

    
    
    
    
    
    

    ;

    
    
private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla

#endif // ifndef PBrowserOrId_h
# 228 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserOrId.h"
# 18 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PTabContext.h" 2

namespace mozilla {
namespace dom {
class PBrowserOrId;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct PopupIPCTabContext|
//
namespace mozilla {
namespace dom {
class PopupIPCTabContext MOZ_FINAL
{
private:
    typedef mozilla::dom::PBrowserOrId PBrowserOrId;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 


    ;

    PBrowserOrId opener_;
    bool isBrowserElement_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct AppFrameIPCTabContext|
//
namespace mozilla {
namespace dom {
class AppFrameIPCTabContext MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

    
    

    
    

private:
    ;

    ;

    uint32_t ownAppId_;
    uint32_t appFrameOwnerAppId_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct BrowserFrameIPCTabContext|
//
namespace mozilla {
namespace dom {
class BrowserFrameIPCTabContext MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    uint32_t browserFrameOwnerAppId_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct VanillaFrameIPCTabContext|
//
namespace mozilla {
namespace dom {
class VanillaFrameIPCTabContext MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

private:
    ;

    ;

};
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class VanillaFrameIPCTabContext;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union IPCTabAppBrowserContext|
//
namespace mozilla {
namespace dom {
class IPCTabAppBrowserContext MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TPopupIPCTabContext = 1,
        TAppFrameIPCTabContext,
        TBrowserFrameIPCTabContext,
        TVanillaFrameIPCTabContext,
        T__Last = TVanillaFrameIPCTabContext
    };

private:
    typedef mozilla::dom::PopupIPCTabContext PopupIPCTabContext;
    typedef mozilla::dom::AppFrameIPCTabContext AppFrameIPCTabContext;
    typedef mozilla::dom::BrowserFrameIPCTabContext BrowserFrameIPCTabContext;
    typedef mozilla::dom::VanillaFrameIPCTabContext VanillaFrameIPCTabContext;
    typedef PopupIPCTabContext PopupIPCTabContext__tdef;
    typedef AppFrameIPCTabContext AppFrameIPCTabContext__tdef;
    typedef BrowserFrameIPCTabContext BrowserFrameIPCTabContext__tdef;
    typedef VanillaFrameIPCTabContext VanillaFrameIPCTabContext__tdef;

    union Value {
        char VPopupIPCTabContext[sizeof(PopupIPCTabContext)];
        char VAppFrameIPCTabContext[sizeof(AppFrameIPCTabContext)];
        char VBrowserFrameIPCTabContext[sizeof(BrowserFrameIPCTabContext)];
        char VVanillaFrameIPCTabContext[sizeof(VanillaFrameIPCTabContext)];
    };

    
    
    
    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class IPCTabAppBrowserContext;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct IPCTabContext|
//
namespace mozilla {
namespace dom {
class IPCTabContext MOZ_FINAL
{
private:
    typedef mozilla::dom::IPCTabAppBrowserContext IPCTabAppBrowserContext;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

    
    

private:
    ;

    ;

    IPCTabAppBrowserContext appBrowserContext_;
};
} // namespace dom
} // namespace mozilla

#endif // ifndef PTabContext_h
# 602 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PTabContext.h"
# 26 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/URIParams.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/URIParams.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef URIParams_h
#define URIParams_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/URIParams.h"
#if 0 /* expanded by -frewrite-includes */
#include "prtime.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/URIParams.h"
#if 0 /* expanded by -frewrite-includes */
#include "IPCMessageStart.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/URIParams.h"
#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/URIParams.h"

// Headers for typedefs
#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/URIParams.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct SimpleURIParams|
//
namespace mozilla {
namespace ipc {
class SimpleURIParams MOZ_FINAL
{
private:
    nsCString scheme_;
    nsCString path_;
    nsCString ref_;
    bool isMutable_;
};
} // namespace ipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct StandardURLSegment|
//
namespace mozilla {
namespace ipc {
class StandardURLSegment MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

    
    

    
    

private:
    ;

    ;

    uint32_t position_;
    int32_t length_;
};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class StandardURLSegment;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct StandardURLParams|
//
namespace mozilla {
namespace ipc {
class StandardURLParams MOZ_FINAL
{
private:
    StandardURLSegment extension_;
    StandardURLSegment query_;
    StandardURLSegment ref_;
    nsCString originCharset_;
    bool isMutable_;
    bool supportsFileURL_;
    uint32_t hostEncoding_;
};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class URIParams;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct JARURIParams|
//
namespace mozilla {
namespace ipc {
class JARURIParams MOZ_FINAL
{
private:
    typedef mozilla::ipc::URIParams URIParams;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 


private:
    ;

    ;

    URIParams* jarFile_;
    URIParams* jarEntry_;
    nsCString charset_;
};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class OptionalURIParams;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct IconURIParams|
//
namespace mozilla {
namespace ipc {
class IconURIParams MOZ_FINAL
{
private:
    typedef mozilla::ipc::OptionalURIParams OptionalURIParams;

public:
    MOZ_IMPLICIT ;

    ;

    ;

    OptionalURIParams* uri_;
    uint32_t size_;
    nsCString contentType_;
    nsCString fileName_;
    nsCString stockIcon_;
    int32_t iconSize_;
    int32_t iconState_;
};
} // namespace ipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct NullPrincipalURIParams|
//
namespace mozilla {
namespace ipc {
class NullPrincipalURIParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

private:
    ;

    ;

};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class SimpleURIParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class StandardURLParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class JARURIParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class IconURIParams;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class NullPrincipalURIParams;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union URIParams|
//
namespace mozilla {
namespace ipc {
class URIParams MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TSimpleURIParams = 1,
        TStandardURLParams,
        TJARURIParams,
        TIconURIParams,
        TNullPrincipalURIParams,
        T__Last = TNullPrincipalURIParams
    };

private:
    typedef mozilla::ipc::SimpleURIParams SimpleURIParams;
    typedef mozilla::ipc::StandardURLParams StandardURLParams;
    typedef mozilla::ipc::JARURIParams JARURIParams;
    typedef mozilla::ipc::IconURIParams IconURIParams;
    typedef mozilla::ipc::NullPrincipalURIParams NullPrincipalURIParams;
    typedef SimpleURIParams SimpleURIParams__tdef;
    typedef StandardURLParams StandardURLParams__tdef;
    typedef JARURIParams* JARURIParams__tdef;
    typedef IconURIParams* IconURIParams__tdef;
    typedef NullPrincipalURIParams NullPrincipalURIParams__tdef;

    union Value {
        char VSimpleURIParams[sizeof(SimpleURIParams)];
        char VStandardURLParams[sizeof(StandardURLParams)];
        JARURIParams* VJARURIParams;
        IconURIParams* VIconURIParams;
        char VNullPrincipalURIParams[sizeof(NullPrincipalURIParams)];
    };

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace ipc {
class URIParams;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union OptionalURIParams|
//
namespace mozilla {
namespace ipc {
class OptionalURIParams MOZ_FINAL
{
public:
    enum Type {
        T__None,
        Tvoid_t = 1,
        TURIParams,
        T__Last = TURIParams
    };

private:
    typedef mozilla::void_t void_t;
    typedef mozilla::ipc::URIParams URIParams;
    typedef void_t void_t__tdef;
    typedef URIParams* URIParams__tdef;

    union Value {
        char Vvoid_t[sizeof(void_t)];
        URIParams* VURIParams;
    };

    
    
    
    

    ;


    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace ipc
} // namespace mozilla

#endif // ifndef URIParams_h
# 1285 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/URIParams.h"
# 27 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/plugins/PluginTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/plugins/PluginTypes.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PluginTypes_h
#define PluginTypes_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/plugins/PluginTypes.h"
//
namespace mozilla {
namespace plugins {
class PluginTag MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    nsCString description_;
    nsTArray<nsCString> mimeTypes_;
    nsTArray<nsCString> mimeDescriptions_;
    nsTArray<nsCString> extensions_;
    bool isJavaPlugin_;
    bool isFlashPlugin_;
    nsCString filename_;
    nsCString version_;
    int64_t lastModifiedTime_;
    bool isFromExtension_;
};
} // namespace plugins
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union PluginIdentifier|
//
namespace mozilla {
namespace plugins {
class PluginIdentifier MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TnsCString = 1,
        Tint32_t,
        T__Last = Tint32_t
    };

private:
    typedef nsCString nsCString__tdef;
    typedef int32_t int32_t__tdef;

    union Value {
        char VnsCString[sizeof(nsCString)];
        char Vint32_t[sizeof(int32_t)];
    };

    
    
    
    

    ;

    
    
    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace plugins
} // namespace mozilla

#endif // ifndef PluginTypes_h
# 383 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/plugins/PluginTypes.h"
# 28 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2
#if 0 /* expanded by -frewrite-includes */
    uint32_t protocolId_;
    FileDescriptor fd_;
};
} // namespace ipc
} // namespace mozilla

#endif // ifndef ProtocolTypes_h
# 95 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/ProtocolTypes.h"
# 29 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h" 2


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union ChromeRegistryItem|
//
class ChromeRegistryItem MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TChromePackage = 1,
        TOverrideMapping,
        TResourceMapping,
        T__Last = TResourceMapping
    };

private:
    typedef ChromePackage ChromePackage__tdef;
    typedef OverrideMapping OverrideMapping__tdef;
    typedef ResourceMapping ResourceMapping__tdef;

    union Value {
        char VChromePackage[sizeof(ChromePackage)];
        char VOverrideMapping[sizeof(OverrideMapping)];
        char VResourceMapping[sizeof(ResourceMapping)];
    };

    
    
    
    
    
    

    ;

    
    

    Value mValue;
    Type mType;
};


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FontListEntry|
//
namespace mozilla {
namespace dom {
class FontListEntry MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;
    bool isHidden_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageFreeSpaceParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageFreeSpaceParams MOZ_FINAL
{
private:

public:
    

private:
    ;

    ;

    nsString type_;
    nsString storageName_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageUsedSpaceParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageUsedSpaceParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    nsString storageName_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageAvailableParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageAvailableParams MOZ_FINAL
{
private:

public:
    

private:
    ;

    ;

    nsString type_;
    nsString storageName_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageStatusParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageStatusParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    nsString storageName_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageFormatParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageFormatParams MOZ_FINAL
{
private:

public:
    

private:
    ;

    ;

    nsString type_;
    nsString storageName_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageMountParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageMountParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    nsString storageName_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageUnmountParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageUnmountParams MOZ_FINAL
{
private:

public:
    

private:
    ;

    ;

    nsString type_;
    nsString storageName_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBlobParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBlobChild;
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageAddParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageAddParams MOZ_FINAL
{

private:
    ;

    ;

    nsString type_;
    nsString storageName_;
    nsString relpath_;
    PBlobParent* blobParent_;
    PBlobChild* blobChild_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class DeviceStorageAppendParams MOZ_FINAL
{
private:
    typedef mozilla::dom::PBlobParent PBlobParent;
    typedef mozilla::dom::PBlobChild PBlobChild;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    
    

private:
    ;

    ;

    nsString type_;
    nsString storageName_;
    nsString relpath_;
    PBlobParent* blobParent_;
    PBlobChild* blobChild_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageCreateFdParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageCreateFdParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 
    

private:
    ;

    ;

    nsString type_;
    nsString storageName_;
    nsString relpath_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageGetParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageGetParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

private:
    ;

    ;

    nsString type_;
    nsString storageName_;
    nsString rootDir_;
    nsString relpath_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageDeleteParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageDeleteParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    ;

    nsString type_;
    nsString storageName_;
    nsString relpath_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DeviceStorageEnumerationParams|
//
namespace mozilla {
namespace dom {
class DeviceStorageEnumerationParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;
    ;

    nsString type_;
    nsString storageName_;
    nsString rootdir_;
    uint64_t since_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class DeviceStorageAddParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class DeviceStorageAppendParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class DeviceStorageCreateFdParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class DeviceStorageGetParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class DeviceStorageAvailableParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class DeviceStorageStatusParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class DeviceStorageFormatParams;
} // namespace dom
namespace dom {
class DeviceStorageParams MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TDeviceStorageAddParams = 1,
        TDeviceStorageAppendParams,
        TDeviceStorageCreateFdParams,
        TDeviceStorageGetParams,
        TDeviceStorageDeleteParams,
        TDeviceStorageEnumerationParams,
        TDeviceStorageFreeSpaceParams,
        TDeviceStorageUsedSpaceParams,
        TDeviceStorageAvailableParams,
        TDeviceStorageStatusParams,
        TDeviceStorageFormatParams,
        TDeviceStorageMountParams,
        TDeviceStorageUnmountParams,
        T__Last = TDeviceStorageUnmountParams
    };

private:
    typedef mozilla::dom::DeviceStorageAddParams DeviceStorageAddParams;
    typedef mozilla::dom::DeviceStorageAppendParams DeviceStorageAppendParams;
    typedef mozilla::dom::DeviceStorageCreateFdParams DeviceStorageCreateFdParams;
    typedef mozilla::dom::DeviceStorageGetParams DeviceStorageGetParams;
    typedef mozilla::dom::DeviceStorageDeleteParams DeviceStorageDeleteParams;
    typedef mozilla::dom::DeviceStorageEnumerationParams DeviceStorageEnumerationParams;
    typedef mozilla::dom::DeviceStorageFreeSpaceParams DeviceStorageFreeSpaceParams;
    typedef mozilla::dom::DeviceStorageUsedSpaceParams DeviceStorageUsedSpaceParams;
    typedef mozilla::dom::DeviceStorageAvailableParams DeviceStorageAvailableParams;
    typedef DeviceStorageUnmountParams DeviceStorageUnmountParams__tdef;

    union Value {
        char VDeviceStorageAddParams[sizeof(DeviceStorageAddParams)];
        char VDeviceStorageAppendParams[sizeof(DeviceStorageAppendParams)];
        char VDeviceStorageCreateFdParams[sizeof(DeviceStorageCreateFdParams)];
        char VDeviceStorageGetParams[sizeof(DeviceStorageGetParams)];
        char VDeviceStorageDeleteParams[sizeof(DeviceStorageDeleteParams)];
        char VDeviceStorageEnumerationParams[sizeof(DeviceStorageEnumerationParams)];
        char VDeviceStorageFreeSpaceParams[sizeof(DeviceStorageFreeSpaceParams)];
        char VDeviceStorageUsedSpaceParams[sizeof(DeviceStorageUsedSpaceParams)];
        char VDeviceStorageAvailableParams[sizeof(DeviceStorageAvailableParams)];
        char VDeviceStorageStatusParams[sizeof(DeviceStorageStatusParams)];
        char VDeviceStorageFormatParams[sizeof(DeviceStorageFormatParams)];
        char VDeviceStorageMountParams[sizeof(DeviceStorageMountParams)];
        char VDeviceStorageUnmountParams[sizeof(DeviceStorageUnmountParams)];
    };

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FMRadioRequestEnableParams|
//
namespace mozilla {
namespace dom {
class FMRadioRequestEnableParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

    
    

private:
    ;

    ;

    double frequency_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FMRadioRequestDisableParams|
//
namespace mozilla {
namespace dom {
class FMRadioRequestDisableParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

private:
    ;

    ;

};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FMRadioRequestSetFrequencyParams|
//
namespace mozilla {
namespace dom {
class FMRadioRequestSetFrequencyParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FMRadioRequestSeekParams|
//
namespace mozilla {
namespace dom {
class FMRadioRequestSeekParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    ;

    bool upward_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FMRadioRequestCancelSeekParams|
//
namespace mozilla {
namespace dom {
class FMRadioRequestCancelSeekParams MOZ_FINAL
{
    ;

};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class FMRadioRequestEnableParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class FMRadioRequestDisableParams;
} // namespace dom
} // namespace mozilla
//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union FMRadioRequestParams|
//
namespace mozilla {
namespace dom {
class FMRadioRequestParams MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TFMRadioRequestEnableParams = 1,
        TFMRadioRequestDisableParams,
        TFMRadioRequestSetFrequencyParams,
        TFMRadioRequestSeekParams,
        TFMRadioRequestCancelSeekParams,
        T__Last = TFMRadioRequestCancelSeekParams
    };

private:
    typedef mozilla::dom::FMRadioRequestEnableParams FMRadioRequestEnableParams;
    typedef mozilla::dom::FMRadioRequestDisableParams FMRadioRequestDisableParams;
    typedef mozilla::dom::FMRadioRequestSetFrequencyParams FMRadioRequestSetFrequencyParams;
    typedef mozilla::dom::FMRadioRequestSeekParams FMRadioRequestSeekParams;
    typedef mozilla::dom::FMRadioRequestCancelSeekParams FMRadioRequestCancelSeekParams;
    typedef FMRadioRequestEnableParams FMRadioRequestEnableParams__tdef;
    typedef FMRadioRequestDisableParams FMRadioRequestDisableParams__tdef;
    typedef FMRadioRequestSetFrequencyParams FMRadioRequestSetFrequencyParams__tdef;
    typedef FMRadioRequestSeekParams FMRadioRequestSeekParams__tdef;
    typedef FMRadioRequestCancelSeekParams FMRadioRequestCancelSeekParams__tdef;

    union Value {
        char VFMRadioRequestEnableParams[sizeof(FMRadioRequestEnableParams)];
        char VFMRadioRequestDisableParams[sizeof(FMRadioRequestDisableParams)];
        char VFMRadioRequestSetFrequencyParams[sizeof(FMRadioRequestSetFrequencyParams)];
        char VFMRadioRequestSeekParams[sizeof(FMRadioRequestSeekParams)];
        char VFMRadioRequestCancelSeekParams[sizeof(FMRadioRequestCancelSeekParams)];
    };

    
    
    
    
    
    
    
    
    
    
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FileSystemCreateDirectoryParams|
//
namespace mozilla {
namespace dom {
class FileSystemCreateDirectoryParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

private:
    ;

    ;

    nsString filesystem_;
    nsString realPath_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBlobParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBlobChild;
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union FileSystemFileDataValue|
//
namespace mozilla {
namespace dom {
class FileSystemFileDataValue MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TArrayOfuint8_t = 1,
        TPBlobParent,
        TPBlobChild,
        T__Last = TPBlobChild
    };

private:
    typedef mozilla::dom::PBlobParent PBlobParent;
    typedef mozilla::dom::PBlobChild PBlobChild;
    typedef nsTArray<uint8_t> ArrayOfuint8_t__tdef;
    typedef PBlobParent* PBlobParent__tdef;
    typedef PBlobChild* PBlobChild__tdef;

    union Value {
        char VArrayOfuint8_t[sizeof(nsTArray<uint8_t>)];
        char VPBlobParent[sizeof(PBlobParent*)];
        char VPBlobChild[sizeof(PBlobChild*)];
    };

    
    
    
    
    
    

    ;

    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class FileSystemFileDataValue;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FileSystemCreateFileParams|
//
namespace mozilla {
namespace dom {
class FileSystemCreateFileParams MOZ_FINAL
{
private:
    typedef mozilla::dom::FileSystemFileDataValue FileSystemFileDataValue;
    nsString filesystem_;
    nsString realPath_;
    FileSystemFileDataValue data_;
    bool replace_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FileSystemGetFileOrDirectoryParams|
//
namespace mozilla {
namespace dom {
class FileSystemGetFileOrDirectoryParams MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 


    nsString filesystem_;
    nsString realPath_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBlobParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBlobChild;
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union FileSystemPathOrFileValue|
//
namespace mozilla {
namespace dom {
class FileSystemPathOrFileValue MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TnsString = 1,
        TPBlobParent,
        TPBlobChild,
        T__Last = TPBlobChild
    };

private:
    typedef mozilla::dom::PBlobParent PBlobParent;
    typedef mozilla::dom::PBlobChild PBlobChild;
    typedef nsString nsString__tdef;
    typedef PBlobParent* PBlobParent__tdef;
    typedef PBlobChild* PBlobChild__tdef;

    union Value {
        char VnsString[sizeof(nsString)];
        char VPBlobParent[sizeof(PBlobParent*)];
        char VPBlobChild[sizeof(PBlobChild*)];
    };
    

    
    
    
    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class FileSystemPathOrFileValue;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FileSystemRemoveParams|
//
namespace mozilla {
namespace dom {
class FileSystemRemoveParams MOZ_FINAL
{

    nsString filesystem_;
    nsString directory_;
    FileSystemPathOrFileValue target_;
    bool recursive_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class FileSystemCreateDirectoryParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class FileSystemCreateFileParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class FileSystemGetFileOrDirectoryParams;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class FileSystemRemoveParams;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union FileSystemParams|
//
namespace mozilla {
namespace dom {
class FileSystemParams MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TFileSystemCreateDirectoryParams = 1,
        TFileSystemCreateFileParams,
        TFileSystemGetFileOrDirectoryParams,
        TFileSystemRemoveParams,
        T__Last = TFileSystemRemoveParams
    };

private:
    typedef mozilla::dom::FileSystemCreateDirectoryParams FileSystemCreateDirectoryParams;
    typedef mozilla::dom::FileSystemCreateFileParams FileSystemCreateFileParams;
    typedef mozilla::dom::FileSystemGetFileOrDirectoryParams FileSystemGetFileOrDirectoryParams;
    typedef mozilla::dom::FileSystemRemoveParams FileSystemRemoveParams;
    typedef FileSystemCreateDirectoryParams FileSystemCreateDirectoryParams__tdef;
    typedef FileSystemCreateFileParams FileSystemCreateFileParams__tdef;
    typedef FileSystemGetFileOrDirectoryParams FileSystemGetFileOrDirectoryParams__tdef;
    typedef FileSystemRemoveParams FileSystemRemoveParams__tdef;

    union Value {
        char VFileSystemCreateDirectoryParams[sizeof(FileSystemCreateDirectoryParams)];
        char VFileSystemCreateFileParams[sizeof(FileSystemCreateFileParams)];
        char VFileSystemGetFileOrDirectoryParams[sizeof(FileSystemGetFileOrDirectoryParams)];
        char VFileSystemRemoveParams[sizeof(FileSystemRemoveParams)];
    };

    
    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union PrefValue|
//
namespace mozilla {
namespace dom {
class PrefValue MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TnsCString = 1,
        Tint32_t,
        Tbool,
        T__Last = Tbool
    };

private:
    typedef nsCString nsCString__tdef;
    typedef int32_t int32_t__tdef;
    typedef bool bool__tdef;

    union Value {
        char VnsCString[sizeof(nsCString)];
        char Vint32_t[sizeof(int32_t)];
        char Vbool[sizeof(bool)];
    };

    
    
    ;

    ;

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PrefValue;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union MaybePrefValue|
//
namespace mozilla {
namespace dom {
class MaybePrefValue MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TPrefValue = 1,
        Tnull_t,
        T__Last = Tnull_t
    };

private:
    typedef mozilla::dom::PrefValue PrefValue;
    typedef mozilla::null_t null_t;
    typedef PrefValue PrefValue__tdef;
    typedef null_t null_t__tdef;

    union Value {
        char VPrefValue[sizeof(PrefValue)];
        char Vnull_t[sizeof(null_t)];
    };

    
    
    
    
    
    
    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class MaybePrefValue;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct PrefSetting|
//
namespace mozilla {
namespace dom {
class PrefSetting MOZ_FINAL
{
private:
    typedef mozilla::dom::MaybePrefValue MaybePrefValue;

    
    

    
    

private:
    ;

    ;

    nsCString name_;
    MaybePrefValue defaultValue_;
    MaybePrefValue userValue_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct DataStoreSetting|
//
namespace mozilla {
namespace dom {
class DataStoreSetting MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    nsString manifestURL_;
    bool readOnly_;
    bool enabled_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct VolumeInfo|
//
namespace mozilla {
namespace dom {
class VolumeInfo MOZ_FINAL
{
private:
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ClipboardCapabilities|
//
namespace mozilla {
namespace dom {
class ClipboardCapabilities MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

private:
    ;

    ;

    bool supportsSelectionClipboard_;
    bool supportsFindClipboard_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union MaybeFileDesc|
//
namespace mozilla {
namespace dom {
class MaybeFileDesc MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TFileDescriptor = 1,
        Tvoid_t,
        T__Last = Tvoid_t
    };

private:
    typedef mozilla::ipc::FileDescriptor FileDescriptor;
    typedef mozilla::void_t void_t;
    typedef FileDescriptor FileDescriptor__tdef;
    typedef void_t void_t__tdef;

    union Value {
        char VFileDescriptor[sizeof(FileDescriptor)];
        char Vvoid_t[sizeof(void_t)];
    };

    
    
    
    

    ;

    
    

public:
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union OptionalContentId|
//
namespace mozilla {
namespace dom {
class OptionalContentId MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TContentParentId = 1,
        Tvoid_t,
        T__Last = Tvoid_t
    };

private:
    typedef mozilla::dom::ContentParentId ContentParentId;
    typedef mozilla::void_t void_t;
    typedef ContentParentId ContentParentId__tdef;
    typedef void_t void_t__tdef;

    union Value {
        char VContentParentId[sizeof(ContentParentId)];
        char Vvoid_t[sizeof(void_t)];
    };

    
    
    
    

    ;

    
    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PContentChild and PContentParent
//
namespace mozilla {
namespace dom {
namespace PContent {

enum State {
    __Dead,
    __Null,
    __Error,
    __Dying,
    __Start = __Null
};

enum MessageType {
    PContentStart = PContentMsgStart << 16,
    Msg_PBrowserConstructor__ID,
    Reply_PBrowserConstructor__ID,
    Msg_PBlobConstructor__ID,
    Reply_PBlobConstructor__ID,
    Msg_SystemMemoryAvailable__ID,
    Msg_PreferenceUpdate__ID,
    Msg_NotifyAlertsObserver__ID,
    Msg_GeolocationUpdate__ID,
    Msg_GeolocationError__ID,
    Msg_UpdateDictionaryList__ID,
    Msg_AddPermission__ID,
    Msg_ScreenSizeChanged__ID,
    Msg_Volumes__ID,
    Msg_FlushMemory__ID,
    Msg_GarbageCollect__ID,
    Msg_CycleCollect__ID,
    Msg_ActivateA11y__ID,
    Msg_AppInfo__ID,
    Msg_LastPrivateDocShellDestroyed__ID,
    Msg_FilePathUpdate__ID,
    Msg_FileSystemUpdate__ID,
    Msg_NuwaFork__ID,
    Msg_NotifyProcessPriorityChanged__ID,
    Msg_MinimizeMemoryUsage__ID,
    Msg_LoadAndRegisterSheet__ID,
    Msg_UnregisterSheet__ID,
    Msg_NotifyPhoneStateChange__ID,
    Msg_NotifyIdleObserver__ID,
    Msg_OnAppThemeChanged__ID,
    Msg_AssociatePluginId__ID,
    Msg_LoadPluginResult__ID,
    Msg_StartProfiler__ID,
    Msg_StopProfiler__ID,
    Msg_GetProfile__ID,
    Reply_GetProfile__ID,
    Msg_NuwaFreeze__ID,
    Msg_Shutdown__ID,
    Msg_LoadProcessScript__ID,
    Msg_PDocAccessibleConstructor__ID,
    Reply_PDocAccessibleConstructor__ID,
    Msg_GetProcessAttributes__ID,
    Reply_GetProcessAttributes__ID,
    Msg_GetXPCOMProcessAttributes__ID,
    Reply_GetXPCOMProcessAttributes__ID,
    Msg_CreateChildProcess__ID,
    Reply_CreateChildProcess__ID,
    Msg_BridgeToChildProcess__ID,
    Reply_BridgeToChildProcess__ID,
    Msg_LoadPlugin__ID,
    Reply_LoadPlugin__ID,
    Msg_ConnectPluginBridge__ID,
    Reply_ConnectPluginBridge__ID,
    Msg_FindPlugins__ID,
    Reply_FindPlugins__ID,
    Msg_PJavaScriptConstructor__ID,
    Reply_PJavaScriptConstructor__ID,
    Msg_PRemoteSpellcheckEngineConstructor__ID,
    Reply_PRemoteSpellcheckEngineConstructor__ID,
    Msg_PDeviceStorageRequestConstructor__ID,
    Reply_PDeviceStorageRequestConstructor__ID,
    Msg_PFileSystemRequestConstructor__ID,
    Reply_PFileSystemRequestConstructor__ID,
    Msg_PCrashReporterConstructor__ID,
    Reply_PCrashReporterConstructor__ID,
    Msg_GetRandomValues__ID,
    Reply_GetRandomValues__ID,
    Msg_GetSystemMemory__ID,
    Msg_IsSecureURI__ID,
    Reply_IsSecureURI__ID,
    Msg_PHalConstructor__ID,
    Reply_PHalConstructor__ID,
    Msg_PMobileConnectionConstructor__ID,
    Reply_PMobileConnectionConstructor__ID,
    Msg_PNeckoConstructor__ID,
    Reply_PNeckoConstructor__ID,
    Msg_PPrintingConstructor__ID,
    Reply_PPrintingConstructor__ID,
    Msg_PScreenManagerConstructor__ID,
    Reply_PScreenManagerConstructor__ID,
    Msg_PCellBroadcastConstructor__ID,
    Reply_PCellBroadcastConstructor__ID,
    Msg_PSmsConstructor__ID,
    Reply_PSmsConstructor__ID,
    Msg_PSpeechSynthesisConstructor__ID,
    Reply_PSpeechSynthesisConstructor__ID,
    Msg_PStorageConstructor__ID,
    Reply_PStorageConstructor__ID,
    Msg_PTelephonyConstructor__ID,
    Reply_PTelephonyConstructor__ID,
    Msg_PVoicemailConstructor__ID,
    Reply_PVoicemailConstructor__ID,
    Msg_PBluetoothConstructor__ID,
    Reply_PBluetoothConstructor__ID,
    Msg_PFMRadioConstructor__ID,
    Reply_PFMRadioConstructor__ID,
    Msg_PAsmJSCacheEntryConstructor__ID,
    Reply_PAsmJSCacheEntryConstructor__ID,
    Msg_StartVisitedQuery__ID,
    Msg_VisitURI__ID,
    Msg_SetURITitle__ID,
    Msg_PrivateDocShellsExist__ID,
    Msg_FirstIdle__ID,
    Msg_AudioChannelGetState__ID,
    Reply_AudioChannelGetState__ID,
    Msg_AudioChannelRegisterType__ID,
    Reply_AudioChannelRegisterType__ID,
    Msg_AudioChannelUnregisterType__ID,
    Reply_AudioChannelUnregisterType__ID,
    Msg_AudioChannelChangedNotification__ID,
    Msg_AudioChannelChangeDefVolChannel__ID,
    Msg_DataStoreGetStores__ID,
    Reply_DataStoreGetStores__ID,
    Msg_FilePathUpdateNotify__ID,
    Msg_SystemMessageHandled__ID,
    Msg_NuwaReady__ID,
    Msg_NuwaWaitForFreeze__ID,
    Msg_AddNewProcess__ID,
    Reply_AddNewProcess__ID,
    Msg_CreateFakeVolume__ID,
    Msg_SetFakeVolumeState__ID,
    Msg_KeywordToURI__ID,
    Reply_KeywordToURI__ID,
    Msg_NotifyKeywordSearchLoading__ID,
    Reply_NotifyKeywordSearchLoading__ID,
    Msg_AllocateLayerTreeId__ID,
    Reply_AllocateLayerTreeId__ID,
    Msg_DeallocateLayerTreeId__ID,
    Msg_SpeakerManagerForceSpeaker__ID,
    Reply_SpeakerManagerForceSpeaker__ID,
    Msg_SpeakerManagerGetSpeakerStatus__ID,
    Reply_SpeakerManagerGetSpeakerStatus__ID,
    Msg_RecordingDeviceEvents__ID,
    Msg_GetGraphicsFeatureStatus__ID,
    Reply_GetGraphicsFeatureStatus__ID,
    Msg_AddIdleObserver__ID,
    Msg_RemoveIdleObserver__ID,
    Msg_BackUpXResources__ID,
    Msg_OpenAnonymousTemporaryFile__ID,
    Reply_OpenAnonymousTemporaryFile__ID,
    Msg_KeygenProcessValue__ID,
    Reply_KeygenProcessValue__ID,
    Msg_KeygenProvideContent__ID,
    Reply_KeygenProvideContent__ID,
    Msg_GetFileReferences__ID,
    Reply_GetFileReferences__ID,
    Msg_AllocateTabId__ID,
    Reply_AllocateTabId__ID,
    Msg_DeallocateTabId__ID,
    Msg_POfflineCacheUpdateConstructor__ID,
    Reply_POfflineCacheUpdateConstructor__ID,
    Msg_SetOfflinePermission__ID,
    Msg_FinishShutdown__ID,
    Msg_AsyncMessage__ID,
    PContentEnd
};

;

class Msg_PBrowserConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PBrowserConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_PBrowserConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Reply_PBrowserConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PBlobConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PBlobConstructor__ID
    };
    MOZ_IMPLICIT 
};

class Msg_GeolocationUpdate :
    public IPC::Message
{
public:

    
};

class Msg_UpdateDictionaryList :
    public IPC::Message
{
public:
    enum {
        ID = Msg_UpdateDictionaryList__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_AddPermission :
    public IPC::Message
{
public:
    enum {
        ID = Msg_AddPermission__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_ScreenSizeChanged :
    public IPC::Message
{
public:
};

class Msg_OnAppThemeChanged :
    public IPC::Message
{
public:
    enum {
        ID = Msg_OnAppThemeChanged__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_AssociatePluginId :
    public IPC::Message
{
public:
    enum {
        ID = Msg_AssociatePluginId__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_LoadPluginResult :
    public IPC::Message
{
public:
    enum {
        ID = Msg_LoadPluginResult__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_StartProfiler :
    public IPC::Message
{
public:
    enum {
        ID = Msg_StartProfiler__ID
    };
    MOZ_IMPLICIT 
};


class Msg_BridgeToChildProcess :
    public IPC::Message
{
public:
    enum {
        ID = Msg_BridgeToChildProcess__ID
    };
    MOZ_IMPLICIT 

    
};
class Msg_FindPlugins :
    public IPC::Message
{
public:

    
};

class Msg_PJavaScriptConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PJavaScriptConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_PJavaScriptConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Reply_PJavaScriptConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PRemoteSpellcheckEngineConstructor :
    public IPC::Message
{
public:
    
};

class Reply_IsSecureURI :
    public IPC::Message
{
public:
    enum {
        ID = Reply_IsSecureURI__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PHalConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PHalConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_PHalConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Reply_PHalConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PMobileConnectionConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PMobileConnectionConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_PMobileConnectionConstructor :
    public IPC::Message
{
    enum {
    };
    MOZ_IMPLICIT 

    
};

class Reply_PTelephonyConstructor :
    public IPC::Message
{
    MOZ_IMPLICIT 

    
};

class Reply_PVoicemailConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Reply_PVoicemailConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PBluetoothConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PBluetoothConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_PBluetoothConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Reply_PBluetoothConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PFMRadioConstructor :
    public IPC::Message
{
};

class Msg_AudioChannelGetState :
    public IPC::Message
{
public:
    enum {
        ID = Msg_AudioChannelGetState__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_AudioChannelGetState :
    public IPC::Message
{
public:
    enum {
        ID = Reply_AudioChannelGetState__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_AudioChannelRegisterType :
    public IPC::Message
{
public:
    enum {
        ID = Msg_AudioChannelRegisterType__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_AudioChannelRegisterType :
    public IPC::Message
{
public:
    enum {
        ID = Reply_AudioChannelRegisterType__ID
    };
    MOZ_IMPLICIT 

    
};
class Msg_AddNewProcess :
    public IPC::Message
{
    MOZ_IMPLICIT 

    
};

class Msg_CreateFakeVolume :
    public IPC::Message
{
public:
    enum {
        ID = Msg_CreateFakeVolume__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_SetFakeVolumeState :
    public IPC::Message
{
public:
    enum {
        ID = Msg_SetFakeVolumeState__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_KeywordToURI :
    public IPC::Message
{
    MOZ_IMPLICIT 

    
};

class Msg_NotifyKeywordSearchLoading :
    public IPC::Message
{
};

class Reply_AllocateLayerTreeId :
    public IPC::Message
{
public:
    enum {
        ID = Reply_AllocateLayerTreeId__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_DeallocateLayerTreeId :
    public IPC::Message
{
    enum {
        ID = Msg_RecordingDeviceEvents__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_GetGraphicsFeatureStatus :
    public IPC::Message
{
public:
    enum {
        ID = Msg_GetGraphicsFeatureStatus__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_GetGraphicsFeatureStatus :
    public IPC::Message
{
    MOZ_IMPLICIT 

    
};

class Msg_RemoveIdleObserver :
    public IPC::Message
{
public:
    enum {
        ID = Msg_RemoveIdleObserver__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_BackUpXResources :
    public IPC::Message
{
public:
    enum {
    };
    MOZ_IMPLICIT 

    
};

class Reply_KeygenProvideContent :
    public IPC::Message
{
public:

    
};

class Reply_GetFileReferences :
    public IPC::Message
{
public:
    enum {
        ID = Reply_GetFileReferences__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_AllocateTabId :
    public IPC::Message
{
public:
    enum {
        ID = Msg_AllocateTabId__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_AllocateTabId :
    public IPC::Message
{
public:
    
};



} // namespace PContent
} // namespace dom
} // namespace mozilla

#endif // ifndef PContent_h
# 11445 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContent.h"
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h" 2
#ifdef DEBUG
#if 0 /* expanded by -frewrite-includes */
#include "prenv.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h"
#endif // DEBUG
# 13 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/id_map.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/id_map.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_ID_MAP_H__
#define BASE_ID_MAP_H__

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/id_map.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/hash_tables.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/id_map.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/logging.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/id_map.h"

// This object maintains a list of IDs that can be quickly converted to
// pointers to objects. It is implemented as a hash table, optimized for
// relatively small data sets (in the common case, there will be exactly one
// item in the list).
//
// Items can be inserted into the container with arbitrary ID, but the caller
// must ensure they are unique. Inserting IDs and relying on automatically
// generated ones is not allowed because they can collide.
template<class T>
class IDMap {
 private:
  typedef base::hash_map<int32_t, T*> HashTable;
  typedef typename HashTable::iterator iterator;

 public:
  // support const iterators over the items
  // Note, use iterator->first to get the ID, iterator->second to get the T*
  typedef typename HashTable::const_iterator const_iterator;

  
  

  

  

  

  

 protected:
  // The next ID that we will return from Add()
  int32_t next_id_;

  HashTable data_;
};


#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/ipc/MessageChannel.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/message_loop.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/ipc/MessageChannel.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/ipc/MessageChannel.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Monitor.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/ipc/MessageChannel.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/ipc/MessageChannel.h"

#if 0 /* expanded by -frewrite-includes */
#include <deque>
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/mozilla/ipc/MessageChannel.h"
#if 0 /* expanded by -frewrite-includes */
#include <stack>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack" 1 3
// -*- C++ -*-
//===---------------------------- stack -----------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_STACK
#define _LIBCPP_STACK

/*
    stack synopsis

namespace std
}  // std

*/

#if 0 /* expanded by -frewrite-includes */
#include <__config>
#endif /* expanded by -frewrite-includes */
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack" 3
#if 0 /* expanded by -frewrite-includes */
#include <deque>
#endif /* expanded by -frewrite-includes */
# 87 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack" 3
#endif
# 91 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Tp, class _Container> class _LIBCPP_TYPE_VIS_ONLY stack;

template <class _Tp, class _Container>
_LIBCPP_INLINE_VISIBILITY
bool
operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);

template <class _Tp, class _Container>
_LIBCPP_INLINE_VISIBILITY
bool
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y);

template <class _Tp, class _Container = deque<_Tp> >
class _LIBCPP_TYPE_VIS_ONLY stack
{
public:
    typedef _Container                               container_type;
    typedef typename container_type::value_type      value_type;
    typedef typename container_type::reference       reference;
    typedef typename container_type::const_reference const_reference;
    typedef typename container_type::size_type       size_type;

protected:
    container_type c;


    _LIBCPP_INLINE_VISIBILITY
    stack& operator=(const stack& __q) {c = __q.c; return *this;}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    stack& operator=(stack&& __q)
        _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
        {c = _VSTD::move(__q.c); return *this;}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 144 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack" 3

    _LIBCPP_INLINE_VISIBILITY
    explicit stack(const container_type& __c) : c(__c) {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 151 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack" 3
    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        explicit stack(const _Alloc& __a,
                       typename enable_if<uses_allocator<container_type,
                                                         _Alloc>::value>::type* = 0)
            : c(__a) {}
    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        stack(const container_type& __c, const _Alloc& __a,
              typename enable_if<uses_allocator<container_type,
                                                _Alloc>::value>::type* = 0)
            : c(__c, __a) {}
    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        stack(const stack& __s, const _Alloc& __a,
              typename enable_if<uses_allocator<container_type,
                                                _Alloc>::value>::type* = 0)
            : c(__s.c, __a) {}
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        stack(container_type&& __c, const _Alloc& __a,
              typename enable_if<uses_allocator<container_type,
                                                _Alloc>::value>::type* = 0)
            : c(_VSTD::move(__c), __a) {}
    template <class _Alloc>
        _LIBCPP_INLINE_VISIBILITY
        stack(stack&& __s, const _Alloc& __a,
              typename enable_if<uses_allocator<container_type,
                                                _Alloc>::value>::type* = 0)
            : c(_VSTD::move(__s.c), __a) {}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 183 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack" 3

    _LIBCPP_INLINE_VISIBILITY
    bool empty()     const      {return c.empty();}
    _LIBCPP_INLINE_VISIBILITY
    size_type size() const      {return c.size();}
    _LIBCPP_INLINE_VISIBILITY
    reference top()             {return c.back();}
    _LIBCPP_INLINE_VISIBILITY
    const_reference top() const {return c.back();}

    _LIBCPP_INLINE_VISIBILITY
    void push(const value_type& __v) {c.push_back(__v);}
    void swap(stack& __s)
        _NOEXCEPT_(__is_nothrow_swappable<container_type>::value)
    {
        using _VSTD::swap;
        swap(c, __s.c);
    }

    ;

    ;
};

template <class _Tp, class _Container>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator==(const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
{
    return __x.c == __y.c;
}

template <class _Tp, class _Container>
inline _LIBCPP_INLINE_VISIBILITY
bool
operator< (const stack<_Tp, _Container>& __x, const stack<_Tp, _Container>& __y)
{
    return __x.c < __y.c;
}











template <class _Tp, class _Container, class _Alloc>
struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<stack<_Tp, _Container>, _Alloc>
    : public uses_allocator<_Container, _Alloc>
{
};

_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_STACK
# 293 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stack" 3
# 24 "../../dist/include/mozilla/ipc/MessageChannel.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <math.h>
#endif /* expanded by -frewrite-includes */
# 25 "../../dist/include/mozilla/ipc/MessageChannel.h"

namespace mozilla {
namespace ipc {

class MessageChannel;

class RefCountedMonitor : public Monitor
{
  public:
    

    NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RefCountedMonitor)

  private:
    ~RefCountedMonitor() {}
};

class MessageChannel : HasResultCodes
{
    friend class ProcessLink;
    friend class ThreadLink;

    class CxxStackFrame;
    class InterruptFrame;

    typedef mozilla::Monitor Monitor;

  public:
    static const int32_t kNoTimeout;

    typedef IPC::Message Message;
    typedef mozilla::ipc::Transport Transport;

  private:
    // Can be run on either thread
    

    // The "link" thread is either the I/O thread (ProcessLink) or the
    // other actor's work thread (ThreadLink).  In either case, it is
    // NOT our worker thread.
    

  private:
    typedef IPC::Message::msgid_t msgid_t;
    typedef std::deque<Message> MessageQueue;
    typedef std::map<size_t, Message> MessageMap;

    // All dequeuing tasks require a single point of cancellation,
    // which is handled via a reference-counted task.
    class RefCountedTask
    {
      public:
        
      private:
        ~RefCountedTask() { delete mTask; }
      public:
        
        

        NS_INLINE_DECL_THREADSAFE_REFCOUNTING(RefCountedTask)

      private:
        CancelableTask* mTask;
    };

    // Wrap an existing task which can be cancelled at any time
    // without the wrapper's knowledge.
    class DequeueTask : public Task
    {
      public:
        
        

      private:
        nsRefPtr<RefCountedTask> mTask;
    };

  private:
    mozilla::WeakPtr<MessageListener> mListener;
    ChannelState mChannelState;
    nsRefPtr<RefCountedMonitor> mMonitor;
    Side mSide;
    MessageLink* mLink;
    MessageLoop* mWorkerLoop;           // thread where work is done
    CancelableTask* mChannelErrorTask;  // NotifyMaybeChannelError runnable

    // id() of mWorkerLoop.  This persists even after mWorkerLoop is cleared
    // during channel shutdown.
    int mWorkerLoopID;

    // A task encapsulating dequeuing one pending message.
    // chain of RPC/urgent messages, it allocates a new transaction ID. Any
    // messages the parent receives, not apart of this transaction, are
    // deferred. When issuing RPC/urgent requests on top of a started
    // transaction, the initiating transaction ID is used.
    //
    // To ensure IDs are unique, we use sequence numbers for transaction IDs,
    // which grow in opposite directions from child to parent.

    // The current transaction ID.
    int32_t mCurrentTransaction;

    class AutoEnterTransaction
    {
      public:
       
       
       

      private:
       MessageChannel *mChan;
       int32_t mOldTransaction;
    };

    // If a sync message times out, we store its sequence number here. Any
    // future sync messages will fail immediately. Once the reply for original
    // sync message is received, we allow sync messages again.
    //
    // When a message times out, nothing is done to inform the other side. The
    // other side will eventually dispatch the message and send a reply. Our
    // side is responsible for replying to all sync messages sent by the other
    // side when it dispatches the timed out message. The response is always an
    // error.
    //
    // A message is only timed out if it initiated a transaction. This avoids
    // hitting a lot of corner cases with message nesting that we don't really
    // care about.
    int32_t mTimedOutMessageSeqno;

    // If waiting for the reply to a sync out-message, it will be saved here
    // on the I/O thread and then read and cleared by the worker thread.
    nsAutoPtr<Message> mRecvd;

    int32_t mPeerPid;
};

;

} // namespace ipc
} // namespace mozilla

#endif  // ifndef ipc_glue_MessageChannel_h
# 721 "../../dist/include/mozilla/ipc/MessageChannel.h"
# 15 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h" 2

class nsIFile;


namespace mozilla {
namespace layers {
class PSharedBufferManagerParent;
} // namespace layers
} // namespace mozilla


namespace mozilla {
class PProcessHangMonitorParent;
} // namespace mozilla


namespace mozilla {
namespace ipc {
class PBackgroundParent;
} // namespace ipc
} // namespace mozilla


namespace mozilla {
namespace layers {
class PCompositorParent;
} // namespace layers
} // namespace mozilla


namespace mozilla {
namespace layers {
class PImageBridgeParent;
} // namespace layers
} // namespace mozilla

// Headers for things that cannot be forward declared
#if 0 /* expanded by -frewrite-includes */
#include "AudioChannelCommon.h"
#endif /* expanded by -frewrite-includes */
# 53 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/process.h"
#endif /* expanded by -frewrite-includes */
# 54 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/process_util.h"
#endif /* expanded by -frewrite-includes */
# 55 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/HalTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/HalTypes.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_hal_Types_h
#define mozilla_hal_Types_h

#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/HalTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Observer.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Observer.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_Observer_h
#define mozilla_Observer_h

#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/Observer.h"

namespace mozilla {

/**
 * 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.
 */
template<class T>
class Observer
{
public:
  
  ;
};

/**
 * ObserverList<T> tracks Observer<T> and can notify them when Broadcast() is
 * called.
 * T represents the type of the object passed in argument to Broadcast() and
 * sent to Observer<T> objects through Notify().
 *
 * @see Observer.
 */
template<class T>
class ObserverList
{
public:
  /**
   * Note: When calling AddObserver, it's up to the caller to make sure the
   * object isn't going to be release as long as RemoveObserver hasn't been
   * called.
   *
   * @see RemoveObserver()
   */
  

  /**
   * Remove the observer from the observer list.
   * @return Whether the observer has been found in the list.
   */
  

  

  

protected:
  nsTArray<Observer<T>*> mObservers;
};

} // namespace mozilla

#endif // mozilla_Observer_h
# 83 "../../dist/include/mozilla/Observer.h"
# 11 "../../dist/include/mozilla/HalTypes.h" 2

namespace mozilla {
namespace hal {

/**
 * These constants specify special values for content process IDs.  You can get
 * a content process ID by calling ContentChild::GetID() or
 * ContentParent::GetChildID().
 */
const uint64_t CONTENT_PROCESS_ID_UNKNOWN = uint64_t(-1);
const uint64_t CONTENT_PROCESS_ID_MAIN = 0;

/**
 * These are defined by libhardware, specifically, hardware/libhardware/include/hardware/lights.h
 * in the gonk subsystem.
 * If these change and are exposed to JS, make sure nsIHal.idl is updated as well.
 */
enum ShutdownMode {
  eHalShutdownMode_Unknown  = -1,
  eHalShutdownMode_PowerOff = 0,
  eHalShutdownMode_Reboot   = 1,
  eHalShutdownMode_Restart  = 2,
  eHalShutdownMode_Count    = 3
};

class SwitchEvent;

enum SwitchDevice {
  SWITCH_DEVICE_UNKNOWN = -1,
  SWITCH_HEADPHONES,
  SWITCH_USB,
  NUM_SWITCH_DEVICE
};

enum SwitchState {
  SWITCH_STATE_UNKNOWN = -1,
  SWITCH_STATE_ON,
  SWITCH_STATE_OFF,
  SWITCH_STATE_HEADSET,          // Headphone with microphone
  SWITCH_STATE_HEADPHONE,        // without microphone
  NUM_SWITCH_STATE
};

typedef Observer<SwitchEvent> SwitchObserver;

// Note that we rely on the order of this enum's entries.  Higher priorities
// should have larger int values.
enum ProcessPriority {
  PROCESS_PRIORITY_UNKNOWN = -1,
  PROCESS_PRIORITY_BACKGROUND,
  PROCESS_PRIORITY_BACKGROUND_HOMESCREEN,
  PROCESS_PRIORITY_BACKGROUND_PERCEIVABLE,
  PROCESS_PRIORITY_FOREGROUND_KEYBOARD,
  // The special class for the preallocated process, high memory priority but
  // low CPU priority.
  PROCESS_PRIORITY_PREALLOC,
  // Any priority greater than or equal to FOREGROUND is considered
  // "foreground" for the purposes of priority testing, for example
  // CurrentProcessIsForeground().
  PROCESS_PRIORITY_FOREGROUND,
  PROCESS_PRIORITY_FOREGROUND_HIGH,
  PROCESS_PRIORITY_MASTER,
  NUM_PROCESS_PRIORITY
};

/**
 * Values that can be passed to hal::SetCurrentThreadPriority().  These should be
 * functional in nature, such as COMPOSITOR, instead of levels, like LOW/HIGH.
 * This allows us to tune our priority scheme for the system in one place such
 * that it makes sense holistically for the overall operating system.  On gonk
 * or android we may want different priority schemes than on windows, etc.
 */
enum ThreadPriority {
  THREAD_PRIORITY_COMPOSITOR,
  NUM_THREAD_PRIORITY
};

/**

/**
 * Used by ModifyWakeLock
 */
enum WakeLockControl {
  WAKE_LOCK_REMOVE_ONE = -1,
  WAKE_LOCK_NO_CHANGE  = 0,
  WAKE_LOCK_ADD_ONE    = 1,
  NUM_WAKE_LOCK
};

class FMRadioOperationInformation;

enum FMRadioOperation {
  FM_RADIO_OPERATION_UNKNOWN = -1,
  FM_RADIO_OPERATION_ENABLE,
  FM_RADIO_OPERATION_DISABLE,
  FM_RADIO_OPERATION_SEEK,
  FM_RADIO_OPERATION_TUNE,
  NUM_FM_RADIO_OPERATION
};

enum FMRadioOperationStatus {
  FM_RADIO_OPERATION_STATUS_UNKNOWN = -1,
  FM_RADIO_OPERATION_STATUS_SUCCESS,
  FM_RADIO_OPERATION_STATUS_FAIL,
  NUM_FM_RADIO_OPERATION_STATUS
};

enum FMRadioSeekDirection {
  FM_RADIO_SEEK_DIRECTION_UNKNOWN = -1,
  FM_RADIO_SEEK_DIRECTION_UP,
  FM_RADIO_SEEK_DIRECTION_DOWN,
  NUM_FM_RADIO_SEEK_DIRECTION
};

enum FMRadioCountry {
  FM_RADIO_COUNTRY_UNKNOWN = -1,
  FM_RADIO_COUNTRY_US,  //USA
  FM_RADIO_COUNTRY_EU,
  FM_RADIO_COUNTRY_CZ,  //Czech Republic
  FM_RADIO_COUNTRY_UK,  //United Kingdom of Great Britain and Northern Ireland
  FM_RADIO_COUNTRY_RW,  //Rwandese Republic
  FM_RADIO_COUNTRY_SN,  //Senegal
  FM_RADIO_COUNTRY_SG,  //Singapore
  FM_RADIO_COUNTRY_SI,  //Slovenia
  FM_RADIO_COUNTRY_ZA,  //South Africa
  FM_RADIO_COUNTRY_SE,  //Sweden
  FM_RADIO_COUNTRY_CH,  //Switzerland
  FM_RADIO_COUNTRY_TW,  //Taiwan
  FM_RADIO_COUNTRY_TR,  //Turkey
  FM_RADIO_COUNTRY_UA,  //Ukraine
  FM_RADIO_COUNTRY_USER_DEFINED,
  NUM_FM_RADIO_COUNTRY
};

class FMRadioRDSGroup;
typedef Observer<FMRadioOperationInformation> FMRadioObserver;
typedef Observer<FMRadioRDSGroup> FMRadioRDSObserver;
} // namespace hal
} // namespace mozilla

namespace IPC {

/**
 * Serializer for ShutdownMode.
 */
template <>
struct ParamTraits<mozilla::hal::ShutdownMode>
  : public ContiguousEnumSerializer<
             mozilla::hal::ShutdownMode,
             mozilla::hal::eHalShutdownMode_Unknown,
             mozilla::hal::eHalShutdownMode_Count>
{};

/**
 * WakeLockControl serializer.
 */
template <>
struct ParamTraits<mozilla::hal::WakeLockControl>
  : public ContiguousEnumSerializer<
             mozilla::hal::WakeLockControl,
             mozilla::hal::WAKE_LOCK_REMOVE_ONE,
             mozilla::hal::NUM_WAKE_LOCK>
{};

/**
 * Serializer for SwitchState
 */
template <>
struct ParamTraits<mozilla::hal::SwitchState>:
  public ContiguousEnumSerializer<
           mozilla::hal::SwitchState,
           mozilla::hal::SWITCH_STATE_UNKNOWN,
           mozilla::hal::NUM_SWITCH_STATE> {
};

/**
 * Serializer for SwitchDevice
 */
template <>
struct ParamTraits<mozilla::hal::SwitchDevice>:
  public ContiguousEnumSerializer<
           mozilla::hal::SwitchDevice,
           mozilla::hal::SWITCH_DEVICE_UNKNOWN,
           mozilla::hal::NUM_SWITCH_DEVICE> {
};

template <>
struct ParamTraits<mozilla::hal::ProcessPriority>:
  public ContiguousEnumSerializer<
           mozilla::hal::ProcessPriority,
           mozilla::hal::PROCESS_PRIORITY_UNKNOWN,
           mozilla::hal::NUM_PROCESS_PRIORITY> {
};

/**
 * Serializer for FMRadioOperation
 */
template <>
struct ParamTraits<mozilla::hal::FMRadioOperation>:
  public ContiguousEnumSerializer<
           mozilla::hal::FMRadioOperation,
           mozilla::hal::FM_RADIO_OPERATION_UNKNOWN,
           mozilla::hal::NUM_FM_RADIO_OPERATION>
{};

/**
           mozilla::hal::FMRadioSeekDirection,
           mozilla::hal::FM_RADIO_SEEK_DIRECTION_UNKNOWN,
           mozilla::hal::NUM_FM_RADIO_SEEK_DIRECTION>
{};

/**
 * Serializer for FMRadioCountry
 **/
template <>
struct ParamTraits<mozilla::hal::FMRadioCountry>:
  public ContiguousEnumSerializer<
           mozilla::hal::FMRadioCountry,
           mozilla::hal::FM_RADIO_COUNTRY_UNKNOWN,
           mozilla::hal::NUM_FM_RADIO_COUNTRY>
{};

} // namespace IPC

#endif // mozilla_hal_Types_h
# 301 "../../dist/include/mozilla/HalTypes.h"
# 56 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/AudioChannelBinding.h"
#endif /* expanded by -frewrite-includes */
# 57 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/PContentBridgeParent.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentBridgeParent.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PContentBridgeParent_h
#define PContentBridgeParent_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/PContentBridge.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentBridge.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PContentBridge_h
#define PContentBridge_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#include "mozilla/dom/DOMTypes.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentBridge.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/jsipc/JavaScriptTypes.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentBridge.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/PTabContext.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentBridge.h"

namespace mozilla {
namespace dom {
class PContentParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PContentParent;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PContentBridgeChild and PContentBridgeParent
//
namespace mozilla {
namespace dom {
namespace PContentBridge {

;

enum State {
    __Dead,
    __Null,
    __Error,
    __Dying,
    __Start = __Null
};

enum MessageType {
    PContentBridgeStart = PContentBridgeMsgStart << 16,
    Msg_SyncMessage__ID,
    Reply_SyncMessage__ID,
    Msg_PBrowserConstructor__ID,
    Reply_PBrowserConstructor__ID,
    Msg_PBlobConstructor__ID,
    Reply_PBlobConstructor__ID,
    Msg_PJavaScriptConstructor__ID,
    Reply_PJavaScriptConstructor__ID,
    Msg_AsyncMessage__ID,
    PContentBridgeEnd
};

;

class Msg_SyncMessage :
    public IPC::Message
{
public:
    enum {
        ID = Msg_SyncMessage__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_SyncMessage :
    public IPC::Message
{
public:
    enum {
        ID = Reply_SyncMessage__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PBrowserConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PBrowserConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_PBrowserConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Reply_PBrowserConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PBlobConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PBlobConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_PBlobConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Reply_PBlobConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PJavaScriptConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PJavaScriptConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_PJavaScriptConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Reply_PJavaScriptConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_AsyncMessage :
    public IPC::Message
{
public:
    enum {
        ID = Msg_AsyncMessage__ID
    };
    MOZ_IMPLICIT 

    
};



} // namespace PContentBridge
} // namespace dom
} // namespace mozilla

#endif // ifndef PContentBridge_h
# 358 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentBridge.h"
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentBridgeParent.h" 2
class nsIFile;

// Headers for things that cannot be forward declared
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ipc/IdType.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentBridgeParent.h"

namespace mozilla {
namespace dom {
class PBlobParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PBlobChild;
class PContentParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PContentChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class PJavaScriptParent;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class PJavaScriptChild;
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBlobParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class PJavaScriptParent;
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBrowserParent;
} // namespace dom
} // namespace mozilla

namespace IPC {
class Principal;
} // namespace IPC

namespace mozilla {
namespace dom {


class /*NS_ABSTRACT_CLASS*/ PContentBridgeParent :
    public mozilla::ipc::IProtocol,
    protected mozilla::ipc::IProtocolManager<mozilla::ipc::IProtocol>,
    public mozilla::ipc::IToplevelProtocol
{
    friend class mozilla::dom::PBlobParent;

    friend class mozilla::jsipc::PJavaScriptParent;

    friend class mozilla::dom::PBrowserParent;

protected:
    typedef mozilla::ipc::ActorHandle ActorHandle;
    typedef mozilla::dom::AnyBlobConstructorParams AnyBlobConstructorParams;
    typedef mozilla::dom::AppFrameIPCTabContext AppFrameIPCTabContext;
    typedef mozilla::dom::BlobConstructorParams BlobConstructorParams;
    typedef mozilla::dom::BlobData BlobData;
    typedef mozilla::dom::BrowserFrameIPCTabContext BrowserFrameIPCTabContext;
    typedef mozilla::dom::ChildBlobConstructorParams ChildBlobConstructorParams;
    typedef mozilla::dom::ClonedMessageData ClonedMessageData;
    typedef mozilla::dom::ContentParentId ContentParentId;
    typedef mozilla::jsipc::CpowEntry CpowEntry;
    typedef mozilla::dom::FileBlobConstructorParams FileBlobConstructorParams;
    typedef mozilla::ipc::FileDescriptor FileDescriptor;
    typedef mozilla::jsipc::GetterSetter GetterSetter;
    typedef mozilla::dom::IPCTabAppBrowserContext IPCTabAppBrowserContext;
    typedef mozilla::dom::IPCTabContext IPCTabContext;
    typedef mozilla::jsipc::JSIDVariant JSIDVariant;
    typedef mozilla::jsipc::JSIID JSIID;
    typedef mozilla::jsipc::JSParam JSParam;
    typedef mozilla::jsipc::JSVariant JSVariant;
    typedef mozilla::dom::KnownBlobConstructorParams KnownBlobConstructorParams;
    typedef mozilla::jsipc::LocalObject LocalObject;
    typedef mozilla::dom::MysteryBlobConstructorParams MysteryBlobConstructorParams;
    typedef mozilla::dom::NormalBlobConstructorParams NormalBlobConstructorParams;
    typedef mozilla::jsipc::NullVariant NullVariant;
    typedef mozilla::jsipc::ObjectOrNullVariant ObjectOrNullVariant;
    typedef mozilla::jsipc::ObjectVariant ObjectVariant;
    typedef mozilla::dom::OptionalBlobData OptionalBlobData;
    typedef mozilla::dom::OptionalID OptionalID;
    typedef mozilla::dom::PBrowserOrId PBrowserOrId;
    typedef mozilla::jsipc::PPropertyDescriptor PPropertyDescriptor;
    typedef mozilla::dom::ParentBlobConstructorParams ParentBlobConstructorParams;
    typedef mozilla::dom::PopupIPCTabContext PopupIPCTabContext;
    typedef IPC::Principal Principal;
    typedef base::ProcessId ProcessId;
    typedef mozilla::ipc::ProtocolId ProtocolId;
    typedef mozilla::jsipc::RegisteredSymbol RegisteredSymbol;
    typedef mozilla::jsipc::RemoteObject RemoteObject;
    typedef mozilla::jsipc::ReturnException ReturnException;
    typedef mozilla::jsipc::ReturnObjectOpResult ReturnObjectOpResult;
    typedef mozilla::jsipc::ReturnStatus ReturnStatus;
    typedef mozilla::jsipc::ReturnStopIteration ReturnStopIteration;
    typedef mozilla::jsipc::ReturnSuccess ReturnSuccess;
    typedef mozilla::dom::SameProcessBlobConstructorParams SameProcessBlobConstructorParams;
    typedef mozilla::SerializedStructuredCloneBuffer SerializedStructuredCloneBuffer;
    typedef mozilla::ipc::Shmem Shmem;
    typedef mozilla::dom::SlicedBlobConstructorParams SlicedBlobConstructorParams;
    typedef mozilla::jsipc::SymbolVariant SymbolVariant;
    typedef mozilla::dom::TabId TabId;
    typedef mozilla::ipc::Transport Transport;
    typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
    typedef mozilla::jsipc::UndefinedVariant UndefinedVariant;
    typedef mozilla::dom::VanillaFrameIPCTabContext VanillaFrameIPCTabContext;
    typedef mozilla::jsipc::WellKnownSymbol WellKnownSymbol;
    typedef mozilla::void_t void_t;
    typedef mozilla::dom::PBlobParent PBlobParent;
    typedef mozilla::dom::PBlobChild PBlobChild;
    typedef mozilla::dom::PBrowserParent PBrowserParent;
    typedef mozilla::dom::PBrowserChild PBrowserChild;
    typedef mozilla::dom::PContentParent PContentParent;
    typedef mozilla::dom::PContentChild PContentChild;
    typedef mozilla::jsipc::PJavaScriptParent PJavaScriptParent;
    typedef mozilla::jsipc::PJavaScriptChild PJavaScriptChild;

    typedef PContentBridge::State State;

    ;
    ;
    ;
    ;
    ;
public:
    typedef mozilla::ipc::IProtocol ProtocolBase;
    typedef IPC::Message Message;
    typedef mozilla::ipc::MessageChannel Channel;
    typedef mozilla::ipc::MessageListener ChannelListener;
    typedef base::ProcessHandle ProcessHandle;
    typedef mozilla::ipc::MessageChannel MessageChannel;
    typedef mozilla::ipc::SharedMemory SharedMemory;
    typedef mozilla::ipc::Trigger Trigger;
    typedef mozilla::ipc::ProtocolCloneContext ProtocolCloneContext;

public:
    MOZ_IMPLICIT ;

    ;


    ;

    PBrowserParent*
    SendPBrowserConstructor(
            const TabId& tabId,
            const IPCTabContext& context,
            const uint32_t& chromeFlags,
            const ContentParentId& cpId,
            const bool& isForApp,
            const bool& isForBrowser) NS_WARN_UNUSED_RESULT;

    PBrowserParent*
    SendPBrowserConstructor(
            PBrowserParent* actor,
            const TabId& tabId,
            const IPCTabContext& context,
            const uint32_t& chromeFlags,
            const ContentParentId& cpId,
            const bool& isForApp,
            const bool& isForBrowser) NS_WARN_UNUSED_RESULT;

    PBlobParent*
    SendPBlobConstructor(const BlobConstructorParams& params) NS_WARN_UNUSED_RESULT;

    PBlobParent*
    SendPBlobConstructor(
            PBlobParent* actor,
            const BlobConstructorParams& params) NS_WARN_UNUSED_RESULT;

    PJavaScriptParent*
    SendPJavaScriptConstructor() NS_WARN_UNUSED_RESULT;
    ;

    ;

    ;

    bool
    Read(
            PBlobParent** __v,
            const Message* __msg,
            void** __iter,
            bool __nullable) NS_WARN_UNUSED_RESULT;

    ;

    bool
    ;

    bool
    Read(
            OptionalBlobData* __v,
            const Message* __msg,
            void** __iter) NS_WARN_UNUSED_RESULT;

    ;

    bool
    Read(
            AppFrameIPCTabContext* __v,
            const Message* __msg,
            void** __iter) NS_WARN_UNUSED_RESULT;

    Channel mChannel;
    IDMap<ProtocolBase> mActorMap;
    int32_t mLastRouteId;
    ProcessHandle mOtherProcess;
    IDMap<Shmem::SharedMemory> mShmemMap;
    Shmem::id_t mLastShmemId;
    State mState;
    // Sorted by pointer value
    nsTArray<PBlobParent*> mManagedPBlobParent;
    // Sorted by pointer value
    nsTArray<PBrowserParent*> mManagedPBrowserParent;
    // Sorted by pointer value
    nsTArray<PJavaScriptParent*> mManagedPJavaScriptParent;
};


} // namespace dom
} // namespace mozilla

#if 0
{
    return false;
}

void
ContentBridgeParent::ActorDestroy(ActorDestroyReason aWhy)
{
}

#include "AudioChannelCommon.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/TabMessageUtils.h"

#ifdef MOZ_CRASHREPORTER
#if 0 /* expanded by -frewrite-includes */
#include "nsExceptionHandler.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/TabMessageUtils.h"
#endif
# 18 "../../dist/include/mozilla/dom/TabMessageUtils.h"

namespace mozilla {
namespace dom {
struct RemoteDOMEvent
{
  // Make sure to set the owner after deserializing.
  nsCOMPtr<nsIDOMEvent> mEvent;
};

;

#ifdef MOZ_CRASHREPORTER
typedef CrashReporter::ThreadId NativeThreadId;
#else
# 33 "../../dist/include/mozilla/dom/TabMessageUtils.h"
// unused in this case
typedef int32_t NativeThreadId;
#endif
# 36 "../../dist/include/mozilla/dom/TabMessageUtils.h"

}
}

namespace IPC {

template<>
struct ParamTraits<mozilla::dom::RemoteDOMEvent>
{
  typedef mozilla::dom::RemoteDOMEvent paramType;

  

  

  
};

template<>
struct ParamTraits<mozilla::dom::AudioChannel>
{
  typedef mozilla::dom::AudioChannel paramType;

  

  

  

  
};

template <>
struct ParamTraits<mozilla::dom::AudioChannelState>
  : public ContiguousEnumSerializer<mozilla::dom::AudioChannelState,
                                    mozilla::dom::AUDIO_CHANNEL_STATE_NORMAL,
                                    mozilla::dom::AUDIO_CHANNEL_STATE_LAST>
{ };

}


#endif
# 102 "../../dist/include/mozilla/dom/TabMessageUtils.h"
# 59 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/asmjscache/AsmJSCache.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/asmjscache/AsmJSCache.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_asmjscache_asmjscache_h
#define mozilla_dom_asmjscache_asmjscache_h

#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/asmjscache/AsmJSCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/asmjscache/AsmJSCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/Vector.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/asmjscache/AsmJSCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "jsapi.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/asmjscache/AsmJSCache.h"

class nsIPrincipal;

namespace mozilla {
namespace dom {

namespace quota {
class Client;
}

namespace asmjscache {

class PAsmJSCacheEntryChild;
class PAsmJSCacheEntryParent;

enum OpenMode
{
  eOpenForRead,
  eOpenForWrite,
  NUM_OPEN_MODES
};

// Each origin stores a fixed size (kNumEntries) LRU cache of compiled asm.js
// modules. Each compiled asm.js module is stored in a separate file with one
// extra metadata file that stores the LRU cache and enough information for a
// client to pick which cached module's file to open.
struct Metadata
{
  static const unsigned kNumEntries = 16;
  static const unsigned kLastEntry = kNumEntries - 1;

  struct Entry
  {
    uint32_t mFastHash;
    uint32_t mNumChars;
    uint32_t mFullHash;
    unsigned mModuleIndex;

    
  };

  Entry mEntries[kNumEntries];
};

// Parameters specific to opening a cache entry for writing
struct WriteParams
{
  int64_t mSize;
  int64_t mFastHash;
  int64_t mNumChars;
  int64_t mFullHash;
  bool mInstalled;

  
};

// Parameters specific to opening a cache entry for reading
struct ReadParams
{
  const char16_t* mBegin;
  const char16_t* mLimit;

  
};

// Implementation of AsmJSCacheOps, installed for the main JSRuntime by

} // namespace asmjscache
} // namespace dom
} // namespace mozilla

namespace IPC {

template <>
struct ParamTraits<mozilla::dom::asmjscache::OpenMode> :
  public ContiguousEnumSerializer<mozilla::dom::asmjscache::OpenMode,
                                  mozilla::dom::asmjscache::eOpenForRead,
                                  mozilla::dom::asmjscache::NUM_OPEN_MODES>
{ };

template <>
struct ParamTraits<mozilla::dom::asmjscache::Metadata>
{
  typedef mozilla::dom::asmjscache::Metadata paramType;
  ;
  ;
  ;
};

template <>
struct ParamTraits<mozilla::dom::asmjscache::WriteParams>
{
  typedef mozilla::dom::asmjscache::WriteParams paramType;
  ;
  ;
  ;
};

template <>
struct ParamTraits<JS::AsmJSCacheResult> :
  public ContiguousEnumSerializer<JS::AsmJSCacheResult,
                                  JS::AsmJSCache_MIN,
                                  JS::AsmJSCache_LIMIT>
{ };

} // namespace IPC

#endif  // mozilla_dom_asmjscache_asmjscache_h
# 191 "../../dist/include/mozilla/dom/asmjscache/AsmJSCache.h"
# 60 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/indexedDB/SerializationHelpers.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/indexedDB/SerializationHelpers.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_indexeddb_serializationhelpers_h__
#define mozilla_dom_indexeddb_serializationhelpers_h__

#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/indexedDB/SerializationHelpers.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/indexedDB/Key.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/indexedDB/Key.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_indexeddb_key_h__
#define mozilla_dom_indexeddb_key_h__


namespace mozilla {
namespace dom {
namespace indexedDB {

class Key
{
  friend struct IPC::ParamTraits<Key>;

  nsCString mBuffer;

public:
  

  

#ifdef DEBUG
  ;
#else
# 308 "../../dist/include/mozilla/dom/indexedDB/Key.h"
  { }
#endif
# 310 "../../dist/include/mozilla/dom/indexedDB/Key.h"
};

} // namespace indexedDB
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_indexeddb_key_h__
# 317 "../../dist/include/mozilla/dom/indexedDB/Key.h"
# 11 "../../dist/include/mozilla/dom/indexedDB/SerializationHelpers.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/indexedDB/KeyPath.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/indexedDB/KeyPath.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_indexeddb_keypath_h__
#define mozilla_dom_indexeddb_keypath_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/indexedDB/KeyPath.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/indexedDB/KeyPath.h"

namespace mozilla {
namespace dom {

class OwningStringOrStringSequence;

namespace indexedDB {

class IndexMetadata;
class Key;
class ObjectStoreMetadata;

class KeyPath
{
  // This private constructor is only to be used by IPDL-generated classes.
  friend class IndexMetadata;
  friend class ObjectStoreMetadata;

  

public:
  enum KeyPathType {
    NONEXISTENT,
    STRING,
    ARRAY,
    ENDGUARD
  };
};

} // namespace indexedDB
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_indexeddb_keypath_h__
# 128 "../../dist/include/mozilla/dom/indexedDB/KeyPath.h"
# 12 "../../dist/include/mozilla/dom/indexedDB/SerializationHelpers.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/indexedDB/IDBCursor.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/indexedDB/IDBCursor.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_indexeddb_idbcursor_h__
#define mozilla_dom_indexeddb_idbcursor_h__

#if 0 /* expanded by -frewrite-includes */
#include "IndexedDatabase.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabase.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_indexeddb_indexeddatabase_h__
#define mozilla_dom_indexeddb_indexeddatabase_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsIProgrammingLanguage.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabase.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/StructuredClone.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabase.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabase.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabase.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabase.h"

class nsIInputStream;

namespace mozilla {
namespace dom {

class File;

namespace indexedDB {

class FileInfo;
class IDBDatabase;
class IDBTransaction;
class SerializedStructuredCloneReadInfo;
class SerializedStructuredCloneWriteInfo;

struct StructuredCloneFile
{
  nsRefPtr<File> mFile;
  nsRefPtr<FileInfo> mFileInfo;

  // In IndexedDatabaseInlines.h
  inline
  StructuredCloneFile();

  // In IndexedDatabaseInlines.h
  inline
  ~StructuredCloneFile();

  // In IndexedDatabaseInlines.h
  inline bool
  operator==(const StructuredCloneFile& aOther) const;
};

struct StructuredCloneReadInfo
{
  nsTArray<uint8_t> mData;
  nsTArray<StructuredCloneFile> mFiles;
  IDBDatabase* mDatabase;

  inline
  MOZ_IMPLICIT StructuredCloneReadInfo(SerializedStructuredCloneReadInfo&& aOther);
};

} // namespace indexedDB
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_indexeddb_indexeddatabase_h__
# 81 "../../dist/include/mozilla/dom/indexedDB/IndexedDatabase.h"
# 11 "../../dist/include/mozilla/dom/indexedDB/IDBCursor.h" 2
#if 0 /* expanded by -frewrite-includes */

  ;

  
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/dom/indexedDB/IDBCursor.h"

class nsPIDOMWindow;

namespace mozilla {

class ErrorResult;

namespace dom {

class OwningIDBObjectStoreOrIDBIndex;

namespace indexedDB {

class BackgroundCursorChild;
class IDBIndex;
class IDBObjectStore;
class IDBRequest;
class IDBTransaction;

class IDBCursor MOZ_FINAL
  : public nsISupports
  , public nsWrapperCache
{
public:
  enum Direction
  {
    NEXT = 0,
    NEXT_UNIQUE,
    PREV,
    PREV_UNIQUE,

    // Only needed for IPC serialization helper, should never be used in code.
    DIRECTION_INVALID
  };

private:
  enum Type
  {
    Type_ObjectStore,
    Type_ObjectStoreKey,
    Type_Index,
    Type_IndexKey,
  };

  BackgroundCursorChild* mBackgroundActor;
  ;
};

} // namespace indexedDB
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_indexeddb_idbcursor_h__
# 206 "../../dist/include/mozilla/dom/indexedDB/IDBCursor.h"
# 13 "../../dist/include/mozilla/dom/indexedDB/SerializationHelpers.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/indexedDB/IDBTransaction.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/indexedDB/IDBTransaction.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_indexeddb_idbtransaction_h__
#define mozilla_dom_indexeddb_idbtransaction_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/indexedDB/IDBTransaction.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/IDBTransactionBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/IDBTransactionBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_IDBTransactionBinding_h
#define mozilla_dom_IDBTransactionBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/IDBTransactionBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/IDBTransactionBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/IDBTransactionBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/IDBTransactionBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/IDBTransactionBinding.h"

namespace mozilla {
namespace dom {

struct NativePropertyHooks;
class ProtoAndIfaceCache;

namespace indexedDB {

class IDBTransaction;
struct IDBTransactionAtoms;

} // namespace indexedDB

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

enum class IDBTransactionMode : uint32_t {
  Readonly,
  Readwrite,
  Versionchange,
  EndGuard_
};

namespace IDBTransactionModeValues {
extern const EnumEntry strings[4];
} // namespace IDBTransactionModeValues


namespace IDBTransactionBinding {

  typedef mozilla::dom::indexedDB::IDBTransaction NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  ;

  ;

  JSObject*
  GetConstructorObject(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

} // namespace IDBTransactionBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_IDBTransactionBinding_h
# 92 "../../dist/include/mozilla/dom/IDBTransactionBinding.h"
# 12 "../../dist/include/mozilla/dom/indexedDB/IDBTransaction.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/indexedDB/IDBWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/indexedDB/IDBWrapperCache.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_indexeddb_idbwrappercache_h__
#define mozilla_dom_indexeddb_idbwrappercache_h__

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/indexedDB/IDBWrapperCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DOMEventTargetHelper.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/indexedDB/IDBWrapperCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/indexedDB/IDBWrapperCache.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/indexedDB/IDBWrapperCache.h"

class nsPIDOMWindow;

namespace mozilla {
namespace dom {
namespace indexedDB {

class IDBWrapperCache : public DOMEventTargetHelper
{
  JS::Heap<JSObject*> mScriptOwner;

public:
  NS_DECL_ISUPPORTS_INHERITED
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(IDBWrapperCache,
                                                         DOMEventTargetHelper)

  JSObject*
  GetScriptOwner() const
  {
    return mScriptOwner;
  }

  void
  SetScriptOwner(JSObject* aScriptOwner);

  void AssertIsRooted() const
#ifdef DEBUG
  ;
#else
# 43 "../../dist/include/mozilla/dom/indexedDB/IDBWrapperCache.h"
  { }
#endif
# 45 "../../dist/include/mozilla/dom/indexedDB/IDBWrapperCache.h"

protected:
  explicit IDBWrapperCache(DOMEventTargetHelper* aOwner);
  explicit IDBWrapperCache(nsPIDOMWindow* aOwner);

  virtual ~IDBWrapperCache();
};

} // namespace indexedDB
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_indexeddb_idbwrappercache_h__
# 58 "../../dist/include/mozilla/dom/indexedDB/IDBWrapperCache.h"
# 13 "../../dist/include/mozilla/dom/indexedDB/IDBTransaction.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/dom/indexedDB/IDBTransaction.h"

class nsPIDOMWindow;

namespace mozilla {

class ErrorResult;
class EventChainPreVisitor;

namespace dom {

class DOMError;
class DOMStringList;
class PBlobChild;

namespace indexedDB {

class BackgroundCursorChild;
class BackgroundRequestChild;
class BackgroundTransactionChild;
class BackgroundVersionChangeTransactionChild;
class IDBDatabase;
class IDBObjectStore;
class IDBOpenDBRequest;
class IDBRequest;
class IndexMetadata;
class ObjectStoreSpec;
class OpenCursorParams;
class PBackgroundIDBDatabaseFileChild;
class RequestParams;

class IDBTransaction MOZ_FINAL
  : public IDBWrapperCache
  , public nsIRunnable
{
  class WorkerFeature;
  friend class WorkerFeature;

public:
  enum Mode
  {
    READ_ONLY = 0,
    READ_WRITE,
    VERSION_CHANGE,

    // Only needed for IPC serialization helper, should never be used in code.
    MODE_INVALID
  };

  enum ReadyState
  {
    INITIAL = 0,
    LOADING,
    COMMITTING,
    DONE
  };

private:
  nsRefPtr<IDBDatabase> mDatabase;
  nsRefPtr<DOMError> mError;
  nsTArray<nsString> mObjectStoreNames;
  nsTArray<nsRefPtr<IDBObjectStore>> mObjectStores;
  ;

  ;
};

} // namespace indexedDB
} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_indexeddb_idbtransaction_h__
# 324 "../../dist/include/mozilla/dom/indexedDB/IDBTransaction.h"
# 14 "../../dist/include/mozilla/dom/indexedDB/SerializationHelpers.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/quota/PersistenceType.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/indexedDB/SerializationHelpers.h"

namespace IPC {

template <>
struct ParamTraits<mozilla::dom::quota::PersistenceType> :
  public ContiguousEnumSerializer<
                               mozilla::dom::quota::PersistenceType,
                               mozilla::dom::quota::PERSISTENCE_TYPE_PERSISTENT,
                               mozilla::dom::quota::PERSISTENCE_TYPE_INVALID>
{ };

template <>
struct ParamTraits<mozilla::dom::indexedDB::Key>
{
  typedef mozilla::dom::indexedDB::Key paramType;

  

  

  
};

template <>
struct ParamTraits<mozilla::dom::indexedDB::KeyPath::KeyPathType> :
  public ContiguousEnumSerializer<mozilla::dom::indexedDB::KeyPath::KeyPathType,
                                  mozilla::dom::indexedDB::KeyPath::NONEXISTENT,
                                  mozilla::dom::indexedDB::KeyPath::ENDGUARD>
{ };

template <>
struct ParamTraits<mozilla::dom::indexedDB::KeyPath>
{
  typedef mozilla::dom::indexedDB::KeyPath paramType;

  

  

  
};

template <>
struct ParamTraits<mozilla::dom::indexedDB::IDBCursor::Direction> :
  public ContiguousEnumSerializer<
                          mozilla::dom::indexedDB::IDBCursor::Direction,
                          mozilla::dom::indexedDB::IDBCursor::NEXT,
                          mozilla::dom::indexedDB::IDBCursor::DIRECTION_INVALID>
{ };

template <>
struct ParamTraits<mozilla::dom::indexedDB::IDBTransaction::Mode> :
  public ContiguousEnumSerializer<
                          mozilla::dom::indexedDB::IDBTransaction::Mode,
                          mozilla::dom::indexedDB::IDBTransaction::READ_ONLY,
                          mozilla::dom::indexedDB::IDBTransaction::MODE_INVALID>
{ };

} // namespace IPC

#endif // mozilla_dom_indexeddb_serializationhelpers_h__
# 96 "../../dist/include/mozilla/dom/indexedDB/SerializationHelpers.h"
# 61 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ipc/IdType.h"

#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/nsGeoPositionIPCSerialiser.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsGeoPosition.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsGeoPosition.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsGeoPosition_h
#define nsGeoPosition_h

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsGeoPosition.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMGeoPositionCoords.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMGeoPositionCoords.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMGeoPositionCoords.idl
 */

#ifndef __gen_nsIDOMGeoPositionCoords_h__
#define __gen_nsIDOMGeoPositionCoords_h__

  NS_IMETHOD GetSpeed(double *aSpeed) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSpeed(aSpeed); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMGeoPositionCoords : public nsIDOMGeoPositionCoords
{
#endif
# 12 "../../dist/include/nsIDOMGeoPosition.h"

#ifndef __gen_nsIDOMGeoPositionCoords_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMGeoPositionCoords.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsIDOMGeoPosition.h"
#endif
# 16 "../../dist/include/nsIDOMGeoPosition.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 21 "../../dist/include/nsIDOMGeoPosition.h"

/* starting interface:    nsIDOMGeoPosition */
#define NS_IDOMGEOPOSITION_IID_STR "dd9f7e81-0f74-4fb5-b361-37019bf60c3f"

#define NS_IDOMGEOPOSITION_IID \
  {0xdd9f7e81, 0x0f74, 0x4fb5, \
    { 0xb3, 0x61, 0x37, 0x01, 0x9b, 0xf6, 0x0c, 0x3f }}

#define NS_DECL_NSIDOMGEOPOSITION \
  NS_IMETHOD GetTimestamp(DOMTimeStamp *aTimestamp) MOZ_OVERRIDE; \
  NS_IMETHOD GetCoords(nsIDOMGeoPositionCoords * *aCoords) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMGEOPOSITION(_to) \
  NS_IMETHOD GetTimestamp(DOMTimeStamp *aTimestamp) MOZ_OVERRIDE { return _to GetTimestamp(aTimestamp); } \
  NS_IMETHOD GetCoords(nsIDOMGeoPositionCoords * *aCoords) MOZ_OVERRIDE { return _to GetCoords(aCoords); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMGEOPOSITION(_to) \
  NS_IMETHOD GetTimestamp(DOMTimeStamp *aTimestamp) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTimestamp(aTimestamp); } \
  NS_IMETHOD GetCoords(nsIDOMGeoPositionCoords * *aCoords) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCoords(aCoords); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMGeoPosition : public nsIDOMGeoPosition
{
public:
  NS_DECL_ISUPPORTS
NS_IMETHODIMP nsDOMGeoPosition::GetCoords(nsIDOMGeoPositionCoords * *aCoords)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 105 "../../dist/include/nsIDOMGeoPosition.h"


#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsGeoPosition.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsGeoPosition.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/nsGeoPosition.h"

////////////////////////////////////////////////////
// nsGeoPositionCoords
////////////////////////////////////////////////////

};

} // namespace dom
} // namespace mozilla

#endif /* nsGeoPosition_h */
# 145 "../../dist/include/nsGeoPosition.h"

# 10 "../../dist/include/nsGeoPositionIPCSerialiser.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMGeoPosition.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsGeoPositionIPCSerialiser.h"

typedef nsIDOMGeoPosition* GeoPosition;

      nsCOMPtr<nsIDOMGeoPositionCoords> tmpcoords = coords;
      return false;
    }

    *aResult = new nsGeoPosition(coords, timeStamp);

    return true;
  };

};

}

#endif
# 151 "../../dist/include/nsGeoPositionIPCSerialiser.h"
# 64 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h"
#endif /* expanded by -frewrite-includes */
# 65 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentParent.h"

namespace mozilla {
namespace dom {
namespace asmjscache {
class PAsmJSCacheEntryParent;
} // namespace asmjscache
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace asmjscache {
class PAsmJSCacheEntryChild;
} // namespace asmjscache
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace ipc {
class PBackgroundParent;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class PBackgroundChild;
} // namespace ipc
} // namespace mozilla

namespace mozilla {
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace bluetooth {
class PBluetoothChild;
} // namespace bluetooth
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBrowserParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PBrowserChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace cellbroadcast {
class PCellBroadcastParent;
} // namespace cellbroadcast
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace cellbroadcast {
class PCellBroadcastChild;
} // namespace cellbroadcast
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace layers {
class PCompositorParent;
} // namespace layers
} // namespace mozilla
namespace mozilla {
namespace layers {
class PCompositorChild;
} // namespace layers
} // namespace mozilla

namespace mozilla {
namespace dom {
class PContentBridgeParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PContentBridgeChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PCycleCollectWithLogsParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PCycleCollectWithLogsChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PCrashReporterParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PCrashReporterChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace a11y {
class PDocAccessibleParent;
} // namespace a11y
} // namespace mozilla
namespace mozilla {
namespace a11y {
class PDocAccessibleChild;
} // namespace a11y
} // namespace mozilla

namespace mozilla {
namespace dom {
class PExternalHelperAppParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PExternalHelperAppChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace devicestorage {
class PDeviceStorageRequestParent;
} // namespace devicestorage
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace devicestorage {
class PDeviceStorageRequestChild;
} // namespace devicestorage
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace ipc {
class PFileDescriptorSetParent;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class PFileDescriptorSetChild;
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace dom {
class PFMRadioParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PFMRadioChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PFileSystemRequestParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PFileSystemRequestChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace hal_sandbox {
class PHalParent;
} // namespace hal_sandbox
} // namespace mozilla
namespace mozilla {
namespace hal_sandbox {
class PHalChild;
} // namespace hal_sandbox
} // namespace mozilla

namespace mozilla {
class PProcessHangMonitorParent;
} // namespace mozilla
namespace mozilla {
class PProcessHangMonitorChild;
} // namespace mozilla

namespace mozilla {
namespace layers {
class PImageBridgeParent;
} // namespace layers
} // namespace mozilla
namespace mozilla {
namespace layers {
class PImageBridgeChild;
} // namespace layers
} // namespace mozilla

namespace mozilla {
namespace dom {
class PMemoryReportRequestParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PMemoryReportRequestChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace mobileconnection {
class PMobileConnectionParent;
} // namespace mobileconnection
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace mobileconnection {
class PMobileConnectionChild;
} // namespace mobileconnection
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace net {
class PNeckoParent;
} // namespace net
} // namespace mozilla
namespace mozilla {
namespace net {
class PNeckoChild;
} // namespace net
} // namespace mozilla

namespace mozilla {
namespace plugins {
class PPluginModuleParent;
} // namespace plugins
} // namespace mozilla
namespace mozilla {
namespace plugins {
class PPluginModuleChild;
} // namespace plugins
} // namespace mozilla

namespace mozilla {
namespace embedding {
class PPrintingParent;
} // namespace embedding
} // namespace mozilla
namespace mozilla {
namespace embedding {
class PPrintingChild;
} // namespace embedding
} // namespace mozilla

namespace mozilla {
namespace docshell {
class POfflineCacheUpdateParent;
} // namespace docshell
} // namespace mozilla
namespace mozilla {
namespace docshell {
class POfflineCacheUpdateChild;
} // namespace docshell
} // namespace mozilla

namespace mozilla {
namespace dom {
class PScreenManagerParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PScreenManagerChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace layers {
class PSharedBufferManagerParent;
} // namespace layers
} // namespace mozilla
namespace mozilla {
namespace layers {
class PSharedBufferManagerChild;
} // namespace layers
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace mobilemessage {
class PSmsParent;
} // namespace mobilemessage
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace mobilemessage {
class PSmsChild;
} // namespace mobilemessage
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PSpeechSynthesisParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PSpeechSynthesisChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PStorageParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PStorageChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace telephony {
class PTelephonyParent;
} // namespace telephony
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace telephony {
class PTelephonyChild;
} // namespace telephony
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace ipc {
class PTestShellParent;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class PTestShellChild;
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace voicemail {
class PVoicemailParent;
} // namespace voicemail
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace voicemail {
class PVoicemailChild;
} // namespace voicemail
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class PJavaScriptParent;
} // namespace jsipc
} // namespace mozilla
namespace mozilla {
namespace jsipc {
class PJavaScriptChild;
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
class PRemoteSpellcheckEngineParent;
} // namespace mozilla
namespace mozilla {
class PRemoteSpellcheckEngineChild;
} // namespace mozilla

namespace mozilla {
namespace jsipc {
class PJavaScriptParent;
} // namespace jsipc
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace mobileconnection {
class PMobileConnectionParent;
} // namespace mobileconnection
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PSpeechSynthesisParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBlobParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PCrashReporterParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace ipc {
class PTestShellParent;
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace dom {
class PCycleCollectWithLogsParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace a11y {
class PDocAccessibleParent;
} // namespace a11y
} // namespace mozilla

namespace mozilla {
namespace dom {
class PExternalHelperAppParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace mobilemessage {
class PSmsParent;
} // namespace mobilemessage
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace embedding {
class PPrintingParent;
} // namespace embedding
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace bluetooth {
class PBluetoothParent;
} // namespace bluetooth
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PFMRadioParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PScreenManagerParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace voicemail {
class PVoicemailParent;
} // namespace voicemail
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PStorageParent;
} // namespace dom
} // namespace mozilla

struct ChromePackage;

struct ResourceMapping;

struct OverrideMapping;

namespace IPC {
struct Permission;
} // namespace IPC

namespace IPC {
class Principal;
} // namespace IPC

namespace mozilla {
struct null_t;
} // namespace mozilla

namespace mozilla {
struct void_t;
} // namespace mozilla

namespace mozilla {
namespace dom {


class /*NS_ABSTRACT_CLASS*/ PContentParent :
    public mozilla::ipc::IProtocol,
    protected mozilla::ipc::IProtocolManager<mozilla::ipc::IProtocol>,
    public mozilla::ipc::IToplevelProtocol
{
    friend class mozilla::jsipc::PJavaScriptParent;

    friend class mozilla::dom::mobileconnection::PMobileConnectionParent;

    friend class mozilla::dom::PSpeechSynthesisParent;


    friend class mozilla::embedding::PPrintingParent;

    friend class mozilla::dom::bluetooth::PBluetoothParent;

    friend class mozilla::dom::PFMRadioParent;

    friend class mozilla::dom::PScreenManagerParent;

    friend class mozilla::dom::voicemail::PVoicemailParent;

    friend class mozilla::ipc::PFileDescriptorSetParent;

    friend class mozilla::dom::PBrowserParent;

    friend class mozilla::PRemoteSpellcheckEngineParent;

    friend class mozilla::dom::PStorageParent;

protected:
    typedef mozilla::ipc::ActorHandle ActorHandle;
    typedef mozilla::dom::AnyBlobConstructorParams AnyBlobConstructorParams;
    typedef mozilla::dom::AppFrameIPCTabContext AppFrameIPCTabContext;
    typedef mozilla::dom::AudioChannel AudioChannel;
    typedef mozilla::dom::AudioChannelState AudioChannelState;
    typedef mozilla::dom::BlobConstructorParams BlobConstructorParams;
    typedef mozilla::dom::BlobData BlobData;
    typedef mozilla::dom::BrowserFrameIPCTabContext BrowserFrameIPCTabContext;
    typedef mozilla::ipc::BufferedInputStreamParams BufferedInputStreamParams;
    typedef mozilla::dom::ChildBlobConstructorParams ChildBlobConstructorParams;
    typedef base::ChildPrivileges ChildPrivileges;
    typedef mozilla::dom::ClipboardCapabilities ClipboardCapabilities;
    typedef mozilla::dom::ClonedMessageData ClonedMessageData;
    typedef mozilla::dom::ContentParentId ContentParentId;
    typedef mozilla::jsipc::CpowEntry CpowEntry;
    typedef mozilla::dom::DataStoreSetting DataStoreSetting;
    typedef mozilla::dom::DeviceStorageAddParams DeviceStorageAddParams;
    typedef mozilla::dom::FMRadioRequestParams FMRadioRequestParams;
    typedef mozilla::dom::FMRadioRequestSeekParams FMRadioRequestSeekParams;
    typedef mozilla::dom::FMRadioRequestSetFrequencyParams FMRadioRequestSetFrequencyParams;
    typedef mozilla::dom::FileBlobConstructorParams FileBlobConstructorParams;
    typedef mozilla::ipc::FileDescriptor FileDescriptor;
    typedef mozilla::ipc::FileInputStreamParams FileInputStreamParams;
    typedef mozilla::dom::FileSystemCreateDirectoryParams FileSystemCreateDirectoryParams;
    typedef mozilla::dom::FileSystemCreateFileParams FileSystemCreateFileParams;
    typedef mozilla::dom::FileSystemFileDataValue FileSystemFileDataValue;
    typedef mozilla::dom::FileSystemGetFileOrDirectoryParams FileSystemGetFileOrDirectoryParams;
    typedef mozilla::dom::FileSystemParams FileSystemParams;
    typedef mozilla::dom::FileSystemPathOrFileValue FileSystemPathOrFileValue;
    typedef mozilla::dom::FileSystemRemoveParams FileSystemRemoveParams;
    typedef mozilla::dom::FontListEntry FontListEntry;
    typedef mozilla::jsipc::GetterSetter GetterSetter;
    typedef mozilla::dom::IPCTabAppBrowserContext IPCTabAppBrowserContext;
    typedef mozilla::dom::NormalBlobConstructorParams NormalBlobConstructorParams;
    typedef mozilla::ipc::NullPrincipalURIParams NullPrincipalURIParams;
    typedef mozilla::jsipc::NullVariant NullVariant;
    typedef mozilla::jsipc::ObjectOrNullVariant ObjectOrNullVariant;
    typedef mozilla::jsipc::ObjectVariant ObjectVariant;
    typedef mozilla::dom::asmjscache::OpenMode OpenMode;
    typedef mozilla::dom::OptionalBlobData OptionalBlobData;
    typedef mozilla::dom::OptionalContentId OptionalContentId;
    typedef mozilla::ipc::OptionalFileDescriptorSet OptionalFileDescriptorSet;
    typedef mozilla::dom::OptionalID OptionalID;
    typedef mozilla::ipc::OptionalInputStreamParams OptionalInputStreamParams;
    typedef mozilla::ipc::OptionalURIParams OptionalURIParams;
    typedef mozilla::dom::PBrowserOrId PBrowserOrId;
    typedef mozilla::jsipc::PPropertyDescriptor PPropertyDescriptor;
    typedef mozilla::dom::ParentBlobConstructorParams ParentBlobConstructorParams;
    typedef mozilla::ipc::PartialFileInputStreamParams PartialFileInputStreamParams;
    typedef IPC::Permission Permission;
    typedef mozilla::dom::quota::PersistenceType PersistenceType;
    typedef mozilla::plugins::PluginIdentifier PluginIdentifier;
    typedef mozilla::plugins::PluginTag PluginTag;
    typedef mozilla::dom::PopupIPCTabContext PopupIPCTabContext;
    typedef mozilla::dom::PrefSetting PrefSetting;
    typedef mozilla::dom::PrefValue PrefValue;
    typedef IPC::Principal Principal;
    typedef base::ProcessId ProcessId;
    typedef mozilla::hal::ProcessPriority ProcessPriority;
    typedef mozilla::ipc::ProtocolFdMapping ProtocolFdMapping;
    typedef mozilla::ipc::ProtocolId ProtocolId;
    typedef mozilla::jsipc::RegisteredSymbol RegisteredSymbol;
    typedef mozilla::ipc::RemoteInputStreamParams RemoteInputStreamParams;
    typedef mozilla::jsipc::RemoteObject RemoteObject;
    typedef mozilla::jsipc::ReturnException ReturnException;
    typedef mozilla::jsipc::ReturnObjectOpResult ReturnObjectOpResult;
    typedef mozilla::jsipc::ReturnStatus ReturnStatus;
    typedef mozilla::jsipc::ReturnStopIteration ReturnStopIteration;
    typedef mozilla::jsipc::ReturnSuccess ReturnSuccess;
    typedef mozilla::dom::SameProcessBlobConstructorParams SameProcessBlobConstructorParams;
    typedef mozilla::ipc::SameProcessInputStreamParams SameProcessInputStreamParams;
    typedef mozilla::SerializedStructuredCloneBuffer SerializedStructuredCloneBuffer;
    typedef mozilla::ipc::Shmem Shmem;
    typedef mozilla::ipc::SimpleURIParams SimpleURIParams;
    typedef mozilla::dom::SlicedBlobConstructorParams SlicedBlobConstructorParams;
    typedef mozilla::ipc::StandardURLParams StandardURLParams;
    typedef mozilla::ipc::StandardURLSegment StandardURLSegment;
    typedef mozilla::ipc::StringInputStreamParams StringInputStreamParams;
    typedef mozilla::jsipc::SymbolVariant SymbolVariant;
    typedef mozilla::dom::TabId TabId;
    typedef mozilla::ipc::Transport Transport;
    typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
    typedef mozilla::ipc::URIParams URIParams;
    typedef mozilla::jsipc::UndefinedVariant UndefinedVariant;
    typedef mozilla::dom::VanillaFrameIPCTabContext VanillaFrameIPCTabContext;
    typedef mozilla::dom::VolumeInfo VolumeInfo;
    typedef mozilla::jsipc::WellKnownSymbol WellKnownSymbol;
    typedef mozilla::dom::asmjscache::WriteParams WriteParams;
    typedef mozilla::null_t null_t;
    typedef mozilla::void_t void_t;
    typedef mozilla::dom::asmjscache::PAsmJSCacheEntryParent PAsmJSCacheEntryParent;
    typedef mozilla::dom::asmjscache::PAsmJSCacheEntryChild PAsmJSCacheEntryChild;
    typedef mozilla::ipc::PBackgroundParent PBackgroundParent;
    typedef mozilla::ipc::PBackgroundChild PBackgroundChild;
    typedef mozilla::dom::PBlobParent PBlobParent;
    typedef mozilla::dom::PBlobChild PBlobChild;
    typedef mozilla::dom::bluetooth::PBluetoothParent PBluetoothParent;
    typedef mozilla::dom::bluetooth::PBluetoothChild PBluetoothChild;
    typedef mozilla::dom::PBrowserParent PBrowserParent;
    typedef mozilla::dom::PBrowserChild PBrowserChild;
    typedef mozilla::dom::cellbroadcast::PCellBroadcastParent PCellBroadcastParent;
    typedef mozilla::dom::cellbroadcast::PCellBroadcastChild PCellBroadcastChild;
    typedef mozilla::layers::PCompositorParent PCompositorParent;
    typedef mozilla::layers::PCompositorChild PCompositorChild;
    typedef mozilla::dom::PContentBridgeParent PContentBridgeParent;
    typedef mozilla::dom::PContentBridgeChild PContentBridgeChild;
    typedef mozilla::dom::PCycleCollectWithLogsParent PCycleCollectWithLogsParent;
    typedef mozilla::dom::PCycleCollectWithLogsChild PCycleCollectWithLogsChild;
    typedef mozilla::dom::PCrashReporterParent PCrashReporterParent;
    typedef mozilla::dom::PCrashReporterChild PCrashReporterChild;
    typedef mozilla::a11y::PDocAccessibleParent PDocAccessibleParent;
    typedef mozilla::a11y::PDocAccessibleChild PDocAccessibleChild;
    typedef mozilla::dom::PExternalHelperAppParent PExternalHelperAppParent;
    typedef mozilla::dom::PExternalHelperAppChild PExternalHelperAppChild;
    typedef mozilla::dom::devicestorage::PDeviceStorageRequestParent PDeviceStorageRequestParent;
    typedef mozilla::dom::devicestorage::PDeviceStorageRequestChild PDeviceStorageRequestChild;
    typedef mozilla::ipc::PFileDescriptorSetParent PFileDescriptorSetParent;
    typedef mozilla::ipc::PFileDescriptorSetChild PFileDescriptorSetChild;
    typedef mozilla::dom::PFMRadioParent PFMRadioParent;
    typedef mozilla::dom::PFMRadioChild PFMRadioChild;
    typedef mozilla::dom::PFileSystemRequestParent PFileSystemRequestParent;
    typedef mozilla::dom::PFileSystemRequestChild PFileSystemRequestChild;
    typedef mozilla::hal_sandbox::PHalParent PHalParent;
    typedef mozilla::hal_sandbox::PHalChild PHalChild;
    typedef mozilla::PProcessHangMonitorParent PProcessHangMonitorParent;
    typedef mozilla::PProcessHangMonitorChild PProcessHangMonitorChild;
    typedef mozilla::layers::PImageBridgeParent PImageBridgeParent;
    typedef mozilla::layers::PImageBridgeChild PImageBridgeChild;
    typedef mozilla::dom::PMemoryReportRequestParent PMemoryReportRequestParent;
    typedef mozilla::dom::PMemoryReportRequestChild PMemoryReportRequestChild;
    typedef mozilla::dom::mobileconnection::PMobileConnectionParent PMobileConnectionParent;
    typedef mozilla::dom::mobileconnection::PMobileConnectionChild PMobileConnectionChild;
    typedef mozilla::net::PNeckoParent PNeckoParent;
    typedef mozilla::net::PNeckoChild PNeckoChild;
    typedef mozilla::plugins::PPluginModuleParent PPluginModuleParent;
    typedef mozilla::plugins::PPluginModuleChild PPluginModuleChild;
    typedef mozilla::embedding::PPrintingParent PPrintingParent;
    typedef mozilla::embedding::PPrintingChild PPrintingChild;
    typedef mozilla::docshell::POfflineCacheUpdateParent POfflineCacheUpdateParent;
    typedef mozilla::docshell::POfflineCacheUpdateChild POfflineCacheUpdateChild;
    typedef mozilla::dom::PScreenManagerParent PScreenManagerParent;
    typedef mozilla::dom::PScreenManagerChild PScreenManagerChild;
    typedef mozilla::layers::PSharedBufferManagerParent PSharedBufferManagerParent;
    typedef mozilla::layers::PSharedBufferManagerChild PSharedBufferManagerChild;
    typedef mozilla::dom::mobilemessage::PSmsParent PSmsParent;
    typedef mozilla::dom::mobilemessage::PSmsChild PSmsChild;
    typedef mozilla::dom::PSpeechSynthesisParent PSpeechSynthesisParent;
    typedef mozilla::dom::PSpeechSynthesisChild PSpeechSynthesisChild;
    typedef mozilla::dom::PStorageParent PStorageParent;
    typedef mozilla::dom::PStorageChild PStorageChild;
    typedef mozilla::dom::telephony::PTelephonyParent PTelephonyParent;
    typedef mozilla::dom::telephony::PTelephonyChild PTelephonyChild;
    typedef mozilla::ipc::PTestShellParent PTestShellParent;
    typedef mozilla::ipc::PTestShellChild PTestShellChild;
    typedef mozilla::dom::voicemail::PVoicemailParent PVoicemailParent;
    typedef mozilla::dom::voicemail::PVoicemailChild PVoicemailChild;
    typedef mozilla::jsipc::PJavaScriptParent PJavaScriptParent;
    typedef mozilla::jsipc::PJavaScriptChild PJavaScriptChild;
    typedef mozilla::PRemoteSpellcheckEngineParent PRemoteSpellcheckEngineParent;
    typedef mozilla::PRemoteSpellcheckEngineChild PRemoteSpellcheckEngineChild;

    typedef PContent::State State;

    virtual bool
    RecvPBrowserConstructor(
            PBrowserParent* actor,
            const TabId& tabId,
            const IPCTabContext& context,
            const uint32_t& chromeFlags,
            const ContentParentId& cpId,
            const bool& isForApp,
            const bool& isForBrowser);
    virtual bool
    RecvPBlobConstructor(
            PBlobParent* actor,
            const BlobConstructorParams& params);
    virtual bool
    RecvPFileDescriptorSetConstructor(
            PFileDescriptorSetParent* actor,
            const FileDescriptor& fd);
    virtual bool
    RecvPDocAccessibleConstructor(
            PDocAccessibleParent* actor,
            PDocAccessibleParent* aParentDoc,
            const uint64_t& aParentAcc);
    virtual bool
    RecvGetProcessAttributes(
            ContentParentId* cpId,
            bool* isForApp,
            bool* isForBrowser) = 0;
    virtual bool
    RecvGetXPCOMProcessAttributes(
            bool* isOffline,
            PDeviceStorageRequestParent* actor,
            const DeviceStorageParams& params);
    virtual bool
    RecvPFileSystemRequestConstructor(
            PFileSystemRequestParent* actor,
            const FileSystemParams& params);
    virtual bool
    RecvPCrashReporterConstructor(
            PCrashReporterParent* actor,
            const NativeThreadId& tid,
            const uint32_t& processType);
    virtual bool
    RecvGetRandomValues(
            const uint32_t& length,
            nsTArray<uint8_t>* randomValues) = 0;
    virtual bool
    RecvClipboardHasText(
            const bool& aWithVideo) = 0;
    virtual bool
    RecvAudioChannelChangedNotification() = 0;
    virtual bool
    RecvAudioChannelChangeDefVolChannel(
            const int32_t& aChannel,
            const bool& aHidden) = 0;
    virtual bool
    RecvDataStoreGetStores(
            const nsString& aName,
            const nsString& aOwner,
            const Principal& aPrincipal,
            nsTArray<DataStoreSetting>* dataStores) = 0;
    virtual bool
    RecvFilePathUpdateNotify(
            const nsString& fsName,
            const nsString& mountPoint) = 0;
    virtual bool
    RecvSetFakeVolumeState(
            const nsString& fsName,
            const int32_t& fsState) = 0;
    virtual bool
    RecvKeywordToURI(
            const nsCString& keyword,
            nsString* providerName,
            OptionalInputStreamParams* postData,
            OptionalURIParams* uri) = 0;
    virtual bool
    RecvNotifyKeywordSearchLoading(
            const nsString& providerName,
            const nsString& keyword) = 0;
    virtual bool
    RecvAllocateLayerTreeId(uint64_t* id) = 0;
    virtual bool
    RecvDeallocateLayerTreeId(const uint64_t& id) = 0;
    virtual bool
    RecvSpeakerManagerForceSpeaker(const bool& aEnable) = 0;
    virtual bool
    RecvSpeakerManagerGetSpeakerStatus(bool* value) = 0;
    virtual bool
    RecvRecordingDeviceEvents(
            const nsString& recordingStatus,
            const nsString& pageURL,
            const bool& isAudio,
            const bool& isVideo) = 0;
    virtual bool
    RecvGetGraphicsFeatureStatus(
            const int32_t& aFeature,
            int32_t* aStatus,
            bool* aSuccess) = 0;
    virtual bool
    RecvAddIdleObserver(
            const uint64_t& observerId,
            const uint32_t& idleTimeInS) = 0;
    virtual bool
    RecvRemoveIdleObserver(
            const uint64_t& observerId,
            const uint32_t& idleTimeInS) = 0;
    virtual bool
    RecvBackUpXResources(const FileDescriptor& aXSocketFd) = 0;
    virtual bool
    RecvOpenAnonymousTemporaryFile(FileDescriptor* aFD) = 0;
    virtual bool
    RecvKeygenProcessValue(
            const nsString& oldValue,
            const nsString& challenge,
            const nsString& keytype,
            const nsString& keyparams,
            nsString* newValue) = 0;
    virtual bool
    RecvKeygenProvideContent(
            nsString* aAttribute,
            nsTArray<nsString>* aContent) = 0;
    virtual bool
    RecvGetFileReferences(
            const PersistenceType& persistenceType,
            const nsCString& origin,
            const nsString& databaseName,
            const int64_t& fileId,
            int32_t* refCnt,
            int32_t* dBRefCnt,
            int32_t* sliceRefCnt,
            bool* result) = 0;
    virtual bool
    RecvAllocateTabId(
            const TabId& openerTabId,
            const IPCTabContext& context,
            const ContentParentId& cpId,
            TabId* tabId) = 0;
    virtual bool
    RecvDeallocateTabId(const TabId& tabId) = 0;
    virtual bool
    RecvPOfflineCacheUpdateConstructor(
            POfflineCacheUpdateParent* actor,
            const URIParams& manifestURI,
            const IPCTabContext& context,
            const uint32_t& chromeFlags,
            const ContentParentId& cpId,
            const bool& isForApp,
            const bool& isForBrowser) = 0;
    virtual bool
    DeallocPBrowserParent(PBrowserParent* aActor) = 0;
    virtual PBlobParent*
    AllocPBlobParent(const BlobConstructorParams& params) = 0;
    virtual bool
    DeallocPBlobParent(PBlobParent* aActor) = 0;
    virtual PFileDescriptorSetParent*
    AllocPFileDescriptorSetParent(const FileDescriptor& fd) = 0;
    virtual bool
    DeallocPFileDescriptorSetParent(PFileDescriptorSetParent* aActor) = 0;
    virtual PMemoryReportRequestParent*
    AllocPMemoryReportRequestParent(
            const uint32_t& generation,
            const bool& anonymize,
            const bool& minimizeMemoryUsage,
            const MaybeFileDesc& DMDFile) = 0;
    virtual bool
    DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* aActor) = 0;
    virtual PCycleCollectWithLogsParent*
    AllocPCycleCollectWithLogsParent(
            const bool& dumpAllTraces,
            const FileDescriptor& gcLog,
            const FileDescriptor& ccLog) = 0;
    virtual bool
    DeallocPCycleCollectWithLogsParent(PCycleCollectWithLogsParent* aActor) = 0;
    virtual PTestShellParent*
    AllocPTestShellParent() = 0;
    virtual bool
    DeallocPTestShellParent(PTestShellParent* aActor) = 0;
    virtual PDocAccessibleParent*
    AllocPDocAccessibleParent(
            PDocAccessibleParent* aParentDoc,
            const uint64_t& aParentAcc) = 0;
    virtual bool
    DeallocPDocAccessibleParent(PDocAccessibleParent* aActor) = 0;
    virtual PJavaScriptParent*
    AllocPJavaScriptParent() = 0;
    virtual bool
    DeallocPJavaScriptParent(PJavaScriptParent* aActor) = 0;
    virtual PRemoteSpellcheckEngineParent*
    AllocPRemoteSpellcheckEngineParent() = 0;
    virtual bool
    DeallocPRemoteSpellcheckEngineParent(PRemoteSpellcheckEngineParent* aActor) = 0;
    virtual PDeviceStorageRequestParent*
    AllocPDeviceStorageRequestParent(const DeviceStorageParams& params) = 0;
    virtual bool
    DeallocPDeviceStorageRequestParent(PDeviceStorageRequestParent* aActor) = 0;
    virtual PFileSystemRequestParent*
    AllocPFileSystemRequestParent(const FileSystemParams& params) = 0;
    virtual bool
    DeallocPFileSystemRequestParent(PFileSystemRequestParent* aActor) = 0;
    virtual PCrashReporterParent*
    AllocPCrashReporterParent(
            const NativeThreadId& tid,
            Transport* aTransport,
            ProcessId aOtherProcess) = 0;
    virtual PBackgroundParent*
    AllocPBackgroundParent(
            Transport* aTransport,
            const char* aReason);
    virtual bool
    ShouldContinueFromReplyTimeout();
    ;
    ;
    ;
    ;

public:
    typedef mozilla::ipc::IProtocol ProtocolBase;
    typedef IPC::Message Message;
    typedef mozilla::ipc::MessageChannel Channel;
    typedef mozilla::ipc::MessageListener ChannelListener;
    typedef base::ProcessHandle ProcessHandle;
    typedef mozilla::ipc::MessageChannel MessageChannel;
    typedef mozilla::ipc::SharedMemory SharedMemory;
    ;

    ;
    ;


    bool
    Read(
            FileSystemPathOrFileValue* __v,
            const Message* __msg,
            void** __iter) NS_WARN_UNUSED_RESULT;

    ;

    bool
    Read(
            PTelephonyParent** __v,
            const Message* __msg,
            void** __iter,
            bool __nullable) NS_WARN_UNUSED_RESULT;

    ;

    bool
    Read(
            PAsmJSCacheEntryParent** __v,
            const Message* __msg,
            void** __iter,
            bool __nullable) NS_WARN_UNUSED_RESULT;

    ;

    nsTArray<PVoicemailParent*> mManagedPVoicemailParent;
    // Sorted by pointer value
    nsTArray<PJavaScriptParent*> mManagedPJavaScriptParent;
    // Sorted by pointer value
    nsTArray<PRemoteSpellcheckEngineParent*> mManagedPRemoteSpellcheckEngineParent;
};


} // namespace dom
} // namespace mozilla

#if 0

//-----------------------------------------------------------------------------
// Skeleton implementation of abstract actor class

            ClipboardCapabilities* clipboardCaps);

    virtual bool
    RecvCreateChildProcess(
            const IPCTabContext& context,
            const ProcessPriority& priority,
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/nsIContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/nsIContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CPOWManagerGetter.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/CPOWManagerGetter.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_CPOWManagerGetter_h
#define mozilla_dom_CPOWManagerGetter_h

namespace mozilla {

namespace jsipc {
class CPOWManager;
} /* namespace jsipc */

namespace dom {
class CPOWManagerGetter
{
public:
  virtual mozilla::jsipc::CPOWManager* GetCPOWManager() = 0;
};
} /* namespace dom */

} /* namespace mozilla */

#endif /* mozilla_dom_CPOWManagerGetter_h */
# 27 "../../dist/include/mozilla/dom/CPOWManagerGetter.h"
# 15 "../../dist/include/mozilla/dom/nsIContentParent.h" 2

#define NS_ICONTENTPARENT_IID                                   \
  { 0xeeec9ebf, 0x8ecf, 0x4e38,                                 \
    { 0x81, 0xda, 0xb7, 0x34, 0x13, 0x7e, 0xac, 0xf3 } }

class nsFrameMessageManager;

namespace IPC {
class Principal;
} // namespace IPC

namespace mozilla {

namespace jsipc {
class PJavaScriptParent;
class CpowEntry;
} // namespace jsipc

namespace dom {

class BlobConstructorParams;
class BlobParent;
class ContentParent;
class File;
class IPCTabContext;
class PBlobParent;
class PBrowserParent;

class nsIContentParent : public nsISupports
                       , public mozilla::dom::ipc::MessageManagerCallback
                       , public CPOWManagerGetter
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTPARENT_IID)

  nsIContentParent();

  BlobParent* GetOrCreateActorForBlob(File* aBlob);

  virtual ContentParentId ChildID() = 0;
  virtual bool IsForApp() = 0;
  virtual bool IsForBrowser() = 0;

  virtual PBlobParent* SendPBlobConstructor(
    PBlobParent* aActor,
    const BlobConstructorParams& aParams) NS_WARN_UNUSED_RESULT = 0;

  virtual PBrowserParent* SendPBrowserConstructor(
    PBrowserParent* actor,
    const TabId& aTabId,
    const IPCTabContext& context,
    const uint32_t& chromeFlags,
    const ContentParentId& aCpId,
    const bool& aIsForApp,
    const bool& aIsForBrowser) NS_WARN_UNUSED_RESULT = 0;

  virtual bool IsContentParent() { return false; }
  ContentParent* AsContentParent();

protected: // methods
  ;

protected: // IPDL methods
  ;
  ;

  ;
  ;

  ;

  ;

  ;
  ;
  ;

protected: // members
  nsRefPtr<nsFrameMessageManager> mMessageManager;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentParent, NS_ICONTENTPARENT_IID)

} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_nsIContentParent_h */
# 118 "../../dist/include/mozilla/dom/nsIContentParent.h"
# 12 "../../dist/include/mozilla/dom/ContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/GeckoChildProcessHost.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ipc/GeckoChildProcessHost.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __IPC_GLUE_GECKOCHILDPROCESSHOST_H__
#define __IPC_GLUE_GECKOCHILDPROCESSHOST_H__

#if 0 /* expanded by -frewrite-includes */
#include "base/file_path.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/ipc/GeckoChildProcessHost.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/process_util.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/ipc/GeckoChildProcessHost.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/waitable_event.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_WAITABLE_EVENT_H_
#define BASE_WAITABLE_EVENT_H_

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"

#if defined(OS_WIN)
#if 0 /* expanded by -frewrite-includes */
#include <windows.h>
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"
#endif
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"

#if defined(OS_POSIX)
#if 0 /* expanded by -frewrite-includes */
#include <list>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 1 3
// -*- C++ -*-
//===---------------------------- list ------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP_LIST
#define _LIBCPP_LIST

/*
    list synopsis

namespace std
{

template <class T, class Alloc = allocator<T> >
class list
{
public:
    template <class Compare>
        void sort(Compare comp);
    void reverse() noexcept;
};
#include <limits>
#endif /* expanded by -frewrite-includes */
# 176 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
#if 0 /* expanded by -frewrite-includes */
#include <initializer_list>
#endif /* expanded by -frewrite-includes */
# 177 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
#if 0 /* expanded by -frewrite-includes */
#include <iterator>
#endif /* expanded by -frewrite-includes */
# 178 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
#if 0 /* expanded by -frewrite-includes */
#include <algorithm>
#endif /* expanded by -frewrite-includes */
# 179 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

#if 0 /* expanded by -frewrite-includes */
#include <__undef_min_max>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 1 3
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifdef min
#if defined(_MSC_VER) && ! defined(__clang__)
# 26 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#warning: macro max is incompatible with C++.  #undefing max
#endif
# 28 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
#undef max
#endif
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__undef_min_max" 3
# 181 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 2 3

#ifdef _LIBCPP_DEBUG
#if 0 /* expanded by -frewrite-includes */
#   include <__debug>
#endif /* expanded by -frewrite-includes */
# 184 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
#else
# 185 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
#   define _LIBCPP_ASSERT(x, m) ((void)0)
#endif
# 187 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#if 0 /* expanded by -frewrite-includes */
#pragma GCC system_header
#endif /* expanded by -frewrite-includes */
# 190 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
#endif
# 191 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

_LIBCPP_BEGIN_NAMESPACE_STD

template <class _Tp, class _VoidPtr> struct __list_node;

template <class _Tp, class _VoidPtr>
struct __list_node_base
{
    typedef typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
        rebind<__list_node<_Tp, _VoidPtr> > pointer;
#else
# 203 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        rebind<__list_node<_Tp, _VoidPtr> >::other pointer;
#endif
# 205 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    typedef typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
        rebind<__list_node_base> __base_pointer;
#else
# 210 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        rebind<__list_node_base>::other __base_pointer;
#endif
# 212 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    pointer __prev_;
    pointer __next_;

    _LIBCPP_INLINE_VISIBILITY
    __list_node_base()
        : __prev_(static_cast<pointer>(pointer_traits<__base_pointer>::pointer_to(*this))),
          __next_(static_cast<pointer>(pointer_traits<__base_pointer>::pointer_to(*this)))
          {}
};

template <class _Tp, class _VoidPtr>
struct __list_node
    : public __list_node_base<_Tp, _VoidPtr>
{
    _Tp __value_;
};

template <class _Tp, class _Alloc> class _LIBCPP_TYPE_VIS_ONLY list;
template <class _Tp, class _Alloc> class __list_imp;
template <class _Tp, class _VoidPtr> class _LIBCPP_TYPE_VIS_ONLY __list_const_iterator;

template <class _Tp, class _VoidPtr>
class _LIBCPP_TYPE_VIS_ONLY __list_iterator
{
    typedef typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
        rebind<__list_node<_Tp, _VoidPtr> > __node_pointer;
#else
# 241 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        rebind<__list_node<_Tp, _VoidPtr> >::other __node_pointer;
#endif
# 243 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    __node_pointer __ptr_;

#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_INLINE_VISIBILITY
    explicit __list_iterator(__node_pointer __p, const void* __c) _NOEXCEPT
        : __ptr_(__p)
    {
        __get_db()->__insert_ic(this, __c);
    }
#else
# 254 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    _LIBCPP_INLINE_VISIBILITY
    explicit __list_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
#endif
# 257 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3



    template<class, class> friend class list;
    template<class, class> friend class __list_imp;
    template<class, class> friend class __list_const_iterator;
public:
    typedef bidirectional_iterator_tag       iterator_category;
    typedef _Tp                              value_type;
    typedef value_type&                      reference;
    typedef typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<value_type>
#else
# 271 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
            rebind<value_type>::other
#endif
# 273 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
                                             pointer;
    typedef typename pointer_traits<pointer>::difference_type difference_type;

    _LIBCPP_INLINE_VISIBILITY
    __list_iterator() _NOEXCEPT : __ptr_(nullptr)
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__insert_i(this);
#endif
# 282 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    }

#if _LIBCPP_DEBUG_LEVEL >= 2

    _LIBCPP_INLINE_VISIBILITY
    __list_iterator(const __list_iterator& __p)
        : __ptr_(__p.__ptr_)
    {
        __get_db()->__iterator_copy(this, &__p);
    }

    _LIBCPP_INLINE_VISIBILITY
    ~__list_iterator()
    {
        __get_db()->__erase_i(this);
    }

    _LIBCPP_INLINE_VISIBILITY
    __list_iterator& operator=(const __list_iterator& __p)
    {
        if (this != &__p)
        {
            __get_db()->__iterator_copy(this, &__p);
            __ptr_ = __p.__ptr_;
        }
        return *this;
    }

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 311 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    _LIBCPP_INLINE_VISIBILITY
    reference operator*() const
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to dereference a non-dereferenceable list::iterator");
#endif
# 319 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        return __ptr_->__value_;
    }
    _LIBCPP_INLINE_VISIBILITY
    pointer operator->() const
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to dereference a non-dereferenceable list::iterator");
#endif
# 328 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        return pointer_traits<pointer>::pointer_to(__ptr_->__value_);
    }

    _LIBCPP_INLINE_VISIBILITY
    __list_iterator& operator++()
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to increment non-incrementable list::iterator");
#endif
# 338 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        __ptr_ = __ptr_->__next_;
        return *this;
    }

    
    
};

template <class _Tp, class _VoidPtr>
class _LIBCPP_TYPE_VIS_ONLY __list_const_iterator
{
    typedef typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
        rebind<__list_node<_Tp, _VoidPtr> > __node_pointer;
#else
# 374 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        rebind<__list_node<_Tp, _VoidPtr> >::other __node_pointer;
#endif
# 376 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    __node_pointer __ptr_;

#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_INLINE_VISIBILITY
    explicit __list_const_iterator(__node_pointer __p, const void* __c) _NOEXCEPT
        : __ptr_(__p)
    {
        __get_db()->__insert_ic(this, __c);
    }
#else
# 387 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    _LIBCPP_INLINE_VISIBILITY
    explicit __list_const_iterator(__node_pointer __p) _NOEXCEPT : __ptr_(__p) {}
#endif
# 390 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    template<class, class> friend class list;
    template<class, class> friend class __list_imp;
public:
    typedef bidirectional_iterator_tag       iterator_category;
    typedef _Tp                              value_type;
    typedef const value_type&                reference;
    typedef typename pointer_traits<_VoidPtr>::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
            rebind<const value_type>
#else
# 401 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
            rebind<const value_type>::other
#endif
# 403 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
                                             pointer;
    typedef typename pointer_traits<pointer>::difference_type difference_type;

    _LIBCPP_INLINE_VISIBILITY
    __list_const_iterator() _NOEXCEPT : __ptr_(nullptr)
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__insert_i(this);
#endif
# 412 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    }
    _LIBCPP_INLINE_VISIBILITY
    __list_const_iterator(const __list_iterator<_Tp, _VoidPtr>& __p) _NOEXCEPT
        : __ptr_(__p.__ptr_)
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__iterator_copy(this, &__p);
#endif
# 420 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    }

#if _LIBCPP_DEBUG_LEVEL >= 2

    _LIBCPP_INLINE_VISIBILITY
    __list_const_iterator(const __list_const_iterator& __p)
        : __ptr_(__p.__ptr_)
    {
        __get_db()->__iterator_copy(this, &__p);
    }

    _LIBCPP_INLINE_VISIBILITY
    ~__list_const_iterator()
    {
        __get_db()->__erase_i(this);
    }

    _LIBCPP_INLINE_VISIBILITY
    __list_const_iterator& operator=(const __list_const_iterator& __p)
    {
        if (this != &__p)
        {
            __get_db()->__iterator_copy(this, &__p);
            __ptr_ = __p.__ptr_;
        }
        return *this;
    }

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 449 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    _LIBCPP_INLINE_VISIBILITY
    reference operator*() const
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to dereference a non-dereferenceable list::const_iterator");
#endif
# 456 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        return __ptr_->__value_;
    }
    _LIBCPP_INLINE_VISIBILITY
    pointer operator->() const
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to dereference a non-dereferenceable list::iterator");
#endif
# 465 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        return pointer_traits<pointer>::pointer_to(__ptr_->__value_);
    }

    _LIBCPP_INLINE_VISIBILITY
    __list_const_iterator& operator++()
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        _LIBCPP_ASSERT(__get_const_db()->__dereferenceable(this),
                       "Attempted to increment non-incrementable list::const_iterator");
#endif
# 475 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        __ptr_ = __ptr_->__next_;
        return *this;
    }

    
    
};

template <class _Tp, class _Alloc>
class __list_imp
{
    __list_imp(const __list_imp&);
    __list_imp& operator=(const __list_imp&);
protected:
    typedef _Tp                                                     value_type;
    typedef _Alloc                                                  allocator_type;
    typedef allocator_traits<allocator_type>                        __alloc_traits;
    typedef typename __alloc_traits::size_type                      size_type;
    typedef typename __alloc_traits::void_pointer                   __void_pointer;
    typedef __list_iterator<value_type, __void_pointer>             iterator;
    typedef __list_const_iterator<value_type, __void_pointer>       const_iterator;
    typedef __list_node_base<value_type, __void_pointer>            __node_base;
    typedef __list_node<value_type, __void_pointer>                 __node;
    typedef typename __alloc_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
                rebind_alloc<__node>
#else
# 523 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
                rebind_alloc<__node>::other
#endif
# 525 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
                                                                     __node_allocator;
    typedef allocator_traits<__node_allocator>                       __node_alloc_traits;
    typedef typename __node_alloc_traits::pointer                    __node_pointer;
    typedef typename __node_alloc_traits::pointer                    __node_const_pointer;
    typedef typename __alloc_traits::pointer                         pointer;
    typedef typename __alloc_traits::const_pointer                   const_pointer;
    typedef typename __alloc_traits::difference_type                 difference_type;

    typedef typename __alloc_traits::template
#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES
                rebind_alloc<__node_base>
#else
# 537 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
                rebind_alloc<__node_base>::other
#endif
# 539 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
                                                                     __node_base_allocator;
    typedef typename allocator_traits<__node_base_allocator>::pointer __node_base_pointer;

    __node_base __end_;
    __compressed_pair<size_type, __node_allocator> __size_alloc_;

    _LIBCPP_INLINE_VISIBILITY
          size_type& __sz() _NOEXCEPT {return __size_alloc_.first();}
    _LIBCPP_INLINE_VISIBILITY
    const size_type& __sz() const _NOEXCEPT
        {return __size_alloc_.first();}
    _LIBCPP_INLINE_VISIBILITY
          __node_allocator& __node_alloc() _NOEXCEPT
          {return __size_alloc_.second();}
    _LIBCPP_INLINE_VISIBILITY
    const __node_allocator& __node_alloc() const _NOEXCEPT
        {return __size_alloc_.second();}

    static void __unlink_nodes(__node_pointer __f, __node_pointer __l) _NOEXCEPT;

    __list_imp()
        _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value);
    __list_imp(const allocator_type& __a);
    ~__list_imp();
    void clear() _NOEXCEPT;
    _LIBCPP_INLINE_VISIBILITY
    bool empty() const _NOEXCEPT {return __sz() == 0;}

    _LIBCPP_INLINE_VISIBILITY
    iterator begin() _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        return iterator(__end_.__next_, this);
#else
# 573 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        return iterator(__end_.__next_);
#endif
# 575 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    }
    _LIBCPP_INLINE_VISIBILITY
    const_iterator begin() const  _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        return const_iterator(__end_.__next_, this);
#else
# 582 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        return const_iterator(__end_.__next_);
#endif
# 584 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    }
    _LIBCPP_INLINE_VISIBILITY
    iterator end() _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        return iterator(static_cast<__node_pointer>(
                pointer_traits<__node_base_pointer>::pointer_to(__end_)), this);
#else
# 592 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        return iterator(static_cast<__node_pointer>(
                      pointer_traits<__node_base_pointer>::pointer_to(__end_)));
#endif
# 595 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    }
    _LIBCPP_INLINE_VISIBILITY
    const_iterator end() const _NOEXCEPT
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        return const_iterator(static_cast<__node_const_pointer>(
        pointer_traits<__node_base_pointer>::pointer_to(const_cast<__node_base&>(__end_))), this);
#else
# 603 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        return const_iterator(static_cast<__node_const_pointer>(
        pointer_traits<__node_base_pointer>::pointer_to(const_cast<__node_base&>(__end_))));
#endif
# 606 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    }

    void swap(__list_imp& __c)
        _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<__node_allocator>::value);

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const __list_imp& __c)
        {__copy_assign_alloc(__c, integral_constant<bool,
                      __node_alloc_traits::propagate_on_container_swap::value>());}
    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, true_type)
        _NOEXCEPT_(__is_nothrow_swappable<__node_allocator>::value)
        {
            using _VSTD::swap;
            swap(__x, __y);
        }
    _LIBCPP_INLINE_VISIBILITY
    static void __swap_alloc(__node_allocator& __x, __node_allocator& __y, false_type)
        _NOEXCEPT
        {}

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const __list_imp& __c, true_type)
        {
            if (__node_alloc() != __c.__node_alloc())
                clear();
            __node_alloc() = __c.__node_alloc();
        }

    _LIBCPP_INLINE_VISIBILITY
    void __copy_assign_alloc(const __list_imp& __c, false_type)
        {}

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__list_imp& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
        {
            __node_alloc() = _VSTD::move(__c.__node_alloc());
        }

    _LIBCPP_INLINE_VISIBILITY
    void __move_assign_alloc(__list_imp& __c, false_type)
        _NOEXCEPT
        {}
};

// Unlink nodes [__f, __l]
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
void
__list_imp<_Tp, _Alloc>::__unlink_nodes(__node_pointer __f, __node_pointer __l)
    _NOEXCEPT
{
    __f->__prev_->__next_ = __l->__next_;
    __l->__next_->__prev_ = __f->__prev_;
}
template <class _Tp, class _Alloc>
__list_imp<_Tp, _Alloc>::~__list_imp()
{
    clear();
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__erase_c(this);
#endif
# 702 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
}

template <class _Tp, class _Alloc>
void
__list_imp<_Tp, _Alloc>::clear() _NOEXCEPT
{
    if (!empty())
    {
        __node_allocator& __na = __node_alloc();
        __node_pointer __f = __end_.__next_;
        __node_pointer __l = static_cast<__node_pointer>(
                       pointer_traits<__node_base_pointer>::pointer_to(__end_));
        __unlink_nodes(__f, __l->__prev_);
        __sz() = 0;
        while (__f != __l)
        {
            __node_pointer __n = __f;
            __f = __f->__next_;
            __node_alloc_traits::destroy(__na, _VSTD::addressof(__n->__value_));
            __node_alloc_traits::deallocate(__na, __n, 1);
        }
#if _LIBCPP_DEBUG_LEVEL >= 2
        __c_node* __c = __get_db()->__find_c_and_lock(this);
        for (__i_node** __p = __c->end_; __p != __c->beg_; )
        {
            --__p;
            const_iterator* __i = static_cast<const_iterator*>((*__p)->__i_);
            if (__i->__ptr_ != __l)
            {
                (*__p)->__c_ = nullptr;
                if (--__c->end_ != __p)
                    memmove(__p, __p+1, (__c->end_ - __p)*sizeof(__i_node*));
            }
        }
        __get_db()->unlock();
#endif
# 738 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    }
}

template <class _Tp, class _Alloc>
void
__list_imp<_Tp, _Alloc>::swap(__list_imp& __c)
        _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<__node_allocator>::value)
{
    _LIBCPP_ASSERT(__alloc_traits::propagate_on_container_swap::value ||
                   this->__node_alloc() == __c.__node_alloc(),
                   "list::swap: Either propagate_on_container_swap must be true"
                   " or the allocators must compare equal");
    using _VSTD::swap;
    __swap_alloc(__node_alloc(), __c.__node_alloc());
    swap(__sz(), __c.__sz());
    swap(__end_, __c.__end_);
    if (__sz() == 0)
        __end_.__next_ = __end_.__prev_ = static_cast<__node_pointer>(
                       pointer_traits<__node_base_pointer>::pointer_to(__end_));
    else
        __end_.__prev_->__next_ = __end_.__next_->__prev_
                                = static_cast<__node_pointer>(
                       pointer_traits<__node_base_pointer>::pointer_to(__end_));
    if (__c.__sz() == 0)
        __c.__end_.__next_ = __c.__end_.__prev_
                           = static_cast<__node_pointer>(
                       pointer_traits<__node_base_pointer>::pointer_to(__c.__end_));
    else
        __c.__end_.__prev_->__next_ = __c.__end_.__next_->__prev_
                                    = static_cast<__node_pointer>(
                       pointer_traits<__node_base_pointer>::pointer_to(__c.__end_));
#if _LIBCPP_DEBUG_LEVEL >= 2
    __libcpp_db* __db = __get_db();
    __c_node* __cn1 = __db->__find_c_and_lock(this);
    __db->unlock();
#endif
# 807 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
}

template <class _Tp, class _Alloc = allocator<_Tp> >
class _LIBCPP_TYPE_VIS_ONLY list
    : private __list_imp<_Tp, _Alloc>
{
    typedef __list_imp<_Tp, _Alloc> base;
    typedef typename base::__node              __node;
    typedef typename base::__node_allocator    __node_allocator;
    typedef typename base::__node_pointer      __node_pointer;
    typedef typename base::__node_alloc_traits __node_alloc_traits;
    typedef typename base::__node_base         __node_base;
    typedef typename base::__node_base_pointer __node_base_pointer;

public:
    typedef _Tp                                      value_type;
    typedef _Alloc                                   allocator_type;
    static_assert((is_same<value_type, typename allocator_type::value_type>::value),
                  "Invalid allocator::value_type");
    typedef value_type&                              reference;
    typedef const value_type&                        const_reference;
    typedef typename base::pointer                   pointer;
    typedef typename base::const_pointer             const_pointer;
    typedef typename base::size_type                 size_type;
    typedef typename base::difference_type           difference_type;
    typedef typename base::iterator                  iterator;
    typedef typename base::const_iterator            const_iterator;
    typedef _VSTD::reverse_iterator<iterator>         reverse_iterator;
    typedef _VSTD::reverse_iterator<const_iterator>   const_reverse_iterator;

    _LIBCPP_INLINE_VISIBILITY
    list()
        _NOEXCEPT_(is_nothrow_default_constructible<__node_allocator>::value)
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__insert_c(this);
#endif
# 844 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    }
    _LIBCPP_INLINE_VISIBILITY
    explicit list(const allocator_type& __a) : base(__a)
    {
#if _LIBCPP_DEBUG_LEVEL >= 2
        __get_db()->__insert_c(this);
#endif
# 851 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    }
    explicit list(size_type __n);
#if _LIBCPP_STD_VER > 11
    explicit list(size_type __n, const allocator_type& __a);
#endif
# 856 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    list(size_type __n, const value_type& __x);
    list(size_type __n, const value_type& __x, const allocator_type& __a);
    template <class _InpIter>
        list(_InpIter __f, _InpIter __l,
             typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
    template <class _InpIter>
        list(_InpIter __f, _InpIter __l, const allocator_type& __a,
             typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);

    list(const list& __c);
    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    list(initializer_list<value_type> __il);
    list(initializer_list<value_type> __il, const allocator_type& __a);
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 872 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    list(list&& __c)
        _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
    list(list&& __c, const allocator_type& __a);
    list& operator=(list&& __c)
        _NOEXCEPT_(
            __node_alloc_traits::propagate_on_container_move_assignment::value &&
            is_nothrow_move_assignable<__node_allocator>::value);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 881 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    list& operator=(initializer_list<value_type> __il)
        {assign(__il.begin(), __il.end()); return *this;}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 886 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    void assign(initializer_list<value_type> __il)
        {assign(__il.begin(), __il.end());}
#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 896 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    allocator_type get_allocator() const _NOEXCEPT;

    _LIBCPP_INLINE_VISIBILITY
    size_type size() const _NOEXCEPT     {return base::__sz();}
    _LIBCPP_INLINE_VISIBILITY
    bool empty() const _NOEXCEPT         {return base::empty();}
    _LIBCPP_INLINE_VISIBILITY
    size_type max_size() const _NOEXCEPT
        {return numeric_limits<difference_type>::max();}

    _LIBCPP_INLINE_VISIBILITY
          iterator begin() _NOEXCEPT        {return base::begin();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator begin()  const _NOEXCEPT {return base::begin();}
    _LIBCPP_INLINE_VISIBILITY
          iterator end() _NOEXCEPT          {return base::end();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator end()    const _NOEXCEPT {return base::end();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator cbegin() const _NOEXCEPT {return base::begin();}
    _LIBCPP_INLINE_VISIBILITY
    const_iterator cend()   const _NOEXCEPT {return base::end();}

    _LIBCPP_INLINE_VISIBILITY
          reverse_iterator rbegin() _NOEXCEPT
            {return       reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rbegin()  const _NOEXCEPT
        {return const_reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
          reverse_iterator rend() _NOEXCEPT
            {return       reverse_iterator(begin());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator rend()    const _NOEXCEPT
        {return const_reverse_iterator(begin());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crbegin() const _NOEXCEPT
        {return const_reverse_iterator(end());}
    _LIBCPP_INLINE_VISIBILITY
    const_reverse_iterator crend()   const _NOEXCEPT
        {return const_reverse_iterator(begin());}

    _LIBCPP_INLINE_VISIBILITY
    reference front()
    {
        _LIBCPP_ASSERT(!empty(), "list::front called on empty list");
        return base::__end_.__next_->__value_;
    }
    _LIBCPP_INLINE_VISIBILITY
    const_reference front() const
    {
        _LIBCPP_ASSERT(!empty(), "list::front called on empty list");
        return base::__end_.__next_->__value_;
    }
    _LIBCPP_INLINE_VISIBILITY
    reference back()
    {
        _LIBCPP_ASSERT(!empty(), "list::back called on empty list");
        return base::__end_.__prev_->__value_;
    }
    _LIBCPP_INLINE_VISIBILITY
    const_reference back() const
    {
        _LIBCPP_ASSERT(!empty(), "list::back called on empty list");
        return base::__end_.__prev_->__value_;
    }

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    void push_front(value_type&& __x);
    void push_back(value_type&& __x);
#ifndef _LIBCPP_HAS_NO_VARIADICS
    template <class... _Args>
       void emplace_front(_Args&&... __args);
    template <class... _Args>
        void emplace_back(_Args&&... __args);
    template <class... _Args>
        iterator emplace(const_iterator __p, _Args&&... __args);
#endif  // _LIBCPP_HAS_NO_VARIADICS
# 975 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    iterator insert(const_iterator __p, value_type&& __x);
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 977 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    ;
    void push_back(const value_type& __x);

    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
    _LIBCPP_INLINE_VISIBILITY
    iterator insert(const_iterator __p, initializer_list<value_type> __il)
        {return insert(__p, __il.begin(), __il.end());}
#endif   // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 991 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    _LIBCPP_INLINE_VISIBILITY
    void swap(list& __c)
        _NOEXCEPT_(!__node_alloc_traits::propagate_on_container_swap::value ||
                   __is_nothrow_swappable<__node_allocator>::value)
        {base::swap(__c);}
    _LIBCPP_INLINE_VISIBILITY
    void clear() _NOEXCEPT {base::clear();}

    ;
    ;

    ;
    ;

    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l)
        {splice(__p, __c, __f, __l);}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1026 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

    ;
    ;
    ;
    ;
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    _LIBCPP_INLINE_VISIBILITY
    void merge(list&& __c) {merge(__c);}
#endif
# 1037 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    ;
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
    template <class _Comp>
    _LIBCPP_INLINE_VISIBILITY
        void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1044 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    ;
    ;

    void reverse() _NOEXCEPT;

    ;

#if _LIBCPP_DEBUG_LEVEL >= 2

    bool __dereferenceable(const const_iterator* __i) const;
    bool __decrementable(const const_iterator* __i) const;
    bool __addable(const const_iterator* __i, ptrdiff_t __n) const;
    bool __subscriptable(const const_iterator* __i, ptrdiff_t __n) const;

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 1060 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

private:
    static void __link_nodes(__node_pointer __p, __node_pointer __f, __node_pointer __l);
    iterator __iterator(size_type __n);
    template <class _Comp>
        static iterator __sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp);

    void __move_assign(list& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value);
    void __move_assign(list& __c, false_type);
};

// Link in nodes [__f, __l] just prior to __p
template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
void
list<_Tp, _Alloc>::__link_nodes(__node_pointer __p, __node_pointer __f, __node_pointer __l)
{
    __p->__prev_->__next_ = __f;
    __f->__prev_ = __p->__prev_;
    __p->__prev_ = __l;
    __l->__next_ = __p;
}

template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::__iterator(size_type __n)
{
    return __n <= base::__sz() / 2 ? _VSTD::next(begin(), __n)
                                   : _VSTD::prev(end(), base::__sz() - __n);
}

template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1099 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    for (; __n > 0; --__n)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
        emplace_back();
#else
# 1103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        push_back(value_type());
#endif
# 1105 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
}

#if _LIBCPP_STD_VER > 11
template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n, const allocator_type& __a) : base(__a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1114 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    for (; __n > 0; --__n)
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
        emplace_back();
#else
# 1118 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
        push_back(value_type());
#endif
# 1120 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
}
#endif
# 1122 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n, const value_type& __x)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1129 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    for (; __n > 0; --__n)
        push_back(__x);
}

template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(size_type __n, const value_type& __x, const allocator_type& __a)
    : base(__a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1140 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    for (; __n > 0; --__n)
        push_back(__x);
}

template <class _Tp, class _Alloc>
template <class _InpIter>
list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l,
                        typename enable_if<__is_input_iterator<_InpIter>::value>::type*)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1152 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    for (; __f != __l; ++__f)
        push_back(*__f);
}

template <class _Tp, class _Alloc>
template <class _InpIter>
list<_Tp, _Alloc>::list(_InpIter __f, _InpIter __l, const allocator_type& __a,
                        typename enable_if<__is_input_iterator<_InpIter>::value>::type*)
    : base(__a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1165 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    for (; __f != __l; ++__f)
        push_back(*__f);
}

#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
    : base(__a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1202 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
            __e = __il.end(); __i != __e; ++__i)
        push_back(*__i);
}

template <class _Tp, class _Alloc>
list<_Tp, _Alloc>::list(initializer_list<value_type> __il)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1213 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    for (typename initializer_list<value_type>::const_iterator __i = __il.begin(),
            __e = __il.end(); __i != __e; ++__i)
        push_back(*__i);
}

#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
# 1219 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3



#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
list<_Tp, _Alloc>::list(list&& __c)
    _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value)
    : base(allocator_type(_VSTD::move(__c.__node_alloc())))
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1244 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    splice(end(), __c);
}

template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
list<_Tp, _Alloc>::list(list&& __c, const allocator_type& __a)
    : base(__a)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    __get_db()->__insert_c(this);
#endif
# 1255 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    if (__a == __c.get_allocator())
        splice(end(), __c);
    else
    {
        typedef move_iterator<iterator> _Ip;
        assign(_Ip(__c.begin()), _Ip(__c.end()));
    }
}

template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
list<_Tp, _Alloc>&
list<_Tp, _Alloc>::operator=(list&& __c)
        _NOEXCEPT_(
            __node_alloc_traits::propagate_on_container_move_assignment::value &&
            is_nothrow_move_assignable<__node_allocator>::value)
{
    __move_assign(__c, integral_constant<bool,
          __node_alloc_traits::propagate_on_container_move_assignment::value>());
    return *this;
}

template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::__move_assign(list& __c, false_type)
{
    if (base::__node_alloc() != __c.__node_alloc())
    {
        typedef move_iterator<iterator> _Ip;
        assign(_Ip(__c.begin()), _Ip(__c.end()));
    }
    else
        __move_assign(__c, true_type());
}

template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::__move_assign(list& __c, true_type)
        _NOEXCEPT_(is_nothrow_move_assignable<__node_allocator>::value)
{
    clear();
    base::__move_assign_alloc(__c);
    splice(end(), __c);
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1301 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3





template <class _Tp, class _Alloc>
inline _LIBCPP_INLINE_VISIBILITY
_Alloc
list<_Tp, _Alloc>::get_allocator() const _NOEXCEPT
{
    return allocator_type(base::__node_alloc());
}









template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::push_back(const value_type& __x)
{
    __node_allocator& __na = base::__node_alloc();
    typedef __allocator_destructor<__node_allocator> _Dp;
    unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), __x);
    __link_nodes(static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::
                         pointer_to(base::__end_)), __hold.get(), __hold.get());
    ++base::__sz();
    __hold.release();
}

#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES

template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::push_front(value_type&& __x)
{
    __node_allocator& __na = base::__node_alloc();
    typedef __allocator_destructor<__node_allocator> _Dp;
    unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
    __link_nodes(base::__end_.__next_, __hold.get(), __hold.get());
    ++base::__sz();
    __hold.release();
}

template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::push_back(value_type&& __x)
{
    __node_allocator& __na = base::__node_alloc();
    typedef __allocator_destructor<__node_allocator> _Dp;
    unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
    __link_nodes(static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::
                         pointer_to(base::__end_)), __hold.get(), __hold.get());
    ++base::__sz();
    __hold.release();
}

#ifndef _LIBCPP_HAS_NO_VARIADICS

template <class _Tp, class _Alloc>
template <class... _Args>
void
list<_Tp, _Alloc>::emplace_front(_Args&&... __args)
{
    __node_allocator& __na = base::__node_alloc();
    typedef __allocator_destructor<__node_allocator> _Dp;
    unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
    __link_nodes(base::__end_.__next_, __hold.get(), __hold.get());
    ++base::__sz();
    __hold.release();
}

template <class _Tp, class _Alloc>
template <class... _Args>
void
list<_Tp, _Alloc>::emplace_back(_Args&&... __args)
{
    __node_allocator& __na = base::__node_alloc();
    typedef __allocator_destructor<__node_allocator> _Dp;
    unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
    __link_nodes(static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::
                         pointer_to(base::__end_)), __hold.get(), __hold.get());
    ++base::__sz();
    __hold.release();
}

template <class _Tp, class _Alloc>
template <class... _Args>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::emplace(const_iterator __p, _Args&&... __args)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
        "list::emplace(iterator, args...) called with an iterator not"
        " referring to this list");
#endif
# 1594 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    __node_allocator& __na = base::__node_alloc();
    typedef __allocator_destructor<__node_allocator> _Dp;
    unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
    __hold->__prev_ = 0;
    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::forward<_Args>(__args)...);
    __link_nodes(__p.__ptr_, __hold.get(), __hold.get());
    ++base::__sz();
#if _LIBCPP_DEBUG_LEVEL >= 2
    return iterator(__hold.release(), this);
#else
# 1604 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    return iterator(__hold.release());
#endif
# 1606 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
}

#endif  // _LIBCPP_HAS_NO_VARIADICS
# 1609 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3

template <class _Tp, class _Alloc>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
{
#if _LIBCPP_DEBUG_LEVEL >= 2
    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
        "list::insert(iterator, x) called with an iterator not"
        " referring to this list");
#endif
# 1619 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    __node_allocator& __na = base::__node_alloc();
    typedef __allocator_destructor<__node_allocator> _Dp;
    unique_ptr<__node, _Dp> __hold(__node_alloc_traits::allocate(__na, 1), _Dp(__na, 1));
    __hold->__prev_ = 0;
    __node_alloc_traits::construct(__na, _VSTD::addressof(__hold->__value_), _VSTD::move(__x));
    __link_nodes(__p.__ptr_, __hold.get(), __hold.get());
    ++base::__sz();
#if _LIBCPP_DEBUG_LEVEL >= 2
    return iterator(__hold.release(), this);
#else
# 1629 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
    return iterator(__hold.release());
#endif
# 1631 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
}

#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
# 1634 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3




template <class _Tp, class _Alloc>
template <class _Comp>
typename list<_Tp, _Alloc>::iterator
list<_Tp, _Alloc>::__sort(iterator __f1, iterator __e2, size_type __n, _Comp& __comp)
{
    switch (__n)
    {
    case 0:
    case 1:
        return __f1;
    case 2:
        if (__comp(*--__e2, *__f1))
        {
            __node_pointer __f = __e2.__ptr_;
            base::__unlink_nodes(__f, __f);
            __link_nodes(__f1.__ptr_, __f, __f);
            return __e2;
        }
        return __f1;
    }
    size_type __n2 = __n / 2;
    iterator __e1 = _VSTD::next(__f1, __n2);
    iterator  __r = __f1 = __sort(__f1, __e1, __n2, __comp);
    iterator __f2 = __e1 = __sort(__e1, __e2, __n - __n2, __comp);
    if (__comp(*__f2, *__f1))
    {
        iterator __m2 = _VSTD::next(__f2);
        for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
            ;
        __node_pointer __f = __f2.__ptr_;
        __node_pointer __l = __m2.__ptr_->__prev_;
        __r = __f2;
        __e1 = __f2 = __m2;
        base::__unlink_nodes(__f, __l);
        __m2 = _VSTD::next(__f1);
        __link_nodes(__f1.__ptr_, __f, __l);
        __f1 = __m2;
    }
    else
        ++__f1;
    while (__f1 != __e1 && __f2 != __e2)
    {
        if (__comp(*__f2, *__f1))
        {
            iterator __m2 = _VSTD::next(__f2);
            for (; __m2 != __e2 && __comp(*__m2, *__f1); ++__m2)
                ;
            __node_pointer __f = __f2.__ptr_;
            __node_pointer __l = __m2.__ptr_->__prev_;
            if (__e1 == __f2)
                __e1 = __m2;
            __f2 = __m2;
            base::__unlink_nodes(__f, __l);
            __m2 = _VSTD::next(__f1);
            __link_nodes(__f1.__ptr_, __f, __l);
            __f1 = __m2;
        }
        else
            ++__f1;
    }
    return __r;
}

template <class _Tp, class _Alloc>
void
list<_Tp, _Alloc>::reverse() _NOEXCEPT
{
    if (base::__sz() > 1)
    {
        iterator __e = end();
        for (iterator __i = begin(); __i.__ptr_ != __e.__ptr_;)
        {
            _VSTD::swap(__i.__ptr_->__prev_, __i.__ptr_->__next_);
            __i.__ptr_ = __i.__ptr_->__prev_;
        }
        _VSTD::swap(__e.__ptr_->__prev_, __e.__ptr_->__next_);
    }
}



#if _LIBCPP_DEBUG_LEVEL >= 2

template <class _Tp, class _Alloc>
bool
list<_Tp, _Alloc>::__dereferenceable(const const_iterator* __i) const
{
    return __i->__ptr_ != static_cast<__node_pointer>(
                       pointer_traits<__node_base_pointer>::pointer_to(const_cast<__node_base&>(this->__end_)));
}

list<_Tp, _Alloc>::__subscriptable(const const_iterator* __i, ptrdiff_t __n) const
{
    return false;
}

#endif  // _LIBCPP_DEBUG_LEVEL >= 2
# 2295 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3















_LIBCPP_END_NAMESPACE_STD

#endif  // _LIBCPP_LIST
# 2356 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/list" 3
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <utility>
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"
// thread that has Wait()ed the longest is selected. The default policy
// may improve performance, as the selected thread may have a greater chance of
// having some of its stack data in various CPU caches.
//
// For a discussion of the many very subtle implementation details, see the FAQ
// at the end of condition_variable_win.cc.

#ifndef BASE_CONDITION_VARIABLE_H_
#define BASE_CONDITION_VARIABLE_H_

#if 0 /* expanded by -frewrite-includes */
#include "base/lock.h"
#endif /* expanded by -frewrite-includes */
# 69 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/condition_variable.h"

namespace base {
  class TimeDelta;
}

class ConditionVariable {
 public:
  // Construct a cv for use with ONLY one user lock.
  ;

  ;

  // Wait() releases the caller's critical section atomically as it starts to
  // sleep, and the reacquires it when it is signaled.
  ;
  ;

  // Broadcast() revives all waiting threads.
  ;
  // Signal() revives one waiting thread.
  ;

 private:

#if defined(OS_WIN)

  // Define Event class that is used to form circularly linked lists.
  // The list container is an element with NULL as its handle_ value.
  // The actual list elements have a non-zero handle_ value.
  // All calls to methods MUST be done under protection of a lock so that links
  // can be validated.  Without the lock, some links might asynchronously
  int allocation_counter_;

#elif defined(OS_POSIX)
# 165 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/condition_variable.h"

  pthread_cond_t condition_;
  pthread_mutex_t* user_mutex_;

#endif
# 170 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/condition_variable.h"

  DISALLOW_COPY_AND_ASSIGN(ConditionVariable);
};

#endif  // BASE_CONDITION_VARIABLE_H_
# 175 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/condition_variable.h"
# 18 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/lock.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"
#endif
# 22 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/message_loop.h"
#endif /* expanded by -frewrite-includes */
# 24 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"

namespace base {

// This replaces INFINITE from Win32
static const int kNoTimeout = -1;

class TimeDelta;

// A WaitableEvent can be a useful thread synchronization tool when you want to
// allow one thread to wait for another thread to finish some work. For
// non-Windows systems, this can only be used from within a single address
// space.
//
// Use a WaitableEvent when you would otherwise use a Lock+ConditionVariable to
// protect a simple boolean value.  However, if you find yourself using a
// WaitableEvent in conjunction with a Lock to wait for a more complex state
// change (e.g., for an item to be added to a queue), then you should probably
// be using a ConditionVariable instead of a WaitableEvent.
//
// NOTE: On Windows, this class provides a subset of the functionality afforded
// by a Windows event object.  This is intentional.  If you are writing Windows
// specific code and you need other features of a Windows event, then you might
// be better off just using an Windows event directly.
class WaitableEvent {
 public:
  // If manual_reset is true, then to set the event state to non-signaled, a
  ;

  // Wait up until max_time has passed for the event to be signaled.  Returns
  // true if the event was signaled.  If this method returns false, then it
  // does not necessarily mean that max_time was exceeded.
  ;
  // For asynchronous waiting, see WaitableEventWatcher

  // This is a private helper class. It's here because it's used by friends of
  // this class (such as WaitableEventWatcher) to be able to enqueue elements
  // of the wait-list
  class Waiter {
   public:
    // Signal the waiter to wake up.
    //
    // Consider the case of a Waiter which is in multiple WaitableEvent's
    // wait-lists. Each WaitableEvent is automatic-reset and two of them are
    // signaled at the same time. Now, each will wake only the first waiter in
    // the wake-list before resetting. However, if those two waiters happen to
    // be the same object (as can happen if another thread didn't have a chance
    // to dequeue the waiter from the other wait-list in time), two auto-resets
    // will have happened, but only one waiter has been signaled!
    //
    // Because of this, a Waiter may "reject" a wake by returning false. In
    // this case, the auto-reset WaitableEvent shouldn't act as if anything has
    // been notified.
    ;

    // Waiters may implement this in order to provide an extra condition for
    // two Waiters to be considered equal. In WaitableEvent::Dequeue, if the
    // pointers match then this function is called as a final check. See the
    // comments in ~Handle for why.
    ;
  };

 private:
  friend class WaitableEventWatcher;

#if defined(OS_WIN)
  HANDLE handle_;
#else
# 136 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"
  // On Windows, one can close a HANDLE which is currently being waited on. The
  // MSDN documentation says that the resulting behaviour is 'undefined', but
  // it doesn't crash. However, if we were to include the following members
  // directly then, on POSIX, one couldn't use WaitableEventWatcher to watch an
  // event which gets deleted. This mismatch has bitten us several times now,
  // so we have a kernel of the WaitableEvent, which is reference counted.
  // WaitableEventWatchers may then take a reference and thus match the Windows
  // behaviour.
  struct WaitableEventKernel MOZ_FINAL {
   public:
    NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WaitableEventKernel)
    

    ;

    Lock lock_;
    const bool manual_reset_;
    bool signaled_;
    std::list<Waiter*> waiters_;
   protected:
    ~WaitableEventKernel() {}
  };

  nsRefPtr<WaitableEventKernel> kernel_;

  ;
  ;
  ;

  // When dealing with arrays of WaitableEvent*, we want to sort by the address
  // of the WaitableEvent in order to have a globally consistent locking order.
  // In that case we keep them, in sorted order, in an array of pairs where the
  // second element is the index of the WaitableEvent in the original,
  // unsorted, array.
  typedef std::pair<WaitableEvent*, size_t> WaiterAndIndex;
  ;
#endif
# 177 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"

  DISALLOW_COPY_AND_ASSIGN(WaitableEvent);
};

}  // namespace base

#endif  // BASE_WAITABLE_EVENT_H_
# 184 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event.h"
# 11 "../../dist/include/mozilla/ipc/GeckoChildProcessHost.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/child_process_host.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_host.h" 1
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_CHILD_PROCESS_HOST_H_
#define CHROME_COMMON_CHILD_PROCESS_HOST_H_

#if 0 /* expanded by -frewrite-includes */
#include "build/build_config.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_host.h"

#if 0 /* expanded by -frewrite-includes */
#include <list>
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_host.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/basictypes.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_host.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/waitable_event_watcher.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h" 1
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef BASE_WAITABLE_EVENT_WATCHER_H_
#define BASE_WAITABLE_EVENT_WATCHER_H_

#if 0 /* expanded by -frewrite-includes */
#include "build/build_config.h"
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h"

#if defined(OS_WIN)
#if 0 /* expanded by -frewrite-includes */
#include "base/object_watcher.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h"
#else
# 13 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/message_loop.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/waitable_event.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h"
#endif
# 17 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h"

namespace base {

class Flag;
class AsyncWaiter;
class AsyncCallbackTask;
class WaitableEvent;

// -----------------------------------------------------------------------------
// This class provides a way to wait on a WaitableEvent asynchronously.
//
// Each instance of this object can be waiting on a single WaitableEvent. When
// the waitable event is signaled, a callback is made in the thread of a given
// MessageLoop. This callback can be deleted by deleting the waiter.
//
// goes out of scope, the watcher_ will be destroyed, and there is no need to
// worry about OnWaitableEventSignaled being called on a deleted MyClass
// pointer.
//
// BEWARE: With automatically reset WaitableEvents, a signal may be lost if it
// occurs just before a WaitableEventWatcher is deleted. There is currently no
// safe way to stop watching an automatic reset WaitableEvent without possibly
// missing a signal.
//
// NOTE: you /are/ allowed to delete the WaitableEvent while still waiting on
// it with a Watcher. It will act as if the event was never signaled.
// -----------------------------------------------------------------------------

class WaitableEventWatcher
#if defined(OS_POSIX)
    : public MessageLoop::DestructionObserver
#endif
# 65 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h"
{
 public:

  ;
  ;

  class Delegate {
   public:
    

    // -------------------------------------------------------------------------
    // This is called on the MessageLoop thread when WaitableEvent has been
    // signaled.
    //
    // Note: the event may not be signaled by the time that this function is
    // called. This indicates only that it has been signaled at some point in
    // the past.
    // -------------------------------------------------------------------------
    ;
  };

  // ---------------------------------------------------------------------------
  // When @event is signaled, the given delegate is called on the thread of the
  // current message loop when StartWatching is called. The delegate is not
  // deleted.
  // ---------------------------------------------------------------------------
  ;

  // ---------------------------------------------------------------------------
  // Cancel the current watch. Must be called from the same thread which
  WaitableEvent* event_;

#if defined(OS_WIN)
  // ---------------------------------------------------------------------------
  // The helper class exists because, if WaitableEventWatcher were to inherit
  // from ObjectWatcher::Delegate, then it couldn't also have an inner class
  // called Delegate (at least on Windows). Thus this object exists to proxy
  // the callback function
  // ---------------------------------------------------------------------------
  class ObjectWatcherHelper : public ObjectWatcher::Delegate {
   public:
    ObjectWatcherHelper(WaitableEventWatcher* watcher);

    // -------------------------------------------------------------------------
    // Implementation of ObjectWatcher::Delegate
    // -------------------------------------------------------------------------
  ;

  MessageLoop* message_loop_;
  nsRefPtr<Flag> cancel_flag_;
  AsyncWaiter* waiter_;
  AsyncCallbackTask* callback_task_;
  nsRefPtr<WaitableEvent::WaitableEventKernel> kernel_;
#endif
# 150 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h"
};

}  // namespace base

#endif  // BASE_WAITABLE_EVENT_WATCHER_H_
# 155 "/Users/luser/build/mozilla-central/ipc/chromium/src/base/waitable_event_watcher.h"
# 14 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_host.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/child_process_info.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_info.h" 1
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_COMMON_CHILD_PROCESS_INFO_H_
#define CHROME_COMMON_CHILD_PROCESS_INFO_H_

#if 0 /* expanded by -frewrite-includes */
#include <string>
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_info.h"

#if 0 /* expanded by -frewrite-includes */
#include "base/process.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_info.h"

// Holds information about a child process.
class ChildProcessInfo {
 public:
  enum ProcessType {
    BROWSER_PROCESS,
    RENDER_PROCESS,
    PLUGIN_PROCESS,
    WORKER_PROCESS,
    UNKNOWN_PROCESS
  };

  std::wstring name_;
  mutable int pid_;  // Cache of the process id.

  // The handle to the process.
  mutable base::Process process_;
};

#endif  // CHROME_COMMON_CHILD_PROCESS_INFO_H_
# 106 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_info.h"
# 15 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_host.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/ipc_channel.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_host.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_host.h"

namespace mozilla {
namespace ipc {
class FileDescriptor;
}
}

class NotificationType;

// Plugins/workers and other child processes that live on the IO thread should
// derive from this class.
class ChildProcessHost :
                         public IPC::Message::Sender,
                         public ChildProcessInfo,
                         public base::WaitableEventWatcher::Delegate,
                         public IPC::Channel::Listener {
 public:
  ;

  // ResourceDispatcherHost::Receiver implementation:
  ;

  // The Iterator class allows iteration through either all child processes, or
  // ones of a specific type, depending on which constructor is used.  Note that
  // this should be done from the IO thread and that the iterator should not be
  // kept around as it may be invalidated on subsequent event processing in the
  // event loop.
  ;

  // IPC::Channel::Listener implementation:
 protected:
  // WaitableEventWatcher::Delegate implementation:
  ;

 private:
  // By using an internal class as the IPC::Channel::Listener, we can intercept
  // OnMessageReceived/OnChannelConnected and do our own processing before
  // calling the subclass' implementation.
  class ListenerHook : public IPC::Channel::Listener {
   public:
    explicit ListenerHook(ChildProcessHost* host);
    virtual void OnMessageReceived(const IPC::Message& msg);
    virtual void OnChannelConnected(int32_t peer_pid);
    virtual void OnChannelError();
    virtual void GetQueuedMessages(std::queue<IPC::Message>& queue);
   private:
    ChildProcessHost* host_;
  };

  ListenerHook listener_;

  // True while we're waiting the channel to be opened.
  bool opening_channel_;

  // The IPC::Channel.
  mozilla::UniquePtr<IPC::Channel> channel_;

  // IPC Channel's id.
  std::wstring channel_id_;

  // Used to watch the child process handle.
  base::WaitableEventWatcher watcher_;

  mozilla::UniquePtr<base::WaitableEvent> process_event_;
};

#endif  // CHROME_COMMON_CHILD_PROCESS_HOST_H_
# 131 "/Users/luser/build/mozilla-central/ipc/chromium/src/chrome/common/child_process_host.h"
# 12 "../../dist/include/mozilla/ipc/GeckoChildProcessHost.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/DebugOnly.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/ipc/GeckoChildProcessHost.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/FileDescriptor.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/ipc/GeckoChildProcessHost.h"
namespace mozilla {
namespace ipc {

class GeckoChildProcessHost : public ChildProcessHost
{
protected:
  typedef mozilla::Monitor Monitor;
  typedef std::vector<std::string> StringVector;

public:
  typedef base::ChildPrivileges ChildPrivileges;
  typedef base::ProcessHandle ProcessHandle;

  static ChildPrivileges DefaultChildPrivileges();

  ;
  // Does the actual work for AsyncLaunch, on the IO thread.
  ;

  ;

  ;

  // In between launching the subprocess and handing off its IPC
  // channel, there's a small window of time in which *we* might still
  // be the channel listener, and receive messages.  That's bad
  // because we have no idea what to do with those messages.  So queue
  // them here until we hand off the eventual listener.
  //
  // FIXME/cjones: this strongly indicates bad design.  Shame on us.
  std::queue<IPC::Message> mQueue;
};

#ifdef MOZ_NUWA_PROCESS
class GeckoExistingProcessHost MOZ_FINAL : public GeckoChildProcessHost
{
public:
  GeckoExistingProcessHost(GeckoProcessType aProcessType,
                           base::ProcessHandle aProcess,
                           const FileDescriptor& aFileDescriptor,
                           ChildPrivileges aPrivileges=base::PRIVILEGES_DEFAULT);

  ~GeckoExistingProcessHost();

  virtual bool PerformAsyncLaunch(StringVector aExtraOpts=StringVector(),
          base::ProcessArchitecture aArch=base::GetCurrentProcessArchitecture()) MOZ_OVERRIDE;

  virtual void InitializeChannel() MOZ_OVERRIDE;

private:
  base::ProcessHandle mExistingProcessHandle;
  mozilla::ipc::FileDescriptor mExistingFileDescriptor;
};
#endif /* MOZ_NUWA_PROCESS */
# 237 "../../dist/include/mozilla/ipc/GeckoChildProcessHost.h"

} /* namespace ipc */
} /* namespace mozilla */

#endif /* __IPC_GLUE_GECKOCHILDPROCESSHOST_H__ */
# 242 "../../dist/include/mozilla/ipc/GeckoChildProcessHost.h"
# 13 "../../dist/include/mozilla/dom/ContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/ContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/FileUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/FileUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_FileUtils_h
#define mozilla_FileUtils_h

#if 0 /* expanded by -frewrite-includes */
#include "nscore.h" // nullptr
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/FileUtils.h"

#if defined(XP_UNIX)
#if 0 /* expanded by -frewrite-includes */
# include <unistd.h>
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/FileUtils.h"
#elif defined(XP_WIN)
# 15 "../../dist/include/mozilla/FileUtils.h"
#if 0 /* expanded by -frewrite-includes */
# include <io.h>
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/FileUtils.h"
#endif
# 17 "../../dist/include/mozilla/FileUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "prio.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/FileUtils.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Scoped.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/FileUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIFile.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/FileUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include <errno.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/errno.h" 1 3 4
/*
 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/mozilla/FileUtils.h"

namespace mozilla {

#if defined(XP_WIN)
typedef void* filedesc_t;
typedef const wchar_t* pathstr_t;
#else
# 30 "../../dist/include/mozilla/FileUtils.h"
typedef int filedesc_t;
typedef const char* pathstr_t;
#endif
# 33 "../../dist/include/mozilla/FileUtils.h"

/**
 * ScopedCloseFD is a RAII wrapper for POSIX file descriptors
 *
 * Instances |close()| their fds when they go out of scope.
 */
struct ScopedCloseFDTraits
{
  typedef int type;
  
  
};
typedef Scoped<ScopedCloseFDTraits> ScopedClose;

#if !defined(XPCOM_GLUE)

/**
 * and is readable (it will not attempt to read anything from it).
 * @return true on success
 */
bool ReadSysFile(const char* aFilename, bool* aVal);

#endif /* (MOZ_WIDGET_GONK || DEBUG) && XP_UNIX */
# 211 "../../dist/include/mozilla/FileUtils.h"

} // namespace mozilla
#endif
# 214 "../../dist/include/mozilla/FileUtils.h"
# 15 "../../dist/include/mozilla/dom/ContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/HalTypes.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/ContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/LinkedList.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/ContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/StaticPtr.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/dom/ContentParent.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsDataHashtable.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/dom/ContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameMessageManager.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/dom/ContentParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
  NS_IMETHOD GetObserver(nsIThreadObserver * *aObserver) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetObserver(aObserver); } \
  NS_IMETHOD SetObserver(nsIThreadObserver *aObserver) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetObserver(aObserver); } \
  NS_IMETHOD GetRecursionDepth(uint32_t *aRecursionDepth) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRecursionDepth(aRecursionDepth); } \
  NS_IMETHOD AddObserver(nsIThreadObserver *observer) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->AddObserver(observer); } \
  NS_IMETHOD RemoveObserver(nsIThreadObserver *observer) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(observer); } \
  NS_IMETHOD PushEventQueue(nsIEventTarget * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->PushEventQueue(_retval); } \
  NS_IMETHOD PopEventQueue(nsIEventTarget *aInnermostTarget) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->PopEventQueue(aInnermostTarget); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsThreadInternal : public nsIThreadInternal
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 161 "../../dist/include/nsIThreadInternal.h"


/* starting interface:    nsIThreadObserver */
#define NS_ITHREADOBSERVER_IID_STR "09b424c3-26b0-4128-9039-d66f85b02c63"

#define NS_ITHREADOBSERVER_IID \
  {0x09b424c3, 0x26b0, 0x4128, \
    { 0x90, 0x39, 0xd6, 0x6f, 0x85, 0xb0, 0x2c, 0x63 }}

class NS_NO_VTABLE nsIThreadObserver : public nsISupports {

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSITHREADOBSERVER \
  NS_IMETHOD OnDispatchedEvent(nsIThreadInternal *thread) MOZ_OVERRIDE; \
  NS_IMETHOD OnProcessNextEvent(nsIThreadInternal *thread, bool mayWait, uint32_t recursionDepth) MOZ_OVERRIDE; \
  NS_IMETHOD AfterProcessNextEvent(nsIThreadInternal *thread, uint32_t recursionDepth, bool eventWasProcessed) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSITHREADOBSERVER(_to) \
  NS_IMETHOD OnDispatchedEvent(nsIThreadInternal *thread) MOZ_OVERRIDE { return _to OnDispatchedEvent(thread); } \
  NS_IMETHOD OnProcessNextEvent(nsIThreadInternal *thread, bool mayWait, uint32_t recursionDepth) MOZ_OVERRIDE { return _to OnProcessNextEvent(thread, mayWait, recursionDepth); } \
  NS_IMETHOD AfterProcessNextEvent(nsIThreadInternal *thread, uint32_t recursionDepth, bool eventWasProcessed) MOZ_OVERRIDE { return _to AfterProcessNextEvent(thread, recursionDepth, eventWasProcessed); } 

#endif /* __gen_nsIThreadInternal_h__ */
# 261 "../../dist/include/nsIThreadInternal.h"
# 24 "../../dist/include/mozilla/dom/ContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMGeoPositionCallback.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMGeoPositionCallback.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMGeoPositionCallback.idl
 */

#ifndef __gen_nsIDOMGeoPositionCallback_h__
#define __gen_nsIDOMGeoPositionCallback_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMGeoPositionCallback.h"
#endif
# 12 "../../dist/include/nsIDOMGeoPositionCallback.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMGeoPositionCallback.h"
class nsIDOMGeoPosition; /* forward declaration */


/* starting interface:    nsIDOMGeoPositionCallback */
#define NS_IDOMGEOPOSITIONCALLBACK_IID_STR "527e8b53-6f29-4b6a-8d04-5c1666a4c4c1"

#define NS_IDOMGEOPOSITIONCALLBACK_IID \
  {0x527e8b53, 0x6f29, 0x4b6a, \
    { 0x8d, 0x04, 0x5c, 0x16, 0x66, 0xa4, 0xc4, 0xc1 }}

class NS_NO_VTABLE nsIDOMGeoPositionCallback : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMGEOPOSITIONCALLBACK_IID)

  /* void handleEvent (in nsIDOMGeoPosition position); */
  NS_IMETHOD HandleEvent(nsIDOMGeoPosition *position) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMGeoPositionCallback, NS_IDOMGEOPOSITIONCALLBACK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMGEOPOSITIONCALLBACK \
  NS_IMETHOD HandleEvent(nsIDOMGeoPosition *position) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMGEOPOSITIONCALLBACK(_to) \
  NS_IMETHOD HandleEvent(nsIDOMGeoPosition *position) MOZ_OVERRIDE { return _to HandleEvent(position); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMGEOPOSITIONCALLBACK(_to) \
  NS_IMETHOD HandleEvent(nsIDOMGeoPosition *position) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->HandleEvent(position); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */
NS_IMETHODIMP nsDOMGeoPositionCallback::HandleEvent(nsIDOMGeoPosition *position)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 91 "../../dist/include/nsIDOMGeoPositionCallback.h"


#endif /* __gen_nsIDOMGeoPositionCallback_h__ */
# 94 "../../dist/include/nsIDOMGeoPositionCallback.h"
# 25 "../../dist/include/mozilla/dom/ContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMGeoPositionErrorCallback.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMGeoPositionErrorCallback.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMGeoPositionErrorCallback.idl
 */

#ifndef __gen_nsIDOMGeoPositionErrorCallback_h__
#define __gen_nsIDOMGeoPositionErrorCallback_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMGeoPositionErrorCallback.h"
#endif
# 12 "../../dist/include/nsIDOMGeoPositionErrorCallback.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMGeoPositionErrorCallback.h"
class nsIDOMGeoPositionError; /* forward declaration */


/* starting interface:    nsIDOMGeoPositionErrorCallback */
#define NS_IDOMGEOPOSITIONERRORCALLBACK_IID_STR "7d9b09d9-4843-43eb-a7a7-67f7dda6b3c4"

#define NS_IDOMGEOPOSITIONERRORCALLBACK_IID \
  {0x7d9b09d9, 0x4843, 0x43eb, \
    { 0xa7, 0xa7, 0x67, 0xf7, 0xdd, 0xa6, 0xb3, 0xc4 }}

class NS_NO_VTABLE nsIDOMGeoPositionErrorCallback : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMGEOPOSITIONERRORCALLBACK_IID)

  /* void handleEvent (in nsIDOMGeoPositionError positionError); */
  NS_IMETHOD HandleEvent(nsIDOMGeoPositionError *positionError) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMGeoPositionErrorCallback, NS_IDOMGEOPOSITIONERRORCALLBACK_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMGEOPOSITIONERRORCALLBACK \
  NS_IMETHOD HandleEvent(nsIDOMGeoPositionError *positionError) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMGEOPOSITIONERRORCALLBACK(_to) \
  NS_IMETHOD HandleEvent(nsIDOMGeoPositionError *positionError) MOZ_OVERRIDE { return _to HandleEvent(positionError); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMGEOPOSITIONERRORCALLBACK(_to) \
  NS_IMETHOD HandleEvent(nsIDOMGeoPositionError *positionError) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->HandleEvent(positionError); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMGeoPositionErrorCallback : public nsIDOMGeoPositionErrorCallback
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMGEOPOSITIONERRORCALLBACK

  nsDOMGeoPositionErrorCallback();
nsDOMGeoPositionErrorCallback::~nsDOMGeoPositionErrorCallback()
{
  /* destructor code */
}

/* void handleEvent (in nsIDOMGeoPositionError positionError); */
NS_IMETHODIMP nsDOMGeoPositionErrorCallback::HandleEvent(nsIDOMGeoPositionError *positionError)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 91 "../../dist/include/nsIDOMGeoPositionErrorCallback.h"


#endif /* __gen_nsIDOMGeoPositionErrorCallback_h__ */
# 94 "../../dist/include/nsIDOMGeoPositionErrorCallback.h"
# 26 "../../dist/include/mozilla/dom/ContentParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "PermissionMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/PermissionMessageUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_permission_message_utils_h__
#define mozilla_dom_permission_message_utils_h__

#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/PermissionMessageUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/PermissionMessageUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrincipal.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/PermissionMessageUtils.h"

namespace IPC {

class Principal {
  friend struct ParamTraits<Principal>;
  ;
  ;
};

} // namespace IPC

#endif // mozilla_dom_permission_message_utils_h__
# 40 "../../dist/include/mozilla/dom/PermissionMessageUtils.h"

# 27 "../../dist/include/mozilla/dom/ContentParent.h" 2

#define CHILD_PROCESS_SHUTDOWN_MESSAGE NS_LITERAL_STRING("child-process-shutdown")

class mozIApplication;
class nsConsoleService;
class nsICycleCollectorLogSink;
class nsIDOMBlob;
class nsIDumpGCAndCCLogsCallback;
class nsIMemoryReporter;
class nsITimer;
class ParentIdleListener;

namespace mozilla {
class PRemoteSpellcheckEngineParent;

namespace ipc {
class OptionalURIParams;
class PFileDescriptorSetParent;
class URIParams;
class TestShellParent;
} // namespace ipc

namespace jsipc {
class JavaScriptShared;
class PJavaScriptParent;
}

namespace layers {
class PCompositorParent;
class PSharedBufferManagerParent;
} // namespace layers

namespace dom {

class Element;
class TabParent;
class PStorageParent;
class ClonedMessageData;
class MemoryReport;
class TabContext;
class ContentBridgeParent;

class ContentParent MOZ_FINAL : public PContentParent
                              , public nsIContentParent
                              , public nsIObserver
                              , public nsIDOMGeoPositionCallback
                              , public nsIDOMGeoPositionErrorCallback
                              , public mozilla::LinkedListElement<ContentParent>
{
    typedef mozilla::ipc::GeckoChildProcessHost GeckoChildProcessHost;
    typedef mozilla::ipc::OptionalURIParams OptionalURIParams;
    typedef mozilla::ipc::PFileDescriptorSetParent PFileDescriptorSetParent;
    typedef mozilla::ipc::TestShellParent TestShellParent;
    typedef mozilla::ipc::URIParams URIParams;
    typedef mozilla::dom::ClonedMessageData ClonedMessageData;

public:
#ifdef MOZ_NUWA_PROCESS
    static int32_t NuwaPid() {
        return sNuwaPid;
    }

    static bool IsNuwaReady() {
        return sNuwaReady;
    }
#endif
# 93 "../../dist/include/mozilla/dom/ContentParent.h"
    
    /**
     * Start up the content-process machinery.  This might include
    /**
     * We cache mAppName instead of looking it up using mAppManifestURL when we
     * need it because it turns out that getting an app from the apps service is
     * expensive.
     */
    nsString mAppName;

    // After we initiate shutdown, we also start a timer to ensure
    // that even content processes that are 100% blocked (say from
    // SIGSTOP), are still killed eventually.  This task enforces that
    // timer.
    nsCOMPtr<nsITimer> mForceKillTimer;
    // How many tabs we're waiting to finish their destruction
    // sequence.  Precisely, how many TabParents have called
    // NotifyTabDestroying() but not called NotifyTabDestroyed().
    int32_t mNumDestroyingTabs;
    // and KillHard() on our channel.
    bool mCalledClose;
    bool mCalledCloseWithError;
    bool mCalledKillHard;
    bool mCreatedPairedMinidumps;
    bool mShutdownPending;
    bool mIPCOpen;

    friend class CrashReporterParent;

    nsRefPtr<nsConsoleService>  mConsoleService;
    ;

    nsDataHashtable<nsUint64HashKey, nsRefPtr<ParentIdleListener> > mIdleListeners;

#ifdef MOZ_X11
    // Dup of child's X socket, used to scope its resources to this
    // object instead of the child process's lifetime.
    ScopedClose mChildXSocketFdDup;
#endif
# 863 "../../dist/include/mozilla/dom/ContentParent.h"

#ifdef MOZ_NUWA_PROCESS
    static int32_t sNuwaPid;
    static bool sNuwaReady;
#endif
# 868 "../../dist/include/mozilla/dom/ContentParent.h"

    PProcessHangMonitorParent* mHangMonitorActor;
};

} // namespace dom
} // namespace mozilla

class ParentIdleListener : public nsIObserver {
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIOBSERVER

  
private:
  
  nsRefPtr<mozilla::dom::ContentParent> mParent;
  uint64_t mObserver;
};

#endif
# 890 "../../dist/include/mozilla/dom/ContentParent.h"
# 78 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ImageData.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/ImageData.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 et tw=78: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_ImageData_h
#define mozilla_dom_ImageData_h

#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMCanvasRenderingContext2D.h"
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/ImageData.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/dom/ImageData.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/mozilla/dom/ImageData.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/GCAPI.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/dom/ImageData.h"

namespace mozilla {
namespace dom {

class ImageData MOZ_FINAL : public nsISupports
{
  

public:
  ImageData(uint32_t aWidth, uint32_t aHeight, JSObject& aData)
    : mWidth(aWidth)
    , mHeight(aHeight)
    , mData(&aData)
  {
    MOZ_COUNT_CTOR(ImageData);
    HoldData();
  }

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ImageData)

  ;

  ;

  
  
  void GetData(JSContext* cx, JS::MutableHandle<JSObject*> aData) const
  {
    aData.set(GetDataObject());
  }
  JSObject* GetDataObject() const
  {
    JS::ExposeObjectToActiveJS(mData);
    return mData;
  }

  bool WrapObject(JSContext* aCx, JS::MutableHandle<JSObject*> aReflector);

private:
  void HoldData();
  void DropData();

  ImageData() = delete;

  uint32_t mWidth, mHeight;
  JS::Heap<JSObject*> mData;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_ImageData_h
# 92 "../../dist/include/mozilla/dom/ImageData.h"
# 79 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/PBrowserParent.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserParent.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PBrowserParent_h
#define PBrowserParent_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/PBrowser.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowser.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PBrowser_h
#define PBrowser_h
// Edit at your own risk
//

#ifndef PContentPermission_h
#define PContentPermission_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentPermission.h"
#if 0 /* expanded by -frewrite-includes */
#include "prtime.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentPermission.h"
#if 0 /* expanded by -frewrite-includes */
#include "IPCMessageStart.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentPermission.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/ProtocolUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentPermission.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct PermissionRequest|
//
namespace mozilla {
namespace dom {
class PermissionRequest MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

    
    const nsCString&
    type() const
    {
        return type_;
    }

    
    

    
    

private:
    ;

    ;

    nsCString type_;
    nsCString access_;
    nsTArray<nsString> options_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct PermissionChoice|
//
namespace mozilla {
namespace dom {
class PermissionChoice MOZ_FINAL
{
private:

public:
    

private:
    ;

    ;

    nsCString type_;
    nsString choice_;
};
} // namespace dom
} // namespace mozilla

#endif // ifndef PContentPermission_h
# 183 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PContentPermission.h"
# 25 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowser.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ServiceWorkerRegistrarTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/ServiceWorkerRegistrarTypes.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef ServiceWorkerRegistrarTypes_h
#define ServiceWorkerRegistrarTypes_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/ServiceWorkerRegistrarTypes.h"
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PBackgroundSharedTypes_h
#define PBackgroundSharedTypes_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PBackgroundSharedTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "prtime.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PBackgroundSharedTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PBackgroundSharedTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/ProtocolUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PBackgroundSharedTypes.h"


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ContentPrincipalInfo|
//
namespace mozilla {
namespace ipc {
class ContentPrincipalInfo MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

    nsCString spec_;
};
} // namespace ipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct SystemPrincipalInfo|
//
namespace mozilla {
namespace ipc {
class SystemPrincipalInfo MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

private:
    ;

    ;

};
} // namespace ipc
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct NullPrincipalInfo|
//
namespace mozilla {
namespace ipc {
class NullPrincipalInfo MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;

private:
    ;

    ;

};
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union PrincipalInfo|
//
namespace mozilla {
namespace ipc {
class PrincipalInfo MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TContentPrincipalInfo = 1,
        TSystemPrincipalInfo,
        TNullPrincipalInfo,
        T__Last = TNullPrincipalInfo
    };

private:
    typedef mozilla::ipc::ContentPrincipalInfo ContentPrincipalInfo;
    typedef mozilla::ipc::SystemPrincipalInfo SystemPrincipalInfo;
    typedef mozilla::ipc::NullPrincipalInfo NullPrincipalInfo;
    typedef ContentPrincipalInfo ContentPrincipalInfo__tdef;
    typedef SystemPrincipalInfo SystemPrincipalInfo__tdef;
    typedef NullPrincipalInfo NullPrincipalInfo__tdef;

    union Value {
        char VContentPrincipalInfo[sizeof(ContentPrincipalInfo)];
        char VSystemPrincipalInfo[sizeof(SystemPrincipalInfo)];
        char VNullPrincipalInfo[sizeof(NullPrincipalInfo)];
    };

    
    
    
    
    

    
    
    
    

private:
    Value mValue;
    Type mType;
};
} // namespace ipc
} // namespace mozilla

#endif // ifndef PBackgroundSharedTypes_h
# 407 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PBackgroundSharedTypes.h"
# 18 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/ServiceWorkerRegistrarTypes.h" 2

namespace mozilla {
namespace ipc {
class PrincipalInfo;
} // namespace ipc
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ServiceWorkerRegistrationData|
//
namespace mozilla {
namespace dom {
class ServiceWorkerRegistrationData MOZ_FINAL
{
private:
    typedef mozilla::ipc::PrincipalInfo PrincipalInfo;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    


    ;

    nsCString scope_;
    nsCString scriptSpec_;
    nsCString currentWorkerURL_;
    PrincipalInfo principal_;
};
} // namespace dom
} // namespace mozilla

#endif // ifndef ServiceWorkerRegistrarTypes_h
# 129 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/ServiceWorkerRegistrarTypes.h"
# 26 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowser.h" 2


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct NativeKeyBinding|
//
namespace mozilla {
namespace dom {
class NativeKeyBinding MOZ_FINAL
{
private:
    typedef mozilla::CommandInt CommandInt;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 
private:
    ;

    ;

    nsTArray<CommandInt> singleLineCommands_;
    nsTArray<CommandInt> multiLineCommands_;
    nsTArray<CommandInt> richTextCommands_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class ServiceWorkerRegistrationData;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct BrowserConfiguration|
//
namespace mozilla {
namespace dom {
class BrowserConfiguration MOZ_FINAL
{
private:
    typedef mozilla::dom::ServiceWorkerRegistrationData ServiceWorkerRegistrationData;

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    nsTArray<ServiceWorkerRegistrationData> serviceWorkerRegistrations_;
};
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class NativeKeyBinding;
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Declaration of the IPDL type |union MaybeNativeKeyBinding|
//
namespace mozilla {
namespace dom {
class MaybeNativeKeyBinding MOZ_FINAL
{
public:
    enum Type {
        T__None,
        TNativeKeyBinding = 1,
        Tvoid_t,
        T__Last = Tvoid_t
    };

private:
    typedef mozilla::dom::NativeKeyBinding NativeKeyBinding;
    typedef mozilla::void_t void_t;
    typedef NativeKeyBinding NativeKeyBinding__tdef;
    typedef void_t void_t__tdef;

    union Value {
        char VNativeKeyBinding[sizeof(NativeKeyBinding)];
        char Vvoid_t[sizeof(void_t)];
    };

    
    
    
    

    ;

    
    

    
    

private:
    Value mValue;
    Type mType;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct ShowInfo|
//
namespace mozilla {
namespace dom {
class ShowInfo MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;

    

    ;
private:
    ;

    ;

    nsString name_;
    bool fullscreenAllowed_;
    bool isPrivate_;
    float dpi_;
    double defaultScale_;
};
} // namespace dom
} // namespace mozilla


//-----------------------------------------------------------------------------
// Declaration of the IPDL type |struct FrameScriptInfo|
//
namespace mozilla {
namespace dom {
class FrameScriptInfo MOZ_FINAL
{
private:

public:
    MOZ_IMPLICIT ;

    MOZ_IMPLICIT 

    MOZ_IMPLICIT 

    ;
    nsString url_;
    bool runInGlobalScope_;
};
} // namespace dom
} // namespace mozilla

//-----------------------------------------------------------------------------
// Code common to PBrowserChild and PBrowserParent
//
namespace mozilla {
namespace dom {
namespace PBrowser {

enum State {
    __Dead,
    __Null,
    __Error,
    __Dying,
    __Start = __Null
};

enum MessageType {
    PBrowserStart = PBrowserMsgStart << 16,
    Msg_AsyncMessage__ID,
    Msg_PRenderFrameConstructor__ID,
    Reply_PRenderFrameConstructor__ID,
    Msg_PPluginWidgetConstructor__ID,
    Reply_PPluginWidgetConstructor__ID,
    Msg_GetWidgetNativeData__ID,
    Reply_GetWidgetNativeData__ID,
    Msg_MoveFocus__ID,
    Msg_Event__ID,
    Msg_CreateWindow__ID,
    Reply_CreateWindow__ID,
    Msg_SyncMessage__ID,
    Reply_SyncMessage__ID,
    Msg_RpcMessage__ID,
    Reply_RpcMessage__ID,
    Msg_NotifyIMEFocus__ID,
    Reply_NotifyIMEFocus__ID,
    Msg_NotifyIMETextChange__ID,
    Msg_NotifyIMESelectedCompositionRect__ID,
    Msg_NotifyIMESelection__ID,
    Msg_NotifyIMETextHint__ID,
    Msg_NotifyIMEMouseButtonEvent__ID,
    Reply_NotifyIMEMouseButtonEvent__ID,
    Msg_NotifyIMEEditorRect__ID,
    Msg_NotifyIMEPositionChange__ID,
    Msg_EndIMEComposition__ID,
    Reply_EndIMEComposition__ID,
    Msg_StartPluginIME__ID,
    Reply_StartPluginIME__ID,
    Msg_SetPluginFocused__ID,
    Msg_RequestFocus__ID,
    Msg_EnableDisableCommands__ID,
    Msg_GetInputContext__ID,
    Reply_GetInputContext__ID,
    Msg_SetInputContext__ID,
    Msg_IsParentWindowMainWidgetVisible__ID,
    Reply_IsParentWindowMainWidgetVisible__ID,
    Msg_GetDPI__ID,
    Reply_GetDPI__ID,
    Msg_GetDefaultScale__ID,
    Reply_GetDefaultScale__ID,
    Msg_SetCursor__ID,
    Msg_SetBackgroundColor__ID,
    Msg_SetStatus__ID,
    Msg_ShowTooltip__ID,
    Msg_HideTooltip__ID,
    Msg_PColorPickerConstructor__ID,
    Reply_PColorPickerConstructor__ID,
    Msg_PContentPermissionRequestConstructor__ID,
    Reply_PContentPermissionRequestConstructor__ID,
    Msg_PFilePickerConstructor__ID,
    Reply_PFilePickerConstructor__ID,
    Msg_PIndexedDBPermissionRequestConstructor__ID,
    Reply_PIndexedDBPermissionRequestConstructor__ID,
    Msg_BrowserFrameOpenWindow__ID,
    Reply_BrowserFrameOpenWindow__ID,
    Msg_ZoomToRect__ID,
    Msg_ContentReceivedInputBlock__ID,
    Msg_SetTargetAPZC__ID,
    Msg_UpdateZoomConstraints__ID,
    Msg_AsyncAuthPrompt__ID,
    Msg___delete____ID,
    Reply___delete____ID,
    Msg_ReplyKeyEvent__ID,
    Msg_DispatchAfterKeyboardEvent__ID,
    Msg_RequestNativeKeyBindings__ID,
    Reply_RequestNativeKeyBindings__ID,
    Msg_RemotePaintIsReady__ID,
    Msg_GetRenderFrameInfo__ID,
    Reply_GetRenderFrameInfo__ID,
    Msg_SetDimensions__ID,
    Msg_SynthesizedMouseWheelEvent__ID,
    Reply_SynthesizedMouseWheelEvent__ID,
    Msg_RealMouseMoveEvent__ID,
    Msg_RealMouseButtonEvent__ID,
    Msg_RealKeyEvent__ID,
    Msg_MouseWheelEvent__ID,
    Msg_RealTouchEvent__ID,
    Msg_RealTouchMoveEvent__ID,
    Msg_KeyEvent__ID,
    Msg_CompositionEvent__ID,
    Msg_SelectionEvent__ID,
    Msg_ActivateFrameEvent__ID,
    Msg_LoadRemoteScript__ID,
    Msg_PDocumentRendererConstructor__ID,
    Reply_PDocumentRendererConstructor__ID,
    Msg_Destroy__ID,
    Msg_SetUpdateHitRegion__ID,
    Msg_SetIsDocShellActive__ID,
    Msg_RequestNotifyAfterRemotePaint__ID,
    Msg_UIResolutionChanged__ID,
    Msg_AppOfflineStatus__ID,
    PBrowserEnd
};

;

class Msg_AsyncMessage :
    public IPC::Message
{
public:
    enum {
        ID = Msg_AsyncMessage__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PRenderFrameConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PRenderFrameConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_PRenderFrameConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Reply_PRenderFrameConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PPluginWidgetConstructor :
    public IPC::Message
{
public:

    
};

class Msg_GetWidgetNativeData :
    public IPC::Message
{
public:
    enum {
        ID = Msg_GetWidgetNativeData__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_GetWidgetNativeData :
    public IPC::Message
{
public:
    enum {
        ID = Reply_GetWidgetNativeData__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_MoveFocus :
    public IPC::Message
{
    enum {
        ID = Reply_SyncMessage__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_RpcMessage :
    public IPC::Message
{
public:
    enum {
        ID = Msg_RpcMessage__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_RpcMessage :
    public IPC::Message
{
public:
    enum {
        ID = Reply_RpcMessage__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_NotifyIMEFocus :
    public IPC::Message
{
public:
    enum {
        ID = Msg_NotifyIMEFocus__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_NotifyIMEFocus :
    public IPC::Message
{
public:
    enum {
        ID = Reply_NotifyIMEFocus__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_NotifyIMETextChange :
    public IPC::Message
{
public:
    enum {
    };
    MOZ_IMPLICIT 

    
};

class Msg_NotifyIMEEditorRect :
    public IPC::Message
{
public:
    enum {
        ID = Msg_NotifyIMEEditorRect__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_NotifyIMEPositionChange :
    public IPC::Message
{
    enum {
        ID = Msg_SetInputContext__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_IsParentWindowMainWidgetVisible :
    public IPC::Message
{
public:
    enum {
        ID = Msg_IsParentWindowMainWidgetVisible__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_IsParentWindowMainWidgetVisible :
    public IPC::Message
{
public:
    enum {
        ID = Reply_IsParentWindowMainWidgetVisible__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_GetDPI :
    public IPC::Message
{
public:
    enum {
        ID = Msg_GetDPI__ID
    };
    MOZ_IMPLICIT 
    
};

class Msg_SetStatus :
    public IPC::Message
{
public:
    
};

class Reply_BrowserFrameOpenWindow :
    public IPC::Message
{
public:
    enum {
        ID = Reply_BrowserFrameOpenWindow__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_ZoomToRect :
    public IPC::Message
{
public:
    enum {
        ID = Msg_ZoomToRect__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_ContentReceivedInputBlock :
    public IPC::Message
{
public:
    enum {
        ID = Msg_ContentReceivedInputBlock__ID
    };
    MOZ_IMPLICIT 

    
};
class Msg_ReplyKeyEvent :
    public IPC::Message
{
public:
    enum {
        ID = Msg_ReplyKeyEvent__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_DispatchAfterKeyboardEvent :
    public IPC::Message
{
public:
    enum {
        ID = Msg_DispatchAfterKeyboardEvent__ID
    };
};

class Msg_KeyEvent :
    public IPC::Message
{
public:
    enum {
        ID = Msg_KeyEvent__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_CompositionEvent :
    public IPC::Message
{
public:
    enum {
        ID = Msg_CompositionEvent__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_SelectionEvent :
    public IPC::Message
{
public:
    enum {
        ID = Msg_SelectionEvent__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_ActivateFrameEvent :
    public IPC::Message
{
public:
    enum {
        ID = Msg_ActivateFrameEvent__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_LoadRemoteScript :
    public IPC::Message
{
public:
    enum {
        ID = Msg_LoadRemoteScript__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_PDocumentRendererConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Msg_PDocumentRendererConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Reply_PDocumentRendererConstructor :
    public IPC::Message
{
public:
    enum {
        ID = Reply_PDocumentRendererConstructor__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_Destroy :
    public IPC::Message
{
public:
    enum {
        ID = Msg_Destroy__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_SetUpdateHitRegion :
    public IPC::Message
{
public:
    enum {
        ID = Msg_SetUpdateHitRegion__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_SetIsDocShellActive :
    public IPC::Message
{
public:
    enum {
        ID = Msg_SetIsDocShellActive__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_RequestNotifyAfterRemotePaint :
    public IPC::Message
{
public:
    enum {
        ID = Msg_RequestNotifyAfterRemotePaint__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_UIResolutionChanged :
    public IPC::Message
{
public:
    enum {
        ID = Msg_UIResolutionChanged__ID
    };
    MOZ_IMPLICIT 

    
};

class Msg_AppOfflineStatus :
    public IPC::Message
{
public:
    enum {
        ID = Msg_AppOfflineStatus__ID
    };
    MOZ_IMPLICIT 

    
};



} // namespace PBrowser
} // namespace dom
} // namespace mozilla

#endif // ifndef PBrowser_h
# 4019 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowser.h"
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserParent.h" 2
# 21 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ScreenOrientation.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/ScreenOrientation.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_ScreenOrientation_h
#define mozilla_dom_ScreenOrientation_h

namespace mozilla {
namespace dom {

// Make sure that any change here is also made in
// * mobile/android/base/GeckoScreenOrientationListener.java
typedef uint32_t ScreenOrientation;

static const ScreenOrientation eScreenOrientation_None               = 0;
static const ScreenOrientation eScreenOrientation_PortraitPrimary    = 1u << 0;
static const ScreenOrientation eScreenOrientation_PortraitSecondary  = 1u << 1;
static const ScreenOrientation eScreenOrientation_LandscapePrimary   = 1u << 2;
static const ScreenOrientation eScreenOrientation_LandscapeSecondary = 1u << 3;
//eScreenOrientation_Default will use the natural orientation for the deivce,
//it could be PortraitPrimary or LandscapePrimary depends on display resolution
static const ScreenOrientation eScreenOrientation_Default            = 1u << 4;

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_ScreenOrientation_h
# 28 "../../dist/include/mozilla/dom/ScreenOrientation.h"
# 23 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/layers/GeckoContentController.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/layers/GeckoContentController.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=4 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_layers_GeckoContentController_h
#define mozilla_layers_GeckoContentController_h

#if 0 /* expanded by -frewrite-includes */
#include "FrameMetrics.h"               // for FrameMetrics, etc
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/layers/GeckoContentController.h"
#if 0 /* expanded by -frewrite-includes */
#include "Units.h"                      // for CSSPoint, CSSRect, etc
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/layers/GeckoContentController.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Assertions.h"         // for MOZ_ASSERT_HELPER2
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/layers/GeckoContentController.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventForwards.h"      // for Modifiers
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/layers/GeckoContentController.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/layers/GeckoContentController.h"

class Task;

namespace mozilla {
namespace layers {

class GeckoContentController
{
public:

  enum APZStateChange {
    /**
     * APZ started modifying the view (including panning, zooming, and fling).
     */
    TransformBegin,
    /**
     * APZ finished modifying the view.
     */
    TransformEnd,
    /**
     * APZ started a touch.
     * |aArg| is 1 if touch can be a pan, 0 otherwise.
     */
    StartTouch,
    /**
     * APZ started a pan.
     */
    StartPanning,
    /**
     * APZ finished processing a touch.
     * |aArg| is 1 if touch was a click, 0 otherwise.
     */
    EndTouch,
    APZStateChangeSentinel
  };

  /**
   * General notices of APZ state changes for consumers.
   * |aGuid| identifies the APZC originating the state change.
   * |aChange| identifies the type of state change
   * |aArg| is used by some state changes to pass extra information (see
   *        the documentation for each state change above)
   */
  virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
                                    APZStateChange aChange,
                                    int aArg = 0) {}

  
  virtual void Destroy() {}

protected:
  // Protected destructor, to discourage deletion outside of Release():
  virtual ~GeckoContentController() {}
};

}
}

#endif // mozilla_layers_GeckoContentController_h
# 180 "../../dist/include/mozilla/layers/GeckoContentController.h"
# 24 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsColor.h"
#endif /* expanded by -frewrite-includes */
# 25 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserParent.h"

namespace mozilla {
namespace dom {
class PBlobParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PBlobChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PColorPickerParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PColorPickerChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PContentBridgeChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace ipc {
class PDocumentRendererParent;
} // namespace ipc
} // namespace mozilla
namespace mozilla {
namespace ipc {
class PDocumentRendererChild;
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace dom {
class PContentPermissionRequestParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PContentPermissionRequestChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PFilePickerParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PFilePickerChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace indexedDB {
class PIndexedDBPermissionRequestParent;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
namespace indexedDB {
class PIndexedDBPermissionRequestChild;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace layout {
class PRenderFrameParent;
} // namespace layout
} // namespace mozilla
namespace mozilla {
namespace layout {
class PRenderFrameChild;
} // namespace layout
} // namespace mozilla

namespace mozilla {
namespace plugins {
class PPluginWidgetParent;
} // namespace plugins
} // namespace mozilla
namespace mozilla {
namespace plugins {
class PPluginWidgetChild;
} // namespace plugins
} // namespace mozilla

namespace mozilla {
namespace dom {
class PFilePickerParent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace net {
class PWyciwygChannelParent;
} // namespace net
} // namespace mozilla

namespace mozilla {
namespace dom {
namespace indexedDB {
class PIndexedDBPermissionRequestParent;
} // namespace indexedDB
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace plugins {
class PPluginWidgetParent;
} // namespace plugins
} // namespace mozilla

namespace mozilla {
namespace embedding {
} // namespace ipc
} // namespace mozilla

namespace mozilla {
namespace layout {
class PRenderFrameParent;
} // namespace layout
} // namespace mozilla

namespace mozilla {
namespace gfx {
class Matrix;
} // namespace gfx
} // namespace mozilla

struct gfxSize;

namespace mozilla {
namespace layers {
struct FrameMetrics;
} // namespace layers
} // namespace mozilla

namespace mozilla {
namespace layers {
struct ScrollableLayerGuid;
} // namespace layers
} // namespace mozilla

namespace mozilla {
namespace layers {
struct ZoomConstraints;
} // namespace layers
} // namespace mozilla

namespace mozilla {
struct void_t;
} // namespace mozilla

namespace mozilla {
class WidgetCompositionEvent;
} // namespace mozilla

namespace mozilla {
namespace widget {
struct IMENotification;
} // namespace widget
} // namespace mozilla

struct nsIMEUpdatePreference;

struct nsIntPoint;

struct nsIntRect;

struct nsIntSize;

namespace mozilla {
class WidgetKeyboardEvent;
} // namespace mozilla

namespace mozilla {
class WidgetMouseEvent;
} // namespace mozilla

namespace mozilla {
class WidgetWheelEvent;
} // namespace mozilla

struct nsRect;

namespace mozilla {
class WidgetSelectionEvent;
} // namespace mozilla

namespace mozilla {
class WidgetTouchEvent;
} // namespace mozilla

namespace mozilla {
namespace dom {
struct RemoteDOMEvent;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace layers {
struct TextureFactoryIdentifier;
} // namespace layers
} // namespace mozilla

namespace mozilla {
namespace dom {


class /*NS_ABSTRACT_CLASS*/ PBrowserParent :
    public mozilla::ipc::IProtocol,
    protected mozilla::ipc::IProtocolManager<mozilla::ipc::IProtocol>
{
    friend class mozilla::dom::PFilePickerParent;

    friend class mozilla::net::PWyciwygChannelParent;

    friend class mozilla::dom::indexedDB::PIndexedDBPermissionRequestParent;

    typedef mozilla::ipc::ContentPrincipalInfo ContentPrincipalInfo;
    typedef mozilla::jsipc::CpowEntry CpowEntry;
    typedef mozilla::dom::FileBlobConstructorParams FileBlobConstructorParams;
    typedef mozilla::ipc::FileDescriptor FileDescriptor;
    typedef mozilla::layers::FrameMetrics FrameMetrics;
    typedef mozilla::dom::FrameScriptInfo FrameScriptInfo;
    typedef mozilla::jsipc::GetterSetter GetterSetter;
    typedef mozilla::widget::IMENotification IMENotification;
    typedef mozilla::ipc::IconURIParams IconURIParams;
    typedef mozilla::ipc::JARURIParams JARURIParams;
    typedef mozilla::jsipc::JSIDVariant JSIDVariant;
    typedef mozilla::jsipc::JSIID JSIID;
    typedef mozilla::jsipc::JSParam JSParam;
    typedef mozilla::jsipc::JSVariant JSVariant;
    typedef mozilla::dom::KnownBlobConstructorParams KnownBlobConstructorParams;
    typedef mozilla::jsipc::LocalObject LocalObject;
    typedef mozilla::dom::PermissionChoice PermissionChoice;
    typedef mozilla::dom::PermissionRequest PermissionRequest;
    typedef IPC::Principal Principal;
    typedef mozilla::ipc::PrincipalInfo PrincipalInfo;
    typedef base::ProcessId ProcessId;
    typedef mozilla::ipc::ProtocolId ProtocolId;
    typedef mozilla::jsipc::RegisteredSymbol RegisteredSymbol;
    typedef mozilla::dom::RemoteDOMEvent RemoteDOMEvent;
    typedef mozilla::jsipc::RemoteObject RemoteObject;
    typedef mozilla::jsipc::ReturnException ReturnException;
    typedef mozilla::jsipc::ReturnObjectOpResult ReturnObjectOpResult;
    typedef mozilla::jsipc::ReturnStatus ReturnStatus;
    typedef mozilla::jsipc::ReturnStopIteration ReturnStopIteration;
    typedef mozilla::jsipc::ReturnSuccess ReturnSuccess;
    typedef mozilla::dom::SameProcessBlobConstructorParams SameProcessBlobConstructorParams;
    typedef mozilla::dom::ScreenOrientation ScreenOrientation;
    typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
    typedef mozilla::SerializedStructuredCloneBuffer SerializedStructuredCloneBuffer;
    typedef mozilla::dom::ServiceWorkerRegistrationData ServiceWorkerRegistrationData;
    typedef mozilla::ipc::Shmem Shmem;
    typedef mozilla::dom::ShowInfo ShowInfo;
    typedef mozilla::ipc::SimpleURIParams SimpleURIParams;
    typedef mozilla::dom::SlicedBlobConstructorParams SlicedBlobConstructorParams;
    typedef mozilla::ipc::StandardURLParams StandardURLParams;
    typedef mozilla::ipc::StandardURLSegment StandardURLSegment;
    typedef mozilla::jsipc::SymbolVariant SymbolVariant;
    typedef mozilla::ipc::SystemPrincipalInfo SystemPrincipalInfo;
    typedef mozilla::layers::TextureFactoryIdentifier TextureFactoryIdentifier;
    typedef mozilla::ipc::Transport Transport;
    typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
    typedef mozilla::ipc::URIParams URIParams;
    typedef mozilla::jsipc::UndefinedVariant UndefinedVariant;
    typedef mozilla::dom::PContentParent PContentParent;
    typedef mozilla::dom::PContentChild PContentChild;
    typedef mozilla::dom::PContentBridgeParent PContentBridgeParent;
    typedef mozilla::dom::PContentBridgeChild PContentBridgeChild;
    typedef mozilla::ipc::PDocumentRendererParent PDocumentRendererParent;
    typedef mozilla::ipc::PDocumentRendererChild PDocumentRendererChild;
    typedef mozilla::dom::PContentPermissionRequestParent PContentPermissionRequestParent;
    typedef mozilla::dom::PContentPermissionRequestChild PContentPermissionRequestChild;
    typedef mozilla::dom::PFilePickerParent PFilePickerParent;
    typedef mozilla::dom::PFilePickerChild PFilePickerChild;
    typedef mozilla::dom::indexedDB::PIndexedDBPermissionRequestParent PIndexedDBPermissionRequestParent;
    typedef mozilla::dom::indexedDB::PIndexedDBPermissionRequestChild PIndexedDBPermissionRequestChild;
    typedef mozilla::layout::PRenderFrameParent PRenderFrameParent;
    typedef mozilla::layout::PRenderFrameChild PRenderFrameChild;
    typedef mozilla::plugins::PPluginWidgetParent PPluginWidgetParent;
    typedef mozilla::plugins::PPluginWidgetChild PPluginWidgetChild;

    typedef PBrowser::State State;

    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;

    ;

public:
    typedef mozilla::ipc::IProtocol ProtocolBase;
    typedef IPC::Message Message;
    typedef mozilla::ipc::MessageChannel Channel;
    typedef mozilla::ipc::MessageListener ChannelListener;
    typedef base::ProcessHandle ProcessHandle;
    typedef mozilla::ipc::MessageChannel MessageChannel;
    typedef mozilla::ipc::SharedMemory SharedMemory;
    typedef mozilla::ipc::Trigger Trigger;
    ;
    ;

    ;
    ;

    ;
    ;

    ;
    ;

    ;

    bool
    SendAsyncMessage(
            bool __nullable) NS_WARN_UNUSED_RESULT;

    ;

    bool
    Read(
            RemoteObject* __v,
            const Message* __msg,
            void** __iter) NS_WARN_UNUSED_RESULT;

    ;

    Channel* mChannel;
    mozilla::ipc::IProtocolManager<mozilla::ipc::IProtocol>* mManager;
    int32_t mId;
    State mState;
    // Sorted by pointer value
    nsTArray<PColorPickerParent*> mManagedPColorPickerParent;
    // Sorted by pointer value
    nsTArray<PDocumentRendererParent*> mManagedPDocumentRendererParent;
    // Sorted by pointer value
    nsTArray<PContentPermissionRequestParent*> mManagedPContentPermissionRequestParent;
    // Sorted by pointer value
    nsTArray<PFilePickerParent*> mManagedPFilePickerParent;
    // Sorted by pointer value
    nsTArray<PIndexedDBPermissionRequestParent*> mManagedPIndexedDBPermissionRequestParent;
    // Sorted by pointer value
    nsTArray<PRenderFrameParent*> mManagedPRenderFrameParent;
    // Sorted by pointer value
    nsTArray<PPluginWidgetParent*> mManagedPPluginWidgetParent;
};


} // namespace dom
} // namespace mozilla

#if 0

//-----------------------------------------------------------------------------
// Skeleton implementation of abstract actor class

// Header file contents
bool
BrowserParent::DeallocPDocumentRendererParent(PDocumentRendererParent* aActor)
{
    return false;
}

} // namespace mozilla
#endif // if 0
# 2331 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserParent.h"

#endif // ifndef PBrowserParent_h
# 2333 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/dom/PBrowserParent.h"
# 80 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/ToJSValue.h"
#endif /* expanded by -frewrite-includes */
# 81 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/TypedArray.h"
#endif /* expanded by -frewrite-includes */
# 82 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Endian.h"
#endif /* expanded by -frewrite-includes */
# 83 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 84 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Helpers.h"
#endif /* expanded by -frewrite-includes */
# 85 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/PathHelpers.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/PathHelpers.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_PATHHELPERS_H_
#define MOZILLA_GFX_PATHHELPERS_H_

#if 0 /* expanded by -frewrite-includes */
#include "2D.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/PathHelpers.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Constants.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/gfx/PathHelpers.h"
#if 0 /* expanded by -frewrite-includes */
#include "UserData.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/gfx/PathHelpers.h"

namespace mozilla {
namespace gfx {



/* This is basically the ArcToBezier with the parameters for drawing a circle
 * inlined which vastly simplifies it and avoids a bunch of transcedental function
 * calls which should make it faster. */


/**
 * Appends a path represending a rectangle to the path being built by
 * Note that the snapping is such that filling the rect using a DrawTarget
 * which has the identity matrix as its transform will result in crisp edges.
 * (That is, aRect will have integer values, aligning its edges between pixel
 * boundaries.)  If on the other hand you stroking the rect with an odd valued
 * stroke width then the edges of the stroke will be antialiased (assuming an
 * AntialiasMode that does antialiasing).
 */


/**
 * This function has the same behavior as UserToDevicePixelSnapped except that
 * aRect is not transformed to device space.
 */


} // namespace gfx
} // namespace mozilla

#endif /* MOZILLA_GFX_PATHHELPERS_H_ */
# 373 "../../dist/include/mozilla/gfx/PathHelpers.h"
# 86 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/DataSurfaceHelpers.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/DataSurfaceHelpers.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _MOZILLA_GFX_DATASURFACEHELPERS_H
#define _MOZILLA_GFX_DATASURFACEHELPERS_H

#if 0 /* expanded by -frewrite-includes */
#include "2D.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/gfx/DataSurfaceHelpers.h"

namespace mozilla {
namespace gfx {

;

/**
 * Copy the pixel data from aSrc and pack it into aDst. aSrcSize, aSrcStride
 * and aBytesPerPixel give the size, stride and bytes per pixel for aSrc's
 * surface. Callers are responsible for making sure that aDst is big enough to
 * contain |aSrcSize.width * aSrcSize.height * aBytesPerPixel| bytes.
 */
;

/**
 * Convert aSurface to a packed buffer in BGRA format. The pixel data is
 * returned in a buffer allocated with new uint8_t[]. The caller then has
 * ownership of the buffer and is responsible for delete[]'ing it.
 */
uint8_t*
SurfaceToPackedBGRA(DataSourceSurface *aSurface);

/**
 * Convert aSurface to a packed buffer in BGR format. The pixel data is
 * returned in a buffer allocated with new uint8_t[]. The caller then has
 * ownership of the buffer and is responsible for delete[]'ing it.
 *
 *
 * @returns true if and only if aPoint is inside the surface.
 */
;

}
}

#endif // _MOZILLA_GFX_DATASURFACEHELPERS_H
# 107 "../../dist/include/mozilla/gfx/DataSurfaceHelpers.h"
# 87 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/PatternHelpers.h"
#endif /* expanded by -frewrite-includes */
# 88 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/DocumentRendererParent.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/ipc/DocumentRendererParent.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_DocumentRendererParent
#define mozilla_dom_DocumentRendererParent

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/PDocumentRendererParent.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRendererParent.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PDocumentRendererParent_h
#define PDocumentRendererParent_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/PDocumentRenderer.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRenderer.h" 1
//
// Automatically generated by ipdlc.
// Edit at your own risk
//

#ifndef PDocumentRenderer_h
#define PDocumentRenderer_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRenderer.h"
#if 0 /* expanded by -frewrite-includes */
#include "prtime.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRenderer.h"
#if 0 /* expanded by -frewrite-includes */
#include "IPCMessageStart.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRenderer.h"
#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRenderer.h"

//-----------------------------------------------------------------------------
// Code common to PDocumentRendererChild and PDocumentRendererParent
//
namespace mozilla {
namespace ipc {
namespace PDocumentRenderer {

enum State {
    __Dead,
    __Null,
    __Error,
    __Dying,
    __Start = __Null

    
};



} // namespace PDocumentRenderer
} // namespace ipc
} // namespace mozilla

#endif // ifndef PDocumentRenderer_h
# 115 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRenderer.h"
# 10 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRendererParent.h" 2
#ifdef DEBUG
#if 0 /* expanded by -frewrite-includes */
#include "prenv.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRendererParent.h"
#endif // DEBUG
# 13 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRendererParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "base/id_map.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRendererParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/MessageChannel.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRendererParent.h"

// Headers for things that cannot be forward declared
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/GfxMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/GfxMessageUtils.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set sw=2 ts=8 et tw=80 : */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __GFXMESSAGEUTILS_H__
#define __GFXMESSAGEUTILS_H__

#if 0 /* expanded by -frewrite-includes */
#include "base/process_util.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/GfxMessageUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "chrome/common/ipc_message_utils.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/GfxMessageUtils.h"
#if 0 /* expanded by -frewrite-includes */
#include "ipc/IPCMessageUtils.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/GfxMessageUtils.h"

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/GfxMessageUtils.h"

#if 0 /* expanded by -frewrite-includes */
#include "gfxColor.h"
#endif /* expanded by -frewrite-includes */
# 29 "../../dist/include/mozilla/GfxMessageUtils.h"

#ifdef _MSC_VER
#pragma warning( disable : 4800 )
#endif
# 33 "../../dist/include/mozilla/GfxMessageUtils.h"

namespace mozilla {

typedef gfxImageFormat PixelFormat;
typedef ::GraphicsFilter GraphicsFilterType;

} // namespace mozilla

namespace IPC {

template<>
struct ParamTraits<mozilla::gfx::Matrix>
{
  typedef mozilla::gfx::Matrix paramType;

  static void Write(Message* aMsg, const paramType& aParam)
  {
    WriteParam(aMsg, aParam._11);
    WriteParam(aMsg, aParam._12);
    WriteParam(aMsg, aParam._21);
    WriteParam(aMsg, aParam._22);
    WriteParam(aMsg, aParam._31);
    WriteParam(aMsg, aParam._32);
  }

  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
  {
    if (ReadParam(aMsg, aIter, &aResult->_11) &&
        ReadParam(aMsg, aIter, &aResult->_12) &&
        ReadParam(aMsg, aIter, &aResult->_21) &&
        ReadParam(aMsg, aIter, &aResult->_22) &&
        ReadParam(aMsg, aIter, &aResult->_31) &&
        ReadParam(aMsg, aIter, &aResult->_32))
      return true;

    return false;
  }

  
};

template<>
struct ParamTraits<mozilla::gfx::Matrix4x4>
{
  typedef mozilla::gfx::Matrix4x4 paramType;

  

  
};

template<>
struct ParamTraits<mozilla::gfx::Matrix5x4>
{
  typedef mozilla::gfx::Matrix5x4 paramType;

  static void Write(Message* msg, const paramType& param)
  {
#define Wr(_f)  WriteParam(msg, param. _f)
    Wr(_11); Wr(_12); Wr(_13); Wr(_14);
    Wr(_21); Wr(_22); Wr(_23); Wr(_24);
    Wr(_31); Wr(_32); Wr(_33); Wr(_34);
    Wr(_41); Wr(_42); Wr(_43); Wr(_44);
    Wr(_51); Wr(_52); Wr(_53); Wr(_54);
#undef Wr
  }

  static bool Read(const Message* msg, void** iter, paramType* result)
  {
#define Rd(_f)  ReadParam(msg, iter, &result-> _f)
    return (Rd(_11) && Rd(_12) && Rd(_13) && Rd(_14) &&
            Rd(_21) && Rd(_22) && Rd(_23) && Rd(_24) &&
            Rd(_31) && Rd(_32) && Rd(_33) && Rd(_34) &&
            Rd(_41) && Rd(_42) && Rd(_43) && Rd(_44) &&
            Rd(_51) && Rd(_52) && Rd(_53) && Rd(_54));
#undef Rd
  }
};

template<>
struct ParamTraits<gfxPoint>
{
  typedef gfxPoint paramType;

  

  
};

template<>
struct ParamTraits<gfxSize>
{
  typedef gfxSize paramType;

  

  
};

template<>
struct ParamTraits<gfxRect>
{
  typedef gfxRect paramType;

  

  
};

template <>
struct ParamTraits<gfxContentType>
  : public ContiguousEnumSerializer<
             gfxContentType,
             gfxContentType::COLOR,
             gfxContentType::SENTINEL>
{};

template <>
struct ParamTraits<gfxSurfaceType>
  : public ContiguousEnumSerializer<
             gfxSurfaceType,
             gfxSurfaceType::Image,
             gfxSurfaceType::Max>
{};

template <>
struct ParamTraits<mozilla::GraphicsFilterType>
  : public ContiguousEnumSerializer<
             mozilla::GraphicsFilterType,
             GraphicsFilter::FILTER_FAST,
             GraphicsFilter::FILTER_SENTINEL>
{};

template <>
struct ParamTraits<mozilla::layers::LayersBackend>
  : public ContiguousEnumSerializer<
             mozilla::layers::LayersBackend,
             mozilla::layers::LayersBackend::LAYERS_NONE,
             mozilla::layers::LayersBackend::LAYERS_LAST>
{};

template <>
struct ParamTraits<mozilla::layers::ScaleMode>
  : public ContiguousEnumSerializer<
             mozilla::layers::ScaleMode,
             mozilla::layers::ScaleMode::SCALE_NONE,
             mozilla::layers::ScaleMode::SENTINEL>
{};

template <>
struct ParamTraits<gfxImageFormat>
  : public ContiguousEnumSerializer<
             gfxImageFormat,
             gfxImageFormat::ARGB32,
             gfxImageFormat::Unknown>
{};

template <>
struct ParamTraits<mozilla::gfx::AttributeName>
  : public ContiguousEnumSerializer<
             mozilla::gfx::AttributeName,
             mozilla::gfx::eBlendBlendmode,
             mozilla::gfx::eLastAttributeName>
{};

template <>
struct ParamTraits<mozilla::gfx::AttributeType>
  : public ContiguousEnumSerializer<
             mozilla::gfx::AttributeType,
             mozilla::gfx::AttributeType::eBool,
             mozilla::gfx::AttributeType::Max>
{};

template <>
struct ParamTraits<mozilla::gfx::PrimitiveType>
  : public ContiguousEnumSerializer<
             mozilla::gfx::PrimitiveType,
             mozilla::gfx::PrimitiveType::Empty,
             mozilla::gfx::PrimitiveType::Max>
{};

template <>
struct ParamTraits<mozilla::gfx::ColorSpace>
  : public ContiguousEnumSerializer<
             mozilla::gfx::ColorSpace,
             mozilla::gfx::ColorSpace::SRGB,
             mozilla::gfx::ColorSpace::Max>
{};

template <>
struct ParamTraits<mozilla::layers::TextureFlags>
  : public BitFlagsEnumSerializer<
            mozilla::layers::TextureFlags,
            mozilla::layers::TextureFlags::ALL_BITS>
{};

template <>
struct ParamTraits<mozilla::layers::DiagnosticTypes>
  : public BitFlagsEnumSerializer<
             mozilla::layers::DiagnosticTypes,
             mozilla::layers::DiagnosticTypes::ALL_BITS>
{};

/*
template <>
struct ParamTraits<mozilla::PixelFormat>
  : public EnumSerializer<mozilla::PixelFormat,
                          gfxImageFormat::ARGB32,
                          gfxImageFormat::Unknown>
{};
*/

template<>
struct ParamTraits<gfxRGBA>
{
  typedef gfxRGBA paramType;

  

  
};

template<>
struct ParamTraits<mozilla::gfx::Color>
{
  typedef mozilla::gfx::Color paramType;

  static void Write(Message* msg, const paramType& param)
  {
    WriteParam(msg, param.r);
    WriteParam(msg, param.g);
    WriteParam(msg, param.b);
    WriteParam(msg, param.a);
  }

  static bool Read(const Message* msg, void** iter, paramType* result)
  {
    return (ReadParam(msg, iter, &result->r) &&
            ReadParam(msg, iter, &result->g) &&
            ReadParam(msg, iter, &result->b) &&
            ReadParam(msg, iter, &result->a));
  }
};

template<>
struct ParamTraits<nsPoint>
{
  typedef nsPoint paramType;

  

  
};

template<>
struct ParamTraits<nsIntPoint>
{
  typedef nsIntPoint paramType;

  

  
};

template<typename T>
struct ParamTraits<mozilla::gfx::IntSizeTyped<T> >
{
  typedef mozilla::gfx::IntSizeTyped<T> paramType;

  static void Write(Message* msg, const paramType& param)
  {
    WriteParam(msg, param.width);
    WriteParam(msg, param.height);
  }

  static bool Read(const Message* msg, void** iter, paramType* result)
  {
    return (ReadParam(msg, iter, &result->width) &&
            ReadParam(msg, iter, &result->height));
  }
};

template<>
struct ParamTraits<nsIntRect>
{
  typedef nsIntRect paramType;

  static void Write(Message* msg, const paramType& param)
  {
    WriteParam(msg, param.x);
    WriteParam(msg, param.y);
    WriteParam(msg, param.width);
    WriteParam(msg, param.height);
  }

  static bool Read(const Message* msg, void** iter, paramType* result)
  {
    return (ReadParam(msg, iter, &result->x) &&
            ReadParam(msg, iter, &result->y) &&
            ReadParam(msg, iter, &result->width) &&
            ReadParam(msg, iter, &result->height));
  }
};

template<typename Region, typename Rect, typename Iter>
struct RegionParamTraits
{
  typedef Region paramType;

  static void Write(Message* msg, const paramType& param)
  {
    Iter it(param);
    while (const Rect* r = it.Next()) {
      MOZ_ASSERT(!r->IsEmpty());
      WriteParam(msg, *r);
    }
    // empty rects are sentinel values because nsRegions will never
    // contain them
    WriteParam(msg, Rect());
  }

  static bool Read(const Message* msg, void** iter, paramType* result)
  {
    Rect rect;
    while (ReadParam(msg, iter, &rect)) {
      if (rect.IsEmpty())
        return true;
      result->Or(*result, rect);
    }
    return false;
  }
};

template<>
struct ParamTraits<nsIntRegion>
  : RegionParamTraits<nsIntRegion, nsIntRect, nsIntRegionRectIterator>
{};

template<>
struct ParamTraits<nsIntSize>
{
  typedef nsIntSize paramType;

  

  

  

  
};

template<class T, class U>
struct ParamTraits< mozilla::gfx::ScaleFactor<T, U> >
{
  typedef mozilla::gfx::ScaleFactor<T, U> paramType;

  static void Write(Message* msg, const paramType& param)
  {
    WriteParam(msg, param.scale);
  }

  static bool Read(const Message* msg, void** iter, paramType* result)
  {
    return (ReadParam(msg, iter, &result->scale));
  }
};

template<class T>
struct ParamTraits< mozilla::gfx::PointTyped<T> >
{
  typedef mozilla::gfx::PointTyped<T> paramType;

  

  
};

template<class T>
struct ParamTraits< mozilla::gfx::Point3DTyped<T> >
{
  typedef mozilla::gfx::Point3DTyped<T> paramType;

  static void Write(Message* msg, const paramType& param)
  {
    WriteParam(msg, param.x);
    WriteParam(msg, param.y);
    WriteParam(msg, param.z);
  }

  static bool Read(const Message* msg, void** iter, paramType* result)
  {
    return (ReadParam(msg, iter, &result->x) &&
            ReadParam(msg, iter, &result->y) &&
            ReadParam(msg, iter, &result->z));
  }
};

template<class T>
struct ParamTraits< mozilla::gfx::IntPointTyped<T> >
{
  typedef mozilla::gfx::IntPointTyped<T> paramType;

  static void Write(Message* msg, const paramType& param)
  {
    WriteParam(msg, param.x);
    WriteParam(msg, param.y);
  }

  static bool Read(const Message* msg, void** iter, paramType* result)
  {
    return (ReadParam(msg, iter, &result->x) &&
            ReadParam(msg, iter, &result->y));
  }
};

template<class T>
struct ParamTraits< mozilla::gfx::SizeTyped<T> >
{
  typedef mozilla::gfx::SizeTyped<T> paramType;

  static void Write(Message* msg, const paramType& param)
  {
    WriteParam(msg, param.width);
    WriteParam(msg, param.height);
  }

  static bool Read(const Message* msg, void** iter, paramType* result)
  {
    return (ReadParam(msg, iter, &result->width) &&
            ReadParam(msg, iter, &result->height));
  }
};

template<class T>
struct ParamTraits< mozilla::gfx::RectTyped<T> >
{
  typedef mozilla::gfx::RectTyped<T> paramType;

  

  
};

template<class T>
struct ParamTraits< mozilla::gfx::IntRectTyped<T> >
{
  typedef mozilla::gfx::IntRectTyped<T> paramType;

  static void Write(Message* msg, const paramType& param)
  {
    WriteParam(msg, param.x);
    WriteParam(msg, param.y);
    WriteParam(msg, param.width);
    WriteParam(msg, param.height);
  }

  static bool Read(const Message* msg, void** iter, paramType* result)
  {
    return (ReadParam(msg, iter, &result->x) &&
            ReadParam(msg, iter, &result->y) &&
            ReadParam(msg, iter, &result->width) &&
            ReadParam(msg, iter, &result->height));
  }
};

template<>
struct ParamTraits<mozilla::gfx::Margin>
{
  typedef mozilla::gfx::Margin paramType;

  

  
  

  

  
};

template<>
struct ParamTraits<mozilla::layers::TextureFactoryIdentifier>
{
  typedef mozilla::layers::TextureFactoryIdentifier paramType;

  

  
};

template<>
struct ParamTraits<mozilla::layers::TextureInfo>
{
  typedef mozilla::layers::TextureInfo paramType;
  
  

  
};

template <>
struct ParamTraits<mozilla::layers::CompositableType>
  : public ContiguousEnumSerializer<
             mozilla::layers::CompositableType,
             mozilla::layers::CompositableType::UNKNOWN,
             mozilla::layers::CompositableType::COUNT>
{};

template <>
struct ParamTraits<mozilla::gfx::SurfaceFormat>
  : public ContiguousEnumSerializer<
             mozilla::gfx::SurfaceFormat,
             mozilla::gfx::SurfaceFormat::B8G8R8A8,
             mozilla::gfx::SurfaceFormat::UNKNOWN>
{};
struct MessageAndAttributeMap
{
  Message* msg;
  const mozilla::gfx::AttributeMap& map;
};

static bool
WriteAttribute(mozilla::gfx::AttributeName aName,
               mozilla::gfx::AttributeType aType,
               void* aUserData)
{
  MessageAndAttributeMap* msgAndMap =
    static_cast<MessageAndAttributeMap*>(aUserData);

  WriteParam(msgAndMap->msg, aType);
  WriteParam(msgAndMap->msg, aName);

  switch (aType) {

#define HANDLE_TYPE(typeName)                                          \
    case mozilla::gfx::AttributeType::e##typeName:                     \
      WriteParam(msgAndMap->msg, msgAndMap->map.Get##typeName(aName)); \

    default:
      MOZ_CRASH("unhandled attribute type");
  }
  return true;
}

template <>
struct ParamTraits<mozilla::gfx::AttributeMap>
{
  typedef mozilla::gfx::AttributeMap paramType;

  static void Write(Message* aMsg, const paramType& aParam)
  {
    WriteParam(aMsg, aParam.Count());
    MessageAndAttributeMap msgAndMap = { aMsg, aParam };
    aParam.EnumerateRead(WriteAttribute, &msgAndMap);
  }

  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
  {
    uint32_t count;
    if (!ReadParam(aMsg, aIter, &count)) {
      return false;
    }
    for (uint32_t i = 0; i < count; i++) {
      mozilla::gfx::AttributeType type;
      if (!ReadParam(aMsg, aIter, &type)) {
        return false;
      }
      mozilla::gfx::AttributeName name;
      if (!ReadParam(aMsg, aIter, &name)) {
        return false;
      }
      switch (type) {

#define HANDLE_TYPE(type, typeName)                                    \
        case mozilla::gfx::AttributeType::e##typeName:                 \
        {                                                              \
          type value;                                                  \
          if (!ReadParam(aMsg, aIter, &value)) {                       \
            return false;                                              \
          }                                                            \
          aResult->Set(name, value);                                   \
        }

        HANDLE_TYPE(bool, Bool)
        HANDLE_TYPE(uint32_t, Uint)
        HANDLE_TYPE(float, Float)
        HANDLE_TYPE(mozilla::gfx::Size, Size)
        HANDLE_TYPE(mozilla::gfx::IntSize, IntSize)
        HANDLE_TYPE(mozilla::gfx::IntPoint, IntPoint)
        HANDLE_TYPE(mozilla::gfx::Matrix, Matrix)
        HANDLE_TYPE(mozilla::gfx::Matrix5x4, Matrix5x4)
        HANDLE_TYPE(mozilla::gfx::Point3D, Point3D)
        HANDLE_TYPE(mozilla::gfx::Color, Color)
        HANDLE_TYPE(mozilla::gfx::AttributeMap, AttributeMap)

#undef HANDLE_TYPE

        case mozilla::gfx::AttributeType::eFloats:
        {
          nsTArray<float> value;
          if (!ReadParam(aMsg, aIter, &value)) {
            return false;
          }
          aResult->Set(name, &value[0], value.Length());
          break;
        }
        default:
          MOZ_CRASH("unhandled attribute type");
      }
    }
    return true;
  }
};

template <>
struct ParamTraits<mozilla::gfx::FilterPrimitiveDescription>
{
  typedef mozilla::gfx::FilterPrimitiveDescription paramType;

  static void Write(Message* aMsg, const paramType& aParam)
  {
    WriteParam(aMsg, aParam.Type());
    WriteParam(aMsg, aParam.PrimitiveSubregion());
    WriteParam(aMsg, aParam.FilterSpaceBounds());
    WriteParam(aMsg, aParam.IsTainted());
    WriteParam(aMsg, aParam.OutputColorSpace());
    WriteParam(aMsg, aParam.NumberOfInputs());
    for (size_t i = 0; i < aParam.NumberOfInputs(); i++) {
      WriteParam(aMsg, aParam.InputPrimitiveIndex(i));
      WriteParam(aMsg, aParam.InputColorSpace(i));
    }
    WriteParam(aMsg, aParam.Attributes());
  }

  static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
  {
    mozilla::gfx::PrimitiveType type;
    mozilla::gfx::IntRect primitiveSubregion;
    mozilla::gfx::IntRect filterSpaceBounds;
    bool isTainted = false;
    mozilla::gfx::ColorSpace outputColorSpace;
    size_t numberOfInputs = 0;
    if (!ReadParam(aMsg, aIter, &type) ||
        !ReadParam(aMsg, aIter, &primitiveSubregion) ||
        !ReadParam(aMsg, aIter, &filterSpaceBounds) ||
        !ReadParam(aMsg, aIter, &isTainted) ||
        !ReadParam(aMsg, aIter, &outputColorSpace) ||
        !ReadParam(aMsg, aIter, &numberOfInputs)) {
      return false;
    }

    aResult->SetType(type);
    aResult->SetPrimitiveSubregion(primitiveSubregion);
    aResult->SetFilterSpaceBounds(filterSpaceBounds);
  }
};

typedef mozilla::layers::GeckoContentController::APZStateChange APZStateChange;

template <>
struct ParamTraits<APZStateChange>
  : public ContiguousEnumSerializer<
             APZStateChange,
             APZStateChange::TransformBegin,
             APZStateChange::APZStateChangeSentinel>
{};

template<>
struct ParamTraits<mozilla::layers::EventRegionsOverride>
  : public BitFlagsEnumSerializer<
            mozilla::layers::EventRegionsOverride,
            mozilla::layers::EventRegionsOverride::ALL_BITS>
{};

} /* namespace IPC */

#endif /* __GFXMESSAGEUTILS_H__ */
# 1119 "../../dist/include/mozilla/GfxMessageUtils.h"
# 18 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRendererParent.h" 2

namespace mozilla {
namespace dom {
class PBrowserParent;
} // namespace dom
} // namespace mozilla
namespace mozilla {
namespace dom {
class PBrowserChild;
} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {
class PBrowserParent;
} // namespace dom
} // namespace mozilla

struct nsIntSize;

namespace mozilla {
namespace ipc {


class /*NS_ABSTRACT_CLASS*/ PDocumentRendererParent :
    public mozilla::ipc::IProtocol,
    protected mozilla::ipc::IProtocolManager<mozilla::ipc::IProtocol>
{
    friend class mozilla::dom::PBrowserParent;

protected:
    typedef mozilla::ipc::ActorHandle ActorHandle;
    typedef mozilla::ipc::FileDescriptor FileDescriptor;
    typedef base::ProcessId ProcessId;
    typedef mozilla::ipc::ProtocolId ProtocolId;
    typedef mozilla::ipc::Shmem Shmem;
    typedef mozilla::ipc::Transport Transport;
    typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
    typedef mozilla::dom::PBrowserParent PBrowserParent;
    typedef mozilla::dom::PBrowserChild PBrowserChild;

    typedef PDocumentRenderer::State State;

    virtual bool
    Recv__delete__(
            const nsIntSize& renderedSize,
            const nsCString& data);

    virtual void
    ActorDestroy(ActorDestroyReason aWhy) = 0;

public:
    typedef mozilla::ipc::IProtocol ProtocolBase;
    typedef IPC::Message Message;
    typedef mozilla::ipc::MessageChannel Channel;
    typedef mozilla::ipc::MessageListener ChannelListener;
    typedef base::ProcessHandle ProcessHandle;
    typedef mozilla::ipc::MessageChannel MessageChannel;
    typedef mozilla::ipc::SharedMemory SharedMemory;
    typedef mozilla::ipc::Trigger Trigger;
    typedef mozilla::ipc::ProtocolCloneContext ProtocolCloneContext;

public:
    MOZ_IMPLICIT PDocumentRendererParent();

    ;
private:
    ;

    ;

    ;

    

    

    ;

    bool
    Read(
            PDocumentRendererParent** __v,
            const Message* __msg,
            void** __iter,
            bool __nullable) NS_WARN_UNUSED_RESULT;

    Channel* mChannel;
    mozilla::ipc::IProtocolManager<mozilla::ipc::IProtocol>* mManager;
    int32_t mId;
    State mState;
};


} // namespace ipc
} // namespace mozilla

#if 0

MOZ_IMPLICIT DocumentRendererParent::~DocumentRendererParent()
{
    MOZ_COUNT_DTOR(DocumentRendererParent);
}

} // namespace ipc
} // namespace mozilla
#endif // if 0
# 282 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRendererParent.h"

#endif // ifndef PDocumentRendererParent_h
# 284 "/Users/luser/build/iphone-device-debug/ipc/ipdl/_ipdlheaders/mozilla/ipc/PDocumentRendererParent.h"
# 9 "../../dist/include/mozilla/ipc/DocumentRendererParent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/ipc/DocumentRendererParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsString.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/ipc/DocumentRendererParent.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfxContext.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/ipc/DocumentRendererParent.h"

class nsICanvasRenderingContextInternal;

namespace mozilla {
namespace ipc {

class DocumentRendererParent : public PDocumentRendererParent
{
public:
    ;
    ;

    ;
    ;

    virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;

    virtual bool Recv__delete__(const nsIntSize& renderedSize,
                                const nsCString& data) MOZ_OVERRIDE;

private:
    nsCOMPtr<nsICanvasRenderingContextInternal> mCanvas;
    nsRefPtr<gfxContext> mCanvasContext;

    DISALLOW_EVIL_CONSTRUCTORS(DocumentRendererParent);
};

}
}

#endif
# 45 "../../dist/include/mozilla/ipc/DocumentRendererParent.h"
# 89 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ipc/PDocumentRendererParent.h"
#endif /* expanded by -frewrite-includes */
# 90 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/MathAlgorithms.h"
#endif /* expanded by -frewrite-includes */
# 91 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Preferences.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Preferences.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_Preferences_h
#define mozilla_Preferences_h

#ifndef MOZILLA_INTERNAL_API
#error "This header is only usable from within libxul (MOZILLA_INTERNAL_API)."
#endif
# 12 "../../dist/include/mozilla/Preferences.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsIPrefService.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIPrefService.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIPrefService.idl
 */

#ifndef __gen_nsIPrefService_h__
#define __gen_nsIPrefService_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIPrefService.h"
#endif
# 12 "../../dist/include/nsIPrefService.h"

#ifndef __gen_nsIPrefBranch_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrefBranch.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIPrefBranch.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIPrefBranch.idl
 */

#ifndef __gen_nsIPrefBranch_h__
#define __gen_nsIPrefBranch_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIPrefBranch.h"
#endif
# 12 "../../dist/include/nsIPrefBranch.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIPrefBranch.h"
class nsIObserver; /* forward declaration */


/* starting interface:    nsIPrefBranch */
#define NS_IPREFBRANCH_IID_STR "55d25e49-793f-4727-a69f-de8b15f4b985"

#define NS_IPREFBRANCH_IID \
  {0x55d25e49, 0x793f, 0x4727, \
    { 0xa6, 0x9f, 0xde, 0x8b, 0x15, 0xf4, 0xb9, 0x85 }}

class NS_NO_VTABLE nsIPrefBranch : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPREFBRANCH_IID)

  enum {
    PREF_INVALID = 0,
    PREF_STRING = 32,
    PREF_INT = 64,
    PREF_BOOL = 128
  };

  /* readonly attribute string root; */
  NS_IMETHOD GetRoot(char * *aRoot) = 0;

  /* long getPrefType (in string aPrefName); */
  NS_IMETHOD GetPrefType(const char * aPrefName, int32_t *_retval) = 0;

  /* boolean getBoolPref (in string aPrefName); */
  NS_IMETHOD GetBoolPref(const char * aPrefName, bool *_retval) = 0;

  /* void setBoolPref (in string aPrefName, in boolean aValue); */
  NS_IMETHOD SetBoolPref(const char * aPrefName, bool aValue) = 0;

  /* float getFloatPref (in string aPrefName); */
  NS_IMETHOD GetFloatPref(const char * aPrefName, float *_retval) = 0;

  /* string getCharPref (in string aPrefName); */
  NS_IMETHOD GetCharPref(const char * aPrefName, char * *_retval) = 0;

  /* void setCharPref (in string aPrefName, in string aValue); */
  NS_IMETHOD SetCharPref(const char * aPrefName, const char * aValue) = 0;

  /* long getIntPref (in string aPrefName); */
  NS_IMETHOD GetIntPref(const char * aPrefName, int32_t *_retval) = 0;

  /* void setIntPref (in string aPrefName, in long aValue); */
  NS_IMETHOD SetIntPref(const char * aPrefName, int32_t aValue) = 0;

  /* void getComplexValue (in string aPrefName, in nsIIDRef aType, [iid_is (aType), retval] out nsQIResult aValue); */
  NS_IMETHOD GetComplexValue(const char * aPrefName, const nsIID & aType, void **aValue) = 0;

  /* void setComplexValue (in string aPrefName, in nsIIDRef aType, in nsISupports aValue); */
  NS_IMETHOD SetComplexValue(const char * aPrefName, const nsIID & aType, nsISupports *aValue) = 0;

  /* void clearUserPref (in string aPrefName); */
  NS_IMETHOD ClearUserPref(const char * aPrefName) = 0;

  /* void lockPref (in string aPrefName); */
  NS_IMETHOD LockPref(const char * aPrefName) = 0;

  /* boolean prefHasUserValue (in string aPrefName); */
  NS_IMETHOD PrefHasUserValue(const char * aPrefName, bool *_retval) = 0;

  /* boolean prefIsLocked (in string aPrefName); */
  NS_IMETHOD PrefIsLocked(const char * aPrefName, bool *_retval) = 0;

  /* void unlockPref (in string aPrefName); */
  NS_IMETHOD UnlockPref(const char * aPrefName) = 0;

  /* void deleteBranch (in string aStartingAt); */
  NS_IMETHOD DeleteBranch(const char * aStartingAt) = 0;

  /* void getChildList (in string aStartingAt, [optional] out unsigned long aCount, [array, size_is (aCount), retval] out string aChildArray); */
  NS_IMETHOD GetChildList(const char * aStartingAt, uint32_t *aCount, char * **aChildArray) = 0;

  /* void resetBranch (in string aStartingAt); */
  NS_IMETHOD ResetBranch(const char * aStartingAt) = 0;

  /* void addObserver (in string aDomain, in nsIObserver aObserver, in boolean aHoldWeak); */
  NS_IMETHOD AddObserver(const char * aDomain, nsIObserver *aObserver, bool aHoldWeak) = 0;

  /* void removeObserver (in string aDomain, in nsIObserver aObserver); */
  NS_IMETHOD RemoveObserver(const char * aDomain, nsIObserver *aObserver) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrefBranch, NS_IPREFBRANCH_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPREFBRANCH \
  NS_IMETHOD GetRoot(char * *aRoot) MOZ_OVERRIDE; \
  NS_IMETHOD GetPrefType(const char * aPrefName, int32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetBoolPref(const char * aPrefName, bool *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD SetBoolPref(const char * aPrefName, bool aValue) MOZ_OVERRIDE; \
  NS_IMETHOD RemoveObserver(const char * aDomain, nsIObserver *aObserver) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPREFBRANCH(_to) \
  NS_IMETHOD GetRoot(char * *aRoot) MOZ_OVERRIDE { return _to GetRoot(aRoot); } \
  NS_IMETHOD GetPrefType(const char * aPrefName, int32_t *_retval) MOZ_OVERRIDE { return _to GetPrefType(aPrefName, _retval); } \
  NS_IMETHOD GetBoolPref(const char * aPrefName, bool *_retval) MOZ_OVERRIDE { return _to GetBoolPref(aPrefName, _retval); } \
  NS_IMETHOD SetBoolPref(const char * aPrefName, bool aValue) MOZ_OVERRIDE { return _to SetBoolPref(aPrefName, aValue); } \
  NS_IMETHOD GetFloatPref(const char * aPrefName, float *_retval) MOZ_OVERRIDE { return _to GetFloatPref(aPrefName, _retval); } \
  NS_IMETHOD GetCharPref(const char * aPrefName, char * *_retval) MOZ_OVERRIDE { return _to GetCharPref(aPrefName, _retval); } \
  NS_IMETHOD SetCharPref(const char * aPrefName, const char * aValue) MOZ_OVERRIDE { return _to SetCharPref(aPrefName, aValue); } \
  NS_IMETHOD GetIntPref(const char * aPrefName, int32_t *_retval) MOZ_OVERRIDE { return _to GetIntPref(aPrefName, _retval); } \
  NS_IMETHOD SetIntPref(const char * aPrefName, int32_t aValue) MOZ_OVERRIDE { return _to SetIntPref(aPrefName, aValue); } \
  NS_IMETHOD GetComplexValue(const char * aPrefName, const nsIID & aType, void **aValue) MOZ_OVERRIDE { return _to GetComplexValue(aPrefName, aType, aValue); } \
  NS_IMETHOD SetComplexValue(const char * aPrefName, const nsIID & aType, nsISupports *aValue) MOZ_OVERRIDE { return _to SetComplexValue(aPrefName, aType, aValue); } \
  NS_IMETHOD ClearUserPref(const char * aPrefName) MOZ_OVERRIDE { return _to ClearUserPref(aPrefName); } \
  NS_IMETHOD LockPref(const char * aPrefName) MOZ_OVERRIDE { return _to LockPref(aPrefName); } \
  NS_IMETHOD PrefHasUserValue(const char * aPrefName, bool *_retval) MOZ_OVERRIDE { return _to PrefHasUserValue(aPrefName, _retval); } \
  NS_IMETHOD PrefIsLocked(const char * aPrefName, bool *_retval) MOZ_OVERRIDE { return _to PrefIsLocked(aPrefName, _retval); } \
  NS_IMETHOD UnlockPref(const char * aPrefName) MOZ_OVERRIDE { return _to UnlockPref(aPrefName); } \
  NS_IMETHOD DeleteBranch(const char * aStartingAt) MOZ_OVERRIDE { return _to DeleteBranch(aStartingAt); } \
  NS_IMETHOD GetChildList(const char * aStartingAt, uint32_t *aCount, char * **aChildArray) MOZ_OVERRIDE { return _to GetChildList(aStartingAt, aCount, aChildArray); } \
  NS_IMETHOD ResetBranch(const char * aStartingAt) MOZ_OVERRIDE { return _to ResetBranch(aStartingAt); } \
  NS_IMETHOD AddObserver(const char * aDomain, nsIObserver *aObserver, bool aHoldWeak) MOZ_OVERRIDE { return _to AddObserver(aDomain, aObserver, aHoldWeak); } \
  NS_IMETHOD RemoveObserver(const char * aDomain, nsIObserver *aObserver) MOZ_OVERRIDE { return _to RemoveObserver(aDomain, aObserver); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPREFBRANCH(_to) \
  NS_IMETHOD GetRoot(char * *aRoot) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRoot(aRoot); } \
  NS_IMETHOD GetPrefType(const char * aPrefName, int32_t *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPrefType(aPrefName, _retval); } \
  NS_IMETHOD GetBoolPref(const char * aPrefName, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBoolPref(aPrefName, _retval); } \
  NS_IMETHOD SetBoolPref(const char * aPrefName, bool aValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetBoolPref(aPrefName, aValue); } \

#endif /* __gen_nsIPrefBranch_h__ */
# 347 "../../dist/include/nsIPrefBranch.h"
# 15 "../../dist/include/nsIPrefService.h" 2
#endif
# 16 "../../dist/include/nsIPrefService.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 21 "../../dist/include/nsIPrefService.h"
struct PrefTuple;
#if 0 /* expanded by -frewrite-includes */
#include "nsTArrayForwardDeclare.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsIPrefService.h"
class nsIFile; /* forward declaration */


/* starting interface:    nsIPrefService */
#define NS_IPREFSERVICE_IID_STR "1f84fd56-3956-40df-b86a-1ea01402ee96"

#define NS_IPREFSERVICE_IID \
  {0x1f84fd56, 0x3956, 0x40df, \
    { 0xb8, 0x6a, 0x1e, 0xa0, 0x14, 0x02, 0xee, 0x96 }}

class NS_NO_VTABLE nsIPrefService : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPREFSERVICE_IID)

  /* void readUserPrefs (in nsIFile aFile); */
  NS_IMETHOD ReadUserPrefs(nsIFile *aFile) = 0;

  /* void resetPrefs (); */
  NS_IMETHOD ResetPrefs(void) = 0;

  /* void resetUserPrefs (); */
  NS_IMETHOD ResetUserPrefs(void) = 0;

  /* void savePrefFile (in nsIFile aFile); */
  NS_IMETHOD SavePrefFile(nsIFile *aFile) = 0;

  /* nsIPrefBranch getBranch (in string aPrefRoot); */
  NS_IMETHOD GetBranch(const char * aPrefRoot, nsIPrefBranch * *_retval) = 0;

  /* nsIPrefBranch getDefaultBranch (in string aPrefRoot); */
  NS_IMETHOD GetDefaultBranch(const char * aPrefRoot, nsIPrefBranch * *_retval) = 0;

  /* readonly attribute boolean dirty; */
  NS_IMETHOD GetDirty(bool *aDirty) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrefService, NS_IPREFSERVICE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPREFSERVICE \
  NS_IMETHOD ReadUserPrefs(nsIFile *aFile) MOZ_OVERRIDE; \
  NS_IMETHOD ResetPrefs(void) MOZ_OVERRIDE; \
  NS_IMETHOD ResetUserPrefs(void) MOZ_OVERRIDE; \
  NS_IMETHOD SavePrefFile(nsIFile *aFile) MOZ_OVERRIDE; \
  NS_IMETHOD GetBranch(const char * aPrefRoot, nsIPrefBranch * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetDefaultBranch(const char * aPrefRoot, nsIPrefBranch * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetDirty(bool *aDirty) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPREFSERVICE(_to) \
  NS_IMETHOD ReadUserPrefs(nsIFile *aFile) MOZ_OVERRIDE { return _to ReadUserPrefs(aFile); } \
  NS_IMETHOD ResetPrefs(void) MOZ_OVERRIDE { return _to ResetPrefs(); } \
  NS_IMETHOD ResetUserPrefs(void) MOZ_OVERRIDE { return _to ResetUserPrefs(); } \
  NS_IMETHOD SavePrefFile(nsIFile *aFile) MOZ_OVERRIDE { return _to SavePrefFile(aFile); } \
  NS_IMETHOD GetBranch(const char * aPrefRoot, nsIPrefBranch * *_retval) MOZ_OVERRIDE { return _to GetBranch(aPrefRoot, _retval); } \
  NS_IMETHOD GetDefaultBranch(const char * aPrefRoot, nsIPrefBranch * *_retval) MOZ_OVERRIDE { return _to GetDefaultBranch(aPrefRoot, _retval); } \
  NS_IMETHOD GetDirty(bool *aDirty) MOZ_OVERRIDE { return _to GetDirty(aDirty); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPREFSERVICE(_to) \
  NS_IMETHOD ReadUserPrefs(nsIFile *aFile) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadUserPrefs(aFile); } \
  NS_IMETHOD ResetPrefs(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetPrefs(); } \
  NS_IMETHOD ResetUserPrefs(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ResetUserPrefs(); } \
  NS_IMETHOD SavePrefFile(nsIFile *aFile) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SavePrefFile(aFile); } \
  NS_IMETHOD GetBranch(const char * aPrefRoot, nsIPrefBranch * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBranch(aPrefRoot, _retval); } \
  NS_IMETHOD GetDefaultBranch(const char * aPrefRoot, nsIPrefBranch * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultBranch(aPrefRoot, _retval); } \
  NS_IMETHOD GetDirty(bool *aDirty) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDirty(aDirty); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsPrefService : public nsIPrefService
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPREFSERVICE
}

/* End of implementation class template. */
#endif
# 169 "../../dist/include/nsIPrefService.h"


#define NS_PREFSERVICE_CID                             \
  { /* {1cd91b88-1dd2-11b2-92e1-ed22ed298000} */       \
    0x91ca2441,                                        \
    0x050f,                                            \
    0x4f7c,                                            \
    { 0x9d, 0xf8, 0x75, 0xb4, 0x0e, 0xa4, 0x01, 0x56 } \
  }
#define NS_PREFSERVICE_CONTRACTID "@mozilla.org/preferences-service;1"
/**
 * Notification sent before reading the default user preferences files.
 */
#define NS_PREFSERVICE_READ_TOPIC_ID "prefservice:before-read-userprefs"
/**
 * Notification sent when resetPrefs has been called, but before the actual
 * reset process occurs.
 */
#define NS_PREFSERVICE_RESET_TOPIC_ID "prefservice:before-reset"
/**
 * Notification sent when after reading app-provided default
 * preferences, but before user profile override defaults or extension
 * defaults are loaded.
 */
#define NS_PREFSERVICE_APPDEFAULTS_TOPIC_ID "prefservice:after-app-defaults"

#endif /* __gen_nsIPrefService_h__ */
# 196 "../../dist/include/nsIPrefService.h"
# 14 "../../dist/include/mozilla/Preferences.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrefBranch.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/Preferences.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrefBranchInternal.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIPrefBranchInternal.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIPrefBranchInternal.idl
 */

#ifndef __gen_nsIPrefBranchInternal_h__
#define __gen_nsIPrefBranchInternal_h__


#ifndef __gen_nsIPrefBranch2_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrefBranch2.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIPrefBranch2.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIPrefBranch2.idl
 */

#ifndef __gen_nsIPrefBranch2_h__
#define __gen_nsIPrefBranch2_h__


#ifndef __gen_nsIPrefBranch_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIPrefBranch.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIPrefBranch2.h"
#endif
# 12 "../../dist/include/nsIPrefBranch2.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIPrefBranch2.h"

/* starting interface:    nsIPrefBranch2 */
#define NS_IPREFBRANCH2_IID_STR "8892016d-07f7-4530-b5c1-d73dfcde4a1c"

#define NS_IPREFBRANCH2_IID \
  {0x8892016d, 0x07f7, 0x4530, \
    { 0xb5, 0xc1, 0xd7, 0x3d, 0xfc, 0xde, 0x4a, 0x1c }}

class NS_NO_VTABLE nsIPrefBranch2 : public nsIPrefBranch {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPREFBRANCH2_IID)

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrefBranch2, NS_IPREFBRANCH2_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPREFBRANCH2 \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPREFBRANCH2(_to) \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPREFBRANCH2(_to) \
  /* no methods! */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsPrefBranch2 : public nsIPrefBranch2
{
public:
{
  /* member initializers and constructor code */
}

nsPrefBranch2::~nsPrefBranch2()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 80 "../../dist/include/nsIPrefBranch2.h"


#endif /* __gen_nsIPrefBranch2_h__ */
# 83 "../../dist/include/nsIPrefBranch2.h"
# 11 "../../dist/include/nsIPrefBranchInternal.h" 2
#endif
# 12 "../../dist/include/nsIPrefBranchInternal.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIPrefBranchInternal.h"

/* starting interface:    nsIPrefBranchInternal */
#define NS_IPREFBRANCHINTERNAL_IID_STR "355bd1e9-248a-438b-809d-e0db1b287882"

#define NS_IPREFBRANCHINTERNAL_IID \
  {0x355bd1e9, 0x248a, 0x438b, \
    { 0x80, 0x9d, 0xe0, 0xdb, 0x1b, 0x28, 0x78, 0x82 }}

class NS_NO_VTABLE nsIPrefBranchInternal : public nsIPrefBranch2 {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPREFBRANCHINTERNAL_IID)

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIPrefBranchInternal, NS_IPREFBRANCHINTERNAL_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPREFBRANCHINTERNAL \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPREFBRANCHINTERNAL(_to) \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPREFBRANCHINTERNAL(_to) \
  /* no methods! */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsPrefBranchInternal : public nsIPrefBranchInternal
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPREFBRANCHINTERNAL


nsPrefBranchInternal::~nsPrefBranchInternal()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 80 "../../dist/include/nsIPrefBranchInternal.h"


#endif /* __gen_nsIPrefBranchInternal_h__ */
# 83 "../../dist/include/nsIPrefBranchInternal.h"
# 16 "../../dist/include/mozilla/Preferences.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIObserver.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/Preferences.h"

class nsIFile;
class nsCString;
class nsString;
class nsAdoptingString;
class nsAdoptingCString;

#ifndef have_PrefChangedFunc_typedef
typedef void (*PrefChangedFunc)(const char *, void *);
#define have_PrefChangedFunc_typedef
#endif
# 32 "../../dist/include/mozilla/Preferences.h"

namespace mozilla {

namespace dom {
class PrefSetting;
}

class Preferences MOZ_FINAL : public nsIPrefService,
                              public nsIObserver,
                              public nsIPrefBranchInternal,
                              public nsSupportsWeakReference
{
public:
  typedef mozilla::dom::PrefSetting PrefSetting;

  NS_DECL_THREADSAFE_ISUPPORTS
  NS_DECL_NSIPREFSERVICE
  NS_FORWARD_NSIPREFBRANCH(sRootBranch->)

  /**
   * Returns shared default pref branch instance.
   * NOTE: not addreffed.
   */
  

  /**
   * Gets int or bool type pref value with default value if failed to get
   * the pref.
   */
  static bool GetBool(const char* aPref, bool aDefault = false)
  {
    bool result = aDefault;
    GetBool(aPref, &result);
    return result;
  }

  static int32_t GetInt(const char* aPref, int32_t aDefault = 0)
  {
    int32_t result = aDefault;
    GetInt(aPref, &result);
    return result;
  }

  

  

  /**
   * Gets char type pref value directly.  If failed, the get() of result
   * returns nullptr.  Even if succeeded but the result was empty string, the
   * when you need to check whether it was failure or not.
   */
  ;
  ;
  ;
  ;

  /**
   * Gets int, float, or bool type pref value with raw return value of
   * nsIPrefBranch.
   *
   * @param aPref       A pref name.
   * @param aResult     Must not be nullptr.  The value is never modified
   *                    when these methods fail.
   */
  static nsresult GetBool(const char* aPref, bool* aResult);
  static nsresult GetInt(const char* aPref, int32_t* aResult);
  ;
  

  /**
   * Gets string type pref value with raw return value of nsIPrefBranch.
   *
   * @param aPref       A pref name.
   * @param aResult     Must not be nullptr.  The value is never modified
   *                    when these methods fail.
   */
  ;
  ;

  ;

  ;

private:
  nsCOMPtr<nsIFile>        mCurrentFile;

  static Preferences*      sPreferences;
  static nsIPrefBranch*    sRootBranch;
  static nsIPrefBranch*    sDefaultRootBranch;
  static bool              sShutdown;

  /**
   * Init static members.  TRUE if it succeeded.  Otherwise, FALSE.
   */
  ;
};

} // namespace mozilla

#endif // mozilla_Preferences_h
# 389 "../../dist/include/mozilla/Preferences.h"
# 92 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Telemetry.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/Telemetry.h" 1
/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef Telemetry_h__
#define Telemetry_h__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/GuardObjects.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/Telemetry.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TimeStamp.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/Telemetry.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/StartupTimeline.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/StartupTimeline.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifdef mozilla_StartupTimeline_Event
mozilla_StartupTimeline_Event(PROCESS_CREATION, "process")
mozilla_StartupTimeline_Event(START, "start")
mozilla_StartupTimeline_Event(MAIN, "main")
mozilla_StartupTimeline_Event(SELECT_PROFILE, "selectProfile")
mozilla_StartupTimeline_Event(AFTER_PROFILE_LOCKED, "afterProfileLocked")
// Record the beginning and end of startup crash detection to compare with crash stats to know whether
// detection should be improved to start or end sooner.
mozilla_StartupTimeline_Event(STARTUP_CRASH_DETECTION_BEGIN, "startupCrashDetectionBegin")
mozilla_StartupTimeline_Event(STARTUP_CRASH_DETECTION_END, "startupCrashDetectionEnd")
mozilla_StartupTimeline_Event(FIRST_PAINT, "firstPaint")
mozilla_StartupTimeline_Event(SESSION_RESTORE_INIT, "sessionRestoreInit")
mozilla_StartupTimeline_Event(SESSION_RESTORED, "sessionRestored")
mozilla_StartupTimeline_Event(CREATE_TOP_LEVEL_WINDOW, "createTopLevelWindow")
mozilla_StartupTimeline_Event(LINKER_INITIALIZED, "linkerInitialized")
mozilla_StartupTimeline_Event(LIBRARIES_LOADED, "librariesLoaded")
mozilla_StartupTimeline_Event(FIRST_LOAD_URI, "firstLoadURI")

// The following are actually shutdown events, used to monitor the duration of shutdown
mozilla_StartupTimeline_Event(QUIT_APPLICATION, "quitApplication")
mozilla_StartupTimeline_Event(PROFILE_BEFORE_CHANGE, "profileBeforeChange")
#else
# 27 "../../dist/include/mozilla/StartupTimeline.h"

#ifndef mozilla_StartupTimeline
#define mozilla_StartupTimeline

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TimeStamp.h"
#endif /* expanded by -frewrite-includes */
# 32 "../../dist/include/mozilla/StartupTimeline.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 33 "../../dist/include/mozilla/StartupTimeline.h"
#if 0 /* expanded by -frewrite-includes */
#include "GeckoProfiler.h"
#endif /* expanded by -frewrite-includes */
# 34 "../../dist/include/mozilla/StartupTimeline.h"

#ifdef MOZ_LINKER
extern "C" {
/* This symbol is resolved by the custom linker. The function it resolves
 * to dumps some statistics about the linker at the key events recorded
 * by the startup timeline. */
extern void __moz_linker_stats(const char *str)
NS_VISIBILITY_DEFAULT __attribute__((weak));
} /* extern "C" */
#else
# 44 "../../dist/include/mozilla/StartupTimeline.h"

#endif
# 46 "../../dist/include/mozilla/StartupTimeline.h"

namespace mozilla {

;
;
;

class StartupTimeline {
public:
  enum Event {
    #define mozilla_StartupTimeline_Event(ev, z) ev,
    #if 0 /* expanded by -frewrite-includes */
#include "StartupTimeline.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/StartupTimeline.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifdef mozilla_StartupTimeline_Event
mozilla_StartupTimeline_Event(PROCESS_CREATION, "process")
mozilla_StartupTimeline_Event(START, "start")
mozilla_StartupTimeline_Event(MAIN, "main")
mozilla_StartupTimeline_Event(SELECT_PROFILE, "selectProfile")
mozilla_StartupTimeline_Event(AFTER_PROFILE_LOCKED, "afterProfileLocked")
// Record the beginning and end of startup crash detection to compare with crash stats to know whether

#ifndef mozilla_StartupTimeline
#define mozilla_StartupTimeline

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TimeStamp.h"
#endif /* expanded by -frewrite-includes */
# 32 "../../dist/include/mozilla/StartupTimeline.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 33 "../../dist/include/mozilla/StartupTimeline.h"
#if 0 /* expanded by -frewrite-includes */
#include "GeckoProfiler.h"
#endif /* expanded by -frewrite-includes */
# 34 "../../dist/include/mozilla/StartupTimeline.h"

private:
  static NS_EXTERNAL_VIS_(TimeStamp) sStartupTimeline[MAX_EVENT_ID];
  static NS_EXTERNAL_VIS_(const char *) sStartupTimelineDesc[MAX_EVENT_ID];
};

}

#endif /* mozilla_StartupTimeline */
# 100 "../../dist/include/mozilla/StartupTimeline.h"

#endif /* mozilla_StartupTimeline_Event */
# 102 "../../dist/include/mozilla/StartupTimeline.h"
# 58 "../../dist/include/mozilla/StartupTimeline.h" 2
    #undef mozilla_StartupTimeline_Event
    MAX_EVENT_ID
  };

  

  

  

  

  

  

private:
  static NS_EXTERNAL_VIS_(TimeStamp) sStartupTimeline[MAX_EVENT_ID];
  static NS_EXTERNAL_VIS_(const char *) sStartupTimelineDesc[MAX_EVENT_ID];
};

}

#endif /* mozilla_StartupTimeline */
# 100 "../../dist/include/mozilla/StartupTimeline.h"

#endif /* mozilla_StartupTimeline_Event */
# 102 "../../dist/include/mozilla/StartupTimeline.h"
# 12 "../../dist/include/mozilla/Telemetry.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/Telemetry.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsStringGlue.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/Telemetry.h"

namespace base {
  class Histogram;
}

namespace mozilla {
namespace HangMonitor {
  class HangAnnotations;
}
namespace Telemetry {

#if 0 /* expanded by -frewrite-includes */
#include "TelemetryHistogramEnums.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/TelemetryHistogramEnums.h" 1
/* This file is auto-generated, see gen-histogram-enum.py.  */

enum ID : uint32_t {
  A11Y_INSTANTIATED_FLAG,
  A11Y_CONSUMERS,
  A11Y_ISIMPLEDOM_USAGE_FLAG,
  A11Y_IATABLE_USAGE_FLAG,
  PWMGR_FORM_ACTION_EFFECT,
  PWMGR_FORM_AUTOFILL_RESULT,
  PWMGR_NUM_PASSWORDS_PER_HOSTNAME,
  PWMGR_NUM_SAVED_PASSWORDS,
  PWMGR_NUM_HTTPAUTH_PASSWORDS,
  PWMGR_LOGIN_LAST_USED_DAYS,
  PWMGR_PROMPT_REMEMBER_ACTION,
  Microsecond
};

/**
 * Initialize the Telemetry service on the main thread at startup.
 */
;

/**
 * Adds sample to a histogram defined in TelemetryHistograms.h
 *
;

/**
 * Record a failed attempt at locking the user's profile.
 *
 * @param aProfileDir The profile directory whose lock attempt failed
 */
;

} // namespace Telemetry
} // namespace mozilla
#endif // Telemetry_h__
# 269 "../../dist/include/mozilla/Telemetry.h"
# 93 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TimeStamp.h"
#endif /* expanded by -frewrite-includes */
# 94 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsCCUncollectableMarker_h_
#define nsCCUncollectableMarker_h_

#if 0 /* expanded by -frewrite-includes */
#include "js/TracingAPI.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsCCUncollectableMarker.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsCCUncollectableMarker.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIObserver.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/base/nsCCUncollectableMarker.h"

class nsCCUncollectableMarker MOZ_FINAL : public nsIObserver
{
  NS_DECL_ISUPPORTS
  NS_DECL_NSIOBSERVER

  /**
   * Inits a global nsCCUncollectableMarker. Should only be called once.
   */
  ;

  /**
   * Checks if we're collecting during a given generation
   */
  

  

  static uint32_t sGeneration;

private:
  
  
};

namespace mozilla {
namespace dom {
;
}
}

#endif
# 51 "/Users/luser/build/mozilla-central/dom/base/nsCCUncollectableMarker.h"
# 97 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCacheInlines.h"
#endif /* expanded by -frewrite-includes */
# 98 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CanvasRenderingContext2DBinding.h"
#endif /* expanded by -frewrite-includes */
# 99 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLImageElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/HTMLImageElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_HTMLImageElement_h
#define mozilla_dom_HTMLImageElement_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/HTMLImageElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsGenericHTMLElement.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/HTMLImageElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsImageLoadingContent.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsImageLoadingContent.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
// vim: ft=cpp tw=78 sw=2 et ts=2
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/*
 * A base class which implements nsIImageLoadingContent and can be
 * subclassed by various content nodes that want to provide image
 * loading functionality (eg <img>, <object>, etc).
 */

#ifndef nsImageLoadingContent_h__
#define nsImageLoadingContent_h__

#if 0 /* expanded by -frewrite-includes */
#include "imgINotificationObserver.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/base/nsImageLoadingContent.h"
#if 0 /* expanded by -frewrite-includes */
#include "imgIOnloadBlocker.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/imgIOnloadBlocker.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/imgIOnloadBlocker.idl
 */

#ifndef __gen_imgIOnloadBlocker_h__
#define __gen_imgIOnloadBlocker_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/imgIOnloadBlocker.h"
#endif
# 12 "../../dist/include/imgIOnloadBlocker.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/imgIOnloadBlocker.h"
class imgIRequest; /* forward declaration */


/* starting interface:    imgIOnloadBlocker */
#define IMGIONLOADBLOCKER_IID_STR "dc126d90-0ee0-4683-b942-2fa66e443abc"

#define IMGIONLOADBLOCKER_IID \
  {0xdc126d90, 0x0ee0, 0x4683, \
    { 0xb9, 0x42, 0x2f, 0xa6, 0x6e, 0x44, 0x3a, 0xbc }}

class NS_NO_VTABLE imgIOnloadBlocker : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(IMGIONLOADBLOCKER_IID)

  /* void blockOnload (in imgIRequest aRequest); */
  NS_IMETHOD BlockOnload(imgIRequest *aRequest) = 0;

  /* void unblockOnload (in imgIRequest aRequest); */
  NS_IMETHOD UnblockOnload(imgIRequest *aRequest) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(imgIOnloadBlocker, IMGIONLOADBLOCKER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_IMGIONLOADBLOCKER \
  NS_IMETHOD BlockOnload(imgIRequest *aRequest) MOZ_OVERRIDE; \
  NS_IMETHOD UnblockOnload(imgIRequest *aRequest) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_IMGIONLOADBLOCKER(_to) \
  NS_IMETHOD BlockOnload(imgIRequest *aRequest) MOZ_OVERRIDE { return _to BlockOnload(aRequest); } \
  NS_IMETHOD UnblockOnload(imgIRequest *aRequest) MOZ_OVERRIDE { return _to UnblockOnload(aRequest); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_IMGIONLOADBLOCKER(_to) \
  NS_IMETHOD BlockOnload(imgIRequest *aRequest) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->BlockOnload(aRequest); } \
  NS_IMETHOD UnblockOnload(imgIRequest *aRequest) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->UnblockOnload(aRequest); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class _MYCLASS_ : public imgIOnloadBlocker
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_IMGIONLOADBLOCKER

  _MYCLASS_();
}

/* End of implementation class template. */
#endif
# 103 "../../dist/include/imgIOnloadBlocker.h"


#endif /* __gen_imgIOnloadBlocker_h__ */
# 106 "../../dist/include/imgIOnloadBlocker.h"
# 18 "/Users/luser/build/mozilla-central/dom/base/nsImageLoadingContent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/CORSMode.h"
#endif /* expanded by -frewrite-includes */
# 27 "/Users/luser/build/mozilla-central/dom/base/nsImageLoadingContent.h"

class nsIURI;
class nsIDocument;
class imgILoader;
class nsIIOService;
class nsPresContext;
class nsIContent;
class imgRequestProxy;

#ifdef LoadImage
// Undefine LoadImage to prevent naming conflict with Windows.
#undef LoadImage
#endif
# 40 "/Users/luser/build/mozilla-central/dom/base/nsImageLoadingContent.h"

class nsImageLoadingContent : public nsIImageLoadingContent,
                              public imgIOnloadBlocker
{
  /* METHODS */
public:
  ;
  ;

  NS_DECL_IMGINOTIFICATIONOBSERVER
  NS_DECL_NSIIMAGELOADINGCONTENT
  NS_DECL_IMGIONLOADBLOCKER

  // Web IDL binding methods.
  // Note that the XPCOM SetLoadingEnabled, AddObserver, RemoveObserver,
  // ForceImageState methods are OK for Web IDL bindings to use as well,
  ;

protected:
  enum ImageLoadType {
    // Most normal image loads
    eImageLoadType_Normal,
    // From a <img srcset> or <picture> context. Affects type given to content
    // policy.
    eImageLoadType_Imageset
  };

  /**
   * LoadImage is called by subclasses when the appropriate
   * attributes (eg 'src' for <img> tags) change.  The string passed
   * in is the new uri string; this consolidates the code for getting
   * the charset, constructing URI objects, and any other incidentals

  

  // Sets blocking state only if the desired state is different from the
  // current one. See the comment for mBlockingOnload for more information.
  ;

  /**
   * Returns the CORS mode that will be used for all future image loads. The
   * default implementation returns CORS_NONE unconditionally.
   */
  virtual mozilla::CORSMode GetCORSMode();

  // Subclasses are *required* to call BindToTree/UnbindFromTree.
  void BindToTree(nsIDocument* aDocument, nsIContent* aParent,
                  nsIContent* aBindingParent, bool aCompileEventHandlers);
  ;

  ;
  ;
  ;

  // The nsContentPolicyType we would use for this ImageLoadType
  ;

private:
  /**
   * Struct used to manage the image observers.
   */
  struct ImageObserver {
    ;
    ;

    nsCOMPtr<imgINotificationObserver> mObserver;
    ImageObserver* mNext;
  };

  /**
   * Struct to report state changes
   */
  struct AutoStateChanger {
    
    

    nsImageLoadingContent* mImageContent;
    bool mNotify;
  };

  bool mCurrentRequestRegistered;
  bool mPendingRequestRegistered;

  // True when FrameCreate has been called but FrameDestroy has not.
  bool mFrameCreateCalled;

  uint32_t mVisibleCount;
};

#endif // nsImageLoadingContent_h__
# 448 "/Users/luser/build/mozilla-central/dom/base/nsImageLoadingContent.h"
# 12 "../../dist/include/mozilla/dom/HTMLImageElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMHTMLImageElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMHTMLImageElement.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMHTMLImageElement.idl
 */

#ifndef __gen_nsIDOMHTMLImageElement_h__
#define __gen_nsIDOMHTMLImageElement_h__


#ifndef __gen_nsIDOMHTMLElement_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMHTMLElement.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMHTMLImageElement.h"
#endif
# 12 "../../dist/include/nsIDOMHTMLImageElement.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMHTMLImageElement.h"

/* starting interface:    nsIDOMHTMLImageElement */
#define NS_IDOMHTMLIMAGEELEMENT_IID_STR "ec18e71c-4f5c-4cc3-aa36-5273168644dc"

#define NS_IDOMHTMLIMAGEELEMENT_IID \
  {0xec18e71c, 0x4f5c, 0x4cc3, \
    { 0xaa, 0x36, 0x52, 0x73, 0x16, 0x86, 0x44, 0xdc }}

class NS_NO_VTABLE nsIDOMHTMLImageElement : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMHTMLIMAGEELEMENT_IID)

  /* attribute DOMString alt; */
  NS_IMETHOD GetAlt(nsAString & aAlt) = 0;
  NS_IMETHOD SetAlt(const nsAString & aAlt) = 0;

  /* attribute DOMString src; */
  NS_IMETHOD GetSrc(nsAString & aSrc) = 0;
  NS_IMETHOD SetSrc(const nsAString & aSrc) = 0;

  /* attribute DOMString srcset; */
  NS_IMETHOD GetSrcset(nsAString & aSrcset) = 0;
  NS_IMETHOD SetSrcset(const nsAString & aSrcset) = 0;

  /* attribute DOMString sizes; */
  NS_IMETHOD GetSizes(nsAString & aSizes) = 0;
  NS_IMETHOD SetSizes(const nsAString & aSizes) = 0;

  /* attribute DOMString useMap; */
  NS_IMETHOD GetUseMap(nsAString & aUseMap) = 0;
  NS_IMETHOD SetUseMap(const nsAString & aUseMap) = 0;

  /* attribute boolean isMap; */
  NS_IMETHOD GetIsMap(bool *aIsMap) = 0;
  NS_IMETHOD SetIsMap(bool aIsMap) = 0;

  /* attribute unsigned long width; */
  NS_IMETHOD GetWidth(uint32_t *aWidth) = 0;
  NS_IMETHOD SetWidth(uint32_t aWidth) = 0;

  /* attribute unsigned long height; */
  NS_IMETHOD GetHeight(uint32_t *aHeight) = 0;
  NS_IMETHOD SetHeight(uint32_t aHeight) = 0;

  /* readonly attribute unsigned long naturalWidth; */
  NS_IMETHOD GetNaturalWidth(uint32_t *aNaturalWidth) = 0;

  /* readonly attribute unsigned long naturalHeight; */
  NS_IMETHOD GetNaturalHeight(uint32_t *aNaturalHeight) = 0;

  /* readonly attribute boolean complete; */
  NS_IMETHOD GetComplete(bool *aComplete) = 0;

  /* attribute DOMString name; */
  NS_IMETHOD GetName(nsAString & aName) = 0;
  NS_IMETHOD SetName(const nsAString & aName) = 0;

  /* attribute DOMString align; */
  NS_IMETHOD GetAlign(nsAString & aAlign) = 0;
  NS_IMETHOD SetAlign(const nsAString & aAlign) = 0;

  /* attribute DOMString border; */
  NS_IMETHOD GetBorder(nsAString & aBorder) = 0;
  NS_IMETHOD SetBorder(const nsAString & aBorder) = 0;

  /* attribute long hspace; */
  NS_IMETHOD GetHspace(int32_t *aHspace) = 0;
  NS_IMETHOD SetHspace(int32_t aHspace) = 0;

  /* attribute DOMString longDesc; */
  NS_IMETHOD GetLongDesc(nsAString & aLongDesc) = 0;
  NS_IMETHOD SetLongDesc(const nsAString & aLongDesc) = 0;

  /* attribute long vspace; */
  NS_IMETHOD GetVspace(int32_t *aVspace) = 0;
  NS_IMETHOD SetVspace(int32_t aVspace) = 0;

  /* attribute DOMString lowsrc; */
  NS_IMETHOD GetLowsrc(nsAString & aLowsrc) = 0;
  NS_IMETHOD SetLowsrc(const nsAString & aLowsrc) = 0;

  /* readonly attribute DOMString currentSrc; */
  NS_IMETHOD GetCurrentSrc(nsAString & aCurrentSrc) = 0;

  /* readonly attribute long x; */
  NS_IMETHOD GetX(int32_t *aX) = 0;

  /* readonly attribute long y; */
  NS_IMETHOD GetY(int32_t *aY) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMHTMLImageElement, NS_IDOMHTMLIMAGEELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMHTMLIMAGEELEMENT \
  NS_IMETHOD GetAlt(nsAString & aAlt) MOZ_OVERRIDE; \
  NS_IMETHOD SetAlt(const nsAString & aAlt) MOZ_OVERRIDE; \
  NS_IMETHOD GetSrc(nsAString & aSrc) MOZ_OVERRIDE; \
  NS_IMETHOD SetSrc(const nsAString & aSrc) MOZ_OVERRIDE; \
  NS_IMETHOD GetSrcset(nsAString & aSrcset) MOZ_OVERRIDE; \
  NS_IMETHOD SetSrcset(const nsAString & aSrcset) MOZ_OVERRIDE; \
  NS_IMETHOD GetSizes(nsAString & aSizes) MOZ_OVERRIDE; \
  NS_IMETHOD SetSizes(const nsAString & aSizes) MOZ_OVERRIDE; \
  NS_IMETHOD GetUseMap(nsAString & aUseMap) MOZ_OVERRIDE; \
  NS_IMETHOD SetUseMap(const nsAString & aUseMap) MOZ_OVERRIDE; \
  NS_IMETHOD SetHspace(int32_t aHspace) MOZ_OVERRIDE; \
  NS_IMETHOD GetLongDesc(nsAString & aLongDesc) MOZ_OVERRIDE; \
  NS_IMETHOD SetLongDesc(const nsAString & aLongDesc) MOZ_OVERRIDE; \
  NS_IMETHOD GetVspace(int32_t *aVspace) MOZ_OVERRIDE; \
  NS_IMETHOD SetVspace(int32_t aVspace) MOZ_OVERRIDE; \
  NS_IMETHOD GetLowsrc(nsAString & aLowsrc) MOZ_OVERRIDE; \
  NS_IMETHOD SetLowsrc(const nsAString & aLowsrc) MOZ_OVERRIDE; \
  NS_IMETHOD GetCurrentSrc(nsAString & aCurrentSrc) MOZ_OVERRIDE; \
  NS_IMETHOD GetX(int32_t *aX) MOZ_OVERRIDE; \
  NS_IMETHOD GetY(int32_t *aY) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMHTMLIMAGEELEMENT(_to) \
  NS_IMETHOD GetAlt(nsAString & aAlt) MOZ_OVERRIDE { return _to GetAlt(aAlt); } \
  NS_IMETHOD SetAlt(const nsAString & aAlt) MOZ_OVERRIDE { return _to SetAlt(aAlt); } \
  NS_IMETHOD GetSrc(nsAString & aSrc) MOZ_OVERRIDE { return _to GetSrc(aSrc); } \
  NS_IMETHOD SetSrc(const nsAString & aSrc) MOZ_OVERRIDE { return _to SetSrc(aSrc); } \
  NS_IMETHOD GetSrcset(nsAString & aSrcset) MOZ_OVERRIDE { return _to GetSrcset(aSrcset); } \
  NS_IMETHOD SetSrcset(const nsAString & aSrcset) MOZ_OVERRIDE { return _to SetSrcset(aSrcset); } \
  NS_IMETHOD GetSizes(nsAString & aSizes) MOZ_OVERRIDE { return _to GetSizes(aSizes); } \
  NS_IMETHOD SetSizes(const nsAString & aSizes) MOZ_OVERRIDE { return _to SetSizes(aSizes); } \
  NS_IMETHOD GetUseMap(nsAString & aUseMap) MOZ_OVERRIDE { return _to GetUseMap(aUseMap); } \
  NS_IMETHOD SetUseMap(const nsAString & aUseMap) MOZ_OVERRIDE { return _to SetUseMap(aUseMap); } \
  NS_IMETHOD GetCurrentSrc(nsAString & aCurrentSrc) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentSrc(aCurrentSrc); } \
  NS_IMETHOD GetX(int32_t *aX) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetX(aX); } \
  NS_IMETHOD GetY(int32_t *aY) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetY(aY); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMHTMLImageElement : public nsIDOMHTMLImageElement

nsDOMHTMLImageElement::nsDOMHTMLImageElement()
{
  /* member initializers and constructor code */
}

}

/* readonly attribute long y; */
NS_IMETHODIMP nsDOMHTMLImageElement::GetY(int32_t *aY)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/HTMLPictureElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMHTMLPictureElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMHTMLPictureElement.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMHTMLPictureElement.idl
 */

#ifndef __gen_nsIDOMHTMLPictureElement_h__
#define __gen_nsIDOMHTMLPictureElement_h__

#define NS_IDOMHTMLPICTUREELEMENT_IID_STR "e0e5ac7f-b969-494c-a61e-9d740e38abba"

#define NS_IDOMHTMLPICTUREELEMENT_IID \
  {0xe0e5ac7f, 0xb969, 0x494c, \
    { 0xa6, 0x1e, 0x9d, 0x74, 0x0e, 0x38, 0xab, 0xba }}

class NS_NO_VTABLE nsIDOMHTMLPictureElement : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMHTMLPICTUREELEMENT_IID)

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMHTMLPictureElement, NS_IDOMHTMLPICTUREELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMHTMLPICTUREELEMENT \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMHTMLPICTUREELEMENT(_to) \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMHTMLPICTUREELEMENT(_to) \
  /* no methods! */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMHTMLPictureElement : public nsIDOMHTMLPictureElement

nsDOMHTMLPictureElement::nsDOMHTMLPictureElement()
{
  /* member initializers and constructor code */
}

nsDOMHTMLPictureElement::~nsDOMHTMLPictureElement()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif
# 80 "../../dist/include/nsIDOMHTMLPictureElement.h"


#endif /* __gen_nsIDOMHTMLPictureElement_h__ */
# 83 "../../dist/include/nsIDOMHTMLPictureElement.h"
# 12 "../../dist/include/mozilla/dom/HTMLPictureElement.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsGenericHTMLElement.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/HTMLPictureElement.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLUnknownElement.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/HTMLUnknownElement.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_HTMLUnknownElement_h
#define mozilla_dom_HTMLUnknownElement_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/HTMLUnknownElement.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsGenericHTMLElement.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/HTMLUnknownElement.h"

namespace mozilla {
namespace dom {

class HTMLUnknownElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
  

  virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;

protected:
  virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
};

} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_HTMLUnknownElement_h */
# 35 "../../dist/include/mozilla/dom/HTMLUnknownElement.h"
# 15 "../../dist/include/mozilla/dom/HTMLPictureElement.h" 2

namespace mozilla {
namespace dom {

class HTMLPictureElement MOZ_FINAL : public nsGenericHTMLElement,
                                    public nsIDOMHTMLPictureElement
{
public:
  ;

  // nsISupports
  NS_DECL_ISUPPORTS_INHERITED

  // nsIDOMHTMLPictureElement
  NS_DECL_NSIDOMHTMLPICTUREELEMENT

  virtual nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE;
  virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) MOZ_OVERRIDE;

  ;

protected:
  ;

  virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_HTMLPictureElement_h
# 46 "../../dist/include/mozilla/dom/HTMLPictureElement.h"
# 19 "../../dist/include/mozilla/dom/HTMLImageElement.h" 2

namespace mozilla {
class EventChainPreVisitor;
namespace dom {

class ResponsiveImageSelector;
class HTMLImageElement MOZ_FINAL : public nsGenericHTMLElement,
                                   public nsImageLoadingContent,
                                   public nsIDOMHTMLImageElement
{
  friend class HTMLSourceElement;
  friend class HTMLPictureElement;
  friend class ImageLoadTask;
public:
  ;
};

} // namespace dom
} // namespace mozilla

#endif /* mozilla_dom_HTMLImageElement_h */
# 344 "../../dist/include/mozilla/dom/HTMLImageElement.h"
# 100 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/HTMLVideoElement.h"
#endif /* expanded by -frewrite-includes */
# 101 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/SVGMatrix.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/SVGMatrix.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * Notes on transforms in Mozilla and the SVG code.
 *
 * It's important to note that the matrix convention used in the SVG standard
 * is the opposite convention to the one used in the Mozilla code or, more
 * specifically, the convention used in Thebes code (code using gfxMatrix).
 * Whereas the SVG standard uses the column vector convention, Thebes code uses
 * the row vector convention. Thus, whereas in the SVG standard you have
 * [M1][M2][M3]|p|, in Thebes you have |p|'[M3]'[M2]'[M1]'. In other words, the
 * following are equivalent:
 * convention, but in that case hopefully the above explanation clears things
 * up.
 */

#ifndef mozilla_dom_SVGMatrix_h
#define mozilla_dom_SVGMatrix_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/SVGTransform.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/SVGTransform.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_SVGTransform_h
#define mozilla_dom_SVGTransform_h

#if 0 /* expanded by -frewrite-includes */
#include "DOMSVGTransformList.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/svg/DOMSVGTransformList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_DOMSVGTRANSFORMLIST_H__
#define MOZILLA_DOMSVGTRANSFORMLIST_H__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/SVGAnimatedTransformList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/SVGAnimatedTransformList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_SVGAnimatedTransformList_h
#define mozilla_dom_SVGAnimatedTransformList_h

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/mozilla/dom/SVGAnimatedTransformList.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/SVGAnimatedTransformList.h"

namespace mozilla {

class DOMSVGTransformList;
class nsSVGAnimatedTransformList;

namespace dom {

/**
 * Class SVGAnimatedTransformList
 *
 * This class is used to create the DOM tearoff objects that wrap internal
 * nsSVGAnimatedTransformList objects.
 *
 * See the architecture comment in DOMSVGAnimatedLengthList.h (that's
 * LENGTH list). The comment for that class largly applies to this one too
 * and will go a long way to helping you understand the architecture here.
 *
 * This class is strongly intertwined with DOMSVGTransformList and
 * DOMSVGTransform.
 * Our DOMSVGTransformList base and anim vals are friends and take care of
 * nulling out our pointers to them when they die (making our pointers to them
 * true weak refs).
 */
class SVGAnimatedTransformList MOZ_FINAL : public nsWrapperCache
{
  friend class mozilla::DOMSVGTransformList;

public:
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGAnimatedTransformList)
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGAnimatedTransformList)

  /**
   * Factory method to create and return a SVGAnimatedTransformList wrapper
   * for a given internal nsSVGAnimatedTransformList object. The factory takes
   * care of caching the object that it returns so that the same object can be
   * returned for the given nsSVGAnimatedTransformList each time it is requested.
   * The cached object is only removed from the cache when it is destroyed due
   * to there being no more references to it or to any of its descendant
   * objects. If that happens, any subsequent call requesting the DOM wrapper
   * for the nsSVGAnimatedTransformList will naturally result in a new
   * SVGAnimatedTransformList being returned.
   *
   * The only time this method could fail is on OOM when trying to increase the
   * length of the DOM list. If that happens then this method simply clears the
   * list and returns. Callers just proceed as normal, and we simply accept
   * that the DOM list will be empty (until successfully set to a new value).
   */
  ;
  ;

  /**
   * Returns true if our attribute is animating (in which case our animVal is
   * not simply a mirror of our baseVal).
   */
  bool IsAnimating() const;

  // WebIDL
  
  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
  // These aren't weak refs because mBaseVal and mAnimVal are weak
  ;
  ;

private:

  /**
   * Only our static GetDOMWrapper() factory method may create objects of our
   * type.
   */
  

  ~SVGAnimatedTransformList();

  /// Get a reference to this DOM wrapper object's internal counterpart.
  ;
  ;

  // Weak refs to our DOMSVGTransformList baseVal/animVal objects. These objects
  // are friends and take care of clearing these pointers when they die, making
  // these true weak references.
  DOMSVGTransformList *mBaseVal;
  DOMSVGTransformList *mAnimVal;

  // Strong ref to our element to keep it alive. We hold this not only for
  // ourself, but also for our base/animVal and all of their items.
  nsRefPtr<nsSVGElement> mElement;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_SVGAnimatedTransformList_h
# 132 "../../dist/include/mozilla/dom/SVGAnimatedTransformList.h"
# 11 "/Users/luser/build/mozilla-central/dom/svg/DOMSVGTransformList.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/svg/DOMSVGTransformList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/svg/DOMSVGTransformList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/svg/DOMSVGTransformList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/svg/DOMSVGTransformList.h"
#if 0 /* expanded by -frewrite-includes */
#include "SVGTransformList.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/svg/SVGTransformList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_SVGTRANSFORMLIST_H__
#define MOZILLA_SVGTRANSFORMLIST_H__

#if 0 /* expanded by -frewrite-includes */
#include "gfxMatrix.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/svg/SVGTransformList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/svg/SVGTransformList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/svg/SVGTransformList.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGTransform.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/svg/nsSVGTransform.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_SVGTRANSFORM_H__
#define MOZILLA_SVGTRANSFORM_H__

#if 0 /* expanded by -frewrite-includes */
#include "gfxMatrix.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/svg/nsSVGTransform.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDebug.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/svg/nsSVGTransform.h"

namespace mozilla {

// Transform Types
static const unsigned short SVG_TRANSFORM_UNKNOWN = 0;
static const unsigned short SVG_TRANSFORM_MATRIX = 1;
static const unsigned short SVG_TRANSFORM_TRANSLATE = 2;
static const unsigned short SVG_TRANSFORM_SCALE = 3;
static const unsigned short SVG_TRANSFORM_ROTATE = 4;
static const unsigned short SVG_TRANSFORM_SKEWX = 5;
static const unsigned short SVG_TRANSFORM_SKEWY = 6;

/*
 * The DOM wrapper class for this class is DOMSVGTransformMatrix.
 */
class nsSVGTransform
{
public:
  // Default ctor initialises to matrix type with identity matrix
  

  

  

  ;

  
  
  

  const gfxMatrix& GetMatrix() const { return mMatrix; }
  ;
  ;
  ;
  ;
  ;
  ;

  static bool MatricesEqual(const gfxMatrix& a, const gfxMatrix& b)
  {
    return a._11 == b._11 &&
           a._12 == b._12 &&
           a._21 == b._21 &&
           a._22 == b._22 &&
           a._31 == b._31 &&
           a._32 == b._32;
  }

protected:
  gfxMatrix mMatrix;
  float mAngle, mOriginX, mOriginY;
  uint16_t mType;
};

/*
 * A slightly more light-weight version of nsSVGTransform for SMIL animation.
 *
 * Storing the parameters in an array (rather than a matrix) also allows simpler
 * (transform type-agnostic) interpolation and addition.
 *
 */
class SVGTransformSMILData
{
public:
  // Number of float-params required in constructor, if constructing one of the
  // 'simple' transform types (all but matrix type)
  static const uint32_t NUM_SIMPLE_PARAMS = 3;

  // Number of float-params required in constructor for matrix type.
  // This is also the number of params we actually store, regardless of type.
  static const uint32_t NUM_STORED_PARAMS = 6;

  

  

  // Conversion to/from a fully-fledged nsSVGTransform
  ;
  ;

  

  

  uint16_t mTransformType;
  float    mParams[NUM_STORED_PARAMS];
};

} // namespace mozilla

#endif // MOZILLA_SVGTRANSFORM_H__
# 179 "/Users/luser/build/mozilla-central/dom/svg/nsSVGTransform.h"
# 14 "/Users/luser/build/mozilla-central/dom/svg/SVGTransformList.h" 2

namespace mozilla {

namespace dom {
class SVGTransform;
}

/**
 * ATTENTION! WARNING! WATCH OUT!!
 *
 * Consumers that modify objects of this type absolutely MUST keep the DOM
 * wrappers for those lists (if any) in sync!! That's why this class is so
 * locked down.
 *
 * The DOM wrapper class for this class is DOMSVGTransformList.
 */
class SVGTransformList
{
  friend class nsSVGAnimatedTransformList;
  friend class DOMSVGTransformList;
  friend class dom::SVGTransform;

public:
  
  

  // Only methods that don't make/permit modification to this list are public.
  // Only our friend classes can access methods that may change us.

  /// This may return an incomplete string on OOM, but that's acceptable.
  ;

  

  uint32_t Length() const {
    return mItems.Length();
  }

  

  

  

  



protected:
  /*
   * See SVGLengthList for the rationale for using FallibleTArray<nsSVGTransform>
   * instead of FallibleTArray<nsSVGTransform, 1>.
   */
  FallibleTArray<nsSVGTransform> mItems;
};

} // namespace mozilla

#endif // MOZILLA_SVGTRANSFORMLIST_H__
# 146 "/Users/luser/build/mozilla-central/dom/svg/SVGTransformList.h"
# 16 "/Users/luser/build/mozilla-central/dom/svg/DOMSVGTransformList.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/svg/DOMSVGTransformList.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/dom/svg/DOMSVGTransformList.h"

class nsSVGElement;

namespace mozilla {

namespace dom {
class SVGMatrix;
class SVGTransform;
}

/**
 * Class DOMSVGTransformList
 *
 * This class is used to create the DOM tearoff objects that wrap internal
 * SVGTransformList objects.
 *
 * See the architecture comment in SVGAnimatedTransformList.h.
 */
class DOMSVGTransformList MOZ_FINAL : public nsISupports,
                                      public nsWrapperCache
{
  friend class AutoChangeTransformListNotifier;
  friend class dom::SVGTransform;

  

public:
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMSVGTransformList)

  

  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;

  

  /**
   * This will normally be the same as InternalList().Length(), except if we've
   * hit OOM in which case our length will be zero.
   */
  uint32_t LengthNoFlush() const {
    MOZ_ASSERT(mItems.IsEmpty() || mItems.Length() == InternalList().Length(),
               "DOM wrapper's list length is out of sync");
    return mItems.Length();
  }

  /// Called to notify us to synchronize our length and detach excess items.
  ;

  /**
   * Returns true if our attribute is animating (in which case our animVal is
   * not simply a mirror of our baseVal).
   */
  
  /// Used to determine if this list is the baseVal or animVal list.
  bool IsAnimValList() const {
    MOZ_ASSERT(this == mAList->mBaseVal || this == mAList->mAnimVal,
               "Calling IsAnimValList() too early?!");
    return this == mAList->mAnimVal;
  }

  /**
   * Get a reference to this object's corresponding internal SVGTransformList.
   *
   * To simplify the code we just have this one method for obtaining both
   * baseVal and animVal internal lists. This means that animVal lists don't
   * get const protection, but our setter methods guard against changing
   * animVal lists.
   */
  SVGTransformList& InternalList() const;

  /// Returns the SVGTransform at aIndex, creating it if necessary.
  already_AddRefed<dom::SVGTransform> GetItemAt(uint32_t aIndex);

  void MaybeInsertNullInAnimValListAt(uint32_t aIndex);
  void MaybeRemoveItemFromAnimValListAt(uint32_t aIndex);

  // Weak refs to our SVGTransform items. The items are friends and take care
  // of clearing our pointer to them when they die.
  FallibleTArray<dom::SVGTransform*> mItems;

  nsRefPtr<dom::SVGAnimatedTransformList> mAList;
};

} // namespace mozilla

#endif // MOZILLA_DOMSVGTRANSFORMLIST_H__
# 168 "/Users/luser/build/mozilla-central/dom/svg/DOMSVGTransformList.h"
# 11 "../../dist/include/mozilla/dom/SVGTransform.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGTransform.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/mozilla/dom/SVGTransform.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/mozilla/dom/SVGTransform.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/dom/SVGTransform.h"

class nsSVGElement;

class gfxMatrix;

#define MOZ_SVG_LIST_INDEX_BIT_COUNT 31 // supports > 2 billion list items

namespace mozilla {
namespace dom {

class SVGMatrix;

/**
 * DOM wrapper for an SVG transform. See DOMSVGLength.h.
 */
class SVGTransform MOZ_FINAL : public nsWrapperCache
{
  friend class AutoChangeTransformNotifier;

public:
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(SVGTransform)
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(SVGTransform)

  /**
   * Generic ctor for SVGTransform objects that are created for an attribute.
   */
  ;

  /**
   * Ctors for creating the objects returned by:
   *   SVGSVGElement.createSVGTransform(),
   *   SVGSVGElement.createSVGTransformFromMatrix(in SVGMatrix matrix),
   *   SVGTransformList.createSVGTransformFromMatrix(in SVGMatrix matrix)
   * which do not initially belong to an attribute.
   */
  ;
  ;

  /**
   * Ctor for creating an unowned copy. Used with Clone().
   */
  ;

  /**
   * Create an unowned copy of an owned transform. The caller is responsible for
   * the first AddRef().
   */
  

  

  /**
   * In future, if this class is used for non-list transforms, this will be
   * different to IsInList().
   */
  bool HasOwner() const {
    return !!mList;
  }

  /**
   * This method is called to notify this DOM object that it is being inserted
   * into a list, and give it the information it needs as a result.
   *
   * This object MUST NOT already belong to a list when this method is called.
   * That's not to say that script can't move these DOM objects between
   * lists - it can - it's just that the logic to handle that (and send out
   * the necessary notifications) is located elsewhere (in
   * DOMSVGTransformList).)
   */

  // WebIDL
  
  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;

protected:
  ~SVGTransform();
  ;
  const nsSVGTransform& InternalItem() const;

#ifdef DEBUG
  bool IndexIsValid();
#endif
# 160 "../../dist/include/mozilla/dom/SVGTransform.h"

  const nsSVGTransform& Transform() const {
    return HasOwner() ? InternalItem() : *mTransform;
  }
  

  nsRefPtr<DOMSVGTransformList> mList;

  // Bounds for the following are checked in the ctor, so be sure to update
  // that if you change the capacity of any of the following.

  uint32_t mListIndex:MOZ_SVG_LIST_INDEX_BIT_COUNT;
  uint32_t mIsAnimValItem:1;

  // Usually this class acts as a wrapper for an nsSVGTransform object which is
  // part of a list and is accessed by going via the owning Element.
  //
  // However, in some circumstances, objects of this class may not be associated
  // with any particular list and thus, no internal nsSVGTransform object. In
  // that case we allocate an nsSVGTransform object on the heap to store the data.
  nsAutoPtr<nsSVGTransform> mTransform;
};

} // namespace dom
} // namespace mozilla
#endif /* expanded by -frewrite-includes */
# 44 "../../dist/include/mozilla/dom/SVGMatrix.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 45 "../../dist/include/mozilla/dom/SVGMatrix.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 46 "../../dist/include/mozilla/dom/SVGMatrix.h"

namespace mozilla {
namespace dom {

/**
 * DOM wrapper for an SVG matrix.
 */
class SVGMatrix MOZ_FINAL : public nsWrapperCache
{
public:
  ;
  
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;

private:
  ~SVGMatrix() {}

  

  

  nsRefPtr<SVGTransform> mTransform;

  // Typically we operate on the matrix data accessed via mTransform but for
  // matrices that exist independently of an SVGTransform we use mMatrix below.
  gfxMatrix mMatrix;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_SVGMatrix_h
# 133 "../../dist/include/mozilla/dom/SVGMatrix.h"
# 102 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/TextMetrics.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/TextMetrics.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_TextMetrics_h
#define mozilla_dom_TextMetrics_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/CanvasRenderingContext2DBinding.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/TextMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/NonRefcountedDOMObject.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/TextMetrics.h"

namespace mozilla {
namespace dom {

class TextMetrics MOZ_FINAL : public NonRefcountedDOMObject
{
public:
  explicit TextMetrics(float aValue) : width(aValue)
  {
    MOZ_COUNT_CTOR(TextMetrics);
  }

  

  

  bool WrapObject(JSContext* aCx, JS::MutableHandle<JSObject*> aReflector)
  {
    return TextMetricsBinding::Wrap(aCx, this, aReflector);
  }

private:
  float width;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_TextMetrics_h
# 46 "../../dist/include/mozilla/dom/TextMetrics.h"
# 103 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/SVGMatrix.h"
#endif /* expanded by -frewrite-includes */
# 104 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/FloatingPoint.h"
#endif /* expanded by -frewrite-includes */
# 105 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "nsGlobalWindow.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 sw=2 et tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsGlobalWindow_h___
#define nsGlobalWindow_h___

#if 0 /* expanded by -frewrite-includes */
#include "nsPIDOMWindow.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsTHashtable.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRefPtrHashtable.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsInterfaceHashtable.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"

// Local Includes
// Helper Classes
#if 0 /* expanded by -frewrite-includes */
#include "nsCOMPtr.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWeakReference.h"
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsDataHashtable.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsJSThingHashtable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsJSThingHashtable.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsJSThingHashtable_h__
#define nsJSThingHashtable_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsHashKeys.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsJSThingHashtable.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsBaseHashtable.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/nsJSThingHashtable.h"

namespace JS {
template<class T>
class Heap;
} /* namespace JS */

/**
 * A wrapper for hash keys that sets ALLOW_MEMMOVE to false.
 *
 * This is used in the implementation of nsJSThingHashtable and is not intended
 * to be used directly.
 *
 * It is necessary for hash tables containing JS::Heap<T> values as these must
 * be copied rather than memmoved.
 */
template<class T>
class nsHashKeyDisallowMemmove : public T
{
public:
  explicit nsHashKeyDisallowMemmove(const typename T::KeyTypePointer aKey) : T(aKey) {}
  enum { ALLOW_MEMMOVE = false };
};


/**
 * Templated hashtable class for use on the heap where the values are JS GC things.
 *
 * Storing JS GC thing pointers on the heap requires wrapping them in a
 * JS::Heap<T>, and this class takes care of that while presenting an interface
 * in terms of the wrapped type T.
 *
 * For example, to store a hashtable mapping strings to JSObject pointers, you
 * can declare a data member like this:
 *
 *   nsJSThingHashtable<nsStringHashKey, JSObject*> mStringToObjectMap;
 *
 * See nsBaseHashtable for complete declaration
 * @param KeyClass a wrapper-class for the hashtable key, see nsHashKeys.h
 *   for a complete specification.
 * @param DataType the datatype being wrapped, must be a JS GC thing.
 * @see nsInterfaceHashtable, nsClassHashtable
 */
template<class KeyClass, class DataType>
class nsJSThingHashtable
  : public nsBaseHashtable<nsHashKeyDisallowMemmove<KeyClass>,
                           JS::Heap<DataType>, DataType>
{
};

#endif // nsJSThingHashtable_h__
# 62 "../../dist/include/nsJSThingHashtable.h"
# 24 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */
# 25 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"

// Interfaces Needed
#if 0 /* expanded by -frewrite-includes */
#include "nsIBrowserDOMWindow.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIBrowserDOMWindow.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIBrowserDOMWindow.idl
 */

#ifndef __gen_nsIBrowserDOMWindow_h__
#define __gen_nsIBrowserDOMWindow_h__

class nsIURI; /* forward declaration */

class nsIFrameLoaderOwner; /* forward declaration */


/* starting interface:    nsIOpenURIInFrameParams */
#define NS_IOPENURIINFRAMEPARAMS_IID_STR "e774db14-79ac-4156-a7a3-aa3fd0a22c10"

#define NS_IOPENURIINFRAMEPARAMS_IID \
  {0xe774db14, 0x79ac, 0x4156, \
    { 0xa7, 0xa3, 0xaa, 0x3f, 0xd0, 0xa2, 0x2c, 0x10 }}

class NS_NO_VTABLE nsIOpenURIInFrameParams : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IOPENURIINFRAMEPARAMS_IID)

  /* attribute DOMString referrer; */
  NS_IMETHOD GetReferrer(nsAString & aReferrer) = 0;
  NS_IMETHOD SetReferrer(const nsAString & aReferrer) = 0;

  /* attribute boolean isPrivate; */
  NS_IMETHOD GetIsPrivate(bool *aIsPrivate) = 0;
  NS_IMETHOD SetIsPrivate(bool aIsPrivate) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIOpenURIInFrameParams, NS_IOPENURIINFRAMEPARAMS_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIOPENURIINFRAMEPARAMS \
  NS_IMETHOD GetIsPrivate(bool *aIsPrivate) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsPrivate(aIsPrivate); } \
  NS_IMETHOD SetIsPrivate(bool aIsPrivate) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetIsPrivate(aIsPrivate); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsOpenURIInFrameParams : public nsIOpenURIInFrameParams
{
public:
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* attribute boolean isPrivate; */
NS_IMETHODIMP nsOpenURIInFrameParams::GetIsPrivate(bool *aIsPrivate)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsOpenURIInFrameParams::SetIsPrivate(bool aIsPrivate)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 123 "../../dist/include/nsIBrowserDOMWindow.h"


/* starting interface:    nsIBrowserDOMWindow */
#define NS_IBROWSERDOMWINDOW_IID_STR "99f5a347-722c-4337-bd38-f14ec94801b3"

#define NS_IBROWSERDOMWINDOW_IID \
  {0x99f5a347, 0x722c, 0x4337, \
    { 0xbd, 0x38, 0xf1, 0x4e, 0xc9, 0x48, 0x01, 0xb3 }}

class NS_NO_VTABLE nsIBrowserDOMWindow : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBROWSERDOMWINDOW_IID)

  enum {
    OPEN_DEFAULTWINDOW = 0,
    OPEN_CURRENTWINDOW = 1,
    OPEN_NEWWINDOW = 2,
    OPEN_NEWTAB = 3,
    OPEN_SWITCHTAB = 4,
    OPEN_EXTERNAL = 1,
    OPEN_NEW = 2
  };

  /* nsIDOMWindow openURI (in nsIURI aURI, in nsIDOMWindow aOpener, in short aWhere, in short aContext); */
  NS_IMETHOD OpenURI(nsIURI *aURI, nsIDOMWindow *aOpener, int16_t aWhere, int16_t aContext, nsIDOMWindow * *_retval) = 0;

  /* nsIFrameLoaderOwner openURIInFrame (in nsIURI aURI, in nsIOpenURIInFrameParams params, in short aWhere, in short aContext); */
  NS_IMETHOD OpenURIInFrame(nsIURI *aURI, nsIOpenURIInFrameParams *params, int16_t aWhere, int16_t aContext, nsIFrameLoaderOwner * *_retval) = 0;

  /* boolean isTabContentWindow (in nsIDOMWindow aWindow); */
  NS_IMETHOD IsTabContentWindow(nsIDOMWindow *aWindow, bool *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIBrowserDOMWindow, NS_IBROWSERDOMWINDOW_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIBROWSERDOMWINDOW \
  NS_IMETHOD OpenURI(nsIURI *aURI, nsIDOMWindow *aOpener, int16_t aWhere, int16_t aContext, nsIDOMWindow * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD OpenURIInFrame(nsIURI *aURI, nsIOpenURIInFrameParams *params, int16_t aWhere, int16_t aContext, nsIFrameLoaderOwner * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD IsTabContentWindow(nsIDOMWindow *aWindow, bool *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIBROWSERDOMWINDOW(_to) \
  NS_IMETHOD OpenURI(nsIURI *aURI, nsIDOMWindow *aOpener, int16_t aWhere, int16_t aContext, nsIDOMWindow * *_retval) MOZ_OVERRIDE { return _to OpenURI(aURI, aOpener, aWhere, aContext, _retval); } \
  NS_IMETHOD OpenURIInFrame(nsIURI *aURI, nsIOpenURIInFrameParams *params, int16_t aWhere, int16_t aContext, nsIFrameLoaderOwner * *_retval) MOZ_OVERRIDE { return _to OpenURIInFrame(aURI, params, aWhere, aContext, _retval); } \
  NS_IMETHOD IsTabContentWindow(nsIDOMWindow *aWindow, bool *_retval) MOZ_OVERRIDE { return _to IsTabContentWindow(aWindow, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIBROWSERDOMWINDOW(_to) \
  NS_IMETHOD OpenURI(nsIURI *aURI, nsIDOMWindow *aOpener, int16_t aWhere, int16_t aContext, nsIDOMWindow * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenURI(aURI, aOpener, aWhere, aContext, _retval); } \
  NS_IMETHOD OpenURIInFrame(nsIURI *aURI, nsIOpenURIInFrameParams *params, int16_t aWhere, int16_t aContext, nsIFrameLoaderOwner * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenURIInFrame(aURI, params, aWhere, aContext, _retval); } \
  NS_IMETHOD IsTabContentWindow(nsIDOMWindow *aWindow, bool *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->IsTabContentWindow(aWindow, _retval); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsBrowserDOMWindow : public nsIBrowserDOMWindow
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIBROWSERDOMWINDOW

  nsBrowserDOMWindow();

private:
  ~nsBrowserDOMWindow();
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 230 "../../dist/include/nsIBrowserDOMWindow.h"


#endif /* __gen_nsIBrowserDOMWindow_h__ */
# 233 "../../dist/include/nsIBrowserDOMWindow.h"
# 28 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMEventTarget.h"
#endif /* expanded by -frewrite-includes */
# 29 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIInterfaceRequestor.h"
#endif /* expanded by -frewrite-includes */
# 30 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMJSWindow.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMJSWindow.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMJSWindow.idl
 */

#ifndef __gen_nsIDOMJSWindow_h__
#define __gen_nsIDOMJSWindow_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMJSWindow.h"
#endif
# 12 "../../dist/include/nsIDOMJSWindow.h"

#if 0 /* expanded by -frewrite-includes */
#include "js/Value.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/nsIDOMJSWindow.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 19 "../../dist/include/nsIDOMJSWindow.h"

/* starting interface:    nsIDOMJSWindow */
#define NS_IDOMJSWINDOW_IID_STR "4237c376-d637-4b6e-9f8a-1da57e867834"

#define NS_IDOMJSWINDOW_IID \
  {0x4237c376, 0xd637, 0x4b6e, \
    { 0x9f, 0x8a, 0x1d, 0xa5, 0x7e, 0x86, 0x78, 0x34 }}

class NS_NO_VTABLE nsIDOMJSWindow : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMJSWINDOW_IID)

  /* void dump (in DOMString str); */
  NS_IMETHOD Dump(const nsAString & str) = 0;

  /* long setTimeout (); */
  NS_IMETHOD SetTimeout(int32_t *_retval) = 0;
};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMJSWindow, NS_IDOMJSWINDOW_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMJSWINDOW \
  NS_IMETHOD Dump(const nsAString & str) MOZ_OVERRIDE; \
  NS_IMETHOD SetTimeout(int32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD SetInterval(int32_t *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD ClearTimeout(int32_t handle) MOZ_OVERRIDE; \
  NS_IMETHOD ClearInterval(int32_t handle) MOZ_OVERRIDE; \
  NS_IMETHOD SetResizable(bool resizable) MOZ_OVERRIDE; \
  NS_IMETHOD OpenJS(const nsAString & url, const nsAString & name, const nsAString & options, nsIDOMWindow * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenJS(url, name, options, _retval); } \
  NS_IMETHOD OpenDialog(const nsAString & url, const nsAString & name, const nsAString & options, nsIDOMWindow * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenDialog(url, name, options, _retval); } \
  NS_IMETHOD GetFrames(nsIDOMWindow * *aFrames) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFrames(aFrames); } \
  NS_IMETHOD GetScriptableContent(JSContext* cx, JS::MutableHandleValue aContent) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetScriptableContent(cx, aContent); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMJSWindow : public nsIDOMJSWindow
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMJSWINDOW

  nsDOMJSWindow();

private:
#endif
# 223 "../../dist/include/nsIDOMJSWindow.h"


#endif /* __gen_nsIDOMJSWindow_h__ */
# 226 "../../dist/include/nsIDOMJSWindow.h"
# 31 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMChromeWindow.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMChromeWindow.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMChromeWindow.idl
 */

#ifndef __gen_nsIDOMChromeWindow_h__
#define __gen_nsIDOMChromeWindow_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMChromeWindow.h"
#endif
# 12 "../../dist/include/nsIDOMChromeWindow.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMChromeWindow.h"
class nsIBrowserDOMWindow; /* forward declaration */

class nsIDOMElement; /* forward declaration */

class nsIDOMEvent; /* forward declaration */

class nsIMessageBroadcaster; /* forward declaration */


/* starting interface:    nsIDOMChromeWindow */
#define NS_IDOMCHROMEWINDOW_IID_STR "78bdcb41-1efa-409f-aaba-70842213f80f"

#define NS_IDOMCHROMEWINDOW_IID \
  {0x78bdcb41, 0x1efa, 0x409f, \
    { 0xaa, 0xba, 0x70, 0x84, 0x22, 0x13, 0xf8, 0x0f }}

class NS_NO_VTABLE nsIDOMChromeWindow : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMCHROMEWINDOW_IID)

  enum {
    STATE_MAXIMIZED = 1U,
    STATE_MINIMIZED = 2U,
    STATE_NORMAL = 3U,
    STATE_FULLSCREEN = 4U
  };

  /* readonly attribute unsigned short windowState; */
  NS_IMETHOD GetWindowState(uint16_t *aWindowState) = 0;
  /* void beginWindowMove (in nsIDOMEvent mouseDownEvent, [optional] in nsIDOMElement panel); */
  NS_IMETHOD BeginWindowMove(nsIDOMEvent *mouseDownEvent, nsIDOMElement *panel) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMChromeWindow, NS_IDOMCHROMEWINDOW_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMCHROMEWINDOW \
  NS_IMETHOD GetWindowState(uint16_t *aWindowState) MOZ_OVERRIDE; \
  NS_IMETHOD GetBrowserDOMWindow(nsIBrowserDOMWindow * *aBrowserDOMWindow) MOZ_OVERRIDE; \
  NS_IMETHOD SetBrowserDOMWindow(nsIBrowserDOMWindow *aBrowserDOMWindow) MOZ_OVERRIDE; \
  NS_IMETHOD GetAttention(void) MOZ_OVERRIDE; \
  NS_IMETHOD GetAttentionWithCycleCount(int32_t aCycleCount) MOZ_OVERRIDE; \
  NS_IMETHOD SetCursor(const nsAString & cursor) MOZ_OVERRIDE; \
  NS_IMETHOD Maximize(void) MOZ_OVERRIDE; \
  NS_IMETHOD Minimize(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Minimize(); } \
  NS_IMETHOD Restore(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Restore(); } \
  NS_IMETHOD NotifyDefaultButtonLoaded(nsIDOMElement *defaultButton) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyDefaultButtonLoaded(defaultButton); } \
  NS_IMETHOD GetMessageManager(nsIMessageBroadcaster * *aMessageManager) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMessageManager(aMessageManager); } \
  NS_IMETHOD GetGroupMessageManager(const nsAString & group, nsIMessageBroadcaster * *_retval) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetGroupMessageManager(group, _retval); } \
  NS_IMETHOD BeginWindowMove(nsIDOMEvent *mouseDownEvent, nsIDOMElement *panel) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->BeginWindowMove(mouseDownEvent, panel); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMChromeWindow : public nsIDOMChromeWindow
{
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void beginWindowMove (in nsIDOMEvent mouseDownEvent, [optional] in nsIDOMElement panel); */
NS_IMETHODIMP nsDOMChromeWindow::BeginWindowMove(nsIDOMEvent *mouseDownEvent, nsIDOMElement *panel)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 244 "../../dist/include/nsIDOMChromeWindow.h"


#endif /* __gen_nsIDOMChromeWindow_h__ */
# 247 "../../dist/include/nsIDOMChromeWindow.h"
# 32 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIScriptGlobalObject.h"
#endif /* expanded by -frewrite-includes */
# 33 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIScriptObjectPrincipal.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/base/nsIScriptObjectPrincipal.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsIScriptObjectPrincipal_h__
#define nsIScriptObjectPrincipal_h__

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/base/nsIScriptObjectPrincipal.h"

class nsIPrincipal;


#define NS_ISCRIPTOBJECTPRINCIPAL_IID \
{ 0x3eedba38, 0x8d22, 0x41e1,  \
{ 0x81, 0x7a, 0x0e, 0x43, 0xe1, 0x65, 0xb6, 0x64} }

/**
 * JS Object Principal information.
 */
class nsIScriptObjectPrincipal : public nsISupports
{
public:
  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTOBJECTPRINCIPAL_IID)

  virtual nsIPrincipal* GetPrincipal() = 0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptObjectPrincipal,
                              NS_ISCRIPTOBJECTPRINCIPAL_IID)

#endif // nsIScriptObjectPrincipal_h__
# 33 "/Users/luser/build/mozilla-central/dom/base/nsIScriptObjectPrincipal.h"
# 34 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsITimer.h"
#endif /* expanded by -frewrite-includes */
# 35 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMModalContentWindow.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMModalContentWindow.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMModalContentWindow.idl
 */

#ifndef __gen_nsIDOMModalContentWindow_h__
#define __gen_nsIDOMModalContentWindow_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMModalContentWindow.h"
#endif
# 12 "../../dist/include/nsIDOMModalContentWindow.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMModalContentWindow.h"
class nsIVariant; /* forward declaration */

class nsIArray; /* forward declaration */


/* starting interface:    nsIDOMModalContentWindow */
#define NS_IDOMMODALCONTENTWINDOW_IID_STR "3f4cb2d0-5f7e-44a9-9f4f-370945f8db08"

#define NS_IDOMMODALCONTENTWINDOW_IID \
  {0x3f4cb2d0, 0x5f7e, 0x44a9, \
    { 0x9f, 0x4f, 0x37, 0x09, 0x45, 0xf8, 0xdb, 0x08 }}

class NS_NO_VTABLE nsIDOMModalContentWindow : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMMODALCONTENTWINDOW_IID)

  /* readonly attribute nsIVariant dialogArguments; */
  NS_IMETHOD GetDialogArguments(nsIVariant * *aDialogArguments) = 0;

  /* attribute nsIVariant returnValue; */
  NS_IMETHOD GetReturnValue(nsIVariant * *aReturnValue) = 0;
  NS_IMETHOD SetReturnValue(nsIVariant *aReturnValue) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMModalContentWindow, NS_IDOMMODALCONTENTWINDOW_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMMODALCONTENTWINDOW \
  NS_IMETHOD GetDialogArguments(nsIVariant * *aDialogArguments) MOZ_OVERRIDE; \
  NS_IMETHOD GetReturnValue(nsIVariant * *aReturnValue) MOZ_OVERRIDE; \
  NS_IMETHOD SetReturnValue(nsIVariant *aReturnValue) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMMODALCONTENTWINDOW(_to) \
  NS_IMETHOD GetDialogArguments(nsIVariant * *aDialogArguments) MOZ_OVERRIDE { return _to GetDialogArguments(aDialogArguments); } \
  NS_IMETHOD GetReturnValue(nsIVariant * *aReturnValue) MOZ_OVERRIDE { return _to GetReturnValue(aReturnValue); } \
  NS_IMETHOD SetReturnValue(nsIVariant *aReturnValue) MOZ_OVERRIDE { return _to SetReturnValue(aReturnValue); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMMODALCONTENTWINDOW(_to) \
  NS_IMETHOD GetDialogArguments(nsIVariant * *aDialogArguments) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDialogArguments(aDialogArguments); } \
  NS_IMETHOD GetReturnValue(nsIVariant * *aReturnValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetReturnValue(aReturnValue); } \
  NS_IMETHOD SetReturnValue(nsIVariant *aReturnValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetReturnValue(aReturnValue); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMModalContentWindow : public nsIDOMModalContentWindow
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMMODALCONTENTWINDOW

  nsDOMModalContentWindow();

private:
  ~nsDOMModalContentWindow();

protected:
  /* additional members */
/* End of implementation class template. */
#endif
# 113 "../../dist/include/nsIDOMModalContentWindow.h"


#endif /* __gen_nsIDOMModalContentWindow_h__ */
# 116 "../../dist/include/nsIDOMModalContentWindow.h"
# 36 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "prclist.h"
#endif /* expanded by -frewrite-includes */
# 41 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/StorageEvent.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/StorageEvent.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_StorageEvent_h
#define mozilla_dom_StorageEvent_h
# 1 "../../dist/include/mozilla/dom/Event.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_Event_h_
#define mozilla_dom_Event_h_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/Event.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/BasicEvents.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/EventBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_EventBinding_h
#define mozilla_dom_EventBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/EventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/EventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/EventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/EventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/EventBinding.h"

namespace mozilla {
namespace dom {

class Event;
struct EventAtoms;
struct EventInitAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

struct EventInit : public DictionaryBase
{
  bool mBubbles;
  bool mCancelable;

  EventInit();

  explicit inline EventInit(const FastDictionaryInitializer& )
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

  explicit inline EventInit(const EventInit& aOther)
  {
    *this = aOther;
  }

  ;

  ;

  ;

  ;

  ;

  void
  operator=(const EventInit& aOther);

private:
  ;
};

namespace binding_detail {
struct FastEventInit : public EventInit
{
  inline FastEventInit()
    : EventInit(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


namespace EventBinding {

  typedef mozilla::dom::Event NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  // address arithmetic.  Declaring it as a pointer instead would require
  // doing a run-time load to fetch a pointer to this binding's property
  ;

  ;

  ;

  ;

} // namespace EventBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_EventBinding_h
# 131 "../../dist/include/mozilla/dom/EventBinding.h"
# 19 "../../dist/include/mozilla/dom/Event.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIScriptGlobalObject.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/mozilla/dom/Event.h"
#if 0 /* expanded by -frewrite-includes */
#include "Units.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/dom/Event.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/TypeDecls.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/mozilla/dom/Event.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIGlobalObject.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/mozilla/dom/Event.h"

class nsIContent;
class nsIDOMEventTarget;
class nsPresContext;

namespace mozilla {
namespace dom {

class EventTarget;
class WantsPopupControlCheck;
#define GENERATED_EVENT(EventClass_) class EventClass_;
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/GeneratedEventList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/GeneratedEventList.h" 1
GENERATED_EVENT(AutocompleteErrorEvent)
GENERATED_EVENT(BlobEvent)
GENERATED_EVENT(CFStateChangeEvent)
GENERATED_EVENT(CSSFontFaceLoadEvent)
GENERATED_EVENT(CallEvent)
GENERATED_EVENT(CallGroupErrorEvent)
GENERATED_EVENT(CameraClosedEvent)
GENERATED_EVENT(CameraConfigurationEvent)
GENERATED_EVENT(CameraFacesDetectedEvent)
GENERATED_EVENT(CameraStateChangeEvent)
GENERATED_EVENT(CloseEvent)
GENERATED_EVENT(DOMTransactionEvent)
GENERATED_EVENT(DataErrorEvent)
GENERATED_EVENT(DataStoreChangeEvent)
GENERATED_EVENT(RTCPeerConnectionIceEvent)
# 35 "../../dist/include/mozilla/dom/Event.h" 2
#undef GENERATED_EVENT
// ExtendableEvent and InstallEvent are ServiceWorker events that are not
// autogenerated since they have some extra methods.
namespace workers {
class ExtendableEvent;
class InstallEvent;
} // namespace workers

// Dummy class so we can cast through it to get from nsISupports to
// Event subclasses with only two non-ambiguous static casts.
class EventBase : public nsIDOMEvent
{
};

class Event : public EventBase,
              public nsWrapperCache
{
public:
  Event(EventTarget* aOwner,
        nsPresContext* aPresContext,
        WidgetEvent* aEvent);
  explicit Event(nsPIDOMWindow* aWindow);

protected:
  virtual ~Event();

private:
  void ConstructorInit(EventTarget* aOwner,
                       nsPresContext* aPresContext,
                       WidgetEvent* aEvent);

public:
  static Event* FromSupports(nsISupports* aSupports)
  {
    nsIDOMEvent* event =
      static_cast<nsIDOMEvent*>(aSupports);
#ifdef DEBUG
    {
      nsCOMPtr<nsIDOMEvent> target_qi =
        do_QueryInterface(aSupports);

      // If this assertion fires the QI implementation for the object in
      // question doesn't use the nsIDOMEvent pointer as the
      // nsISupports pointer. That must be fixed, or we'll crash...
      MOZ_ASSERT(target_qi == event, "Uh, fix QI!");
    }
#endif
# 82 "../../dist/include/mozilla/dom/Event.h"
    return static_cast<Event*>(event);
  }

  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Event)

  nsIGlobalObject* GetParentObject()
  {
    return mOwner;
  }

  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE MOZ_FINAL;

  virtual JSObject* WrapObjectInternal(JSContext* aCx);

#define GENERATED_EVENT(EventClass_) \
  virtual EventClass_* As##EventClass_()  \
  {                                       \
    return nullptr;                       \
  }
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/GeneratedEventList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/GeneratedEventList.h" 1
GENERATED_EVENT(AutocompleteErrorEvent)
GENERATED_EVENT(BlobEvent)
GENERATED_EVENT(CFStateChangeEvent)
GENERATED_EVENT(CSSFontFaceLoadEvent)
  nsCOMPtr<nsIGlobalObject>   mOwner;
  bool                        mEventIsInternal;
  bool                        mPrivateDataDuplicated;
};

} // namespace dom
} // namespace mozilla

#define NS_FORWARD_TO_EVENT \
  NS_FORWARD_NSIDOMEVENT(Event::)

#define NS_FORWARD_NSIDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION(_to) \
  NS_IMETHOD GetType(nsAString& aType) MOZ_OVERRIDE { return _to GetType(aType); } \
  NS_IMETHOD GetTarget(nsIDOMEventTarget** aTarget) MOZ_OVERRIDE { return _to GetTarget(aTarget); } \
  NS_IMETHOD GetCurrentTarget(nsIDOMEventTarget** aCurrentTarget) MOZ_OVERRIDE { return _to GetCurrentTarget(aCurrentTarget); } \
  NS_IMETHOD GetEventPhase(uint16_t* aEventPhase) MOZ_OVERRIDE { return _to GetEventPhase(aEventPhase); } \
  NS_IMETHOD GetBubbles(bool* aBubbles) MOZ_OVERRIDE { return _to GetBubbles(aBubbles); } \
  NS_IMETHOD GetCancelable(bool* aCancelable) MOZ_OVERRIDE { return _to GetCancelable(aCancelable); } \
  NS_IMETHOD GetTimeStamp(DOMTimeStamp* aTimeStamp) MOZ_OVERRIDE { return _to GetTimeStamp(aTimeStamp); } \
  NS_IMETHOD StopPropagation(void) MOZ_OVERRIDE { return _to StopPropagation(); } \
  NS_IMETHOD PreventDefault(void) MOZ_OVERRIDE { return _to PreventDefault(); } \
  NS_IMETHOD InitEvent(const nsAString& eventTypeArg, bool canBubbleArg, bool cancelableArg) MOZ_OVERRIDE { return _to InitEvent(eventTypeArg, canBubbleArg, cancelableArg); } \
  NS_IMETHOD GetDefaultPrevented(bool* aDefaultPrevented) MOZ_OVERRIDE { return _to GetDefaultPrevented(aDefaultPrevented); } \
  NS_IMETHOD StopImmediatePropagation(void) MOZ_OVERRIDE { return _to StopImmediatePropagation(); } \
  NS_IMETHOD GetOriginalTarget(nsIDOMEventTarget** aOriginalTarget) MOZ_OVERRIDE { return _to GetOriginalTarget(aOriginalTarget); } \
  NS_IMETHOD GetExplicitOriginalTarget(nsIDOMEventTarget** aExplicitOriginalTarget) MOZ_OVERRIDE { return _to GetExplicitOriginalTarget(aExplicitOriginalTarget); } \
  NS_IMETHOD GetPreventDefault(bool* aRetval) MOZ_OVERRIDE { return _to GetPreventDefault(aRetval); } \
  NS_IMETHOD GetIsTrusted(bool* aIsTrusted) MOZ_OVERRIDE { return _to GetIsTrusted(aIsTrusted); } \
  NS_IMETHOD SetTarget(nsIDOMEventTarget* aTarget) MOZ_OVERRIDE { return _to SetTarget(aTarget); } \
  NS_IMETHOD_(bool) IsDispatchStopped(void) MOZ_OVERRIDE { return _to IsDispatchStopped(); } \
  NS_IMETHOD_(WidgetEvent*) GetInternalNSEvent(void) MOZ_OVERRIDE { return _to GetInternalNSEvent(); } \
  NS_IMETHOD_(void) SetTrusted(bool aTrusted) MOZ_OVERRIDE { _to SetTrusted(aTrusted); } \
  NS_IMETHOD_(void) SetOwner(EventTarget* aOwner) MOZ_OVERRIDE { _to SetOwner(aOwner); } \
  NS_IMETHOD_(Event*) InternalDOMEvent() MOZ_OVERRIDE { return _to InternalDOMEvent(); }

#define NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION \
  NS_FORWARD_NSIDOMEVENT_NO_SERIALIZATION_NO_DUPLICATION(Event::)





#endif // mozilla_dom_Event_h_
# 344 "../../dist/include/mozilla/dom/Event.h"
# 14 "../../dist/include/mozilla/dom/StorageEvent.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/StorageEventBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/StorageEventBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_StorageEventBinding_h
#define mozilla_dom_StorageEventBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "EventBinding.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/StorageEventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/StorageEventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/StorageEventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/StorageEventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/StorageEventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/DOMStorage.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/DOMStorage.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef nsDOMStorage_h___
#define nsDOMStorage_h___

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/DOMStorage.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/DOMStorage.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMStorage.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMStorage.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMStorage.idl
 */

#ifndef __gen_nsIDOMStorage_h__
#define __gen_nsIDOMStorage_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMStorage.h"
#endif
# 12 "../../dist/include/nsIDOMStorage.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMStorage.h"

/* starting interface:    nsIDOMStorage */
#define NS_IDOMSTORAGE_IID_STR "425a33f0-e0e9-45e7-a95f-9908bd6ae988"

#define NS_IDOMSTORAGE_IID \
  {0x425a33f0, 0xe0e9, 0x45e7, \
    { 0xa9, 0x5f, 0x99, 0x08, 0xbd, 0x6a, 0xe9, 0x88 }}

class NS_NO_VTABLE nsIDOMStorage : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMSTORAGE_IID)

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMStorage, NS_IDOMSTORAGE_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMSTORAGE \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMSTORAGE(_to) \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMSTORAGE(_to) \
  /* no methods! */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMStorage : public nsIDOMStorage
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMSTORAGE

  nsDOMStorage();

private:
  ~nsDOMStorage();


/* End of implementation class template. */
#endif
# 80 "../../dist/include/nsIDOMStorage.h"


#endif /* __gen_nsIDOMStorage_h__ */
# 83 "../../dist/include/nsIDOMStorage.h"
# 12 "../../dist/include/mozilla/dom/DOMStorage.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/DOMStorage.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */

namespace mozilla {
namespace dom {

class DOMStorageManager;
class DOMStorageCache;

class DOMStorage MOZ_FINAL
  : public nsIDOMStorage
  , public nsSupportsWeakReference
  , public nsWrapperCache
{
public:
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(DOMStorage,
                                                         nsIDOMStorage)

  // Whether storage is set to persist data only per session, may change
  // dynamically and is set by CanUseStorage function that is called
  // before any operation on the storage.
  bool mIsSessionOnly : 1;

  ;
};

} // ::dom
} // ::mozilla

#endif /* nsDOMStorage_h___ */
# 167 "../../dist/include/mozilla/dom/DOMStorage.h"
# 12 "../../dist/include/mozilla/dom/StorageEventBinding.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/mozilla/dom/StorageEventBinding.h"

namespace mozilla {
namespace dom {

class DOMStorage;
struct NativePropertyHooks;
class ProtoAndIfaceCache;
class StorageEvent;
struct StorageEventAtoms;
struct StorageEventInitAtoms;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

struct StorageEventInit : public EventInit
{
  nsString mKey;
  nsString mNewValue;
  nsString mOldValue;
  nsRefPtr<mozilla::dom::DOMStorage> mStorageArea;
  nsString mUrl;

  ;

  

};

namespace binding_detail {
struct FastStorageEventInit : public StorageEventInit
{
  
};
} // namespace binding_detail


namespace StorageEventBinding {

  typedef mozilla::dom::StorageEvent NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable

  ;

  ;

  ;

} // namespace StorageEventBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_StorageEventBinding_h
# 135 "../../dist/include/mozilla/dom/StorageEventBinding.h"
# 15 "../../dist/include/mozilla/dom/StorageEvent.h" 2

// Helper for EventDispatcher.
;

namespace mozilla {
namespace dom {

class DOMStorage;

class StorageEvent : public Event
{
public:
  NS_DECL_ISUPPORTS_INHERITED
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(StorageEvent, Event)

  ;

protected:
  ;

  nsString mKey;
  nsString mOldValue;
  nsString mNewValue;
  nsString mUrl;
  nsRefPtr<DOMStorage> mStorageArea;

public:
  ;

  virtual JSObject* WrapObjectInternal(JSContext* aCx) MOZ_OVERRIDE;

  ;

  ;

  ;

  

  

  void GetNewValue(nsString& aRetVal) const
  {
    aRetVal = mNewValue;
  }

  void GetUrl(nsString& aRetVal) const
  {
    aRetVal = mUrl;
  }

  DOMStorage* GetStorageArea() const
  {
    return mStorageArea;
  }
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_StorageEvent_h
# 93 "../../dist/include/mozilla/dom/StorageEvent.h"
# 42 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/StorageEventBinding.h"
#endif /* expanded by -frewrite-includes */
# 43 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/UnionTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/UnionTypes.h" 1
#ifndef mozilla_dom_UnionTypes_h
#define mozilla_dom_UnionTypes_h

#if 0 /* expanded by -frewrite-includes */
#include "CustomEventBinding.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/CustomEventBinding.h" 1
/* THIS FILE IS AUTOGENERATED - DO NOT EDIT */

#ifndef mozilla_dom_CustomEventBinding_h
#define mozilla_dom_CustomEventBinding_h

#if 0 /* expanded by -frewrite-includes */
#include "EventBinding.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/CustomEventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "js/RootingAPI.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/CustomEventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "jspubtd.h"
#endif /* expanded by -frewrite-includes */
# 9 "../../dist/include/mozilla/dom/CustomEventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/ErrorResult.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/CustomEventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/BindingDeclarations.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/CustomEventBinding.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/Nullable.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/CustomEventBinding.h"

namespace mozilla {
namespace dom {

class CustomEvent;
struct CustomEventAtoms;
struct CustomEventInitAtoms;
struct NativePropertyHooks;
class ProtoAndIfaceCache;

} // namespace dom
} // namespace mozilla

namespace mozilla {
namespace dom {

struct CustomEventInit : public EventInit
{
  JS::Value mDetail;

  CustomEventInit();

  explicit inline CustomEventInit(const FastDictionaryInitializer& )
    : EventInit(FastDictionaryInitializer()),
      mDetail(JS::UndefinedValue())
  {
    // Do nothing here; this is used by our "Fast" subclass
  }

private:
  CustomEventInit(const CustomEventInit&) = delete;
  void operator=(const CustomEventInit) = delete;

  static bool
  InitIds(JSContext* cx, CustomEventInitAtoms* atomsCache);

public:
  bool
  Init(JSContext* cx, JS::Handle<JS::Value> val, const char* sourceDescription = "Value", bool passedToJSImpl = false);

  ;

  ;

  ;

  void
  TraceDictionary(JSTracer* trc);
};

namespace binding_detail {
struct FastCustomEventInit : public CustomEventInit
{
  inline FastCustomEventInit()
    : CustomEventInit(FastDictionaryInitializer())
  {
    // Doesn't matter what int we pass to the parent constructor
  }
};
} // namespace binding_detail


namespace CustomEventBinding {

  typedef mozilla::dom::CustomEvent NativeType;

  // We declare this as an array so that retrieving a pointer to this
  // binding's property hooks only requires compile/link-time resolvable
  ;

  ;

  JS::Handle<JSObject*>
  GetConstructorObjectHandle(JSContext* aCx, JS::Handle<JSObject*> aGlobal, bool aDefineOnGlobal = true);

  JSObject*
  GetConstructorObject(JSContext* aCx, JS::Handle<JSObject*> aGlobal);

} // namespace CustomEventBinding



} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_CustomEventBinding_h
# 126 "../../dist/include/mozilla/dom/CustomEventBinding.h"
# 5 "../../dist/include/mozilla/dom/UnionTypes.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "EventBinding.h"
#endif /* expanded by -frewrite-includes */
# 6 "../../dist/include/mozilla/dom/UnionTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "EventHandlerBinding.h"
#endif /* expanded by -frewrite-includes */
# 7 "../../dist/include/mozilla/dom/UnionTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "jsfriendapi.h"
#endif /* expanded by -frewrite-includes */
# 8 "../../dist/include/mozilla/dom/UnionTypes.h"
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/**
 * Class for representing MozMap arguments.  This is an nsTHashtable
 * under the hood, but we don't want to leak that implementation
 * detail.
 */

#ifndef mozilla_dom_MozMap_h
#define mozilla_dom_MozMap_h

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Move.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/mozilla/dom/MozMap.h"

namespace mozilla {
namespace dom {

namespace binding_detail {
template<typename DataType>
class MozMapEntry : public nsStringHashKey
{
public:
  explicit MozMapEntry(const nsAString* aKeyTypePointer)
    : nsStringHashKey(aKeyTypePointer)
  {
  }

  // Move constructor so we can do MozMaps of MozMaps.
  MozMapEntry(MozMapEntry<DataType>&& aOther)
    : nsStringHashKey(aOther),
      mData(Move(aOther.mData))
  {
  }

  DataType mData;
};
} // namespace binding_detail

template<typename DataType>
class MozMap : protected nsTHashtable<binding_detail::MozMapEntry<DataType>>
{
public:
  typedef typename binding_detail::MozMapEntry<DataType> EntryType;
  typedef nsTHashtable<EntryType> Base;
  typedef MozMap<DataType> SelfType;

  MozMap()
  {
  }

  // Move constructor so we can do MozMap of MozMap.
  MozMap(SelfType&& aOther) :
    Base(Move(aOther))
  {
  }

  // The return value is only safe to use until an AddEntry call.
  const DataType& Get(const nsAString& aKey) const
  {
    const EntryType* ent = this->GetEntry(aKey);
    MOZ_ASSERT(ent, "Why are you using a key we didn't claim to have?");
    return ent->mData;
  }

  

  // The return value is only safe to use until an AddEntry call.
  

  

  // XXXbz we expose this generic enumerator for tracing.  Otherwise we'd end up
  // with a dependency on BindingUtils.h here for the SequenceTracer bits.
  typedef PLDHashOperator (* Enumerator)(DataType* aValue, void* aClosure);
  

  

private:
  static PLDHashOperator
  KeyEnumerator(EntryType* aEntry, void* aClosure)
  {
    nsTArray<nsString>& keys = *static_cast<nsTArray<nsString>*>(aClosure);
    keys.AppendElement(aEntry->GetKey());
    return PL_DHASH_NEXT;
  }

  struct ValueEnumClosure {
    Enumerator mEnumerator;
    void* mClosure;
  };

  static PLDHashOperator
  ValueEnumerator(EntryType* aEntry, void* aClosure)
  {
    ValueEnumClosure* enumClosure = static_cast<ValueEnumClosure*>(aClosure);
    return enumClosure->mEnumerator(&aEntry->mData, enumClosure->mClosure);
  }
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_MozMap_h
# 138 "../../dist/include/mozilla/dom/MozMap.h"
# 12 "../../dist/include/mozilla/dom/UnionTypes.h" 2

class nsGenericHTMLElement;
class nsINode;

namespace mozilla {
namespace dom {

class CanvasGradient;
class CanvasPattern;
class File;
class HTMLOptGroupElement;
class HTMLOptionElement;
class OwningArrayBufferOrArrayBufferViewOrBlobOrString;
class OwningCanvasPatternOrCanvasGradient;
class OwningCanvasPatternOrNullOrCanvasGradient;
class OwningEventHandlerNonNullOrNullOrLong;
;

class ArrayBufferOrArrayBufferViewOrBlobOrString
{
  friend class ArrayBufferOrArrayBufferViewOrBlobOrStringArgument;
  enum Type
  {
    eUninitialized,
    eArrayBuffer,
    eArrayBufferView,
    eBlob,
    eString
  };

  union Value
  {
    UnionMember<RootedTypedArray<ArrayBuffer> > mArrayBuffer;
    UnionMember<RootedTypedArray<ArrayBufferView> > mArrayBufferView;
    UnionMember<NonNull<mozilla::dom::File> > mBlob;
    UnionMember<binding_detail::FakeString > mString;

  };

  Type mType;
  Value mValue;

  ArrayBufferOrArrayBufferViewOrBlobOrString(const ArrayBufferOrArrayBufferViewOrBlobOrString&) = delete;
  void operator=(const ArrayBufferOrArrayBufferViewOrBlobOrString) = delete;
public:
  explicit inline ArrayBufferOrArrayBufferViewOrBlobOrString()
    : mType(eUninitialized)
  {
  }

  inline RootedTypedArray<ArrayBuffer>&
  SetAsArrayBuffer(JSContext* cx)
  {
    if (mType == eArrayBuffer) {
      return mValue.mArrayBuffer.Value();
    }
    Uninit();
    mType = eArrayBuffer;
    return mValue.mArrayBuffer.SetValue(cx);
  }

  inline bool
  IsArrayBuffer() const
  {
    return mType == eArrayBuffer;
  }

  inline RootedTypedArray<ArrayBuffer>&
  GetAsArrayBuffer()
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    return mValue.mArrayBuffer.Value();
  }

  inline ArrayBuffer const &
  GetAsArrayBuffer() const
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    return mValue.mArrayBuffer.Value();
  }

  inline RootedTypedArray<ArrayBufferView>&
  RawSetAsArrayBufferView(JSContext* cx)
  {
    if (mType == eArrayBufferView) {
      return mValue.mArrayBufferView.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eArrayBufferView;
    return mValue.mArrayBufferView.SetValue(cx);
  }

  inline RootedTypedArray<ArrayBufferView>&
  SetAsArrayBufferView(JSContext* cx)
  {
    if (mType == eArrayBufferView) {
      return mValue.mArrayBufferView.Value();
    }
    Uninit();
    mType = eArrayBufferView;
    return mValue.mArrayBufferView.SetValue(cx);
  }

  inline bool
  IsArrayBufferView() const
  {
    return mType == eArrayBufferView;
  }

  inline RootedTypedArray<ArrayBufferView>&
  GetAsArrayBufferView()
  {
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
    return mValue.mArrayBufferView.Value();
  }

  inline ArrayBufferView const &
  GetAsArrayBufferView() const
  {
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
    return mValue.mArrayBufferView.Value();
  }

  inline NonNull<mozilla::dom::File>&
  RawSetAsBlob()
  {
    if (mType == eBlob) {
      return mValue.mBlob.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eBlob;
    return mValue.mBlob.SetValue();
  }

  inline NonNull<mozilla::dom::File>&
  SetAsBlob()
  {
    if (mType == eBlob) {
      return mValue.mBlob.Value();
    }
    Uninit();
    mType = eBlob;
    return mValue.mBlob.SetValue();
  }

  inline bool
  IsBlob() const
  {
    return mType == eBlob;
  }

  inline NonNull<mozilla::dom::File>&
  GetAsBlob()
  {
    MOZ_ASSERT(IsBlob(), "Wrong type!");
    return mValue.mBlob.Value();
  }

  inline mozilla::dom::File&
  GetAsBlob() const
  {
    MOZ_ASSERT(IsBlob(), "Wrong type!");
    return mValue.mBlob.Value();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline binding_detail::FakeString&
  SetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    Uninit();
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eArrayBuffer: {
        DestroyArrayBuffer();
        break;
      }
      case eArrayBufferView: {
        DestroyArrayBufferView();
        break;
      }
      case eBlob: {
        DestroyBlob();
        break;
      }
      case eString: {
        DestroyString();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyArrayBuffer()
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    mValue.mArrayBuffer.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyArrayBufferView()
  {
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
    mValue.mArrayBufferView.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyBlob()
  {
    MOZ_ASSERT(IsBlob(), "Wrong type!");
    mValue.mBlob.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    mValue.mString.Destroy();
    mType = eUninitialized;
  }
};

class ArrayBufferOrLong
{
  friend class ArrayBufferOrLongArgument;
  enum Type
  {
    eUninitialized,
    eArrayBuffer,
    eLong
  };

  union Value
  {
    UnionMember<RootedTypedArray<ArrayBuffer> > mArrayBuffer;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ArrayBufferOrLong(const ArrayBufferOrLong&) = delete;
  void operator=(const ArrayBufferOrLong) = delete;
public:
  explicit inline ArrayBufferOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~ArrayBufferOrLong()
  {
    Uninit();
  }

  inline RootedTypedArray<ArrayBuffer>&
  RawSetAsArrayBuffer(JSContext* cx)
  {
    if (mType == eArrayBuffer) {
      return mValue.mArrayBuffer.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eArrayBuffer;
    return mValue.mArrayBuffer.SetValue(cx);
  }

  inline RootedTypedArray<ArrayBuffer>&
  SetAsArrayBuffer(JSContext* cx)
  {
    if (mType == eArrayBuffer) {
      return mValue.mArrayBuffer.Value();
    }
    Uninit();
    mType = eArrayBuffer;
    return mValue.mArrayBuffer.SetValue(cx);
  }

  inline bool
  IsArrayBuffer() const
  {
    return mType == eArrayBuffer;
  }

  inline RootedTypedArray<ArrayBuffer>&
  GetAsArrayBuffer()
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    return mValue.mArrayBuffer.Value();
  }

  inline ArrayBuffer const &
  GetAsArrayBuffer() const
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    return mValue.mArrayBuffer.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eArrayBuffer: {
        DestroyArrayBuffer();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyArrayBuffer()
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    mValue.mArrayBuffer.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class ArrayBufferViewOrArrayBuffer
{
  friend class ArrayBufferViewOrArrayBufferArgument;
  enum Type
  {
    eUninitialized,
    eArrayBufferView,
    eArrayBuffer
  };

  union Value
  {
    UnionMember<RootedTypedArray<ArrayBufferView> > mArrayBufferView;
    UnionMember<RootedTypedArray<ArrayBuffer> > mArrayBuffer;

  };

  Type mType;
  Value mValue;

  ArrayBufferViewOrArrayBuffer(const ArrayBufferViewOrArrayBuffer&) = delete;
  void operator=(const ArrayBufferViewOrArrayBuffer) = delete;
public:
  explicit inline ArrayBufferViewOrArrayBuffer()
    : mType(eUninitialized)
  {
  }

  inline ~ArrayBufferViewOrArrayBuffer()
  {
    Uninit();
  }

  inline RootedTypedArray<ArrayBufferView>&
  RawSetAsArrayBufferView(JSContext* cx)
  {
    if (mType == eArrayBufferView) {
      return mValue.mArrayBufferView.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eArrayBufferView;
    return mValue.mArrayBufferView.SetValue(cx);
  }

  inline RootedTypedArray<ArrayBufferView>&
  SetAsArrayBufferView(JSContext* cx)
  {
    if (mType == eArrayBufferView) {
      return mValue.mArrayBufferView.Value();
    }
    Uninit();
    mType = eArrayBufferView;
    return mValue.mArrayBufferView.SetValue(cx);
  }

  inline bool
  IsArrayBufferView() const
  {
    return mType == eArrayBufferView;
  }

  inline RootedTypedArray<ArrayBufferView>&
  GetAsArrayBufferView()
  {
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
    return mValue.mArrayBufferView.Value();
  }

  inline ArrayBufferView const &
  GetAsArrayBufferView() const
  {
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
    return mValue.mArrayBufferView.Value();
  }

  inline RootedTypedArray<ArrayBuffer>&
  RawSetAsArrayBuffer(JSContext* cx)
  {
    if (mType == eArrayBuffer) {
      return mValue.mArrayBuffer.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eArrayBuffer;
    return mValue.mArrayBuffer.SetValue(cx);
  }

  inline RootedTypedArray<ArrayBuffer>&
  SetAsArrayBuffer(JSContext* cx)
  {
    if (mType == eArrayBuffer) {
      return mValue.mArrayBuffer.Value();
    }
    Uninit();
    mType = eArrayBuffer;
    return mValue.mArrayBuffer.SetValue(cx);
  }

  inline bool
  IsArrayBuffer() const
  {
    return mType == eArrayBuffer;
  }

  inline RootedTypedArray<ArrayBuffer>&
  GetAsArrayBuffer()
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    return mValue.mArrayBuffer.Value();
  }

  inline ArrayBuffer const &
  GetAsArrayBuffer() const
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    return mValue.mArrayBuffer.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eArrayBufferView: {
        DestroyArrayBufferView();
        break;
      }
      case eArrayBuffer: {
        DestroyArrayBuffer();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyArrayBufferView()
  {
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
    mValue.mArrayBufferView.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyArrayBuffer()
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    mValue.mArrayBuffer.Destroy();
    mType = eUninitialized;
  }
};

class ByteStringOrLong
{
  friend class ByteStringOrLongArgument;
  enum Type
  {
    eUninitialized,
    eByteString,
    eLong
  };

  union Value
  {
    UnionMember<nsCString > mByteString;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ByteStringOrLong(const ByteStringOrLong&) = delete;
  void operator=(const ByteStringOrLong) = delete;
public:
  explicit inline ByteStringOrLong()
    : mType(eUninitialized)
  {
  }

  inline nsCString&
  SetAsByteString()
  {
    if (mType == eByteString) {
      return mValue.mByteString.Value();
    }
    Uninit();
    mType = eByteString;
    return mValue.mByteString.SetValue();
  }

  inline bool
  IsByteString() const
  {
    return mType == eByteString;
  }

  inline nsCString&
  GetAsByteString()
  {
    MOZ_ASSERT(IsByteString(), "Wrong type!");
    return mValue.mByteString.Value();
  }

  inline const nsCString&
  GetAsByteString() const
  {
    MOZ_ASSERT(IsByteString(), "Wrong type!");
    return mValue.mByteString.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eByteString: {
        DestroyByteString();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyByteString()
  {
    MOZ_ASSERT(IsByteString(), "Wrong type!");
    mValue.mByteString.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class CanvasPatternOrCanvasGradient
{
  friend class CanvasPatternOrCanvasGradientArgument;
  enum Type
  {
    eUninitialized,
    eCanvasPattern,
    eCanvasGradient
  };

  union Value
  {
    UnionMember<NonNull<mozilla::dom::CanvasPattern> > mCanvasPattern;
    UnionMember<NonNull<mozilla::dom::CanvasGradient> > mCanvasGradient;

  };

  Type mType;
  Value mValue;

  CanvasPatternOrCanvasGradient(const CanvasPatternOrCanvasGradient&) = delete;
  void operator=(const CanvasPatternOrCanvasGradient) = delete;
public:
  explicit inline CanvasPatternOrCanvasGradient()
    : mType(eUninitialized)
  {
  }

  inline ~CanvasPatternOrCanvasGradient()
  {
    Uninit();
  }

  inline NonNull<mozilla::dom::CanvasPattern>&
  RawSetAsCanvasPattern()
  {
    if (mType == eCanvasPattern) {
      return mValue.mCanvasPattern.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eCanvasPattern;
    return mValue.mCanvasPattern.SetValue();
  }

  inline NonNull<mozilla::dom::CanvasPattern>&
  SetAsCanvasPattern()
  {
    if (mType == eCanvasPattern) {
      return mValue.mCanvasPattern.Value();
    }
    Uninit();
    mType = eCanvasPattern;
    return mValue.mCanvasPattern.SetValue();
  }

  inline bool
  IsCanvasPattern() const
  {
    return mType == eCanvasPattern;
  }

  inline NonNull<mozilla::dom::CanvasPattern>&
  GetAsCanvasPattern()
  {
    MOZ_ASSERT(IsCanvasPattern(), "Wrong type!");
    return mValue.mCanvasPattern.Value();
  }

  inline mozilla::dom::CanvasPattern&
  GetAsCanvasPattern() const
  {
    MOZ_ASSERT(IsCanvasPattern(), "Wrong type!");
    return mValue.mCanvasPattern.Value();
  }

  inline NonNull<mozilla::dom::CanvasGradient>&
  RawSetAsCanvasGradient()
  {
    return mValue.mCanvasGradient.SetValue();
  }

  inline bool
  IsCanvasGradient() const
  {
    return mType == eCanvasGradient;
  }

  inline NonNull<mozilla::dom::CanvasGradient>&
  GetAsCanvasGradient()
  {
    MOZ_ASSERT(IsCanvasGradient(), "Wrong type!");
    return mValue.mCanvasGradient.Value();
  }

  inline mozilla::dom::CanvasGradient&
  GetAsCanvasGradient() const
  {
    MOZ_ASSERT(IsCanvasGradient(), "Wrong type!");
    return mValue.mCanvasGradient.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eCanvasPattern: {
        DestroyCanvasPattern();
        break;
      }
      case eCanvasGradient: {
        DestroyCanvasGradient();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyCanvasPattern()
  {
    MOZ_ASSERT(IsCanvasPattern(), "Wrong type!");
    mValue.mCanvasPattern.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyCanvasGradient()
  {
    MOZ_ASSERT(IsCanvasGradient(), "Wrong type!");
    mValue.mCanvasGradient.Destroy();
    mType = eUninitialized;
  }
};

class CanvasPatternOrNullOrCanvasGradient
{
  friend class CanvasPatternOrNullOrCanvasGradientArgument;
  enum Type
  {
    eUninitialized,
    eNull,
    eCanvasPattern,
    eCanvasGradient
  };

  union Value
  {
    UnionMember<NonNull<mozilla::dom::CanvasPattern> > mCanvasPattern;
    UnionMember<NonNull<mozilla::dom::CanvasGradient> > mCanvasGradient;

  };

  Type mType;
  Value mValue;

  CanvasPatternOrNullOrCanvasGradient(const CanvasPatternOrNullOrCanvasGradient&) = delete;
  void operator=(const CanvasPatternOrNullOrCanvasGradient) = delete;
public:
  explicit inline CanvasPatternOrNullOrCanvasGradient()
    : mType(eUninitialized)
  {
  }

  inline ~CanvasPatternOrNullOrCanvasGradient()
  {
    Uninit();
  }

  inline bool
  IsNull() const
  {
    return mType == eNull;
  }

  inline void
  SetNull()
  {
    Uninit();
    mType = eNull;
  }

  inline NonNull<mozilla::dom::CanvasPattern>&
  RawSetAsCanvasPattern()
  {
    return mValue.mCanvasPattern.SetValue();
  }

  inline bool
  IsCanvasPattern() const
  {
    return mType == eCanvasPattern;
  }

  inline NonNull<mozilla::dom::CanvasPattern>&
  GetAsCanvasPattern()
  {
    MOZ_ASSERT(IsCanvasPattern(), "Wrong type!");
    return mValue.mCanvasPattern.Value();
  }

  inline mozilla::dom::CanvasPattern&
  GetAsCanvasPattern() const
  {
    MOZ_ASSERT(IsCanvasPattern(), "Wrong type!");
    return mValue.mCanvasPattern.Value();
  }

  inline NonNull<mozilla::dom::CanvasGradient>&
  RawSetAsCanvasGradient()
  {
    if (mType == eCanvasGradient) {
      return mValue.mCanvasGradient.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eCanvasGradient;
    return mValue.mCanvasGradient.SetValue();
  }

  inline NonNull<mozilla::dom::CanvasGradient>&
  SetAsCanvasGradient()
  {
    if (mType == eCanvasGradient) {
      return mValue.mCanvasGradient.Value();
    }
    Uninit();
    mType = eCanvasGradient;
    return mValue.mCanvasGradient.SetValue();
  }

  inline bool
  IsCanvasGradient() const
  {
    return mType == eCanvasGradient;
  }

  inline NonNull<mozilla::dom::CanvasGradient>&
  GetAsCanvasGradient()
  {
    MOZ_ASSERT(IsCanvasGradient(), "Wrong type!");
    return mValue.mCanvasGradient.Value();
  }

  inline mozilla::dom::CanvasGradient&
  GetAsCanvasGradient() const
  {
    MOZ_ASSERT(IsCanvasGradient(), "Wrong type!");
    return mValue.mCanvasGradient.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eNull: {
        break;
      }
      case eCanvasPattern: {
        DestroyCanvasPattern();
        break;
      }
      case eCanvasGradient: {
        DestroyCanvasGradient();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyCanvasPattern()
  {
    MOZ_ASSERT(IsCanvasPattern(), "Wrong type!");
    mValue.mCanvasPattern.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyCanvasGradient()
  {
    MOZ_ASSERT(IsCanvasGradient(), "Wrong type!");
    mValue.mCanvasGradient.Destroy();
    mType = eUninitialized;
  }
};

class CustomEventInitOrLong
{
  friend class CustomEventInitOrLongArgument;
  enum Type
  {
    eUninitialized,
    eCustomEventInit,
    eLong
  };

  union Value
  {
    UnionMember<RootedDictionary<binding_detail::FastCustomEventInit> > mCustomEventInit;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  CustomEventInitOrLong(const CustomEventInitOrLong&) = delete;
  void operator=(const CustomEventInitOrLong) = delete;
public:
  explicit inline CustomEventInitOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~CustomEventInitOrLong()
  {
    Uninit();
  }

  inline RootedDictionary<binding_detail::FastCustomEventInit>&
  RawSetAsCustomEventInit(JSContext* cx)
  {
    if (mType == eCustomEventInit) {
      return mValue.mCustomEventInit.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eCustomEventInit;
    return mValue.mCustomEventInit.SetValue(cx);
  }

  inline RootedDictionary<binding_detail::FastCustomEventInit>&
  SetAsCustomEventInit(JSContext* cx)
  {
    if (mType == eCustomEventInit) {
      return mValue.mCustomEventInit.Value();
    }
    Uninit();
    mType = eCustomEventInit;
    return mValue.mCustomEventInit.SetValue(cx);
  }

  inline bool
  IsCustomEventInit() const
  {
    return mType == eCustomEventInit;
  }

  inline RootedDictionary<binding_detail::FastCustomEventInit>&
  GetAsCustomEventInit()
  {
    MOZ_ASSERT(IsCustomEventInit(), "Wrong type!");
    return mValue.mCustomEventInit.Value();
  }

  inline const CustomEventInit&
  GetAsCustomEventInit() const
  {
    MOZ_ASSERT(IsCustomEventInit(), "Wrong type!");
    return mValue.mCustomEventInit.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eCustomEventInit: {
        DestroyCustomEventInit();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyCustomEventInit()
  {
    MOZ_ASSERT(IsCustomEventInit(), "Wrong type!");
    mValue.mCustomEventInit.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class DoubleOrString
{
  friend class DoubleOrStringArgument;
  enum Type
  {
    eUninitialized,
    eDouble,
    eString
  };

  union Value
  {
    UnionMember<double > mDouble;
    UnionMember<binding_detail::FakeString > mString;

  };

  Type mType;
  Value mValue;

  DoubleOrString(const DoubleOrString&) = delete;
  void operator=(const DoubleOrString) = delete;
public:
  explicit inline DoubleOrString()
    : mType(eUninitialized)
  {
  }

  inline ~DoubleOrString()
  {
    Uninit();
  }

  inline double&
  RawSetAsDouble()
  {
    if (mType == eDouble) {
      return mValue.mDouble.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eDouble;
    return mValue.mDouble.SetValue();
  }

  inline double&
  SetAsDouble()
  {
    if (mType == eDouble) {
      return mValue.mDouble.Value();
    }
    Uninit();
    mType = eDouble;
    return mValue.mDouble.SetValue();
  }

  inline bool
  IsDouble() const
  {
    return mType == eDouble;
  }

  inline double&
  GetAsDouble()
  {
    MOZ_ASSERT(IsDouble(), "Wrong type!");
    return mValue.mDouble.Value();
  }

  inline double
  GetAsDouble() const
  {
    MOZ_ASSERT(IsDouble(), "Wrong type!");
    return mValue.mDouble.Value();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline binding_detail::FakeString&
  SetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    Uninit();
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eDouble: {
        DestroyDouble();
        break;
      }
      case eString: {
        DestroyString();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyDouble()
  {
    MOZ_ASSERT(IsDouble(), "Wrong type!");
    mValue.mDouble.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    mValue.mString.Destroy();
    mType = eUninitialized;
  }
};

class EventHandlerNonNullOrNullOrLong
{
  friend class EventHandlerNonNullOrNullOrLongArgument;
  enum Type
  {
    eUninitialized,
    eNull,
    eEventHandlerNonNull,
    eLong
  };

  union Value
  {
    UnionMember<OwningNonNull<EventHandlerNonNull> > mEventHandlerNonNull;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  EventHandlerNonNullOrNullOrLong(const EventHandlerNonNullOrNullOrLong&) = delete;
  void operator=(const EventHandlerNonNullOrNullOrLong) = delete;
public:
  explicit inline EventHandlerNonNullOrNullOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~EventHandlerNonNullOrNullOrLong()
  {
    Uninit();
  }

  inline bool
  IsNull() const
  {
    return mType == eNull;
  }

  inline void
  SetNull()
  {
    Uninit();
    mType = eNull;
  }

  inline OwningNonNull<EventHandlerNonNull>&
  RawSetAsEventHandlerNonNull()
  {
    if (mType == eEventHandlerNonNull) {
      return mValue.mEventHandlerNonNull.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eEventHandlerNonNull;
    return mValue.mEventHandlerNonNull.SetValue();
  }

  inline OwningNonNull<EventHandlerNonNull>&
  SetAsEventHandlerNonNull()
  {
    if (mType == eEventHandlerNonNull) {
      return mValue.mEventHandlerNonNull.Value();
    }
    Uninit();
    mType = eEventHandlerNonNull;
    return mValue.mEventHandlerNonNull.SetValue();
  }

  inline bool
  IsEventHandlerNonNull() const
  {
    return mType == eEventHandlerNonNull;
  }

  inline OwningNonNull<EventHandlerNonNull>&
  GetAsEventHandlerNonNull()
  {
    MOZ_ASSERT(IsEventHandlerNonNull(), "Wrong type!");
    return mValue.mEventHandlerNonNull.Value();
  }

  inline EventHandlerNonNull&
  GetAsEventHandlerNonNull() const
  {
    MOZ_ASSERT(IsEventHandlerNonNull(), "Wrong type!");
    return mValue.mEventHandlerNonNull.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eNull: {
        break;
      }
      case eEventHandlerNonNull: {
        DestroyEventHandlerNonNull();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyEventHandlerNonNull()
  {
    MOZ_ASSERT(IsEventHandlerNonNull(), "Wrong type!");
    mValue.mEventHandlerNonNull.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class EventInitOrLong
{
  friend class EventInitOrLongArgument;
  enum Type
  {
    eUninitialized,
    eEventInit,
    eLong
  };

  union Value
  {
    UnionMember<binding_detail::FastEventInit > mEventInit;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  EventInitOrLong(const EventInitOrLong&) = delete;
  void operator=(const EventInitOrLong) = delete;
public:
  explicit inline EventInitOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~EventInitOrLong()
  {
    Uninit();
  }

  inline binding_detail::FastEventInit&
  RawSetAsEventInit()
  {
    if (mType == eEventInit) {
      return mValue.mEventInit.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eEventInit;
    return mValue.mEventInit.SetValue();
  }

  inline binding_detail::FastEventInit&
  SetAsEventInit()
  {
    if (mType == eEventInit) {
      return mValue.mEventInit.Value();
    }
    Uninit();
    mType = eEventInit;
    return mValue.mEventInit.SetValue();
  }

  inline bool
  IsEventInit() const
  {
    return mType == eEventInit;
  }

  inline binding_detail::FastEventInit&
  GetAsEventInit()
  {
    MOZ_ASSERT(IsEventInit(), "Wrong type!");
    return mValue.mEventInit.Value();
  }

  inline const EventInit&
  GetAsEventInit() const
  {
    MOZ_ASSERT(IsEventInit(), "Wrong type!");
    return mValue.mEventInit.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eEventInit: {
        DestroyEventInit();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyEventInit()
  {
    MOZ_ASSERT(IsEventInit(), "Wrong type!");
    mValue.mEventInit.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class EventInitOrStringSequence
{
  friend class EventInitOrStringSequenceArgument;
  enum Type
  {
    eUninitialized,
    eEventInit,
    eStringSequence
  };

  union Value
  {
    UnionMember<binding_detail::FastEventInit > mEventInit;
    UnionMember<binding_detail::AutoSequence<nsString> > mStringSequence;

  };

  Type mType;
  Value mValue;

  EventInitOrStringSequence(const EventInitOrStringSequence&) = delete;
  void operator=(const EventInitOrStringSequence) = delete;
public:
  explicit inline EventInitOrStringSequence()
    : mType(eUninitialized)
  {
  }

  inline ~EventInitOrStringSequence()
  {
    Uninit();
  }

  inline binding_detail::FastEventInit&
  RawSetAsEventInit()
  {
    return mValue.mEventInit.SetValue();
  }

  inline bool
  IsEventInit() const
  {
    return mType == eEventInit;
  }

  inline binding_detail::FastEventInit&
  GetAsEventInit()
  {
    MOZ_ASSERT(IsEventInit(), "Wrong type!");
    return mValue.mEventInit.Value();
  }

  inline const EventInit&
  GetAsEventInit() const
  {
    MOZ_ASSERT(IsEventInit(), "Wrong type!");
    return mValue.mEventInit.Value();
  }

  inline binding_detail::AutoSequence<nsString>&
  RawSetAsStringSequence()
  {
    if (mType == eStringSequence) {
      return mValue.mStringSequence.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eStringSequence;
    return mValue.mStringSequence.SetValue();
  }

  inline binding_detail::AutoSequence<nsString>&
  SetAsStringSequence()
  {
    if (mType == eStringSequence) {
      return mValue.mStringSequence.Value();
    }
    Uninit();
    mType = eStringSequence;
    return mValue.mStringSequence.SetValue();
  }

  inline bool
  IsStringSequence() const
  {
    return mType == eStringSequence;
  }

  inline binding_detail::AutoSequence<nsString>&
  GetAsStringSequence()
  {
    MOZ_ASSERT(IsStringSequence(), "Wrong type!");
    return mValue.mStringSequence.Value();
  }

  inline const Sequence<nsString>&
  GetAsStringSequence() const
  {
    MOZ_ASSERT(IsStringSequence(), "Wrong type!");
    return mValue.mStringSequence.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eEventInit: {
        DestroyEventInit();
        break;
      }
      case eStringSequence: {
        DestroyStringSequence();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyEventInit()
  {
    MOZ_ASSERT(IsEventInit(), "Wrong type!");
    mValue.mEventInit.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyStringSequence()
  {
    MOZ_ASSERT(IsStringSequence(), "Wrong type!");
    mValue.mStringSequence.Destroy();
    mType = eUninitialized;
  }
};

class FloatOrString
{
  friend class FloatOrStringArgument;
  enum Type
  {
    eUninitialized,
    eFloat,
    eString
  };

  union Value
  {
    UnionMember<float > mFloat;
    UnionMember<binding_detail::FakeString > mString;

  };

  Type mType;
  Value mValue;

  FloatOrString(const FloatOrString&) = delete;
  void operator=(const FloatOrString) = delete;
public:
  explicit inline FloatOrString()
    : mType(eUninitialized)
  {
  }

  inline ~FloatOrString()
  {
    Uninit();
  }

  inline float&
  RawSetAsFloat()
  {
    if (mType == eFloat) {
      return mValue.mFloat.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eFloat;
    return mValue.mFloat.SetValue();
  }

  inline float&
  SetAsFloat()
  {
    if (mType == eFloat) {
      return mValue.mFloat.Value();
    }
    Uninit();
    mType = eFloat;
    return mValue.mFloat.SetValue();
  }

  inline bool
  IsFloat() const
  {
    return mType == eFloat;
  }

  inline float&
  GetAsFloat()
  {
    MOZ_ASSERT(IsFloat(), "Wrong type!");
    return mValue.mFloat.Value();
  }

  inline float
  GetAsFloat() const
  {
    MOZ_ASSERT(IsFloat(), "Wrong type!");
    return mValue.mFloat.Value();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline binding_detail::FakeString&
  SetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    Uninit();
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eFloat: {
        DestroyFloat();
        break;
      }
      case eString: {
        DestroyString();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyFloat()
  {
    MOZ_ASSERT(IsFloat(), "Wrong type!");
    mValue.mFloat.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    mValue.mString.Destroy();
    mType = eUninitialized;
  }
};

class HTMLElementOrLong
{
  friend class HTMLElementOrLongArgument;
  enum Type
  {
    eUninitialized,
    eHTMLElement,
    eLong
  };

  union Value
  {
    UnionMember<NonNull<nsGenericHTMLElement> > mHTMLElement;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  HTMLElementOrLong(const HTMLElementOrLong&) = delete;
  void operator=(const HTMLElementOrLong) = delete;
public:
  explicit inline HTMLElementOrLong()
    : mType(eUninitialized)
  {
  }

  inline NonNull<nsGenericHTMLElement>&
  SetAsHTMLElement()
  {
    if (mType == eHTMLElement) {
      return mValue.mHTMLElement.Value();
    }
    Uninit();
    mType = eHTMLElement;
    return mValue.mHTMLElement.SetValue();
  }

  inline bool
  IsHTMLElement() const
  {
    return mType == eHTMLElement;
  }

  inline NonNull<nsGenericHTMLElement>&
  GetAsHTMLElement()
  {
    MOZ_ASSERT(IsHTMLElement(), "Wrong type!");
    return mValue.mHTMLElement.Value();
  }

  inline nsGenericHTMLElement&
  GetAsHTMLElement() const
  {
    MOZ_ASSERT(IsHTMLElement(), "Wrong type!");
    return mValue.mHTMLElement.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eHTMLElement: {
        DestroyHTMLElement();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyHTMLElement()
  {
    MOZ_ASSERT(IsHTMLElement(), "Wrong type!");
    mValue.mHTMLElement.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class HTMLOptionElementOrHTMLOptGroupElement
{
  friend class HTMLOptionElementOrHTMLOptGroupElementArgument;
  enum Type
  {
    eUninitialized,
    eHTMLOptionElement,
    eHTMLOptGroupElement
  };

  union Value
  {
    UnionMember<NonNull<mozilla::dom::HTMLOptionElement> > mHTMLOptionElement;
    UnionMember<NonNull<mozilla::dom::HTMLOptGroupElement> > mHTMLOptGroupElement;

  };

  Type mType;
  Value mValue;

  HTMLOptionElementOrHTMLOptGroupElement(const HTMLOptionElementOrHTMLOptGroupElement&) = delete;
  void operator=(const HTMLOptionElementOrHTMLOptGroupElement) = delete;
public:
  explicit inline HTMLOptionElementOrHTMLOptGroupElement()
    : mType(eUninitialized)
  {
  }

  inline ~HTMLOptionElementOrHTMLOptGroupElement()
  {
    Uninit();
  }

  inline NonNull<mozilla::dom::HTMLOptionElement>&
  RawSetAsHTMLOptionElement()
  {
    if (mType == eHTMLOptionElement) {
      return mValue.mHTMLOptionElement.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eHTMLOptionElement;
    return mValue.mHTMLOptionElement.SetValue();
  }

  inline NonNull<mozilla::dom::HTMLOptionElement>&
  SetAsHTMLOptionElement()
  {
    if (mType == eHTMLOptionElement) {
      return mValue.mHTMLOptionElement.Value();
    }
    Uninit();
    mType = eHTMLOptionElement;
    return mValue.mHTMLOptionElement.SetValue();
  }

  inline bool
  IsHTMLOptionElement() const
  {
    return mType == eHTMLOptionElement;
  }

  inline NonNull<mozilla::dom::HTMLOptionElement>&
  GetAsHTMLOptionElement()
  {
    MOZ_ASSERT(IsHTMLOptionElement(), "Wrong type!");
    return mValue.mHTMLOptionElement.Value();
  }

  inline mozilla::dom::HTMLOptionElement&
  GetAsHTMLOptionElement() const
  {
    MOZ_ASSERT(IsHTMLOptionElement(), "Wrong type!");
    return mValue.mHTMLOptionElement.Value();
  }

  inline NonNull<mozilla::dom::HTMLOptGroupElement>&
  RawSetAsHTMLOptGroupElement()
  {
    if (mType == eHTMLOptGroupElement) {
      return mValue.mHTMLOptGroupElement.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eHTMLOptGroupElement;
    return mValue.mHTMLOptGroupElement.SetValue();
  }

  inline NonNull<mozilla::dom::HTMLOptGroupElement>&
  SetAsHTMLOptGroupElement()
  {
    if (mType == eHTMLOptGroupElement) {
      return mValue.mHTMLOptGroupElement.Value();
    }
    Uninit();
    mType = eHTMLOptGroupElement;
    return mValue.mHTMLOptGroupElement.SetValue();
  }

  inline bool
  IsHTMLOptGroupElement() const
  {
    return mType == eHTMLOptGroupElement;
  }

  inline NonNull<mozilla::dom::HTMLOptGroupElement>&
  GetAsHTMLOptGroupElement()
  {
    MOZ_ASSERT(IsHTMLOptGroupElement(), "Wrong type!");
    return mValue.mHTMLOptGroupElement.Value();
  }

  inline mozilla::dom::HTMLOptGroupElement&
  GetAsHTMLOptGroupElement() const
  {
    MOZ_ASSERT(IsHTMLOptGroupElement(), "Wrong type!");
    return mValue.mHTMLOptGroupElement.Value();
  }

  inline void
  Uninit()
  {
    mValue.mHTMLOptGroupElement.Destroy();
    mType = eUninitialized;
  }
};

class ImageDataOrNullSequenceOrLong
{
  friend class ImageDataOrNullSequenceOrLongArgument;
  enum Type
  {
    eUninitialized,
    eImageDataOrNullSequence,
    eLong
  };

  union Value
  {
    UnionMember<binding_detail::AutoSequence<nsRefPtr<mozilla::dom::ImageData>> > mImageDataOrNullSequence;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ImageDataOrNullSequenceOrLong(const ImageDataOrNullSequenceOrLong&) = delete;
  void operator=(const ImageDataOrNullSequenceOrLong) = delete;
public:
  explicit inline ImageDataOrNullSequenceOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~ImageDataOrNullSequenceOrLong()
  {
    Uninit();
  }

  inline binding_detail::AutoSequence<nsRefPtr<mozilla::dom::ImageData>>&
  RawSetAsImageDataOrNullSequence()
  {
    if (mType == eImageDataOrNullSequence) {
      return mValue.mImageDataOrNullSequence.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eImageDataOrNullSequence;
    return mValue.mImageDataOrNullSequence.SetValue();
  }

  inline binding_detail::AutoSequence<nsRefPtr<mozilla::dom::ImageData>>&
  SetAsImageDataOrNullSequence()
  {
    if (mType == eImageDataOrNullSequence) {
      return mValue.mImageDataOrNullSequence.Value();
    }
    Uninit();
    mType = eImageDataOrNullSequence;
    return mValue.mImageDataOrNullSequence.SetValue();
  }

  inline bool
  IsImageDataOrNullSequence() const
  {
    return mType == eImageDataOrNullSequence;
  }

  inline binding_detail::AutoSequence<nsRefPtr<mozilla::dom::ImageData>>&
  GetAsImageDataOrNullSequence()
  {
    MOZ_ASSERT(IsImageDataOrNullSequence(), "Wrong type!");
    return mValue.mImageDataOrNullSequence.Value();
  }

  inline const Sequence<nsRefPtr<mozilla::dom::ImageData>>&
  GetAsImageDataOrNullSequence() const
  {
    MOZ_ASSERT(IsImageDataOrNullSequence(), "Wrong type!");
    return mValue.mImageDataOrNullSequence.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eImageDataOrNullSequence: {
        DestroyImageDataOrNullSequence();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyImageDataOrNullSequence()
  {
    MOZ_ASSERT(IsImageDataOrNullSequence(), "Wrong type!");
    mValue.mImageDataOrNullSequence.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class ImageDataOrNullSequenceSequenceOrLong
{
  friend class ImageDataOrNullSequenceSequenceOrLongArgument;
  enum Type
  {
    eUninitialized,
    eImageDataOrNullSequenceSequence,
    eLong
  };

  union Value
  {
    UnionMember<binding_detail::AutoSequence<Sequence<nsRefPtr<mozilla::dom::ImageData>>> > mImageDataOrNullSequenceSequence;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ImageDataOrNullSequenceSequenceOrLong(const ImageDataOrNullSequenceSequenceOrLong&) = delete;
  void operator=(const ImageDataOrNullSequenceSequenceOrLong) = delete;
public:
  explicit inline ImageDataOrNullSequenceSequenceOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~ImageDataOrNullSequenceSequenceOrLong()
  {
    Uninit();
  }

  inline binding_detail::AutoSequence<Sequence<nsRefPtr<mozilla::dom::ImageData>>>&
  RawSetAsImageDataOrNullSequenceSequence()
  {
    if (mType == eImageDataOrNullSequenceSequence) {
      return mValue.mImageDataOrNullSequenceSequence.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eImageDataOrNullSequenceSequence;
    return mValue.mImageDataOrNullSequenceSequence.SetValue();
  }

  inline binding_detail::AutoSequence<Sequence<nsRefPtr<mozilla::dom::ImageData>>>&
  SetAsImageDataOrNullSequenceSequence()
  {
    if (mType == eImageDataOrNullSequenceSequence) {
      return mValue.mImageDataOrNullSequenceSequence.Value();
    }
    Uninit();
    mType = eImageDataOrNullSequenceSequence;
    return mValue.mImageDataOrNullSequenceSequence.SetValue();
  }

  inline bool
  IsImageDataOrNullSequenceSequence() const
  {
    return mType == eImageDataOrNullSequenceSequence;
  }

  inline binding_detail::AutoSequence<Sequence<nsRefPtr<mozilla::dom::ImageData>>>&
  GetAsImageDataOrNullSequenceSequence()
  {
    MOZ_ASSERT(IsImageDataOrNullSequenceSequence(), "Wrong type!");
    return mValue.mImageDataOrNullSequenceSequence.Value();
  }

  inline const Sequence<Sequence<nsRefPtr<mozilla::dom::ImageData>>>&
  GetAsImageDataOrNullSequenceSequence() const
  {
    MOZ_ASSERT(IsImageDataOrNullSequenceSequence(), "Wrong type!");
    return mValue.mImageDataOrNullSequenceSequence.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eImageDataOrNullSequenceSequence: {
        DestroyImageDataOrNullSequenceSequence();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyImageDataOrNullSequenceSequence()
  {
    MOZ_ASSERT(IsImageDataOrNullSequenceSequence(), "Wrong type!");
    mValue.mImageDataOrNullSequenceSequence.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class ImageDataSequenceOrLong
{
  friend class ImageDataSequenceOrLongArgument;
  enum Type
  {
    eUninitialized,
    eImageDataSequence,
    eLong
  };

  union Value
  {
    UnionMember<binding_detail::AutoSequence<OwningNonNull<mozilla::dom::ImageData>> > mImageDataSequence;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ImageDataSequenceOrLong(const ImageDataSequenceOrLong&) = delete;
  void operator=(const ImageDataSequenceOrLong) = delete;
public:
  explicit inline ImageDataSequenceOrLong()
    : mType(eUninitialized)
  {
  }

  inline binding_detail::AutoSequence<OwningNonNull<mozilla::dom::ImageData>>&
  SetAsImageDataSequence()
  {
    if (mType == eImageDataSequence) {
      return mValue.mImageDataSequence.Value();
    }
    Uninit();
    mType = eImageDataSequence;
    return mValue.mImageDataSequence.SetValue();
  }

  inline bool
  IsImageDataSequence() const
  {
    return mType == eImageDataSequence;
  }

  inline binding_detail::AutoSequence<OwningNonNull<mozilla::dom::ImageData>>&
  GetAsImageDataSequence()
  {
    MOZ_ASSERT(IsImageDataSequence(), "Wrong type!");
    return mValue.mImageDataSequence.Value();
  }

  inline const Sequence<OwningNonNull<mozilla::dom::ImageData>>&
  GetAsImageDataSequence() const
  {
    MOZ_ASSERT(IsImageDataSequence(), "Wrong type!");
    return mValue.mImageDataSequence.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eImageDataSequence: {
        DestroyImageDataSequence();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyImageDataSequence()
  {
    MOZ_ASSERT(IsImageDataSequence(), "Wrong type!");
    mValue.mImageDataSequence.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class ImageDataSequenceSequenceOrLong
{
  friend class ImageDataSequenceSequenceOrLongArgument;
  enum Type
  {
    eUninitialized,
    eImageDataSequenceSequence,
    eLong
  };

  union Value
  {
    UnionMember<binding_detail::AutoSequence<Sequence<OwningNonNull<mozilla::dom::ImageData>>> > mImageDataSequenceSequence;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ImageDataSequenceSequenceOrLong(const ImageDataSequenceSequenceOrLong&) = delete;
  void operator=(const ImageDataSequenceSequenceOrLong) = delete;
public:

  inline bool
  IsImageDataSequenceSequence() const
  {
    return mType == eImageDataSequenceSequence;
  }

  inline binding_detail::AutoSequence<Sequence<OwningNonNull<mozilla::dom::ImageData>>>&
  GetAsImageDataSequenceSequence()
  {
    MOZ_ASSERT(IsImageDataSequenceSequence(), "Wrong type!");
    return mValue.mImageDataSequenceSequence.Value();
  }

  inline const Sequence<Sequence<OwningNonNull<mozilla::dom::ImageData>>>&
  GetAsImageDataSequenceSequence() const
  {
    MOZ_ASSERT(IsImageDataSequenceSequence(), "Wrong type!");
    return mValue.mImageDataSequenceSequence.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eImageDataSequenceSequence: {
        DestroyImageDataSequenceSequence();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyImageDataSequenceSequence()
  {
    MOZ_ASSERT(IsImageDataSequenceSequence(), "Wrong type!");
    mValue.mImageDataSequenceSequence.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class LongMozMapOrLong
{
  friend class LongMozMapOrLongArgument;
  enum Type
  {
    eUninitialized,
    eLongMozMap,
    eLong
  };

  union Value
  {
    UnionMember<MozMap<int32_t> > mLongMozMap;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  LongMozMapOrLong(const LongMozMapOrLong&) = delete;
  void operator=(const LongMozMapOrLong) = delete;
public:
  explicit inline LongMozMapOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~LongMozMapOrLong()
  {
    Uninit();
  }

  inline MozMap<int32_t>&
  RawSetAsLongMozMap()
  {
    if (mType == eLongMozMap) {
      return mValue.mLongMozMap.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLongMozMap;
    return mValue.mLongMozMap.SetValue();
  }

  inline MozMap<int32_t>&
  SetAsLongMozMap()
  {
    if (mType == eLongMozMap) {
      return mValue.mLongMozMap.Value();
    }
    Uninit();
    mType = eLongMozMap;
    return mValue.mLongMozMap.SetValue();
  }

  inline bool
  IsLongMozMap() const
  {
    return mType == eLongMozMap;
  }

  inline MozMap<int32_t>&
  GetAsLongMozMap()
  {
    MOZ_ASSERT(IsLongMozMap(), "Wrong type!");
    return mValue.mLongMozMap.Value();
  }

  inline const MozMap<int32_t>&
  GetAsLongMozMap() const
  {
    MOZ_ASSERT(IsLongMozMap(), "Wrong type!");
    return mValue.mLongMozMap.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eLongMozMap: {
        DestroyLongMozMap();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyLongMozMap()
  {
    MOZ_ASSERT(IsLongMozMap(), "Wrong type!");
    mValue.mLongMozMap.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class LongOrAnyMozMap
{
  friend class LongOrAnyMozMapArgument;
  enum Type
  {
    eUninitialized,
    eLong,
    eAnyMozMap
  };

  union Value
  {
    UnionMember<int32_t > mLong;
    UnionMember<MozMap<JS::Value> > mAnyMozMap;

  };

  Type mType;
  Value mValue;

  LongOrAnyMozMap(const LongOrAnyMozMap&) = delete;
  void operator=(const LongOrAnyMozMap) = delete;
public:
  explicit inline LongOrAnyMozMap()
    : mType(eUninitialized)
  {
  }

  inline ~LongOrAnyMozMap()
  {
    Uninit();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline MozMap<JS::Value>&
  RawSetAsAnyMozMap()
  {
    if (mType == eAnyMozMap) {
      return mValue.mAnyMozMap.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eAnyMozMap;
    return mValue.mAnyMozMap.SetValue();
  }

  inline MozMap<JS::Value>&
  SetAsAnyMozMap()
  {
    if (mType == eAnyMozMap) {
      return mValue.mAnyMozMap.Value();
    }
    Uninit();
    mType = eAnyMozMap;
    return mValue.mAnyMozMap.SetValue();
  }

  inline bool
  IsAnyMozMap() const
  {
    return mType == eAnyMozMap;
  }

  inline MozMap<JS::Value>&
  GetAsAnyMozMap()
  {
    MOZ_ASSERT(IsAnyMozMap(), "Wrong type!");
    return mValue.mAnyMozMap.Value();
  }

  inline const MozMap<JS::Value>&
  GetAsAnyMozMap() const
  {
    MOZ_ASSERT(IsAnyMozMap(), "Wrong type!");
    return mValue.mAnyMozMap.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
      case eAnyMozMap: {
        DestroyAnyMozMap();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyAnyMozMap()
  {
    MOZ_ASSERT(IsAnyMozMap(), "Wrong type!");
    mValue.mAnyMozMap.Destroy();
    mType = eUninitialized;
  }
};

class LongOrBoolean
{
  friend class LongOrBooleanArgument;
  enum Type
  {
    eUninitialized,
    eLong,
    eBoolean
  };

  union Value
  {
    UnionMember<int32_t > mLong;
    UnionMember<bool > mBoolean;

  };

  Type mType;
  Value mValue;

  LongOrBoolean(const LongOrBoolean&) = delete;
  void operator=(const LongOrBoolean) = delete;
public:
  explicit inline LongOrBoolean()
    : mType(eUninitialized)
  {
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline bool&
  RawSetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool&
  SetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    Uninit();
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool
  IsBoolean() const
  {
    return mType == eBoolean;
  }

  inline bool&
  GetAsBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline bool
  GetAsBoolean() const
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
      case eBoolean: {
        DestroyBoolean();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    mValue.mBoolean.Destroy();
    mType = eUninitialized;
  }
};

class LongSequenceOrLong
{
  friend class LongSequenceOrLongArgument;
  enum Type
  {
    eUninitialized,
    eLongSequence,
    eLong
  };

  union Value
  {
    UnionMember<binding_detail::AutoSequence<int32_t> > mLongSequence;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  LongSequenceOrLong(const LongSequenceOrLong&) = delete;
  void operator=(const LongSequenceOrLong) = delete;
public:
  explicit inline LongSequenceOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~LongSequenceOrLong()
  {
    Uninit();
  }

  inline binding_detail::AutoSequence<int32_t>&
  RawSetAsLongSequence()
  {
    if (mType == eLongSequence) {
      return mValue.mLongSequence.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLongSequence;
    return mValue.mLongSequence.SetValue();
  }

  inline binding_detail::AutoSequence<int32_t>&
  SetAsLongSequence()
  {
    if (mType == eLongSequence) {
      return mValue.mLongSequence.Value();
    }
    Uninit();
    mType = eLongSequence;
    return mValue.mLongSequence.SetValue();
  }

  inline bool
  IsLongSequence() const
  {
    return mType == eLongSequence;
  }

  inline binding_detail::AutoSequence<int32_t>&
  GetAsLongSequence()
  {
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
    return mValue.mLongSequence.Value();
  }

  inline const Sequence<int32_t>&
  GetAsLongSequence() const
  {
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
    return mValue.mLongSequence.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eLongSequence: {
        DestroyLongSequence();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyLongSequence()
  {
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
    mValue.mLongSequence.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class LongSequenceOrNullOrLong
{
  friend class LongSequenceOrNullOrLongArgument;
  enum Type
  {
    eUninitialized,
    eNull,
    eLongSequence,
    eLong
  };

  union Value
  {
    UnionMember<binding_detail::AutoSequence<int32_t> > mLongSequence;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  LongSequenceOrNullOrLong(const LongSequenceOrNullOrLong&) = delete;
  void operator=(const LongSequenceOrNullOrLong) = delete;
public:
  explicit inline LongSequenceOrNullOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~LongSequenceOrNullOrLong()
  {
    Uninit();
  }

  inline bool
  IsNull() const
  {
    return mType == eNull;
  }

  inline void
  SetNull()
  {
    Uninit();
    mType = eNull;
  }

  inline binding_detail::AutoSequence<int32_t>&
  RawSetAsLongSequence()
  {
    return mValue.mLongSequence.SetValue();
  }

  inline bool
  IsLongSequence() const
  {
    return mType == eLongSequence;
  }

  inline binding_detail::AutoSequence<int32_t>&
  GetAsLongSequence()
  {
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
    return mValue.mLongSequence.Value();
  }

  inline const Sequence<int32_t>&
  GetAsLongSequence() const
  {
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
    return mValue.mLongSequence.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eNull: {
        break;
      }
      case eLongSequence: {
        DestroyLongSequence();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyLongSequence()
  {
    MOZ_ASSERT(IsLongSequence(), "Wrong type!");
    mValue.mLongSequence.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class NodeOrLongOrBoolean
{
  friend class NodeOrLongOrBooleanArgument;
  enum Type
  {
    eUninitialized,
    eNode,
    eLong,
    eBoolean
  };

  union Value
  {
    UnionMember<NonNull<nsINode> > mNode;
    UnionMember<int32_t > mLong;
    UnionMember<bool > mBoolean;

  };

  Type mType;
  Value mValue;

  NodeOrLongOrBoolean(const NodeOrLongOrBoolean&) = delete;
  void operator=(const NodeOrLongOrBoolean) = delete;
public:
  explicit inline NodeOrLongOrBoolean()
    : mType(eUninitialized)
  {
  }

  inline ~NodeOrLongOrBoolean()
  {
    Uninit();
  }

  inline NonNull<nsINode>&
  RawSetAsNode()
  {
    if (mType == eNode) {
      return mValue.mNode.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eNode;
    return mValue.mNode.SetValue();
  }

  inline NonNull<nsINode>&
  SetAsNode()
  {
    if (mType == eNode) {
      return mValue.mNode.Value();
    }
    Uninit();
    mType = eNode;
    return mValue.mNode.SetValue();
  }

  inline bool
  IsNode() const
  {
    return mType == eNode;
  }

  inline NonNull<nsINode>&
  GetAsNode()
  {
    MOZ_ASSERT(IsNode(), "Wrong type!");
    return mValue.mNode.Value();
  }

  inline nsINode&
  GetAsNode() const
  {
    MOZ_ASSERT(IsNode(), "Wrong type!");
    return mValue.mNode.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline bool&
  RawSetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool&
  SetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    Uninit();
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool
  IsBoolean() const
  {
    return mType == eBoolean;
  }

  inline bool&
  GetAsBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline bool
  GetAsBoolean() const
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eNode: {
        DestroyNode();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
      case eBoolean: {
        DestroyBoolean();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyNode()
  {
    MOZ_ASSERT(IsNode(), "Wrong type!");
    mValue.mNode.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    mValue.mBoolean.Destroy();
    mType = eUninitialized;
  }
};

class ObjectMozMapOrLong
{
  friend class ObjectMozMapOrLongArgument;
  enum Type
  {
    eUninitialized,
    eObjectMozMap,
    eLong
  };

  union Value
  {
    UnionMember<MozMap<JSObject*> > mObjectMozMap;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ObjectMozMapOrLong(const ObjectMozMapOrLong&) = delete;
  void operator=(const ObjectMozMapOrLong) = delete;
public:
  explicit inline ObjectMozMapOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~ObjectMozMapOrLong()
  {
    Uninit();
  }

  inline MozMap<JSObject*>&
  RawSetAsObjectMozMap()
  {
    if (mType == eObjectMozMap) {
      return mValue.mObjectMozMap.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eObjectMozMap;
    return mValue.mObjectMozMap.SetValue();
  }

  inline MozMap<JSObject*>&
  SetAsObjectMozMap()
  {
    if (mType == eObjectMozMap) {
      return mValue.mObjectMozMap.Value();
    }
    Uninit();
    mType = eObjectMozMap;
    return mValue.mObjectMozMap.SetValue();
  }

  inline bool
  IsObjectMozMap() const
  {
    return mType == eObjectMozMap;
  }

  inline MozMap<JSObject*>&
  GetAsObjectMozMap()
  {
    MOZ_ASSERT(IsObjectMozMap(), "Wrong type!");
    return mValue.mObjectMozMap.Value();
  }

  inline const MozMap<JSObject*>&
  GetAsObjectMozMap() const
  {
    MOZ_ASSERT(IsObjectMozMap(), "Wrong type!");
    return mValue.mObjectMozMap.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eObjectMozMap: {
        DestroyObjectMozMap();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObjectMozMap()
  {
    MOZ_ASSERT(IsObjectMozMap(), "Wrong type!");
    mValue.mObjectMozMap.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class ObjectOrBoolean
{
  friend class ObjectOrBooleanArgument;
  enum Type
  {
    eUninitialized,
    eObject,
    eBoolean
  };

  union Value
  {
    UnionMember<JS::Rooted<JSObject*> > mObject;
    UnionMember<bool > mBoolean;

  };

  Type mType;
  Value mValue;

  ObjectOrBoolean(const ObjectOrBoolean&) = delete;
  void operator=(const ObjectOrBoolean) = delete;
public:
  explicit inline ObjectOrBoolean()
    : mType(eUninitialized)
  {
  }

  inline ~ObjectOrBoolean()
  {
    Uninit();
  }

  inline bool
  IsObject() const
  {
    return mType == eObject;
  }

  inline JS::Rooted<JSObject*>&
  GetAsObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline JSObject*
  GetAsObject() const
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline bool&
  RawSetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool&
  SetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool
  IsBoolean() const
  {
    return mType == eBoolean;
  }

  inline bool&
  GetAsBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline bool
  GetAsBoolean() const
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eObject: {
        DestroyObject();
        break;
      }
      case eBoolean: {
        DestroyBoolean();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    mValue.mObject.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    mValue.mBoolean.Destroy();
    mType = eUninitialized;
  }
};

class ObjectOrLong
{
  friend class ObjectOrLongArgument;
  enum Type
  {
    eUninitialized,
    eObject,
    eLong
  };

  union Value
  {
    UnionMember<JS::Rooted<JSObject*> > mObject;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ObjectOrLong(const ObjectOrLong&) = delete;
  void operator=(const ObjectOrLong) = delete;
public:
  explicit inline ObjectOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~ObjectOrLong()
  {
    Uninit();
  }

  inline bool
  IsObject() const
  {
    return mType == eObject;
  }

  inline JS::Rooted<JSObject*>&
  GetAsObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline JSObject*
  GetAsObject() const
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eObject: {
        DestroyObject();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    mValue.mObject.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class ObjectOrLongOrBoolean
{
  friend class ObjectOrLongOrBooleanArgument;
  enum Type
  {
    eUninitialized,
    eObject,
    eLong,
    eBoolean
  };

  union Value
  {
    UnionMember<JS::Rooted<JSObject*> > mObject;
    UnionMember<int32_t > mLong;
    UnionMember<bool > mBoolean;

  };

  Type mType;
  Value mValue;

  ObjectOrLongOrBoolean(const ObjectOrLongOrBoolean&) = delete;
  void operator=(const ObjectOrLongOrBoolean) = delete;
public:
  explicit inline ObjectOrLongOrBoolean()
    : mType(eUninitialized)
  {
  }

  inline ~ObjectOrLongOrBoolean()
  {
    Uninit();
  }

  inline bool
  IsObject() const
  {
    return mType == eObject;
  }

  inline JS::Rooted<JSObject*>&
  GetAsObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline JSObject*
  GetAsObject() const
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline bool&
  RawSetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool&
  SetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool
  IsBoolean() const
  {
    return mType == eBoolean;
  }

  inline bool&
  GetAsBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline bool
  GetAsBoolean() const
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eObject: {
        DestroyObject();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
      case eBoolean: {
        DestroyBoolean();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    mValue.mObject.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    mValue.mBoolean.Destroy();
    mType = eUninitialized;
  }
};

class ObjectOrLongOrNull
{
  friend class ObjectOrLongOrNullArgument;
  enum Type
  {
    eUninitialized,
    eNull,
    eObject,
    eLong
  };

  union Value
  {
    UnionMember<JS::Rooted<JSObject*> > mObject;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ObjectOrLongOrNull(const ObjectOrLongOrNull&) = delete;
  void operator=(const ObjectOrLongOrNull) = delete;

  inline void
  SetNull()
  {
    Uninit();
    mType = eNull;
  }

  inline bool
  IsObject() const
  {
    return mType == eObject;
  }

  inline JS::Rooted<JSObject*>&
  GetAsObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline JSObject*
  GetAsObject() const
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eNull: {
        break;
      }
      case eObject: {
        DestroyObject();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    mValue.mObject.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class ObjectOrNullOrLong
{
  friend class ObjectOrNullOrLongArgument;
  enum Type
  {
    eUninitialized,
    eNull,
    eObject,
    eLong
  };

  union Value
  {
    UnionMember<JS::Rooted<JSObject*> > mObject;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ObjectOrNullOrLong(const ObjectOrNullOrLong&) = delete;
  void operator=(const ObjectOrNullOrLong) = delete;
public:
  explicit inline ObjectOrNullOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~ObjectOrNullOrLong()
  {
    Uninit();
  }

  inline bool
  IsNull() const
  {
    return mType == eNull;
  }

  inline void
  SetNull()
  {
    Uninit();
    mType = eNull;
  }

  inline bool
  IsObject() const
  {
    return mType == eObject;
  }

  inline JS::Rooted<JSObject*>&
  GetAsObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline JSObject*
  GetAsObject() const
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eNull: {
        break;
      }
      case eObject: {
        DestroyObject();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    mValue.mObject.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class ObjectOrString
{
  friend class ObjectOrStringArgument;
  enum Type
  {
    eUninitialized,
    eObject,
    eString
  };

  union Value
  {
    UnionMember<JS::Rooted<JSObject*> > mObject;
    UnionMember<binding_detail::FakeString > mString;

  };

  Type mType;
  Value mValue;

  ObjectOrString(const ObjectOrString&) = delete;
  void operator=(const ObjectOrString) = delete;
public:
  explicit inline ObjectOrString()
    : mType(eUninitialized)
  {
  }

  inline ~ObjectOrString()
  {
    Uninit();
  }

  inline bool
  IsObject() const
  {
    return mType == eObject;
  }

  inline JS::Rooted<JSObject*>&
  GetAsObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline JSObject*
  GetAsObject() const
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline binding_detail::FakeString&
  SetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eObject: {
        DestroyObject();
        break;
      }
      case eString: {
        DestroyString();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    mValue.mObject.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    mValue.mString.Destroy();
    mType = eUninitialized;
  }
};

class ObjectOrStringOrBoolean
{
  friend class ObjectOrStringOrBooleanArgument;
  enum Type
  {
    eUninitialized,
    eObject,
    eString,
    eBoolean
  };

  union Value
  {
    UnionMember<JS::Rooted<JSObject*> > mObject;
    UnionMember<binding_detail::FakeString > mString;
    UnionMember<bool > mBoolean;

  };

  Type mType;
  Value mValue;

  ObjectOrStringOrBoolean(const ObjectOrStringOrBoolean&) = delete;
  void operator=(const ObjectOrStringOrBoolean) = delete;
public:
  explicit inline ObjectOrStringOrBoolean()
    : mType(eUninitialized)
  {
  }

  inline ~ObjectOrStringOrBoolean()
  {
    Uninit();
  }

  inline bool
  IsObject() const
  {
    return mType == eObject;
  }

  inline JS::Rooted<JSObject*>&
  GetAsObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline JSObject*
  GetAsObject() const
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline binding_detail::FakeString&
  SetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline bool&
  RawSetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool&
  SetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool
  IsBoolean() const
  {
    return mType == eBoolean;
  }

  inline bool&
  GetAsBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline bool
  GetAsBoolean() const
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eObject: {
        DestroyObject();
        break;
      }
      case eString: {
        DestroyString();
        break;
      }
      case eBoolean: {
        DestroyBoolean();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    mValue.mObject.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    mValue.mString.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    mValue.mBoolean.Destroy();
    mType = eUninitialized;
  }
};

class ObjectOrStringOrLong
{
  friend class ObjectOrStringOrLongArgument;
  enum Type
  {
    eUninitialized,
    eObject,
    eString,
    eLong
  };

  union Value
  {
    UnionMember<JS::Rooted<JSObject*> > mObject;
    UnionMember<binding_detail::FakeString > mString;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ObjectOrStringOrLong(const ObjectOrStringOrLong&) = delete;
  void operator=(const ObjectOrStringOrLong) = delete;
public:
  explicit inline ObjectOrStringOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~ObjectOrStringOrLong()
  {
    Uninit();
  }

  inline bool
  IsObject() const
  {
    return mType == eObject;
  }

  inline JS::Rooted<JSObject*>&
  GetAsObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline JSObject*
  GetAsObject() const
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline binding_detail::FakeString&
  SetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eObject: {
        DestroyObject();
        break;
      }
      case eString: {
        DestroyString();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    mValue.mObject.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    mValue.mString.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class ObjectOrStringOrLongOrBoolean
{
  friend class ObjectOrStringOrLongOrBooleanArgument;
  enum Type
  {
    eUninitialized,
    eObject,
    eString,
    eLong,
    eBoolean
  };

  union Value
  {
    UnionMember<JS::Rooted<JSObject*> > mObject;
    UnionMember<binding_detail::FakeString > mString;
    UnionMember<int32_t > mLong;
    UnionMember<bool > mBoolean;

  };

  Type mType;
  Value mValue;

  ObjectOrStringOrLongOrBoolean(const ObjectOrStringOrLongOrBoolean&) = delete;
  void operator=(const ObjectOrStringOrLongOrBoolean) = delete;
public:
  explicit inline ObjectOrStringOrLongOrBoolean()
    : mType(eUninitialized)
  {
  }

  inline ~ObjectOrStringOrLongOrBoolean()
  {
    Uninit();
  }

  inline bool
  IsObject() const
  {
    return mType == eObject;
  }

  inline JS::Rooted<JSObject*>&
  GetAsObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline JSObject*
  GetAsObject() const
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline binding_detail::FakeString&
  SetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline bool&
  RawSetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool&
  SetAsBoolean()
  {
    if (mType == eBoolean) {
      return mValue.mBoolean.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eBoolean;
    return mValue.mBoolean.SetValue();
  }

  inline bool
  IsBoolean() const
  {
    return mType == eBoolean;
  }

  inline bool&
  GetAsBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline bool
  GetAsBoolean() const
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    return mValue.mBoolean.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    mValue.mObject.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyBoolean()
  {
    MOZ_ASSERT(IsBoolean(), "Wrong type!");
    mValue.mBoolean.Destroy();
    mType = eUninitialized;
  }
};

class ObjectSequenceOrLong
{
  friend class ObjectSequenceOrLongArgument;
  enum Type
  {
    eUninitialized,
    eObjectSequence,
    eLong
  };

  union Value
  {
    UnionMember<binding_detail::AutoSequence<JSObject*> > mObjectSequence;
    UnionMember<int32_t > mLong;

  };

  Type mType;
  Value mValue;

  ObjectSequenceOrLong(const ObjectSequenceOrLong&) = delete;
  void operator=(const ObjectSequenceOrLong) = delete;
public:
  explicit inline ObjectSequenceOrLong()
    : mType(eUninitialized)
  {
  }

  inline ~ObjectSequenceOrLong()
  {
    Uninit();
  }

  inline binding_detail::AutoSequence<JSObject*>&
  RawSetAsObjectSequence()
  {
    if (mType == eObjectSequence) {
      return mValue.mObjectSequence.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eObjectSequence;
    return mValue.mObjectSequence.SetValue();
  }

  inline binding_detail::AutoSequence<JSObject*>&
  SetAsObjectSequence()
  {
    if (mType == eObjectSequence) {
      return mValue.mObjectSequence.Value();
    }
    Uninit();
    mType = eObjectSequence;
    return mValue.mObjectSequence.SetValue();
  }

  inline bool
  IsObjectSequence() const
  {
    return mType == eObjectSequence;
  }

  inline binding_detail::AutoSequence<JSObject*>&
  GetAsObjectSequence()
  {
    MOZ_ASSERT(IsObjectSequence(), "Wrong type!");
    return mValue.mObjectSequence.Value();
  }

  inline const Sequence<JSObject*>&
  GetAsObjectSequence() const
  {
    MOZ_ASSERT(IsObjectSequence(), "Wrong type!");
    return mValue.mObjectSequence.Value();
  }

  inline int32_t&
  RawSetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline int32_t&
  SetAsLong()
  {
    if (mType == eLong) {
      return mValue.mLong.Value();
    }
    Uninit();
    mType = eLong;
    return mValue.mLong.SetValue();
  }

  inline bool
  IsLong() const
  {
    return mType == eLong;
  }

  inline int32_t&
  GetAsLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline int32_t
  GetAsLong() const
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    return mValue.mLong.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eObjectSequence: {
        DestroyObjectSequence();
        break;
      }
      case eLong: {
        DestroyLong();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyObjectSequence()
  {
    MOZ_ASSERT(IsObjectSequence(), "Wrong type!");
    mValue.mObjectSequence.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyLong()
  {
    MOZ_ASSERT(IsLong(), "Wrong type!");
    mValue.mLong.Destroy();
    mType = eUninitialized;
  }
};

class StringMozMapOrString
{
  friend class StringMozMapOrStringArgument;
  enum Type
  {
    eUninitialized,
    eStringMozMap,
    eString
  };

  union Value
  {
    UnionMember<MozMap<nsString> > mStringMozMap;
    UnionMember<binding_detail::FakeString > mString;

  };

  Type mType;
  Value mValue;

  StringMozMapOrString(const StringMozMapOrString&) = delete;
  void operator=(const StringMozMapOrString) = delete;
public:
  explicit inline StringMozMapOrString()
    : mType(eUninitialized)
  {
  }

  inline MozMap<nsString>&
  SetAsStringMozMap()
  {
    if (mType == eStringMozMap) {
      return mValue.mStringMozMap.Value();
    }
    Uninit();
    mType = eStringMozMap;
    return mValue.mStringMozMap.SetValue();
  }

  inline bool
  IsStringMozMap() const
  {
    return mType == eStringMozMap;
  }

  inline MozMap<nsString>&
  GetAsStringMozMap()
  {
    MOZ_ASSERT(IsStringMozMap(), "Wrong type!");
    return mValue.mStringMozMap.Value();
  }

  inline const MozMap<nsString>&
  GetAsStringMozMap() const
  {
    MOZ_ASSERT(IsStringMozMap(), "Wrong type!");
    return mValue.mStringMozMap.Value();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline binding_detail::FakeString&
  SetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    Uninit();
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eStringMozMap: {
        DestroyStringMozMap();
        break;
      }
      case eString: {
        DestroyString();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyStringMozMap()
  {
    MOZ_ASSERT(IsStringMozMap(), "Wrong type!");
    mValue.mStringMozMap.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    mValue.mString.Destroy();
    mType = eUninitialized;
  }
};

class StringMozMapOrStringSequence
{
  friend class StringMozMapOrStringSequenceArgument;
  enum Type
  {
    eUninitialized,
    eStringMozMap,
    eStringSequence
  };

  union Value
  {
    UnionMember<MozMap<nsString> > mStringMozMap;
    UnionMember<binding_detail::AutoSequence<nsString> > mStringSequence;

  };

  Type mType;
  Value mValue;

  StringMozMapOrStringSequence(const StringMozMapOrStringSequence&) = delete;
  void operator=(const StringMozMapOrStringSequence) = delete;
public:
  explicit inline StringMozMapOrStringSequence()
    : mType(eUninitialized)
  {
  }

  inline ~StringMozMapOrStringSequence()
  {
    Uninit();
  }

  inline MozMap<nsString>&
  RawSetAsStringMozMap()
  {
    if (mType == eStringMozMap) {
      return mValue.mStringMozMap.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eStringMozMap;
    return mValue.mStringMozMap.SetValue();
  }

  inline MozMap<nsString>&
  SetAsStringMozMap()
  {
    if (mType == eStringMozMap) {
      return mValue.mStringMozMap.Value();
    }
    Uninit();
    mType = eStringMozMap;
    return mValue.mStringMozMap.SetValue();
  }

  inline bool
  IsStringMozMap() const
  {
    return mType == eStringMozMap;
  }

  inline MozMap<nsString>&
  GetAsStringMozMap()
  {
    MOZ_ASSERT(IsStringMozMap(), "Wrong type!");
    return mValue.mStringMozMap.Value();
  }

  inline const MozMap<nsString>&
  GetAsStringMozMap() const
  {
    MOZ_ASSERT(IsStringMozMap(), "Wrong type!");
    return mValue.mStringMozMap.Value();
  }

  inline binding_detail::AutoSequence<nsString>&
  RawSetAsStringSequence()
  {
    if (mType == eStringSequence) {
      return mValue.mStringSequence.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eStringSequence;
    return mValue.mStringSequence.SetValue();
  }

  inline binding_detail::AutoSequence<nsString>&
  SetAsStringSequence()
  {
    if (mType == eStringSequence) {
      return mValue.mStringSequence.Value();
    }
    Uninit();
    mType = eStringSequence;
    return mValue.mStringSequence.SetValue();
  }

  inline bool
  IsStringSequence() const
  {
    return mType == eStringSequence;
  }

  inline binding_detail::AutoSequence<nsString>&
  GetAsStringSequence()
  {
    MOZ_ASSERT(IsStringSequence(), "Wrong type!");
    return mValue.mStringSequence.Value();
  }

  inline const Sequence<nsString>&
  GetAsStringSequence() const
  {
    MOZ_ASSERT(IsStringSequence(), "Wrong type!");
    return mValue.mStringSequence.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
      case eStringMozMap: {
        DestroyStringMozMap();
        break;
      }
      case eStringSequence: {
        DestroyStringSequence();
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyStringMozMap()
  {
    MOZ_ASSERT(IsStringMozMap(), "Wrong type!");
    mValue.mStringMozMap.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyStringSequence()
  {
    MOZ_ASSERT(IsStringSequence(), "Wrong type!");
    mValue.mStringSequence.Destroy();
    mType = eUninitialized;
  }
};

class StringOrBlobOrArrayBufferOrArrayBufferView
{
  friend class StringOrBlobOrArrayBufferOrArrayBufferViewArgument;
  enum Type
  {
    eUninitialized,
    eString,
    eBlob,
    eArrayBuffer,
    eArrayBufferView
  };

  union Value
  {
    UnionMember<binding_detail::FakeString > mString;
    UnionMember<NonNull<mozilla::dom::File> > mBlob;
    UnionMember<RootedTypedArray<ArrayBuffer> > mArrayBuffer;
    UnionMember<RootedTypedArray<ArrayBufferView> > mArrayBufferView;

  };

  Type mType;
  Value mValue;

  StringOrBlobOrArrayBufferOrArrayBufferView(const StringOrBlobOrArrayBufferOrArrayBufferView&) = delete;
  void operator=(const StringOrBlobOrArrayBufferOrArrayBufferView) = delete;
public:
  explicit inline StringOrBlobOrArrayBufferOrArrayBufferView()
    : mType(eUninitialized)
  {
  }

  inline ~StringOrBlobOrArrayBufferOrArrayBufferView()
  {
    Uninit();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline binding_detail::FakeString&
  SetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    Uninit();
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline NonNull<mozilla::dom::File>&
  RawSetAsBlob()
  {
    if (mType == eBlob) {
      return mValue.mBlob.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eBlob;
    return mValue.mBlob.SetValue();
  }

  inline NonNull<mozilla::dom::File>&
  SetAsBlob()
  {
    if (mType == eBlob) {
      return mValue.mBlob.Value();
    }
    Uninit();
    mType = eBlob;
    return mValue.mBlob.SetValue();
  }

  inline bool
  IsBlob() const
  {
    return mType == eBlob;
  }

  inline NonNull<mozilla::dom::File>&
  GetAsBlob()
  {
  }

  inline bool
  IsArrayBuffer() const
  {
    return mType == eArrayBuffer;
  }

  inline RootedTypedArray<ArrayBuffer>&
  GetAsArrayBuffer()
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    return mValue.mArrayBuffer.Value();
  }

  inline ArrayBuffer const &
  GetAsArrayBuffer() const
  {
    MOZ_ASSERT(IsArrayBuffer(), "Wrong type!");
    return mValue.mArrayBuffer.Value();
  }

  inline RootedTypedArray<ArrayBufferView>&
  RawSetAsArrayBufferView(JSContext* cx)
  {
    if (mType == eArrayBufferView) {
      return mValue.mArrayBufferView.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eArrayBufferView;
    return mValue.mArrayBufferView.SetValue(cx);
  }

  inline RootedTypedArray<ArrayBufferView>&
  SetAsArrayBufferView(JSContext* cx)
  {
    if (mType == eArrayBufferView) {
      return mValue.mArrayBufferView.Value();
    }
    Uninit();
    mType = eArrayBufferView;
    return mValue.mArrayBufferView.SetValue(cx);
  }

  inline bool
  IsArrayBufferView() const
  {
    return mType == eArrayBufferView;
  }

  inline RootedTypedArray<ArrayBufferView>&
  GetAsArrayBufferView()
  {
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
    return mValue.mArrayBufferView.Value();
  }

  inline ArrayBufferView const &
  GetAsArrayBufferView() const
  {
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
    return mValue.mArrayBufferView.Value();
  }

  inline void
  Uninit()
  {
    switch (mType) {
      case eUninitialized: {
        break;
      }
    }
  }

  bool
  ToJSVal(JSContext* cx, JS::Handle<JSObject*> scopeObj, JS::MutableHandle<JS::Value> rval) const;

private:
  inline void
  DestroyString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    mValue.mString.Destroy();
    mType = eUninitialized;
  }

  inline void
  DestroyArrayBufferView()
  {
    MOZ_ASSERT(IsArrayBufferView(), "Wrong type!");
    mValue.mArrayBufferView.Destroy();
    mType = eUninitialized;
  }
};

class StringOrObject
{
  friend class StringOrObjectArgument;
  enum Type
  {
    eUninitialized,
    eString,
    eObject
  };

  union Value
  {
    UnionMember<binding_detail::FakeString > mString;
    UnionMember<JS::Rooted<JSObject*> > mObject;

  };

  Type mType;
  Value mValue;

  StringOrObject(const StringOrObject&) = delete;
  void operator=(const StringOrObject) = delete;
public:
  explicit inline StringOrObject()
    : mType(eUninitialized)
  {
  }

  inline ~StringOrObject()
  {
    Uninit();
  }

  inline binding_detail::FakeString&
  RawSetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType == eUninitialized);
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline binding_detail::FakeString&
  SetAsString()
  {
    if (mType == eString) {
      return mValue.mString.Value();
    }
    MOZ_ASSERT(mType != eObject, "This will not play well with Rooted");
    Uninit();
    mType = eString;
    return mValue.mString.SetValue();
  }

  inline bool
  IsString() const
  {
    return mType == eString;
  }

  inline binding_detail::FakeString&
  GetAsString()
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline const nsAString&
  GetAsString() const
  {
    MOZ_ASSERT(IsString(), "Wrong type!");
    return mValue.mString.Value();
  }

  inline bool
  IsObject() const
  {
    return mType == eObject;
  }

  inline JS::Rooted<JSObject*>&
  GetAsObject()
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  inline JSObject*
  GetAsObject() const
  {
    MOZ_ASSERT(IsObject(), "Wrong type!");
    return mValue.mObject.Value();
  }

  

  void
  Uninit();

  ;

  ;

private:
  ;

  ;
};

class OwningStringOrStringSequence : public AllOwningUnionBase
{
  ;
  enum Type
  {
    eUninitialized,
    eString,
    eStringSequence
  };

  

  

  ;

  ;

  ;

  ;

private:
  ;

  ;
};

class OwningUnrestrictedDoubleOrString : public AllOwningUnionBase
{
  ;
  enum Type
  {
    eUninitialized,
    eUnrestrictedDouble,
    eString
  };

  union Value
  ;

private:
  ;

  ;
};

class OwningUnrestrictedFloatOrString : public AllOwningUnionBase
{
  ;
  enum Type
  {
    eUninitialized,
    eUnrestrictedFloat,
    eString
  };

  union Value
  {
    UnionMember<float > mUnrestrictedFloat;
    UnionMember<nsString > mString;

  };

  Type mType;
  Value mValue;

public:
  

  
  nsString&
  RawSetAsString();

  ;

  ;

  

  

  

  

  void
  Uninit();

  ;

  ;

  void
  operator=(const OwningUnrestrictedFloatOrString& aOther);

private:
  ;

  ;
};
} // namespace dom
} // namespace mozilla


#endif // mozilla_dom_UnionTypes_h
# 13190 "../../dist/include/mozilla/dom/UnionTypes.h"
# 44 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsFrameMessageManager.h"
#endif /* expanded by -frewrite-includes */
# 45 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/LinkedList.h"
#endif /* expanded by -frewrite-includes */
# 46 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/TimeStamp.h"
#endif /* expanded by -frewrite-includes */
# 47 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCacheInlines.h"
#endif /* expanded by -frewrite-includes */
# 48 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIIdleObserver.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIIdleObserver.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIIdleObserver.idl
 */

#ifndef __gen_nsIIdleObserver_h__
#define __gen_nsIIdleObserver_h__

#define NS_IIDLEOBSERVER_IID_STR "37916e05-e062-4f72-96d5-660cfb55e9b6"

#define NS_IIDLEOBSERVER_IID \
  {0x37916e05, 0xe062, 0x4f72, \
    { 0x96, 0xd5, 0x66, 0x0c, 0xfb, 0x55, 0xe9, 0xb6 }}

class NS_NO_VTABLE nsIIdleObserver : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIDLEOBSERVER_IID)

  /* readonly attribute unsigned long time; */
  NS_IMETHOD GetTime(uint32_t *aTime) = 0;

  /* void onidle (); */
  NS_IMETHOD Onidle(void) = 0;

  /* void onactive (); */
  NS_IMETHOD Onactive(void) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIIdleObserver, NS_IIDLEOBSERVER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIIDLEOBSERVER \
  NS_IMETHOD GetTime(uint32_t *aTime) MOZ_OVERRIDE; \
  NS_IMETHOD Onidle(void) MOZ_OVERRIDE; \
  NS_IMETHOD Onactive(void) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIIDLEOBSERVER(_to) \
  NS_IMETHOD GetTime(uint32_t *aTime) MOZ_OVERRIDE { return _to GetTime(aTime); } \
  NS_IMETHOD Onidle(void) MOZ_OVERRIDE { return _to Onidle(); } \
  NS_IMETHOD Onactive(void) MOZ_OVERRIDE { return _to Onactive(); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIIDLEOBSERVER(_to) \
  NS_IMETHOD GetTime(uint32_t *aTime) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTime(aTime); } \
  NS_IMETHOD Onidle(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Onidle(); } \
  NS_IMETHOD Onactive(void) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->Onactive(); } 

#if 0
/* readonly attribute unsigned long time; */
NS_IMETHODIMP nsIdleObserver::GetTime(uint32_t *aTime)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onidle (); */
NS_IMETHODIMP nsIdleObserver::Onidle()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onactive (); */
NS_IMETHODIMP nsIdleObserver::Onactive()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 113 "../../dist/include/nsIIdleObserver.h"


#endif /* __gen_nsIIdleObserver_h__ */
# 116 "../../dist/include/nsIIdleObserver.h"
# 49 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsIDocument.h"
#endif /* expanded by -frewrite-includes */
# 50 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/EventTarget.h"
#endif /* expanded by -frewrite-includes */
# 51 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/WindowBinding.h"
#endif /* expanded by -frewrite-includes */
struct nsIntSize;
struct nsRect;

class nsWindowSizes;

namespace mozilla {
class DOMEventTargetHelper;
namespace dom {
class BarProp;
class Console;
class Crypto;
class External;
class Function;
class Gamepad;
class VRDevice;
class MediaQueryList;
class MozSelfSupport;
class Navigator;
class OwningExternalOrWindowProxy;
class Promise;
struct RequestInit;
class RequestOrUSVString;
class Selection;
class SpeechSynthesis;
class WakeLock;
namespace cache {
class CacheStorage;
} // namespace cache
namespace indexedDB {
class IDBFactory;
} // namespace indexedDB
} // namespace dom
namespace gfx {
class VRHMDInfo;
} // namespace gfx
} // namespace mozilla

;

;

;

/*
 * Timeout struct that holds information about each script
 * timeout.  Holds a strong reference to an nsIScriptTimeoutHandler, which
 * abstracts the language specific cruft.
 */
struct nsTimeout MOZ_FINAL
  : mozilla::LinkedListElement<nsTimeout>
{
private:
  ~nsTimeout();

public:
  ;

  NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsTimeout)
  NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsTimeout)

  

  ;

  // stack depth at which timeout is firing
  nsCOMPtr<nsIPrincipal> mOrigin;
  nsCOMPtr<nsIVariant> mValue;
};

//*****************************************************************************
// nsGlobalWindow: Global Object for Scripting
//*****************************************************************************
// Beware that all scriptable interfaces implemented by
// nsGlobalWindow will be reachable from JS, if you make this class
// implement new interfaces you better know what you're
// doing. Security wise this is very sensitive code. --
// jst@netscape.com

// nsGlobalWindow inherits PRCList for maintaining a list of all inner
// windows still in memory for any given outer window. This list is
// needed to ensure that mOuterWindow doesn't end up dangling. The
// nature of PRCList means that the window itself is always in the
// list, and an outer window's list will also contain all inner window
// objects that are still in memory (and in reality all inner window
// object's lists also contain its outer and all other inner windows
// belonging to the same outer window, but that's an unimportant
// side effect of inheriting PRCList).

class nsGlobalWindow : public mozilla::dom::EventTarget,
                       public nsPIDOMWindow,
                       public nsIScriptGlobalObject,
                       public nsIScriptObjectPrincipal,
                       public nsIDOMJSWindow,
                       public nsSupportsWeakReference,
                       public nsIInterfaceRequestor,
                       public PRCListStr
{
public:
  typedef mozilla::TimeStamp TimeStamp;
  typedef mozilla::TimeDuration TimeDuration;
  typedef nsDataHashtable<nsUint64HashKey, nsGlobalWindow*> WindowByIdTable;

  static void
  AssertIsOnMainThread()
#ifdef DEBUG
  ;
#else
# 345 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
  { }
#endif
# 347 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"

  // public methods
  ;

  // callback for close event
  ;

  // nsISupports
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS

  // nsWrapperCache
  

  // nsIGlobalJSObjectHolder
  virtual JSObject* GetGlobalJSObject() MOZ_OVERRIDE;
  // depending on which info they actually want off the scrollable frame.
  ;

  ;

  // Outer windows only.
  ;

  ;
  ;
  ;
  ;

  ;

  friend class WindowStateHolder;

  NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsGlobalWindow,
                                                                   nsIDOMEventTarget)

#ifdef DEBUG
  // Call Unlink on this window. This may cause bad things to happen, so use
  // with caution.
  void RiskyUnlink();
#endif
# 636 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"

  virtual JSObject*
    GetCachedXBLPrototypeHandler(nsXBLPrototypeHandler* aKey) MOZ_OVERRIDE;

  virtual void
    CacheXBLPrototypeHandler(nsXBLPrototypeHandler* aKey,
                             JS::Handle<JSObject*> aHandler) MOZ_OVERRIDE;

  virtual bool TakeFocus(bool aFocus, uint32_t aFocusMethod) MOZ_OVERRIDE;
  virtual void SetReadyForFocus() MOZ_OVERRIDE;
  virtual void PageHidden() MOZ_OVERRIDE;
  virtual nsresult DispatchAsyncHashchange(nsIURI *aOldURI, nsIURI *aNewURI) MOZ_OVERRIDE;
  virtual nsresult DispatchSyncPopState() MOZ_OVERRIDE;

  // Inner windows only.
  virtual void EnableDeviceSensor(uint32_t aType) MOZ_OVERRIDE;
  virtual void DisableDeviceSensor(uint32_t aType) MOZ_OVERRIDE;

  virtual void EnableTimeChangeNotifications() MOZ_OVERRIDE;
  virtual void DisableTimeChangeNotifications() MOZ_OVERRIDE;

#ifdef MOZ_B2G
  // Inner windows only.
  virtual void EnableNetworkEvent(uint32_t aType) MOZ_OVERRIDE;
  virtual void DisableNetworkEvent(uint32_t aType) MOZ_OVERRIDE;
#endif // MOZ_B2G
# 662 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"

  virtual nsresult SetArguments(nsIArray* aArguments) MOZ_OVERRIDE;

  ;
  

  


  // Get the VR devices for this window, initializing if necessary
  ;

#define EVENT(name_, id_, type_, struct_)                                     \
  mozilla::dom::EventHandlerNonNull* GetOn##name_()                           \
  void SetOn##name_(mozilla::dom::OnBeforeUnloadEventHandlerNonNull* handler) \
  {                                                                           \
    mozilla::EventListenerManager* elm = GetOrCreateListenerManager();        \
    if (elm) {                                                                \
      elm->SetEventHandler(handler);                                          \
    }                                                                         \
  }
#define WINDOW_ONLY_EVENT EVENT
#define TOUCH_EVENT EVENT
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/EventNameList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/EventNameList.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
# 968 "../../dist/include/mozilla/EventNameList.h"

#ifdef ID_TO_EVENT
#undef EVENT
#undef WINDOW_ONLY_EVENT
#undef TOUCH_EVENT
#undef DOCUMENT_ONLY_EVENT
#undef NON_IDL_EVENT
#endif /* ID_TO_EVENT */
# 976 "../../dist/include/mozilla/EventNameList.h"

# 826 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h" 2
#undef TOUCH_EVENT
#undef WINDOW_ONLY_EVENT
#undef BEFOREUNLOAD_EVENT
#undef ERROR_EVENT
  mozilla::dom::BarProp* GetScrollbars(mozilla::ErrorResult& aError);
  mozilla::dom::BarProp* GetStatusbar(mozilla::ErrorResult& aError);
  mozilla::dom::BarProp* GetToolbar(mozilla::ErrorResult& aError);
  void GetStatus(nsAString& aStatus, mozilla::ErrorResult& aError);
  ;
  ;
  void GetContent(JSContext* aCx,
                  JS::MutableHandle<JSObject*> aRetval,
                  mozilla::ErrorResult& aError);
  void Get_content(JSContext* aCx,
                   JS::MutableHandle<JSObject*> aRetval,
                   mozilla::ErrorResult& aError)
  {
    if (mDoc) {
      mDoc->WarnOnceAbout(nsIDocument::eWindow_Content);
    }
    GetContent(aCx, aRetval, aError);
  }

  // ChromeWindow bits.  Do NOT call these unless your window is in
  // fact an nsGlobalChromeWindow.
  uint16_t WindowState();
  nsIBrowserDOMWindow* GetBrowserDOMWindow(mozilla::ErrorResult& aError);
  void SetBrowserDOMWindow(nsIBrowserDOMWindow* aBrowserWindow,
                           mozilla::ErrorResult& aError);
  void GetAttention(mozilla::ErrorResult& aError);
  void GetAttentionWithCycleCount(int32_t aCycleCount,
                                  mozilla::ErrorResult& aError);
  void SetCursor(const nsAString& aCursor, mozilla::ErrorResult& aError);
  void Maximize(mozilla::ErrorResult& aError);
  void Minimize(mozilla::ErrorResult& aError);
  void Restore(mozilla::ErrorResult& aError);
  bool                                       mVRDevicesInitialized;
  // The VRDevies for this window
  nsTArray<nsRefPtr<mozilla::dom::VRDevice>> mVRDevices;
  // Any attached HMD when fullscreen
  nsRefPtr<mozilla::gfx::VRHMDInfo>          mVRHMDInfo;

  friend class nsDOMScriptableHelper;
  friend class nsDOMWindowUtils;
  friend class PostMessageEvent;
  friend class DesktopNotification;

  static WindowByIdTable* sWindowsById;
  static bool sWarnedAboutWindowInternal;
};



/*
 * nsGlobalModalWindow inherits from nsGlobalWindow. It is the global
 * object created for a modal content windows only (i.e. not modal
 * chrome dialogs).
 */
class nsGlobalModalWindow : public nsGlobalWindow,
                            public nsIDOMModalContentWindow
{
public:
  NS_DECL_ISUPPORTS_INHERITED
  NS_DECL_NSIDOMMODALCONTENTWINDOW

  ;

protected:
  

  
};

/* factory function */


#endif /* nsGlobalWindow_h___ */
# 1822 "/Users/luser/build/mozilla-central/dom/base/nsGlobalWindow.h"
# 106 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "GLContext.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GLCONTEXT_H_
#define GLCONTEXT_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#if 0 /* expanded by -frewrite-includes */
#include <ctype.h>
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#if 0 /* expanded by -frewrite-includes */
#include <map>
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#if 0 /* expanded by -frewrite-includes */
#include <bitset>
#define MOZ_GL_DEBUG 1
#endif
# 34 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
# 36 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"

#if 0 /* expanded by -frewrite-includes */
#include "GLDefs.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLDefs.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#if !defined(LOCALGL_H_)
#define LOCALGL_H_

#if 0 /* expanded by -frewrite-includes */
#include "GLTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLTypes.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#if !defined(GLTYPES_H_)
#define GLTYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include <stddef.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
 *
 * Copyright (c) 2008 Eli Friedman
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __STDDEF_H
#define __STDDEF_H

#if !defined(_PTRDIFF_T) || __has_feature(modules)
/* Always define ptrdiff_t when modules are available. */
#if !__has_feature(modules)
#define _PTRDIFF_T
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __PTRDIFF_TYPE__ ptrdiff_t;
# 85 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#endif
# 86 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

#define offsetof(t, d) __builtin_offsetof(t, d)

#endif /* __STDDEF_H */
# 90 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4

/* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
__WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
#if defined(__need_wint_t)
/* Always define wint_t when modules are available. */
#if !defined(_WINT_T) || __has_feature(modules)
#if !__has_feature(modules)
#define _WINT_T
#endif
# 99 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
typedef __WINT_TYPE__ wint_t;
#endif
# 101 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
#undef __need_wint_t
#endif /* __need_wint_t */
# 103 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 3 4
# 9 "/Users/luser/build/mozilla-central/gfx/gl/GLTypes.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/gfx/gl/GLTypes.h"

#ifndef GLAPIENTRY
# ifdef WIN32
#if 0 /* expanded by -frewrite-includes */
#  include <windef.h>
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/gfx/gl/GLTypes.h"
#  define GLAPIENTRY APIENTRY
#  define GLAPI
# else
# 17 "/Users/luser/build/mozilla-central/gfx/gl/GLTypes.h"
#  define GLAPIENTRY
#  define GLAPI
# endif
# 20 "/Users/luser/build/mozilla-central/gfx/gl/GLTypes.h"
#endif
# 21 "/Users/luser/build/mozilla-central/gfx/gl/GLTypes.h"

typedef int8_t realGLboolean;

#if !defined(__gltypes_h_) && !defined(__gl_h_)
#define __gltypes_h_
#define __gl_h_

typedef uint32_t GLenum;
typedef uint32_t GLbitfield;
typedef uint32_t GLuint;
typedef int32_t GLint;
typedef int32_t GLsizei;
typedef int8_t GLbyte;
typedef int16_t GLshort;
typedef uint8_t GLubyte;
typedef uint16_t GLushort;
typedef float GLfloat;
typedef float GLclampf;
#ifndef GLdouble_defined
typedef double GLdouble;
#endif
# 42 "/Users/luser/build/mozilla-central/gfx/gl/GLTypes.h"
typedef double GLclampd;
typedef void GLvoid;

typedef char GLchar;
#ifndef __gl2_h_
typedef intptr_t GLsizeiptr;
typedef intptr_t GLintptr;
#endif
# 50 "/Users/luser/build/mozilla-central/gfx/gl/GLTypes.h"

#endif /* #if !defined(__gltypes_h_) && !defined(__gl_h_) */
# 52 "/Users/luser/build/mozilla-central/gfx/gl/GLTypes.h"
#define LOCAL_GL_INT_VEC4                                    0x8B55
#define LOCAL_GL_INT_VEC4_ARB                                0x8B55
#define LOCAL_GL_INVALID_ENUM                                0x0500
#define LOCAL_GL_INVALID_FRAMEBUFFER_OPERATION               0x0506
#define LOCAL_GL_INVALID_FRAMEBUFFER_OPERATION_EXT           0x0506
#define LOCAL_GL_INVALID_FRAMEBUFFER_OPERATION_OES           0x0506
#define LOCAL_GL_INVALID_INDEX                               0xFFFFFFFF
#define LOCAL_GL_INVALID_OPERATION                           0x0502
#define LOCAL_GL_INVALID_VALUE                               0x0501
#define LOCAL_GL_INVARIANT_DATATYPE_EXT                      0x87EB
#define LOCAL_GL_INVARIANT_EXT                               0x87C2
#define LOCAL_GL_INVARIANT_VALUE_EXT                         0x87EA
#define LOCAL_GL_INVERSE_NV                                  0x862B
#define LOCAL_GL_INVERSE_TRANSPOSE_NV                        0x862D
#define LOCAL_GL_INVERT                                      0x150A
#define LOCAL_GL_INVERTED_SCREEN_W_REND                      0x8491
#define LOCAL_GL_OUTPUT_TEXTURE_COORD4_EXT                   0x87A1
#define LOCAL_GL_OUTPUT_TEXTURE_COORD5_EXT                   0x87A2
#define LOCAL_GL_OUTPUT_TEXTURE_COORD6_EXT                   0x87A3
#define LOCAL_GL_OUTPUT_TEXTURE_COORD7_EXT                   0x87A4
#define LOCAL_GL_OUTPUT_TEXTURE_COORD8_EXT                   0x87A5
#define LOCAL_GL_OUTPUT_TEXTURE_COORD9_EXT                   0x87A6
#define LOCAL_GL_OUTPUT_VERTEX_EXT                           0x879A
#define LOCAL_GL_OUT_OF_MEMORY                               0x0505
#define LOCAL_GL_OVERLAY_NV                                  0x9296
#define LOCAL_GL_RASTERIZER_DISCARD_NV                       0x8C89
#define LOCAL_GL_RASTER_POSITION_UNCLIPPED_IBM               0x19262
#define LOCAL_GL_READ_BUFFER                                 0x0C02
#define LOCAL_GL_READ_BUFFER_EXT                             0x0C02
#define LOCAL_GL_READ_BUFFER_NV                              0x0C02
#define LOCAL_GL_READ_FRAMEBUFFER                            0x8CA8
#define LOCAL_GL_READ_FRAMEBUFFER_ANGLE                      0x8CA8
#define LOCAL_GL_RG8UI                                       0x8238
#define LOCAL_GL_RG8_EXT                                     0x822B
#define LOCAL_GL_RG8_SNORM                                   0x8F95
#define LOCAL_GL_RGB                                         0x1907
#define LOCAL_GL_RGB10                                       0x8052
#define LOCAL_GL_RGB10_A2                                    0x8059
#define LOCAL_GL_RGB10_A2UI                                  0x906F
#define LOCAL_GL_RGB10_A2_EXT                                0x8059
#define LOCAL_GL_RGB10_EXT                                   0x8052
#define LOCAL_GL_RGB12                                       0x8053
#define LOCAL_GL_RGB12_EXT                                   0x8053
#define LOCAL_GL_RGB16                                       0x8054
#define LOCAL_GL_RGB16F                                      0x881B
#define LOCAL_GL_RGB16F_ARB                                  0x881B
#define LOCAL_GL_STACK_OVERFLOW                              0x0503
#define LOCAL_GL_STACK_OVERFLOW_KHR                          0x0503
#define LOCAL_GL_STACK_UNDERFLOW                             0x0504
#define LOCAL_GL_STACK_UNDERFLOW_KHR                         0x0504
#define LOCAL_GL_STANDARD_FONT_NAME_NV                       0x9072
#define LOCAL_GL_STATE_RESTORE                               0x8BDC
#define LOCAL_GL_STATIC_ATI                                  0x8760
#define LOCAL_GL_STATIC_COPY                                 0x88E6
#define LOCAL_GL_STATIC_COPY_ARB                             0x88E6
#define LOCAL_GL_STATIC_DRAW                                 0x88E4
#define LOCAL_GL_STATIC_DRAW_ARB                             0x88E4
#define LOCAL_GL_STATIC_READ                                 0x88E5
#define LOCAL_GL_STATIC_READ_ARB                             0x88E5
#define LOCAL_GL_STATIC_VERTEX_ARRAY_IBM                     103061
#define LOCAL_GL_STENCIL                                     0x1802
#define LOCAL_GL_STENCIL_ATTACHMENT                          0x8D20
#define LOCAL_GL_STENCIL_ATTACHMENT_EXT                      0x8D20
#define LOCAL_GL_STENCIL_ATTACHMENT_OES                      0x8D20
#define LOCAL_GL_TABLE_TOO_LARGE                             0x8031
#define LOCAL_GL_TABLE_TOO_LARGE_EXT                         0x8031
#define LOCAL_GL_TANGENT_ARRAY_EXT                           0x8439
#define LOCAL_GL_TANGENT_ARRAY_POINTER_EXT                   0x8442
#define LOCAL_GL_TANGENT_ARRAY_STRIDE_EXT                    0x843F
#define LOCAL_GL_TANGENT_ARRAY_TYPE_EXT                      0x843E
#define LOCAL_GL_TESSELLATION_FACTOR_AMD                     0x9005
#define LOCAL_GL_TESSELLATION_MODE_AMD                       0x9004
#define LOCAL_GL_TESS_CONTROL_OUTPUT_VERTICES                0x8E75
#define LOCAL_GL_TESS_CONTROL_PROGRAM_NV                     0x891E
#define LOCAL_GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV    0x8C74
#define LOCAL_GL_TESS_CONTROL_SHADER                         0x8E88
#define LOCAL_GL_TESS_CONTROL_SHADER_BIT                     0x00000008
#define LOCAL_GL_TESS_CONTROL_SUBROUTINE                     0x92E9
#define LOCAL_GL_TESS_CONTROL_SUBROUTINE_UNIFORM             0x92EF
#define LOCAL_GL_TESS_CONTROL_TEXTURE                        0x829C
#define LOCAL_GL_TEXTURE_COORD_ARRAY_TYPE_EXT                0x8089
#define LOCAL_GL_TEXTURE_COORD_NV                            0x8C79
#define LOCAL_GL_TEXTURE_COVERAGE_SAMPLES_NV                 0x9045
#define LOCAL_GL_TEXTURE_CROP_RECT_OES                       0x8B9D
#define LOCAL_GL_TEXTURE_CUBE_MAP                            0x8513
#define LOCAL_GL_TEXTURE_CUBE_MAP_ARB                        0x8513
#define LOCAL_GL_TEXTURE_CUBE_MAP_ARRAY                      0x9009
#define LOCAL_GL_TEXTURE_CUBE_MAP_ARRAY_ARB                  0x9009
#define LOCAL_GL_TEXTURE_CUBE_MAP_EXT                        0x8513
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X                 0x8516
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB             0x8516
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT             0x8516
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES             0x8516
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y                 0x8518
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB             0x8518
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT             0x8518
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES             0x8518
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z                 0x851A
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB             0x851A
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT             0x851A
#define LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES             0x851A
#define LOCAL_GL_TEXTURE_CUBE_MAP_OES                        0x8513
#define LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X                 0x8515
#define LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB             0x8515
#define LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT             0x8515
#define LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES             0x8515
#define LOCAL_GL_TEXTURE_INTERNAL_FORMAT                     0x1003
#define LOCAL_GL_TEXTURE_INTERNAL_FORMAT_QCOM                0x8BD5
#define LOCAL_GL_TEXTURE_LEQUAL_R_SGIX                       0x819C
#define LOCAL_GL_TEXTURE_LIGHTING_MODE_HP                    0x8167
#define LOCAL_GL_TEXTURE_LIGHT_EXT                           0x8350
#define LOCAL_GL_TEXTURE_LOD_BIAS                            0x8501
#define LOCAL_WGL_UNIQUE_ID_NV                               0x20CE
#define LOCAL_WGL_VIDEO_OUT_ALPHA_NV                         0x20C4
#define LOCAL_WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV               0x20C6
#define LOCAL_WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV               0x20C7
#define LOCAL_WGL_VIDEO_OUT_COLOR_NV                         0x20C3
#define LOCAL_WGL_VIDEO_OUT_DEPTH_NV                         0x20C5
#define LOCAL_WGL_VIDEO_OUT_FIELD_1                          0x20C9
#define LOCAL_WGL_VIDEO_OUT_FIELD_2                          0x20CA
#define LOCAL_WGL_VIDEO_OUT_FRAME                            0x20C8
#define LOCAL_WGL_VIDEO_OUT_STACKED_FIELDS_1_2               0x20CB
#define LOCAL_WGL_VIDEO_OUT_STACKED_FIELDS_2_1               0x20CC



#endif // GLCONSTS_H_
# 5960 "/Users/luser/build/mozilla-central/gfx/gl/GLConsts.h"
#define LOCAL_GL_CONTEXT_ROBUST_ACCESS_BIT_ARB          0x00000004


#define LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE         ((EGLNativeDisplayType)-2)
#define LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE              ((EGLNativeDisplayType)-3)

#endif
# 63 "/Users/luser/build/mozilla-central/gfx/gl/GLDefs.h"
# 38 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GLLibraryLoader.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLLibraryLoader.h" 1
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GLLIBRARYLOADER_H_
#define GLLIBRARYLOADER_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdio.h>
#endif /* expanded by -frewrite-includes */
# 9 "/Users/luser/build/mozilla-central/gfx/gl/GLLibraryLoader.h"

#ifdef WIN32
#if 0 /* expanded by -frewrite-includes */
#include <windows.h>
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/gfx/gl/GLLibraryLoader.h"
#endif
# 13 "/Users/luser/build/mozilla-central/gfx/gl/GLLibraryLoader.h"

#if 0 /* expanded by -frewrite-includes */
#include "GLDefs.h"
#endif /* expanded by -frewrite-includes */
# 15 "/Users/luser/build/mozilla-central/gfx/gl/GLLibraryLoader.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/gfx/gl/GLLibraryLoader.h"
#if 0 /* expanded by -frewrite-includes */
#include "prlink.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlink.h" 1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef prlink_h___
#define prlink_h___

/*
** API to static and dynamic linking.
*/
#if 0 /* expanded by -frewrite-includes */
#include "prtypes.h"
#endif /* expanded by -frewrite-includes */
# 13 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlink.h"

PR_BEGIN_EXTERN_C

typedef struct PRLibrary PRLibrary;

typedef struct PRStaticLinkTable {
    const char *name;
    void (*fp)(void);
} PRStaticLinkTable;

/*
** Change the default library path to the given string. The string is
** copied. This call will fail if it runs out of memory.
**
** The string provided as 'path' is copied. The caller can do whatever is
** convenient with the argument when the function is complete.
*/
NSPR_API(PRStatus) PR_SetLibraryPath(const char *path);

/*

/*
** Similar to PR_FindSymbol, except that the return value is a pointer to
** a function, and not a pointer to void. Casting between a data pointer
** and a function pointer is not portable according to the C standard.
** Any function pointer can be cast to any other function pointer.
**
** This function does not modify the reference count of the library.
*/
typedef void (*PRFuncPtr)(void);
NSPR_API(PRFuncPtr) PR_FindFunctionSymbol(PRLibrary *lib, const char *name);

/*
** Finds a symbol in one of the currently loaded libraries. Given the
** name of a procedure, return the address of the function that
** implements the procedure, and return the library that contains that
** symbol, or NULL if no such function can be found. This does not find
** symbols in the main program (the ".exe"); use PR_AddStaticLibrary to

/*
** Return the pathname of the file that the library "name" was loaded
** from. "addr" is the address of a function defined in the library.
**
** The caller is responsible for freeing the result with PR_Free.
*/
NSPR_API(char *) PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr);

PR_END_EXTERN_C

#endif /* prlink_h___ */
# 231 "/Users/luser/build/iphone-device-debug/dist/include/nspr/prlink.h"
# 17 "/Users/luser/build/mozilla-central/gfx/gl/GLLibraryLoader.h" 2

namespace mozilla {
namespace gl {

class GLLibraryLoader
{
public:
    ;

    typedef PRFuncPtr (GLAPIENTRY * PlatformLookupFunction) (const char *);

    enum {
        MAX_SYMBOL_NAMES = 6,
        MAX_SYMBOL_LENGTH = 128
    };

    PlatformLookupFunction mLookupFunc;
};

} /* namespace gl */
} /* namespace mozilla */

#endif /* GLLIBRARYLOADER_H_ */
# 68 "/Users/luser/build/mozilla-central/gfx/gl/GLLibraryLoader.h"
# 39 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISupportsImpl.h"
#endif /* expanded by -frewrite-includes */
# 40 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "plstr.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLContextTypes.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GLCONTEXT_TYPES_H_
#define GLCONTEXT_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include "GLTypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/gfx/gl/GLContextTypes.h"

namespace mozilla {
namespace gl {

class GLContext;

enum class GLContextType {
    Unknown,
    WGL,
    CGL,
    GLX,
    EGL
};

enum class OriginPos : uint8_t {
  TopLeft,
  BottomLeft
};

struct GLFormats
{
    // Constructs a zeroed object:
    ;

    GLenum color_texInternalFormat;
    GLenum color_texFormat;
    GLenum color_texType;
    GLenum color_rbFormat;

    GLenum depthStencil;
    GLenum depth;
    GLenum stencil;

    GLsizei samples;
};

} /* namespace gl */
} /* namespace mozilla */

#endif /* GLCONTEXT_TYPES_H_ */
# 50 "/Users/luser/build/mozilla-central/gfx/gl/GLContextTypes.h"
# 45 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GLTextureImage.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLTextureImage.h" 1
/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GLTEXTUREIMAGE_H_
#define GLTEXTUREIMAGE_H_

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/gfx/gl/GLTextureImage.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRegion.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/gfx/gl/GLTextureImage.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/gfx/gl/GLTextureImage.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/gfx/gl/GLTextureImage.h"

class gfxASurface;

namespace mozilla {
namespace gfx {
class DataSourceSurface;
class DrawTarget;
}
}

namespace mozilla {
namespace gl {
class GLContext;

/**
 * A TextureImage encapsulates a surface that can be drawn to by a
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    ;
    
    ;
    
    ;

protected:
    ;

    unsigned int mCurrentImage;
    BigImageIterationCallback mIterationCallback;
    void* mIterationCallbackData;
    nsTArray< nsRefPtr<TextureImage> > mImages;
    bool mInUpdate;
    gfx::IntSize mSize;
    unsigned int mTileSize;
    unsigned int mRows, mColumns;
  * crashy) behavior.
  */
;

} // namespace gl
} // namespace mozilla

#endif /* GLTEXTUREIMAGE_H_ */
# 405 "/Users/luser/build/mozilla-central/gfx/gl/GLTextureImage.h"
# 46 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SurfaceTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/SurfaceTypes.h" 1
/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef SURFACE_TYPES_H_
#define SURFACE_TYPES_H_

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/gfx/gl/SurfaceTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/gfx/gl/SurfaceTypes.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/gfx/gl/SurfaceTypes.h"

namespace mozilla {
namespace layers {
class ISurfaceAllocator;
}

namespace gl {

struct SurfaceCaps MOZ_FINAL
{
    bool any;
    bool color, alpha;
    bool bpp16;
    bool depth, stencil;
    bool antialias;
    bool premultAlpha;
    bool preserve;

    // The surface allocator that we want to create this
    
};

enum class SharedSurfaceType : uint8_t {
    Unknown = 0,

    Basic,
    GLTextureShare,
    EGLImageShare,
    EGLSurfaceANGLE,
    DXGLInterop,
    DXGLInterop2,
    Gralloc,
    IOSurface,

    Max
};

enum class AttachmentType : uint8_t {
    Screen = 0,

    GLTexture,
    GLRenderbuffer,

    Max
};

} /* namespace gfx */
} /* namespace mozilla */

#endif /* SURFACE_TYPES_H_ */
# 97 "/Users/luser/build/mozilla-central/gfx/gl/SurfaceTypes.h"
# 47 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GLScreenBuffer.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLScreenBuffer.h" 1
/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* GLScreenBuffer is the abstraction for the "default framebuffer" used
 * by an offscreen GLContext. Since it's only for offscreen GLContext's,
 * it's only useful for things like WebGL, and is NOT used by the
 * compositor's GLContext. Remember that GLContext provides an abstraction
 * so that even if you want to draw to the 'screen', even if that's not
 * actually the screen, just draw to 0. This GLScreenBuffer class takes the
 * logic handling out of GLContext.
*/

#ifndef SCREEN_BUFFER_H_
#define SCREEN_BUFFER_H_

#if 0 /* expanded by -frewrite-includes */
#include "GLContextTypes.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/gfx/gl/GLScreenBuffer.h"
#if 0 /* expanded by -frewrite-includes */
#include "GLDefs.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/gfx/gl/GLScreenBuffer.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 21 "/Users/luser/build/mozilla-central/gfx/gl/GLScreenBuffer.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Point.h"
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/mozilla-central/gfx/gl/GLScreenBuffer.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/gfx/gl/GLScreenBuffer.h"
#if 0 /* expanded by -frewrite-includes */
#include "SharedSurface.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/SharedSurface.h" 1
/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

/* SharedSurface abstracts an actual surface (can be a GL texture, but
 * not necessarily) that handles sharing.
 * Its specializations are:
 *     SharedSurface_Basic (client-side bitmap, does readback)
 *     SharedSurface_GLTexture
 *     SharedSurface_EGLImage
 *     SharedSurface_ANGLEShareHandle
 */

#ifndef SHARED_SURFACE_H_
#define SHARED_SURFACE_H_

#if 0 /* expanded by -frewrite-includes */
#include <queue>
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/gfx/gl/SharedSurface.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/gfx/gl/SharedSurface.h"

#if 0 /* expanded by -frewrite-includes */
#include "GLContextTypes.h"
#endif /* expanded by -frewrite-includes */
# 22 "/Users/luser/build/mozilla-central/gfx/gl/SharedSurface.h"
#if 0 /* expanded by -frewrite-includes */
#include "GLDefs.h"
#endif /* expanded by -frewrite-includes */
# 23 "/Users/luser/build/mozilla-central/gfx/gl/SharedSurface.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/WeakPtr.h"
#endif /* expanded by -frewrite-includes */
# 28 "/Users/luser/build/mozilla-central/gfx/gl/SharedSurface.h"
#if 0 /* expanded by -frewrite-includes */
#include "ScopedGLHelpers.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/ScopedGLHelpers.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef SCOPEDGLHELPERS_H_
#define SCOPEDGLHELPERS_H_

#if 0 /* expanded by -frewrite-includes */
#include "GLDefs.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/gfx/gl/ScopedGLHelpers.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/UniquePtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/gfx/gl/ScopedGLHelpers.h"

namespace mozilla {
namespace gl {

class GLContext;

#ifdef DEBUG
bool IsContextCurrent(GLContext* gl);
#endif
# 20 "/Users/luser/build/mozilla-central/gfx/gl/ScopedGLHelpers.h"

//RAII via CRTP!
template <class Derived>
struct ScopedGLWrapper
{
private:
    bool mIsUnwrapped;

protected:
    GLContext* const mGL;

    

    
    // Use |newState = true| to enable, |false| to disable.
    ;
    // variant that doesn't change state; simply records existing state to be
    // restored by the destructor
    ;

protected:
    ;
};

// Saves and restores with GetUserBoundFB and BindUserFB.
struct ScopedBindFramebuffer
    : public ScopedGLWrapper<ScopedBindFramebuffer>
{
    friend struct ScopedGLWrapper<ScopedBindFramebuffer>;

protected:
    GLuint mOldReadFB;
    GLuint mOldDrawFB;

private:
    ;

public:
    ;
    ;

protected:
    ;
};

struct ScopedBindTextureUnit
    : public ScopedGLWrapper<ScopedBindTextureUnit>
{
    friend struct ScopedGLWrapper<ScopedBindTextureUnit>;

protected:
    GLenum mOldTexUnit;

public:
    ;

protected:
    ;
};


struct ScopedTexture
    : public ScopedGLWrapper<ScopedTexture>
{
    friend struct ScopedGLWrapper<ScopedTexture>;

protected:
    GLuint mTexture;

public:
    ;
    

protected:
    ;
};


struct ScopedFramebuffer
    : public ScopedGLWrapper<ScopedFramebuffer>
{
    friend struct ScopedGLWrapper<ScopedFramebuffer>;

    GLuint maxAttrib;
    UniquePtr<GLint[]> attrib_enabled;
    GLint attrib0_size;
    GLint attrib0_stride;
    GLint attrib0_type;
    GLint attrib0_normalized;
    GLint attrib0_bufferBinding;
    void* attrib0_pointer;

    realGLboolean colorMask[4];
    GLint viewport[4];
protected:
    ;
};
} /* namespace gl */
} /* namespace mozilla */

#endif /* SCOPEDGLHELPERS_H_ */
# 365 "/Users/luser/build/mozilla-central/gfx/gl/ScopedGLHelpers.h"
# 29 "/Users/luser/build/mozilla-central/gfx/gl/SharedSurface.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SurfaceTypes.h"
#endif /* expanded by -frewrite-includes */
# 30 "/Users/luser/build/mozilla-central/gfx/gl/SharedSurface.h"

class nsIThread;

namespace mozilla {
namespace gfx {
class DrawTarget;
}
namespace gl {

class GLContext;
class SurfaceFactory;
class ShSurfHandle;

class SharedSurface
{
public:
    ;

    const SharedSurfaceType mType;
};

;
;

} // namespace gl
} // namespace mozilla

#endif // SHARED_SURFACE_H_
# 298 "/Users/luser/build/mozilla-central/gfx/gl/SharedSurface.h"
# 24 "/Users/luser/build/mozilla-central/gfx/gl/GLScreenBuffer.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SurfaceTypes.h"
#endif /* expanded by -frewrite-includes */
# 25 "/Users/luser/build/mozilla-central/gfx/gl/GLScreenBuffer.h"

namespace mozilla {
namespace gl {

class GLContext;
class SharedSurface;
class ShSurfHandle;
class SurfaceFactory;

class DrawBuffer
{
public:
    // Fallible!
    // But it may return true with *out_buffer==nullptr if unneeded.
    ;

protected:
    GLContext* const mGL;
public:
    const gfx::IntSize mSize;
    const GLsizei mSamples;
    const GLuint mFB;
protected:
    const GLuint mColorMSRB;
    const GLuint mDepthRB;
    const GLuint mStencilRB;

    

public:
    ;
};

class ReadBuffer
{
public:
    // Infallible, always non-null.
    ;

protected:
    GLContext* const mGL;
public:
    const GLuint mFB;
protected:
    // mFB has the following attachments:
    const GLuint mDepthRB;
    const GLuint mStencilRB;
    // note no mColorRB here: this is provided by mSurf.
    SharedSurface* mSurf;

    

public:
    ;

    // Cannot attach a surf of a different AttachType or Size than before.
    ;

    ;

    

    ;
};


class GLScreenBuffer
{
public:
    // Infallible.
    ;

protected:
    GLContext* const mGL; // Owns us.
public:
    const SurfaceCaps mCaps;
protected:
    UniquePtr<SurfaceFactory> mFactory;

    RefPtr<ShSurfHandle> mBack;
    RefPtr<ShSurfHandle> mFront;

    UniquePtr<DrawBuffer> mDraw;
    UniquePtr<ReadBuffer> mRead;

    bool mNeedsBlit;

    GLenum mUserReadBufferMode;

    // Below are the parts that help us pretend to be framebuffer 0:
    GLuint mUserDrawFB;
    GLuint mUserReadFB;
    GLuint mInternalDrawFB;
    GLuint mInternalReadFB;

#ifdef DEBUG
    bool mInInternalMode_DrawFB;
    bool mInInternalMode_ReadFB;
#endif
# 159 "/Users/luser/build/mozilla-central/gfx/gl/GLScreenBuffer.h"

    

public:
    ;

    

    

    

    

    

    

    

    ;

    

    ;

    ;
    ;
    void AfterDrawCall();
    ;

    ;
    ;
};

}   // namespace gl
}   // namespace mozilla

#endif  // SCREEN_BUFFER_H_
# 288 "/Users/luser/build/mozilla-central/gfx/gl/GLScreenBuffer.h"
# 48 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GLContextSymbols.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLContextSymbols.h" 1
/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GLCONTEXTSYMBOLS_H_
#define GLCONTEXTSYMBOLS_H_

#if 0 /* expanded by -frewrite-includes */
#include "GLDefs.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/gfx/gl/GLContextSymbols.h"

/*
 * This file should only be included by GLContext.h, and should be
 * autogenerated in the future.
 */

#ifndef GLAPIENTRY
#ifdef XP_WIN
#define GLAPIENTRY __stdcall
#else
# 20 "/Users/luser/build/mozilla-central/gfx/gl/GLContextSymbols.h"
#define GLAPIENTRY
#endif
# 22 "/Users/luser/build/mozilla-central/gfx/gl/GLContextSymbols.h"
#define GLAPI
#endif
# 24 "/Users/luser/build/mozilla-central/gfx/gl/GLContextSymbols.h"

namespace mozilla {
namespace gl {

struct GLContextSymbols
{
    

    

    typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture);
    PFNGLACTIVETEXTUREPROC fActiveTexture;
    typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
    PFNGLATTACHSHADERPROC fAttachShader;
    typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
    PFNGLBEGINQUERYPROC fBeginQuery;
    typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name);
    PFNGLBINDATTRIBLOCATIONPROC fBindAttribLocation;
    typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
    PFNGLBINDBUFFERPROC fBindBuffer;
    typedef void (GLAPIENTRY * PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
    PFNGLBINDTEXTUREPROC fBindTexture;
    typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array);
    PFNGLBINDVERTEXARRAYPROC fBindVertexArray;
    typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
    PFNGLBLENDCOLORPROC fBlendColor;
    typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode);
    PFNGLBLENDEQUATIONPROC fBlendEquation;
    typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum);
    PFNGLBLENDEQUATIONSEPARATEPROC fBlendEquationSeparate;
    typedef void (GLAPIENTRY * PFNGLBLENDFUNCPROC) (GLenum, GLenum);
    PFNGLBLENDFUNCPROC fBlendFunc;
    typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
    PFNGLBLENDFUNCSEPARATEPROC fBlendFuncSeparate;
    typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
    PFNGLBUFFERDATAPROC fBufferData;
    typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
    PFNGLBUFFERSUBDATAPROC fBufferSubData;
    typedef void (GLAPIENTRY * PFNGLCLEARPROC) (GLbitfield);
    PFNGLCLEARPROC fClear;
    typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
    PFNGLCLEARBUFFERFIPROC fClearBufferfi;
    typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum buffer, GLint drawbuffer, const GLfloat* value);
    PFNGLCLEARBUFFERFVPROC fClearBufferfv;
    typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum buffer, GLint drawbuffer, const GLint* value);
    PFNGLCLEARBUFFERIVPROC fClearBufferiv;
    typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum buffer, GLint drawbuffer, const GLuint* value);
    PFNGLCLEARBUFFERUIVPROC fClearBufferuiv;
    typedef void (GLAPIENTRY * PFNGLCLEARCOLORPROC) (GLfloat, GLfloat, GLfloat, GLfloat);
    PFNGLCLEARCOLORPROC fClearColor;
    typedef void (GLAPIENTRY * PFNGLCLEARSTENCILPROC) (GLint);
    typedef void (GLAPIENTRY * PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params);
    PFNGLGETINTEGERVPROC fGetIntegerv;
    typedef void (GLAPIENTRY * PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *params);
    PFNGLGETFLOATVPROC fGetFloatv;
    typedef void (GLAPIENTRY * PFNGLGETBOOLEANBPROC) (GLenum pname, realGLboolean *params);
    PFNGLGETBOOLEANBPROC fGetBooleanv;
    typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params);
    PFNGLGETBUFFERPARAMETERIVPROC fGetBufferParameteriv;
    typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target);
    PFNGLGENERATEMIPMAPPROC fGenerateMipmap;
    typedef GLenum (GLAPIENTRY * PFNGLGETERRORPROC) (void);
    PFNGLGETERRORPROC fGetError;
    typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param);
    PFNGLGETPROGRAMIVPROC fGetProgramiv;
    typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
    PFNGLGETPROGRAMINFOLOGPROC fGetProgramInfoLog;
    typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params);
    PFNGLGETQUERYIVPROC fGetQueryiv;
    typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params);
    PFNGLGETQUERYOBJECTIVPROC fGetQueryObjectiv;
    typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params);
    PFNGLGETQUERYOBJECTUIVPROC fGetQueryObjectuiv;
    typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
    PFNGLTEXPARAMETERIPROC fTexParameteri;
    typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint* param);
    PFNGLTEXPARAMETERIVPROC fTexParameteriv;
    typedef void (GLAPIENTRY * PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
    PFNGLTEXPARAMETERFPROC fTexParameterf;
    typedef GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum);
    PFNGLGETSTRINGPROC fGetString;
    typedef void (GLAPIENTRY * PFNGLGETTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLvoid* image);
    PFNGLGETTEXIMAGEPROC fGetTexImage;
    typedef void (GLAPIENTRY * PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
    PFNGLSTENCILFUNCPROC fStencilFunc;
    typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
    PFNGLSTENCILFUNCSEPARATEPROC fStencilFuncSeparate;
    typedef void (GLAPIENTRY * PFNGLSTENCILMASKPROC) (GLuint mask);
    PFNGLSTENCILMASKPROC fStencilMask;
    typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint);
    PFNGLSTENCILMASKSEPARATEPROC fStencilMaskSeparate;
    typedef void (GLAPIENTRY * PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
    PFNGLSTENCILOPPROC fStencilOp;
    typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
    PFNGLSTENCILOPSEPARATEPROC fStencilOpSeparate;
    typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
    PFNGLTEXIMAGE2DPROC fTexImage2D;
    typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
    PFNGLTEXSUBIMAGE2DPROC fTexSubImage2D;
    typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
    PFNGLUNIFORMMATRIX4X2FVPROC fUniformMatrix4x2fv;
    typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, realGLboolean transpose, const GLfloat* value);
    PFNGLUNIFORMMATRIX4X3FVPROC fUniformMatrix4x3fv;

    typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program);
    PFNGLUSEPROGRAMPROC fUseProgram;
    typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program);
    PFNGLVALIDATEPROGRAMPROC fValidateProgram;
    typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, realGLboolean normalized, GLsizei stride, const GLvoid* pointer);
    PFNGLVERTEXATTRIBPOINTERPROC fVertexAttribPointer;
    typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
    PFNGLVERTEXATTRIB1FPROC fVertexAttrib1f;
    typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
    PFNGLVERTEXATTRIB2FPROC fVertexAttrib2f;
    typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
    PFNGLVERTEXATTRIB3FPROC fVertexAttrib3f;
    typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
    PFNGLVERTEXATTRIB4FPROC fVertexAttrib4f;
    typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v);
    PFNGLVERTEXATTRIB1FVPROC fVertexAttrib1fv;
    typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v);
    PFNGLVERTEXATTRIB2FVPROC fVertexAttrib2fv;
    typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v);
    PFNGLVERTEXATTRIB3FVPROC fVertexAttrib3fv;
    typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v);
    PFNGLVERTEXATTRIB4FVPROC fVertexAttrib4fv;
    typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader);
    PFNGLCOMPILESHADERPROC fCompileShader;
    typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
    PFNGLCOPYTEXIMAGE2DPROC fCopyTexImage2D;
    typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
    typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUS) (GLenum target);
    PFNGLCHECKFRAMEBUFFERSTATUS fCheckFramebufferStatus;
    typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFER) (GLenum target, GLenum attachmentPoint, GLenum renderbufferTarget, GLuint renderbuffer);
    PFNGLFRAMEBUFFERRENDERBUFFER fFramebufferRenderbuffer;
    typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2D) (GLenum target, GLenum attachmentPoint, GLenum textureTarget, GLuint texture, GLint level);
    PFNGLFRAMEBUFFERTEXTURE2D fFramebufferTexture2D;
    typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIV) (GLenum target, GLenum attachment, GLenum pname, GLint* value);
    PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIV fGetFramebufferAttachmentParameteriv;
    typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIV) (GLenum target, GLenum pname, GLint* value);
    PFNGLGETRENDERBUFFERPARAMETERIV fGetRenderbufferParameteriv;
    typedef realGLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFER) (GLuint framebuffer);
    PFNGLISFRAMEBUFFER fIsFramebuffer;
    typedef realGLboolean (GLAPIENTRY * PFNGLISRENDERBUFFER) (GLuint renderbuffer);
        typedef void (GLAPIENTRY * PFNTEXGENFV) (GLenum coord, GLenum pname, const GLfloat* param);
        PFNTEXGENFV fTexGenfv;
        typedef void (GLAPIENTRY * PFNVERTEXPOINTER) (GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
    typedef void (GLAPIENTRY * PFNGLDEPTHRANGEPROC) (GLclampd, GLclampd);
    PFNGLDEPTHRANGEPROC fDepthRange;
    typedef void (GLAPIENTRY * PFNGLCLEARDEPTHPROC) (GLclampd);
    PFNGLCLEARDEPTHPROC fClearDepth;

    /* These are special because we end up tracking these so that we don't
     * have to query the values from GL.
     */

    typedef void (GLAPIENTRY * PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
    PFNGLVIEWPORTPROC fViewport;
    typedef void (GLAPIENTRY * PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
    PFNGLSCISSORPROC fScissor;


    /* These are special -- they create or delete GL resources that can live
     * in a shared namespace.  In DEBUG, we wrap these calls so that we can
     * check when we have something that failed to do cleanup at the time the
     * final context is destroyed.
     */

    typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void);
    PFNGLCREATEPROGRAMPROC fCreateProgram;
    typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type);
    PFNGLCREATESHADERPROC fCreateShader;
    typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers);
    PFNGLGENBUFFERSPROC fGenBuffers;
    typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* queries);
    PFNGLGENQUERIESPROC fGenQueries;
    typedef void (GLAPIENTRY * PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
    PFNGLGENTEXTURESPROC fGenTextures;
    typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERS) (GLsizei n, GLuint* ids);
    PFNGLGENFRAMEBUFFERS fGenFramebuffers;
    typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERS) (GLsizei n, GLuint* ids);
    PFNGLGENRENDERBUFFERS fGenRenderbuffers;
    typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYS) (GLsizei n, GLuint* arrays);
    PFNGLGENVERTEXARRAYS fGenVertexArrays;

    typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program);
    PFNGLDELETEPROGRAMPROC fDeleteProgram;
    typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader);
    PFNGLDELETESHADERPROC fDeleteShader;
    typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers);
    PFNGLDELETEBUFFERSPROC fDeleteBuffers;
    typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* queries);
    PFNGLDELETEQUERIESPROC fDeleteQueries;
    typedef void (GLAPIENTRY * PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint* textures);
    PFNGLDELETETEXTURESPROC fDeleteTextures;

    // 3D Textures
    typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level,
                                                     GLenum internalFormat,
                                                     GLenum width, GLsizei height, GLsizei depth,
                                                     GLint border, GLenum format, GLenum type,
                                                     const GLvoid* pixels);
    PFNGLTEXIMAGE3DPROC fTexImage3D;
    typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset,
                                                        GLint yoffset, GLint zoffset, GLsizei width,
                                                        GLsizei height, GLsizei depth, GLenum format,
                                                        GLenum type, const GLvoid* pixels);
    PFNGLTEXSUBIMAGE3DPROC fTexSubImage3D;
    typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset,
                                                            GLint yoffset, GLint zoffset, GLint x,
                                                            GLint y, GLsizei width, GLsizei height);
    PFNGLCOPYTEXSUBIMAGE3DPROC fCopyTexSubImage3D;
    typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3D) (GLenum target, GLint level, GLenum internalformat,
                                                           GLsizei width, GLsizei height, GLsizei depth,
                                                           GLint border, GLsizei imageSize, const GLvoid* data);
    PFNGLCOMPRESSEDTEXIMAGE3D fCompressedTexImage3D;
    typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3D) (GLenum target, GLint level,
                                                              GLint xoffset, GLint yoffset, GLint zoffset,
                                                              GLsizei width, GLsizei height, GLsizei depth,
                                                              GLenum format, GLsizei imageSize, const GLvoid* data);
    PFNGLCOMPRESSEDTEXSUBIMAGE3D fCompressedTexSubImage3D;

    // get_string_indexed
    typedef const GLubyte* (GLAPIENTRY * pfnGLGetStringiT)(GLenum name, GLuint index);
    pfnGLGetStringiT fGetStringi;
};

}
}

#endif /* GLCONTEXTSYMBOLS_H_ */
# 679 "/Users/luser/build/mozilla-central/gfx/gl/GLContextSymbols.h"
# 49 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "base/platform_thread.h"       // for PlatformThreadId
#endif /* expanded by -frewrite-includes */
# 50 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/GenericRefCounted.h"
#endif /* expanded by -frewrite-includes */
# 51 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "gfx2DGlue.h"
#endif /* expanded by -frewrite-includes */
# 52 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "GeckoProfiler.h"
#endif /* expanded by -frewrite-includes */
# 53 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"

class nsIntRegion;
class nsIRunnable;
class nsIThread;

namespace android {
    class GraphicBuffer;
}

namespace mozilla {
    namespace gfx {
        class DataSourceSurface;
        class SourceSurface;
    }

    namespace gl {
        class GLContext;
        class GLLibraryEGL;
        class GLScreenBuffer;
        class TextureGarbageBin;
        class GLBlitHelper;
        class GLBlitTextureImageHelper;
        class GLReadTexImageHelper;
        struct SurfaceCaps;
    }

    namespace layers {
        class ColorTextureLayerProgram;
    }
}

namespace mozilla {
namespace gl {

enum class GLFeature {
    bind_buffer_offset,
    blend_minmax,
    clear_buffers,
    copy_buffer,
    depth_texture,
    draw_buffers,
    draw_instanced,
    texture_3D_copy,
    texture_float,
    texture_float_linear,
    texture_half_float,
    texture_half_float_linear,
    texture_non_power_of_two,
    texture_storage,
    transform_feedback2,
    uniform_buffer_object,
    uniform_matrix_nonsquare,
    vertex_array_object,
    EnumMax
};

enum class ContextProfile : uint8_t {
    Unknown = 0,
    OpenGL, // only for IsAtLeast's <profile> parameter
    OpenGLCore,
    OpenGLCompatibility,
    OpenGLES
};

enum class GLVendor {
    Intel,
    NVIDIA,
    ATI,
    Qualcomm,
    Imagination,
    Nouveau,
    Vivante,
    VMware,
    ARM,
    Other
};

enum class GLRenderer {
    Adreno200,
    Adreno205,
    AdrenoTM200,
    AdrenoTM205,
    AdrenoTM320,
    SGX530,
    SGX540,
    Tegra,
    AndroidEmulator,
    GalliumLlvmpipe,
    IntelHD3000,
    MicrosoftBasicRenderDriver,
    Other
};

class GLContext
    : public GLLibraryLoader
    , public GenericAtomicRefCounted
{
// -----------------------------------------------------------------------------
// basic enums
public:

// -----------------------------------------------------------------------------
// basic getters
public:

    /**

    GLVendor Vendor() const {
        return mVendor;
    }

    

    

    /**
     * If this context is double-buffered, returns TRUE.
     */
    

    virtual GLContextType GetContextType() const = 0;

    virtual bool IsCurrent() = 0;

protected:
    bool mInitialized;
    bool mIsOffscreen;
    bool mIsGlobalSharedContext;
    bool mContextLost;

    /**
     * mVersion store the OpenGL's version, multiplied by 100. For example, if
     * the context is an OpenGL 2.1 context, mVersion value will be 210.
     */
    uint32_t mVersion;
    nsCString mVersionString;
    ContextProfile mProfile;

    static const char* GLErrorToString(GLenum aError) {
        switch (aError) {
            case LOCAL_GL_INVALID_ENUM:
                return "GL_INVALID_ENUM";
            case LOCAL_GL_INVALID_VALUE:
                return "GL_INVALID_VALUE";
            case LOCAL_GL_INVALID_OPERATION:
                return "GL_INVALID_OPERATION";
            case LOCAL_GL_STACK_OVERFLOW:
                return "GL_STACK_OVERFLOW";
            case LOCAL_GL_STACK_UNDERFLOW:
                return "GL_STACK_UNDERFLOW";
            case LOCAL_GL_OUT_OF_MEMORY:
                return "GL_OUT_OF_MEMORY";
            case LOCAL_GL_TABLE_TOO_LARGE:
                return "GL_TABLE_TOO_LARGE";
            case LOCAL_GL_INVALID_FRAMEBUFFER_OPERATION:
                return "GL_INVALID_FRAMEBUFFER_OPERATION";
            default:
                return "";
        }
    }

private:
    GLenum mTopError;

    GLenum RawGetError() {
        return mSymbols.fGetError();
    }

    GLenum RawGetErrorAndClear() {
        GLenum err = RawGetError();

        if (err)
            while (RawGetError()) {}

        return err;
    }

public:
    GLenum FlushErrors() {
        GLenum err = RawGetErrorAndClear();
        if (!mTopError)
            mTopError = err;
        return err;
    }

    

private:
    ;
    ;


// -----------------------------------------------------------------------------
// MOZ_GL_DEBUG implementation
private:

#undef BEFORE_GL_CALL
#undef AFTER_GL_CALL

#ifdef MOZ_GL_DEBUG

#ifndef MOZ_FUNCTION_NAME
# ifdef __GNUC__
#  define MOZ_FUNCTION_NAME __PRETTY_FUNCTION__
# elif defined(_MSC_VER)
# 669 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#  define MOZ_FUNCTION_NAME __FUNCTION__
# else
# 671 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#  define MOZ_FUNCTION_NAME __func__  // defined in C99, supported in various C++ compilers. Just raw function name.
# endif
# 673 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#endif
# 674 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"


            if (err != LOCAL_GL_NO_ERROR &&
                !mLocalErrorScope)
        return tip;
    }

    static void AssertNotPassingStackBufferToTheGL(const void* ptr);

#ifdef MOZ_WIDGET_ANDROID
// Record the name of the GL call for better hang stacks on Android.
#define BEFORE_GL_CALL                              \
            PROFILER_LABEL_FUNC(                    \
              js::ProfileEntry::Category::GRAPHICS);\
            BeforeGLCall(MOZ_FUNCTION_NAME)
#else
# 737 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#define BEFORE_GL_CALL                              \
            do {                                    \
                BeforeGLCall(MOZ_FUNCTION_NAME);    \
            } while (0)
#endif
# 742 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"

#define AFTER_GL_CALL                               \
            do {                                    \
                AfterGLCall(MOZ_FUNCTION_NAME);     \
            } while (0)

#define TRACKING_CONTEXT(a)                         \
            do {                                    \
                TrackingContext()->a;               \
            } while (0)

#define ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(ptr) AssertNotPassingStackBufferToTheGL(ptr)

#else // ifdef MOZ_GL_DEBUG
# 756 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"

#ifdef MOZ_WIDGET_ANDROID
// Record the name of the GL call for better hang stacks on Android.
#define BEFORE_GL_CALL PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS)
#else
# 761 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#define BEFORE_GL_CALL do { } while (0)
#endif
# 763 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#define AFTER_GL_CALL do { } while (0)
#define TRACKING_CONTEXT(a) do {} while (0)
#define ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(ptr) do {} while (0)

#endif // ifdef MOZ_GL_DEBUG

    

    

    

    

    

private:
    void raw_fBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage) {
        ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(data);
        BEFORE_GL_CALL;
        mSymbols.fBufferData(target, size, data, usage);
        AFTER_GL_CALL;
        mHeavyGLCallsSinceLastFlush = true;
    }


public:
    

    

    

    

    

    

    

    

    

    

    

    

    void fTexParameteri(GLenum target, GLenum pname, GLint param) {
        BEFORE_GL_CALL;
        mSymbols.fTexParameteri(target, pname, param);
        AFTER_GL_CALL;
    }

    

    

    

    

public:
    

    

    

private:
    void raw_fTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
        ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(pixels);
        BEFORE_GL_CALL;
        mSymbols.fTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
        AFTER_GL_CALL;
        mHeavyGLCallsSinceLastFlush = true;
    }

public:
    void fTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels) {
        if (!IsTextureSizeSafeToPassToDriver(target, width, height)) {
            // pass wrong values to cause the GL to generate GL_INVALID_VALUE.
            // See bug 737182 and the comment in IsTextureSizeSafeToPassToDriver.
            level = -1;
            width = -1;
            height = -1;
            border = -1;
        }
        raw_fTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
    }

    

    

    

    

    

    


    

    void raw_fGenTextures(GLsizei n, GLuint* names) {
        BEFORE_GL_CALL;
        mSymbols.fGenTextures(n, names);
        AFTER_GL_CALL;
    }

public:
    

    

    

    

    

    void raw_fDeleteTextures(GLsizei n, const GLuint* names) {
        BEFORE_GL_CALL;
        mSymbols.fDeleteTextures(n, names);
        AFTER_GL_CALL;
    }

public:
    


// -----------------------------------------------------------------------------
// Everything that isn't standard GL APIs
protected:
    typedef gfx::SurfaceFormat SurfaceFormat;

    virtual bool MakeCurrentImpl(bool aForce) = 0;

public:
#ifdef MOZ_GL_DEBUG
    static void StaticInit() {
        PR_NewThreadPrivateIndex(&sCurrentGLContextTLS, nullptr);
    }
#endif
# 3196 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"

    bool MakeCurrent(bool aForce = false) {
        if (IsDestroyed()) {
            return false;
        }
#ifdef MOZ_GL_DEBUG
    PR_SetThreadPrivate(sCurrentGLContextTLS, this);

    // XXX this assertion is disabled because it's triggering on Mac;
    // we need to figure out why and reenable it.
#if 0
        // IsOwningThreadCurrent is a bit of a misnomer;
        // the "owning thread" is the creation thread,
        // and the only thread that can own this.  We don't
        // support contexts used on multiple threads.
        NS_ASSERTION(IsOwningThreadCurrent(),
                     "MakeCurrent() called on different thread than this context was created on!");
#endif
# 3214 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
#endif
# 3215 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
        return MakeCurrentImpl(aForce);
    }

    ;

    ;

    

    bool IsDestroyed() {
        // MarkDestroyed will mark all these as null.
        return mSymbols.fUseProgram == nullptr;
    }

    

    /**
     * Returns true if the thread on which this context was created is the currently
     * executing thread.
     */
    ;

    ;

public:
    /**
     * If this context wraps a double-buffered target, swap the back
     */
    ;

    

    

    

    

    

    

    GLint GetMaxTextureImageSize() { return mMaxTextureImageSize; }

public:
    std::map<GLuint, SharedSurface*> mFBOMapping;

    enum {
        DebugEnabled = 1 << 0,
        DebugTrace = 1 << 1,
        DebugAbortOnError = 1 << 2
    };

    static uint32_t sDebugMode;

    static uint32_t DebugMode() {
#ifdef MOZ_GL_DEBUG
        return sDebugMode;
#else
# 3379 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
        return 0;
#endif
# 3381 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
    }

protected:
    nsRefPtr<GLContext> mSharedContext;

    // The thread id which this context was created.
    PlatformThreadId mOwningThreadId;

    GLContextSymbols mSymbols;

#ifdef MOZ_GL_DEBUG
    // GLDebugMode will check that we don't send call
    // to a GLContext that isn't current on the current
    // thread.
    // Store the current context when binding to thread local
    // storage to support DebugMode on an arbitrary thread.
    static unsigned sCurrentGLContextTLS;
#endif
# 3399 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"

    UniquePtr<GLBlitHelper> mBlitHelper;
    UniquePtr<GLReadTexImageHelper> mReadTexImageHelper;

public:
    GLBlitHelper* BlitHelper();
    ;
    ;

    GLint mViewportRect[4];
    GLint mScissorRect[4];

    GLint mMaxTextureSize;
    GLint mMaxCubeMapTextureSize;
    GLint mMaxTextureImageSize;
    GLint mMaxRenderbufferSize;
    GLint mMaxViewportDims[2];
    GLsizei mMaxSamples;
    bool mNeedsTextureSizeChecks;
    bool mWorkAroundDriverBugs;

    bool IsTextureSizeSafeToPassToDriver(GLenum target, GLsizei width, GLsizei height) const {
        if (mNeedsTextureSizeChecks) {
            // some drivers incorrectly handle some large texture sizes that are below the
            // max texture size that they report. So we check ourselves against our own values
            // (mMax[CubeMap]TextureSize).
            // see bug 737182 for Mac Intel 2D textures
            // see bug 684882 for Mac Intel cube map textures
            // see bug 814716 for Mesa Nouveau
            GLsizei maxSize = target == LOCAL_GL_TEXTURE_CUBE_MAP ||
                                (target >= LOCAL_GL_TEXTURE_CUBE_MAP_POSITIVE_X &&
                                target <= LOCAL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z)
                              ? mMaxCubeMapTextureSize
                              : mMaxTextureSize;
            return width <= maxSize && height <= maxSize;
        }
        return true;
    }


public:
    

    

#undef ASSERT_SYMBOL_PRESENT

#ifdef MOZ_GL_DEBUG
    void CreatedProgram(GLContext *aOrigin, GLuint aName);
    void CreatedShader(GLContext *aOrigin, GLuint aName);
    void CreatedBuffers(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
    void CreatedQueries(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
    void CreatedTextures(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
    void CreatedFramebuffers(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
    void CreatedRenderbuffers(GLContext *aOrigin, GLsizei aCount, GLuint *aNames);
    void DeletedProgram(GLContext *aOrigin, GLuint aName);
    void DeletedShader(GLContext *aOrigin, GLuint aName);
    void DeletedBuffers(GLContext *aOrigin, GLsizei aCount, const GLuint *aNames);
    void DeletedQueries(GLContext *aOrigin, GLsizei aCount, const GLuint *aNames);
    void DeletedTextures(GLContext *aOrigin, GLsizei aCount, const GLuint *aNames);
    void DeletedFramebuffers(GLContext *aOrigin, GLsizei aCount, const GLuint *aNames);
    void DeletedRenderbuffers(GLContext *aOrigin, GLsizei aCount, const GLuint *aNames);

    void SharedContextDestroyed(GLContext *aChild);
    void ReportOutstandingNames();

    struct NamedResource {
    nsTArray<NamedResource> mTrackedRenderbuffers;
    nsTArray<NamedResource> mTrackedBuffers;
    nsTArray<NamedResource> mTrackedQueries;
#endif
# 3662 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"


protected:
    bool mHeavyGLCallsSinceLastFlush;

public:
    void FlushIfHeavyGLCallsSinceLastFlush();
    ;
    ;
    ;
};

;

;





} /* namespace gl */
} /* namespace mozilla */

#endif /* GLCONTEXT_H_ */
# 3712 "/Users/luser/build/mozilla-central/gfx/gl/GLContext.h"
# 107 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "GLContextProvider.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GLCONTEXTPROVIDER_H_
#define GLCONTEXTPROVIDER_H_

#if 0 /* expanded by -frewrite-includes */
#include "GLContextTypes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h"
#if 0 /* expanded by -frewrite-includes */
#include "SurfaceTypes.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h" // for gfxIntSize (needed by GLContextProviderImpl.h below)
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h"

class nsIWidget;

namespace mozilla {
namespace gl {

#define IN_GL_CONTEXT_PROVIDER_H

// Null is always there
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderNull
#if 0 /* expanded by -frewrite-includes */
#include "GLContextProviderImpl.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProviderImpl.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef IN_GL_CONTEXT_PROVIDER_H
#error GLContextProviderImpl.h must only be included from GLContextProvider.h
#endif
# 9 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProviderImpl.h"

#ifndef GL_CONTEXT_PROVIDER_NAME
#error GL_CONTEXT_PROVIDER_NAME not defined
#endif
# 13 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProviderImpl.h"

class GL_CONTEXT_PROVIDER_NAME
{
public:
    /**
     */
    ;
};
# 25 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h" 2
#undef GL_CONTEXT_PROVIDER_NAME

#ifdef XP_WIN
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderWGL
#undef GL_CONTEXT_PROVIDER_NAME
#define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL
#endif
# 41 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h"

#if defined(ANDROID) || defined(XP_WIN)
#define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
#endif
# 64 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h"

#ifdef GL_CONTEXT_PROVIDER_DEFAULT
typedef GL_CONTEXT_PROVIDER_DEFAULT GLContextProvider;
#else
# 68 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h"
typedef GLContextProviderNull GLContextProvider;
#endif
# 70 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h"

#undef IN_GL_CONTEXT_PROVIDER_H

}
}

#endif
# 77 "/Users/luser/build/mozilla-central/gfx/gl/GLContextProvider.h"
# 108 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "SVGContentUtils.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/svg/SVGContentUtils.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_SVGCONTENTUTILS_H
#define MOZILLA_SVGCONTENTUTILS_H

class SVGContentUtils
{
public:
  typedef mozilla::gfx::Float Float;
  typedef mozilla::gfx::StrokeOptions StrokeOptions;
  typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio;
  typedef mozilla::SVGPreserveAspectRatio SVGPreserveAspectRatio;

  /*
   * Get the outer SVG element of an nsIContent
   * in a helper function and pass it out. This sub-class owns the mDashPattern
   * buffer so that consumers of such a helper function don't need to worry
   * about creating it, passing it in, or deleting it. (An added benefit is
   * that in the typical case when stroke-dasharray is short it will avoid
   * allocating.)
  /**
   * Check if this is one of the SVG elements that SVG 1.1 Full says
   * establishes a viewport: svg, symbol, image or foreignObject.
   */
  ;

  ;

  /* enum for specifying coordinate direction for ObjectSpace/UserSpace */
  enum ctxDirection { X, Y, XY };

  ;

  /**
   * True if 'aCh' is a decimal digit.
   * Returns a path
   * string formatted as an SVG path
   */
  static mozilla::TemporaryRef<mozilla::gfx::Path>
  GetPath(const nsAString& aPathString);
};

#endif
# 329 "/Users/luser/build/mozilla-central/dom/svg/SVGContentUtils.h"
# 109 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "SVGImageContext.h"
#endif /* expanded by -frewrite-includes */
# 110 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "nsIScreenManager.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIScreenManager.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIScreenManager.idl
 */

#ifndef __gen_nsIScreenManager_h__
#define __gen_nsIScreenManager_h__


#ifndef __gen_nsISupports_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIScreenManager.h"
#endif
# 12 "../../dist/include/nsIScreenManager.h"

#ifndef __gen_nsIScreen_h__
#if 0 /* expanded by -frewrite-includes */
#include "nsIScreen.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsIScreenManager.h"
#endif
# 16 "../../dist/include/nsIScreenManager.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 21 "../../dist/include/nsIScreenManager.h"

/* starting interface:    nsIScreenManager */
#define NS_ISCREENMANAGER_IID_STR "e8a96e60-6b61-4a14-bacc-53891604b502"

#define NS_ISCREENMANAGER_IID \
  {0xe8a96e60, 0x6b61, 0x4a14, \
    { 0xba, 0xcc, 0x53, 0x89, 0x16, 0x04, 0xb5, 0x02 }}

class NS_NO_VTABLE nsIScreenManager : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCREENMANAGER_IID)

  /* nsIScreen screenForRect (in long left, in long top, in long width, in long height); */
  NS_IMETHOD ScreenForRect(int32_t left, int32_t top, int32_t width, int32_t height, nsIScreen * *_retval) = 0;

  /* nsIScreen screenForId (in unsigned long id); */
  NS_IMETHOD ScreenForId(uint32_t id, nsIScreen * *_retval) = 0;

  /* readonly attribute nsIScreen primaryScreen; */
  NS_IMETHOD GetPrimaryScreen(nsIScreen * *aPrimaryScreen) = 0;

  /* readonly attribute unsigned long numberOfScreens; */
  NS_IMETHOD GetNumberOfScreens(uint32_t *aNumberOfScreens) = 0;

  /* readonly attribute float systemDefaultScale; */
  NS_IMETHOD GetSystemDefaultScale(float *aSystemDefaultScale) = 0;

  /* [noscript] nsIScreen screenForNativeWidget (in voidPtr nativeWidget); */
  NS_IMETHOD ScreenForNativeWidget(void *nativeWidget, nsIScreen * *_retval) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIScreenManager, NS_ISCREENMANAGER_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISCREENMANAGER \
  NS_IMETHOD ScreenForRect(int32_t left, int32_t top, int32_t width, int32_t height, nsIScreen * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD ScreenForId(uint32_t id, nsIScreen * *_retval) MOZ_OVERRIDE; \
  NS_IMETHOD GetPrimaryScreen(nsIScreen * *aPrimaryScreen) MOZ_OVERRIDE; \
  NS_IMETHOD GetNumberOfScreens(uint32_t *aNumberOfScreens) MOZ_OVERRIDE; \
  NS_IMETHOD GetSystemDefaultScale(float *aSystemDefaultScale) MOZ_OVERRIDE; \
  NS_IMETHOD ScreenForNativeWidget(void *nativeWidget, nsIScreen * *_retval) MOZ_OVERRIDE; 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsScreenManager : public nsIScreenManager
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISCREENMANAGER

  nsScreenManager();

private:
  ~nsScreenManager();

/* [noscript] nsIScreen screenForNativeWidget (in voidPtr nativeWidget); */
NS_IMETHODIMP nsScreenManager::ScreenForNativeWidget(void *nativeWidget, nsIScreen * *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 153 "../../dist/include/nsIScreenManager.h"



#endif /* __gen_nsIScreenManager_h__ */
# 157 "../../dist/include/nsIScreenManager.h"
# 111 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsFilterInstance.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsFilterInstance.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __NS_FILTERINSTANCE_H__
#define __NS_FILTERINSTANCE_H__

#if 0 /* expanded by -frewrite-includes */
#include "gfxMatrix.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsFilterInstance.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsPoint.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/nsFilterInstance.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsRect.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/nsFilterInstance.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSize.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/nsFilterInstance.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGFilters.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/svg/nsSVGFilters.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __NS_SVGFILTERSELEMENT_H__
#define __NS_SVGFILTERSELEMENT_H__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/svg/nsSVGFilters.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsImageLoadingContent.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/svg/nsSVGFilters.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGLength2.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/svg/nsSVGLength2.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __NS_SVGLENGTH2_H__
#define __NS_SVGLENGTH2_H__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/svg/nsSVGLength2.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIDOMSVGLength.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsIDOMSVGLength.h" 1
/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMSVGLength.idl
 */

#ifndef __gen_nsIDOMSVGLength_h__
#define __gen_nsIDOMSVGLength_h__


#ifndef __gen_domstubs_h__
#if 0 /* expanded by -frewrite-includes */
#include "domstubs.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/nsIDOMSVGLength.h"
#endif
# 12 "../../dist/include/nsIDOMSVGLength.h"

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
# 17 "../../dist/include/nsIDOMSVGLength.h"

/* starting interface:    nsIDOMSVGLength */
#define NS_IDOMSVGLENGTH_IID_STR "2596325c-aed0-487e-96a1-0a6d589b9c6b"

#define NS_IDOMSVGLENGTH_IID \
  {0x2596325c, 0xaed0, 0x487e, \
    { 0x96, 0xa1, 0x0a, 0x6d, 0x58, 0x9b, 0x9c, 0x6b }}

class NS_NO_VTABLE nsIDOMSVGLength : public nsISupports {
 public: 

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMSVGLENGTH_IID)

  enum {
    SVG_LENGTHTYPE_UNKNOWN = 0U,
    SVG_LENGTHTYPE_NUMBER = 1U,
    SVG_LENGTHTYPE_PERCENTAGE = 2U,
    SVG_LENGTHTYPE_EMS = 3U,
    SVG_LENGTHTYPE_EXS = 4U,
    SVG_LENGTHTYPE_PX = 5U,
    SVG_LENGTHTYPE_CM = 6U,
    SVG_LENGTHTYPE_MM = 7U,
    SVG_LENGTHTYPE_IN = 8U,
    SVG_LENGTHTYPE_PT = 9U,
    SVG_LENGTHTYPE_PC = 10U
  };

  /* readonly attribute unsigned short unitType; */
  NS_IMETHOD GetUnitType(uint16_t *aUnitType) = 0;

  /* attribute float value; */
  NS_IMETHOD GetValue(float *aValue) = 0;
  NS_IMETHOD SetValue(float aValue) = 0;

  /* attribute float valueInSpecifiedUnits; */
  NS_IMETHOD GetValueInSpecifiedUnits(float *aValueInSpecifiedUnits) = 0;
  NS_IMETHOD SetValueInSpecifiedUnits(float aValueInSpecifiedUnits) = 0;

  /* attribute DOMString valueAsString; */
  NS_IMETHOD GetValueAsString(nsAString & aValueAsString) = 0;
  NS_IMETHOD SetValueAsString(const nsAString & aValueAsString) = 0;

  /* void newValueSpecifiedUnits (in unsigned short unitType, in float valueInSpecifiedUnits); */
  NS_IMETHOD NewValueSpecifiedUnits(uint16_t unitType, float valueInSpecifiedUnits) = 0;

  /* void convertToSpecifiedUnits (in unsigned short unitType); */
  NS_IMETHOD ConvertToSpecifiedUnits(uint16_t unitType) = 0;

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMSVGLength, NS_IDOMSVGLENGTH_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMSVGLENGTH \
  NS_IMETHOD GetUnitType(uint16_t *aUnitType) MOZ_OVERRIDE; \
  NS_IMETHOD GetValue(float *aValue) MOZ_OVERRIDE; \
  NS_IMETHOD SetValueAsString(const nsAString & aValueAsString) MOZ_OVERRIDE { return _to SetValueAsString(aValueAsString); } \
  NS_IMETHOD NewValueSpecifiedUnits(uint16_t unitType, float valueInSpecifiedUnits) MOZ_OVERRIDE { return _to NewValueSpecifiedUnits(unitType, valueInSpecifiedUnits); } \
  NS_IMETHOD ConvertToSpecifiedUnits(uint16_t unitType) MOZ_OVERRIDE { return _to ConvertToSpecifiedUnits(unitType); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMSVGLENGTH(_to) \
  NS_IMETHOD GetUnitType(uint16_t *aUnitType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUnitType(aUnitType); } \
  NS_IMETHOD GetValue(float *aValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aValue); } \
  NS_IMETHOD SetValue(float aValue) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetValue(aValue); } \
  NS_IMETHOD GetValueInSpecifiedUnits(float *aValueInSpecifiedUnits) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValueInSpecifiedUnits(aValueInSpecifiedUnits); } \
  NS_IMETHOD SetValueInSpecifiedUnits(float aValueInSpecifiedUnits) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetValueInSpecifiedUnits(aValueInSpecifiedUnits); } \
  NS_IMETHOD GetValueAsString(nsAString & aValueAsString) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValueAsString(aValueAsString); } \
  NS_IMETHOD SetValueAsString(const nsAString & aValueAsString) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->SetValueAsString(aValueAsString); } \
  NS_IMETHOD NewValueSpecifiedUnits(uint16_t unitType, float valueInSpecifiedUnits) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->NewValueSpecifiedUnits(unitType, valueInSpecifiedUnits); } \
  NS_IMETHOD ConvertToSpecifiedUnits(uint16_t unitType) MOZ_OVERRIDE { return !_to ? NS_ERROR_NULL_POINTER : _to->ConvertToSpecifiedUnits(unitType); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMSVGLength : public nsIDOMSVGLength
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMSVGLENGTH
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void convertToSpecifiedUnits (in unsigned short unitType); */
NS_IMETHODIMP nsDOMSVGLength::ConvertToSpecifiedUnits(uint16_t unitType)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif
# 187 "../../dist/include/nsIDOMSVGLength.h"


#endif /* __gen_nsIDOMSVGLength_h__ */
# 190 "../../dist/include/nsIDOMSVGLength.h"
# 15 "/Users/luser/build/mozilla-central/dom/svg/nsSVGLength2.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsISMILAttr.h"
#endif /* expanded by -frewrite-includes */
# 16 "/Users/luser/build/mozilla-central/dom/svg/nsSVGLength2.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsMathUtils.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/svg/nsSVGLength2.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGElement.h"
#endif /* expanded by -frewrite-includes */
# 18 "/Users/luser/build/mozilla-central/dom/svg/nsSVGLength2.h"
#if 0 /* expanded by -frewrite-includes */
#include "SVGContentUtils.h"
#endif /* expanded by -frewrite-includes */
# 19 "/Users/luser/build/mozilla-central/dom/svg/nsSVGLength2.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/Rect.h"
#endif /* expanded by -frewrite-includes */
# 20 "/Users/luser/build/mozilla-central/dom/svg/nsSVGLength2.h"

class nsIFrame;
class nsSMILValue;

namespace mozilla {
class DOMSVGLength;
namespace dom {
class SVGAnimatedLength;
class SVGAnimationElement;
class SVGSVGElement;
}
}

namespace mozilla {
namespace dom {

class UserSpaceMetrics
{
public:
  virtual ~UserSpaceMetrics() {}

  virtual float GetEmLength() const = 0;
  virtual float GetExLength() const = 0;
  virtual float GetAxisLength(uint8_t aCtxType) const = 0;
};

class UserSpaceMetricsWithSize : public UserSpaceMetrics
{
public:
  virtual gfx::Size GetSize() const = 0;
  virtual float GetAxisLength(uint8_t aCtxType) const MOZ_OVERRIDE;
};


class NonSVGFrameUserSpaceMetrics : public UserSpaceMetricsWithSize
{
public:
  explicit NonSVGFrameUserSpaceMetrics(nsIFrame* aFrame);

  virtual float GetEmLength() const MOZ_OVERRIDE;
  virtual float GetExLength() const MOZ_OVERRIDE;
  virtual gfx::Size GetSize() const MOZ_OVERRIDE;

private:
  nsIFrame* mFrame;
};

}
}

class nsSVGLength2
{
  friend class mozilla::dom::SVGAnimatedLength;
  friend class mozilla::DOMSVGLength;
  typedef mozilla::dom::UserSpaceMetrics UserSpaceMetrics;
public:
  void Init(uint8_t aCtxType = SVGContentUtils::XY,
            uint8_t aAttrEnum = 0xff,
            float aValue = 0,
            uint8_t aUnitType = nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER) {
    mAnimVal = mBaseVal = aValue;
    mSpecifiedUnitType = aUnitType;
    mAttrEnum = aAttrEnum;
    mCtxType = aCtxType;
    mIsAnimated = false;
    mIsBaseSet = false;
  }

  nsSVGLength2& operator=(const nsSVGLength2& aLength) {
    mBaseVal = aLength.mBaseVal;
    mAnimVal = aLength.mAnimVal;
    mSpecifiedUnitType = aLength.mSpecifiedUnitType;
    mIsAnimated = aLength.mIsAnimated;
    mIsBaseSet = aLength.mIsBaseSet;
    return *this;
  }

  nsresult SetBaseValueString(const nsAString& aValue,
                              nsSVGElement *aSVGElement,
                              bool aDoSetAttr);
  ;
  float mAnimVal;
  float mBaseVal;
  uint8_t mSpecifiedUnitType;
  uint8_t mAttrEnum; // element specified tracking for attribute
  uint8_t mCtxType; // X, Y or Unspecified
  bool mIsAnimated:1;
  bool mIsBaseSet:1;

  ;
  ;
  ;
  ;

  // SetBaseValue and SetAnimValue set the value in user units
  ;
  ;
  ;
  ;
  ;
  ;
  ;
  ;

public:
  struct SMILLength : public nsISMILAttr
  {
  public:
    

    // These will stay alive because a nsISMILAttr only lives as long
    // as the Compositing step, and DOM elements don't get a chance to
    // die during that.
    nsSVGLength2* mVal;
    nsSVGElement* mSVGElement;

    // nsISMILAttr methods
    virtual nsresult ValueFromString(const nsAString& aStr,
                                     const mozilla::dom::SVGAnimationElement* aSrcElement,
                                     nsSMILValue &aValue,
                                     bool& aPreventCachingOfSandwich) const MOZ_OVERRIDE;
    virtual nsSMILValue GetBaseValue() const MOZ_OVERRIDE;
    virtual void ClearAnimValue() MOZ_OVERRIDE;
    virtual nsresult SetAnimValue(const nsSMILValue& aValue) MOZ_OVERRIDE;
  };
};

#endif //  __NS_SVGLENGTH2_H__
# 210 "/Users/luser/build/mozilla-central/dom/svg/nsSVGLength2.h"
# 12 "/Users/luser/build/mozilla-central/dom/svg/nsSVGFilters.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGString.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/svg/nsSVGString.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __NS_SVGSTRING_H__
#define __NS_SVGSTRING_H__

#if 0 /* expanded by -frewrite-includes */
#include "nsError.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/svg/nsSVGString.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGElement.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/dom/svg/nsSVGString.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/Attributes.h"
#endif /* expanded by -frewrite-includes */
# 12 "/Users/luser/build/mozilla-central/dom/svg/nsSVGString.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/SVGAnimatedString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/SVGAnimatedString.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_SVGAnimatedString_h
#define mozilla_dom_SVGAnimatedString_h

#if 0 /* expanded by -frewrite-includes */
#include "nsSVGElement.h"
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/mozilla/dom/SVGAnimatedString.h"

namespace mozilla {
namespace dom {

class SVGAnimatedString : public nsISupports,
                          public nsWrapperCache
{
public:
  

  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;

  // WebIDL
  

  ;
  ;
  ;

  nsRefPtr<nsSVGElement> mSVGElement;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_SVGAnimatedString_h
# 42 "../../dist/include/mozilla/dom/SVGAnimatedString.h"
# 13 "/Users/luser/build/mozilla-central/dom/svg/nsSVGString.h" 2

class nsSVGString
{

public:
  

  ;
  

  ;
  nsAutoPtr<nsString> mAnimVal;
  uint8_t mAttrEnum; // element specified tracking for attribute
  bool mIsBaseSet;

public:
  struct DOMAnimatedString MOZ_FINAL : public mozilla::dom::SVGAnimatedString
  {
    NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMAnimatedString)

    

    nsSVGString* mVal; // kept alive because it belongs to content

    

    

    

  private:
    ;
  };
  struct SMILString : public nsISMILAttr
  {
  public:
    

    // These will stay alive because a nsISMILAttr only lives as long
    // as the Compositing step, and DOM elements don't get a chance to
    // die during that.
    nsSVGString* mVal;
    nsSVGElement* mSVGElement;

    // nsISMILAttr methods
    virtual nsresult ValueFromString(const nsAString& aStr,
                                     const mozilla::dom::SVGAnimationElement *aSrcElement,
                                     nsSMILValue& aValue,
                                     bool& aPreventCachingOfSandwich) const MOZ_OVERRIDE;
    virtual nsSMILValue GetBaseValue() const MOZ_OVERRIDE;
    virtual void ClearAnimValue() MOZ_OVERRIDE;
    virtual nsresult SetAnimValue(const nsSMILValue& aValue) MOZ_OVERRIDE;
  };
};
#endif //__NS_SVGSTRING_H__
# 108 "/Users/luser/build/mozilla-central/dom/svg/nsSVGString.h"
# 13 "/Users/luser/build/mozilla-central/dom/svg/nsSVGFilters.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGElement.h"
#endif /* expanded by -frewrite-includes */
# 14 "/Users/luser/build/mozilla-central/dom/svg/nsSVGFilters.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGNumber2.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/svg/nsSVGNumber2.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __NS_SVGNUMBER2_H__
#define __NS_SVGNUMBER2_H__

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/dom/SVGAnimatedNumber.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/dom/SVGAnimatedNumber.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_SVGAnimatedNumber_h
#define mozilla_dom_SVGAnimatedNumber_h

#if 0 /* expanded by -frewrite-includes */
#include "nsISupports.h"
#endif /* expanded by -frewrite-includes */
# 11 "../../dist/include/mozilla/dom/SVGAnimatedNumber.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsWrapperCache.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/mozilla/dom/SVGAnimatedNumber.h"

#if 0 /* expanded by -frewrite-includes */
#include "nsSVGElement.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/mozilla/dom/SVGAnimatedNumber.h"

namespace mozilla {
namespace dom {

class SVGAnimatedNumber : public nsISupports
                        , public nsWrapperCache
{

  nsRefPtr<nsSVGElement> mSVGElement;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_SVGAnimatedNumber_h
# 51 "../../dist/include/mozilla/dom/SVGAnimatedNumber.h"
# 18 "/Users/luser/build/mozilla-central/dom/svg/nsSVGNumber2.h" 2

class nsSMILValue;

namespace mozilla {
namespace dom {
class SVGAnimationElement;
}
}

class nsSVGNumber2
{

public:
  

  ;
  ;

  ;
  
  ;
  
  uint8_t mAttrEnum; // element specified tracking for attribute
  bool mIsAnimated;
  bool mIsBaseSet;

public:
  struct DOMAnimatedNumber MOZ_FINAL : public mozilla::dom::SVGAnimatedNumber
  {
    
    ;

    nsSVGNumber2* mVal; // kept alive because it belongs to content

    
    

    // Script may have modified animation parameters or timeline -- DOM getters
    // need to flush any resample requests to reflect these modifications.
    
  };

  struct SMILNumber : public nsISMILAttr
  {
  public:
    

    // These will stay alive because a nsISMILAttr only lives as long
    // as the Compositing step, and DOM elements don't get a chance to
    // die during that.
    nsSVGNumber2* mVal;
    nsSVGElement* mSVGElement;

    // nsISMILAttr methods
    virtual nsresult ValueFromString(const nsAString& aStr,
                                     const mozilla::dom::SVGAnimationElement* aSrcElement,
                                     nsSMILValue& aValue,
                                     bool& aPreventCachingOfSandwich) const MOZ_OVERRIDE;
    virtual nsSMILValue GetBaseValue() const MOZ_OVERRIDE;
    virtual void ClearAnimValue() MOZ_OVERRIDE;
    virtual nsresult SetAnimValue(const nsSMILValue& aValue) MOZ_OVERRIDE;
  };
};

#endif //__NS_SVGNUMBER2_H__
# 124 "/Users/luser/build/mozilla-central/dom/svg/nsSVGNumber2.h"
# 15 "/Users/luser/build/mozilla-central/dom/svg/nsSVGFilters.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGNumberPair.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/dom/svg/nsSVGNumberPair.h" 1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef __NS_SVGNUMBERPAIR_H__
#define __NS_SVGNUMBERPAIR_H__

#if 0 /* expanded by -frewrite-includes */
#include "nsAutoPtr.h"
#endif /* expanded by -frewrite-includes */
# 10 "/Users/luser/build/mozilla-central/dom/svg/nsSVGNumberPair.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsCycleCollectionParticipant.h"
#endif /* expanded by -frewrite-includes */

namespace mozilla {
namespace dom {
class SVGAnimationElement;
}
}

class nsSVGNumberPair
{

public:
  enum PairIndex {
    eFirst,
    eSecond
  };


  struct SMILNumberPair : public nsISMILAttr
  {
  public:
    

    // These will stay alive because a nsISMILAttr only lives as long
    // as the Compositing step, and DOM elements don't get a chance to
    // die during that.
    nsSVGNumberPair* mVal;
    nsSVGElement* mSVGElement;

    // nsISMILAttr methods
    virtual nsresult ValueFromString(const nsAString& aStr,
                                     const mozilla::dom::SVGAnimationElement* aSrcElement,
                                     nsSMILValue& aValue,
                                     bool& aPreventCachingOfSandwich) const MOZ_OVERRIDE;
    virtual nsSMILValue GetBaseValue() const MOZ_OVERRIDE;
    virtual void ClearAnimValue() MOZ_OVERRIDE;
    virtual nsresult SetAnimValue(const nsSMILValue& aValue) MOZ_OVERRIDE;
  };
};

#endif //__NS_SVGNUMBERPAIR_H__
# 135 "/Users/luser/build/mozilla-central/dom/svg/nsSVGNumberPair.h"
# 16 "/Users/luser/build/mozilla-central/dom/svg/nsSVGFilters.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "FilterSupport.h"
#endif /* expanded by -frewrite-includes */
# 17 "/Users/luser/build/mozilla-central/dom/svg/nsSVGFilters.h"

class nsSVGFilterInstance;
class nsSVGFilterResource;
class nsSVGNumberPair;

struct nsSVGStringInfo {
  

  const nsSVGString* mString;
  nsSVGElement* mElement;
};

typedef nsSVGElement nsSVGFEBase;

#define NS_SVG_FE_CID \
{ 0x60483958, 0xd229, 0x4a77, \
  { 0x96, 0xb2, 0x62, 0x3e, 0x69, 0x95, 0x1e, 0x0e } }

/**
 * Base class for filter primitive elements
 * Children of those elements e.g. feMergeNode
 * derive from SVGFEUnstyledElement instead
 */
class nsSVGFE : public nsSVGFEBase
{
  friend class nsSVGFilterInstance;

protected:
  typedef mozilla::gfx::SourceSurface SourceSurface;
  typedef mozilla::gfx::Size Size;
  typedef mozilla::gfx::IntRect IntRect;
  typedef mozilla::gfx::ColorSpace ColorSpace;
  typedef mozilla::gfx::FilterPrimitiveDescription FilterPrimitiveDescription;

  
  

public:
  typedef mozilla::gfx::AttributeMap AttributeMap;

  

  // This is only called for filter primitives without inputs. For primitives
  // with inputs, the output color model is the same as of the first input.
  

  // See http://www.w3.org/TR/SVG/filters.html#FilterPrimitiveSubRegion
  

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_SVG_FE_CID)
  static LengthInfo sLengthInfo[4];
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsSVGFE, NS_SVG_FE_CID)

typedef nsSVGElement SVGFEUnstyledElementBase;

class SVGFEUnstyledElement : public SVGFEUnstyledElementBase
{
protected:
  

public:
  ;

  // returns true if changes to the attribute should cause us to
  nsSVGString mStringAttributes[2];
  static StringInfo sStringInfo[2];
};

namespace mozilla {
namespace dom {

typedef SVGFEUnstyledElement SVGFELightElementBase;

class SVGFELightElement : public SVGFELightElementBase
{
protected:
  

public:
  typedef gfx::AttributeMap AttributeMap;

  ;
};

}
}

#endif
# 243 "/Users/luser/build/mozilla-central/dom/svg/nsSVGFilters.h"
# 18 "../../dist/include/nsFilterInstance.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGNumber2.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsFilterInstance.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGNumberPair.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsFilterInstance.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsTArray.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsFilterInstance.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsIFrame.h"
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsFilterInstance.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/2D.h"
#endif /* expanded by -frewrite-includes */
# 23 "../../dist/include/nsFilterInstance.h"

class gfxContext;
class nsIFrame;
class nsSVGFilterPaintCallback;

namespace mozilla {
namespace dom {
class UserSpaceMetrics;
}
}

/**
 * This class performs all filter processing.
 *
 * We build a graph of the filter image data flow, essentially
 * converting the filter graph to SSA. This lets us easily propagate
 * analysis data (such as bounding-boxes) over the filter primitive graph.
 *
 * Definition of "filter space": filter space is a coordinate system that is
 * aligned with the user space of the filtered element, with its origin located
 * at the top left of the filter region, and with one unit equal in size to one
 * pixel of the offscreen surface into which the filter output would/will be
 * painted.
 *
 * The definition of "filter region" can be found here:
 * http://www.w3.org/TR/SVG11/filters.html#FilterEffectsRegion
 */
class nsFilterInstance
{
  typedef mozilla::gfx::IntRect IntRect;
  typedef mozilla::gfx::SourceSurface SourceSurface;
  typedef mozilla::gfx::DrawTarget DrawTarget;
  typedef mozilla::gfx::FilterPrimitiveDescription FilterPrimitiveDescription;
  typedef mozilla::gfx::FilterDescription FilterDescription;
  typedef mozilla::dom::UserSpaceMetrics UserSpaceMetrics;

public:
  /**
   * Create a FilterDescription for the supplied filter. All coordinates in
   * the description are in filter space.
   * @param aOutAdditionalImages Will contain additional images needed to
   *   render the filter (from feImage primitives).
   * @return A FilterDescription describing the filter.
   */
  static FilterDescription GetFilterDescription(nsIContent* aFilteredElement,
                                                const nsTArray<nsStyleFilter>& aFilterChain,
                                                const UserSpaceMetrics& aMetrics,
                                                const gfxRect& aBBox,
                                                nsTArray<mozilla::RefPtr<SourceSurface>>& aOutAdditionalImages);

  /**
   * Paint the given filtered frame.
   * @param aDirtyArea The area than needs to be painted, in aFilteredFrame's
   *   frame space (i.e. relative to its origin, the top-left corner of its
   *   border box).
   */
  ;

  /**
   * Returns the post-filter area that could be dirtied when the given
   * pre-filter area of aFilteredFrame changes.
  /**
   * Sets the aPostFilterDirtyRegion outparam to the post-filter area in frame
   * space that would be dirtied by mTargetFrame when a given
   * pre-filter area of mTargetFrame is dirtied. The pre-filter area must have
   * been specified before calling this method by passing it as the
   * for a given post-filter dirtied area. The post-filter area must have been
   * specified before calling this method by passing it as the aPostFilterDirtyRegion
   * argument to the nsFilterInstance constructor.
   */
  ;


  /**
   * Returns the transform from filter space to outer-<svg> device space.
   */
  

private:
  struct SourceInfo {
    // Specifies which parts of the source need to be rendered.
    // Set by ComputeNeededBoxes().
    nsIntRect mNeededBounds;

    // The surface that contains the input rendering.
    // Set by BuildSourceImage / BuildSourcePaint.
    mozilla::RefPtr<SourceSurface> mSourceSurface;

    // The position and size of mSourceSurface in filter space.
    // Set by BuildSourceImage / BuildSourcePaint.
    IntRect mSurfaceRect;
  };

  /**
   * Creates a SourceSurface for either the FillPaint or StrokePaint graph
   * nodes
   */
  ;
  SourceInfo mFillPaint;
  SourceInfo mStrokePaint;

  /**
   * The transform to the SVG user space of mTargetFrame.
   */
  gfxMatrix               mPaintTransform;

  nsTArray<mozilla::RefPtr<SourceSurface>> mInputImages;
  nsTArray<FilterPrimitiveDescription> mPrimitiveDescriptions;
  FilterDescription mFilterDescription;
  bool mInitialized;
};

#endif
# 374 "../../dist/include/nsFilterInstance.h"
# 112 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsSVGLength2.h"
#endif /* expanded by -frewrite-includes */
# 113 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "nsDeviceContext.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsDeviceContext.h" 1
/* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef _NS_DEVICECONTEXT_H_
#define _NS_DEVICECONTEXT_H_

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>                     // for uint32_t
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsDeviceContext.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>                  // for int32_t
#include "nsISupports.h"                // for NS_INLINE_DECL_REFCOUNTING
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsDeviceContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nsMathUtils.h"                // for NS_round
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsDeviceContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"                     // for char16_t, nsAString
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/nsDeviceContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/AppUnits.h"           // for AppUnits
#endif /* expanded by -frewrite-includes */
# 22 "../../dist/include/nsDeviceContext.h"

class gfxASurface;
class gfxContext;
class gfxTextPerfMetrics;
class gfxUserFontSet;
struct nsFont;
class nsFontCache;
class nsFontMetrics;
class nsIAtom;
class nsIDeviceContextSpec;
class nsIScreen;
class nsIScreenManager;
class nsIWidget;
struct nsRect;

class nsDeviceContext MOZ_FINAL
{
public:
    ;

    NS_INLINE_DECL_REFCOUNTING(nsDeviceContext)

    /**
     * Initialize the device context from a widget
     * @param aWidget a widget to initialize the device context from
     * @return error status
     * @param aFont font description to obtain metrics for
     * @param aLanguage the language of the document
     * @param aMetrics out parameter for font metrics
     * @param aUserFontSet user font set
     * @return error status
     */
    nsresult GetMetricsFor(const nsFont& aFont,
                           nsIAtom* aLanguage, bool aExplicitLanguage,
                           gfxFont::Orientation aOrientation,
                           gfxUserFontSet* aUserFontSet,
                           gfxTextPerfMetrics* aTextPerf,
                           nsFontMetrics*& aMetrics);

    /**
     * Notification when a font metrics instance created for this device is
     * about to be deleted

    /**
     * Returns the page full zoom factor applied.
     */
    

    /**
     * True if this device context was created for printing.
     */
    ;

private:
    // Private destructor, to discourage deletion outside of Release():
    ~nsDeviceContext();

    ;
    nsCOMPtr<nsIWidget>            mWidget;
    nsCOMPtr<nsIScreenManager>     mScreenManager;
    nsCOMPtr<nsIDeviceContextSpec> mDeviceContextSpec;
    nsRefPtr<gfxASurface>          mPrintingSurface;
#ifdef XP_MACOSX
    nsRefPtr<gfxASurface>          mCachedPrintingSurface;
#endif
# 282 "../../dist/include/nsDeviceContext.h"
};

#endif /* _NS_DEVICECONTEXT_H_ */
# 285 "../../dist/include/nsDeviceContext.h"
# 114 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#if 0 /* expanded by -frewrite-includes */
#include "nsFontMetrics.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/nsFontMetrics.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef NSFONTMETRICS__H__
#define NSFONTMETRICS__H__

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>                     // for uint32_t
#endif /* expanded by -frewrite-includes */
# 10 "../../dist/include/nsFontMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>                  // for int32_t
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/nsFontMetrics.h"
#if 0 /* expanded by -frewrite-includes */
#include "nscore.h"                     // for char16_t
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/nsFontMetrics.h"

class gfxUserFontSet;
class gfxTextPerfMetrics;
class nsDeviceContext;
class nsIAtom;
class nsRenderingContext;
struct nsBoundingMetrics;

/**
 * Font metrics
 *
 * This class may be somewhat misnamed. A better name might be
 * nsFontList. The style system uses the nsFont struct for various
 * font properties, one of which is font-family, which can contain a
 * *list* of font names. The nsFont struct is "realized" by asking the
 * device context to cough up an nsFontMetrics object, which contains
 * a list of real font handles, one for each font mentioned in
 * font-family (and for each fallback when we fall off the end of that
 * list).
 *
 * The style system needs to have access to certain metrics, such as
 * the em height (for the CSS "em" unit), and we use the first Western
 * font's metrics for that purpose. The platform-specific
 * implementations are expected to select non-Western fonts that "fit"
 * reasonably well with the Western font that is loaded at Init time.
 */
class nsFontMetrics MOZ_FINAL
{
public:
    ;

    NS_INLINE_DECL_REFCOUNTING(nsFontMetrics)

    /**
     * Initialize the font metrics. Call this after creating the font metrics.
     * Font metrics you get from the font cache do NOT need to be initialized
     *
     * @see nsDeviceContext#GetMetricsFor()
     */
    ;

    /**
     * Destroy this font metrics. This breaks the association between
     * the font metrics and the device context.
     */
    ;

    /**
     * Return the font's x-height.
     */
    nscoord XHeight();

    /**
     * Return the font's superscript offset (the distance from the
     * baseline to where a superscript's baseline should be placed).
     * The value returned will be positive.
     */
    ;

    
    

    gfxFontGroup* GetThebesFontGroup() const { return mFontGroup; }
    

    

private:
    // Private destructor, to discourage deletion outside of Release():
    ~nsFontMetrics();

    

    ;

    nsFont mFont;
    nsRefPtr<gfxFontGroup> mFontGroup;
    nsCOMPtr<nsIAtom> mLanguage;
    nsDeviceContext *mDeviceContext;
    int32_t mP2A;

    // The font orientation (horizontal or vertical) for which these metrics
    // have been initialized. This determines which line metrics (ascent and
    // descent) they will return.
    gfxFont::Orientation mOrientation;

    // These fields may be set by clients to control the behavior of methods
    // like GetWidth and DrawString according to the writing mode, direction
    // and text-orientation desired.
    bool mTextRunRTL;
    bool mVertical;
    uint8_t mTextOrientation;
};

#endif /* NSFONTMETRICS__H__ */
# 264 "../../dist/include/nsFontMetrics.h"
# 115 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2

#undef free // apparently defined by some windows header, clashing with a free()
            // method in SkTypes.h
#if 0 /* expanded by -frewrite-includes */
#include "SkiaGLGlue.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/SkiaGLGlue.h" 1
/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#if 0 /* expanded by -frewrite-includes */
#include "mozilla/RefPtr.h"
#endif /* expanded by -frewrite-includes */
# 7 "/Users/luser/build/mozilla-central/gfx/gl/SkiaGLGlue.h"

#ifdef USE_SKIA_GPU

#if 0 /* expanded by -frewrite-includes */
#include "GLContext.h"
#endif /* expanded by -frewrite-includes */
# 11 "/Users/luser/build/mozilla-central/gfx/gl/SkiaGLGlue.h"
#if 0 /* expanded by -frewrite-includes */
#include "skia/GrGLInterface.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrGLInterface.h" 1
/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrGLInterface_DEFINED
#define GrGLInterface_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrGLFunctions.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrGLFunctions.h" 1

/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrGLFunctions_DEFINED
#define GrGLFunctions_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrGLConfig.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrGLConfig.h" 1

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */



#ifndef GrGLConfig_DEFINED
#define GrGLConfig_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrTypes.h" 1

/*
 * Copyright 2010 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */



#ifndef GrTypes_DEFINED
#define GrTypes_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkTypes.h" 1
/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkTypes_DEFINED
#define SkTypes_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkPreConfig.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkPreConfig.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkPreConfig_DEFINED
#define SkPreConfig_DEFINED

#ifdef WEBKIT_VERSION_MIN_REQUIRED
    #if 0 /* expanded by -frewrite-includes */
#include "config.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/SkPreConfig.h"
#endif
# 16 "../../dist/include/skia/SkPreConfig.h"

// Allows embedders that want to disable macros that take arguments to just
// define that symbol to be one of these
//
#define SK_NOTHING_ARG1(arg1)
#define SK_NOTHING_ARG2(arg1, arg2)
#define SK_NOTHING_ARG3(arg1, arg2, arg3)

//////////////////////////////////////////////////////////////////////

#if !defined(SK_BUILD_FOR_ANDROID) && !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_PALM) && !defined(SK_BUILD_FOR_WINCE) && !defined(SK_BUILD_FOR_WIN32) && !defined(SK_BUILD_FOR_UNIX) && !defined(SK_BUILD_FOR_MAC) && !defined(SK_BUILD_FOR_SDL) && !defined(SK_BUILD_FOR_BREW) && !defined(SK_BUILD_FOR_NACL)

    #ifdef __APPLE__
        #if 0 /* expanded by -frewrite-includes */
#include "TargetConditionals.h"
#endif /* expanded by -frewrite-includes */
# 30 "../../dist/include/skia/SkPreConfig.h"
    #endif
# 31 "../../dist/include/skia/SkPreConfig.h"

    #if defined(PALMOS_SDK_VERSION)
        #define SK_BUILD_FOR_PALM
    #elif defined(UNDER_CE)
# 35 "../../dist/include/skia/SkPreConfig.h"
        #define SK_BUILD_FOR_WINCE
    #elif defined(WIN32)
# 37 "../../dist/include/skia/SkPreConfig.h"
        #define SK_BUILD_FOR_WIN32
    #elif defined(__SYMBIAN32__)
# 39 "../../dist/include/skia/SkPreConfig.h"
        #define SK_BUILD_FOR_WIN32
    #elif defined(ANDROID)
# 41 "../../dist/include/skia/SkPreConfig.h"
        #define SK_BUILD_FOR_ANDROID
    #elif defined(linux) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
          defined(__sun) || defined(__NetBSD__) || defined(__DragonFly__) || \
          defined(__GLIBC__) || defined(__GNU__)
# 45 "../../dist/include/skia/SkPreConfig.h"
        #define SK_BUILD_FOR_UNIX
    #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
# 47 "../../dist/include/skia/SkPreConfig.h"
        #define SK_BUILD_FOR_IOS
    #else
# 49 "../../dist/include/skia/SkPreConfig.h"
        #define SK_BUILD_FOR_MAC
    #endif
# 51 "../../dist/include/skia/SkPreConfig.h"

#endif
# 53 "../../dist/include/skia/SkPreConfig.h"

/* Even if the user only defined the framework variant we still need to build
 * the default (NDK-compliant) Android code. Therefore, when attempting to
 * include/exclude something from the framework variant check first that we are
 * building for Android then check the status of the framework define.
 */
#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) && !defined(SK_BUILD_FOR_ANDROID)
    #define SK_BUILD_FOR_ANDROID
#endif
# 62 "../../dist/include/skia/SkPreConfig.h"

//////////////////////////////////////////////////////////////////////

#if !defined(SK_DEBUG) && !defined(SK_RELEASE)
    #ifdef NDEBUG
        #define SK_RELEASE
    #else
# 69 "../../dist/include/skia/SkPreConfig.h"
        #define SK_DEBUG
    #endif
# 71 "../../dist/include/skia/SkPreConfig.h"
#endif
# 72 "../../dist/include/skia/SkPreConfig.h"

#ifdef SK_BUILD_FOR_WIN32
    #if !defined(SK_RESTRICT)
        #define SK_RESTRICT __restrict
    #endif
# 77 "../../dist/include/skia/SkPreConfig.h"
#endif
# 91 "../../dist/include/skia/SkPreConfig.h"

//////////////////////////////////////////////////////////////////////

#if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
    #if defined(__sparc) || defined(__sparc__) || \
      defined(_POWER) || defined(__powerpc__) || \
      defined(__ppc__) || defined(__hppa) || \
      defined(__PPC__) || defined(__PPC64__) || \
      defined(_MIPSEB) || defined(__ARMEB__) || \
      defined(__s390__) || \
      (defined(__sh__) && defined(__BIG_ENDIAN__)) || \
      (defined(__ia64) && defined(__BIG_ENDIAN__))
         #define SK_CPU_BENDIAN
    #else
# 105 "../../dist/include/skia/SkPreConfig.h"
        #define SK_CPU_LENDIAN
    #endif
# 107 "../../dist/include/skia/SkPreConfig.h"
#endif
# 108 "../../dist/include/skia/SkPreConfig.h"

//////////////////////////////////////////////////////////////////////

#if defined(__i386) || defined(_M_IX86) ||  defined(__x86_64__) || defined(_M_X64)
  #define SK_CPU_X86 1
#endif
# 114 "../../dist/include/skia/SkPreConfig.h"

/**
 *  SK_CPU_SSE_LEVEL
#else
# 217 "../../dist/include/skia/SkPreConfig.h"
    #define SK_API
#endif
# 219 "../../dist/include/skia/SkPreConfig.h"

//////////////////////////////////////////////////////////////////////

/**
 * Use SK_PURE_FUNC as an attribute to indicate that a function's
 * return value only depends on the value of its parameters. This
 * can help the compiler optimize out successive calls.
 *
 * Usage:
 *      void  function(int params)  SK_PURE_FUNC;
 */
#if defined(__GNUC__)
#  define  SK_PURE_FUNC  __attribute__((pure))
#else
# 233 "../../dist/include/skia/SkPreConfig.h"
#  define  SK_PURE_FUNC  /* nothing */
#endif
# 235 "../../dist/include/skia/SkPreConfig.h"

//////////////////////////////////////////////////////////////////////

/**
 * SK_HAS_ATTRIBUTE(<name>) should return true iff the compiler
 * supports __attribute__((<name>)). Mostly important because
 * Clang doesn't support all of GCC attributes.
 */
#if defined(__has_attribute)
#   define SK_HAS_ATTRIBUTE(x) __has_attribute(x)
#elif defined(__GNUC__)
# 246 "../../dist/include/skia/SkPreConfig.h"
#   define SK_HAS_ATTRIBUTE(x) 1
#else
# 248 "../../dist/include/skia/SkPreConfig.h"
#   define SK_HAS_ATTRIBUTE(x) 0
#endif
# 250 "../../dist/include/skia/SkPreConfig.h"

/**
 * SK_ATTRIBUTE_OPTIMIZE_O1 can be used as a function attribute
 * to specify individual optimization level of -O1, if the compiler
 * supports it.
 *
 * NOTE: Clang/ARM (r161757) does not support the 'optimize' attribute.
 */
#if SK_HAS_ATTRIBUTE(optimize)
#   define SK_ATTRIBUTE_OPTIMIZE_O1 __attribute__((optimize("O1")))
#else
# 261 "../../dist/include/skia/SkPreConfig.h"
#   define SK_ATTRIBUTE_OPTIMIZE_O1 /* nothing */
#endif
# 263 "../../dist/include/skia/SkPreConfig.h"

#endif
# 265 "../../dist/include/skia/SkPreConfig.h"
# 12 "../../dist/include/skia/SkTypes.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkUserConfig.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkUserConfig.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkUserConfig_DEFINED
#define SkUserConfig_DEFINED

/*  SkTypes.h, the root of the public header files, does the following trick:

    #include "SkPreConfig.h"
    #include "SkUserConfig.h"
#endif
# 74 "../../dist/include/skia/SkPostConfig.h"

/**
 * The clang static analyzer likes to know that when the program is not
 * expected to continue (crash, assertion failure, etc). It will notice that
 * some combination of parameters lead to a function call that does not return.
 * It can then make appropriate assumptions about the parameters in code
 * executed only if the non-returning function was *not* called.
 */
#if !defined(SkNO_RETURN_HINT)
#  if SK_HAS_COMPILER_FEATURE(attribute_analyzer_noreturn)
     static inline void SkNO_RETURN_HINT() __attribute__((analyzer_noreturn));
     static inline void SkNO_RETURN_HINT() {}
#  else
# 87 "../../dist/include/skia/SkPostConfig.h"
#    define SkNO_RETURN_HINT() do {} while (false)
#  endif
# 89 "../../dist/include/skia/SkPostConfig.h"
#endif
# 90 "../../dist/include/skia/SkPostConfig.h"

#if defined(SK_ZLIB_INCLUDE) && defined(SK_SYSTEM_ZLIB)
#  error "cannot define both SK_ZLIB_INCLUDE and SK_SYSTEM_ZLIB"
#elif defined(SK_ZLIB_INCLUDE) || defined(SK_SYSTEM_ZLIB)
# 94 "../../dist/include/skia/SkPostConfig.h"
#  define SK_HAS_ZLIB
#endif
# 96 "../../dist/include/skia/SkPostConfig.h"

///////////////////////////////////////////////////////////////////////////////

#ifndef SkNEW
#  define SkNEW(type_name)                           (new type_name)
#  define SkNEW_ARGS(type_name, args)                (new type_name args)
#  define SkNEW_ARRAY(type_name, count)              (new type_name[(count)])
#  define SkNEW_PLACEMENT(buf, type_name)            (new (buf) type_name)
#  define SkNEW_PLACEMENT_ARGS(buf, type_name, args) (new (buf) type_name args)
#  define SkDELETE(obj)                              (delete (obj))
#  define SkDELETE_ARRAY(array)                      (delete[] (array))
#endif
# 108 "../../dist/include/skia/SkPostConfig.h"

#ifndef SK_CRASH
#  ifdef SK_BUILD_FOR_WIN
#    define SK_CRASH() __debugbreak()
#  else
# 113 "../../dist/include/skia/SkPostConfig.h"
#    define SK_A32_SHIFT 24
#    define SK_R32_SHIFT 16
#    define SK_G32_SHIFT 8
#    define SK_B32_SHIFT 0
#  endif
# 167 "../../dist/include/skia/SkPostConfig.h"
#
#endif
# 169 "../../dist/include/skia/SkPostConfig.h"

#ifndef SK_ALWAYSBREAK
#  ifdef SK_DEBUG
#    define SK_ALWAYSBREAK(cond) do { \
              if (cond) break; \
              SkNO_RETURN_HINT(); \
              SkDebugf("%s:%d: failed assertion \"%s\"\n", __FILE__, __LINE__, #cond); \
#  ifdef SK_CPU_BENDIAN
#    define SK_R32_SHIFT    24
#    define SK_G32_SHIFT    16
#    define SK_B32_SHIFT    8
#    define SK_A32_SHIFT    0
#  else
# 195 "../../dist/include/skia/SkPostConfig.h"
#    define SK_R32_SHIFT    0
#    define SK_G32_SHIFT    8
#    define SK_B32_SHIFT    16
#    define SK_A32_SHIFT    24
#  endif
# 200 "../../dist/include/skia/SkPostConfig.h"
#endif
# 201 "../../dist/include/skia/SkPostConfig.h"

//////////////////////////////////////////////////////////////////////

// TODO: rebaseline as needed so we can remove this flag entirely.
//  - all platforms have int64_t now
//  - we have slightly different fixed math results because of this check
//    since we don't define this for linux/android
#if defined(SK_BUILD_FOR_WIN32) || defined(SK_BUILD_FOR_MAC)
#  ifndef SkLONGLONG
#    define SkLONGLONG int64_t
#  endif
# 242 "../../dist/include/skia/SkPostConfig.h"
#endif
# 243 "../../dist/include/skia/SkPostConfig.h"

//////////////////////////////////////////////////////////////////////////////////////////////
#ifndef SK_BUILD_FOR_WINCE
#if 0 /* expanded by -frewrite-includes */
#  include <string.h>
#endif /* expanded by -frewrite-includes */
# 247 "../../dist/include/skia/SkPostConfig.h"
#if 0 /* expanded by -frewrite-includes */
#  include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 248 "../../dist/include/skia/SkPostConfig.h"
#else
# 249 "../../dist/include/skia/SkPostConfig.h"
#  define _CMNINTRIN_DECLARE_ONLY
#if 0 /* expanded by -frewrite-includes */
#  include "cmnintrin.h"
#endif /* expanded by -frewrite-includes */
# 251 "../../dist/include/skia/SkPostConfig.h"
#endif
# 252 "../../dist/include/skia/SkPostConfig.h"

#if defined SK_DEBUG && defined SK_BUILD_FOR_WIN32
#  ifdef free
#    undef free
#  endif
# 257 "../../dist/include/skia/SkPostConfig.h"
#if 0 /* expanded by -frewrite-includes */
#  include <crtdbg.h>
#endif /* expanded by -frewrite-includes */
# 258 "../../dist/include/skia/SkPostConfig.h"
#  undef free
#
#  ifdef SK_DEBUGx
#    if defined(SK_SIMULATE_FAILED_MALLOC) && defined(__cplusplus)
       void * operator new(
           );
       void operator delete(
           void *pUserData
           );
       void operator delete[]( void * p );
#      define DEBUG_CLIENTBLOCK   new( _CLIENT_BLOCK, __FILE__, __LINE__, 0)
#    else
# 286 "../../dist/include/skia/SkPostConfig.h"
#      define DEBUG_CLIENTBLOCK   new( _CLIENT_BLOCK, __FILE__, __LINE__)
#    endif
# 288 "../../dist/include/skia/SkPostConfig.h"
#    define new DEBUG_CLIENTBLOCK
#  else
# 290 "../../dist/include/skia/SkPostConfig.h"
#    define DEBUG_CLIENTBLOCK
#  endif
# 292 "../../dist/include/skia/SkPostConfig.h"
#endif
# 293 "../../dist/include/skia/SkPostConfig.h"

//////////////////////////////////////////////////////////////////////

#ifndef SK_OVERRIDE
#  if defined(_MSC_VER)
#    define SK_OVERRIDE override
#  elif defined(__clang__)
# 300 "../../dist/include/skia/SkPostConfig.h"
     // Using __attribute__((override)) on clang does not appear to always work.
     // Clang defaults to C++03 and warns about using override. Squelch that. Intentionally no
     // push/pop here so all users of SK_OVERRIDE ignore the warning too. This is like passing
     // -Wno-c++11-extensions, except that GCC won't die (because it won't see this pragma).
#    pragma clang diagnostic ignored "-Wc++11-extensions"
#
#    if __has_feature(cxx_override_control)
#      define SK_OVERRIDE override
#    elif defined(__has_extension) && __has_extension(cxx_override_control)
# 309 "../../dist/include/skia/SkPostConfig.h"
#      define SK_OVERRIDE override
#    endif
# 311 "../../dist/include/skia/SkPostConfig.h"
#  endif
# 312 "../../dist/include/skia/SkPostConfig.h"
#  ifndef SK_OVERRIDE
#    define SK_OVERRIDE
#  endif
# 315 "../../dist/include/skia/SkPostConfig.h"
#endif
# 316 "../../dist/include/skia/SkPostConfig.h"

//////////////////////////////////////////////////////////////////////

#if !defined(SK_UNUSED)
#  define SK_UNUSED SK_ATTRIBUTE(unused)
#endif
# 322 "../../dist/include/skia/SkPostConfig.h"

#if !defined(SK_ATTR_DEPRECATED)
   // FIXME: we ignore msg for now...
#  define SK_ATTR_DEPRECATED(msg) SK_ATTRIBUTE(deprecated)
#endif
# 327 "../../dist/include/skia/SkPostConfig.h"

#if !defined(SK_ATTR_EXTERNALLY_DEPRECATED)
#  if !defined(SK_INTERNAL)
#    define SK_ATTR_EXTERNALLY_DEPRECATED(msg) SK_ATTR_DEPRECATED(msg)
#  else
# 332 "../../dist/include/skia/SkPostConfig.h"
#    define SK_ATTR_EXTERNALLY_DEPRECATED(msg)
#  endif
# 334 "../../dist/include/skia/SkPostConfig.h"
#endif
# 335 "../../dist/include/skia/SkPostConfig.h"

/**
 * If your judgment is better than the compiler's (i.e. you've profiled it),
 * you can use SK_ALWAYS_INLINE to force inlining. E.g.
 *     inline void someMethod() { ... }             // may not be inlined
 *     SK_ALWAYS_INLINE void someMethod() { ... }   // should always be inlined
 */
#if !defined(SK_ALWAYS_INLINE)
#endif
# 369 "../../dist/include/skia/SkPostConfig.h"

//////////////////////////////////////////////////////////////////////

#ifndef SK_SIZE_T_SPECIFIER
#  if defined(_MSC_VER)
#    define SK_SIZE_T_SPECIFIER "%Iu"
#  else
# 376 "../../dist/include/skia/SkPostConfig.h"
#    define SK_SIZE_T_SPECIFIER "%zu"
#  endif
# 378 "../../dist/include/skia/SkPostConfig.h"
#endif
# 379 "../../dist/include/skia/SkPostConfig.h"

//////////////////////////////////////////////////////////////////////

#ifndef SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
#  define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 1
#endif
# 385 "../../dist/include/skia/SkPostConfig.h"

//////////////////////////////////////////////////////////////////////

#ifndef SK_ATOMICS_PLATFORM_H
#  if defined(_MSC_VER)
#    define SK_ATOMICS_PLATFORM_H "../../src/ports/SkAtomics_win.h"
#  else
# 392 "../../dist/include/skia/SkPostConfig.h"
#    define SK_ATOMICS_PLATFORM_H "../../src/ports/SkAtomics_sync.h"
#  endif
#  if SK_HAS_COMPILER_FEATURE(thread_sanitizer)
#    define SK_BARRIERS_PLATFORM_H "../../src/ports/SkBarriers_tsan.h"
#  elif defined(SK_CPU_ARM32) || defined(SK_CPU_ARM64)
# 408 "../../dist/include/skia/SkPostConfig.h"
#    define SK_BARRIERS_PLATFORM_H "../../src/ports/SkBarriers_arm.h"
#  else
# 410 "../../dist/include/skia/SkPostConfig.h"
#    define SK_BARRIERS_PLATFORM_H "../../src/ports/SkBarriers_x86.h"
#  endif
# 412 "../../dist/include/skia/SkPostConfig.h"
#endif
# 413 "../../dist/include/skia/SkPostConfig.h"


//////////////////////////////////////////////////////////////////////

#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/SkTypes.h"

/** \file SkTypes.h
*/

/** See SkGraphics::GetVersion() to retrieve these at runtime
 */
#define SKIA_VERSION_MAJOR  1
#define SKIA_VERSION_MINOR  0
#define SKIA_VERSION_PATCH  0

/*
    memory wrappers to be implemented by the porting layer (platform)
*/

 */
SK_API ;

/** Same as sk_calloc, but throws an exception instead of returning NULL on failure.
 */
SK_API ;

// bzero is safer than memset, but we can't rely on it, so... sk_bzero()


///////////////////////////////////////////////////////////////////////////////

#ifdef SK_OVERRIDE_GLOBAL_NEW
#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
# 77 "../../dist/include/skia/SkTypes.h"

inline void* operator new(size_t size) {
    return sk_malloc_throw(size);
}

inline void operator delete(void* p) {
    sk_free(p);
}
#endif
# 86 "../../dist/include/skia/SkTypes.h"

///////////////////////////////////////////////////////////////////////////////

#define SK_INIT_TO_AVOID_WARNING    = 0

#ifndef SkDebugf
    SK_API void SkDebugf(const char format[], ...);
#endif
# 94 "../../dist/include/skia/SkTypes.h"

#ifdef SK_DEBUG
    #define SkASSERT(cond)              SK_ALWAYSBREAK(cond)
    #define SkDEBUGFAIL(message)        SkASSERT(false && message)
    #define SkDEBUGCODE(code)           code
    #define SkDECLAREPARAM(type, var)   , type var
    #define SkPARAM(var)                , var
//  #define SkDEBUGF(args       )       SkDebugf##args
    #define SkDEBUGF(args       )       SkDebugf args
    #define SkAssertResult(cond)        SkASSERT(cond)
#else
# 105 "../../dist/include/skia/SkTypes.h"
    #define SkASSERT(cond)
    #define SkDEBUGFAIL(message)
    #define SkDEBUGCODE(code)
    #define SkDEBUGF(args)
    #define SkDECLAREPARAM(type, var)
    #define SkPARAM(var)

    // unlike SkASSERT, this guy executes its condition in the non-debug build
    #define SkAssertResult(cond)        cond
#endif
# 115 "../../dist/include/skia/SkTypes.h"

#define SkFAIL(message)                 SK_ALWAYSBREAK(false && message)

// We want to evaluate cond only once, and inside the SkASSERT somewhere so we see its string form.
// So we use the comma operator to make an SkDebugf that always returns false: we'll evaluate cond,
// and if it's true the assert passes; if it's false, we'll print the message and the assert fails.
#define SkASSERTF(cond, fmt, ...)       SkASSERT((cond) || (SkDebugf(fmt"\n", __VA_ARGS__), false))

#ifdef SK_DEVELOPER
    #define SkDEVCODE(code)             code
#else
# 126 "../../dist/include/skia/SkTypes.h"
    #define SkDEVCODE(code)
#endif
# 128 "../../dist/include/skia/SkTypes.h"

#ifdef SK_IGNORE_TO_STRING
    #define SK_TO_STRING_NONVIRT()
    #define SK_TO_STRING_VIRT()
    #define SK_TO_STRING_PUREVIRT()
    #define SK_TO_STRING_OVERRIDE()
#else
# 135 "../../dist/include/skia/SkTypes.h"
    // the 'toString' helper functions convert Sk* objects to human-readable
    // form in developer mode
    #define SK_TO_STRING_NONVIRT() void toString(SkString* str) const;
    #define SK_TO_STRING_VIRT() virtual void toString(SkString* str) const;
    #define SK_TO_STRING_PUREVIRT() virtual void toString(SkString* str) const = 0;
    #define SK_TO_STRING_OVERRIDE() virtual void toString(SkString* str) const SK_OVERRIDE;
#endif
# 142 "../../dist/include/skia/SkTypes.h"

template <bool>
struct SkCompileAssert {
};

// Uses static_cast<bool>(expr) instead of bool(expr) due to
 */
#define SK_REQUIRE_LOCAL_VAR(classname) \
    SK_COMPILE_ASSERT(false, missing_name_for_##classname)

///////////////////////////////////////////////////////////////////////

/**
 */
typedef uint8_t SkBool8;

#ifdef SK_DEBUG
    SK_API ;
    SK_API uint8_t     SkToU8(uintmax_t);
    SK_API ;
    SK_API ;
    SK_API int32_t     SkToS32(intmax_t);
    SK_API ;
    SK_API ;
    SK_API ;
    SK_API ;
#else
# 248 "../../dist/include/skia/SkTypes.h"
    #define SkToS8(x)   ((int8_t)(x))
    #define SkToU8(x)   ((uint8_t)(x))
    #define SkToS16(x)  ((int16_t)(x))
    #define SkToU16(x)  ((uint16_t)(x))
    #define SkToS32(x)  ((int32_t)(x))
    #define SkToU32(x)  ((uint32_t)(x))
    #define SkToInt(x)  ((int)(x))
    #define SkToUInt(x) ((unsigned)(x))
    #define SkToSizeT(x) ((size_t)(x))
#endif
#define SK_ARRAY_COUNT(array)       (sizeof(array) / sizeof(array[0]))

#define SkAlign2(x)     (((x) + 1) >> 1 << 1)
#define SkIsAlign2(x)   (0 == ((x) & 1))

/** The unique IDs in Skia reserve 0 has an invalid marker.
 */
#define SK_InvalidUniqueID  0

/****************************************************************************
    The rest of these only build with C++
*/
#ifdef __cplusplus

/** Faster than SkToBool for integral conditions. Returns 0 or 1
*/
    

private:
    void*       fPtr;
    size_t      fSize;  // can be larger than the requested size (see kReuse)
    uint32_t    fStorage[(kSize + 3) >> 2];
};
// Can't guard the constructor because it's a template class.

#endif /* C++ */
# 673 "../../dist/include/skia/SkTypes.h"

#endif
# 675 "../../dist/include/skia/SkTypes.h"
# 15 "../../dist/include/skia/GrTypes.h" 2
#if 0 /* expanded by -frewrite-includes */
#if defined(__APPLE_CPP__) || defined(__APPLE_CC__)
    #if 0 /* expanded by -frewrite-includes */
#include <TargetConditionals.h>
#endif /* expanded by -frewrite-includes */
# 29 "../../dist/include/skia/GrConfig.h"
#endif
# 30 "../../dist/include/skia/GrConfig.h"

/**
 * GR_GEOM_BUFFER_MAP_THRESHOLD gives a threshold (in bytes) for when Gr should
 * map a GrGeometryBuffer to update its contents. It will use map() if the
 * size of the updated region is greater than the threshold. Otherwise it will
 * use updateData().
 */
#if !defined(GR_GEOM_BUFFER_MAP_THRESHOLD)
    #define GR_GEOM_BUFFER_MAP_THRESHOLD (1 << 15)
#endif
# 208 "../../dist/include/skia/GrConfig.h"

/**
 * GR_DEFAULT_RESOURCE_CACHE_MB_LIMIT gives a threshold (in megabytes) for the
 * maximum size of the texture cache in vram. The value is only a default and
 * can be overridden at runtime.
 */
#if !defined(GR_DEFAULT_RESOURCE_CACHE_MB_LIMIT)
    #define GR_DEFAULT_RESOURCE_CACHE_MB_LIMIT 96
#endif
# 217 "../../dist/include/skia/GrConfig.h"

/**
 * GR_DEFAULT_RESOURCE_CACHE_COUNT_LIMIT specifies the maximum number of
 * textures the texture cache can hold in vram. The value is only a default and
#if 0 /* expanded by -frewrite-includes */
#include "SkMath.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkMath.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkMath_DEFINED
#define SkMath_DEFINED

 */
#define SkSqrt32(n)         SkSqrtBits(n, 15)

//! Returns the number of leading zero bits (0...32)
;

#ifndef SkCLZ
    #if defined(_MSC_VER) && _MSC_VER >= 1400
        #if 0 /* expanded by -frewrite-includes */
#include <intrin.h>
#endif /* expanded by -frewrite-includes */
# 77 "../../dist/include/skia/SkMath.h"

        static inline int SkCLZ(uint32_t mask) {
            if (mask) {
                DWORD index;
                _BitScanReverse(&index, mask);
                return index ^ 0x1F;
            } else {
                return 32;
            }
        }
    #elif defined(SK_CPU_ARM32) || defined(__GNUC__) || defined(__clang__)
# 88 "../../dist/include/skia/SkMath.h"
        static inline int SkCLZ(uint32_t mask) {
            // __builtin_clz(0) is undefined, so we have to detect that case.
            return mask ? __builtin_clz(mask) : 32;
        }
    #else
# 93 "../../dist/include/skia/SkMath.h"
        #define SkCLZ(x)    SkCLZ_portable(x)
    #endif
# 95 "../../dist/include/skia/SkMath.h"
#endif
# 96 "../../dist/include/skia/SkMath.h"

/**
 *  Returns (value < 0 ? 0 : value) efficiently (i.e. no compares or branches)
 */


/** Given an integer and a positive (max) integer, return the value
 *  Return a*b/((1 << shift) - 1), rounding any fractional bits.
 *  Only valid if a and b are unsigned and <= 32767 and shift is > 0 and <= 8
 */


/**
 *  Return a*b/255, rounding any fractional bits.
 *  Only valid if a and b are unsigned and <= 32767.
 */


/**
 * Stores numer/denom and numer%denom into div and mod respectively.
 */


#endif
# 230 "../../dist/include/skia/SkMath.h"
# 17 "../../dist/include/skia/GrTypes.h" 2

//#define SK_SUPPORT_LEGACY_GRTYPES

    friend X operator & (X a, T b); \
////////////////////////////////////////////////////////////////////////////////

#ifdef SK_SUPPORT_LEGACY_GRTYPES

/**
 *  Macro to round n up to the next multiple of 4, or return it unchanged if
 *  n is already a multiple of 4
 */
#define GrALIGN4(n)     SkAlign4(n)
#define GrIsALIGN4(n)   SkIsAlign4(n)

template <typename T> const T& GrMin(const T& a, const T& b) {
    return (a < b) ? a : b;
}

template <typename T> const T& GrMax(const T& a, const T& b) {
    return (b < a) ? a : b;
}

/**
 *  Count elements in an array
 */
#define GR_ARRAY_COUNT(array)  SK_ARRAY_COUNT(array)

/**
 *  16.16 fixed point type
 */
typedef int32_t GrFixed;

#ifdef SK_DEBUG

static inline int16_t GrToS16(intptr_t x) {
    SkASSERT((int16_t)x == x);
    return (int16_t)x;
}

#else
# 90 "../../dist/include/skia/GrTypes.h"

#define GrToS16(x)  x

#endif
# 94 "../../dist/include/skia/GrTypes.h"

#endif
# 96 "../../dist/include/skia/GrTypes.h"


template <size_t S> class GrAutoMalloc : public GrAutoMallocBaseType {
public:
    
    
    
private:
    typedef GrAutoMallocBaseType INHERITED;
};

#undef GrAutoMallocBaseType
#endif
# 731 "../../dist/include/skia/GrTypes.h"
# 15 "../../dist/include/skia/GrGLConfig.h" 2

/**
 * driver then the workaround doesn't help.
 *
 * The issue is tracked at:
 * http://code.google.com/p/chromium/issues/detail?id=114865
 *
 * When the workaround is enabled we will use the glBufferData / glBufferSubData
 * trick every 128 array buffer uploads.
 *
 * Hopefully we will understand this better and have a cleaner fix or get a
 * OS/driver level fix.
 */
#define GR_GL_MAC_BUFFER_OBJECT_PERFOMANCE_WORKAROUND   \
    (defined(SK_BUILD_FOR_MAC) &&                       \
     !GR_GL_USE_BUFFER_DATA_NULL_HINT)

#endif
typedef unsigned int GrGLuint;
typedef uint64_t GrGLuint64;
typedef float GrGLfloat;
typedef float GrGLclampf;
typedef double GrGLdouble;
typedef double GrGLclampd;
typedef void GrGLvoid;
#ifndef SK_IGNORE_64BIT_OPENGL_CHANGES
#ifdef _WIN64
typedef signed long long int GrGLintptr;
typedef signed long long int GrGLsizeiptr;
#else
# 55 "../../dist/include/skia/GrGLFunctions.h"
typedef signed long int GrGLintptr;
typedef signed long int GrGLsizeiptr;
#endif
# 58 "../../dist/include/skia/GrGLFunctions.h"
#else
# 59 "../../dist/include/skia/GrGLFunctions.h"
typedef signed long int GrGLintptr;
typedef signed long int GrGLsizeiptr;
#endif
# 62 "../../dist/include/skia/GrGLFunctions.h"

///////////////////////////////////////////////////////////////////////////////

extern "C" {
    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLActiveTextureProc)(GrGLenum texture);
    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLAttachShaderProc)(GrGLuint program, GrGLuint shader);
    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBeginQueryProc)(GrGLenum target, GrGLuint id);
    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBindAttribLocationProc)(GrGLuint program, GrGLuint index, const char* name);
    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLBindBufferProc)(GrGLenum target, GrGLuint buffer);
    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLPathTexGenProc)(GrGLenum texCoordSet, GrGLenum genMode, GrGLint components, const GrGLfloat *coeffs);
    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCoverFillPathProc)(GrGLuint path, GrGLenum coverMode);
    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCoverStrokePathProc)(GrGLuint name, GrGLenum coverMode);
    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCoverFillPathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid *paths, GrGLuint pathBase, GrGLenum coverMode, GrGLenum transformType, const GrGLfloat *transformValues);
    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLCoverStrokePathInstancedProc)(GrGLsizei numPaths, GrGLenum pathNameType, const GrGLvoid *paths, GrGLuint pathBase, GrGLenum coverMode, GrGLenum transformType, const GrGLfloat* transformValues);

    typedef GrGLvoid (GR_GL_FUNCTION_TYPE* GrGLProgramPathFragmentInputGenProc)(GrGLuint program, GrGLint location, GrGLenum genMode, GrGLint components,const GrGLfloat *coeffs);
}  // extern "C"

#endif
# 253 "../../dist/include/skia/GrGLFunctions.h"
# 12 "../../dist/include/skia/GrGLInterface.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GrGLExtensions.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrGLExtensions.h" 1
/*
 * Copyright 2013 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrGLExtensions_DEFINED
#define GrGLExtensions_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrGLFunctions.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/GrGLExtensions.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkString.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkString.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkString_DEFINED
#define SkString_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkScalar.h"
/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkFixed_DEFINED
#define SkFixed_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/SkFixed.h"

/** \file SkFixed.h

    Types and macros for 16.16 fixed point
*/

/** 32 bit signed integer used to represent fractions values with 16 bits to the right of the decimal point
*/
typedef int32_t             SkFixed;
#define SK_Fixed1           (1 << 16)
#define SK_FixedHalf        (1 << 15)
#define SK_FixedMax         (0x7FFFFFFF)
#define SK_FixedMin         (-SK_FixedMax)
#define SK_FixedNaN         ((int) 0x80000000)
#define SK_FixedPI          (0x3243F)
#define SK_FixedSqrt2       (92682)
#define SK_FixedTanPIOver8  (0x6A0A)
#define SK_FixedRoot2Over2  (0xB505)
#ifdef SkLONGLONG
    inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b)
    {
        return (SkFixed)((int64_t)a * b >> 16);
    }
    #define SkFixedMul(a,b)     SkFixedMul_longlong(a,b)
#endif
# 107 "../../dist/include/skia/SkFixed.h"

#if defined(SK_CPU_ARM32)
    /* This guy does not handle NaN or other obscurities, but is faster than
       than (int)(x*65536).  When built on Android with -Os, needs forcing
       to inline or we lose the speed benefit.
    */
    SK_ALWAYS_INLINE SkFixed SkFloatToFixed_arm(float x)
    {
#endif
# 148 "../../dist/include/skia/SkFixed.h"

#ifndef SkFixedMul
    #define SkFixedMul(x, y)    SkFixedMul_portable(x, y)
#endif
# 152 "../../dist/include/skia/SkFixed.h"

///////////////////////////////////////////////////////////////////////////////

typedef int64_t SkFixed48;

#define SkIntToFixed48(x)       ((SkFixed48)(x) << 48)
#define SkFixed48ToInt(x)       ((int)((x) >> 48))
#define SkFixedToFixed48(x)     ((SkFixed48)(x) << 32)
#define SkFixed48ToFixed(x)     ((SkFixed)((x) >> 32))
#define SkFloatToFixed48(x)     ((SkFixed48)((x) * (65536.0f * 65536.0f * 65536.0f)))

#define SkScalarToFixed48(x)    SkFloatToFixed48(x)

#endif
# 166 "../../dist/include/skia/SkFixed.h"
# 12 "../../dist/include/skia/SkScalar.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkFloatingPoint.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkFloatingPoint.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkFloatingPoint_DEFINED
#define SkFloatingPoint_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkFloatingPoint.h"

#if 0 /* expanded by -frewrite-includes */
#include <math.h>
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/skia/SkFloatingPoint.h"
extern const uint32_t gIEEENotANumber;
extern const uint32_t gIEEEInfinity;
extern const uint32_t gIEEENegativeInfinity;

#define SK_FloatNaN                 (*SkTCast<const float*>(&gIEEENotANumber))
#define SK_FloatInfinity            (*SkTCast<const float*>(&gIEEEInfinity))
#define SK_FloatNegativeInfinity    (*SkTCast<const float*>(&gIEEENegativeInfinity))

#if defined(__SSE__)
#if 0 /* expanded by -frewrite-includes */
#include <xmmintrin.h>
#endif /* expanded by -frewrite-includes */
# 123 "../../dist/include/skia/SkFloatingPoint.h"
#elif defined(__ARM_NEON__)
# 124 "../../dist/include/skia/SkFloatingPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include <arm_neon.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 1 3 4
/*===---- arm_neon.h - ARM Neon intrinsics ---------------------------------===
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 *
 *===-----------------------------------------------------------------------===
 */

#ifndef __ARM_NEON_H
#define __ARM_NEON_H

#if defined(__arm64)
#if 0 /* expanded by -frewrite-includes */
#include "arm64_neon_internal.h"
#endif /* expanded by -frewrite-includes */
# 29 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4
#else
# 30 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4

#if !defined(__ARM_NEON)
#error "NEON support not enabled"
#endif
# 34 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4

#if 0 /* expanded by -frewrite-includes */
#include <stdint.h>
#endif /* expanded by -frewrite-includes */
# 36 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4

typedef float float32_t;
typedef __attribute__((neon_vector_type(2)))  uint64_t uint64x2_t;
typedef __attribute__((neon_vector_type(4)))  float16_t float16x4_t;
typedef __attribute__((neon_vector_type(8)))  float16_t float16x8_t;
typedef __attribute__((neon_vector_type(2)))  float32_t float32x2_t;
typedef __attribute__((neon_vector_type(4)))  float32_t float32x4_t;
#ifdef __aarch64__
typedef __attribute__((neon_vector_type(1)))  float64_t float64x1_t;
typedef __attribute__((neon_vector_type(2)))  float64_t float64x2_t;
#endif
# 76 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4
typedef __attribute__((neon_polyvector_type(8)))  poly8_t poly8x8_t;
typedef __attribute__((neon_polyvector_type(16))) poly8_t poly8x16_t;
typedef __attribute__((neon_polyvector_type(4)))  poly16_t poly16x4_t;
typedef __attribute__((neon_polyvector_type(8)))  poly16_t poly16x8_t;
#ifdef __aarch64__
typedef __attribute__((neon_polyvector_type(1)))  poly64_t poly64x1_t;
typedef __attribute__((neon_polyvector_type(2)))  poly64_t poly64x2_t;
#endif
# 84 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4

typedef struct int8x8x2_t {
  int8x8_t val[2];
} int8x8x2_t;

typedef struct int8x16x2_t {
  int8x16_t val[2];
} int8x16x2_t;

typedef struct int16x4x2_t {
  int16x4_t val[2];
} int16x4x2_t;

  poly8x8_t val[2];
} poly8x8x2_t;

typedef struct poly8x16x2_t {
  poly8x16_t val[2];
} poly8x16x2_t;

typedef struct poly16x4x2_t {
  poly16x4_t val[2];
} poly16x4x2_t;

typedef struct poly16x8x2_t {
  poly16x8_t val[2];
} poly16x8x2_t;

#ifdef __aarch64__
typedef struct poly64x1x2_t {
  poly64x1_t val[2];
} poly64x1x2_t;

typedef struct poly64x2x2_t {
  poly64x2_t val[2];
} poly64x2x2_t;

#endif
# 201 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4
typedef struct int8x8x3_t {
  int8x8_t val[3];
} int8x8x3_t;

typedef struct int8x16x3_t {
  int8x16_t val[3];

#ifdef __aarch64__
__ai poly128_t vmull_p64(poly64_t __a, poly64_t __b) {
  return (poly128_t)__builtin_neon_vmull_p64(__a, __b); }

__ai int16x8_t vmovl_high_s8(int8x16_t __a) {
  int8x8_t __a1 = vget_high_s8(__a);
  return (int16x8_t)vshll_n_s8(__a1, 0); }
__ai int32x4_t vmovl_high_s16(int16x8_t __a) {
  int16x4_t __a1 = vget_high_s16(__a);
  return (int32x4_t)vshll_n_s16(__a1, 0); }
__ai int16x8_t vmovn_high_s32(int16x4_t __a, int32x4_t __b) {
  int16x4_t __a1 = vmovn_s32(__b);
  return __builtin_shufflevector(__a, __a1, 0, 1, 2, 3, 4, 5, 6, 7); }
__ai int32x4_t vmovn_high_s64(int32x2_t __a, int64x2_t __b) {
  int32x2_t __a1 = vmovn_s64(__b);
  return __builtin_shufflevector(__a, __a1, 0, 1, 2, 3); }
__ai uint8x16_t vmovn_high_u16(uint8x8_t __a, uint16x8_t __b) {
  uint8x8_t __a1 = vmovn_u16(__b);
  return __builtin_shufflevector(__a, __a1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15); }
__ai uint16x8_t vmovn_high_u32(uint16x4_t __a, uint32x4_t __b) {
  uint16x4_t __a1 = vmovn_u32(__b);
  return __builtin_shufflevector(__a, __a1, 0, 1, 2, 3, 4, 5, 6, 7); }
__ai uint32x4_t vmovn_high_u64(uint32x2_t __a, uint64x2_t __b) {
  uint32x2_t __a1 = vmovn_u64(__b);
  return __builtin_shufflevector(__a, __a1, 0, 1, 2, 3); }

#ifdef __ARM_FEATURE_CRYPTO
__ai uint8x16_t vaesdq_u8(uint8x16_t __a, uint8x16_t __b) {
  return (uint8x16_t)__builtin_neon_vaesdq_v((int8x16_t)__a, (int8x16_t)__b, 48); }

__ai uint8x16_t vaeseq_u8(uint8x16_t __a, uint8x16_t __b) {
__ai uint32x4_t vsha256su0q_u32(uint32x4_t __a, uint32x4_t __b) {
  return (uint32x4_t)__builtin_neon_vsha256su0q_v((int8x16_t)__a, (int8x16_t)__b, 50); }

__ai uint32x4_t vsha256su1q_u32(uint32x4_t __a, uint32x4_t __b, uint32x4_t __c) {
  return (uint32x4_t)__builtin_neon_vsha256su1q_v((int8x16_t)__a, (int8x16_t)__b, (int8x16_t)__c, 50); }

#endif
# 9665 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4

#endif
# 9667 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4

#undef __ai

#endif /* not __arm64 */
# 9671 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4

#endif /* __ARM_NEON_H */
# 9673 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/arm_neon.h" 3 4
# 125 "../../dist/include/skia/SkFloatingPoint.h" 2
#endif
# 126 "../../dist/include/skia/SkFloatingPoint.h"

// Fast, approximate inverse square root.
// Compare to name-brand "1.0f / sk_float_sqrt(x)".  Should be around 10x faster on SSE, 2x on NEON.


#endif
# 162 "../../dist/include/skia/SkFloatingPoint.h"
# 13 "../../dist/include/skia/SkScalar.h" 2

//#define SK_SUPPORT_DEPRECATED_SCALARROUND


#ifndef SkTemplates_DEFINED
#define SkTemplates_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkTemplates.h"
#if 0 /* expanded by -frewrite-includes */
#include <limits.h>
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/SkTemplates.h"
#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
template <int N, typename T> class SkAlignedSTStorage : SkNoncopyable {
public:
    /**
     * Returns void* because this object does not initialize the
     * memory. Use placement new for types that require a cons.
     */
    
private:
    SkAlignedSStorage<sizeof(T)*N> fStorage;
};

#endif
# 480 "../../dist/include/skia/SkTemplates.h"
# 14 "../../dist/include/skia/SkTArray.h" 2

template <typename T, bool MEM_COPY = false> class SkTArray;
    

    

    

    

private:
    SkAlignedSTStorage<N,T> fStorage;
};

#endif
# 530 "../../dist/include/skia/SkTArray.h"
# 15 "../../dist/include/skia/SkString.h" 2


#endif
# 248 "../../dist/include/skia/SkString.h"
# 13 "../../dist/include/skia/GrGLExtensions.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkTArray.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/GrGLExtensions.h"

struct GrGLInterface;

/**
 * This helper queries the current GL context for its extensions, remembers them, and can be
 * queried. It supports both glGetString- and glGetStringi-style extension string APIs and will
 * use the latter if it is available.
 */
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkRefCnt.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkRefCnt_DEFINED
#define SkRefCnt_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkDynamicAnnotations.h"
#if SK_DYNAMIC_ANNOTATIONS_ENABLED

extern "C" {
// TSAN provides these hooks.
void AnnotateIgnoreReadsBegin(const char* file, int line);
void AnnotateIgnoreReadsEnd(const char* file, int line);
void AnnotateIgnoreWritesBegin(const char* file, int line);
void AnnotateIgnoreWritesEnd(const char* file, int line);
void AnnotateBenignRaceSized(const char* file, int line,
                             const volatile void* addr, long size, const char* desc);
}  // extern "C"

// SK_ANNOTATE_UNPROTECTED_READ can wrap any variable read to tell TSAN to ignore that it appears to
// be a racy read.  This should be used only when we can make an external guarantee that though this
// particular read is racy, it is being used as part of a mechanism which is thread safe.  Examples:
//   - the first check in double-checked locking;
#define SK_ANNOTATE_BENIGN_RACE(ptr)

#endif
# 65 "../../dist/include/skia/SkDynamicAnnotations.h"

// Can be used to wrap values that are intentionally racy, usually small mutable cached values, e.g.
//   - SkMatrix type mask
//   - SkPixelRef genIDs
template <typename T>
class SkTRacy {
public:
    operator const T() const {
        return SK_ANNOTATE_UNPROTECTED_READ(fVal);
    }

    SkTRacy& operator=(const T& val) {

    

    

    
          T* get()       { return &fVal; }

    
          

private:
    T fVal;
};

#endif//SkDynamicAnnotations_DEFINED
# 114 "../../dist/include/skia/SkDynamicAnnotations.h"
# 14 "../../dist/include/skia/SkRefCnt.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkThread.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkThread.h" 1
/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkThread_DEFINED
#define SkThread_DEFINED

static void sk_membar_acquire__after_atomic_dec();

/** If sk_atomic_conditional_inc does not act as an acquire (L/SL) barrier,
 * Copyright 2013 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkMutex_pthread_DEFINED
#define SkMutex_pthread_DEFINED

/** Posix pthread_mutex based mutex. */

#if 0 /* expanded by -frewrite-includes */
#include <errno.h>
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/usr/include/errno.h" 1 3 4
/*
 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 
 * This file contains Original Code and/or Modifications of Original Code
 * as defined in and that are subject to the Apple Public Source License
 * Version 2.0 (the 'License'). You may not use this file except in
 * compliance with the License. Please obtain a copy of the License at
 * http://www.opensource.apple.com/apsl/ and read it before using this
 * file.
 * 
 * The Original Code and all software distributed under the License are
 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/SkMutex_pthread.h"

// This isn't technically portable, but on Linux and Android pthread_t is some sort of int, and
// on Darwin it's a pointer.  So assuming pthread_self() never returns 0, it works as a sentinel.
SkDEBUGCODE(static const pthread_t kNoOwner = 0;)

// A SkBaseMutex is a POD structure that can be directly initialized
// at declaration time with SK_DECLARE_STATIC/GLOBAL_MUTEX. This avoids the
// generation of a static initializer in the final machine code (and
// a corresponding static finalizer).
struct SkBaseMutex {
    
    
    

    
};

#define SK_BASE_MUTEX_INIT { PTHREAD_MUTEX_INITIALIZER, SkDEBUGCODE(0) }

// Using POD-style initialization prevents the generation of a static initializer.
//
// Without magic statics there are no thread safety guarantees on initialization
// of local statics (even POD). As a result, it is illegal to use
// SK_DECLARE_STATIC_MUTEX in a function.
//
// Because SkBaseMutex is not a primitive, a static SkBaseMutex cannot be
// initialized in a class with this macro.
#define SK_DECLARE_STATIC_MUTEX(name) namespace {} static SkBaseMutex name = SK_BASE_MUTEX_INIT

#endif
    /** Assert that we're holding the mutex. */
    

private:
    SkBaseMutex* fMutex;
};
#define SkAutoMutexAcquire(...) SK_REQUIRE_LOCAL_VAR(SkAutoMutexAcquire)

#endif
# 144 "../../dist/include/skia/SkThread.h"
# 15 "../../dist/include/skia/SkRefCnt.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkInstCnt.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkInstCnt.h" 1
/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkInstCnt_DEFINED
#define SkInstCnt_DEFINED

/*
 * The instance counting system consists of three macros that create the
 * instance counting machinery. A class is added to the system by adding:
 *   SK_DECLARE_INST_COUNT at the top of its declaration for derived classes
 *   SK_DECLARE_INST_COUNT_ROOT at the top of its declaration for a root class
 * At the end of an application a call to all the "root" objects'
 * CheckInstanceCount methods should be made
 */
#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 21 "../../dist/include/skia/SkInstCnt.h"

#if SK_ENABLE_INST_COUNT
// Static variables inside member functions below may be defined multiple times
// if Skia is being used as a dynamic library. Instance counting should be on
// only for static builds. See bug skia:2058.
#if defined(SKIA_DLL)
#error Instance counting works only when Skia is built as a static library.
#endif
# 29 "../../dist/include/skia/SkInstCnt.h"

            SkInstanceCountHelper::GetChildren()->push_back(childCheckInstCnt); \
        }                                                                   \
    }

#else
# 135 "../../dist/include/skia/SkInstCnt.h"
// Typically SK_ENABLE_INST_COUNT=0. Make sure the class declares public typedef INHERITED by
// causing a compile-time error if the typedef is missing. This way SK_ENABLE_INST_COUNT=1 stays
// compiling.
#define SK_DECLARE_INST_COUNT(className) static void AddInstChild() { INHERITED::AddInstChild(); }
#define SK_DECLARE_INST_COUNT_ROOT(className) static void AddInstChild() { }
#endif
# 141 "../../dist/include/skia/SkInstCnt.h"

// Following are deprecated. They are defined only for backwards API compatibility.
#define SK_DECLARE_INST_COUNT_TEMPLATE(className) SK_DECLARE_INST_COUNT(className)
#define SK_DEFINE_INST_COUNT(className)
#define SK_DEFINE_INST_COUNT_TEMPLATE(templateInfo, className)

#endif // SkInstCnt_DEFINED
# 148 "../../dist/include/skia/SkInstCnt.h"
# 16 "../../dist/include/skia/SkRefCnt.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkTemplates.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/skia/SkRefCnt.h"

/** \class SkRefCntBase

    SkRefCntBase is the base class for objects that may be shared by multiple
    objects. When an existing owner wants to share a reference, it calls ref().
    When an owner wants to release its reference, it calls unref(). When the
     */
    void internal_dispose_restore_refcnt_to_1() const {
#ifdef SK_DEBUG
        SkASSERT(0 == fRefCnt);
        fRefCnt = 1;
#endif
# 103 "../../dist/include/skia/SkRefCnt.h"
    }

private:
    /**
     *  Called when the ref count goes to 0.
     */
    virtual void internal_dispose() const {
        this->internal_dispose_restore_refcnt_to_1();
        SkDELETE(this);
    }

    // The following friends are those which override internal_dispose()
    // and conditionally call SkRefCnt::internal_dispose().
    friend class SkWeakRefCnt;

    mutable int32_t fRefCnt;

    typedef SkNoncopyable INHERITED;
};

#ifdef SK_REF_CNT_MIXIN_INCLUDE
// It is the responsibility of the following include to define the type SkRefCnt.
// This SkRefCnt should normally derive from SkRefCntBase.
#if 0 /* expanded by -frewrite-includes */
#include SK_REF_CNT_MIXIN_INCLUDE
#endif /* expanded by -frewrite-includes */
# 127 "../../dist/include/skia/SkRefCnt.h"
#else
# 128 "../../dist/include/skia/SkRefCnt.h"
class SK_API SkRefCnt : public SkRefCntBase { };
#endif
# 130 "../../dist/include/skia/SkRefCnt.h"

///////////////////////////////////////////////////////////////////////////////

/** Helper macro to safely assign one SkRefCnt[TS]* to another, checking for
    null in on each side of the assignment, and ensuring that ref() is called
    before unref(), in case the two pointers point to the same object.
 */
#define SkRefCnt_SafeAssign(dst, src)   \
    do {                                \
     *  skAutoTUnrefInstance->ref() and skAutoTUnrefInstance->unref().
     */
    
    

private:
    T*  fObj;
};
// Can't use the #define trick below to guard a bare SkAutoTUnref(...) because it's templated. :(

class SkAutoUnref : public SkAutoTUnref<SkRefCnt> {
public:
    
};
#define SkAutoUnref(...) SK_REQUIRE_LOCAL_VAR(SkAutoUnref)

#endif
# 251 "../../dist/include/skia/SkRefCnt.h"
# 14 "../../dist/include/skia/GrGLInterface.h" 2

////////////////////////////////////////////////////////////////////////////////

/**
 * Rather than depend on platform-specific GL headers and libraries, we require
 * the client to provide a struct of GL function pointers. This struct can be
 * specified per-GrContext as a parameter to GrContext::Create. If NULL is
 * passed to Create then a "default" GL interface is created. If the default is
 * also NULL GrContext creation will fail.
 *
 * The default interface is returned by GrGLDefaultInterface. This function's
 * implementation is platform-specific. Several have been provided, along with
 * an implementation that simply returns NULL.
    } fFunctions;

    // Per-GL func callback
#if GR_GL_PER_GL_FUNC_CALLBACK
    GrGLInterfaceCallbackProc fCallback;
    GrGLInterfaceCallbackData fCallbackData;
#endif
# 346 "../../dist/include/skia/GrGLInterface.h"
};

#endif
# 349 "../../dist/include/skia/GrGLInterface.h"
# 12 "/Users/luser/build/mozilla-central/gfx/gl/SkiaGLGlue.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "skia/GrContext.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrContext.h" 1
/*
 * Copyright 2010 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrContext_DEFINED
#define GrContext_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrClipData.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrClipData.h" 1
/*
 * Copyright 2010 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrClip_DEFINED
#define GrClip_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkClipStack.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkClipStack.h" 1

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
#ifndef SkClipStack_DEFINED
#define SkClipStack_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkDeque.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkDeque.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkDeque_DEFINED
#define SkDeque_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkDeque.h"

/*
 * The deque class works by blindly creating memory space of a specified element
 * size. It manages the memory as a doubly linked list of blocks each of which
 * can contain multiple elements. Pushes and pops add/remove blocks from the

#endif
# 139 "../../dist/include/skia/SkDeque.h"
# 12 "../../dist/include/skia/SkClipStack.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkPath.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkPath.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkPath_DEFINED
#define SkPath_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkInstCnt.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkPath.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkMatrix.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkMatrix.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkMatrix_DEFINED
#define SkMatrix_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkDynamicAnnotations.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkMatrix.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkRect.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkRect.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkRect_DEFINED
#define SkRect_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkPoint.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkPoint.h" 1
/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkPoint_DEFINED
#define SkPoint_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkMath.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/SkPoint.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkScalar.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/skia/SkPoint.h"

/** \struct SkIPoint16

    SkIPoint holds two 16 bit integer coordinates
*/
struct SkIPoint16 {
    int16_t fX, fY;

    

    
    

    
typedef SkPoint SkVector;

#endif
# 534 "../../dist/include/skia/SkPoint.h"
# 14 "../../dist/include/skia/SkRect.h" 2
#if 0 /* expanded by -frewrite-includes */

    
};

#endif
# 111 "../../dist/include/skia/SkSize.h"
# 15 "../../dist/include/skia/SkRect.h" 2

/** \struct SkIRect

     *  in which case this rect is set to empty and false is returned.
     */
    bool setBoundsCheck(const SkPoint pts[], int count);

    

    

#ifdef SK_DEVELOPER
    /**
     * Dumps the rect using SkDebugf. This is intended for Skia development debugging. Don't
     * rely on the existence of this function or the formatting of its output.
     */
    void dump() const {
        SkDebugf("{ l: %f, t: %f, r: %f, b: %f }", fLeft, fTop, fRight, fBottom);
    }
#endif
# 844 "../../dist/include/skia/SkRect.h"

};

#endif
# 848 "../../dist/include/skia/SkRect.h"
# 15 "../../dist/include/skia/SkMatrix.h" 2

class SkString;

// TODO: can we remove these 3 (need to check chrome/android)
typedef SkScalar SkPersp;
#define SkScalarToPersp(x) (x)
#define SkPerspToScalar(x) (x)

};

#endif
# 721 "../../dist/include/skia/SkMatrix.h"
# 15 "../../dist/include/skia/SkPath.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkPathRef.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkPathRef.h" 1

/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkPathRef_DEFINED
#define SkPathRef_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkDynamicAnnotations.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/skia/SkPathRef.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkMatrix.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkPathRef.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkPoint.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/SkPathRef.h"
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkTDArray_DEFINED
#define SkTDArray_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkTDArray.h"

template <typename T> class SkTDArray {
public:
    

    

    

#ifdef SK_DEBUG
    
#endif
# 349 "../../dist/include/skia/SkTDArray.h"

private:
#ifdef SK_DEBUG
    enum {
        kDebugArraySize = 16
    };
    typedef T ArrayT[kDebugArraySize];
    ArrayT* fData;
#endif
# 358 "../../dist/include/skia/SkTDArray.h"
    T*      fArray;
    int     fReserve;
    int     fCount;

    /**
     *  Adjusts the number of elements in the array.
     *  This is the same as calling setCount(count() + delta).
     */
    

    /**
     *  Increase the storage allocation such that it can hold (fCount + extra)
     *  elements.
     *  It never shrinks the allocation, and it may increase the allocation by
     *  more than is strictly required, based on a private growth heuristic.
     *
     *  note: does NOT modify fCount
     */
    
};

#endif
# 390 "../../dist/include/skia/SkTDArray.h"
# 18 "../../dist/include/skia/SkPathRef.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <stddef.h> // ptrdiff_t
#endif /* expanded by -frewrite-includes */
# 1 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0/include/stddef.h" 1 3 4
/*===---- stddef.h - Basic type definitions --------------------------------===
    typedef SkRefCnt INHERITED;
};

#endif
# 463 "../../dist/include/skia/SkPathRef.h"
# 16 "../../dist/include/skia/SkPath.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkTDArray.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/skia/SkPath.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkRefCnt.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/skia/SkPath.h"

class SkReader32;

    void computeType() const;
    ;

    // to access fRadii directly
    friend class SkPath;
};

#endif
# 319 "../../dist/include/skia/SkRRect.h"
# 15 "../../dist/include/skia/SkClipStack.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkRegion.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkRegion.h" 1

/*
 * Copyright 2005 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkRegion_DEFINED
#define SkRegion_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkRect.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkRegion.h"

#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkTLazy.h" 1

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */



#ifndef SkTLazy_DEFINED
#define SkTLazy_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/SkTLazy.h"
#if 0 /* expanded by -frewrite-includes */
#include <new>
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/skia/SkTLazy.h"

template <typename T> class SkTLazy;
;

/**
 *  Efficient way to defer allocating/initializing a class until it is needed
 *  (if ever).
 */
template <typename T> class SkTLazy {

    

private:
    const T*    fObj;
    SkTLazy<T>  fLazy;
};

#endif
# 193 "../../dist/include/skia/SkTLazy.h"
# 18 "../../dist/include/skia/SkClipStack.h" 2

class SkCanvasClipVisitor;

// Because a single save/restore state can have multiple clips, this class
// stores the stack depth (fSaveCount) and clips (fDeque) separately.

        
        /**
         * Is the clip shape inverse filled.
         */
        

        /**
        * Replay this clip into the visitor.
        */
        ;

#ifdef SK_DEVELOPER
        /**
         * Dumps the element to SkDebugf. This is intended for Skia development debugging
         * Don't rely on the existence of this function or the formatting of its output.
         */
        void dump() const;
#endif
# 178 "../../dist/include/skia/SkClipStack.h"

    private:
        friend class SkClipStack;

        SkTLazy<SkPath> fPath;
        SkRRect         fRRect;
        int             fSaveCount; // save count of stack when this element was added.
        SkRegion::Op    fOp;
        Type            fType;
        bool            fDoAA;

        /* fFiniteBoundType and fFiniteBound are used to incrementally update the clip stack's

#endif
# 480 "../../dist/include/skia/SkClipStack.h"
# 12 "../../dist/include/skia/GrClipData.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GrSurface.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrSurface.h" 1
/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef GrSurface_DEFINED
#define GrSurface_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrTypes.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/skia/GrSurface.h"
#if 0 /* expanded by -frewrite-includes */
#include "GrGpuResource.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrGpuResource.h" 1
/*
 * Copyright 2014 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrGpuResource_DEFINED
#define GrGpuResource_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkInstCnt.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/GrGpuResource.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkTInternalLList.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkTInternalLList.h" 1
/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkTInternalLList_DEFINED
#define SkTInternalLList_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/SkTInternalLList.h"

/**
 * Helper class to automatically initialize the doubly linked list created pointers.
 */
template <typename T> class SkPtrWrapper {
        

        

        /**
         * Return the next/previous element in the list or NULL if at the end.
         */
        

        

    private:
        T* fCurr;
    };

#ifdef SK_DEBUG
    

    /**
     * Debugging-only method that uses the list back pointer to check if 'entry' is indeed in 'this'
     * list.
     */
    

    /**
     * Debugging-only method that laboriously counts the list entries.
     */
    
#endif // SK_DEBUG
# 264 "../../dist/include/skia/SkTInternalLList.h"

private:
    T* fHead;
    T* fTail;

    typedef SkNoncopyable INHERITED;
};

#endif
# 273 "../../dist/include/skia/SkTInternalLList.h"
# 13 "../../dist/include/skia/GrGpuResource.h" 2

class GrResourceCacheEntry;
class GrGpu;
class GrContext;

/**
 * Base class for objects that can be kept in the GrResourceCache.
#if 0 /* expanded by -frewrite-includes */
#include "SkRect.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/GrSurface.h"

class GrTexture;
class GrRenderTarget;
struct SkImageInfo;

class GrSurface : public GrGpuResource {
public:
    SK_DECLARE_INST_COUNT(GrSurface);

    /**
     * Retrieves the width of the surface.
     *
     * @param pixelOpsFlags See the GrContext::PixelOpsFlags enum.
     */
    virtual void writePixels(int left, int top, int width, int height,
                             GrPixelConfig config,
                             const void* buffer,
                             size_t rowBytes = 0,
                             uint32_t pixelOpsFlags = 0) = 0;

    /**
     * Write the contents of the surface to a PNG. Returns true if successful.
     * @param filename      Full path to desired file
     */
    bool savePixels(const char* filename);

protected:
    

    GrTextureDesc fDesc;

private:
    typedef GrGpuResource INHERITED;
};

#endif // GrSurface_DEFINED
# 151 "../../dist/include/skia/GrSurface.h"
# 13 "../../dist/include/skia/GrClipData.h" 2

struct SkIRect;

/**
 * GrClipData encapsulates the information required to construct the clip
 * masks. 'fOrigin' is only non-zero when saveLayer has been called

    ;
};

#endif
# 62 "../../dist/include/skia/GrClipData.h"
# 12 "../../dist/include/skia/GrContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GrColor.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrColor.h" 1

/*
 * Copyright 2010 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */



#ifndef GrColor_DEFINED
#define GrColor_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrTypes.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/GrColor.h"

/**
 * GrColor is 4 bytes for R, G, B, A, in a specific order defined below. The components are stored
 * premultiplied.
# 13 "../../dist/include/skia/GrContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GrPaint.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrPaint.h" 1

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef GrPaint_DEFINED
#define GrPaint_DEFINED



#ifndef GrEffectStage_DEFINED
#define GrEffectStage_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrBackendEffectFactory.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrBackendEffectFactory.h" 1
/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrBackendEffectFactory_DEFINED
#define GrBackendEffectFactory_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrTypes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/GrBackendEffectFactory.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkTemplates.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/skia/GrBackendEffectFactory.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkThread.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/GrBackendEffectFactory.h"
private:
};

#endif
# 145 "../../dist/include/skia/GrBackendEffectFactory.h"
# 15 "../../dist/include/skia/GrEffectStage.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GrEffect.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrEffect.h" 1
/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrEffect_DEFINED
#define GrEffect_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrColor.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/GrEffect.h"
#if 0 /* expanded by -frewrite-includes */
#include "GrEffectUnitTest.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrEffectUnitTest.h" 1
/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrEffectUnitTest_DEFINED
#define GrEffectUnitTest_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkRandom.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkRandom.h" 1
/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkRandom_DEFINED
#define SkRandom_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkScalar.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/SkRandom.h"

/** \class SkLCGRandom

    Utility class that implements pseudo random 32bit numbers using a fast
    linear equation. Unlike rand(), this class holds its own seed (initially
    set to 0), so that multiple instances can be used with no side-effects.
*/
class SkLCGRandom {
#define GR_DEFINE_EFFECT_TEST(Effect)                                               \
    GrEffectTestFactory Effect :: gTestFactory(Effect :: TestCreate)

#else // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
# 90 "../../dist/include/skia/GrEffectUnitTest.h"

// The unit test relies on static initializers. Just declare the TestCreate function so that
// its definitions will compile.
#define GR_DECLARE_EFFECT_TEST                                                      \
    static GrEffect* TestCreate(SkRandom*,                                          \
                                GrContext*,                                         \
                                const GrDrawTargetCaps&,                            \
                                GrTexture* dummyTextures[2])
#define GR_DEFINE_EFFECT_TEST(X)

#endif // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
# 101 "../../dist/include/skia/GrEffectUnitTest.h"
#endif
# 102 "../../dist/include/skia/GrEffectUnitTest.h"
# 13 "../../dist/include/skia/GrEffect.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GrTexture.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrTexture.h" 1

/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrTexture_DEFINED
#define GrTexture_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrSurface.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/skia/GrTexture.h"
#if 0 /* expanded by -frewrite-includes */
#include "GrRenderTarget.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrRenderTarget.h" 1
/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrRenderTarget_DEFINED
#define GrRenderTarget_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrSurface.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/GrRenderTarget.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkRect.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/skia/GrRenderTarget.h"

class GrStencilBuffer;
class GrTexture;
#include "SkRefCnt.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/skia/GrTexture.h"

class GrResourceKey;
class GrTextureParams;
class GrTextureImpl;

class GrTexture : public GrSurface {
public:
    /**
     *  Approximate number of bytes used by the texture
     */
    virtual size_t gpuMemorySize() const SK_OVERRIDE;

    // GrSurface overrides
#if 0 /* expanded by -frewrite-includes */
#include "SkShader.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkShader.h" 1
/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkShader_DEFINED
#define SkShader_DEFINED

#if 0 /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkColor.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkColor_DEFINED
#define SkColor_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkScalar.h"
#endif /* expanded by -frewrite-includes */
/** Define a function pointer type for combining a premultiplied src color
    and a 16bit device color.
*/
typedef uint16_t (*SkXfermodeProc16)(SkPMColor src, uint16_t dst);

#endif
# 170 "../../dist/include/skia/SkColor.h"
# 12 "../../dist/include/skia/SkBitmap.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkColorTable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkColorTable.h" 1

/*
 * Copyright 2012 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkColorTable_DEFINED
#define SkColorTable_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkColor.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkColorTable.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkFlattenable.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkFlattenable.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkFlattenable_DEFINED
#define SkFlattenable_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkRefCnt.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkFlattenable.h"

    typedef SkRefCnt INHERITED;
};

#endif
# 115 "../../dist/include/skia/SkFlattenable.h"
# 15 "../../dist/include/skia/SkColorTable.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkImageInfo.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkImageInfo.h" 1
/*
 * Copyright 2013 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkImageInfo_DEFINED
#define SkImageInfo_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkMath.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/SkImageInfo.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkSize.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/skia/SkImageInfo.h"

class SkWriteBuffer;
class SkReadBuffer;
    
    

    ;
    ;

    

    

    

    SkDEBUGCODE(void validate() const;)
};

#endif
#include "SkRefCnt.h"
#endif /* expanded by -frewrite-includes */
# 16 "../../dist/include/skia/SkBitmap.h"

struct SkMask;
struct SkIRect;
struct SkRect;
class SkPaint;
class SkPixelRef;
class SkPixelRefFactory;
class SkRegion;
class SkString;
class GrTexture;

/** \class SkBitmap

    The SkBitmap class specifies a raster bitmap. A bitmap has an integer width
    and height, and a format (colortype), and a pointer to the actual pixels.
    Bitmaps can be drawn into a SkCanvas, but they are also used to specify the
    target of a SkCanvas' drawing operations.
    A const SkBitmap exposes getAddr(), which lets a caller write its pixels;
    the constness is considered to apply to the bitmap's configuration, not
    its contents.
*/
class SK_API SkBitmap {
public:
    class SK_API Allocator;

#ifdef SK_SUPPORT_LEGACY_BITMAP_CONFIG
    enum Config {
        kNo_Config,         //!< bitmap has not been configured
        kA8_Config,         //!< 8-bits per pixel, with only alpha specified (0 is transparent, 0xFF is opaque)
    Config  getConfig() const { return this->config(); }
#endif
# 63 "../../dist/include/skia/SkBitmap.h"

    /**
     *  Default construct creates a bitmap with zero width and height, and no pixels.
     *  Its colortype is set to kUnknown_SkColorType.
     */
    ;

    /**

    /*  Unreference any pixelrefs or colortables
    */
    ;
    ;
     */
    

    

private:
    SkColorTable*    fCTable;
    const SkPMColor* fColors;
};
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkMask.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkMask_DEFINED
#define SkMask_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkRect.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkMask.h"

/** \class SkMask
    SkMask is used to describe alpha bitmaps, either 1bit, 8bit, or
    the 3-channel 3D format. These are passed to SkMaskFilter objects.
*/
 *
 *  Stack class used to manage the fImage buffer in a SkMask.
 *  When this object loses scope, the buffer is freed with SkMask::FreeImage().
 */
class SkAutoMaskFreeImage {
public:
    

    

private:
    uint8_t* fImage;
};
#define SkAutoMaskFreeImage(...) SK_REQUIRE_LOCAL_VAR(SkAutoMaskFreeImage)

#endif
 * found in the LICENSE file.
 */


#ifndef SkPaint_DEFINED
#define SkPaint_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkColor.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/SkPaint.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkDrawLooper.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkDrawLooper.h" 1

/*
 * Copyright 2011 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkDrawLooper_DEFINED
#define SkDrawLooper_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkBlurTypes.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkBlurTypes.h" 1
/*
 * Copyright 2014 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkBlurTypes_DEFINED
#define SkBlurTypes_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/SkBlurTypes.h"

enum SkBlurStyle {
    kNormal_SkBlurStyle,  //!< fuzzy inside and outside
    kSolid_SkBlurStyle,   //!< solid inside, fuzzy outside
    kOuter_SkBlurStyle,   //!< nothing inside, fuzzy outside
    kInner_SkBlurStyle,   //!< fuzzy inside, nothing outside

    kLastEnum_SkBlurStyle = kInner_SkBlurStyle
};

enum SkBlurQuality {
    kLow_SkBlurQuality,     //!< e.g. box filter
    kHigh_SkBlurQuality,    //!< e.g. 3-pass similar to gaussian

    kLastEnum_SkBlurQuality
};

#endif
# 30 "../../dist/include/skia/SkBlurTypes.h"
#include "SkXfermode.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkXfermode.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkXfermode_DEFINED
#define SkXfermode_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkFlattenable.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkXfermode.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkColor.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/SkXfermode.h"

class GrEffect;
class GrTexture;
class SkString;

/** \class SkXfermode
 *
 *  SkXfermode is the base class for objects that are called to implement custom
 *  "transfer-modes" in the drawing pipeline. The static function Create(Modes)
    /** The default implementation of xfer32/xfer16/xferA8 in turn call this
        method, 1 color at a time (upscaled to a SkPMColor). The default
        implmentation of this method just returns dst. If performance is
        important, your subclass should override xfer32/xfer16/xferA8 directly.

        This method will not be called directly by the client, so it need not
        be implemented if your subclass has overridden xfer32/xfer16/xferA8
    */
    ;

private:
    enum {
        kModeCount = kLastMode + 1
    };

    typedef SkFlattenable INHERITED;
};

#endif
# 241 "../../dist/include/skia/SkXfermode.h"
# 18 "../../dist/include/skia/SkPaint.h" 2
#ifdef SK_BUILD_FOR_ANDROID
#if 0 /* expanded by -frewrite-includes */
#include "SkPaintOptionsAndroid.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/skia/SkPaint.h"
#endif
# 21 "../../dist/include/skia/SkPaint.h"

class SkAnnotation;
class SkAutoGlyphCache;
class SkColorFilter;
# 1151 "../../dist/include/skia/SkPaint.h"
};

#endif
# 1154 "../../dist/include/skia/SkPaint.h"
# 17 "../../dist/include/skia/SkShader.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GrColor.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/skia/SkShader.h"

class SkPath;
class SkPicture;
class SkXfermode;
class GrContext;
class GrEffect;
};

#endif
# 480 "../../dist/include/skia/SkShader.h"
# 13 "../../dist/include/skia/GrTextureAccess.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/GrTextureAccess.h"

class GrTexture;

/**
 * Represents the filtering and tile modes used to access a texture. It is mostly used with
 * GrTextureAccess (defined below). Also, some of the texture cache methods require knowledge about
 * filtering and tiling to perform a cache lookup. If it wasn't for this latter usage this would

    /**
     * swizzle must be a string between one and four (inclusive) characters containing only 'r',
     * 'g', 'b',  and/or 'a'.
     */
    ;

    typedef SkNoncopyable INHERITED;
};

#endif
# 189 "../../dist/include/skia/GrTextureAccess.h"
# 15 "../../dist/include/skia/GrEffect.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "GrTypesPriv.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/GrTypesPriv.h" 1
/*
 * Copyright 2013 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrTypesPriv_DEFINED
#define GrTypesPriv_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "GrTypes.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/GrTypesPriv.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkTArray.h"
#endif /* expanded by -frewrite-includes */
# 13 "../../dist/include/skia/GrTypesPriv.h"

/**
 * Types of shader-language-specific boxed variables we can create. (Currently only GrGLShaderVars,
 * but should be applicable to other shader languages.)
 */
enum GrSLType {
    kVoid_GrSLType,
    kFloat_GrSLType,
    kVec2f_GrSLType,
    kVec3f_GrSLType,
    kVec4f_GrSLType,
    kMat33f_GrSLType,
    kMat44f_GrSLType,
static const int kGrEffectEdgeTypeCnt = kLast_GrEffectEdgeType + 1;









#endif
# 221 "../../dist/include/skia/GrTypesPriv.h"
# 16 "../../dist/include/skia/GrEffect.h" 2

class GrBackendEffectFactory;
class GrContext;
    virtual const GrBackendEffectFactory& getFactory() const = 0;

    /** Returns true if this and other effect conservatively draw identically. It can only return
        true when the two effects are of the same subclass (i.e. they return the same object from
        from getFactory()).

        A return value of true from isEqual() should not be used to test whether the effects would
        generate the same shader code. To test for identical code generation use the effects' keys
        computed by the GrBackendEffectFactory.
     */
    bool isEqual(const GrEffect& other) const {
        if (&this->getFactory() != &other.getFactory()) {
            return false;
        }
        bool result = this->onIsEqual(other);
#ifdef SK_DEBUG
        if (result) {
            this->assertEquality(other);
        }
#endif
# 87 "../../dist/include/skia/GrEffect.h"
        return result;
    }

    /** Human-meaningful string to identify this effect; may be embedded
        in generated shader code. */
    ;

    

    /** Returns the coordinate transformation at index. index must be valid according to
        numTransforms(). */
#include "SkShader.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/skia/GrEffectStage.h"

class GrEffectStage {
public:
    

    GrEffectStage(const GrEffectStage& other) {
        *this = other;
    }

    GrEffectStage& operator= (const GrEffectStage& other) {
        fCoordChangeMatrixSet = other.fCoordChangeMatrixSet;
        if (other.fCoordChangeMatrixSet) {
            fCoordChangeMatrix = other.fCoordChangeMatrix;

#endif
# 142 "../../dist/include/skia/GrEffectStage.h"
# 15 "../../dist/include/skia/GrPaint.h" 2

#if 0 /* expanded by -frewrite-includes */
#include "SkXfermode.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/skia/GrPaint.h"

/**
 * The paint describes how color and coverage are computed at each pixel by GrContext draw
 * functions and the how color is blended with the destination pixel.
 *
 * The paint allows installation of custom color and coverage stages. New types of stages are
 * created by subclassing GrEffect.
#if 0 /* expanded by -frewrite-includes */
#include "GrTexture.h"
#endif /* expanded by -frewrite-includes */
# 17 "../../dist/include/skia/GrContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkMatrix.h"
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/skia/GrContext.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkPathEffect.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkPathEffect.h" 1

/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */


#ifndef SkPathEffect_DEFINED
#define SkPathEffect_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkFlattenable.h"
#endif /* expanded by -frewrite-includes */
# 14 "../../dist/include/skia/SkPathEffect.h"
#if 0 /* expanded by -frewrite-includes */
#include "SkPath.h"
#endif /* expanded by -frewrite-includes */
# 15 "../../dist/include/skia/SkPathEffect.h"
 * found in the LICENSE file.
 */

#ifndef SkStrokeRec_DEFINED
#define SkStrokeRec_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkPaint.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/SkStrokeRec.h"

class SkPath;

class SkStrokeRec {
public:
    enum InitStyle {

    SkScalar        fWidth;
    SkScalar        fMiterLimit;
    SkPaint::Cap    fCap;
    SkPaint::Join   fJoin;
    bool            fStrokeAndFill;
};

#endif
# 108 "../../dist/include/skia/SkStrokeRec.h"
# 18 "../../dist/include/skia/SkPathEffect.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkTDArray.h"
#endif /* expanded by -frewrite-includes */
# 19 "../../dist/include/skia/SkPathEffect.h"

    ;
    ;

    typedef SkPairPathEffect INHERITED;
};

#endif
# 239 "../../dist/include/skia/SkPathEffect.h"
# 19 "../../dist/include/skia/GrContext.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "SkTypes.h"
#endif /* expanded by -frewrite-includes */
# 20 "../../dist/include/skia/GrContext.h"

class GrAARectRenderer;
class GrAutoScratchTexture;
     *
     * Note that the caller is assumed to accept and manage the ref to the
     * returned texture.
     */
    

    

    

private:
    GrContext*                    fContext;
    GrTexture*                    fTexture;
};

#endif
# 1154 "../../dist/include/skia/GrContext.h"
# 13 "/Users/luser/build/mozilla-central/gfx/gl/SkiaGLGlue.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "mozilla/gfx/HelpersSkia.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/mozilla/gfx/HelpersSkia.h" 1
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef MOZILLA_GFX_HELPERSSKIA_H_
#define MOZILLA_GFX_HELPERSSKIA_H_

#if 0 /* expanded by -frewrite-includes */
#include "2D.h"





class SkCanvasClipVisitor {
public:
    ;
    ;
    ;
    ;
};

#endif
# 1482 "../../dist/include/skia/SkCanvas.h"
# 11 "../../dist/include/mozilla/gfx/HelpersSkia.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "skia/SkDashPathEffect.h"
#endif /* expanded by -frewrite-includes */
# 1 "../../dist/include/skia/SkDashPathEffect.h" 1
/*
 * Copyright 2006 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkDashPathEffect_DEFINED
#define SkDashPathEffect_DEFINED

#if 0 /* expanded by -frewrite-includes */
#include "SkPathEffect.h"
#endif /* expanded by -frewrite-includes */
# 12 "../../dist/include/skia/SkDashPathEffect.h"

/** \class SkDashPathEffect

    SkDashPathEffect is a subclass of SkPathEffect that implements dashing
*/
class SK_API SkDashPathEffect : public SkPathEffect {
public:
    /** intervals: array containing an even number of entries (>=2), with
         the even indices specifying the length of "on" intervals, and the odd
         indices specifying the length of "off" intervals.
        count: number of elements in the intervals array
        phase: offset into the intervals array (mod the sum of all of the
         intervals).

#if 0 /* expanded by -frewrite-includes */
#include <vector>
#endif /* expanded by -frewrite-includes */
# 18 "../../dist/include/mozilla/gfx/HelpersSkia.h"

namespace mozilla {
namespace gfx {
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER 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.

  typedef T* RefPtrSkia::*unspecified_bool_type;
  

private:
  T* fObj;
};

// End of code imported from Skia.

}
}

#endif /* MOZILLA_GFX_HELPERSSKIA_H_ */
# 362 "../../dist/include/mozilla/gfx/HelpersSkia.h"
# 14 "/Users/luser/build/mozilla-central/gfx/gl/SkiaGLGlue.h" 2
  RefPtr<GLContext> mGLContext;
  mozilla::gfx::RefPtrSkia<GrGLInterface> mGrGLInterface;
  mozilla::gfx::RefPtrSkia<GrContext> mGrContext;
};

}
}

#else
# 48 "/Users/luser/build/mozilla-central/gfx/gl/SkiaGLGlue.h"

class GrContext;

namespace mozilla {
namespace gl {

class GLContext;

class SkiaGLGlue : public GenericAtomicRefCounted
{
public:
  SkiaGLGlue(GLContext* context);
  GLContext* GetGLContext() const { return nullptr; }
  GrContext* GetGrContext() const { return nullptr; }
};
}
}

#endif
# 67 "/Users/luser/build/mozilla-central/gfx/gl/SkiaGLGlue.h"
# 119 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#ifdef USE_SKIA
#if 0 /* expanded by -frewrite-includes */
#include "SurfaceTypes.h"
#endif /* expanded by -frewrite-includes */
# 121 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
#if 0 /* expanded by -frewrite-includes */
#include "GLBlitHelper.h"
#endif /* expanded by -frewrite-includes */
# 1 "/Users/luser/build/mozilla-central/gfx/gl/GLBlitHelper.h" 1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim: set ts=8 sts=4 et sw=4 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef GLBLITHELPER_H_
#define GLBLITHELPER_H_
                            GLuint xoffset = 0, GLuint yoffset = 0, GLuint width = 0,
                            GLuint height = 0);
};

} // namespace gl
} // namespace mozilla

#endif // GLBLITHELPER_H_
# 202 "/Users/luser/build/mozilla-central/gfx/gl/GLBlitHelper.h"
# 122 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp" 2
#endif
# 123 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"

using mozilla::gl::GLContext;
using mozilla::gl::SkiaGLGlue;
using mozilla::gl::GLContextProvider;

// windows.h (included by chromium code) defines this, in its infinite wisdom
#undef DrawText

using namespace mozilla;
using namespace mozilla::CanvasUtils;
using namespace mozilla::css;
using namespace mozilla::gfx;
using namespace mozilla::image;
using namespace mozilla::ipc;
using namespace mozilla::layers;

namespace mgfx = mozilla::gfx;

namespace mozilla {
namespace dom {

// Cap sigma to avoid overly large temp surfaces.
const Float SIGMA_MAX = 100;

/* Memory reporter stuff */
static int64_t gCanvasAzureMemoryUsed = 0;

// This is KIND_OTHER because it's not always clear where in memory the pixels
// of a canvas are stored.  Furthermore, this memory will be tracked by the
// underlying surface implementations.  See bug 655638 for details.
class Canvas2dPixelsReporter MOZ_FINAL : public nsIMemoryReporter
{
  ~Canvas2dPixelsReporter() {}
public:
  NS_DECL_ISUPPORTS

  NS_IMETHOD CollectReports(nsIHandleReportCallback* aHandleReport,
                            nsISupports* aData, bool aAnonymize) MOZ_OVERRIDE
  {
    return MOZ_COLLECT_REPORT(
      "canvas-2d-pixels", KIND_OTHER, UNITS_BYTES,
      gCanvasAzureMemoryUsed,
      "Memory used by 2D canvases. Each canvas requires "
      "(width * height * 4) bytes.");
  }
};

NS_IMPL_ISUPPORTS(Canvas2dPixelsReporter, nsIMemoryReporter)

class CanvasRadialGradient : public CanvasGradient
{
public:
  

  Point mCenter1;
  Point mCenter2;
  Float mRadius1;
  Float mRadius2;
};

class CanvasLinearGradient : public CanvasGradient
{
public:
  

protected:
  friend class CanvasGeneralPattern;

  // Beginning of linear gradient.
  Point mBegin;
  // End of linear gradient.
  Point mEnd;
};

// This class is named 'GeneralCanvasPattern' instead of just
// 'GeneralPattern' to keep Windows PGO builds from confusing the
// GeneralPattern class in gfxContext.cpp with this one.

class CanvasGeneralPattern
{
public:
  typedef CanvasRenderingContext2D::Style Style;
  typedef CanvasRenderingContext2D::ContextState ContextState;

  Pattern& ForStyle(CanvasRenderingContext2D *aCtx,
                    Style aStyle,
                    DrawTarget *aRT)
  {
    // This should only be called once or the mPattern destructor will
    // not be executed.
    NS_ASSERTION(!mPattern.GetPattern(), "ForStyle() should only be called once on CanvasGeneralPattern!");

    const ContextState &state = aCtx->CurrentState();

    if (state.StyleIsColor(aStyle)) {
      mPattern.InitColorPattern(ToDeviceColor(state.colorStyles[aStyle]));
    } else if (state.gradientStyles[aStyle] &&
               state.gradientStyles[aStyle]->GetType() == CanvasGradient::Type::LINEAR) {
      CanvasLinearGradient *gradient =
        static_cast<CanvasLinearGradient*>(state.gradientStyles[aStyle].get());

      mPattern.InitLinearGradientPattern(gradient->mBegin, gradient->mEnd,
                                         gradient->GetGradientStopsForTarget(aRT));
    } else if (state.gradientStyles[aStyle] &&
               state.gradientStyles[aStyle]->GetType() == CanvasGradient::Type::RADIAL) {
      CanvasRadialGradient *gradient =
        static_cast<CanvasRadialGradient*>(state.gradientStyles[aStyle].get());

      mPattern.InitRadialGradientPattern(gradient->mCenter1, gradient->mCenter2,
                                         gradient->mRadius1, gradient->mRadius2,
                                         gradient->GetGradientStopsForTarget(aRT));
    } else if (state.patternStyles[aStyle]) {
      if (aCtx->mCanvasElement) {
        CanvasUtils::DoDrawImageSecurityCheck(aCtx->mCanvasElement,
                                              state.patternStyles[aStyle]->mPrincipal,
                                              state.patternStyles[aStyle]->mForceWriteOnly,
                                              state.patternStyles[aStyle]->mCORSUsed);
      }

      ExtendMode mode;
      if (state.patternStyles[aStyle]->mRepeat == CanvasPattern::RepeatMode::NOREPEAT) {
        mode = ExtendMode::CLAMP;
      } else {
        mode = ExtendMode::REPEAT;
      }
      mPattern.InitSurfacePattern(state.patternStyles[aStyle]->mSurface, mode,
                                  state.patternStyles[aStyle]->mTransform);
    }

    return *mPattern.GetPattern();
  }

  GeneralPattern mPattern;
};

/* This is an RAII based class that can be used as a drawtarget for
 * operations that need to have a filter applied to their results.
 * All coordinates passed to the constructor are in device space.
 */
class AdjustedTargetForFilter
{
public:
  typedef CanvasRenderingContext2D::ContextState ContextState;

  AdjustedTargetForFilter(CanvasRenderingContext2D *ctx,
                          DrawTarget *aFinalTarget,
                          const mgfx::IntPoint& aFilterSpaceToTargetOffset,
                          const mgfx::IntRect& aPreFilterBounds,
                          const mgfx::IntRect& aPostFilterBounds,
                          mgfx::CompositionOp aCompositionOp)
    : mCtx(nullptr)
    , mCompositionOp(aCompositionOp)
  {
    mCtx = ctx;
    mFinalTarget = aFinalTarget;
    mPostFilterBounds = aPostFilterBounds;
    mOffset = aFilterSpaceToTargetOffset;

    nsIntRegion sourceGraphicNeededRegion;
    nsIntRegion fillPaintNeededRegion;
    nsIntRegion strokePaintNeededRegion;

    FilterSupport::ComputeSourceNeededRegions(
      ctx->CurrentState().filter, mgfx::ThebesIntRect(mPostFilterBounds),
      sourceGraphicNeededRegion, fillPaintNeededRegion, strokePaintNeededRegion);

    mSourceGraphicRect = mgfx::ToIntRect(sourceGraphicNeededRegion.GetBounds());
    mFillPaintRect = mgfx::ToIntRect(fillPaintNeededRegion.GetBounds());
    mStrokePaintRect = mgfx::ToIntRect(strokePaintNeededRegion.GetBounds());

    mSourceGraphicRect = mSourceGraphicRect.Intersect(aPreFilterBounds);

    if (mSourceGraphicRect.IsEmpty()) {
      // The filter might not make any use of the source graphic. We need to
      // create a DrawTarget that we can return from DT() anyway, so we'll
      // just use a 1x1-sized one.
      mSourceGraphicRect.SizeTo(1, 1);
    }

    mTarget =
      mFinalTarget->CreateSimilarDrawTarget(mSourceGraphicRect.Size(), SurfaceFormat::B8G8R8A8);

    if (!mTarget) {
      // XXX - Deal with the situation where our temp size is too big to
      // fit in a texture (bug 1066622).
      mTarget = mFinalTarget;
      mCtx = nullptr;
      mFinalTarget = nullptr;
      return;
    }

    mTarget->SetTransform(
      mFinalTarget->GetTransform().PostTranslate(-mSourceGraphicRect.TopLeft() + mOffset));
  }

  // Return a SourceSurface that contains the FillPaint or StrokePaint source.
  TemporaryRef<SourceSurface>
  DoSourcePaint(mgfx::IntRect& aRect, CanvasRenderingContext2D::Style aStyle)
  {
    if (aRect.IsEmpty()) {
      return nullptr;
    }

    RefPtr<DrawTarget> dt =
      mFinalTarget->CreateSimilarDrawTarget(aRect.Size(), SurfaceFormat::B8G8R8A8);
    if (!dt) {
      aRect.SetEmpty();
      return nullptr;
    }

    Matrix transform =
      mFinalTarget->GetTransform().PostTranslate(-aRect.TopLeft() + mOffset);

    RefPtr<SourceSurface> snapshot = mTarget->Snapshot();

    RefPtr<SourceSurface> fillPaint =
      DoSourcePaint(mFillPaintRect, CanvasRenderingContext2D::Style::FILL);
    RefPtr<SourceSurface> strokePaint =
      DoSourcePaint(mStrokePaintRect, CanvasRenderingContext2D::Style::STROKE);

    AutoRestoreTransform autoRestoreTransform(mFinalTarget);
    mFinalTarget->SetTransform(Matrix());

    mgfx::FilterSupport::RenderFilterDescription(
      mFinalTarget, mCtx->CurrentState().filter,
      mgfx::Rect(mPostFilterBounds),
      snapshot, mSourceGraphicRect,
      fillPaint, mFillPaintRect,
      strokePaint, mStrokePaintRect,
      mCtx->CurrentState().filterAdditionalImages,
      mPostFilterBounds.TopLeft() - mOffset,
      DrawOptions(1.0f, mCompositionOp));
  }

  DrawTarget* DT()
  {
    return mTarget;
  }

private:
  RefPtr<DrawTarget> mTarget;
  RefPtr<DrawTarget> mFinalTarget;
  CanvasRenderingContext2D *mCtx;
  mgfx::IntRect mSourceGraphicRect;
  mgfx::IntRect mFillPaintRect;
  mgfx::IntRect mStrokePaintRect;
  mgfx::IntRect mPostFilterBounds;
  mgfx::IntPoint mOffset;
  mgfx::CompositionOp mCompositionOp;
};

/* This is an RAII based class that can be used as a drawtarget for
 * operations that need to have a shadow applied to their results.
 * All coordinates passed to the constructor are in device space.
 */
class AdjustedTargetForShadow
{
public:
  typedef CanvasRenderingContext2D::ContextState ContextState;

  AdjustedTargetForShadow(CanvasRenderingContext2D *ctx,
                          DrawTarget *aFinalTarget,
                          const mgfx::Rect& aBounds,
                          mgfx::CompositionOp aCompositionOp)
    : mCtx(nullptr)
    , mCompositionOp(aCompositionOp)
  {
    mCtx = ctx;
    mFinalTarget = aFinalTarget;

    const ContextState &state = mCtx->CurrentState();

    mSigma = state.ShadowBlurSigma();

    mgfx::Rect bounds = aBounds;

    int32_t blurRadius = state.ShadowBlurRadius();

    // We actually include the bounds of the shadow blur, this makes it
    // easier to execute the actual blur on hardware, and shouldn't affect
    // the amount of pixels that need to be touched.
    bounds.Inflate(blurRadius);

    bounds.RoundOut();
    bounds.ToIntRect(&mTempRect);

    mTarget =
      mFinalTarget->CreateShadowDrawTarget(mTempRect.Size(),
                                           SurfaceFormat::B8G8R8A8, mSigma);

    if (!mTarget) {
      // XXX - Deal with the situation where our temp size is too big to
      // fit in a texture (bug 1066622).
      mTarget = mFinalTarget;
      mCtx = nullptr;
      mFinalTarget = nullptr;
    } else {
      mTarget->SetTransform(
        mFinalTarget->GetTransform().PostTranslate(-mTempRect.TopLeft()));
    }
  }

  ~AdjustedTargetForShadow()
  {
    if (!mCtx) {
      return;
    }

    RefPtr<SourceSurface> snapshot = mTarget->Snapshot();

    mFinalTarget->DrawSurfaceWithShadow(snapshot, mTempRect.TopLeft(),
                                        Color::FromABGR(mCtx->CurrentState().shadowColor),
                                        mCtx->CurrentState().shadowOffset, mSigma,
                                        mCompositionOp);
  }

  DrawTarget* DT()
  {
    return mTarget;
  }

  mgfx::IntPoint OffsetToFinalDT()
  {
    return mTempRect.TopLeft();
  }

private:
  RefPtr<DrawTarget> mTarget;
  RefPtr<DrawTarget> mFinalTarget;
  CanvasRenderingContext2D *mCtx;
  Float mSigma;
  mgfx::IntRect mTempRect;
  mgfx::CompositionOp mCompositionOp;
};

/* This is an RAII based class that can be used as a drawtarget for
 * operations that need a shadow or a filter drawn. It will automatically
 * provide a temporary target when needed, and if so blend it back with a
 * shadow, filter, or both.
 * If both a shadow and a filter are needed, the filter is applied first,
 * and the shadow is applied to the filtered results.
 *
 * aBounds specifies the bounds of the drawing operation that will be
 * drawn to the target, it is given in device space! If this is nullptr the
 * drawing operation will be assumed to cover the whole canvas.
 */
class AdjustedTarget
{
public:
  typedef CanvasRenderingContext2D::ContextState ContextState;

  explicit AdjustedTarget(CanvasRenderingContext2D* ctx,
                          const mgfx::Rect *aBounds = nullptr)
  {
    mTarget = ctx->mTarget;

    // All rects in this function are in the device space of ctx->mTarget.

    // In order to keep our temporary surfaces as small as possible, we first
    // calculate what their maximum required bounds would need to be if we
    // were to fill the whole canvas. Everything outside those bounds we don't
    // need to render.
    mgfx::Rect r(0, 0, ctx->mWidth, ctx->mHeight);
    mgfx::Rect maxSourceNeededBoundsForShadow =
      MaxSourceNeededBoundsForShadow(r, ctx);
    mgfx::Rect maxSourceNeededBoundsForFilter =
      MaxSourceNeededBoundsForFilter(maxSourceNeededBoundsForShadow, ctx);

    mgfx::Rect bounds = maxSourceNeededBoundsForFilter;
    if (aBounds) {
      bounds = bounds.Intersect(*aBounds);
    }
    mgfx::Rect boundsAfterFilter = BoundsAfterFilter(bounds, ctx);

    mozilla::gfx::CompositionOp op = ctx->CurrentState().op;

    mgfx::IntPoint offsetToFinalDT;

    // First set up the shadow draw target, because the shadow goes outside.
    // It applies to the post-filter results, if both a filter and a shadow
    // are used.
    if (ctx->NeedToDrawShadow()) {
      mShadowTarget = MakeUnique<AdjustedTargetForShadow>(
        ctx, mTarget, boundsAfterFilter, op);
      mTarget = mShadowTarget->DT();
      offsetToFinalDT = mShadowTarget->OffsetToFinalDT();

      // If we also have a filter, the filter needs to be drawn with OP_OVER
    }
  }

  ~AdjustedTarget()
  {
    // The order in which the targets are finalized is important.
    // Filters are inside, any shadow applies to the post-filter results.
    mFilterTarget.reset();
    mShadowTarget.reset();
  }

  operator DrawTarget*()
  {
    return mTarget;
  }

  DrawTarget* operator->() MOZ_NO_ADDREF_RELEASE_ON_RETURN
  {
    return mTarget;
  }

private:

  mgfx::Rect
  MaxSourceNeededBoundsForFilter(const mgfx::Rect& aDestBounds, CanvasRenderingContext2D *ctx)
  {
    if (!ctx->NeedToApplyFilter()) {
      return aDestBounds;
    }

    nsIntRegion sourceGraphicNeededRegion;
    nsIntRegion fillPaintNeededRegion;
    nsIntRegion strokePaintNeededRegion;

    FilterSupport::ComputeSourceNeededRegions(
      ctx->CurrentState().filter, mgfx::ThebesIntRect(mgfx::RoundedToInt(aDestBounds)),
      sourceGraphicNeededRegion, fillPaintNeededRegion, strokePaintNeededRegion);

    return mgfx::Rect(mgfx::ToIntRect(sourceGraphicNeededRegion.GetBounds()));
  }

  mgfx::Rect
  MaxSourceNeededBoundsForShadow(const mgfx::Rect& aDestBounds, CanvasRenderingContext2D *ctx)
  {
    if (!ctx->NeedToDrawShadow()) {
      return aDestBounds;
    }

    const ContextState &state = ctx->CurrentState();
    mgfx::Rect sourceBounds = aDestBounds - state.shadowOffset;
    sourceBounds.Inflate(state.ShadowBlurRadius());

    // Union the shadow source with the original rect because we're going to
    // draw both.
    return sourceBounds.Union(aDestBounds);
  }

  mgfx::Rect
  BoundsAfterFilter(const mgfx::Rect& aBounds, CanvasRenderingContext2D *ctx)
  {
    if (!ctx->NeedToApplyFilter()) {
      return aBounds;
    }

    mgfx::Rect bounds(aBounds);
    bounds.RoundOut();

    mgfx::IntRect intBounds;
    if (!bounds.ToIntRect(&intBounds)) {
      return mgfx::Rect();
    }

    nsIntRegion extents =
      mgfx::FilterSupport::ComputePostFilterExtents(ctx->CurrentState().filter,
                                                    mgfx::ThebesIntRect(intBounds));
    return mgfx::Rect(mgfx::ToIntRect(extents.GetBounds()));
  }

  RefPtr<DrawTarget> mTarget;
  UniquePtr<AdjustedTargetForShadow> mShadowTarget;
  UniquePtr<AdjustedTargetForFilter> mFilterTarget;
};





NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(CanvasGradient, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(CanvasGradient, Release)

NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CanvasGradient, mContext)

NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(CanvasPattern, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(CanvasPattern, Release)

NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(CanvasPattern, mContext)

class CanvasDrawObserver
{
public:
  explicit CanvasDrawObserver(CanvasRenderingContext2D* aCanvasContext);

  // Only enumerate draw calls that could affect the heuristic
  enum DrawCallType {
    PutImageData,
    GetImageData,
    DrawImage
  };

  // This is the one that we call on relevant draw calls and count
  // GPU vs. CPU preferrable calls...
  void DidDrawCall(DrawCallType aType);

  // When this returns true, the observer is done making the decisions.
  // Right now, we expect to get rid of the observer after the FrameEnd
  // returns true, though the decision could eventually change if the
  // function calls shift.  If we change to monitor the functions called
  // and make decisions to change more than once, we would probably want
  // FrameEnd to reset the timer and counters as it returns true.
  bool FrameEnd();

private:
  // These values will be picked up from preferences:
  int32_t mMinFramesBeforeDecision;
  float mMinSecondsBeforeDecision;
  int32_t mMinCallsBeforeDecision;

  CanvasRenderingContext2D* mCanvasContext;
  int32_t mSoftwarePreferredCalls;
  int32_t mGPUPreferredCalls;
  int32_t mFramesRendered;
  TimeStamp mCreationTime;
};

// We are not checking for the validity of the preference values.  For example,
// negative values will have an effect of a quick exit, so no harm done.
CanvasDrawObserver::CanvasDrawObserver(CanvasRenderingContext2D* aCanvasContext)
 : mMinFramesBeforeDecision(gfxPrefs::CanvasAutoAccelerateMinFrames())
 , mMinSecondsBeforeDecision(gfxPrefs::CanvasAutoAccelerateMinSeconds())
 , mMinCallsBeforeDecision(gfxPrefs::CanvasAutoAccelerateMinCalls())
 , mCanvasContext(aCanvasContext)
 , mSoftwarePreferredCalls(0)
 , mGPUPreferredCalls(0)
 , mFramesRendered(0)
 , mCreationTime(TimeStamp::NowLoRes())
{}

void
CanvasDrawObserver::DidDrawCall(DrawCallType aType)
{
  switch (aType) {
    case PutImageData:
    case GetImageData:
      if (mGPUPreferredCalls == 0 && mSoftwarePreferredCalls == 0) {
        mCreationTime = TimeStamp::NowLoRes();
      }
      mSoftwarePreferredCalls++;
      break;
    case DrawImage:
      if (mGPUPreferredCalls == 0 && mSoftwarePreferredCalls == 0) {
        mCreationTime = TimeStamp::NowLoRes();
      }
      mGPUPreferredCalls++;
      break;
  }
}

// If we return true, the observer is done making the decisions...
bool
CanvasDrawObserver::FrameEnd()
{
  mFramesRendered++;

  // We log the first mMinFramesBeforeDecision frames of any
  // canvas object then make a call to determine whether it should
  // be GPU or CPU backed
  if ((mFramesRendered >= mMinFramesBeforeDecision) ||
      ((TimeStamp::NowLoRes() - mCreationTime).ToSeconds()) > mMinSecondsBeforeDecision) {

    // If we don't have enough data, don't bother changing...
    if (mGPUPreferredCalls > mMinCallsBeforeDecision ||
        mSoftwarePreferredCalls > mMinCallsBeforeDecision) {
      if (mGPUPreferredCalls >= mSoftwarePreferredCalls) {
        mCanvasContext->SwitchRenderingMode(CanvasRenderingContext2D::RenderingMode::OpenGLBackendMode);
      } else {
        mCanvasContext->SwitchRenderingMode(CanvasRenderingContext2D::RenderingMode::SoftwareBackendMode);
      }
    }

    // If we ever redesign this class to constantly monitor the functions
    // and keep making decisions, we would probably want to reset the counters
    // and the timers here...
    return true;
  }
  return false;
}

class CanvasRenderingContext2DUserData : public LayerUserData {
public:
  explicit CanvasRenderingContext2DUserData(CanvasRenderingContext2D *aContext)
    : mContext(aContext)
  {
    aContext->mUserDatas.AppendElement(this);
  }
  ~CanvasRenderingContext2DUserData()
  {
    if (mContext) {
      mContext->mUserDatas.RemoveElement(this);
    }
  }

  static void PreTransactionCallback(void* aData)
  {
    CanvasRenderingContext2DUserData* self =
      static_cast<CanvasRenderingContext2DUserData*>(aData);
    CanvasRenderingContext2D* context = self->mContext;
    if (!context || !context->mTarget)
      return;

    // Since SkiaGL default to store drawing command until flush
    // We will have to flush it before present.
    context->mTarget->Flush();
  }

  static void DidTransactionCallback(void* aData)
  {
    CanvasRenderingContext2DUserData* self =
      static_cast<CanvasRenderingContext2DUserData*>(aData);
    if (self->mContext) {
      self->mContext->MarkContextClean();
      if (self->mContext->mDrawObserver) {
        if (self->mContext->mDrawObserver->FrameEnd()) {
          // Note that this call deletes and nulls out mDrawObserver:
          self->mContext->RemoveDrawObserver();
        }
      }
    }
  }
  bool IsForContext(CanvasRenderingContext2D *aContext)
  {
    return mContext == aContext;
  }
  void Forget()
  {
    mContext = nullptr;
  }

private:
  CanvasRenderingContext2D *mContext;
};

NS_IMPL_CYCLE_COLLECTING_ADDREF(CanvasRenderingContext2D)
NS_IMPL_CYCLE_COLLECTING_RELEASE(CanvasRenderingContext2D)

NS_IMPL_CYCLE_COLLECTION_CLASS(CanvasRenderingContext2D)


NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CanvasRenderingContext2D)
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCanvasElement)
  for (uint32_t i = 0; i < tmp->mStyleStack.Length(); i++) {
    ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].patternStyles[Style::STROKE], "Stroke CanvasPattern");
    ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].patternStyles[Style::FILL], "Fill CanvasPattern");
    ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].gradientStyles[Style::STROKE], "Stroke CanvasGradient");
    ImplCycleCollectionTraverse(cb, tmp->mStyleStack[i].gradientStyles[Style::FILL], "Fill CanvasGradient");
  }
  for (size_t x = 0 ; x < tmp->mHitRegionsOptions.Length(); x++) {
    RegionInfo& info = tmp->mHitRegionsOptions[x];
    if (info.mElement) {
      ImplCycleCollectionTraverse(cb, info.mElement, "Hit region fallback element");
    }
  }
  NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END

NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(CanvasRenderingContext2D)

NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(CanvasRenderingContext2D)
 if (nsCCUncollectableMarker::sGeneration && tmp->IsBlack()) {
   dom::Element* canvasElement = tmp->mCanvasElement;
    if (canvasElement) {
      if (canvasElement->IsPurple()) {
        canvasElement->RemovePurple();
      }
      dom::Element::MarkNodeChildren(canvasElement);
    }
    return true;
  }
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END

NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(CanvasRenderingContext2D)
  return nsCCUncollectableMarker::sGeneration && tmp->IsBlack();
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END

NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(CanvasRenderingContext2D)
  return nsCCUncollectableMarker::sGeneration && tmp->IsBlack();
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END

NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CanvasRenderingContext2D)
  NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
  NS_INTERFACE_MAP_ENTRY(nsICanvasRenderingContextInternal)
  NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END

/**
    if (info.mElement == aElement) {
      mgfx::Rect bounds(info.mPath->GetBounds());
      gfxRect rect(bounds.x, bounds.y, bounds.width, bounds.height);
      aRect = nsLayoutUtils::RoundGfxRectToAppRect(rect, AppUnitsPerCSSPixel());

      return true;
    }
  }

  return false;
}

/**
 * Used for nsBidiPresUtils::ProcessText
 */
struct MOZ_STACK_CLASS CanvasBidiProcessor : public nsBidiPresUtils::BidiProcessor
{
  CanvasBidiProcessor()
    : nsBidiPresUtils::BidiProcessor()
  {
    if (Preferences::GetBool(GFX_MISSING_FONTS_NOTIFY_PREF)) {
      mMissingFonts = new gfxMissingFontRecorder();
    }
  }

  ~CanvasBidiProcessor()
  {
    // notify front-end code if we encountered missing glyphs in any script
    if (mMissingFonts) {
      mMissingFonts->Flush();
    }
  }

  typedef CanvasRenderingContext2D::ContextState ContextState;

  virtual void SetText(const char16_t* text, int32_t length, nsBidiDirection direction)
  {
    mFontgrp->UpdateUserFonts(); // ensure user font generation is current
    // adjust flags for current direction run
    uint32_t flags = mTextRunFlags;
    if (direction == NSBIDI_RTL) {
      flags |= gfxTextRunFactory::TEXT_IS_RTL;
    } else {
      flags &= ~gfxTextRunFactory::TEXT_IS_RTL;
    }
    mTextRun = mFontgrp->MakeTextRun(text,
                                     length,
                                     mThebes,
                                     mAppUnitsPerDevPixel,
                                     flags,
                                     mMissingFonts);
  }

  virtual nscoord GetWidth()
  {
    gfxTextRun::Metrics textRunMetrics = mTextRun->MeasureText(0,
                                                               mTextRun->GetLength(),
                                                               mDoMeasureBoundingBox ?
                                                                 gfxFont::TIGHT_INK_EXTENTS :
                                                                 gfxFont::LOOSE_INK_EXTENTS,
                                                               mThebes,
                                                               nullptr);

    // this only measures the height; the total width is gotten from the
    // the return value of ProcessText.
    if (mDoMeasureBoundingBox) {
      textRunMetrics.mBoundingBox.Scale(1.0 / mAppUnitsPerDevPixel);
      mBoundingBox = mBoundingBox.Union(textRunMetrics.mBoundingBox);
    }

    return NSToCoordRound(textRunMetrics.mAdvanceWidth);
  }

  virtual void DrawText(nscoord xOffset, nscoord width)
  {
    gfxPoint point = mPt;
    bool rtl = mTextRun->IsRightToLeft();
    bool verticalRun = mTextRun->IsVertical();
    bool centerBaseline = mTextRun->UseCenterBaseline();

    gfxFloat& inlineCoord = verticalRun ? point.y : point.x;
    inlineCoord += xOffset;

    // offset is given in terms of left side of string
    if (rtl) {
      // Bug 581092 - don't use rounded pixel width to advance to
      // right-hand end of run, because this will cause different
      // glyph positioning for LTR vs RTL drawing of the same
      // glyph string on OS X and DWrite where textrun widths may
      // involve fractional pixels.
      gfxTextRun::Metrics textRunMetrics =
        mTextRun->MeasureText(0,
                              mTextRun->GetLength(),
                              mDoMeasureBoundingBox ?
                                  gfxFont::TIGHT_INK_EXTENTS :
                                  gfxFont::LOOSE_INK_EXTENTS,
                              mThebes,
                              nullptr);
      inlineCoord += textRunMetrics.mAdvanceWidth;
      // old code was:
      //   point.x += width * mAppUnitsPerDevPixel;
      // TODO: restore this if/when we move to fractional coords
      // throughout the text layout process
    }

    uint32_t numRuns;
    const gfxTextRun::GlyphRun *runs = mTextRun->GetGlyphRuns(&numRuns);
    const int32_t appUnitsPerDevUnit = mAppUnitsPerDevPixel;
    const double devUnitsPerAppUnit = 1.0/double(appUnitsPerDevUnit);
    Point baselineOrigin =
      Point(point.x * devUnitsPerAppUnit, point.y * devUnitsPerAppUnit);

    float advanceSum = 0;

    mCtx->EnsureTarget();
    for (uint32_t c = 0; c < numRuns; c++) {
      gfxFont *font = runs[c].mFont;

      bool verticalFont =
        runs[c].mOrientation == gfxTextRunFactory::TEXT_ORIENT_VERTICAL_UPRIGHT;

      const float& baselineOriginInline =
        verticalFont ? baselineOrigin.y : baselineOrigin.x;
      const float& baselineOriginBlock =
        verticalFont ? baselineOrigin.x : baselineOrigin.y;

      uint32_t endRun = 0;
      if (c + 1 < numRuns) {
        endRun = runs[c + 1].mCharacterOffset;
      } else {
        endRun = mTextRun->GetLength();
      }

      const gfxTextRun::CompressedGlyph *glyphs = mTextRun->GetCharacterGlyphs();

      RefPtr<ScaledFont> scaledFont =
        gfxPlatform::GetPlatform()->GetScaledFontForFont(mCtx->mTarget, font);

      if (!scaledFont) {
        // This can occur when something switched DirectWrite off.
        return;
      }

      AutoRestoreTransform sidewaysRestore;
      if (runs[c].mOrientation ==
          gfxTextRunFactory::TEXT_ORIENT_VERTICAL_SIDEWAYS_RIGHT) {
        sidewaysRestore.Init(mCtx->mTarget);
        const gfxFont::Metrics& metrics = mTextRun->GetFontGroup()->
          GetFirstValidFont()->GetMetrics(gfxFont::eHorizontal);

        gfx::Matrix mat = mCtx->mTarget->GetTransform().Copy().
          PreTranslate(baselineOrigin).      // translate origin for rotation
          PreRotate(gfx::Float(M_PI / 2.0)). // turn 90deg clockwise
          PreTranslate(-baselineOrigin);     // undo the translation

        if (centerBaseline) {
          // TODO: The baseline adjustment here is kinda ad hoc; eventually
          // perhaps we should check for horizontal and vertical baseline data
          // in the font, and adjust accordingly.
          // (The same will be true for HTML text layout.)
          float offset = (metrics.emAscent - metrics.emDescent) / 2;
          mat = mat.PreTranslate(Point(0, offset));
                              // offset the (alphabetic) baseline of the
                              // horizontally-shaped text from the (centered)
                              // default baseline used for vertical
        }

        mCtx->mTarget->SetTransform(mat);
      }

      RefPtr<GlyphRenderingOptions> renderingOptions = font->GetGlyphRenderingOptions();

      GlyphBuffer buffer;

      std::vector<Glyph> glyphBuf;

      // TODO:
      // This more-or-less duplicates the code found in gfxTextRun::Draw
      // and the gfxFont methods that uses (Draw, DrawGlyphs, DrawOneGlyph);
      // it would be nice to refactor and share that code.
      for (uint32_t i = runs[c].mCharacterOffset; i < endRun; i++) {
        Glyph newGlyph;

        float& inlinePos =
          verticalFont ? newGlyph.mPosition.y : newGlyph.mPosition.x;
        float& blockPos =
          verticalFont ? newGlyph.mPosition.x : newGlyph.mPosition.y;

        if (glyphs[i].IsSimpleGlyph()) {
          newGlyph.mIndex = glyphs[i].GetSimpleGlyph();
          if (rtl) {
            inlinePos = baselineOriginInline - advanceSum -
              glyphs[i].GetSimpleAdvance() * devUnitsPerAppUnit;
          } else {
            inlinePos = baselineOriginInline + advanceSum;
          }
          blockPos = baselineOriginBlock;
          advanceSum += glyphs[i].GetSimpleAdvance() * devUnitsPerAppUnit;
          glyphBuf.push_back(newGlyph);
          continue;
        }

        if (!glyphs[i].GetGlyphCount()) {
          continue;
        }

        const gfxTextRun::DetailedGlyph *d = mTextRun->GetDetailedGlyphs(i);

        if (glyphs[i].IsMissing() && d->mAdvance > 0) {
          newGlyph.mIndex = 0;
          if (rtl) {
            inlinePos = baselineOriginInline - advanceSum -
              d->mAdvance * devUnitsPerAppUnit;
          } else {
            inlinePos = baselineOriginInline + advanceSum;
          }
          blockPos = baselineOriginBlock;
          advanceSum += d->mAdvance * devUnitsPerAppUnit;
          glyphBuf.push_back(newGlyph);
          continue;
        }

        for (uint32_t c = 0; c < glyphs[i].GetGlyphCount(); c++, d++) {
          newGlyph.mIndex = d->mGlyphID;
          if (rtl) {
            inlinePos = baselineOriginInline - advanceSum -
              d->mAdvance * devUnitsPerAppUnit;
          } else {
            inlinePos = baselineOriginInline + advanceSum;
          }
          inlinePos += d->mXOffset * devUnitsPerAppUnit;
          blockPos = baselineOriginBlock + d->mYOffset * devUnitsPerAppUnit;
          glyphBuf.push_back(newGlyph);
          advanceSum += d->mAdvance * devUnitsPerAppUnit;
        }
      }

      if (!glyphBuf.size()) {
        // This may happen for glyph runs for a 0 size font.
        continue;
      }

      buffer.mGlyphs = &glyphBuf.front();
      buffer.mNumGlyphs = glyphBuf.size();

      Rect bounds = mCtx->mTarget->GetTransform().
        TransformBounds(Rect(mBoundingBox.x, mBoundingBox.y,
                             mBoundingBox.width, mBoundingBox.height));
      if (mOp == CanvasRenderingContext2D::TextDrawOperation::FILL) {
        AdjustedTarget(mCtx, &bounds)->
          FillGlyphs(scaledFont, buffer,
                     CanvasGeneralPattern().
                       ForStyle(mCtx, CanvasRenderingContext2D::Style::FILL, mCtx->mTarget),
                     DrawOptions(mState->globalAlpha, mCtx->UsedOperation()),
                     renderingOptions);
      } else if (mOp == CanvasRenderingContext2D::TextDrawOperation::STROKE) {
        // stroke glyphs one at a time to avoid poor CoreGraphics performance
        // when stroking a path with a very large number of points
        buffer.mGlyphs = &glyphBuf.front();
        buffer.mNumGlyphs = 1;
        const ContextState& state = *mState;
        AdjustedTarget target(mCtx, &bounds);
        const StrokeOptions strokeOpts(state.lineWidth, state.lineJoin,
                                       state.lineCap, state.miterLimit,
                                       state.dash.Length(),
                                       state.dash.Elements(),
                                       state.dashOffset);
        CanvasGeneralPattern cgp;
        const Pattern& patForStyle
          (cgp.ForStyle(mCtx, CanvasRenderingContext2D::Style::STROKE, mCtx->mTarget));
        const DrawOptions drawOpts(state.globalAlpha, mCtx->UsedOperation());

        for (unsigned i = glyphBuf.size(); i > 0; --i) {
          RefPtr<Path> path = scaledFont->GetPathForGlyphs(buffer, mCtx->mTarget);
          target->Stroke(path, patForStyle, strokeOpts, drawOpts);
          buffer.mGlyphs++;
        }
      }
    }
  }

  // current text run
  nsAutoPtr<gfxTextRun> mTextRun;

  // pointer to a screen reference context used to measure text and such
  nsRefPtr<gfxContext> mThebes;

  // Pointer to the draw target we should fill our text to
  CanvasRenderingContext2D *mCtx;

  // position of the left side of the string, alphabetic baseline
  gfxPoint mPt;

  // current font
  gfxFontGroup* mFontgrp;

  // to record any unsupported characters found in the text,
  // and notify front-end if it is interested
  nsAutoPtr<gfxMissingFontRecorder> mMissingFonts;

  // dev pixel conversion factor
  int32_t mAppUnitsPerDevPixel;

  // operation (fill or stroke)
  CanvasRenderingContext2D::TextDrawOperation mOp;

  // context state
  ContextState *mState;

  // union of bounding boxes of all runs, needed for shadows
  gfxRect mBoundingBox;

  // flags to use when creating textrun, based on CSS style
  uint32_t mTextRunFlags;

  // true iff the bounding box should be measured
  bool mDoMeasureBoundingBox;
};



gfxFontGroup *CanvasRenderingContext2D::GetCurrentFontStyle()
{
  // use lazy initilization for the font group since it's rather expensive
  if (!CurrentState().fontGroup) {
    ErrorResult err;
    NS_NAMED_LITERAL_STRING(kDefaultFontStyle, "10px sans-serif");
    static float kDefaultFontSize = 10.0;
    SetFont(kDefaultFontStyle, err);
    if (err.Failed()) {
      gfxFontStyle style;
      style.size = kDefaultFontSize;
      CurrentState().fontGroup =
        gfxPlatform::GetPlatform()->CreateFontGroup(FontFamilyList(eFamily_sans_serif),
                                                    &style,
                                                    nullptr);
      if (CurrentState().fontGroup) {
        CurrentState().font = kDefaultFontStyle;

        nsIPresShell* presShell = GetPresShell();
        if (presShell) {
          CurrentState().fontGroup->SetTextPerfMetrics(
            presShell->GetPresContext()->GetTextPerfMetrics());
        }
      } else {
        NS_ERROR("Default canvas font is invalid");
      }
    }

  }

  return CurrentState().fontGroup;
}

//
// line caps/joins
//















// Returns a surface that contains only the part needed to draw aSourceRect.
// On entry, aSourceRect is relative to aSurface, and on return aSourceRect is
// relative to the returned surface.
static TemporaryRef<SourceSurface>
ExtractSubrect(SourceSurface* aSurface, mgfx::Rect* aSourceRect, DrawTarget* aTargetDT)
{
  mgfx::Rect roundedOutSourceRect = *aSourceRect;
  roundedOutSourceRect.RoundOut();
  mgfx::IntRect roundedOutSourceRectInt;
  if (!roundedOutSourceRect.ToIntRect(&roundedOutSourceRectInt)) {
    return aSurface;
  }

  RefPtr<DrawTarget> subrectDT =
    aTargetDT->CreateSimilarDrawTarget(roundedOutSourceRectInt.Size(), SurfaceFormat::B8G8R8A8);

  if (!subrectDT) {
    return aSurface;
  }

  *aSourceRect -= roundedOutSourceRect.TopLeft();

  subrectDT->CopySurface(aSurface, roundedOutSourceRectInt, IntPoint());
  return subrectDT->Snapshot();
}

// Acts like nsLayoutUtils::SurfaceFromElement, but it'll attempt
// to pull a SourceSurface from our cache. This allows us to avoid
// other valid value for optional_argc is 6 if sx, sy, sw, sh, dx, dy, dw and dh
// are all passed in.

void
CanvasRenderingContext2D::DrawImage(const HTMLImageOrCanvasOrVideoElement& image,
                                    double sx, double sy, double sw,
                                    double sh, double dx, double dy,
                                    double dw, double dh,
                                    uint8_t optional_argc,
                                    ErrorResult& error)
{
  if (mDrawObserver) {
    mDrawObserver->DidDrawCall(CanvasDrawObserver::DrawCallType::DrawImage);
  }

  MOZ_ASSERT(optional_argc == 0 || optional_argc == 2 || optional_argc == 6);

  RefPtr<SourceSurface> srcSurf;
  gfx::IntSize imgSize;

  Element* element;

  EnsureTarget();
  if (image.IsHTMLCanvasElement()) {
    HTMLCanvasElement* canvas = &image.GetAsHTMLCanvasElement();
    element = canvas;
    nsIntSize size = canvas->GetSize();
    if (size.width == 0 || size.height == 0) {
      error.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
      return;
    }
  } else {
    if (image.IsHTMLImageElement()) {
      HTMLImageElement* img = &image.GetAsHTMLImageElement();
      element = img;
    } else {
      HTMLVideoElement* video = &image.GetAsHTMLVideoElement();
      element = video;
    }

    srcSurf =
      CanvasImageCache::Lookup(element, mCanvasElement, &imgSize);
  }

  nsLayoutUtils::DirectDrawInfo drawInfo;

#ifdef USE_SKIA_GPU
  if (mRenderingMode == RenderingMode::OpenGLBackendMode &&
                                            principal, false,
                                            video->GetCORSMode() != CORS_NONE);
    }
  }
#endif
# 4286 "/Users/luser/build/mozilla-central/dom/canvas/CanvasRenderingContext2D.cpp"
  if (!srcSurf) {
    // The canvas spec says that drawImage should draw the first frame
    // of animated images. We also don't want to rasterize vector images.
    uint32_t sfeFlags = nsLayoutUtils::SFE_WANT_FIRST_FRAME |
                        nsLayoutUtils::SFE_NO_RASTERIZING_VECTORS;
    // The cache lookup can miss even if the image is already in the cache
    // if the image is coming from a different element or cached for a
    // different canvas. This covers the case when we miss due to caching
    // for a different canvas, but CanvasImageCache should be fixed if we
    // see misses due to different elements drawing the same image.
    if (image.IsHTMLVideoElement()) {
      HTMLVideoElement* video = &image.GetAsHTMLVideoElement();
      int32_t displayWidth = video->VideoWidth();
      int32_t displayHeight = video->VideoHeight();
      sw *= (double)imgSize.width / (double)displayWidth;
      sh *= (double)imgSize.height / (double)displayHeight;
    }

  }

  if (dw == 0.0 || dh == 0.0) {
    // not really failure, but nothing to do --
    // and noone likes a divide-by-zero
    return;
  }

  if (sx < 0.0 || sy < 0.0 ||
      sw < 0.0 || sw > (double) imgSize.width ||
      sh < 0.0 || sh > (double) imgSize.height ||
      dw < 0.0 || dh < 0.0) {
    // XXX - Unresolved spec issues here, for now return error.
    error.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
    return;
  }

  Filter filter;

  if (CurrentState().imageSmoothingEnabled)
    filter = mgfx::Filter::LINEAR;
  else
    filter = mgfx::Filter::POINT;

  mgfx::Rect bounds;

  if (NeedToCalculateBounds()) {
    bounds = mgfx::Rect(dx, dy, dw, dh);
    bounds = mTarget->GetTransform().TransformBounds(bounds);
  }

  if (srcSurf) {
    mgfx::Rect sourceRect(sx, sy, sw, sh);
    if (element == mCanvasElement) {
      // srcSurf is a snapshot of mTarget. If we draw to mTarget now, we'll
      // trigger a COW copy of the whole canvas into srcSurf. That's a huge
      // waste if sourceRect doesn't cover the whole canvas.
      // We avoid copying the whole canvas by manually copying just the part
      // that we need.
      srcSurf = ExtractSubrect(srcSurf, &sourceRect, mTarget);
    }
    AdjustedTarget(this, bounds.IsEmpty() ? nullptr : &bounds)->
      DrawSurface(srcSurf,
                  mgfx::Rect(dx, dy, dw, dh),
                  sourceRect,
                  DrawSurfaceOptions(filter),
                  DrawOptions(CurrentState().globalAlpha, UsedOperation()));
  } else {
    DrawDirectlyToCanvas(drawInfo, &bounds,
                         mgfx::Rect(dx, dy, dw, dh),
                         mgfx::Rect(sx, sy, sw, sh),
                         imgSize);
  }

  RedrawUser(gfxRect(dx, dy, dw, dh));
}

void
CanvasRenderingContext2D::DrawDirectlyToCanvas(
                          const nsLayoutUtils::DirectDrawInfo& image,
                          mgfx::Rect* bounds,
                          mgfx::Rect dest,
                          mgfx::Rect src,
                          gfx::IntSize imgSize)
{
  MOZ_ASSERT(src.width > 0 && src.height > 0,
             "Need positive source width and height");

  gfxMatrix contextMatrix;
  AdjustedTarget tempTarget(this, bounds->IsEmpty() ? nullptr: bounds);

  // Get any existing transforms on the context, including transformations used
  // for context shadow.
  if (tempTarget) {
    Matrix matrix = tempTarget->GetTransform();
    contextMatrix = gfxMatrix(matrix._11, matrix._12, matrix._21,
                              matrix._22, matrix._31, matrix._32);
  }
  gfxSize contextScale(contextMatrix.ScaleFactors(true));

  // Scale the dest rect to include the context scale.
  dest.Scale(contextScale.width, contextScale.height);

  // Scale the image size to the dest rect, and adjust the source rect to match.
  gfxSize scale(dest.width / src.width, dest.height / src.height);
  nsIntSize scaledImageSize(std::ceil(imgSize.width * scale.width),
                            std::ceil(imgSize.height * scale.height));
  src.Scale(scale.width, scale.height);

  // We're wrapping tempTarget's (our) DrawTarget here, so we need to restore
  // the matrix even though this is a temp gfxContext.
  AutoRestoreTransform autoRestoreTransform(mTarget);

  nsRefPtr<gfxContext> context = new gfxContext(tempTarget);
  context->SetMatrix(contextMatrix.
                       Scale(1.0 / contextScale.width,
                             1.0 / contextScale.height).
                       Translate(dest.x - src.x, dest.y - src.y));

  // FLAG_CLAMP is added for increased performance, since we never tile here.
  uint32_t modifiedFlags = image.mDrawingFlags | imgIContainer::FLAG_CLAMP;

  SVGImageContext svgContext(scaledImageSize, Nothing(), CurrentState().globalAlpha);

  auto result = image.mImgContainer->
    Draw(context, scaledImageSize,
         ImageRegion::Create(gfxRect(src.x, src.y, src.width, src.height)),
         image.mWhichFrame, GraphicsFilter::FILTER_GOOD,
         Some(svgContext), modifiedFlags);

  if (result != DrawResult::SUCCESS) {
    NS_WARNING("imgIContainer::Draw failed");
  }
}









//

static already_AddRefed<ImageData>
CreateImageData(JSContext* cx, CanvasRenderingContext2D* context,
                uint32_t w, uint32_t h, ErrorResult& error)
{
  if (w == 0)
      w = 1;
  if (h == 0)
      h = 1;

  CheckedInt<uint32_t> len = CheckedInt<uint32_t>(w) * h * 4;
  if (!len.isValid()) {
    error.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
    return nullptr;
  }

  // Create the fast typed array; it's initialized to 0 by default.
  JSObject* darray = Uint8ClampedArray::Create(cx, context, len.value());
  if (!darray) {
    error.Throw(NS_ERROR_OUT_OF_MEMORY);
    return nullptr;
  }

  nsRefPtr<mozilla::dom::ImageData> imageData =
    new mozilla::dom::ImageData(w, h, *darray);
  return imageData.forget();
}

already_AddRefed<ImageData>
CanvasRenderingContext2D::CreateImageData(JSContext* cx, double sw,
                                          double sh, ErrorResult& error)
{
  if (!sw || !sh) {
    error.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
    return nullptr;
  }

  int32_t wi = JS::ToInt32(sw);
  int32_t hi = JS::ToInt32(sh);

  uint32_t w = Abs(wi);
  uint32_t h = Abs(hi);
  return mozilla::dom::CreateImageData(cx, this, w, h, error);
}



static uint8_t g2DContextLayerUserData;


uint32_t
CanvasRenderingContext2D::SkiaGLTex() const
{
    MOZ_ASSERT(IsTargetValid());
    return (uint32_t)(uintptr_t)mTarget->GetNativeSurface(NativeSurfaceType::OPENGL_TEXTURE);
}

void CanvasRenderingContext2D::RemoveDrawObserver()
{
  if (mDrawObserver) {
    delete mDrawObserver;
    mDrawObserver = nullptr;
  }
}


already_AddRefed<CanvasLayer>
CanvasRenderingContext2D::GetCanvasLayer(nsDisplayListBuilder* aBuilder,
                                         CanvasLayer *aOldLayer,
                                         LayerManager *aManager)
{
  if (mOpaque) {
    // If we're opaque then make sure we have a surface so we paint black
    // instead of transparent.
    EnsureTarget();
  }

  // Don't call EnsureTarget() ... if there isn't already a surface, then
  // we have nothing to paint and there is no need to create a surface just
  // to paint nothing. Also, EnsureTarget() can cause creation of a persistent
  // layer manager which must NOT happen during a paint.
  if (!mTarget || !IsTargetValid()) {
    // No DidTransactionCallback will be received, so mark the context clean
    // now so future invalidations will be dispatched.
    MarkContextClean();
    return nullptr;
  }

  mTarget->Flush();

  if (!mResetLayer && aOldLayer) {
    CanvasRenderingContext2DUserData* userData =
      static_cast<CanvasRenderingContext2DUserData*>(
        aOldLayer->GetUserData(&g2DContextLayerUserData));

    CanvasLayer::Data data;

    GLuint skiaGLTex = SkiaGLTex();
    if (skiaGLTex) {
      SkiaGLGlue* glue = gfxPlatform::GetPlatform()->GetSkiaGLGlue();
      MOZ_ASSERT(glue);

      data.mGLContext = glue->GetGLContext();
      data.mFrontbufferGLTex = skiaGLTex;
    } else {
      data.mDrawTarget = mTarget;
    }

    if (userData && userData->IsForContext(this) && aOldLayer->IsDataValid(data)) {
      nsRefPtr<CanvasLayer> ret = aOldLayer;
      return ret.forget();
    }
  }

  nsRefPtr<CanvasLayer> canvasLayer = aManager->CreateCanvasLayer();
  if (!canvasLayer) {
    NS_WARNING("CreateCanvasLayer returned null!");
    // No DidTransactionCallback will be received, so mark the context clean
    // now so future invalidations will be dispatched.
    MarkContextClean();
    return nullptr;
  }
  CanvasRenderingContext2DUserData *userData = nullptr;
  // Make the layer tell us whenever a transaction finishes (including
  // the current transaction), so we can clear our invalidation state and
  // start invalidating again. We need to do this for all layers since
  // callers of DrawWindow may be expecting to receive normal invalidation
  // notifications after this paint.

  // The layer will be destroyed when we tear down the presentation
  // (at the latest), at which time this userData will be destroyed,
  // releasing the reference to the element.
  // The userData will receive DidTransactionCallbacks, which flush the
  // the invalidation state to indicate that the canvas is up to date.
  userData = new CanvasRenderingContext2DUserData(this);
  canvasLayer->SetDidTransactionCallback(
          CanvasRenderingContext2DUserData::DidTransactionCallback, userData);
  canvasLayer->SetUserData(&g2DContextLayerUserData, userData);

  CanvasLayer::Data data;

  canvasLayer->Initialize(data);
  uint32_t flags = mOpaque ? Layer::CONTENT_OPAQUE : 0;
  canvasLayer->SetContentFlags(flags);
  canvasLayer->Updated();

  mResetLayer = false;

  return canvasLayer.forget();
}

void
CanvasRenderingContext2D::MarkContextClean()
{
  if (mInvalidateCount > 0) {
    mPredictManyRedrawCalls = mInvalidateCount > kCanvasMaxInvalidateCount;
  }
  mIsEntireFrameInvalid = false;
  mInvalidateCount = 0;
}


bool
CanvasRenderingContext2D::ShouldForceInactiveLayer(LayerManager *aManager)
{
  return !aManager->CanUseCanvasLayerForSize(IntSize(mWidth, mHeight));
}

NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(CanvasPath, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(CanvasPath, Release)










TemporaryRef<gfx::Path>
CanvasPath::GetPath(const CanvasWindingRule& winding, const DrawTarget* aTarget) const
{
  FillRule fillRule = FillRule::FILL_WINDING;
  if (winding == CanvasWindingRule::Evenodd) {
    fillRule = FillRule::FILL_EVEN_ODD;
  }

  // retarget our backend if we're used with a different backend
  if (mPath->GetBackendType() != aTarget->GetBackendType()) {
    RefPtr<PathBuilder> tmpPathBuilder = aTarget->CreatePathBuilder(fillRule);
    mPath->StreamToSink(tmpPathBuilder);
    mPath = tmpPathBuilder->Finish();
  } else if (mPath->GetFillRule() != fillRule) {
    RefPtr<PathBuilder> tmpPathBuilder = mPath->CopyToBuilder(fillRule);
    mPath = tmpPathBuilder->Finish();
  }

  return mPath;
}

void
CanvasPath::EnsurePathBuilder() const
{
  if (mPathBuilder) {
    return;
  }

  // if there is not pathbuilder, there must be a path
  MOZ_ASSERT(mPath);
  mPathBuilder = mPath->CopyToBuilder();
  mPath = nullptr;
}

}
}


// this should reproduce the crash:
// /home/jrmuizel/src/creduce/creduce/../clang_delta/clang_delta --transformation=replace-function-def-with-decl --counter=1 /tmp/crash/clang_delta_crash_tmp_filerYyCh6.cpp